Quantum Error-Detection at Low Energies

Motivated by the close relationship between quantum error-correction, topological order, the holographic AdS/CFT duality, and tensor networks, we initiate the study of approximate quantum error-detecting codes in matrix product states (MPS). We first show that using open-boundary MPS to define boundary to bulk encoding maps yields at most constant distance error-detecting codes. These are degenerate ground spaces of gapped local Hamiltonians. To get around this no-go result, we consider excited states, i.e., we use the excitation ansatz to construct encoding maps: these yield error-detecting codes with distance $\Omega(n^{1-\nu})$ for any $\nu\in (0,1)$ and $\Omega(\log n)$ encoded qubits. This shows that gapped systems contain $-$ within isolated energy bands $-$ error-detecting codes spanned by momentum eigenstates. We also consider the gapless Heisenberg-XXX model, whose energy eigenstates can be described via Bethe ansatz tensor networks. We show that it contains $-$ within its low-energy eigenspace $-$ an error-detecting code with the same parameter scaling. All these codes detect arbitrary $d$-local (not necessarily geometrically local) errors even though they are not permutation-invariant. This suggests that a wide range of naturally occurring many-body systems possess intrinsic error-detecting features.


Introduction
how generic the appearance of error-correcting features is in naturally occurring quantum many-body systems. A first step towards showing the ubiquity of such features is the work of Brandao, et. al. [52]. There, it is shown that quantum chaotic systems satisfying the Eigenstate Thermalization Hypothesis (ETH) have energy eigenstates that form approximate quantum error-correcting codes. Nearby extensive energy eigenstates of 1D translation invariant Hamiltonians, as well as ground spaces of certain gapless systems (including the Heisenberg and Motzkin models), also contain approximate quantum error-correcting codes. Motivated by this work, we ask if one can demonstrate the existence of error-correcting codes within the low-energy eigenspaces of generic Hamiltonians, whether or not they are gapped or gapless. Specifically, we ask this question for 1D systems.
Our work goes beyond earlier work by considering errors (that is, noise) of a more general form: existing studies of error-correction in the context of entanglement renormalization and/or holography have primarily concentrated on qubit loss, modeled by socalled erasure errors (see e.g., [48,53]). This erasure noise model has several theoretical advantages. In particular, it permits one to argue about the existence of recovery maps in terms of entanglement entropies of the associated erased regions. This can be connected to well-known results on entanglement entropies in critical 1D systems. Furthermore, the appearance of entanglement entropies in these considerations is natural in the context of the AdS/CFT duality, where these quantities are involved in the connection of the boundary field theory to the bulk geometry via the Ryu-Takayangi formula. However, compared to other forms of errors typically studied in the quantum fault-tolerance community, erasure is quite a restricted form of noise: it is, in a certain sense, much easier to correct than, e.g., depolarizing noise. As an example to illustrate this point, we recall that the toric code can recover from loss of half its qubits [54], whereas it can only tolerate depolarizing noise up to a noise rate of 11% even given perfect syndrome measurements [9]. Motivated by this, we aim to analyze error-correcting properties with respect to more generic noise even though this precludes the use of entanglement entropies. Again, the work [52] provides first results in this direction by considering errors on a fixed, connected subset of sites (that is, geometrically localized errors). The restriction to a connected subset was motivated in part by the consideration of permutation-invariant subspaces. In our work, we lift the restriction to permutation-invariant codes and instead analyze arbitrary weight-d errors with potentially disconnected supports. Furthermore, we study an operational task -that of error-detection -with respect to a noise model where errors can occur on any subset of qubits of a certain size, instead of only a fixed subset.
We find that the language of matrix product states (MPS) and the related excitation ansatz states provides a powerful analytical tool for studying error-detection in 1D systems. In particular, we relate properties of transfer operators to error-detection features: for MPS describing (degenerate) ground spaces of gapped Hamiltonians, injectivity of the transfer operators gives rise to a no-go theorem. For excitation ansatz states describing the low-energy excitations of gapped systems, we use injectivity and a certain normal form to establish error-correction properties. Finally, for a gapless integrable model, we analyze the Jordan structure of (generalized) transfer matrices to find bounds on code parameters. In this way, our work connects locally defined features of tensor networks to global error-correction properties. This can be seen as a first step in an organized program of studying approximate quantum error-correction in tensor network states.

Our contribution
We focus on error-detection, a natural primitive in fault-tolerant quantum computation. Contrary to full error-correction, where the goal is to recover the initial encoded state from its corrupted version, error-detection merely permits one to decide whether or not an error has occurred. Errors (such as local observables) detected by an error-detecting code have expectation values independent of the particular logical state. In the context of topological order, where local errors are considered, error-detection has been referred to as TQO-1 (topological quantum order condition 1); see, e.g., [55]. An approximate version of the latter is discussed in [56].
A code, i.e., a subspace of the physical Hilbert space, is said to be error-detecting (for a set of errors) if the projection back onto the code space after the application of an error results in the original encoded state, up to normalization. Operationally, this means that one can ensure that no error occurred by performing a binary-outcome POVM consisting of the projection onto the code space or its complement. This notion of an error-detecting code is standard, though quite stringent: unless the code is constructed algebraically (e.g., in terms of Pauli operators), it is typically not going to have this property.
Our first contribution is a relaxed, yet still operationally meaningful definition for approximate error-detection. It relaxes the former notion in two directions: first, the postmeasurement state is only required to approximate the original encoded state. Second, we only demand that this approximation condition is satisfied if the projection onto the code space occurs with non-negligible probability. This is motivated by the fact that if this projection does not succeed with any significant probability, the error-detection measurement has little effect (by the gentle measurement lemma [57]) and may as well be omitted. More precisely, we consider a CPTP map N : B((C p ) ⊗n ) → B((C p ) ⊗n ) modeling noise on n physical qudits (of dimension p). Here the Kraus operators of N take the role of errors (considered in the original definition). We define the following notion: Definition 3.1 (Approximate quantum error-detecting code). A subspace C ⊂ (C p ) ⊗n (with associated projection P ) is an ( , δ)-approximate error-detecting code for N if for any state |Ψ ∈ C the following holds: if tr(P N (|Ψ Ψ|)) ≥ δ then Ψ|ρ N ,P |Ψ ≥ 1 − , where ρ N ,P = tr(P N (|Ψ Ψ|)) −1 · P N (|Ψ Ψ|)P .
This definition ensures that the post-measurement state ρ N ,P is close (as quantified by ) to the initial code state when the outcome of the POVM is P . Furthermore, we only demand this in the case where N (|Ψ Ψ|) has an overlap with the code space of at least δ.
In the following, we often consider families of codes {C n } n indexed by the number n of physical spins. In this case, we demand that both approximation parameters n and δ n tend to zero as n → ∞. This is how we make sure that we have a working error-detecting code in the asymptotic or thermodynamic limit of the physical Hilbert space.
Of particular interest are errors of weight d, i.e., errors which only act non-trivially on a subset of d of the n subsystems in the product space (C p ) ⊗n . We call this subset the support of the error, and refer to the error as d-local. We emphasize that throughout this paper, d-local only refers to the weight of the errors: they do not need to be geometrically local, i.e., their support may be disconnected. In contrast, earlier work on approximate error-correction such as [52] only considered errors with support on a (fixed) connected subset of d sites. We then define the following: Definition 3.3 (Error-detection for d-local errors). A subspace C ⊂ (C p ) ⊗n is called an ( , δ) [[n, k, d]]-approximate quantum error-detecting code (AQEDC) if dim C = p k and if C is an ( , δ)-approximate error-detecting code for any CPTP map N : B((C p ) ⊗n ) → B((C p ) ⊗n ) of the form where each F j is a d-local operator with F j ≤ 1 and {p j } j∈[J] is a probability distribution. We refer to d as the distance of the code.
In other words, an ( , δ)[[n, k, d]]-AQEDC deals with error channels which are convex combinations of d-local errors. This includes for example the commonly considered case of random Pauli noise (assuming the distribution is supported on errors having weight at most d). However, it does not cover the most general case of (arbitrary) d-local errors/error channels because of the restriction to convex combinations. The consideration of convex combinations of d-local errors greatly facilitates our estimates and allows us to consider settings that go beyond earlier work. We leave it as an open problem to lift this restriction, and only provide some tentative statements in this direction.
To exemplify in what sense our definition of AQEDC for d-local errors extends earlier considerations, consider the case where the distribution over errors in (1) is the uniform distribution over all d-qudit Pauli errors on n qubits. In this case, the number of Kraus operators in the representation (1) is polynomial in n even for constant distance d. In particular, arguments involving the number of terms in (1) cannot be used to establish bounds on the code distance as in [52], where instead, only Pauli errors acting on d fixed sites were considered: The number of such operators is only 4 d instead of the number n d 4 d of all weight-≤ d-Paulis, and, in particular, does not depend on the system size n.
We establish the following approximate Knill-LaFlamme type conditions which are sufficient for errordetection: (i) codes that are degenerate ground spaces of local Hamiltonians and permits a description in terms of tensor networks, and (ii) codes defined by low-energy eigenstates of (geometrically) local Hamiltonians, with the property that these can be efficiently described in terms of tensor networks.
As we explain below, (i) and (ii) are closely connected via the parent Hamiltonian construction. For (i), we follow a correspondence between tensor networks and codes which is implicit in many existing constructions: we may think of a tensor as a map from certain virtual to physical degrees of freedom. To define this map, consider a tensor network given by a graph G = (V, E) and a collection of tensors A. Let us say that an edge e ∈ E is a dangling edge if one of its vertices has degree 1, and let us call the corresponding vertices the dangling vertices of the tensor network. An edge e ∈ E is an internal edge if it is not a dangling edge; we use an analogous notion for vertices. We assume that each internal edge e ∈ E is associated a virtual space of fixed bond dimension D, and each dangling edge with a physical degree of dimension p. Then the tensor network associates a tensor T of degree deg(v) to each internal vertex v of G, where it is understood that indices corresponding to internal edges are contracted. The tensor network is fully specified by the family A of such tensors. We partition the set of dangling vertices into a two subsets M and M c . Then the tensor network defines a map Γ(A, G) : (C p ) ⊗|M | → (C p ) ⊗|M c | as each fixing of the degrees of freedom in M defines an element of the Hilbert space associated with the degrees of freedom in M c by tensor contraction. That is, the map depends on the graph G specifying the structure of the tensor network, as well as the family A of local tensors. In particular, fixing a subspace of (C p ) ⊗|M | , its image under the map Γ(A, G) defines a subspace C ⊂ (C p ) ⊗|M c | which we will think of as an error-correcting code. In the following, we also allow the physical and virtual (bond) dimensions to vary (depending on the location in the tensor network); however, this description captures the essential construction. This type of construction is successful in two and higher spatial dimensions, yielding error-correcting codes with macroscopic distance: examples are the ground states of the toric code [41,58] and other topologically ordered models [38,40,42]. However, in 1D, it seems a priori unlikely that the very same setup can generate any nontrivial quantum error-detection code, at least for gapped systems. This is because of the exponential decay of correlations [59][60][61] and the lack of topological order without symmetry protection [18,62]. We make this precise by stating and proving a no-go theorem.
More precisely, we follow the above setup provided by the boundary-to-bulk tensor network map Γ(A) = Γ(A, G). Here, G is the 1D line graph with dangling edges attached to internal vertices, which is equivalent to considering the ground space of 1D local gapped Hamiltonians with open boundary conditions. The associated tensor network is a matrix product state.
Generic MPS satisfy a condition called injectivity, which is equivalent to saying that the transfer matrix of the MPS is gapped. Exploiting this property allows us to prove a lower bound on the distinguishability of d-local reduced density operators for any two orthogonal states in the code space. This bound is expressed in terms of the virtual bond dimension D of the MPS tensor A. In particular, the bound implies the following no-go theorem for codes generated by MPS as described above.
Theorem 5.3. Let C ⊂ (C p ) ⊗n be an approximate quantum error-detecting code generated by Γ(A), i.e., a translation-invariant injective MPS of constant bond dimension D by varying boundary conditions. Then the distance of C is constant.
The physical interpretation of this theorem is as follows: for every injective MPS with periodic boundary conditions, there exists a strictly log D-geometrically local gapped Hamiltonian such that the MPS is the unique ground state [29]. One can further enlarge the ground space by leaving out a few Hamiltonian terms near the boundary. The degeneracy then depends on the number of terms omitted, and the ground states are described by open boundary condition MPS. Then, our no-go theorem implies that the ground space of any such parent Hamiltonian arising from such a constant bond-dimension MPS is a trivial code, i.e., it can have at most a constant distance. This result is equivalent to saying that there is no topological quantum order in the ground space of 1D gapped systems. 1 To get around this no-go result, we extend our considerations beyond the ground space and include low-energy subspaces in the code space. We show that this indeed leads to error-detecting codes with macroscopic distance. We identify two ways of constructing nontrivial codes by either considering single-particle excitations of varying momenta, or by considering multi-particle excitations above the ground space. Both constructions provide us with codes having distance scaling asymptotically significantly better than what can be achieved in the setup of our no-go theorem. In fact, the code distance is a polynomial arbitrarily close to linear in the system size (i.e., n) in both cases.
Our first approach, using states of different momenta, involves the formalism of the excitation ansatz (see Section 6 for a review). This gives a tensor network parametrization of momentum eigenstates associated with a Hamiltonian having quasi-particle excitations. We show the following: Theorem 6.9. Let ν ∈ (0, 1) and let κ, λ > 0 be such that 5κ + λ < ν .
Let A, B(p) be tensors associated with an injective excitation ansatz state |Φ p (B; A) , where p is the momentum of the state. Then there is a subspace C ⊂ (C p ) ⊗n spanned by excitation ansatz states {|Φ p (B; A) } p with different momenta p such that C is an ( , δ)[[n, k, d]]-AQEDC with parameters k = κ log p n , The physical interpretation of this result stems from the fact that excitation ansatz states approximate quasi-particle excitations: given a local gapped Hamiltonian, assuming a good MPS approximation to its ground state, we can construct an arbitrarily good approximation to its isolated quasi-particle excitation bands by the excitation ansatz. This approximation guarantee is shown using Lieb-Robinson type bounds [59,63] based on a previous result [64] which employs the method of energy filtering operators. Thus our result demonstrates that generic low-energy subspaces contain approximate errordetecting codes with the above parameters. Also, note that unlike the codes considered in [52,Theorem 1], the excitation ansatz codes are comprised of finite energy states, and not finite energy density states.
We remark that the choice of momenta is irrelevant for this result; it is not necessary to restrict to nearby momenta. Instead, any subset of momentum eigenstates can be used. The only limitation here is that the number of different momenta is bounded by the dimension of the code space. This is related to the fact that localized wave functions (which would lead to a non-extensive code distance) are a superposition of many different momenta, a fact formally expressed by the position-momentum uncertainty relation.
Our second approach for side-stepping the no-go theorem is to consider multi-particle excitations. We consider a specific model, the periodic Heisenberg-XXX spin chain Hamiltonian H on n qubits. We find that there are good error-detecting codes within the low-energy subspace of this system. For this purpose, we consider the state and where s − m = |0 1| changes the state of the m-th spin from |1 to |0 . This has energy O(1/n 2 ) above the ground state energy of H. The corresponding eigenspace is degenerate and contains all "descendants" S r − |Ψ for r ∈ {0, . . . , n − 2}, where S − = n m=1 s − m is the (total) spin lowering operator. We also note that each state S r − |Ψ has fixed momentum 2π/n, and that r directly corresponds to its total magnetization. We emphasize that these states are, in particular, not permutation-invariant. Our main result concerning these states is the following: Theorem 7.9. Let ν ∈ (0, 1) and κ, λ > 0 be such that 6κ + λ < ν .
Then there is a subspace C spanned by descendant states {S r − |Ψ } r with magnetization r pairwise differing by at least 2 such that C is an ( , δ)[[n, k, d]]-AQEDC with parameters This code, which we call the magnon-code, can also be seen to be realized by tensor networks. The state (2) has an MPS description with bond dimension 2 and the descendants S r − |Ψ can be expressed using a matrix-product operator (MPO) description of the operator S − . More generally, it is known that these states form an example of the algebraic Bethe ansatz, and the latter have a natural tensor network description [65]. This suggests that our results may generalize to other exactly solvable models.

