Approximate symmetries and quantum error correction

Quantum error correction (QEC) is a key concept in quantum computation as well as many areas of physics. There are fundamental tensions between continuous symmetries and QEC. One vital situation is unfolded by the Eastin--Knill theorem, which forbids the existence of QEC codes that admit transversal continuous symmetry actions (transformations). Here, we systematically study the competition between continuous symmetries and QEC in a quantitative manner. We first define a series of meaningful measures of approximate symmetries motivated from different perspectives, and then establish a series of trade-off bounds between them and QEC accuracy utilizing multiple different methods. Remarkably, the results allow us to derive general quantitative limitations of transversally implementable logical gates, an important topic in fault-tolerant quantum computation. As concrete examples, we showcase two explicit types of quantum codes, obtained from quantum Reed--Muller codes and thermodynamic codes, respectively, that nearly saturate our bounds. Finally, we discuss several potential applications of our results in physics.


Introduction
Symmetry has long been a pivotal concept and tool in physics.Continuous symmetries are those described by transformations that vary continuously as a function of some parameterization, mathematically modeled by Lie groups.Associated with conservation laws as dictated by the celebrated Noether's theorem 1 , continuous symmetries ubiquitously arise in physical systems and play fundamental roles in their behaviors.A basic, prototypical example of a continuous symmetry group is U (1), coming with a conserved quantity that may correspond to charge, particle number, energy, etc., depending on the physical scenario.
A phenomenon that has drawn significant interest lately is that continuous symmetries can induce fundamental limitations on quantum error correction (QEC) 2,3 , a cornerstone of quantum technologies which was initially introduced as a technique to protect quantum information [4][5][6][7] and has since been found to play fundamental roles in many areas in physics including quantum gravity 8,9 and condensed matter physics [10][11][12][13] .An early result is the Eastin-Knill theorem 3 which, in a quantum computation language, says that if a (finite-dimensional) quantum code implements any continuous group of gates transversally (see Fig. 1 for an illustration), it cannot exactly correct local errors.It is worth noting that the transversality property is not only important in quantum computation since transversal gates are particularly desirable for fault tolerance, but also widely so in physics as a fundamental feature of internal symmetries in many-body scenarios.Further, there has been a series of recent works that consider approximate QEC by covariant codes, providing bounds on the accuracy as well as explicit constructions [14][15][16][17][18][19][20][21][22] .Viewing the gates as symmetry actions, these results indicate that the QEC accuracy of a code admitting transversal continuous symmetries is necessarily restricted to some extent.Such codes are called covariant codes in the literature 2,14,15 .Besides the direct relevance to quantum computation, covariant codes have intriguing connections to wide-ranging disciplines in physics including condensed matter physics 12,13,16 , holography 14,15,[23][24][25] , and quantum information 2,15,22 .
As certain forms of invariance under transformations, symmetries are by definition exact.The existing works on QEC with symmetries 2, 14-22 indeed focused on the QEC performance of exactly covariant codes.However, it is often useful or even necessary to consider approximate forms of symmetries or conservation laws, especially in quantum physics.For instance, noise effects and imperfections that are common in realistic scenarios can cause deviations from the exact symmetry conditions.There are various more fundamental symmetry breaking mechanisms including spontaneous symmetry breaking, anomalies, and nonrenormalizable effects 26 .Remarkably, the inexactness of symmetries plays a significant role in our understanding of wide-ranging aspects of fundamental physics.In particle physics, many fundamental symmetries are known to be only approximate 27 .In fact, it is commonly believed that global symmetries cannot be exact in a unified theory of quantum mechanics and gravity [27][28][29][30][31][32] .Notably, one modern argument justifying the belief in more concrete terms in AdS/CFT is closely related to covariant codes 14,23,24 .Despite the importance of approximate symmetries, our understanding of them, especially on a quantitative level, is quite limited and unsystematic, raising the need for a general theory of symmetry violation measures.In particular, for QEC and associated problems in physics, it is imperative that we quantitatively understand how symmetry violation is induced by QEC accuracy, which represents a theory of the emergence of approximate symmetries.
In this work, we introduce a variety of approximate continuous symmetry measures in quantum channels and codes, and furthermore, establish a comprehensive theory of the competition between them and QEC accuracy for the most fundamental U (1) case.More specifically, we introduce three different meaningful measures of the degree of symmetry violation in terms of group-global and group-local covariance violation respectively, and charge conservation violation, which correspondingly induce different quantitative notions of approximately covariant codes.We then derive a series of trade-off relations between the QEC inaccuracy and the above approximate symmetry measures under a general condition called Hamiltonian-in-Kraus-span (HKS) condition which subsumes transversality in our setup, by employing various techniques and ideas from approximate QEC 33,34 , quantum metrology [35][36][37] and quantum resource theory [38][39][40][41] .In particular, our results indicate various forms of lower bounds on the symmetry violation of QEC codes, which imply universal fine-grained restrictions on the transversally implementable gates, improving the Eastin-Knill theorem.To exemplify the general theory, we present two explicit families of approximately covariant codes that nearly saturate certain lower bounds.In the end, we provide a blueprint for several potential applications in quantum gravity and condensed matter physics.
The main goal of this paper is to elucidate the intuitions behind our approaches and report the most representative results.We refer interested readers to the Supplementary Information 42 , which can be read independently as an extended companion paper gearing more towards the technical audience.All technical details, additional results, and more extensive discussions can be found in it.

Results
Quantitatively characterizing approximate symmetries.We first introduce, from a general standpoint, three physically motivated types of quantitative measures of the symmetry violation of quantum systems.
Let G be a compact Lie group corresponding to the continuous symmetry of interest.Denote by E B←A a quantum channel from system A to system B. The channel exactly respects symmetry G if it is covariant with respect to the group actions, i.e., or equivalently where we use U(•) := U (•)U † to denote the channel action of unitary U , and U g is determined by the unitary representation of G under consideration (on the appropriate system).
To characterize the deviation from the exact symmetry, it is natural to consider the mismatch between the two sides of the covariance condition.Then an intuitive overall measure is the maximum mismatch overall the entire group as given by some channel distance D, which we call group-global covariance violation: ( Note that we may not explicitly write down the arguments of the measures when they are unambiguous.
Another important notion is the symmetry violation around a certain point g 0 in the group at which the covariance condition Here we are interested in the local geometry of the mismatch around this point.Without loss of generality, we assume g 0 = 1, because for an arbitrary g 0 , we can always redefine the quantum channel to be U A,g0 •E B←A .
Let the symmetry actions be parametrized by θ = {θ k } ∈ R K via some unitary representation U g = e −iJ•θ where J = {J k } are infinitesimal generators of G.For all k = 1, . . ., K, we define the group-local (point) covariance violation as where ∂ 2 θ D 2 denotes the second-order derivative of D 2 with respect to θ k .The square root and the coefficient √ 2 in the definition are chosen to simplify calculations, as will be seen later on.It is worth noting that this notion is closely connected to local parameter estimation, which is a standard setup in metrology, as will be further discussed.
Lastly, it is natural to consider the deviation from conservation laws.Specifically, each generator J k is associated with a charge, and we can quantify the variation of the charge for input state ρ by where J k,A and J k,B are the generators on systems A and B, respectively, so the trace gives the expectation value of the associated charge.Then overall measures can be defined based on e.g.maximization over ρ.Note that δcharge is not necessarily zero for covariant encoding channel E, except when E is isometric, which is the standard in QEC scenarios 43 .
Since δlocal and δcharge only depend on the local geometry of the symmetry group, we shall collectively call them local symmetry measures.As will become evident, these three measures are inequivalent and their behaviors should be understood independently; notably, δglobal is a unitless measure with range [0, 1], in contrast to δlocal and δcharge .
QEC setting: code accuracy and symmetry.Now we describe the QEC setup and in particular, formally define the QEC (in)accuracy and symmetry measures associated with a quantum code (as an application of the general measures introduced above) that will be considered.
In this work, we mainly consider a type of distance measure based on the purified distance, which is particularly well behaved and of broad importance in quantum information.More specifically, the state purified distance is given by where f (ρ, σ) := Tr( ρ 1/2 σρ 1/2 ) is the fidelity, based on which one can define the channel purified distance [44][45][46] as In principle, one may also consider other metrics.In Secs.II and VII of Ref. 42 , we also discuss the situations where one uses e.g. the diamond norm distance 47 , which is another standard channel distance measure.Additionally, the purified distance is equal to the Bures distance defined by 2(1 − f (ρ, σ)) up to the leading order when f ≈ 1 or the distance is small, a quantity used to study approximate QEC before 34 .The choice of purified distance directly relates the local covariance violation to the quantum Fisher information (QFI) [48][49][50][51] , which is a central notion in quantum metrology as a standard quantifier of the amount of information a parametrized quantum state ρ θ carries about the parameter θ locally.Note that the QFI we use here is conventionally called the symmetric logarithmic derivative (SLD) QFI, while there are other types of QFIs, e.g., the right logarithmic derivative (RLD) QFI [52][53][54] which we will encounter in Methods.
A quantum code is defined by an encoding channel E S←L , which is a map from a logical system L to a physical system S.The physical system may be subject to a noise channel N S .Ideally, if we can find a recovery (decoding) channel R L←S that achieves where 1 L denotes the logical identity channel, indicating that the QEC procedure essentially removes the noise effects so that the logical information is perfectly recovered, we say the code achieves exact QEC or is an QEC code.For general codes, there may not exist a recovery channel that satisfies Eq. ( 7), meaning that QEC cannot be done perfectly.Naturally, we characterize the QEC inaccuracy by ε := min that quantifies the minimum deviation from perfect information recovery.
We now consider symmetry in the QEC setting.Here the encoding E S←L is the channel of interest in the last section, and the symmetry acts on its input and output systems, namely the logical system L and the physical system S. From here on, we shall base our discussion on U (1) symmetry, which is of fundamental importance in itself and nicely reveals the key phenomena.Specifically, consider the family of logical gates U L,θ = e −iH L θ for every θ ∈ R, implemented by physical gates U S,θ = e −iH S θ for every θ ∈ R, which are U (1) representations on L and S generated by non-trivial Hamiltonians (symmetry generators) H L and H S , respectively (note that they should not be confused with the intrinsic Hamiltonians of the systems).

Suppose the Kraus decomposition of the noise channel is given by N
where K S,i are the Kraus operators.A sufficient condition for the non-existence of exactly covariant QEC codes, or in other words, the incompatibility between exact symmetry and QEC, is which will be referred to as the 'Hamiltonian-in-Kraus-span' (HKS) condition 18 .Note that although the HKS condition is defined using Kraus operators, it is just a function of the noise channel, because different Kraus representations of a channel will give the same Kraus span.An important scenario obeying the HKS condition that can be regarded a prototypical case of our theory is when H S is 1-local and N S is any single-qubit noise with a full Kraus span.This includes erasure, depolarizing, and amplitude damping noises 55 .The 1-local property means that each term in H S acts nontrivially only on one subsystem and corresponds to the transversality of U S,θ (illustrated in Fig. 1).As motivated earlier, this transversality property is crucial to practical quantum computing since transversal gates are fault-tolerant.Moreover, it is broadly important in physical contexts, where one normally considers global internal symmetries generated by sums of disjoint local charge observables, in particular on-site (transversal with respect to sites) symmetries; a typical example is U (1) generated by the Hamming-weight-type charge observable.Note that whether the symmetries are on-site is linked to whether they can be gauged or are anomaly-free, which plays important roles in the physics of quantum many-body systems and field theories 56 .Transversality also plays fundamental roles in AdS/CFT 23,57,58 .
It is worth noting that, when the HKS condition fails, examples of exactly covariant QEC codes exist, for instance, when N S = 1 (unitary dynamics), when H S is a Pauli-X operator and N S is a dephasing noise 59,60 , and when H S is 2-local and N S is a singleerasure noise 61 .We will assume the HKS condition holds from now on and study the consequent competition between QEC and covariance.
Finally, we formally define the three quantitative measures of code symmetry (violation) that we shall consider, obtained by applying the general ideas from the last section to our setup where the symmetry group is U (1). i) Group-global covariance violation: Directly following the general definition, we consider δ global = 0 if and only if the code is exactly covariant.
ii) Group-local covariance violation, in the vicinity of a certain θ 0 where the code is exactly covariant (as explained, we assume θ 0 = 0 without loss of generality): For our setting, by letting D be the channel purified distance in δlocal we obtain where 62 , in which is the conventional state QFI [48][49][50][51]63 . (Not that it is standard to take the infinitesimal form of a distance function to define a measure of local sensitivity.Different definitions of QFI will be induced by different distance functions, e.g., the Wigner-Yanase skew information is induced by the Hellinger distance 64 .However, we will focus only on the purified distance and the above definition of group-local covariance violation in this work.) iii) Charge conservation violation: Recall that the logical and physical charge observables are, Hermitian operators H L and H S respectively.As mentioned, isometric covariant channels are always charge-conserving, i.e., satisfying H L − ν1 = (E S←L ) † (H S ) (up to some constant offset ν which does not affect the U (1) group representations) where (E S←L ) † is the dual of the encoding channel 14 that maps from S to L (the subscript L ← S is omitted for simplicity of notation).Here we directly consider where ∆(H) denotes the difference between the maximum and minimum eigenvalues of a Hermitian operator H, or equivalently, In what follows, we will refer to 'group-global' and 'group-local' as 'global' and 'local' respectively for simplicity as is common in e.g.estimation theory, which should be distinguished from the geometric notions commonly used in physical contexts.The remarks on the general measures at the end of the last section still apply here.
Symmetry vs. QEC.We now present our main results-general joint bounds of the QEC accuracy and approximate symmetry measures of a code-which reveal fundamental trade-offs between them under the HKS condition (see Fig. 2 for an illustration).Detailed proofs and further results can be found in Secs.III and IV of Ref. 42 .When expressing the results, by 'x > ∼ y' we mean x ≥ ℓ(y) for some ℓ(y) that is equivalent to y asymptotically (i.e., lim y→0 + ℓ(y)/y = 1).
We first discuss the global symmetry violation δ global .Using different approaches that will be explained, we prove the following two results: where J(N S , H S ) := min h: where h is an arbitrary Hermitian matrix.
Theorem 1 and Theorem 2 both demonstrate the robust trade-off between ε and δ global ; specifically, they give non-trivial lower bounds on ε for sufficiently small δ global and vice versa.Here, both J and F are positive functions of the noise channel N S and the physical charge Hamiltonian H S (different Kraus representations of a noise channel do not induce different values of J and F.).Note that the definition of J has a close connection to the HKS condition; F equals the regularized channel QFI of the noisy physical gate 36,37 ).The above results can be broadly applied to different noise and charge settings simply by analyzing J and F, which are efficiently computable using semidefinite programming (see details Secs.III and IV of Ref. 42 ).
To be more concrete, we now discuss the specific scaling behaviors of the above general bounds (see Table 1) .Consider quantum codes on an n-partite system with 1-local H S corresponding to transversal symmetry action (such that ∆H S = O(n) and ∆H L = O(1)).Consider the following important practical noise models: i) single-erasure noise, defined by N S (•) = √ n) lower bound on δ global for sufficiently small ε; but for sufficiently small δ global , Theorem 2 gives a Ω(1/ √ n) lower bound on ε, which is tighter than Ω(1/n) given by Theorem 1.To sum up, we see that our two bounds can behave differently and complement each other in different important settings.Note that, these lower bounds grow inverse-polynomially with n while the system dimension is exponentially large.That means errors in systems can easily become intolerable in a linear or a square-root size of circuits of n qudits, demonstrating the strong competition between QEC and continuous symmetries.The above discussions can be extended to general noise models, e.g., single-depolarizing noise acts on each subsystem with different probabilities, and the exact values of the lower bounds can be analytically calculated (see discussions in Sec.III of Ref. 42 ).
We now explain the main ideas behind the derivation of Theorem 1 and Theorem 2. The full proofs can be found in Secs.III and IV of Ref. 42 .In particular, each of the two results builds upon a meaningful quantity we introduce associated with a code and the symmetry, which may be of independent interest.Theorem 1 comes from a notion that we call charge fluctuation, defined by where |0 L ⟩ and |1 L ⟩ are eigenstates of H L corresponding to the largest and the smallest eigenvalues, respectively.For intuition, consider the following extremes.For exact QEC codes, it is straightforward to see that χ = 0: the Knill-Laflamme conditions 33 indicate that ΠK † S,i K S,j Π ∝ Π for all i, j where Π is the projection onto the code subspace, so then since H S can be written as a linear combination of K † S,i K S,j due to the HKS condition, we have That is, the value of χ characterizes the degree of deviation from Knill-Laflamme conditions.On the other hand, for exactly covariant codes, we have χ = ∆H L because (E S←L ) † (H S ) = H L − ν1 for some ν ∈ R 14 .More generally, for approximately QEC or covariant codes, ε (or δ global ) can be lower bounded using the distance between χ and 0 (or ∆H L ).Indeed, Theorem 1 is established by combining the following two inequalities for isometric encoding channels, where Eq. ( 18) is derived from the approximate Knill-Laflamme conditions 34 , and Eq. ( 19) follows from the definition of δ global .
Theorem 2 is derived from another notion that we call gate implementation error, defined by which quantifies the error of implementing an ideal set of logical gates U L,θ using the error-corrected noisy gates The gate implementation error unifies QEC accuracy and symmetry in a sense: it can be proven that putting ε and δ global on the same footing.A crucial observation here is that these quantities can be understood from a quantum metrology (channel estimation) perspective: intuitively, smaller error goes hand in hand with higher sensitivity of parameter estimation under noise.This allows us to make use of quantum metrology and QFI techniques to analyze γ.Specifically, we show that which implies Theorem 2. We include in the Methods section further explanations and details of the quantum metrology method.
Furthermore, using quantum resource theory methods, we can derive different versions of Theorem 2 which, in particular, give results on the average-case behavior over different input states, in addition to the worst-case results discussed above.Again, see Methods and Sec.IV of Ref. 42 for further explanations and details of the quantum resource theory method.
For the local symmetry measures δ local and δ charge , we establish the following trade-off bounds which are also expressed in terms of the general, efficiently computable quantities J and F that encode the noise and charge Hamiltonian: where J(N S , H S ) := min h:H S = ij hij K † S,i K S,j ∆h, h is an arbitrary Hermitian matrix.
where F(N S , H S ) := 4 min h: h is an arbitrary Hermitian matrix.
Again, Theorem 3 and Theorem 4 indicate trade-offs between ε and δ local (or δ charge ), and set non-trivial lower bounds on ε for sufficiently small δ local (or δ charge ) and vice versa.The proof of Theorem 3 uses Eq. ( 18) and the following inequalities for isometric encoding channels: which follows from the definitions, and a simple relation between δ local and δ charge , Similar to Theorem 2, Theorem 4 is derived using quantum metrology for quantum channel techniques.See also Methods and Sec.VI of Ref. 42 for explanations and details.
Note that δ local and δ charge have the same units as the Hamiltonians and may naturally be superconstant (in contrast to δ global which is always no larger than one).For example, consider the trivial encoding where L = S and E S←L = 1.Then we have for an n-partite system with 1-local H S such that ∆H S = O(n) and ∆H L = O(1), implying that a constant scaling of δ local or δ charge still requires non-trivial code structures.
Discussions on further refinements of Theorem 1 and Theorem 3 using quantum metrology techniques, as well as remarks on non-compact groups and infinite-dimensional codes, can be found in Appx.D and Sec.II of Ref. 42 .
When setting δ global = δ local = 0, our theorems recover previous results on exactly covariant codes 14,15,[17][18][19] .The results and methods here apply to general quantum codes beyond exactly covariant codes.In particular, they enable us to quantitatively understand the symmetry restrictions on exact QEC codes which are of utmost interest.In the following section, we demonstrate a particularly important application of our symmetry bounds for QEC codes.
General limitations on transversal gates.As motivated earlier, transversal gates or symmetry actions are of central importance to fault-tolerant quantum computing and also widely important in physical contexts.Recall that our theory indicates non-trivial bounds for symmetry under the HKS condition, like transversal symmetry.Remarkably, by analyzing such bounds, we are able to prove the following fundamental restriction on the set of transversal logical gates for general QEC codes, which refines the Eastin-Knill theorem: Corollary 5. Suppose an n-qudit QEC code with distance at least 2 admits a transversal implementation V S = n l=1 e −i2πT S l /D of the logical gate V L = e −i2πT L /D where D is a positive integer and T L,S are Hermitian operators with integer eigenvalues.Then D is at most Intuitively, D characterizes the precision or density of the gates.A key insight behind Corollary 5 is that in the D → ∞ limit, the code becomes arbitrarily close to an exactly covariant code, which is in conflict with the incompatibility between QEC and continuous symmetries.Further, we obtain the upper bound on D by transforming the lower bound on δ global obtained by applying Theorem 1 to exact QEC codes (setting ε = 0) with H S = n l=1 T S l and H L = T L (see Sec. V of Ref. 42 ).
As a standard example, consider the Pauli-Z rotation corresponding to T L = Z L , T S l = −Z l ; that is, D characterizes the precision of the Pauli-Z rotation.Our Corollary 5 gives the upper bound D = O(n 3/2 ).On the achievability side, there exists a set of 65 (which will be further discussed later) such that the logical Pauli-Z rotation is implemented by transversal physical gate V S = n l=1 e iπZ l /2 t−1 , i.e., achieves D = 2 t = Ω(n), which is polynomially close to our upper bound O(n 3/2 ).
For stabilizer codes, Corollary 5 implies that ṼS = n l=1 e −i2πa l Z l /D where a l is an integer and D is a power of two (which is the most general form of transversal logical gates up to local Clifford equivalences 66,67 ) can only implement logical gates up to the O(log n)-th level of the Clifford hierarchy when a l = O(poly(n)) (see Sec. V of Ref. 42 ), which can be attained by the aforementioned quantum Reed-Muller codes.Note that several similar bounds [66][67][68][69][70] were known for stabilizer codes.A key point of our results is that such restrictions fundamentally stem from symmetry principles and hold generally for arbitrary codes, meaning that the stabilizer structure is not essential here.We remark that there are ways to circumvent the Eastin-Knill theorem and the above limitations that involves more complex QEC procedures such as code switching 71 and magic state injection 72,73 .
Concrete code examples.We now discuss two specific families of quantum codes that exhibit important approximate covariance features and also provide evidence of the tightness of our bounds (more details in Sec.VII of Ref. 42 ).
The first example we give is a family of exact QEC codes that are approximately covariant.Specifically, let us consider the 65 .The codewords are |x⟩ , (28) where we use x to denote n-bit strings (0 and 1 are all zero and all one strings, respectively) and R(1, t) is the classical shortened Reed-Muller code 74 .Note that all strings in R(1, t)\{0} have weight 2 t−1 .Consider the single-erasure noise which is exactly correctable, namely, ε = 0.As mentioned above, the code admits a transversal implementation l e iπZ l /2 t−1 of the logical operator e −iπZ L /2 t−1 (here the symmetry is defined by Intuitively, the larger t or n (associated with the precision of transversal gates) is, the closer the code is to being covariant.Indeed, calculations indicate that δ global ≃ 4/n for large n ('≃' indicates equivalence at the leading order), saturating our lower bound δ global > ∼ 1/n up to a constant factor.We see that δ global nicely captures the relation between global gate precision and the closeness to covariance, leading to results like Corollary 5.As for the local symmetry measures, we find that here δ local = √ n + 1 for all θ = 4kπ n+1 (∀k ∈ Z) at which the code is exactly covariant, having a gap with its constant lower bound δ local > ∼ 1, and δ charge = 1, exactly matching the lower bound δ charge ≥ 1.
In the second example, we construct a parametrized family of codes that exhibits a smooth transition from exact covariance to exact QEC, which we call modified thermodynamic code, based on the previously studied thermodynamic code 12,14 .Our modified thermodynamic code is an n-qubit 2-dimensional quantum code defined on a spin chain with Hamiltonian H S = − 1 2 n l=1 Z l given by codewords where q is a tunable parameter in [0, 1] and it is assumed that m + n is an even number with 2 ≤ m ≪ n, and |l n ⟩ are Dicke states, i.e., symmetric eigenstates of H S , satisfying H S |l n ⟩ = l 2 |l n ⟩.To understand the code, let us now consider different values of q.When q = 0, the code reduces to the thermodynamic code 12,14 , which is exactly covariant with respect to H L = m 2 Z L , due to the fact that the codewords are eigenstates of H S with eigenvalues ± m 2 .When q = 1, the code satisfies the Knill-Laflamme conditions and is exactly error-correcting under the single-erasure noise.When q is taken in between 0 and 1, the code interpolates between the above two extreme cases.Here, we find that δ global ≃ 4qm/n and ε ≃ (1 − q)m/2n, saturating the scaling of their lower bounds δ global > ∼ qm/n and ε > ∼ (1 − 4q)m/2n, respectively.As for the local symmetry measures, we find that δ local ≃ √ qmn for all θ = 4kπ n+m (∀k ∈ Z) at which the code is exactly covariant, having a gap with its lower bound δ local > ∼ qm, and δ charge = qm, exactly matching the lower bound δ charge > ∼ qm.In conclusion, both examples achieve the optimal scalings of δ global and δ charge .
Potential applications to physics.Here we point out a few important areas in physics where our theory is potentially useful.
First, we expect our study to lead to new quantitative insights into the crucial symmetry problem in quantum gravity (see e.g., 23,[28][29][30][31][32]75 ), through the following lenses: i) Holography and AdS/CFT correspondence: AdS/CFT is known to have fundamental connections with QEC 8,9 and indeed, the no-global-symmetry arguments of Harlow and Ooguri 23,24 is underpinned by insights from QEC. Inparticular, for the continuous symmetry case, the situation becomes largely equivalent to Eastin-Knill (due to the transversality deduced from inherent properties of AdS/CFT 8,14,23,24,57 ), indicating that our theory can potentially be used to establish quantitative statements about the breaking of global symmetries in AdS/CFT.
ii) Black hole evaporation: A standard no-global-symmetry argument is based on certain inconsistencies between the evaporation and charge conservation of charged black holes 32 (note that the weak gravity conjectures 31,76 are closely relevant).
Our results may be applied to symmetric versions of Hayden-Preskill model of black hole evaporation as the model can be formulated in terms of QEC (see also 21,[77][78][79] ), through which new insights on charged black hole evaporation may be obtained.
In these scenarios, our theory can potentially be used to derive interesting quantitative bounds on the magnitude of symmetryviolating effects (operators, terms, modes, etc.).Note that there are some recent field or string theory calculations on approximate symmetries in quantum gravity [80][81][82] and it could be intriguing to draw comparisons with our quantum information results.
Furthermore, QEC and symmetries naturally arise together in various key areas in many-body physics like topological phases of matter 11,[83][84][85][86][87][88][89][90] and information scrambling 21,22,77,[91][92][93][94][95][96][97] , where the interplay between them is expected to find interesting applications.To be more specific, note first that the notions of many-body entanglement, topological and quantum order, and QEC are intimately connected 11,83,85,86,90 ; besides, as mentioned above, the violation of symmetry conditions is important in realistic systems and in particular, goes hand in hand with anomalies, which play fundamental roles in the physics of quantum systems in various ways.Our study potentially provides a powerful framework for establishing rigorous connections among these important concepts.