Outline
The paper is organized as follows. We discuss our notion of approximate error-detection and establish sufficient and necessary conditions in Section 3. In Section 4, we review the basics of matrix product states. We also establish bounds on expectation values in terms of properties of the associated transfer operators. In Section 5, we prove our no-go theorem and show the limits of error-detection for code spaces limited to the ground space of a gapped local Hamiltonian. We then consider low-energy eigenstates of local Hamiltonians and show how they perform asymptotically better than the limits of the no-go theorem. We first consider single-particle momentum eigenstates of generic local gapped Hamiltonians in Section 6. In Section 7, we consider codes defined by manyparticle eigenstates of the Heisenberg-XXX model.

Approximate Quantum Error-Detection
Here we introduce our notion of approximate quantum error-detection. In Section 3.1, we give an operational definition of this notion. In Section 3.2, we provide sufficient conditions for approximate quantum error-detection which are analogous to the Knill-LaFlamme conditions for quantum error-correction [4]. Finally, in Section 3.3, we give necessary conditions for a subspace to be an approximate quantum error-detecting code.

Operational definition of approximate error-detection
Let N : B((C p ) ⊗n ) → B((C p ) ⊗n ) be a CPTP map modeling noise on n physical qubits. We introduce the following notion: Definition 3.1. A subspace C ⊂ (C p ) ⊗n (with associated projection P ) is an ( , δ)approximate error-detection code for N if for any pure state |Ψ ∈ C the following holds: where ρ N ,P = tr(P N (|Ψ Ψ|)) −1 · P N (|Ψ Ψ|)P .
In this definition, ρ N ,P is the post-measurement state when applying the POVM {P, I− P } to N (|Ψ Ψ|). Roughly speaking, this definition ensures that the post-measurement state is -close to the initial code state if the outcome of the POVM is P . Note, however, that we only demand this in the case where N (|Ψ Ψ|) has an overlap with the code space of at least δ. The idea behind this definition is that if this overlap is negligible, then the outcome P does not occur with any significant probability and the error-detection measurement may as well be omitted. Definition 3.1 is similar in spirit to operationally defined notions of approximate quantum error-correction considered previously. In [66], approximate error-correction was defined in terms of the "recoverable fidelity" of any encoded pure state affected by noise. The restriction to pure states in the definition is justified by means of an earlier result by Barnum,Knill,and Nielsen [67].
We note that, by definition, an ( , δ)-approximate error-detection code for N is also an ( , δ )-approximate error-detection code for any ≤ and δ ≤ δ . The traditional "exact" notion of a quantum error-detecting code C (see e.g., [68]) demands that for a set F ⊂ B((C p ) ⊗n ) of detectable errors, we have Ψ|E|Φ = λ E Ψ|Φ for all |Ψ , |Φ ∈ C for some scalar λ E ∈ C depending only on E, for all E ∈ F. It is straightforward to see that such a code defines a (0, 0)-approximate error-detecting code of any CPTP map N whose Kraus operators belong to F.

Sufficient conditions for approximate quantum error-detection
The following theorem shows that certain approximate Knill-LaFlamme-type conditions are sufficient for approximate error-detection.
Let δ > K 5 approx be arbitrary. Then the subspace C is an ( , δ)-approximate quantum error-detection code for N with = K 5 approx δ −1 .
This theorem deals with cases where the code dimension K is "small" compared to other quantities. We will later apply this theorem to the case where K is polynomial, and where approx and δ are inverse polynomial in the system size n.
We note that the conditions of Theorem 3.2 may appear more involved than e.g., the Knill-LaFlamme type conditions (see [4]) for (exact) quantum error-correction: the latter involve one or two error operators (interpreted as Kraus operators of the channel), whereas in expression (3), we sum over all Kraus operators. It appears that this is, to some extent, unavoidable when going from exact to approximate error-correction/detection in general. We note that (tight) approximate error-correction conditions [69] obtained by considering the decoupling property of the complementary (encoding plus noise) channel similarly depend on the entire noise channel. Nevertheless, we show below that, at least for probabilistic noise, simple sufficient conditions for quantum error-detection involving only individual Kraus operators can be given.
If there are vectors {η α,β } α,β∈ [K] such that then this implies the bound Unfortunately, good bounds of the form (6) are not straightforward to establish in the cases considered here. Instead, we consider a slightly weaker condition (see equation (8)) which still captures many cases of interest. In particular, it provides a simple criterion for establishing that a code can detect probabilistic Pauli errors with a certain maximum weight. Correspondingly, we introduce the following definition: ]-AQEDC C is a p k -dimensional subspace of (C p ) ⊗n such that C is an ( , δ)-error-detecting code for any CPTP map of the form where each F j is a d-local operator with F ≤ 1 and {p j } j∈[J] is a probability distribution.
We then have the following sufficient condition: Corollary 3.4. Let K = p k and C ⊂ (C p ) ⊗n be a code with orthonormal basis {ψ α } α∈ [K] satisfying (for some γ > 0), for every d-local operator F on (C p ) ⊗n . Let δ > K 5 γ 2 . Then C is an Proof. Defining R j = √ p j F j , the claim follows immediately from Theorem 3.2.
Note that the exponents in this statement are not optimized, and could presumably be improved. We have instead opted for the presentation of a simple proof, as this ultimately provides the same qualitative statements.
We also note that the setting considered in Corollary 3.4, i.e., our notion of ( , δ)[[n, k, d]]error-detecting codes, goes beyond existing work on approximate error-detection/correction [52,53], where typically only noise channels with Kraus (error) operators acting on a fixed, contiguous (i.e., geometrically local) set of d physical spins are considered. At the same time, our results are limited to convex combinations of the form (7). It remains an open problem whether these codes also detect noise given by more general (coherent) channels.