Discussion
In this work, we developed a systematic quantitative theory of the interplay between continuous symmetries and QEC by introducing several notions of approximate symmetry measures based on both global and local symmetry violation and analyzing QEC accuracy together with them in quantum codes.A key message is that the degree of symmetry (in multiple senses) and optimal QEC accuracy of a code are concurrently limited by trade-off relations between them, which has interesting implications in quantum computation and physics.
We point out a few directions that are worth further study.First, it would be interesting to further understand whether the two trade-off relations between global symmetry and QEC, which exhibit different behaviours under different noise models, can be unified.Another natural future task is to extend our study to more general continuous symmetry groups including non-Abelian ones with multiple non-commuting charges, in particular, SU (d) symmetry, which will complete the understanding of the limitations on the ability to perform universal quantum computation using transversal gates.More involved representation theory machinery is expected to be useful 14,22 in the SU (d) extension.Discrete symmetries are also important and worth further exploringalthough they are not as fundamentally incompatible with QEC as continuous symmetries 2 , there exist important scenarios where the incompatibility arises from simple additional constraints (e.g., AdS/CFT codes 14,23,24 )-it would be interesting to have a more systematic understanding of the discrete symmetry case (note that this paper readily implies some results).Finally, in the last section we pointed to a few potentially relevant physical problems.It would be worthwhile to further consolidate these connections in physics languages, which would enrich the interaction between quantum information and physics and open new doors for both.