Necessary conditions for approximate quantum error-detection
Here we give a partial converse to Corollary 3.4, which shows that a condition of the form (8) is indeed necessary for approximate quantum error-detection.
Lemma 3.5. Let ψ 1 , ψ 2 ∈ (C p ) ⊗n be two orthonormal states in the code space C and F = F S ⊗ I [n]\S ∈ B((C p ) ⊗d ) an orthogonal projection acting on d sites S ⊂ [n] such that Proof. Let F j,k := ψ j |F |ψ k for j, k ∈ {1, 2} .
By choosing the phase of |ψ 1 appropriately, we may assume that F 1,2 ≥ 0. Note that F 1,2 = F 2,1 ≤ F ψ 2 = ψ 2 |F |ψ 2 by the Cauchy-Schwarz inequality and because F is a projection. Let us denote the entries of F by Let us define a CPTP map N of the form (7) by where W j,k := ψ j |e iπF |ψ k for j, k ∈ {1, 2} .
Observe that since F 2 = F is a projection, we have e iπF = I − 2F , thus the entries of W are In particular, from (9) we obtain for the projection P onto C tr (P N (|Ψ Ψ|)P ) ≥ tr P N (|Ψ Ψ|)P where we used that the last expression is minimal (and equal to (p − q) 2 ) for r = 1/2(1 − p − q). We also have This expression is maximal for (r, q) each maximal (since both are non-negative), hence for (r, q) = ( √ 1 − η, 1 − η) and we obtain the upper bound where we used that x ≤ √ x for x ∈ [0, 1]. This implies with (10) that for ρ N ,P = tr(P N (|Ψ Ψ|)) −1 · P N (|Ψ Ψ|)P we have With (10), this implies the claim.
With the inequality A 1 ≤ rank(A) A F we get the bound on the fidelity of ρ 1 and ρ 2 , where D = rank( The claim then follows from Lemma 3. 5

On expectation values of local operators in MPS
Key to our analysis are expectation values of local observables in MPS, and more generally, matrix elements of local operators with respect to different MPS. These directly determine whether or not the considered subspace satisfies the approximate quantum error-detection conditions. To study these quantities, we first review the terminology of transfer operators (and, in particular, injective MPS) in Section 4.1. In Section 4.2, we establish bounds on the matrix elements and the norms of transfer operators. These will subsequently be applied in all our derivations.

Review of matrix product states
A matrix product state (or MPS) of bond dimension D is a state |Ψ on (C p ) ⊗n which is parametrized by a collection of D × D matrices. In this paper, we focus on uniform, site-independent MPS. Such a state is fully specified by a family A = {A j } p j=1 of D × D matrices describing the "bulk properties" of the state, together with a "boundary condition" matrix X ∈ B(C D ). We write |Ψ = |Ψ(A, X, n) for such a state, where we often suppress the defining parameters (A, X, n) for brevity.
Written in the standard computational basis, the state |Ψ(A, X, n) is expressed as for a family {A j } p j=1 ⊂ B(C D ) of matrices. The number of sites n ∈ N is called the system size, and each site is of local dimension p ∈ N, which is called the physical dimension of the system. The parameter D ∈ N is called the bond, or virtual, dimension. This state can be represented graphically as a tensor network as in Figure 1.
Note that the family of matrices A = {A j } p j=1 of a site-independent MPS equivalently defines a three-index tensor (A j ) αβ with one "physical" (j) and two "virtual" (α, β) indices. We call this the local MPS tensor associated to |Ψ(A, X, n) .
Without loss of generality (by suitably normalizing the matrices {A j } p j=1 ), we assume that E has spectral radius 1. This implies that E has a positive semi-definite fixed point r ∈ B(C D ) by the Perron-Frobenius Theorem, see [70,Theorem 2.5]. We say that the MPS |Ψ(A, X, n) is injective 2 if the associated map E is primitive, i.e., if the fixed-point r is positive definite (and not just positive semi-definite), and if the eigenvalue 1 associated to r is the only eigenvalue on the unit circle, including multiplicity [72,Theorem 6.7].
From expression (11), we can see that there is a gauge freedom of the form for every invertible matrix P ∈ GL(C D ), for which |Ψ(A, X, n) = |Ψ(Ã,X, n) . Given an injective MPS, the defining tensors can be brought into a canonical form by exploiting this gauge freedom in the definition of the MPS. 3 One proceeds as follows: given an injective MPS, let r denote the unique fixed-point of the transfer operator E. We can apply the gauge freedom (13) with P = √ r to obtain an equivalent MPS description by matrices {Ã j := r −1/2 A j r 1/2 } p j=1 , where the associated mapẼ is again primitive with spectral radius 1, but now with the identity operatorr = I C D as the unique fixed-point.
Similarly, one can show that the adjoint of a primitive map E is also primitive. 4 Since the spectrum of E † is given by spec(E † ) = 2 Injective MPS are known to be "generic". More precisely, consider the space C D ⊗ C D ⊗ C p of all defining tensors with physical dimension p and bond dimension D. Then the set of defining tensors with a primitive transfer operator forms an open, co-measure zero set. The definition of injective that we use here differs from the one commonly used in the literature (cf. [29]), but is ultimately equivalent. For a proof of equivalence, see Definition 8, Lemma 6, and Theorem 18 of [71]. 3 The canonical form holds for non-injective MPS as well, see [29]. We only consider the injective case here. 4 Note that the adjoint is taken with respect to the Hilbert-Schmidt inner product on B(C D ). One way to see that the adjoint of a primitive map is primitive is to note that an equivalent definition for primitivity given in [72, Theorem 6.7 (2)] is in terms of irreducible maps. A map is irreducible if and only if its adjoint is irreducible (see the remarks in [72] after Theorem 6.2). This in turn means that a map is primitive if and only if its adjoint is primitive. spec(E), this implies that the map E † has a unique positive fixed-point with eigenvalue 1, with all other eigenvalues having magnitude less than 1. Now, let˜ denote the unique fixed-point of the previously definedẼ. Since˜ is positive definite, it is unitarily diagonalizable:˜ with U being a unitary matrix, and Λ being a diagonal matrix with all diagonal entries positive. Using the gauge freedom (13) in the form we obtain an equivalent MPS description such that the associated channelẼ † has a fixedpoint given by a positive definite diagonal matrix Λ. We may without loss of generality take Λ to be normalized as tr(Λ) = 1. It is also easy to check that the identity operator I D remains the unique fixed-point ofẼ.
In summary, given an injective MPS with associated map E, one may, by using the gauge freedom, assume without loss of generality that: (i) The unique fixed-point r of E is equal to the identity, i.e., r = I C D .
(ii) The unique fixed-point of E † is given by a positive definite diagonal matrix = Λ, normalized so that tr(Λ) = 1.
An MPS with defining tensors A satisfying these two properties above is said to be in canonical form.
In the following, after fixing a standard orthonormal basis {|α } D α=1 of C D , we identify elements X ∈ B(C D ) with vectors |X ∈ C D ⊗ C D via the vectorization isomorphism It is easy to verify that X|Y = tr(X † Y ), i.e., the standard inner product on C D ⊗C D directly corresponds to the Hilbert-Schmidt inner product of operators in B(C D ) under this identification. Furthermore, under this isomorphism, a super-operator E : The matrix E is simply the matrix representation of E, thus E has the same spectrum as E. Explicitly, for a map of the form (12), it is given by The fixed-point equations for a fixed-point r of E and a fixed-point of E † become i.e., the corresponding vectors are left and right eigenvectors of E, respectively.
For a site-independent MPS |Ψ(A, X, n) , defined by matrices {A j } p j=1 , we call the associated matrix E (cf. (14)) the transfer matrix. Many key properties of a siteindependent MPS are captured by its transfer matrix. For example, the normalization of the state is given by If the MPS is injective, then, according to (i)-(ii), it has a Jordan decomposition of the form In this expression, |I Λ| is the (1-dimensional) Jordan block corresponding to eigenvalue 1, whereasẼ is a direct sum of Jordan blocks with eigenvalues of modulus less than 1. The second largest eigenvalue λ 2 of E has a direct interpretation in terms of the correlation length ξ of the state, which determines two-point correlators | σ j σ j − σ j · σ j | ∼ e −|j−j |/ξ . The latter is given by ξ = log(1/λ 2 ).
For an injective MPS, the fact that |I is the unique right-eigenvector of E with eigenvalue 1 implies the normalization condition Λ|I = tr(Λ) = 1 .
We will represent these identities diagrammatically, which is convenient for later reference. The matrix Λ will be shown by a square box, the identity matrix corresponds to a straight line. That is, the normalization condition (16)

Transfer matrix techniques
Here we establish some essential statements for the analysis of transfer operators. In Section 4.2.1, we introduce generalized (non-standard) transfer operators: these can be used to express the matrix elements of the form Ψ|F |Ψ of local operators F with respect to pairs of MPS (Ψ, Ψ ). In Section 4.2.2, we establish bounds on the norm of such operators. Relevant quantities appearing in these bounds are the second largest eigenvalue λ 2 of the transfer matrix, as well as the sizes of its Jordan blocks.

More general and mixed transfer operators
Consider a single-site operator Z ∈ B(C p ). The generalized transfer matrix E Z ∈ B(C D ⊗ C D ) is defined as Figure 2: The transfer operator E, as well as E Z for Z ∈ B(C p ), and E F for F ∈ (C p ) ⊗3 .
Left-multiplication by an operator corresponds to attaching the corresponding diagram on the left.
We further generalize this as follows: This definition extends by linearity to any operator F ∈ B((C p ) ⊗d ), and gives a corresponding operator E F ∈ B(C D ⊗ C D ). The tensor network diagrams for these definitions are given in Figure 2, and the composition of the corresponding maps is illustrated in Figure 3.
In the following, we are interested in inner products Ψ(A, X, n)|Ψ(B, Y, n) of two MPS, defined by local tensors A and B, with boundary matrices X and Y , which may have different bond dimensions D 1 and D 2 , respectively. To analyze these, it is convenient to introduce an "overlap" transfer operator E = E(A, B) which now depends on both MPS tensors A and B. First we define The definition of E Z for Z ∈ B(C p ) is analogous to equation (17), but with appropriate substitutions. We set Starting from this definition, the expression is then defined analogously as before.

Norm bounds on generalized transfer operators
A first key observation is that the (operator) norm of powers of any transfer operator scales (at most) as a polynomial in the number of physical spins, with the degree of the polynomial determined by the size of the largest Jordan block. We need these bounds explicitly and start with the following simple bounds.
Below, we often consider families of parameters depending on the system size n, i.e., the total number of spins. We write m h as a shorthand for a parameter m "being sufficiently large" compared to another parameter h. More precisely, this signifies that we assume that |h/m| → 0 for n → ∞, and that by a corresponding choice of a sufficiently large n, the term |h/m| can be made sufficiently small for a given bound to hold. Oftentimes h will in fact be constant, with m → ∞ as n → ∞.
Lemma 4.1. For m > h, the Frobenius norm of the m-th power (λI + N ) m of a Jordan block λI + N ∈ B(C h ) with eigenvalue λ, such that |λ| ≤ 1, and size h is bounded by Furthermore, Proof. For h = 0 the claim is trivial. Assume that h > 1. Because N h = 0 and N r has exactly h − r non-zero entries for r < h, we have Since the right hand side is maximal for r = h − 1, and the binomial coefficient can be bounded from above by m r ≤ em r r ≤ 3 · m r we obtain hence, the first claim follows. For the second claim, recall that the entries of the m-th power of a Jordan block are Using the Cauchy-Schwarz inequality, it is straightforward to check that the claim follows. Now, we apply Lemma 4.1 to (standard and mixed) transfer operators. It is convenient to state these bounds as follows. The first two statements are about the scaling of the norms of powers of E; the last statement is about the magnitude of matrix elements in powers of E.
We will often use E m F ≤ 1 as a coarse bound.
where we assumed that m h * ≥ h(λ), |λ| ≤ 1 and (19). This shows claim (i). Claim (ii) immediately follows from (18) and the observation that For the proof of statement (iii), observe that matrix elements (20) of a Jordan block (matrix) with eigenvalue λ (with |λ| = 1) of size h scale as for q > p and are constant otherwise.
Since E m is similar (as a matrix) to a direct sum of such powers of Jordan blocks, and the form of this scaling does not change under linear combination of matrix coefficients, the claim follows. Now let us consider the case where E = | r| ⊕Ẽ is the transfer operator of an injective MPS, normalized with maximum eigenvalue 1. Let λ 2 < 1 denote the second largest eigenvalue. Without loss of generality, we can take the MPS to be in canonical form, so that E has a unique right fixed-point given by the identity matrix I and a unique left fixed-point given by some positive-definite diagonal matrix Λ with unit trace. We can then write the Jordan decomposition of the transfer matrix as where |I and |Λ denotes the vectorization of I and Λ respectively, and whereẼ denotes the remaining Jordan blocks of E. Note that powers of E can then be expressed as We can bound the Frobenius norm of the transfer matrix as where tr(I) = D and tr(Λ 2 ) ≤ tr(Λ) 2 = 1. In particular, since ρ(Ẽ) = λ 2 , we obtain from This implies the following statement: We also need a bound on the norm is an operator acting on d sites, and where ψ j ∈ C D j for j = 1, 2.
for all F ∈ B((C p ) ⊗d ).
Proof. Writing matrix elements in the computational basis as we have Therefore, where π is the permutation which maps the j-th factor in the tensor product (C p ) ⊗n to the (n − j + 1)-th factor, and where F is obtained by complex conjugating the matrix elements in the computational basis. This means that with E † being the mixed transfer operator E † = E(A † , B † ) obtained by replacing each A j respectively B j with its adjoint. Now consider . This can be represented diagrammatically as where ϕ, χ ∈ (C p ) ⊗2d are defined as It is straightforward to check that Since (E † j ) d = E d j for j = 1, 2, it follows with the submultiplicativity of the operator norm that Applying the Cauchy-Schwarz inequality to (28) yields where we used the fact that the operator norm satisfies F † = F = F and I ⊗A = A . The claim (24) follows from this and (29). The claim (25) follows analogously by using equation (27). Finally, the claim (26) follows from (25) and where we employed the orthonormal basis {|α } α∈[D 1 ] and {|β } β∈[D 2 ] for C D 1 and C D 2 , respectively, and applied the Cauchy-Schwarz inequality.
The main result of this section is the following upper bound on the matrix elements of geometrically d-local operators with respect to two MPS.
denote the combined transfer operator defined by the MPS tensors A 1 and A 2 , h * j the size of the largest Jordan block of E j = E(A j ) for j = 1, 2, and h * the size of the largest Jordan block of E = E(A 1 , A 2 ). Assume that the spectral radii ρ(E), ρ(E 1 ), and ρ(E 2 ) are contained in [0, 1]. Then, for any F ∈ B((C p ) ⊗d ), we have Proof. The matrix elements α = Ψ 1 |(F ⊗ I (C p ) ⊗n−d )|Ψ 2 of interest can be written as By the Cauchy-Schwarz inequality, we have

No-Go Theorem: Degenerate ground spaces of gapped Hamiltonians are constant-distance AQEDC
In this section we prove a no-go result regarding the error-detection performance of the ground spaces of local gapped Hamiltonians: their distance can be no more than constant. We prove this result by employing the necessary condition for approximate error-detection from Lemma 3.6 for the code subspaces generated by varying the boundary conditions of an (open-boundary) injective MPS. Note that, given a translation invariant MPS with periodic boundary conditions and bond dimension D, there exists a local gapped Hamiltonian, called the parent Hamiltonian, with a unique ground state being the MPS [29]. We need the following bounds which follow from the orthogonality and normalization of states in such codes.
Lemma 5.1. Let A be the MPS tensor of an injective MPS with bond dimension D, and let X, Y ∈ B(C D ) be such that the states |Ψ X = |Ψ(A, X, n) and |Ψ Y = |Ψ(A, Y, n) are normalized and orthogonal. Let us write the transfer operator as E = |I Λ| ⊕Ẽ (cf. equation (21)). Assume n D. Then (i) The Frobenius norm of X (and similarly the norm of Y ) is bounded by In the following proofs, we repeatedly use the inequality for D × D-matrices {M j } k j=1 . Note that the inequality (30) is simply the Cauchy-Schwarz inequality for k = 2. For k > 2, the inequality follows from the inequality for k = 2 and the submultiplicativity of the Frobenius-norm because Proof. The proof of (i) follows from the fact that the state Ψ X is normalized, i.e., where λ min (Λ) denotes the smallest eigenvalue of Λ, and we make use of the fact that XX † is positive with trace tr(XX † ) = X 2 F . Since (30) and (22), we conclude Then the claim (i) follows since λ min (Λ) −1 is a constant. Now, consider the first inequality in (ii) (the bound for | Λ|(Y ⊗ X)|I | is shown analogously). Using the orthogonality of the states |Ψ X and |Ψ Y , we obtain using (22). The claim (ii) then follows from (i).
With the following lemma, we prove an upper bound on the overlap of the reduced density matrices ρ X and ρ Y , supported on 2∆-sites surrounding the boundary, of the global states |Ψ X and |Ψ Y , respectively.
where λ 2 is the second largest eigenvalue of the transfer operator E = E(A) and where c is a constant depending only on the minimal eigenvalue of E and the bond dimension D.
Proof. For convenience, let us relabel the systems as indicating their location on the left, in the middle, and on the right, respectively. For the tensor product H A ⊗ H B of two isomorphic Hilbert spaces, we denote by F AB ∈ B(H A ⊗ H B ) the flip-operator which swaps the two systems. The following expressions are visualized in Figure 4. We have In the last identity, we have used that F 2 = I is the identity.
Reordering and regrouping the systems as is an MPS with MPS tensor A ⊗ A and boundary tensor Y ⊗ X. Let us denote the virtual systems of the first MPS by V 1 V 2 , and those of the second MPS by W 1 W 2 , such that the boundary tensors are Recall that E ∆ = |I Λ| ⊕Ẽ ∆ , where we have In the second line, we use the fact that |Λ 2 = tr(Λ † Λ) = i λ i 2 ≤ 1 and |I 2 = D 2 . Therefore, we have and Note thatÊ Inserting this into (33) gives a sum of 16 terms Consider the term with b j = 0 for all j ∈ {1, . . . , 4}. This is given by By inserting this into (35) we get with Lemma 5.1 (ii) and the Cauchy-Schwarz inequality With Lemma 4.4 this can further be bounded as (23)), we conclude that The remaining terms 0, 0, 0) can be bounded as follows using inequality (30): We have where we use (34) and the assumption that (b 1 , b 2 , b 3 , b 4 ) = (0, 0, 0, 0). We use Lemma 4.4 and (23) to get the upper bound E F ⊗n−2∆ ≤ D 2 F ⊗n−2∆ · E n−D = O(1). Thus Combining (37) with (36), we conclude that . The claim follows from this.
Recall that we call (a family of subspaces) C ⊂ (C p ) ⊗n an approximate error-detection code if it is an ( , δ)[[n, k, d]]-code with → 0 and δ → 0 for n → ∞. Our main result is the following: Theorem 5.3. Let C ⊂ (C p ) ⊗n be an approximate error-detecting code generated from a translation-invariant injective MPS of constant bond dimension D by varying boundary conditions. Then the distance of C is constant.
Proof. Let C = C n ⊂ (C p ) ⊗n be a (family of) subspace(s) of dimension p k defined by an MPS tensor A by choosing different boundary conditions, i.e., for some (fixed) subspace X ⊂ B(C D ). For the sake of contradiction, assume that C n is an ( n , δ n )[[n, k, d n ]]-code with n , δ n → 0 and code distance d n → ∞ for n → ∞ .
Let |Ψ X = |Ψ(A, X, n) , |Ψ Y = |Ψ(A, Y, n) ∈ C be two orthonormal states defined by choosing different boundary conditions X, Y ∈ X . From Lemma 5.2, we may choose ∆ sufficiently large such that the reduced density operators ρ X , ρ Y on d sites surrounding the boundary satisfies We note that ∆ only depends on the transfer operator and is independent of n. Fix any constant , δ ∈ (0, 1) and choose some d ≥ 2∆ sufficiently large such that Since by assumption d n → ∞, there exists some N 0 ∈ N such that Combining (39), (40), and (41) with Lemma 3.6, we conclude that C n is not an ( , δ)[[n, k, d n ]]code for any n ≥ N 0 .
By assumption (38), there exists some N 1 ∈ N such that n < and δ n < δ for all n ≥ N 1 .
Let us set N = max{N 0 , N 1 }. Then we obtain that C n is not an ( n , δ n )[[n, k, d n ]]-code for any n ≥ N , a contradiction.
In terms of the TQO-1 condition (cf. [55]), Theorem 5.3 shows the absence of topological order in 1D gapped systems. The theorem also tells us that we should not restrict our attention to the ground space of a local Hamiltonian when looking for quantum errordetecting codes. In the following sections, we bypass this no-go result by extending our search for codes to low-energy states. In particular, we show that single quasi-particle momentum eigenstates of local gapped Hamiltonians and multi-particle excitations of the gapless Heisenberg model constitute error-detecting codes. See Sections 6 and 7, respectively.

AQEDC at low energies: The excitation ansatz
In this section, we employ tangent space methods for the matrix product state formalism, i.e., the excitation ansatz [64,73,74], in order to show that quasi-particle momentum eigenstates of local gapped Hamiltonians yield an error-detecting code with distance Ω(n 1−ν ) for any ν ∈ (0, 1) and Ω(log n) encoded qubits.
In order to render the formalism accessible to an unfamiliar reader, we review the definition of the excitation ansatz in Section 6.1. We then develop the necessary calculational ingredients in order to prove the error-detection properties. In Section 6.2, we compute the norm of the excitation ansatz states to lowest order. In Section 6.3, we establish (norm) bounds on the transfer operators associated with the excitation ansatz. Then, in Section 6.4, we provide estimates on matrix elements of local operators with respect to states appearing in the definition of the excitation ansatz states. Finally, in Section 6.5, we combine these results to obtain the parameters of quantum error-detecting codes based on the excitation ansatz. 5

MPS tangent space methods: The excitation ansatz
In [73], the MPS ansatz was generalized to a variational class of states which have nonzero momentum. The resulting states are called the excitation ansatz. An excitation ansatz state |Φ p (B; A) ∈ (C p ) ⊗n is specified by two MPS tensors of the same bond and physical dimensions, together with a parameter p ∈ {2πk/n | k = 5 A simple yet illustrative example of the excitation ansatz states is the following. Consider the n-fold product state |0 ⊗n , the n-body W -state |10 · · · 0 + · · · + |00 · · · 1 √ n , as well as other W -like states with position dependent phase, such as |10 · · · 0 + e ip |01 · · · 0 + · · · + e ip(n−1) |00 · · · 1 √ n .
Here p can be interpreted as the momentum of a single particle excitation. These states are the ground state and first excited states with different momenta of the non-interacting Hamiltonian H = − i Z i . One can represent them by a bond-dimension D = 2 non-injective MPS which is obtained by expressing the excitation ansatz as a single MPS instead of a sum of injective MPS. One can also consider higher (multi-particle) excitations, which can again be treated by using non-injective MPS. We note that error-detecting properties of various subspaces of the low-energy space of this particular simple non-interacting Hamiltonian can be studied either with or without the formalism of MPS. The tangent space methods serve as a powerful tool that allow us to perform our error-detection analysis, not only for the non-interacting cases, but also for the most general interacting Hamiltonians.
The definition of these states is illustrated in Figure 5. Note that we allow the B tensors themselves to depend on the momentum p, so we will sometimes write B(p) when we feel the need to be explicit, and the notation |Φ p (B; A) should really be read as a short-hand for |Φ p (B(p); A) .
It is also useful to define the constituent "position space" states which is the state with a "single B(p) excitation" at site j. Note that we retain the p dependence in the definition of these "position space" states since the B tensors themselves are generally p dependent. We call an excitation ansatz state |Φ p (B; A) injective if the transfer operator E(A) associated with {A j } p j=1 is primitive, which is the only case we consider in this work. Denoting the transfer matrix associated with E(A) simply as E, it will also be useful to define several other mixed transfer matrices as follows: For brevity, we often suppress the dependence on A and B and simply write |Φ p ≡ |Φ p (B; A) when no confusion is possible.
In addition to the multiplicative gauge freedom (13), the excitation ansatz admits an additional additive gauge freedom. Exploiting this additive gauge freedom, the following statement can be shown (see [74,Equation (154)]): Lemma 6.1. Let |Φ p (B; A) be an injective excitation ansatz state and assume that A is normalized such that the transfer operator has spectral radius 1. Let and r be the corresponding left-and right-eigenvectors corresponding to eigenvalue 1. Assume p = 0. 6 Then there exists a tensorB such that |Φ p (B; A) = |Φ p (B; A) , and such that For completeness, we give a proof of this statement in Appendix A. Below, we assume that all excitation ansatz states satisfy the gauge condition (44). We also write c p := c pp . These appear in the norm of the excitation ansatz states as follows:

The norm of an excitation ansatz state
Lemma 6.2. The norm of an excitation ansatz state |Φ p (B; A) ∈ (C p ) ⊗n satisfies where λ 2 is the second largest eigenvalue of the transfer matrix E.
Proof. Using the mixed transfer operators defined in (6.1), we can write the norm of the state |Φ p (B; A) as a sum over pairs (j, j ) ∈ [n] 2 satisfying j < j , j = j , and j > j respectively, as follows: Consider an individual term tr E j−1 E B(p) E j −j−1 E B(p) E n−j in the first sum. By the cyclicity of the trace, it can be expressed as where ∆ = j − j. Clearly, one of the terms ∆ − 1 or n − ∆ − 1 must be lower bounded by n/3. Assume that it is the first (the argument for the other case is analogous), i.e., that Then we may substitute the Jordan decomposition of E in the form which allows us to write By the gauge condition (44), the first term vanishes. The magnitude of the second term can be bounded by inequality (30), giving Here we used the fact that for all pairs (j, j ) with j < j .
Identical reasoning gives us a bound of the form for all pairs (j, j ) with j > j . Inserting this into the sum (45), we obtain By the cyclicity of the trace and the Jordan decomposition of E, we have Again using inequality (30) and Lemma 4.2(ii), we get Inserting this into (47) and noting that λ Taking the square root yields the desired claim.

Bounds on transfer operators associated with the excitation ansatz
For an operator F ∈ (C p ) ⊗L , sites j, j ∈ [L] and momenta p, p , let us define operators on C D ⊗ C D by the diagrams E F (j, p, j , p ) = , and E F (j, p) = .
We also denote by E(j, p, j , p ) the expression E I (j, p, j , p ). We keep the dependence of E F on L implicit, since none of our computations will explicitly depend on L. Similar to the bounds discussed in Section 4.2.2, we require bounds on the norm (respectively matrix elements) of these transfer operators. These are given by the following: Lemma 6.3. Let F ∈ (C p ) ⊗L , j, j ∈ [L], and momenta p, p be arbitrary. Then we have |E(j, p, j , p )|r = δ j,j c pp , and For the proof of Lemma 6.3 (and other arguments below), we make repeated use of the following states. Let L ∈ [n]. Define on C D ⊗ (C p ) ⊗L ⊗ C D . Despite the similar notation, these states are not to be confused with the "position space" states |Φ j,p introduced in equation (43). The key property of the states |Φ L j,p is the following: Lemma 6.4. The states (53) have inner product independently of the value of L.
Proof. First, consider the case where j = j. Then we have Φ L j,p |Φ L j,p = |E j−1 E B(p )B(p) E L−j |r = |E B(p )B(p) |r = c pp , where we have used the fixed-point equations (15). That is, we have Φ L j,p |Φ L j,p = = .
In a similar fashion, we can compute, for j < j , where we have used the fixed-point equations (15) and the gauge condition (44). The proof for j > j is analogous.
Proof of Lemma 6.3. We first prove (49). The expression of interest can be written diagrammatically as |E F (j, p, j , p )|r = = Φ L j ,p |(I ⊗ F ⊗ I)|Φ L j,p .
Equation (48) follows by setting F to be equal to the identity on (C p ) ⊗L and using the orthogonality relation (54). Furthermore, we have

The claim (49) then follows from (54).
Let us next prove (50). By the definition of the Frobenius norm · F , we have is an orthonormal basis of C D . The terms in the sum can be written diagrammatically as Defining vectors on (C p ) ⊗L , we have The norm of the vector (55) can be bounded as In the first inequality, we have used (30), together with the fact that |β α| ⊗ |β α| F = 1 .
In the second inequality, we have used Lemma 4.2, along with the fact ρ(E) = 1. The claim (50) follows from this. With a completely analogous proof, we also have which are claims (51) and (52).

Matrix elements of local operators in the excitation ansatz 6.4.1 Overview of the proof
Let us give a high-level overview of the argument used to establish our main technical result, Lemma 6.8. The latter gives estimates on matrix elements φ p |F |φ p of a dlocal operator F with respect to normalized excitation ansatz states |φ p and |φ p , with possibly different momenta p and p . More precisely, to apply the approximate Knill-LaFlamme conditions for approximate error-detection, we need to establish two kinds of bounds: 1. For p = p (i.e., the non-diagonal elements), our aim is to argue that | φ p |F |φ p | vanishes as an inverse polynomial in n. This is ultimately a consequence of the fact that in the Jordan decomposition E = |r | ⊕Ẽ of the transfer matrix, the sub-dominant termẼ has norm decaying exponentially with a rate determined by the second largest eigenvalue λ 2 .
2. For the diagonal elements, our aim is to argue that φ p |F |φ p is almost independent of p, that is, we want to show | φ p |F |φ p − φ p |F |φ p | is small for different momenta p = p . For this purpose, we need to identify the leading order term in the expression φ p |F |φ p . Higher order terms are again small by the properties of the transfer operator.
To establish these bounds, first observe that an unnormalized excitation ansatz state |Φ p (B; A) is a superposition of the "position space" states {|Φ j,p } n j=1 , where each state |Φ j,p is given by a simple tensor network with an "insertion" of an operator at site j . Correspondingly, we first study matrix elements of the form Φ j ,p |F |Φ j,p . Bounds on these matrix elements are given in Lemma 6.5. The idea of the proof of this statement is simple: in the tensor network diagram for the matrix element, subdiagrams associated with powers E ∆ with sufficiently large ∆ may be replaced by the diagram associated with the map |r |, with an error scaling term scaling as O(λ ∆/2 2 ). This is due to the Jordan decomposition of the transfer operator. Thanks to the gauge condition (44), the resulting diagrams then simplify, allowing us to identify the leading order term.
To realize this approach, a key step is to identify suitable subdiagrams corresponding to powers E ∆ in the diagram associated with Φ j ,p |F |Φ j,p . These are associated with connected regions of size ∆ where the operator F acts trivially, and there is no insertion of B(p) (respectively B(p )), meaning that j and j do not belong to the region. Lemma 6.5 provides a careful case-by-case analysis depending on, at the coarsest level of detail, whether or not j and j belong to a ∆-neighborhood of the support of F . Some subleties that arise are the following: to obtain estimates on the leading-order terms for the diagonal matrix elements (see (2) above) as well as related expressions, a bound on the magnitude of the matrix element Φ j,p |F |Φ j,p only is not sufficient. The lowest-order approximating expression to Φ j,p |F |Φ j,p obtained by making the above substitutions of the transfer operators a priori seems to depend on the exact site location j. This is awkward because the term Φ j,p |F |Φ j,p appears as a summand (with sum taken over j) when computing matrix elements of excitation ansatz states. We argue that in fact, the leading order term of Φ j,p |F |Φ j,p is identical for all values of j not belonging to the support of F . This statement is formalized in Lemma 6.6 and allows us to subsequently estimate sums of interest without worry about the explicit dependence on j.
Finally, we require a strengthening of the estimates obtained in Lemma 6.5 because we are ultimately interested in excitation ansatz states: these are superpositions of the states |Φ j,p , with phases of the form e ipj . Estimating only the magnitude of matrix elements of the form Φ j ,p |F |Φ j,p is not sufficient to establish our results. Instead, we need to treat the phases "coherently", which leads to certain cancellations. The corresponding statement is given in Lemma 6.7.

The proof
We will envision the sites {1, . . . , n} as points on a ring, i.e., using periodic boundary conditions, and measure the distance between sites j, j by dist(j, j ) := min k∈Z |j − j + k · n|.
For an operator F acting on (C p ) ⊗n , let supp(F ) ⊂ {1, . . . , n} denote its support, i.e., the sites of the system that the operator acts on non-trivially. We say that F is d-local if |supp(F )| = d. Let us assume that supp(F ) decomposes into κ disjoint connected components We may, without loss of generality, assume that this gives a partition of {1, . . . , n} into disjoint connected sets . . , κ − 2}, and A 0 is right-adjacent to F κ−1 . We may then decompose the operator F as where we write F as a sum of decomposable tensor operators (indexed by i), with each F i,α being an operator acting on the component F α .
Let us define a function τ : {1, . . . , n}\supp(F ) → {0, . . . , κ − 1} which associates to every site j ∈ supp(F) the unique index τ (j) for the component A τ (j) of the complement of supp(F ) such that j ∈ A τ (j) . It is also convenient to introduce the following operators {F (τ )} κ−1 τ =0 . The operator F (τ ) is obtained by removing the identity factor on the sites A τ of F , and cyclically permuting the remaining components in such a way that F τ ends up on the sites {1, . . . , |F τ |}. More precisely, we define F (τ ) ∈ B((C p ) ⊗(n−|Aτ |) ) by for τ ∈ {0, . . . , κ − 1}. We note that j → F (τ (j)) associates a permuted operator to each site j not belonging to the support of F . Let us also define ι(j) to be the index of the site which gets cyclically shifted to the first site when defining F τ (j) . An example is shown diagrammatically in Figure 6. For two excitation ansatz states |Φ p and |Φ p , and an operator F on (C p ) ⊗n , we may write the corresponding matrix element as where |Φ j,p are the "position space" states introduced in equation (43). We are interested in bounding the magnitude of this quantity. We begin by bounding the individual terms in the sum (58).
Lemma 6.5. Let j, j ∈ {1, . . . , n} and let p, p be arbitrary non-zero momenta. Consider the states |Φ j,p and |Φ j ,p defined by (43). Let ∆ = ∆(n) and d = d(n) be monotonically increasing functions of n. Suppose further that we have 10∆d < n .
Assume F is a d-local operator of unit norm on (C p ) ⊗n whose support has κ connected components as in (56). Then we have the following.
(i) There is some fixed q ∈ [n] such that for all j, j ∈ B ∆ (supp(F )), we have Furthermore, Here the operator F (τ (j)) is defined by equation (57).
Then we may write Φ j ,p |F |Φ j,p = tr (E F (j, p, j , p )) = tr E s E I ⊗∆ ⊗F τ (q) ⊗I ⊗∆ (ĵ, p,ĵ , p ) (60) where s ≥ 2∆. This is because by the choice of q, there are at least 2∆ sites not belonging to supp(F ) both on the left and the right of q. Each of these 4∆ sites contributes a factor E = E I (i.e., a single transfer operator) to the expression within the trace.
The term E I ⊗∆ ⊗F τ (q) ⊗I ⊗∆ (ĵ, p,ĵ , p ) incorporates ∆ of the associated transfer operators E = E I on the left-and right of q, respectively, such that at least 2∆ factors of E remain. By the cyclicity of the trace, these can be consolidated into a single term E s with s ≥ 2∆. The operator I ⊗∆ ⊗F τ (q) ⊗I ⊗∆ (i.e., the additional I ⊗∆ factors) in the term E I ⊗∆ ⊗F τ (q) ⊗I ⊗∆ (ĵ, p,ĵ , p ) is used to ensure that j and j are correctly "retained" when going from the first to the second line in (60). Inserting the Jordan decomposition E = |r | ⊕Ẽ, we obtain By Lemma 4.2(ii) and Lemma 6.3, we have the bound where we have used the fact that λ s/2 2 ≤ λ ∆ 2 in the last line. We have also absorbed the dependence on the constants D, F , and E B(p )B(p ) F E B(p )B(p) F into the big-O notation. Inserting this into (61) gives the first claim of (i). Now consider the inner product Φ j ,p |Φ j,p = tr(E(j, p, j , p )), which corresponds to the case where F is the identity. By the cyclicity of the trace, this can be written as Φ j ,p |Φ j,p = tr(E s E(ĵ, p,ĵ , p )) for some s ≥ 2∆ and suitably definedĵ,ĵ . Repeating the same argument as above and using the fact that |E(ĵ, p,ĵ , p )|r = ∆ĵ ,ĵ c pp = ∆ j,j c pp by definition of E(ĵ, p,ĵ , p ), equation (15) (i.e., the fact that | and |r are left-respectively right eigenvectors of E), and the gauge identities (44) of E B(p) and E B(p) , we obtain the claim (59). Now consider claim (ii). Suppose that j, j ∈ B ∆ (supp(F )). We consider the following two cases: (iia) If j = j , then there is a connected region of at least ∆ sites not belonging to supp(F ) to either the left of j and not containing j, or the left of j and not containing j . Without loss of generality, we assume the former is the case. By the cyclicity of the trace, we may also assume without loss of generality that j = ∆ + 1, j > j , and that F is supported on the sites {2∆ + 2, . . . , n}. LetF denote the restriction of F to the sites {∆ + 2, . . . , n}, and letĵ := j − (∆ + 1). Then we may write Φ j ,p |F |Φ j,p = tr E ∆ E B(p ) EF (ĵ, p) .