Methods
We employed methods and techniques native to the fields of quantum metrology and quantum resource theory in our derivation, which we overview here (further details can be found in Secs.III and IV of Ref. 42 ).
Quantum metrology method.First, we describe the quantum metrology method used in the proofs of Theorem 2 and Theorem 4.
As introduced in the main text, we consider the regularized channel QFI 36,37 of the noisy physical gate N S,θ := N S • U S,θ which is a function of N S and H S only.We have where F (•) is the channel QFI given by F (Φ θ ) = max ρ F ((Φ θ ⊗ 1)(ρ)) 62 .The goal is to relate it with the error quantities.
The regularized channel QFI possesses the following useful properties: i) Monotonicity: for arbitrary Φ θ and Φ 1,2 independent of θ, it holds that It indicates that any type of parameter-independent superchannel, including quantum error correction, cannot increase the value of the regularized channel QFI; ii) F ∞ (N S,θ ) ≥ 0, and F ∞ (N S,θ ) = +∞ if and only if the HKS condition is violated.As a result, when the HKS condition is satisfied as we assume, there do not exist encoding and decoding channels E S←L and R L←S such that because F ∞ (U L,θ ) = +∞ while F ∞ (N S,θ ) < +∞, so Eq. ( 34) is forbidden by the monotonicity property.
In order to derive the results, consider an error-corrected noise channel Here, we introduce an ancillary qubit system A and a logical qubit system C, and consider specifically the encoding and decoding channels where E S←L is the quantum code under study, E rep LA←C is the repetition code E rep LA←C (|i C ⟩) = |i C i A ⟩ for i = 0, 1, and R rep LA←C is the decoding channel that perfectly corrects bit-flip errors on L. We show that for any R L←S , N C,θ is a rotated dephasing channel on C satisfying for all i, j = 0, 1 and some complex number ξ θ (the angle of ξ θ indicates the angle of Pauli-Z rotation and the magnitude of ξ θ indicates the dephasing rate).The regularized channel QFI of the rotated dephasing channel is given by where |∂ θ ξ θ | characterizes the strength of the signal and 1 − |ξ θ | 2 characterizes the strength of the dephasing noise; that is, ) can be handwavily understood as the square of the signal-to-noise ratio.By some calculations based on Eq. ( 38), we obtain (for Now note that by the monotonicity of the regularized channel QFI, we have By combining Eq. ( 42) and Eq. ( 40), we obtain Eq. ( 22), namely F > ∼ (∆H L ) 2 /(4γ 2 ), which implies Theorem 2; and by combining Eq. ( 42) and Eq. ( 41), we obtain Eq. ( 24) (Theorem 4), namely ε > ∼ (∆H L − δ local )/ √ 4F.
Quantum resource theory method.Here we introduce a different line of thought, which draws ideas and methods from another active field, namely quantum resource theory.More specifically, inspired by the no-purification theories [39][40][41] , we can bound the QEC inaccuracy and the global covariance violation jointly using the monotonicity of suitable asymmetry measures.
In particular, while the theorems introduced in the main text are worst-case (with respect to all input states) results, the resource theory method allows us to obtain average-case results.Specifically, we show that assuming that N S commutes with U S,θ .Here ε and δ global are, respectively, what we call the Choi QEC inaccuracy and Choi global covariance violation defined by where ) as the input state, is the Choi purified distance.The Choi measures capture the average-case behaviors in the sense that they are closely related to the uniform averages over all pure input states given by integration over the Haar measure 44,98,99 .Furthermore, F R (N S,θ ) is the right logarithmic derivative (RLD) channel QFI 53 defined by where the RLD state QFI 52 , and +∞ otherwise.
In order to prove Eq. ( 43), we use a resource theory of asymmetry 39 where the free (incoherent) states are quantum states that commute with the Hamiltonian and the free (covariant) operations C L←S are quantum operations that commutes with the symmetry actions, namely satisfying Here the RLD QFI induces a resource monotone: It can be easily seen that it is infinite for pure coherent states.
The intuition goes as follows.First, we prove that there always exists a covariant recovery channel R cov L←S that can achieve QEC inaccuracy ε cov = min assuming N S commutes with U S,θ .This is done by construction: we show that a variant of an optimal recovery channel achieving ε, obtained by a suitable twirling action over the symmetry group (which implies that the channel is covariant), satisfies Eq. ( 47).The monotonicity of the resource monotone indicates that where i=1 |i L ⟩ |i R ⟩ is a maximally entanglement state between the logical system L and a reference system R.The left-hand side is no larger than the RLD channel QFI F R (N S,θ ) due to the definition of the channel QFI.Notice that the right-hand side tends to infinity when R cov L←S • N S • E S←L tends to the identity channel due to the property that F R (ρ, H) is infinite for pure coherent states.By a more detailed analysis, we can show that which links ε cov with the resource measures.Combining Eq. ( 49), Eq. ( 50) and Eq. ( 51) , we obtain Eq. (43).
Following an analogous argument, a trade-off relation between the worst-case ε and δ global (which turns out to be weaker than Theorem 2; see Sec.IV of Ref. 42 for details) can also be derived using the quantum resource theory method.
Data Availability There is no data in this paper.