Substituting the Jordan decomposition
Since we assume that p = 0, the gauge condition (44) states that |E B(p) = 0, hence the first term vanishes and it follows that as claimed in (iia). In the last line, we have again absorbed the constants into the big-O-expression. This proves part (iia) of Claim (ii).
(iib) If j = j , then there are at least ∆ sites to the left and right of j which do not belong to supp(F ). Therefore we may write where s and t are integers greater than ∆, representing the sites surrounding j which are not in the support of F .
Applying the Jordan decomposition E ∆ = |r | ⊕Ẽ ∆ twice (for E s and E t ) then gives four terms Φ j ,p |F |Φ j,p = |E B(p )B(p) |r |E F (τ (j)) |r Since s and t are both larger than ∆, by the same arguments from before, it is clear that the last three terms can each be bounded by O(λ ∆/2 2 ). The claim follows since |E B(p )B(p) |r = c pp .
Next, we give the proof of claim (iii). Let us consider the situation where j ∈ B ∆ (supp(F )) and j ∈ B ∆ (supp(F )). The proof of the other setting is analogous. We consider two cases: (iiia) Suppose j ∈ B 2∆ (supp(F )). Let us define the shifted indexĵ = j − ι(j ) + ∆ + 1 (mod n). Then we may write where s and t are integers larger than ∆, representing the number of sites adjacent to j on the left and right which are not in B ∆ (supp(F )). We use the Jordan where the first term vanishes due to the gauge condition (44). From Lemma 4.2(ii) we have E t F ≤ 1, and repeating the same arguments as before, we get the bound Since s ≥ ∆, we conclude that (iiib) Suppose now that j ∈ B 2∆ (supp(F )). Then by repeating the argument for case (i), with ∆ replaced by 2∆, we obtain , where we now have q ∈ B 4∆ (F). Again, the existence of such a q is guaranteed by the condition 10∆d < n.
We note that (iv) follows immediately from (iii) by interchanging the roles of (j, p) and (j , p ). Note that we can write Φ j ,p |F |Φ j,p = Φ j ,p |F |Φ j,p = Φ j,p |F † |Φ j ,p .
The last expression within the parentheses is precisely what we had calculated in (iii), so this implies the following: 2 ), where we note that the exact same bound holds for F and F † since F = F † .
2 ). This proves the claim. 7 Note that in the statement (iib), the dependence on j in the expression |E F (τ (j)) |r can be eliminated as follows: Lemma 6.6. Suppose j 1 , j 2 ∈ B ∆ (supp(F )). Then In particular, for any fixed j 0 ∈ B ∆ (supp(F )) we have Proof. The claim (63) follows immediately from (62) and claim (iib) of Lemma 6.5 since , there is nothing to prove. Suppose τ (j 1 ) = τ (j 2 ). Without loss of generality, assume that τ (j 1 ) = 0 and τ (j 2 ) = ξ. Then we may write where a α = |A α | for α ∈ {0, . . . , κ}. Defining the operatorŝ (We give an example for the operator F , F (τ (j 1 )) and F (τ (j 2 )) in Figure 7.) Therefore we can write where |Φ L j,p are the states defined by (53), for some appropriate length L. Then we can proceed to conjugate the matrix element, giving us Figure 7: Example for the operator F and the corresponding F (τ (j 1 )) and F (τ (j 2 )).
Inserting the Jordan decomposition E = |r | ⊕Ẽ gives Taking the difference, the first terms of the sums cancel, and we are left with We can bound the first term i |EĜ iẼ a ξ EF i |r as follows. First, we write where the last inequality comes from the fact that j 2 ∈ B ∆ (supp(F )) and j 2 ∈ A ξ implies that a ξ ≥ 2∆, so Lemma 4.2(ii) gives Ẽ a ξ F ≤ λ ∆ 2 . Proceeding as we did in the proof of Lemma 6.3, we can write the latter Frobenius norm as The individual terms in the sum can be depicted diagrammatically as Defining the vectors we can then write Applying the Cauchy-Schwarz inequality, we get The norm of the vector |Ψ(α, β) is given by where in the second equality we have used the fixed-point equations (15). Therefore we have where the last equality follows from the fact that we gauge-fix the left and right fixedpoints such that r = I C D and tr( ) = 1. Finally, we note that since the operator norm is multiplicative over tensor products, i.e., A ⊗ B = A · B , we have The term involving a 0 in (64) can be bounded identically, and so which proves (62).
We also need a different version of statement (i), as well as statements (iiib) and (ivb) derived from it.
Finally, we have the following: There exists some fixed j 0 ∈ [n] such that for p = p , we have For p = p , we have We observe that the first expression on the right-hand side of the above bound scales linearly with the support size of F instead of the support size of F c , as may be naively expected. For (69), this is due to a cancellation of phases, see (73) below.
Proof. For the proof of (65), let us first define the vectors Then we can write where the last inequality follows by Cauchy-Schwarz along with the definition of the operator norm F . The vector norm is given by and together with equation (59), we get . Taking the square root and inserting into equation (70), we get Using the bound B ∆ (F) ≤ 5d∆ < n gives (65). Next, let us look at (66). We have where we define The norm of the second sum can be bounded using Lemma 6.5(iiia), giving us where we again use the trivial bound B ∆ (F) , B 2∆ (F) c ≤ n in the last line. Using Lemma 6.5 (iiib), we can express the first sum, with some fixed q ∈ [n], as where the indicesĵ andĵ are defined as in Lemma 6.5. To bound the remaining sum, let us introduce the states |Ψ 1 (p) := j∈B ∆ (F ) e ipj |Φ L j,p , and where we set L = |supp(F (τ (q)))|. Here, |Φ L j,p are as defined in (53). Then we can write By the Cauchy-Schwarz inequality and the orthogonality relations (54), we have where we bound the states |Ψ 1,2 (p) in exactly the same way as we did in the proof of (65). Using the fact that |B ∆ (F)|, |B 2∆ (F)\B ∆ (F)| ≤ |B 2∆ (F)|, we conclude that Combining this with (71) gives the claim (66). The proof of (67) is analogous, using Lemma 6.5(iv). Finally, consider (68) and (69). We have Using Lemma 6.5(iia), we have On the other hand, by Lemma 6.5(iib), or more precisely its refinement in the form of equation (63) from Lemma 6.6, we have for some fixed j 0 ∈ B ∆ (F) c . For p = p, the sum above is given trivially by j∈B ∆ (F ) c 1 = B ∆ (F) c . For p = p , we have j∈[n] e ij(p−p ) = 0, and hence Therefore, for p = p we have and for p = p , we have Note that we also have c pp ≤ √ c p c p by the Cauchy-Schwarz inequality. Combining these results with (72) proves claims (68) and (69).

The parameters of codes based on the excitation ansatz
Recall that the normalization of the excitation ansatz states |Φ p ≡ |Φ p (B; A) are given by Lemma 6.2 as 2 ).
In the following, we let |φ p denote the normalized versions of |Φ p . In terms of matrix elements, we have Our main technical result for the excitation ansatz consists of the following estimates: Lemma 6.8. Let ν ∈ (0, 1) and d = n 1−ν . Let F ∈ B((C p ) ⊗n ) be a d-local operator with unit norm. Consider the normalized versions |φ p and |φ p of the excitation ansatz state (42). Then we have and Proof. By definition of the excitation ansatz states, we have where , , is the partition of [n] 2 considered in Lemma 6.7. Thus, for p = p , we obtain Inserting the expression (74) for the normalized matrix element, we get Assume that supp(F ) consists of κ disjoint connected components. By definition, we have where we use the fact that κ ≤ d in the last inequality. Hence, we have Let 1 > ν > 0 be arbitrary. Choosing d = n 1−ν and ∆ = 6n ν/2 gives 8 and therefore Note that the last equality follows since, for all λ 2 < 1 and a, b > 0, we have lim n→∞ n a λ n b 2 = 0. This proves claim (75).
Next, we prove (76). Making use of equation (74) and the decomposition (77), we have By Lemma 6.7 we have and so we can write It remains to consider the terms involving Ω 4 , whereby using equation (68) we get 2 ). 8 Note that this choice of d and ∆ satisfies the requirement in Lemma 6.5 for sufficiently large n.
Putting everything together, we have where we again use the bound (78) in the last line. This proves claim (76).
With Lemma 6.8, it is straightforward to check the condition for approximate quantum error-detection from Section 3.2. This leads to the following: Theorem 6.9. Let ν ∈ (0, 1) and let κ, ∆ > 0 be such that 5κ + λ < ν .
Let A, B be tensors associated with an injective excitation ansatz state |Φ p (B; A) , where p is the momentum of the state. Then there is a subspace C ⊂ (C p ) ⊗n spanned by excitation Proof. Let us choose an arbitrary set {p 1 , . . . , p p k } of p k = n κ distinct, non-zero momenta and define the space C by Since momentum eigenstates to different momenta are orthogonal, the states {|φ p j } p k j=1 form an orthonormal basis of C. By Lemma 6.8, we have | φ pr |F |φ ps − δ r,s φ p 1 |F |φ p 1 | = O(n −ν/2 ) .
for any d-local unit norm operator F ∈ B((C p ) ⊗n ) and all r, s ∈ [p k ]. The sufficient conditions of Corollary 3.4 for approximate error-detection applied with γ = Θ(n −ν/2 ) show that C is a (Θ(p 5k n −ν /δ), δ)[[n, k, d]]-AQEDC for any δ satisfying δ > p 5k n −ν . This implies the claim for the given choice of parameters.
From [64], we know that isolated energy bands in gapped systems are well approximated, under mild physical conditions, by the Fourier transforms of local operators. In particular, this means that, possibly after blocking, isolated momentum eigenstates of gapped systems are well approximated by some excitation ansatz state, as one would expect. 9 One consequence of this is that the excitation ansatz codes considered in this section are generic among physical systems: essentially any selection of momentum eigenstates from an isolated energy band of a gapped system can be expected to form an error-detecting code with the above parameters.