Logical
Table 1: Scalings of our lower bounds on ε and δ for different noise models (see details in Secs.III and IV of Ref. 42 ).Random local noise means noise that acts locally on randomly selected different subsystems, while independent noise means noise that acts independently on all subsystems (which is a mixture of global noises).The lower bounds are taken from both Theorem 1 and Theorem 2.Here when we show the lower bound on ε (or δ), we assume δ (or ε) is sufficiently small, i.e., so small that the lower bound on ε (or δ) has the worst scaling.There is a gap between the lower bound on δ from Theorem 1 and Theorem 2 for random local noise and a gap between the lower bounds on ε from Theorem 1 and Theorem 2 for independent noise.A potential way to close up the latter one was explored in Sec.III B2 of Ref. 42 , where the charge fluctuation approach is used to derive a new trade-off relation using quantum metrology.

(
For simplicity of notation ∆H is used interchageably with ∆(H).)δ charge is a close variant of the general δcharge .It can be verified that δ charge = 2 min ν∈R max ρ |Tr(H S E S←L (ρ)) − Tr((H L − ν1)ρ)|, where we allow a constant offset on the definitions of charges.

S
(•) = |∅⟩ ⟨∅| S l ⊗ Tr S l (•) represents the complete erasure on the l-th subsystem with other subsystems unaffected (we use |∅⟩ to denote the vacuum state).In this case we have J = O(n) and F = O(n 2 ).Then both Theorem 1 and Theorem 2 give a Ω(1/n) lower bound on ε for sufficiently small δ global ; but for sufficiently small ε, Theorem 1 gives a Ω(1/ √ n) lower bound on δ global , which is tighter than Ω(1/n) given by Theorem 2. ii) i.i.d.erasure noise, defined by N S (•) = n l=1 N S l where N S l (•) = (1 − p e )(•) S l + p e |∅⟩ ⟨∅| S l Tr S l (•) represents a local erasure on the l-th subsystem and p e is the noise rate.In this case we have J = O(n) and F = O(n).Then both Theorem 1 and Theorem 2 give a Ω(1/

Figure 1 :
Figure1: An illustration of the transversality property.The logical gate (orange) is transversal in the sense that it is implemented by physical gates with tensor product forms, i.e., acting on individual physical subsystems (yellow).Transversal gates are desirable for fault tolerance because they do not spread errors within code blocks.In our context, the gates represent symmetry actions so transversality signifies the product property of the symmetry representations on the physical system.

Figure 2 :
Figure 2: Measuring approximate QEC and approximate symmetry.We study the trade-off between QEC inaccuracy (the deviation of the QEC procedure from the logical identity channel, as shown in the left panel) and symmetry violation (the deviation of the encoding map from being covariant with respect to symmetry actions, as shown in the right panel).