AQEDC at low energies: An integrable model
In this section, we consider the Heisenberg-XXX spin chain. In Section 7.1, we introduce the model. The approximate error-detection codes we consider are spanned by eigenstates that we call magnon-states. The latter are particular instances of the algebraic Bethe ansatz, for which a general framework of MPS/MPO descriptions has been introduced in prior work [65]. We review the necessary notation for matrix product operators (MPOs) in Section 7.2. In Section 7.3, we give an MPS/MPO description of magnon-states. In Section 7.4, we provide a second MPS/MPO description with smaller bond dimension. In Section 7.5, we consider matrix elements of operators with respect to the magnonstate basis. We show how to relate matrix elements of operators with arbitrary support to matrix elements of operators with connected support. In Section 7.6 we analyze the Jordan structure of the transfer operators. In Section 7.7, we bound matrix elements of local operators in magnon states. Finally, in Section 7.8, we determine the parameters of the magnon code.

The XXX-model and the magnon code
Consider the periodic Heisenberg-XXX spin chain, with Hamiltonian on (C 2 ) ⊗n , where we apply periodic boundary conditions, and where σ x m , σ y m , σ z m are the Pauli matrices acting on the m-th qubit. The model (79) is gapless and can be solved exactly using the algebraic Bethe ansatz. Our goal here is to argue that (79) contains error-detecting codes in its low-energy subspace. More precisely, we consider subspaces spanned by non-zero momentum eigenstates.
The Hamiltonian (79) may alternatively be expressed as where F m,m+1 is the flip-operator acting on the m-th and (m + 1)-th qubit. Equation (80) shows that H commutes with the tensor product representation of the special unitary group SU (2) on (C 2 ) ⊗n , hence we may restrict to irreducible subspaces (with fixed angular momentum) to diagonalize H. More precisely, let us define, for each qubit m, the operators These satisfy the canonical su(2) commutation relations, with s + and s − being the raising and lowering operators of the spin-1/2 representation, and the basis states |0 and |1 corresponding to |j, m = |1/2, −1/2 and |1/2, 1/2 , respectively. The total z-angular momentum and raising/lowering-operators for the tensor product representation on (C 2 ) ⊗n are given by These operators commute with H, and therefore the total Hilbert space splits into a direct sum of spin representations: where the direct sum is taken over all irreducible spin represenations (with multiplicity m j ) present in the decomposition of the tensor representation. Each H j defines an irreducible 2j + 1-dimensional angular momentum-j representation, and H| H j = E j I H j is proportional to the identity on each of these spaces. For instance, the subspace H n/2 with maximal angular momentum has highest weight vector |1 ⊗n and is spanned by "descendants" obtained by applying the lowering operator, that is, It is associated with energy E n/2 = −n/4, which is the ground state energy of H. Clearly, this is the symmetric subspace, containing only permutation-invariant (i.e., zeromomentum) states. Error-correction within this subspace has been considered in [52]. Indeed, all the examples constructed there consist of subspaces of H n/2 .
Here we go beyond permutation-invariance. Specifically, we consider the vector The factor ω in front is introduced for convenience. A straightforward calculation shows that S + |Ψ = 0 and S 3 |Ψ = (n/2 − 1) |Ψ , hence this is a highest weight vector for angular momentum j = n/2 − 1 and The energy of states in this subspace can be computed to be E n/2−1 = −n/4 + 1 − cos(2π/n) = E n/2 + O(1/n 2 ). This shows that these states are associated with lowlying excitations, and the system is gapless. Observe also that (81) is an eigenvector of the cyclic shift with eigenvalue ω, that is, it has fixed momentum p = 2π/n. As S r − commutes with the cyclic shift, the same is true for all states in H n/2−1 : this is a subspace of fixed momentum and energy. We will argue that H n/2−1 contains error-detecting codes. Specifically, we consider subspaces spanned by states of the form {S r − |Ψ } r for appropriate choices of magnetization r. The state (81) is sometimes referred to as a one-magnon state. Correspondingly, we call the corresponding code(s) the magnon-code. We also refer to the vectors {S r − |Ψ } r (respectively, their normalized versions) as magnon-states. For brevity, let us denote the r-th descendant by It is clear that the states |Ψ r and |Ψ s are orthogonal for r = s as they have different magnetization, hence they form a basis of the magnon code. It is also convenient to introduce their normalized versions which are given by as follows from the fact that for a normalized highest-weight vector |j, j of a spin-jrepresentation, the vectors with k = 0, . . . , 2j form an orthonormal basis.

Matrix product operators
Here we briefly review the formalism of matrix product operators (MPO) and introduce the corresponding notation. We only require site-independent MPO. Such an MPO O ∈ B((C p ) ⊗n ) with bond dimension D is given by Equation (85)  We refer to the tensor O as a local MPO tensor, and to X as a boundary operator.
It is convenient to introduce the following product on MPO tensors. Suppose O 1 and O 2 are MPO tensors associated with MPOs having physical dimension p, and bond dimensions D 1 and D 2 , respectively. Then O 1 O 2 is the MPO tensor of an MPO with physical dimension p and bond dimension D 1 · D 2 . Its tensor network description is given This is clearly associative, and allows us to define O k := O O (k−1) recursively. Suppose now that an MPO O = O(O, X, n) is given. Observe that for k ∈ N, the operator O k is an MPO whose virtual bond space is (C D ) ⊗k and whose local tensors take the form  see Figure 11 for the definition of the MPS tensor O T . In the following, we are interested in matrix elements of the form Ψ|O|Ψ . A central object of study is the generalized transfer operator

this is given by
This operator, as well as E O k ∈ B(C p ⊗ (C D 2 ) ⊗k ⊗ C p ) for k = 3 are illustrated in Figure 12. Consider

MPS/MPO representation of the magnon states
Here we give an MPS/MPO representation of the magnon states that we use throughout our analysis below. We note that more generally, [65] discusses such representations for the Bethe ansatz states.
Consider the one-magnon state |Ψ ∈ (C 2 ) ⊗n defined by (81). It is straightforward to check that an MPS representation of |Ψ = |Ψ({A 0 , A 1 , X}) with bond dimension D = 2 is given by where ω = e 2πi/n , see Figure 14. Next, we consider the descendants (83). The operator S − = n m=1 s − m can be expressed as a bond dimension D = 2 MPO, given by where the boundary tensor is X = σ − := |0 1|, and where the local tensors are defined as This definition is illustrated in Figure 15. The adjoint operator S + has an MPO representation described as in Figure 16.
It follows that the "descendants" |Ψ s = S s − |Ψ can be represented as in Figure 17, i.e., they are MPS of the form where the MPS tensor O T is defined as in equation (86).

A compressed MPS/MPO representation of the magnon states
Consider the MPO representation (88) of S − . For s ∈ [n], it implies the MPO representation for the s-th power of S − , which has bond dimension D = 2 s . Below we argue that the MPO (89) can also be expressed as an MPO with bond dimension s + 1. We call this the compressed representation: Here the virtual space C s+1 is that of a spin-s/2 with orthonormal angular momentum eigenstate basis {|s/2, m | m = − s 2 , −s/2 + 1, . . . , s/2}. The boundary tensor is X s = |s/2, −s/2 s/2, s/2| and the MPO tensorÕ s is defined by the matrices where J + is the usual spin-raising operator. 10 In particular, the states |Ψ s = S s − |Ψ have an MPS representation of the form |Ψ s = |Ψ(Õ s A,X s ⊗ X, n) , with bond dimension 2(s + 1).

Action of the symmetric group on the magnon states
The symmetric group S n acts on (C 2 ) ⊗n by permuting the factors, i.e., we have for an orthonormal basis {|e 1 , |e 2 } ∈ C 2 that π(|e i 1 ⊗ · · · ⊗ |e in ) = |e i π −1 (1) ⊗ · · · ⊗ |e i π −1 (n) for all π ∈ S n , and this is linearly extended to all of (C 2 ) ⊗n . Since the space span{S k − |Ψ | k ∈ N 0 } is invariant under permutations. In the following, we will show that the restriction of the group action to this space has a particularly simple form: every permutation acts as a tensor product of diagonal unitaries. Our main claim (Theorem 7.3 below) follows from (92) and the following statement.
It is convenient to express the corresponding statements diagramatically. First observe that specializing (92) to a neighboring transposition and inserting the MPO description of S − introduced in Section 7.3, we obtain the diagrammatic identity The main feature we need in what follows is the following statement: Lemma 7.3. Consider the spin j = n/2 − 1 subspace H n/2−1 ⊂ (C 2 ) ⊗n introduced in equation (82). Let τ = (k k + 1) ∈ S n be an arbitrary transposition of nearest neighbors. Then the restriction of τ to H n/2−1 is given by the operator Proof. It suffices to check that τ S s − |Ψ = (I ⊗k−1 ⊗ Z † ⊗ Z ⊗ I ⊗n−k−1 )S s − |Ψ . This follows immediately from Lemma 7.2. A diagrammatic proof of the steps involved can be given as follows (illustrated for s = 3): Here we used (95) s times in the first identity, equation (96) in the second identity, and equation (97) (applied s times) in the last step.
An immediate and crucial consequence of Lemma 7.3 and the unitarity of Z is the fact that matrix elements of an operator acting on d arbitrary sites can be related to matrix elements of a local operator on the d first sites. To express this concisely, we use the following notation: suppose F = F 1 ⊗ · · · ⊗ F d ∈ B((C 2 ) ⊗d ) is a tensor product operator and A = {a 1 < · · · < a d } ⊂ [n] a subset of d = |A| (ordered) sites. Then we write F A ⊗ I [n]\A ∈ B((C 2 ) ⊗n ) for the operator acting as F k on site a k , for k ∈ [d]. By linearity, this definition extends to general (not necessarily product) operators F ∈ B((C 2 ) ⊗d ).

Note that if
More generally, if B ⊂ [n] is a subset of size b = |B| located "to the right of A" (i.e., if min B > max A) and G ∈ B((C 2 ) ⊗b ), then Furthermore, the analogous statement holds when G is permuted to the right, but with Z replaced by Z † .
Succintly, equation (98) can be represented as follows in the case where A consists of a connected set of sites (and r = s = 0): We emphasize, however, the analogous statement is true for the more general case where A is a union of disconnected components.
Proof. The proof of equation (98) for a single-site operator F is immediate. We have (illustrated for r = s = 0): Applying (98) (with d = 1) iteratively then shows that the claim (98) also holds for any tensor product operator F = F 1 ⊗· · ·⊗F d . The general claim then follows by decomposing an arbitrary operator F into tensor products and using linearity.

The transfer operator of the magnon states and its Jordan structure
We are ultimately interested in matrix elements Ψ r |(F ⊗I ⊗(n−d) )|Ψ s where F ∈ B((C 2 ) ⊗d ) acts on d sites. Using the compressed representation from Lemma 7.1, we may write these as We are thus interested in the ("overlap") transfer operator Observe that E 0,0 is the transfer operator E of the MPS |Ψ , whereas E 0,s is the transfer operator of S s − |Ψ . We will order the tensor factors such that the virtual spaces of the original MPS are the first two factors. Then E r,s ∈ B(C 2 ⊗ C 2 ⊗ C r+1 ⊗ C s+1 ). Our main goal in this section is to show the following: Theorem 7.5. Let r, s ∈ {0, . . . , n} be arbitrary. Then the operator E r,s ∈ B(C 2 ⊗ C 2 ⊗ C r+1 ⊗C s+1 ) has spectrum spec(E r,s ) = {1, ω, ω} (where 1 has multiplicity 2·(r +1)(s+1) and ω, ω each have multiplicity (r + 1)(s + 1)). The size h * of the largest Jordan block in E r,s is bounded by h * ≤ min{r, s} + 2 .
To prove this theorem, we first rewrite the operator E r,s . We have whereÕ † r is obtained from the defining matrices {Õ α,β } α,β ofÕ by replacingÕ α,β with its adjoint (Õ † ) α,β . This amounts to replacing σ − by σ + , or alternatively, swapping the indices in the defining matrices {(Õ s ) i,j } (cf. (90)). That is, where J +,s and J +,r are the raising operators in the spin-s/2 respectively the spin-r/2 representation, respectively. We conclude that where S + are the raising operator S + of the spin-j representation with j = r/2 and j = s/2, respectively. Here are the transfer operators of the MPS |Ψ . We can write down the transfer matrix E r,s more explicitly as where A 0 = σ + = 0 0 1 0 , and A 1 = 1 0 0 ω are the defining tensors of the original state |Ψ (cf. (87)). With this, we can give the proof of the above theorem as follows.
Proof of Theorem 7.5. Observe that in the standard basis of the spin-j-representation, the raising operator J + is strictly lower diagonal. From (99) and the definition of A 0 and A 1 , it follows that the transfer operator E r,s is lower diagonal in the tensor product basis (consisting of these standard bases and the computational basis of C 2 ) since each term in the sum is a tensor product of lower diagonal matrices. In fact, every term except is strictly lower diagonal. Therefore, we see that the eigenvalues of E r,s are given by the diagonal entries of D, and consist of the eigenvalue 1 with multiplicity 2(r + 1)(s + 1), and the eigenvalues ω and ω, both with multiplicity (r + 1)(s + 1). Observe that A 0 and A 1 commute up to a factor of ω, that is, To shorten some of the expressions, let define We note that each N i is a nilpotent matrix of order 2, i.e., since A 2 0 = 0. Moreover, for the same reason and (100), we have equation (100) also implies that where q i (ω) ∈ {1, ω, ω}. Now consider the transfer operator with its diagonal term removed, i.e., E r,s − D = N 1 ⊗ I ⊗ I + N 2 ⊗ I ⊗ J +,s + N 3 ⊗ J +,r ⊗ I + A ⊗ J +,r ⊗ J +,s .
(ii) The product of any min{r, s} + 2 operators in X is equal to zero.
Property (i) follows immediately with the commutation relation (102) because D = A ⊗ I ⊗I. Similarly, property (ii) follows from the nilpotency relation (101), the commutation relation (102) and the fact that We can write these two properties succintly as equalities of sets, that is, DX = X D , and (103) for all m ≥ min{r, s} + 2 , where e.g., X 2 = {X 1 X 2 |X 1 , X 2 ∈ X }. Let us write D λ = D − λI. Then E r,s − λI = D λ + (E r,s − D) ∈ D λ + X .
Therefore the minimal polynomial of E r,s must divide p(x) = [(x − 1)(x − ω)(x − ω)] min{r,s}+2 . Thus the Jordan blocks of E r,s are bounded above in size by min{r, s} + 2, as claimed.

Matrix elements of magnon states
With the established bounds on the Jordan structure of E r,s , we can derive upper bounds on overlaps of magnon states. Recall that |Ψ r = S r − |Ψ for r = 0, . . . , n − 2 and |ψ r is its normalized version (cf. (84)) .
We also need estimates for the difference of expectation values of magnon states. Let us first show that the reduced d-local operators are all essentially the same. Observe that for d < n for a vector |Φ ∈ (C p ) ⊗n satisfying (|1 1| ⊗d ⊗ I ⊗n−d )|Φ = 0. In particular, we have (|1 1| ⊗d ⊗ I ⊗(n−d) )|Ψ n s = ω d |1 ⊗d |Ψ n−d s .
Using the triangle inequality, the claim follows.
Proof. We claim that the subspace C = span{ψ s | s even and s ≤ 2n κ } spanned by a subset of magnon-states has the claimed property. Clearly, dim C = n κ = 2 k .
Let F be an arbitrary d-local operator on (C 2 ) ⊗n of unit norm. According to Lemma 7.4, the following considerations concerning matrix elements ψ q |F |ψ p of magnon states do not depend on the location of the support of F as we are interested in the supremum over d-local operators F and unitary conjugation does not change the locality or the norm. Thus, we can assume that F =F ⊗ I ⊗n−d . That is, we have sup The sufficient conditions of Corollary 3.4 for approximate error-detection, applied with γ = Θ(d 1/2 n (κ−1)/2 ), thus imply that C is an (Θ(2 5k dn κ−1 )/δ, δ)[[n, k, d]]-AQEDC for any δ satisfying δ > Θ(2 5k dn κ−1 ) = Θ(n 6κ−ν ) .

A Canonical form of excitation ansatz states
For the reader's convenience, we include here a proof of the Lemma 6.1 following [74].
Lemma 6.1. Let |Φ p (B; A) be an injective excitation ansatz state and assume that A is normalized such that the transfer operator has spectral radius 1. Let and r be the corresponding left-and right-eigenvectors corresponding to eigenvalue 1. Assume p = 0.
Proof. We note that the equations (44) can be written as It is then easy to check that where B + C is the MPS tensor obtained by setting (B + C) j = B j + C j for each j = 1, . . . , p. Indeed, the difference of these two vectors is n k=1 e ipk tr(A i 1 · · · A i k−1 C i k A i k+1 · · · A in )|i 1 · · · i n = i 1 ,...,in∈ [p] n k=1 e ipk tr A i 1 · · · A i k−1 (A i k X − e −ip XA i k )A i k+1 · · · A in |i 1 · · · i n = 0 , since the terms in the square brackets vanish because of the cyclicity of the trace (alternatively, this can be seen by substituting each square box (corresponding to B) in Figure 5 by a formal linear combination of a square box (B) and diagram (107)).
Observe that the second equation in (106) can be obtained from the first by taking the adjoint since is a selfadjoint operator. It thus suffices to show that there is an MPS tensorB with the desired property |Φ p (B; A) = |Φ p (B; A) such that It turns out that settingB = B + C for an appropriate choice of X (and thus C) suffices. equation (108) then amounts to the identity
Since is full rank, we may substitute X = −1 Y . Then (109) Because 1 is the unique eigenvalue of magnitude 1 of E, the map (λI − e −ip E) is invertible under the assumption that p = 0, and we obtain the solution A † j B j   to equation (109), proving the claim for p = 0.