Enhancing detection of topological order by local error correction

The exploration of topologically-ordered states of matter is a long-standing goal at the interface of several subfields of the physical sciences. Such states feature intriguing physical properties such as long-range entanglement, emergent gauge fields and non-local correlations, and can aid in realization of scalable fault-tolerant quantum computation. However, these same features also make creation, detection, and characterization of topologically-ordered states particularly challenging. Motivated by recent experimental demonstrations, we introduce a paradigm for quantifying topological states—locally error-corrected decoration (LED)—by combining methods of error correction with ideas of renormalization-group flow. Our approach allows for efficient and robust identification of topological order, and is applicable in the presence of incoherent noise sources, making it particularly suitable for realistic experiments. We demonstrate the power of LED using numerical simulations of the toric code under a variety of perturbations. We subsequently apply it to an experimental realization, providing new insights into a quantum spin liquid created on a Rydberg-atom simulator. Finally, we extend LED to generic topological phases, including those with non-abelian order.

Topological ordering is an exotic phenomenon which can occur when quantum fluctuations and local constraints stabilize a state with long-range entanglement [1].With their non-local correlations, topologicallyordered states feature many remarkable properties and can be used for protecting quantum information nonlocally [1][2][3].Yet, because these states appear to be liquid-like at short length-scales [4], they cannot be identified or characterized using any local order parameters.Instead, the canonical approach to discern topological order is to measure operators supported on large closed loops, the Wilson loops [1,[5][6][7].However, such operators are challenging to identify or measure: while they have simple forms in certain fixed-point models, this is generally not the case for states realized experimentally in the presence of noise or other perturbations.In these cases, the expectation values of the simple or 'bare' Wilson loop operators described above decay exponentially with the loop's perimeter, which hinders the experimental certification of topological order.
To address these challenges, several methods have been developed to construct 'fattened' Wilson loops which do not decay with loop size.These include a systematic method utilizing quasi-adiabatic connections to the fixed-point models [5], as well as variational and tensornetwork-based approaches [9][10][11][12].Nevertheless, these methods are challenging to apply in realistic experiments, especially in the presence of incoherent noise (e.g., spontaneous emission).Other signatures, such as topological entanglement entropy [13,14] are likewise difficult to measure in large systems.
Motivated by these considerations, we introduce a novel and powerful framework, locally error-corrected decoration (LED), for studying and characterizing topologically-ordered states.By leveraging the errorcorrecting properties of topological phases, LED provides a systematic method to construct and efficiently measure 'decorated' Wilson loop operators, a variant of the fattened loop operators.This enables the identification and characterization of topological order at large lengthscales in the presence of both coherent perturbations and incoherent noise, which are particularly challenging or impossible using conventional methods.
In its most general form, LED corresponds to a class of hierarchically-structured quantum circuits which resemble the classification of quantum phases using RG flow [15,16].Yet, for a wide range of experiments where the prepared state is known to approximate a fixed-point state with zero correlation length [68], there is an efficient 'snapshot-based' realization of LED using only classical post-processing of experimental measurements in a few fixed bases.In this work, we primarily focus on snapshotbased LED due to current experimental limitations and the hardness of simulating 2D quantum circuits.

LED APPROACH
The key idea of LED can be understood by considering Kitaev's toric code model, a canonical example of topological order.Specifically, we consider qubits localized on the edges of a square lattice.The ideal, fixed-point Hamiltonian is defined as [8]: In the absence of perturbations, a topologically-ordered state with zero correlation length such as Kitaev's toric code state [8] is characterized by +1 expectation values of 'bare' Wilson loop operators, which are typically tensor products of single-site operators (dotted blue loop).In realistic systems, however, coherent perturbations give rise to virtual anyon pairs (red dots/straight lines), and incoherent errors introduce physical anyon pairs (orange dots/wavy lines); this causes the expectation value of bare Wilson operators to decay exponentially with the loop's perimeter.To account for these local fluctuations, one can measure 'fattened' Wilson operators supported on an annulus (blue); the LED loops constitute one realization of this.(b) LED method to measure decorated Wilson loop observables for Z2 topological order in a system where qubits live on the links of a square lattice, and stabilizers are associated with vertices.Given an experimental snapshot of all qubits in the Z or X basis, one can obtain values for all stabilizer operators in that basis, thereby identifying the locations of all e or m anyons, respectively.In the first step, neighboring anyons are paired using a local decoder (dashed pairings), and each pair is removed by flipping the value(s) of qubit(s) lying on a path of minimal length connecting the two anyons; subsequently, the lattice is coarse-grained so that only a fraction of the original qubits remain.These two steps are iterated n times (here, n = 2), after which a bare Wilson loop is evaluated on the final, coarse-grained state.(c) The final, bare Wilson loop operator evaluated on the final state is equivalent to decorated Wilson loop operators evaluated at earlier iterations (see Methods).
where A v = i∈adj(v) X i , B p = i∈adj(p) Z i , and adj(v) (resp., adj(p)) denote the set of edges touching a given vertex v (plaquette p) of the lattice.The ground state space, given by the simultaneous +1 eigenspace of all stabilizer operators {A v , B p }, forms a quantum errorcorrecting code: all local operators either act trivially on ground states or couple them to excited states [8].By measuring stabilizers, one can detect the presence of excitations and apply a recovery procedure to return the system back to this ground state space.In this model, contractible Wilson loops can be constructed by multiplying stabilizers, so their expectation values in any ground state of H TC are +1, independent of loop size.However, in realistic situations, the prepared state differs from the fixed-point state by local fluctuations such as coherent perturbations and incoherent errors (Figure 1a).This causes bare Wilson loops to decay exponentially with the number of locations where a fluctuation can intersect the loop (i.e., its perimeter).
The snapshot-based LED approach begins with a measurement of all qubits in the same (Pauli-Z or Pauli-X) basis.For each measurement snapshot, one can calculate the stabilizer and Wilson loop values.Local fluctuations appear as stabilizer violations, which are identified with anyonic excitations [8] (Figure 1b).A local decoder partially removes such fluctuations by flipping measured qubits using only nearby stabilizer values.The simplest such local decoder can remove single-qubit errors, by flipping a qubit if and only if both adjacent vertices (resp., plaquettes) are occupied by an m (e-anyon).However, it cannot remove higher-weight errors, which flip two or more adjacent qubits.Subsequently, the lattice is coarse-grained, which can also be done efficiently on measurement snapshots (see methods).Together, the anyon-pairing and coarse-graining steps are repeated for n layers.Crucially, the weight of uncorrected errors is reduced in each layer, so that all local errors eventually become single-qubit errors which the decoder can correct; this mimics a real-space RG flow towards the fluctuation-free fixed-point state (see Methods).Finally, a bare Wilson loop is measured on the final, corrected and coarse-grained state (Figure 1b).
This bare operator measured on the final state is equivalent to a decorated Wilson loop operator measured on the original state (Figure 1).Moreover, it is determined solely by the fixed-point state and is independent of the specific fluctuations in the system; this crucially differentiates LED from prior approaches to construct fattened loop operators [5,9,10].Notice that all steps in snapshot-based LED can be performed in post-processing (see Methods), making it uniquely suited for integration into experimental measurement procedures.More general LED operators can be constructed through the quantum circuit formulation; one example is presented in the Supplementary Information.
The hierarchical LED procedure is also inspired by the quantum convolutional neural network (QCNN) approach to phase classification, and the decorated Wilson loop operators resemble the "multiscale string order parameters" studied in Ref. [17].However, in this context, the LED framework is more general: one can construct LED Wilson operators of diameter L with any desired correction distance d ≪ L (Figure 2a) by choosing any local decoder which pairs anyons up to distance d (see Methods) [69].The construction of Figure 1b with alternating local-decoding and coarse-graining layers is a particularly efficient way to construct local decoders and LED loops with longer-range (e.g., d, L ∝ 2 n ).
We emphasize that the locality of our procedure ensures that only topologically-ordered states can flow to the fixed-point state.Thus, LED gives rise to a new sufficient condition or witness for topological order.This distinguishes LED from general decoders, which do not typically respect locality and hence cannot be used to certify topological order.

NUMERICAL DETECTION OF TOPOLOGICAL ORDER WITH COHERENT PERTURBATIONS
To demonstrate the applicability of LED for coherent local perturbations to H TC , we consider a family of states generated by imaginary-time evolution of a toric code ground state |ψ TC ⟩ [18][19][20].As each operator Z i (resp., X i ) creates a pair of m anyons (e anyons), |ψ(g X , g Z )⟩ contains virtual anyon fluctuations on top of |ψ TC ⟩.In the special case where g X = 0, topological order is known to survive for perturbations g Z ≤ g c = 0.220343, beyond which the m-anyons condense, driving a secondorder phase transition into the Z-paramagnet state [21].More generally, |ψ(g X ̸ = 0, g Z ̸ = 0)⟩ is also topologicallyordered for small g X and g Z , but the transitions to paramagnetic phases can occur at points which differ from g c .In testing LED, we numerically simulate projective measurements of |ψ(g X , g Z )⟩ and use them as input "experimental snapshots" in Figure 1b (see Methods).Figure 2b shows the value of the LED order parameter for a trivial and a topological state with g Z = 0.14, when n is varied (and d, L ∝ 2 n ).Clearly, the order parameter stays at 0 for the trivial state, but increases from a small, finite value to one for the topological state as n is increased.Similar behavior is also observed throughout a one-dimensional parameter space in Figures 2c and  2d, whenever the correction distance d is increased, while keeping d ≪ L to prevent overcorrection (see Methods).Importantly, amplification occurs only if the input state is topological, and the order parameter approaches 0 for all trivial states.
Another important set of observables for characterizing topological order are X and Z open string operators, which detect the transition from the topological phase to the trivial, paramagnet phase.Because LED Wilson Z-loop operators (resp., X-loop operators) are linear combinations of Z (X) closed loops supported on an annulus, they anti-commute with conjugate X (Z) open strings connecting the interior and exterior of the annulus.As such, the expectation value of long, open strings must flow to zero in the topological phase, where closed-loop LED operators flow to unity with increasing d [70].The topological-to-trivial phase transition occurs when certain long, open X or Z strings acquire non-zero expectation value, due to the condensation of m or e anyons, respectively.Indeed, deep in the paramagnetic phase the state lim gx→∞ |(g x , g z )⟩ is polarized along the X direction, and X open strings become unity.However, for generic trivial states, open strings also decay exponentially with length, due to local fluctuations of the opposite type; nevertheless, LED can still amplify their expectation values by removing the effect of local fluctuations.This behavior is demonstrated in our simulations: in Figure 2e,f, open string expectation values stay at 0 in the topological phase, but are amplified and saturate to a non-zero value in the trivial (paramagnetic) phase.Because LED amplifies the contrast between trivial states and a large class of topological states, the topological order can be detected using with lower sample complexity-that is, by using substantially fewer experimental repetitions [17,22] (see Supplementary Information).
Let us note that the boundary dividing the states whose LED operators approach zero and one does not necessarily correspond to the topological phase bound- ary: in general, it depends on the choice of decoder and coarse-graining length-scale.For instance, this is observed in Figure 2g, where closed loops are nearly one after n = 3 layers for a large region within, but not fully encompassing, the topological phase.Hence, LED is not always a necessary condition for topological order.

EFFECT OF INCOHERENT ERRORS
We next demonstrate the application of LED in the presence of incoherent local noise such as spontaneous emission or dephasing, which commonly occur in experiments.Because local decoders can recover topologically encoded information in the presence of small, local error channels [13,23] it is reasonable to ask whether mixed states prepared in these systems exhibit topological ordering.
To study such examples, we introduce incoherent bitand phase-flip errors by independently flipping, with probability p flip , each measured qubit in a snapshot of |ψ(g X , g Z )⟩.Here, we associate topological order with states that can be transformed into a ground state of H TC via local operations.Our analysis then suggests that the resulting mixed-state phase space contains a Z 2topological phase, a Z-paramagnet, an X-paramagnet, and a disordered phase with large incoherent error rates.However, it is especially difficult to distinguish the topological and disordered phases using measurements of bare operators alone: in both phases, open strings remain close to zero, while bare Wilson loops decay exponentially with perimeter as e −αL , where the exponent α interpolates smoothly between the phases (Figure 3a,b).This is in contrast to the paramagnet phases, where closed loops exhibit similar behavior, but certain open strings decay with the same exponent α as the closed loops [24].
Upon studying the behavior of LED operators, one finds that the mixed-state phase space exhibits two qualitatively different regimes (Figure 3b).LED reduces α to 0 with increasing d in the 'correctable' regime, while α grows in the 'uncorrectable' regime.Further, correctable states with small p flip are connected to topologicallyordered pure states, suggesting these mixed states are topologically-ordered as well.Indeed, we show that correctability implies the input state cannot be prepared from a product state using only local operations.In particular, if LED Wilson loops are amplified to above 1 − ϵ under depth d correction, this certifies topological order up to length-scale O(L − d) where L ∼ 1/ √ ϵ.Furthermore, we argue (see Methods) that, under plausible conditions, this implies the entanglement negativity of the input state contains a topological term; this connects the LED characterization of mixed state topological order to other studies [25][26][27].The ability of LED to distinguish between the topological and disordered phases can be understood by analogy to quantum error correction.Conceptually, since any given LED loop operator is supported on an annulus, we can consider this operator as being embedded in a surface code on this annulus with open boundary conditions, which supports a logical qubit.Then, an LED Z-loop operator corresponds to a logical-Z operator for this qubit, while an X-string connecting the interior of the annulus to the exterior corresponds to a logical-X operator (see Figure 2a).In this framework, the decay rate α of Wilson loops corresponds to a local logical error rate per unit length, and in the correctable phase, LED-based decoding succeeds with high probability as long as the code distance d is sufficiently large (Figure 3c).However, in the uncorrectable phase, such as when p flip is above the error correction threshold or when long, open strings condense in a paramagnetic phase, decoding cannot correctly pair anyons, resulting in a high rate of logical errors [23].
The above results are deeply rooted in the stability of topological order against local perturbations.In con-trast, any finite temperature destroys long-range topological order as it leads to freely propagating thermal anyons.In Figure 3d, we consider the toric code model at finite temperature, with local incoherent errors, and find that the LED loop operators indeed approach zero upon increasing n.Interestingly, their expectation values flow non-monotonically, being amplified at small n before eventually turning to 0. This occurs because of a competition between two effects: thermal anyons are uncorrectable, so their density accumulates under RG flow; however, local fluctuations are corrected at early layers, which initially amplifies LED loop expectation values.Because loops at different n probe correlations at different length-scales, the turning point in these curves can be used to identify the characteristic length-scale of separation between thermal anyons, or equivalently, the system's temperature.show expected variation (one standard error) of the mean.The regime in which both types of loops are amplified corresponds nicely to the spin-liquid regime identified in Ref. [28] (shaded blue region).(c,f) The behavior of expectation values of open Z-and X-strings under LED further confirms our findings, as both types of open strings stay at 0 in the spinliquid regime.Here, the measured open strings are half of the Wilson loops.By considering the behavior of all types of loops and strings-closed and open, Z and X-we find that there are four regimes (I-IV), corresponding to four phases: (I) Zparamagnet, (II) X-paramagnet, (III) topological spin liquid (blue), and (IV) a phase which is consistent with strong decoherence effects (gray).In our analysis, the progression from Regime (III) to (IV) appears to be smooth.

EXPERIMENTAL REALIZATION IN RYDBERG ATOM ARRAYS
We now use LED to characterize and provide new insights into the Z 2 -topologically-ordered states recently realized on a 219-qubit programmable quantum simulator [28].In the experiment, qubits are encoded in ground states and n = 70 Rydberg states of neutral 87 Rb atoms and placed in an array on the links of a kagome lattice (Figure 4).This model maps onto a dimer model, where each Rydberg atom can be viewed as a dimer covering the two adjacent vertices of the kagome lattice [29]: the Rydberg blockade interaction between nearby atoms enforces a "dimer constraint" by preventing, with high probability, any vertex from being covered by more than one dimer [30].
This dimer model is predicted to support a Z 2topologically-ordered state of the resonating valence bond (RVB) type, involving the equally-weighted superposition of all dimer coverings [29,31,32].In this model, Z-stabilizers are given by (−1) times the product of single-qubit Z-operators on the edges touching a vertex, X-stabilizers are given by the product of offdiagonal operators supported on the triangles bordering a hexagon (see Methods), and the RVB state forms a fixed-point state.An e (resp., m) anyon arises when a Z (X) stabilizer is violated [33-35] [71].
In the experiment, a topologically-ordered state is prepared by quasi-adiabatically adjusting the detuning ∆ and Rabi frequency Ω of a global laser drive [28].The onset of topological order is observed by studying the expectation values of Wilson loops and open strings [24,28,29,36,37].A state consistent with Z 2 topological order emerges when using a quasi-adiabatic sweep from initial ∆/Ω < 0 to a final value of ∆/Ω in the range 3.3 < ∼ ∆/Ω < ∼ 4.5.In practice, several factors make quantitative characterization of such states difficult, as they cause the prepared state to differ from the ideal fixed-point state for the dimer model.In particular, the Rydberg interaction Hamiltonian is only an approximation of the parent Hamiltonian of the fixed-point state [72].Moreover, the finite sweep speed and experimental imperfections (e.g., off-resonant scattering, laser phase noise, spontaneous emission events) also modify the experimentally created state.These factors correspond to both coherent and incoherent perturbations, similar to those considered in our toric code simulations.As a result, while topological order can be discerned at modest length-scales, the expectation values of large, bare Wilson loop observables have nearly vanishing signal for almost all final values of ∆/Ω (Figure 4b,e).
To circumvent these imperfections, we measure LED loops on the experimentally prepared states.Due to the limited experimental system size, it is not possible to consider loops which strictly satisfy the limit where ξ ≪ d ≪ L, resulting in relatively small expectation values for the LED loop operators.Nonetheless, we clearly observe a range of values of ∆/Ω where both Z-and Xloops are amplified, which corresponds to the spin-liquid interval identified in Ref. [28] (blue shaded region in Figure 4).In particular, some of the largest loops within the system acquire non-zero expectation values in this parameter regime.To further confirm our findings in this intermediate system size setting, we also examine the behavior of open Z-and X-strings under LED, and we find that there are four regimes (I-IV).Regimes I, II, and III correspond to the Z-paramagnet, X-paramagnet, and spin-liquid regime, in agreement with the prior in-terpretation of experimental results [28].We emphasize that our analysis of Regime III goes beyond that of [28], showing non-trivial coherence in closed loops at significantly longer length-scales.Furthermore, LED provides novel insights into the nature of Regime IV: because LED does not amplify open or closed string expectation values, our analysis appears to be consistent with a decoherencedominated disordered phase (see also Supplementary Information).Such a phase is analogous to the disordered part of the mixed-state phase diagram (see Figure 3c), which has a high density of dephasing (Z) errors, in contrast to the valence-bond solid (VBS) phase predicted for the ground state [29].

CIRCUIT-BASED LED AND GENERIC TOPOLOGICAL PHASES
While our current LED analysis uses classical postprocessing of Z-and X-basis experimental snapshots, the most generic LED formulation involves a quantum circuit model following the QCNN framework of Ref. [17].
Here, the entropy associated with both incoherent and coherent fluctuations are systematically removed by introducing ancillary degrees of freedom and applying local unitary transformations, ultimately leaving a purified state supported on fewer degrees of freedom.Notably, this enables the application of LED to a large class of non-abelian topological orders known as string-net models [8,40].The anyon content of these models is characterized by a modular tensor category (MTC) C = Z(A), where Z denotes the Drinfeld center [41,42] of a unitary fusion category A [8]. Here, the possible topological charges (i.e., anyon types) are given by the simple objects α 0 , α 1 , ..., α N −1 of C. It is conjectured that any MTC is uniquely determined by modular S and T matrices which capture its anyon braiding statistics: A J e r U f r 2 X q z 3 i e t J W s 6 s w 1 + w f r 4 B i l F m Y Y = < / l a t e x i t > Direct measurements of s ij and t ij involve braiding anyons along large loops, and hence are affected by coherent perturbations and incoherent errors.The inability to extract their precise values prevents accurate identification of the topological phase.To circumvent this, we use a hierarchical LED circuit which systematically detects and identifies errors (anyons) at each site by using ancillary qubits, removes them by inputting the fusion rules of C into a maximum-likelihood decoder, and applies an entanglement renormalization circuit to coarse-grain the system [39].After multiple layers, the S and T matrices can be measured with much higher accuracy and efficiency (Figure 5).We note that circuit-based LED is required for the detection and removal of non-abelian anyons.More details on circuit-based LED and generic topological phases can be found in Methods and Supplementary Information.

OUTLOOK
These results demonstrate that LED constitutes an exceptionally promising approach to enhance the detection and characterization of topological order.Several generalizations and future avenues can be considered.For example, the variational methods of QCNN circuits can enable adaptive measurement procedures, which can recognize a much larger portion of the topological phase.This opens the door towards achieving a necessary and sufficient criterion for topological order using LED, which cannot be done using any fixed linear observable [43].Moreover, our results indicate that LED is applicable to generic topological orders in higher dimensions, which is challenging to analyze using any currently known techniques.LED can also potentially serve as an order parameter for efficiently characterizing glassy gauge models [44], through a mapping shown in Methods.Additionally, while our present work analyzes a spin-liquid state prepared using a Rydberg-atom quantum simulator, LED is also directly applicable to other platforms such as superconducting qubits [45] or trapped ions [46].
Another promising direction is to further study whether the "correctability" of states in our mixed-state phase diagram can be used to characterize topological order in mixed states more generally [12,27,[47][48][49].In particular, it could be intriguing to further explore the dependence of the correctable regime on the choice of local error correction and/or coarse-graining procedure.Finally, while our approach can be directly applied to any string-net topological order, it could be interesting to consider more general topological phases, fracton phases or gauge theories with continuous gauge groups [35,50].Such methods can then become indispensable parts of quantum simulation toolboxes for understanding exotic states of entangled quantum matter.

METHODS Numerical Simulations for the Toric Code
In this section, we explain how the numerical simulations underlying Figures 2 and 3 where Pi projects R onto the subspace with topological charge αi, and finally measure the ancilla's state.(b) Local error correction is performed by inputting the fusion rules of C into a maximum-likelihood patch-based decoder.Given any l × l patch, one identifies possible groupings of anyons (including groupings to the boundary) that can remove all nontrivial topological charges within the patch.The decoder performs the grouping of highest probability by fusing anyons or dragging them to the boundary of the patch [38].If C is non-abelian, the vacuum topological charge may only be attained probabilistically with probability 1 − α pα, or a nontrivial topological charge α remains with some probability pα.(c) The system is then coarse-grained by applying a quantum circuit corresponding to a multiscale entanglement renormalization ansatz (MERA) representation of the fixed-point state [39].(d) At the final layer, S-and T -matrix elements can be measured by introducing an ancilla qubit in the |+⟩ state and applying controlled-anyon-braiding operations.More details on implementing Steps (c) and (d) can be found in Methods.
by constructing a projected entangled pair state (PEPS) representation of the exact toric code ground state [51].This construction utilizes a parity tensor P defined as where each index i, j, k, l ∈ {0, 1} (i.e., the tensor P has bond dimension two).Because the toric code is defined with qubits on the links of a square lattice, our PEPS representation of the state has one PEPS tensor with two physical indices per unit cell.Letting p, q be the physical indices and ijkl be the virtual indices, the toric code PEPS tensor A is then given by A pq ijkl = δ p i δ q j P ijkl .Our perturbed states |ψ(g X , g Z )⟩ are constructed from the toric code state by applying imaginary time evolution to each site L(g X , g Z ) = e g X X+g Z Z : Notice that this operation does not change the PEPS bond dimension, thereby allowing for efficient simulation.
Our goal is to simulate projective Z-basis measurements to serve as the "experimental snapshot" input in Figure 1b.The key ingredient which enables efficient sampling is an algorithm for efficiently computing marginal and conditional probabilities, which can be implemented as follows: We first label every unit cell by its coordinate (x, y).There are four possible measurement outcomes at each unit cell, and we compute the probability P (σ (1,1) = ab) that measurement of the first site (x, y) = (1, 1) yields the outcome ab = 00, 01, 10, or 11.
Next, we select a sample ab 11 based on this probability distribution, compute the conditional probability distribution on the second site, P (σ (2,1) = ab|σ (1,1) = ab 11 ), and sample the second measurement outcome ab 21 .The process then repeats, with each subsequent distribution being conditioned on all prior measurements.
Computing the probabilities requires contracting a 2D tensor network (Figure 6), which is in general #Phard [52].In practice, however, the states we encounter have finite correlation length, and the computation becomes remarkably efficient throughout much of the phase diagram [53].In particular, we work on a strip of finite height L x and infinite length L y , and introduce boundary matrix product states (MPS) to efficiently capture the effect of the environment-that is, the sites different from the one currently being sampled [54].Because singularvalue decomposition truncation is used at each step to prevent the bond dimension of the boundary MPS from growing exponentially [55], the method is approximate; however, we only discard singular values < 10 −8 , so truncation errors are insignificant.Details of the boundary conditions and contraction ordering are discussed in the Supplementary Information.
In our simulations, we choose L x = 300 unit cells and sample 1000 columns, giving us access to very large snapshots with 600,000 qubits.To minimize boundary effects, we compute observables supported on sites at least 30 unit cells away from the boundaries.Near the phase boundaries, the bond dimension (entanglement) of the boundary MPS becomes large due to the large correlation length, which increases the computational demands for sampling (gray data points in Figure 2g).We numer- ically confirm this phase boundary with an independent calculation (see Supplementary Information).

Details on Error-Correction and Coarse-Graining Procedures
Here, we explain the details of the LED decoding and coarse-graining procedures and demonstrate how bare Wilson loops become decorated under the LED protocol.Without loss of generality, we consider Z-basis measurements, from which we can calculate plaquette stabilizers B u .Here, each plaquette is labelled by the 2D coordinate of its unit cell u = (x, y).Since there are two qubits per unit cell, each qubit carries a coordinate and a link label v or h, depending on whether its corresponding edge in the square lattice is vertical or horizontal, respectively.Finally, the projective measurement outcomes are denoted by σ ∈ {+1, −1} (see Figure 7).
To illustrate local error correction, we consider the "pairing decoder," which flips a qubit if and only if its two neighboring plaquettes are simultaneously occupied.Importantly, to preserve locality, we first compute all stabilizer values and then flip qubits based on these values.The decision of whether to flip any qubit then depends only on its value, and the values of the six adjacent qubits with which it shares a plaquette.Equivalently, this error correction procedure corresponds to an operator transformation To ensure all local errors are removed after a finite number of LED steps, we also pair anyons which occupy two plaquettes separated by a diagonal, such as B u and B u+x+ŷ .The locality of the decoder ensures that the support of any local operator only grows by a finite amount with each step.Subsequently, the coarse-graining procedure replaces each b × b block of plaquettes with a single plaquette whose value is the product of b 2 plaquettes; microscopically, this can be done by defining new qubits as a product of b corresponding qubits in the original lattice.The combination of a local pairing step and a coarse-graining step forms a layer of real-space RG; with each additional layer, one can correct errors of higher and higher weight.
The bare Wilson loops measured in the final state are equivalent to decorated loop operators acting on the original state.These decorated operators can be efficiently computed from projective measurement data, since their eigenstates are product states in the Z and X bases, respectively.Furthermore, in the operator transformation picture, any loop or string of length L maps onto a linear combination of exponentially many (2 O(L) ) loops or strings, respectively.Thus, while the operator transformation picture is helpful for conceptual reasons, it is computationally much easier to use the original picture of error-correction and coarse-graining.
A few remarks are in order.First, one important property of LED is that it preserves commutation relations: consider two anti-commuting X and Z strings which intersect at a single point, far from the strings' endpoints.Upon applying LED, the resulting decorated strings still anti-commute.This is because the correction is computed only using stabilizers, so it decorates Z-operators by a linear combination of closed Z-loops, and similarly for X.Moreover, other local decoding algorithms, such as cellular automata and RG decoders, can also be used to generate different LED operators [56].In the following section, we describe a flexible, "patch-based" local decoder for the toric code, which allows LED to classify a wider range of states as topological.

Patch-based decoder
The patch-based decoder with variable correction distance d is based on a local minimum-weight perfect matching (MWPM) procedure.In the first decoding step, a local MWPM decoder is convolved with all l by l square regions of the toric code, where l ∼ d; for each region, MWPM takes as input the location of the enclosed anyons.Because both e and m anyons can freely move into and out of the region, this is analogous to decoding a surface code with open boundaries.Therefore, MWPM pairs any given anyon either with another anyon or with the boundary.
The second step aggregates MWPM pairings.Since the square regions can overlap, a pair may appear more than once.As such, after choosing a natural indexing of the plaquettes, we create a list of all MWPM pairings between two plaquettes (p, q) with p < q; pairings with the boundary are not included (Figure 8).For each plaquette p containing an anyon, the patch-based decoder then performs the pairing (p, q) which occurs most often.This procedure naturally favors pairings that flip fewer qubits, because shorter-range pairings can be included in more local patches.
A critical property of this decoder is that it preserves locality.In the first step, MWPM only uses information from local l by l patches, while the distance between partner plaquettes in the second step is always less than l.Aggregation can thus be performed using only the results from a small number of overlapping local patches.

Decoder Details for the Ruby Lattice Spin Liquid
We now explain the decoding procedure for a dimer model where qubits lie on the vertices of the ruby lattice, or equivalently, on the links of a kagome lattice.This dimer model supports a Z 2 spin-liquid phase, whose fixed-point is a resonating valence-bond (RVB) state [29].This state is in the same universality class as the toric code, as it supports e and m anyons with similar string operators.
We first describe the decoding procedure for e anyons, which correspond to vertices with an even number of adjacent dimers [73].In the first correction step, we apply the pairing decoder between adjacent vertices.We then coarse-grain the kagome lattice to a triangular lattice by grouping vertices within each upward-pointing triangle.This transforms vertex stabilizers in the kagome lattice to vertex stabilizers in the triangular lattice (Figure 9a).The pairing decoder is then applied between adjacent triangles in the second correction step.In the main text, we study the flow from uncorrected loops to vertex-paired and triangle-paired loops, which are denoted as as layers 0, 1, and 2, respectively.
We next consider the m anyons, which are associated with hexagonal plaquettes.A rotation is first performed within each triangle, such that the string operators associated with m anyons become diagonal in the measurement basis.This allows us to map each configuration onto a triangular lattice, whose vertices are located at the center of each hexagon in the kagome lattice; this mapping transforms X-stabilizers of the dimer model into vertex Z-stabilizers in the triangular lattice (Figure 9b).Due to the small experimental system size, we can only perform one layer of correction, and we use the pairing decoder on the triangular lattice.We note that open strings on the triangular lattice map onto open strings on the ruby lattice, although the resultant strings are slightly different from the ones measured in [28,29].

Quantum Circuit Formulation of LED
As discussed in the main text, the most general formulation of LED uses a hierarchical quantum circuit like the QCNN circuit introduced in Ref. [17].The structure of such a circuit is illustrated in Figure 10 in a onedimensional example for simplicity of illustration, but can be easily generalized to the two-dimensional cases considered in LED.
In this framework, stabilizer measurements are performed at each layer using quantum circuits to preserve the coherence of qubits in the system, in the same fashion as for surface-code quantum computation [57].When the lattice is coarse-grained as in Figures 1, 7, a fraction of the system's qubits are measured, and local operations are applied to each remaining qubit based on nearby sta- In particular, we count the number of times each site p is paired to sites q > p.In the diagram, two equal-weight pairings contribute 0.5 each, though we randomly break the tie in practice.Then, the algorithm pairs p with the q that appears most often.In this example diagram, we connect two pairs which have weight= 5.5, and do not form the weight= 2 pairing.We see in the simple four-anyon case depicted above, the procedure correctly recovers the pairing with windows of size l = 3.In general, this patch-based decoder can correct errors up to distance d = ⌊l/2⌋; moreover, the distance by which it spreads information and the thickness of any associated LED operators are both proportional to l.
(a) (b) FIG. 9: Decoding for the ruby lattice spin liquid realized in Ref. [28].(a) For Z-loops, two layers of LED can be performed.In both layers, we use the pairing decoder, which flips a qubit (e.g., red or orange circle) if and only if both neighboring stabilizers (e.g., red or orange squares) are equal to −1.Stabilizers in the first layer (e.g., red squares) are given by (−1) i∈v Zi for each vertex v of the kagome lattice.The coarse-graining procedure after the first decoding step maps three stabilizers to a single stabilizer (e.g., orange square) in the coarse-grained lattice (blue lines), whose value is determined by the product of the qubits along a loop enclosing a triangle (e.g., purple closed loop).The open strings considered in the main text start and end at hexagons (e.g., purple open string).(b) To measure X-loops, a basis rotation is first performed within each triangle of the kagome lattice, so that the X-string operators become diagonal in the measurement basis (inset and Refs.[28,29]).
Each configuration is then mapped to a triangular lattice (blue lines), where each edge of the triangular lattice is determined by the product of four qubits in the original lattice (e.g., red circles); moreover, the X stabilizers of the dimer model become vertex stabilizers in the triangular lattice (e.g., purple hexagons).As before, the pairing decoder flips qubits (orange edges) conditioned on the values of stabilizers (e.g., orange squares).Open strings on the triangular lattice also map to open strings in the kagome lattice (e.g., red string), although the resulting strings are slightly different from the ones measured in Refs.[28,29].

⇢ in
FIG. 10: One-dimensional illustration of a hierarchical LED circuit, inspired by the QCNN circuit of Ref. [17].Here, stabilizer measurements are performed at each LED layer using local unitary gates (white boxes), and the LED error-correction step is performed through controlled-unitary gates.While this particular circuit model maps stabilizer values in each LED layer to qubits in the initial system (ρin) which are measured in that layer, the stabilizer values can also be obtained by introducing ancillary qubits in a known state (e.g |0⟩) and performing local gates in the same fashion as for surface-code quantum computation [57].To accommodate states which differ from a known, fixed-point state by local rotations, variational unitary operations (blue boxes) can be introduced before each LED stabilizer-measurement step, and the parameters to these unitaries can be optimized adaptively through a hybrid quantum-classical feedback loop to achieve high LED operator expectation values.
bilizer measurement values, to correct for local errors.One example circuit construction of LED stabilizer measurement, decoding, and coarse-graining for recognizing the toric code phase is presented in the Supplementary Information.For more general string-net models, ancillas can be used to detect the presence of anyons, and the decoding steps perform anyon transport and fusion via procedures described in Ref. [38]; meanwhile, the coarse-graining circuit is constructed as the inverse circuit of a multiscale entanglement renormalization ansatz (MERA) representation of the fixed-point state (Figure 5) [39].Additionally, a layer of variational unitary operations is placed in front of each anyon-detection step.These variational unitaries can be tuned to optimize the LED order parameter values, especially in the presence of (quasi-)local rotations of qubits on top of a known fixed-point state.For example, if every qubit in a perfectly-prepared toric code state underwent a Haar-random, single-qubit operation, both the bare and snapshot-based LED Wilson loop operators will be exponentially small.However, the layer of variational unitaries in front of the first local decoding step enables one to "un-do" these single-qubit operations and again achieve a high LED signal.In particular, one uses here an adaptive procedure, whereby a hybrid quantum-classical feedback loop is used to tune each unitary to optimize LED loop values.More generally, variational unitaries in front of subsequent local decoding steps l allow us to compensate for local operations acting on multiple qubits of the system.This is a major step towards achieving a necessary and sufficient criterion for topological order, which is not possible using a single, fixed observable such as a bare Wilson loop operator [43].Moreover, due to the special hierarchical structure of QCNN and LED circuits, the optimization of the variational unitaries can be done efficiently without encountering the so-called "barren plateau" challenges of variational quantum circuits [58,59].
Finally, one other advantage of circuit-based LED is that it enables the simultaneous measurement of loop operators in multiple bases in each experimental repetition.This allows us to capture anyonic braiding statistics, which is critical to the application of LED to nonabelian phases.In particular, the final measurement of s ij (Figure 5d) can be performed by initializing an ancilla qubit in the state |+⟩ = 1 √ 2 (|0⟩ + |1⟩), and applying a controlled operation which, conditioned on the ancilla being in |1⟩, creates anyon pairs α i , α i and α j , α j , braids α i around α j , and fuses the pairs α i , α i and α j , α j .s ij is then measured in two steps: First, the magnitude |s ij | 2 is equal to the probability of α j , α j fusing to vacuum when the ancilla is in |1⟩; this probability can be obtained by measuring local energy densities (e.g., by performing stabilizer measurements).Then, when |s ij | 2 > 0, we postselect on both α i , α i and α j , α j fusing to vacuum and measure the ancilla's final state in an appropriate basis to obtain the phase of s ij .For topological phases described by abelian quantum double models [8], the quantum circuit and snapshotbased versions of LED can be combined by measuring all qubits in a fixed basis after some chosen depth d, and performing snapshot-based LED using the resulting stabilizer measurement values (see Supplementary Information).The choice of d is then determined by a tradeoff between the quantum circuit depth/fidelity and the generality of local rotations which can be compensated for.

Topological Order Witness
Here, we show that LED provides a topological order witness-that is, it does not misclassify any trivial product state as topological.For simplicity, we study the case of Z 2 topological order on a surface with trivial topology, where the fixed-point state is the unique ground state |ψ TC ⟩ of H TC .We begin by considering the ideal case where LED operators go to one.
Theorem 1.Let ρ be an arbitrary input state defined on a surface with trivial topology.Then, after performing LED with correction distance d, assume the resultant state ρ f has, as a subsystem, qubits living on the links of a square lattice, as in the toric code.Then, if the stabilizer expectation values 1+Av The key to the proof is a unitary implementation of LED by introducing product state ancillas and performing local unitary gates to perform stabilizer measurement and correction (see Supplementary Information for details).These operations, which cannot change the longrange entanglement structure of the state, are known as gLU transformations [18], and preserve phase boundaries.Thus, if we further assume the output ancillas α anc are in a trivial state, Theorem 1 guarantees the input state is in the toric code phase.However, we do not certify this condition holds, which is in general more difficult: measurements in multiple bases are needed to uniquely determine α anc .Instead, LED certifies that the toric code state can be distilled from the input state by gLU transformations.Because long-range entanglement cannot be created from a trivial state by gLU transformations [18], Theorem 1 implies that LED operators flowing to unity forms a sufficient condition for topological order, or equivalently, a topological order witness (see also Ref. [7]).
While the above argument works well in theory, any practical system cannot measure LED observables equal to one with infinite precision.Indeed, even infinitesimal local perturbations to the toric code ground state, such as e −iϵH |ψ TC ⟩ for arbitrarily small ϵ and some local Hamiltonian H, can create error strings larger than the correction length d.This causes LED loop expectation values to decay exponentially, even in the topological phase.To show that LED still provides a topological order witness in the presence of local perturbations, finite measurement errors, and finite system size, we show the following Theorem: Upon combining the result of Lemma 4 with the fact that our LED procedure corresponds to a local quantum circuit with depth O(d), we find that the original input state |ψ⟩ cannot be prepared using a quantum circuit of depth smaller than O(L − d)-which is precisely the statement of Theorem 2. So, if we measure loops of length L ≫ d to be 1 − ϵ, this shows that LED provides a topological order witness up to length-scales of O(L/ √ ϵ).
We now discuss how these theoretical results are reflected in our numerical simulations.First, when fluctuations are local, the probability of having an error string of length ℓ decays exponentially with ℓ, and the exponent is determined by the characteristic length-scale ξ of fluctuations.In these systems, we expect the error rate after an optimal LED procedure with correction distance d to be given by ϵ(d) ∝ e −d/ξ , so correction distance d = Ω(ξ log L ) is sufficient to certify topological order up to length-scale L .Second, when LED uses the hierarchical, anyon-pairing decoder, the anyon density is observed to decrease faster than exponentially in the number n of LED steps (Figure 11).In this case, both the measured stabilizer size and the correction distance d grow exponentially with n, which implies that the certification length-scale L grows at least exponentially with n as well.Third, our argument does not certify topological order to any length-scale when L < d; this is because the support of such an LED operator no longer has an interior, potentially giving rise to signal even in the trivial phase.Indeed, this is reflected in our numerics as well (Figure 12).

Connection to Topological Entanglement Negativity
The entanglement negativity of a mixed state ρ S is defined as S N (ρ) = log ||ρ|| 1 = log( λ i ), where λ i are the eigenvalues of ρ.Prior works have shown, via a combination of analytical arguments and numerical results, that in a topological phase, S N obeys an area-law with a constant correction, i.e. S N = αL − γ.Further, recent results have also shown that the topological term γ vanishes at finite-temperature [60], or for high incoherent error rates [61].Thus, the negativity appears to capture important features of mixed state topological order.
The unitary circuit construction of LED also enables us to connect a positive classification under LED, to the topological entanglement negativity of the input state.In particular, theorem 1 implies that states classified as topological are connected to an output state ρ f = |ψ TC ⟩ ⟨ψ TC | ⊗ α anc via local unitary circuits.If we further assume the ancillas contain no long-range order (see SM for rigorous definition), then since |ψ TC ⟩ is topologically ordered, the output state indeed has a topological correction in the entanglement negativity.It is further believed that γ is a topological invariant, i.e. it should remain invariant under local unitary circuits.As such, this should be sufficient to certify the input state ρ S has topological order.We show this in the SM, for the special case where the LED circuit is composed of Clifford gates, by extending the stabilizer formalism introduced in Ref. [60].Interestingly, there, the topological correction to S N comes from the presence of decorated Wilson loops operators with non-trivial twist product in the input state ρ S (see also proof of Lemma 4).Thus we conjecture a connection to topological entanglement negativity holds for LED Wilson loops more generally.

SUPPLEMENTARY INFORMATION PEPS Sampling Contraction Details
We start by computing the left boundary MPS of an infinite strip.For sites with y ≤ 0, we average over measurement outcomes, and hence the doubled PEPS tensor for each site, which contains both the bra and the ket tensors, is The boundary conditions we choose are |+⟩ i |+⟩ i ′ at the lower x = 1 boundary and δ i,i ′ at the x = L x boundary.Contracting the doubled tensor along an entire column x = 1, ..., L x results in a matrix product operator (MPO) T y acting on the boundary MPS.Then, we can compute the effect of an infinite environment by repeatedly applying T y to some initial boundary MPS until it converges.The right boundary MPS can be similarly computed, by exchanging the input and output directions of the MPO.Note that at each application of T y , we use singular-value decomposition truncation to prevent the bond dimension of the boundary MPS from growing too rapidly, rendering the method approximate.However, only singular values smaller than < 10 −8 are discarded, so truncation errors should be insignificant.We refer to the resulting tensors as the left and right fixed-point of T y .
The algorithm continues by using the left and right boundary MPS to sample a column of sites.Computing the marginal probability P (ab) on the first site requires contracting a 1D tensor network (see Figure 6), where the doubled tensor at x, y = 1, 1 is replaced by a measurement-dependent one T (ab) i ′ ,j ′ ,k ′ ,l ′ i,j,k,l = (A * ) ab i ′ ,j ′ ,k ′ ,l ′ A ab i,j,k,l , while the doubled tensor at sites x > 1 remain measurement-independent.Note that the tensor network outputs an unnormalized probability distribution; however, since there are only four states per site, the normalization can be computed with little overhead.After drawing a sample ab 11 for the first site, we replace the doubled tensor at (x, y) = (1, 1) by T (ab 11 ), and then compute the distribution of the second site.The process is repeated until the entire column is sampled.To minimize repeat 1D contractions, upper and lower environment tensors can be stored and updated during the sweep x = 1, ..., L x .
Next, the history of samples along the column are used to construct a measurement-dependent MPO T y (ab 1 , ab 2 , ..., ab Lx ), where the doubled tensor at each site is replaced by a measurement-dependent one.Then, the left boundary MPS can be updated by contraction with T y ({ab i }), and the process repeated for the second column.Thus, the left boundary MPS keeps track of the effect of past measurements on future measurements, as the algorithm sweeps from left to right.Meanwhile, the right boundary MPS remains unchanged, as it is modelling a static, infinite environment.

Calculation of Phase Diagram
To compute the phase diagram, we use the PEPS tensors to construct a transfer matrix with periodic boundary conditions, on small cylinders with circumference L y measured in unit cells.The largest few eigenvalues of the transfer matrix can be efficiently computed using Krylov algorithms in this regime, and the degeneracy of the largest eigenvalue serves as an alternative signature of the topological transition [10,11].In particular, the local Z 2 gauge symmetry of the PEPS tensor becomes a Z 2 × Z 2 symmetry of the doubled tensor (bra and ket).Hence the topological, e-condensate (Z-paramagnet), and mcondensate (X-paramagnet) correspond to three distinct symmetry broken phases from the point of view of the virtual legs, with degeneracy two, one, and four respectively.
As such, along the transition from topological to econdensate, which occurs for g X small and g Z ≈ 0.2−0.3, the relevant ratio is between the first and second eigenvalues, ∆ 12 (g Z , g X ) = log(λ 1 /λ 2 ).In contrast, for the transition from topological to m-paramagnet, the relevant gap is between the first and third eigenvalues ∆ 13 (g Z , g X ).Furthermore, the model is self-dual, so the wavefunction at |ψ(g z , g x )⟩ is equivalent to the wavefunc-tion at |ψ(g x , g z )⟩ by a basis rotation and spatial translation.We will use this duality to compute the phase boundary in a way which minimizes finite-size effects, by computing the two gaps at their dual points (Fig 13a).Therefore, we introduce two parameters g 0 , g 1 , and let g 1 be the parameter which changes across the transition.The relevant parameter is therefore ∆ 12 (g 1 , g 0 ) for the topological to e-condensate transition, and ∆ 13 (g 0 , g 1 ) for the topological to m-condensate transition.
As ∆ 12 grows with increasing g 1 , while ∆ 13 reduces with increasing g 1 , these two ratios will eventually cross.Indeed, in the limit L y → ∞, the crossing point should exactly correspond to the phase boundary.In general, finite L y may shift the boundary.Empirically, we see that at g 0 = 0, the solvable point, there are essentially no finite size effects, and the agreement with the analytical value g c = 0.2203434 is almost exact (Fig. 13ac).For larger g 0 , the dependence on L y appears minimal until around g 0 = 0.01: indeed, even in this case, L y = 4 only overestimates the phase boundary compared to L y = 6 by a few percent (Fig. 13d).As such, we use L y = 4 and compute the phase boundary by identifying points where the difference ∆ 12 − ∆ 13 is close to zero (Fig 13b).

Sample Complexity
A key figure of merit for certification of phases is the sample complexity, defined here as the number of samples required to confirm with 95% confidence that the measured loop operator is non-zero.To compute sample complexity, we approximate the LED Wilson loop expectation value evaluated on a large but finite size system as a Gaussian random variable.In this scenario, the important quantity is the ratio of the standard deviation σ to the mean ⟨Z closed ⟩.The estimator of the expectation value has a standard deviation that decreases as 1/ √ S where S is the number of samples.Thus, to confirm the mean is non-zero to two standard deviations (95% confidence), we require approximately S = (2σ/⟨Z closed ⟩) 2 samples.
In Figure 14, we compare the sample complexity of certifying non-zero Wilson loops using bare and LED observables.Two scenarios are considered.In the first, bare and LED Wilson loops are compared at fixed lengthscale.Indeed, the sample complexity decreases by an order of magnitude for a range of incoherent error rates below the correction threshold.In the second scenario, coarse-graining is considered, where larger length-scales are probed at each layer.Here, the sample complexity in fact increases at early layers for moderate error rates before falling dramatically.This is because the variance of the signal initially increases, since coarse-graining reduces the number of loops available for averaging in a fixed size system.However, for sufficient correction layers, LED reliably removes almost all errors.This is the FIG.13: (a) For a given point (g0, g1) on the phase diagram, the phase transition from topological to e-condensate is signaled by the transfer matrix gap ratio ∆12(g0, g1), while the transition from topological to m-condensate is signaled by ∆13(g1, g0), where both quantities are evaluated at the selfdual point with gz ↔ gx switched.When these two gaps are equal, the system must be at the critical point, due to the self-duality.We observe that the crossing point coincides exactly with the known critical point gc (vertical dotted line), for Ly = 4 regime where ξ ≪ d, so the Wilson loops saturate at one and their variance approaches zero (see histograms in Figure 14).Nevertheless, the initial increase in sample complexity is not simply due to information being removed.Upon further examination of the scenario without coarsegraining, we find a similar initial increase in sample complexity.We interpret this as correction causing adjacent LED loops to become correlated.Finally, we note that the sample complexity measured in this way only improves in the topological phase.In the uncorrectable, disordered phase, the inverse ratio ⟨Z closed ⟩/σ rapidly approaches zero.

Decoder dependence
We now examine how different choices of LED decoders can change the size of the "correctable" region-that is, the region classified as topological.The main text demonstrates results for an l = 4 (or d = 2) patch-based decoder with coarse-graining size b = 2; in Figure 15, we compare this with the pairing decoder and an l = 6 (d = 3) patch-based decoder which also uses b = 2.We see clearly that the l = 4 and l = 6 decoders both produce significantly larger correctable regions than the simple pairing decoder, for both coherent and incoherent errors.Meanwhile, the l = 4 and l = 6 decoders perform similarly, so it appears that the decoder threshold saturates with l.Intriguingly, we observe saturation at an incoherent error rate which is significantly below the known error correction threshold of p c ≈ 10.9%.An interesting open question is to determine whether this discrepancy arises because the patch-based decoder is suboptimal, or because local decoders have some fundamental limit.In the Supplementary Information, we show that a "annulus-based" decoder which applies MWPM in a nonlocal fashion results in a much larger correctable regime.

Definition and Properties of Fixed-Point States
As discussed in the main text, one important component for defining any LED procedure is to identify a fixed-point state of the target phase of matter.Here, we review the definition and key properties of a fixed-point state.
It is well-known in the literature that gapped quantum ground states can be classified by a real-space RG flow [15,18].To implement such an RG flow, one notes that any two states in the same phase can be connected by finite-depth local unitary transformations.The hallmark property of topologically-ordered states is the presence of long-range entanglement, and finite-depth local unitary transformations can add or remove local shortrange entanglement; thus, for any given state in a topological phase of matter, one can construct a procedure which hierarchically removes all short-range entanglement from this state at increasing length-scales.Then, the resulting state then has zero correlation length, as all short-range entanglement has been removed; this state is known as a fixed-point state of the topological phase.We also consider important properties of the fixedpoint state in the context of our LED procedure and the closely related QCNN procedure of Ref. [17].In both of these procedures, a fixed-point state of the phase under consideration is chosen, and the protocol identifies states within this phase by removing local errors or perturbations on top of this fixed-point state; this is done by performing a decoding operation and a coarse-graining operation, and repeating them n times.In these settings, the fixed-point state has a few special properties: If the input state is equal to the fixed-point state, no errors are detected within each decoding step, and furthermore, the state after each layer of decoding and coarse-graining is equal to the input state, defined on a subsystem of the original system with fewer qubits.Finally, because fixedpoint states have zero correlation length, the bare Wilson loops defined in the main text have expectation value equal to +1 without performing any correction or LED.

LED Circuit for Z2 Toric Code
In the quantum circuit formulation, the stabilizer measurement, local decoding, and coarse-graining steps of LED are implemented through local controlled-unitary gates, single-qubit rotations, and (optionally) measurements and local feed-forward operations.Meanwhile, local variational unitary gates are introduced before each LED layer to enable efficient and robust identification of a large set of topologically-ordered states (see Methods and Figure 10).The quantum circuit for stabilizer measurements, local decoding, and coarse-graining can be implemented in different ways, as discussed below.
As a first example, one can introduce an ancillary qubit for each stabilizer, and perform local controlled-NOT (CNOT) gates between the system qubits and the ancillary qubit at each vertex or plaquette.These local CNOT gates are designed in the exact same fashion as stabilizer measurements of the surface code (see, for example, Ref. [57]).Decoding can then be implemented either by measuring the ancillary qubits and performing local feed-forward operations on the system qubits to correct for arbitrary single-qubit errors, or by using local controlled-unitary operations between the ancillary and system qubits to achieve the same result.Finally, the MERA circuit of Ref. [62] can be used to perform coarse-graining at each LED layer.
Alternatively, one can avoid introducing ancillary qubits by carefully constructing a circuit which maps stabilizer values in each layer to the qubits which are removed during the coarse-graining process of that layer.This scheme combines the stabilizer measurement and coarse-graining procedures together into one large set of unitary operations.As before, the decoding step can be implemented by measuring stabilizer qubits and performing local feedforwarding to the remaining qubits, or by using local controlled-unitary operations between the ancillary and system qubits.
Because the number of removed qubits in each unit cell FIG.16: Setup for a quantum circuit which implements LED for the Z2 toric code phase without introducing any ancillary qubits.The coarse-graining performed by this circuit combines nine unit cells into a single, large unit cell in the subsequent layer (thick vs. thin lines); we label each of the 18 qubits in this large unit cell using the letters a through r as shown above.Here, we focus on the local unitaries involving the qubits within a single, large unit cell (darker blue shaded cell); however, some of the local unitaries in our circuit span two large unit cells, so we also consider the neighboring cells (lighter blue shaded cells).We label the neighboring cells 1 through 4, and refer to a qubit in such a cell by its letter and the number of the cell (e.g., the uppermost qubits of unit cell 2 would be a2, b2, and c2 from left to right).
is always smaller than the number of stabilizers in this second case, only a fraction of stabilizers can be measured in every layer.Thus, one must design the circuit meticulously in order to still correct for all single-qubit errors.As a concrete example, we illustrate here such a quantum circuit implementation of the LED stabilizer measurement, local decoding, and coarse-graining procedures for the Z 2 toric code which does not require additional ancillary qubits.In this circuit, nine unit cells are combined to a single, large unit cell in the next layer by the coarse-graining procedure (i.e., a 3-to-1 reduction is performed in each dimension).The circuit is invariant under translation by the large unit cells, so we consider only the gates involving a single large unit cell.The setup and notations for qubits are defined in Figure 16.
Our circuit consists primarily of two-qubit CNOT gates, together with some single-qubit rotations and multi-qubit controlled-unitary operations.Thus, to compactly specify our circuit, we introduce some notations for the controlled-unitary operations of our circuit: specifically, we use the notation (control qubits → target qubit) to refer to the gate which performs a bit-flip (X) gate on the target qubit if and only if all control qubits are in the Z = −1 state, and identity otherwise.For example, (a → b) denotes a CNOT gate where a is the control qubit and b is the target qubit.Likewise, (a, b → c) denotes a Toffoli gate where a and b are the control qubits and c is the target qubit.
With all notations defined, we are now ready to specify our circuit.Due to translation invariance, it is understood that whenever we list a gate here, it will also be applied simultaneously on all qubits which differ from the labeled sites by translation of an integer number of large unit cells; thus, our circuit consists of many layers of non-overlapping local gates.The circuit proceeds as follows: 1. Perform layers of CNOT gates in the following order:

Perform layers of Toffoli gates in the following
3. Perform single-qubit X gates on e, f , g, h, n, o.

LED for Abelian Quantum Double Models
The snapshot-based LED framework can be extended to enable detection of Kitaev's quantum double models based on any finite abelian group G. Since the quantum double model D(G) of a direct product of finite groups G = G 1 ×G 2 ×...×G k is equivalent to the model where k quantum doubles D(G 1 ), ..., D(G k ) are stacked together, it suffices to consider the quantum double of cyclic groups G d = {0, 1, ..., d − 1}.In such models, an orientation must be assigned to each link of the square lattice, which is occupied by a qudit belonging to the Hilbert space spanned by {|j⟩, j ∈ G d } (Figure 17).To define the vertex and plaquette stabilizers for these quantum double FIG.17: Setup for Kitaev's quantum double models on a square lattice [8].For generic groups G, one must define an orientation for each edge; for simplicity, we choose edges to be oriented upwards and to the right.models, we first introduce the single-qudit shift and clock operators-X ± and Z ± , respectively-which are generalizations of the Pauli matrices X and Z for qubits.We define these operators based on their action on the basis states: where addition is performed modulo d, and ω = e 2πi/d is a d th root of unity.Using these operators, we can define generalized vertex and plaquette operators: Here, the X and Z operators depend on the orientation of the edge j relative to the vertex v or plaquette p under consideration: if the directed edge j points away from v, X(j, v) = X − (j), otherwise X(j, v) = X + (j); if p is on the left (resp., right) of the directed edge j when the lattice is rotated such that j points upwards, Z(j, p) = Z − (j) (resp., Z + (j)) [8].The Hamiltonian for this model is then As in the case of the toric code Hamiltonian (Equation (1)  We now demonstrate how a generalized snapshot-based LED procedure can be used to recognize the quantum double phase.In this case, we begin by measuring all qudits in the basis {|0⟩, |1⟩, ..., |d − 1⟩}, which we refer to as the group basis.Such a measurement allows us to compute all plaquette terms B(p), and identify e-type anyons.The location of such an anyon can be shifted one cell away by applying X B(p) ± to one of the edges in adj(p) (the sign depends on the edge's orientation relative to the plaquette): for example, if the anyon is located on the plaquette p in Figure 17, applying X B(p) − to j 3 will move the anyon up by one cell.The patch-based decoder we use for LED thus corrects errors by grouping together, when possible, two or more plaquettes p 1 , p 2 , ... with nontrivial B(p i ) such that the product i B(p i ) = 1; this can be implemented simply by multiplying qudits by group elements B(p i ) ±1 .The groupings are chosen to minimize the total number of qudits to modify, while still removing as many errors as possible within each patch.
The above procedure allows us to correct for e-type errors.The same LED procedure can be performed to address m-type errors, by measuring qudits in another basis-the representation basis.Representationbasis measurements are performed by first applying a generalized Hadamard operator and then measuring in the group basis.Because the shift operator is diagonal in the representation basis, measurements in this basis allow us to identify m-type anyons, and utilize the patch-based decoding scheme described above for LED.

Background on Generic Topological Phases
Here, we provide background on generic topological quantum field theories (TQFTs), which are characterized by modular tensor categories C. The possible topological charges (a.k.a.anyon types) in such a system are given by the simple objects {α 0 , α 1 , α 2 , ...} of C, where α 0 = 1 is the trivial or vacuum topological charge.Abelian anyons α i have quantum dimension d i = 1, meaning that the outcome of fusing α i with any other anyon α j is deterministic: α i ⊗α j = α k(i,j) for some integer k(i, j).On the other hand, non-abelian anyons α i , α j have quantum dimensions d i , d j > 1, and their fusion can result multiple possible anyon types as governed by fusion rules Here, the fusion coefficients n k ij must satisfy Moreover, each anyon α i has a unique conjugate anyon α j = α i for which n 1 ij = 1 (i.e., α i and α i can annihilate each other by fusing to vacuum); for all other α k , n 1 ik = 0.In addition to anyon types and fusion rules, several other quantities are needed to characterize a TQFT.In particular, for every pair of anyons α i , α j , one can compute the Hopf link Moreover, for each anyon α i , its topological twist is defined as < l a t e x i t s h a 1 _ b a s e 6 4 = " B 6 9 R w I x l v l H h t q e 0 l J D g K w 7 These quantities are used to define the modular S and T matrices of C: where It is conjectured that the modular S and T matrices uniquely define a unitary modular tensor category, or equivalently a topological phase of matter [41].In the main text and Methods, we illustrate the application of LED to Levin and Wen's string-net models based on arbitrary unitary fusion categories A. The MTC describing such a string-net model is the Drinfeld center C = Z(A) [40].Additional background on general TQFTs and MTCs can be found in Refs.[41,42].

Arbitrary Local Perturbations
In this section, we show that LED Wilson loops flow to one for any state which differs from the fixed-point state by an arbitrary local perturbation.This implies that LED loop operators are independent of the exact perturbation, unlike the fattened Wilson loops of Refs.[5,14].For concreteness, we examine perturbations on top of a toric code ground state.
To Proof.The LED procedure forms a local quantum channel, and we begin our proof by constructing a purification of this channel.To mediate stabilizer measurement and local error correction, one can first introduce an ancilla in the state |0⟩ at every vertex and plaquette.Next, a sequence of Hadamard and controlled-NOT (CNOT) gates is applied such that a Z-basis measurement on an ancilla is equivalent to the associated stabilizer measurement of A v or B p .Then, local quantum error correction is performed using a local unitary evolution on the combined system, which contains the original state and the added ancilla qubits.This local unitary evolution applies gates which perform X and Z spin flips on the system qubits, conditioned on the state of the ancilla qubits.Finally, the coarse-graining step can also be performed with local unitary transformations by using a quantum circuit corresponding to a multiscale entanglement renormalization ansatz (MERA) representation of the fixed-point state [62].The transformations generated by introducing product state ancillas and performing local unitary operations are called generalized local unitaries (gLU); this class of transformations includes our LED procedure described above and is known to preserve phase boundaries [18].Proof.To bound the trace distance, we will use the fact that our state ρ d locally looks almost the same as the toric code state.Specifically, trace distance is related to distinguishability by [63] ||ρ To upper bound this, we can consider all possible unit norm operators O. Specifically, O can always be written as a linear combination of Pauli strings.18: Consider two operators A and B, each supported on an annulus which intersects at two regions, one higher and one lower.The twist product A∞B consists of applying B first in the higher region, and A first in the lower region (also see Ref. [7] Fig. 1 and Eq. 4).In the diagram the order of operations goes back to front.Furthermore, for tensor product operators which can be written as A = A low A high , B = B low B high , we can write the twist product as A∞B = B low A high A low B high .
show this, we add the two individual bounds to obtain ⟨A⟩ + ⟨B⟩ > 2 − 2ϵ; moreover, since AB has spectrum {0, 1}, we have ⟨A⟩ + ⟨B⟩ − ⟨AB⟩ < 1.It thus follows that ⟨AB⟩ > 1−2ϵ, and upon applying this recursively to include all vertex and plaquette terms within the L × L region, we obtain Using this fact, along with CP TC = P TC we can similarly lower bound the expectation value Tr[ρ d C] ≥ 1−4L 2 ϵ.Thus, for any C, we have 1  2 Next, we consider operators O which anti-commute with some stabilizers.In particular, these operators are Pauli strings with at least one endpoint (open strings).Naturally, their expectation value vanishes in the toric code state.To see this, let S be one of the stabilizers which anti-commutes with O. Now, S and O form an anti-commuting pair of Pauli operators, so they satisfy an uncertainty relation ⟨S⟩ To prove these results, we extend and generalize the proof techniques developed by Ref. [7].Note that for notional simplicity, here we work with an input state |ψ⟩ that is a purification of ρ.This is done without loss of generality, since all of the operations act on the original degrees of freedom.
Consider a pair of Z-basis and X-basis Wilson loops A and B, supported on two overlapping annuli.The twist product of the two operators A∞B is defined such that at one intersection region, operator B is applied first, while at the other operator A is applied first (Fig. 18).By the arguments of Ref. [7], such a pair of locally noncommuting observables, whose twist product does not factorize into a product of the individual observables, can serve as a witness for long-range entanglement.In our case, since Z-and X-strings locally anti-commute, we can remove the twist to get A∞B = −AB.
Then, Ref. [7] showed that, assuming the observables A and B satisfy an additional important property called local invisibility (see below), then the following correlation serves as a witness for long-range order.
Specifically, the state |ψ⟩ cannot be prepared from a trivial state by a circuit of depth O(L), where L is the separation between the two intersection regions.Indeed, in the exact case, where the expectation value of large LED Wilson loops are one, the results of Ref. [7] can be directly applied.However, the proofs in Ref. [7] do not immediately apply to the realistic case considered here, where stabilizers have expectation value 1 − ϵ, and residual entanglement between the system and ancilla or environment qubits prevents exact knowledge of the state.Nevertheless, with sufficient care and a few additional assumptions, approximate versions of key results in Ref. [7] can be recovered.
First, we develop a notion of approximate local invisibility.Throughout, we follow the spirit of the proofs in Section III of Ref. [7]; the reader is encouraged to consult the original reference for additional details and insights.
Definition 5 (Approximate (∆, r, t)-local invisibility.).Let A be a region of radius r and B be a t-ball around A. An operator O with unit norm is (∆, r, t)-locally invisible with respect to a state |ψ⟩ if, for any state |ϕ⟩ whose reduced density matrix on B is equivalent to |ψ⟩, it satisfies where the norm is the standard trace norm.In other words, locally invisible operators leave local reduced density matrices approximately unchanged.Note that we restrict to states |ϕ⟩ for which the expectation value does not vanish, such that this remains well-defined.This subtlety is also present in the original definition of Ref. [7].
Next, we will show that Wilson loops that nearly stabilize |ψ d ⟩ are approximately locally invisible.Let A be a region of radius r, which can only cover a patch of the loop.Furthermore, let t = 0, i.e. region B is identical to region A. Since the Wilson loop is a tensor product of local unitaries, we can write This allows us to work directly with the reduced density matrices of region B, and we can use Lemma 3 to reduce to the toric code case Indeed, since O is locally invisible with respect to to the toric code, this gives us our result, where the error term depends on the size of B.
More microscopically, O spans the region, so locally looks like a logical operator.The reduced density matrix σ TC on region B is an equal weight mixture of all logical states, so O leaves it invariant.This shows that Wilson loops are (∆, r, t)-locally invisible with respect to |ψ d ⟩ for t ≥ 0 and ∆ = max √ ϵ, 2(r + 1) 2 ϵ .When combined with the fact that Wilson loops have large expectation value on |ψ d ⟩, this will serve as a witness for long-range topological order.
To prove this, we need to confirm that, even for the weaker notion of approximate local invisibility, the twist product approximately factorizes for trivial states.where A and B are supported on two annuli which intersect at two regions (Fig. 18) whose separation is ≥ 2(r + t).
Proof.In the first step of the proof, we bound the expectation value of Π R = i∈R |0⟩ ⟨0| i , the projector onto |ψ⟩ supported on region R evaluated with respect to O |ψ⟩ for unitary O.
Invoking the definition of local invisibility, we show for Thus, the expectation value of the observable Π A satisfies: Next, we can use the fact that Π R can be written as a product of Π A approximately R/r times.It follows from the same union bound argument in Lemma 3, that To prove the main result, we use the same construction as Ref. [7].Specifically, we want to use the above result to show that A∞B |ψ⟩ = (AΠ R )∞B |ψ⟩ + O(∆L 2 ).We do this by carefully inserting projectors.For Wilson loops, which are tensor product operators, we the twist product can be split up as follows (see Fig. 18), Our above result implies Π R B high |ψ⟩ = B high |ψ⟩ + O(∆R/r).We can subsequently pull projectors from |ψ⟩ to cover the region of support of A, e.g.low and the parts of high.Thus, we get as we wanted.Finally, we this implies the expectation value of the twist product approximately factorizes Although we proved that the twist product must factorize for the trivial product state, this holds for a much wider class of short-range entangled states, generated from a trivial state by a finite-depth unitary circuit.In particular, using the same argument as Haah Lemma III.3 shows that, given a (∆, r, t)-locally invisible operator O and state |ψ⟩, if we evolve under a local unitary circuit W of depth d, then the operator W OW † is (∆, r − d, t + 2d)-locally indistinguishable with respect to W |ψ⟩.This will be used to show that non-factorizability of the twist product lower bounds the depth of a quantum circuit required to produce the state from the trivial product state.
Finally, we can use the trace distance Lemma 3, to show the twist product does not factorize for |ψ d ⟩.Specifically, let A and B be Wilson loops supported on an L × L region.Then, for a constant c.Combining this Lemma 6 for trivial states, we see the bound is violated when We choose r to be a constant fraction of L , and see that we can roughly make L ∼ O (

Connection Between LED and Entanglement Negativity
The LED framework suggests a characterization of topological order based on the ability to distill the fixedpoint wavefunction using generalized local unitary operations.In this section, we connect this definition to the topological entanglement negativity of the input state, a typical observable used to detect topological order in mixed states [25,26].
As described above, the circuit construction for LED involves applying local unitary transformations to the input mixed state ρ S and product state ancillas |0⟩ A ⟨0|. States that are classified as topological by LED are connected via a finite-depth local unitary to the toric code fixed-point state and an ancillary register (see Theorem 1).
In particular, all of the entropy in the input state, associated with both incoherent and coherent fluctuations away from the fixed point state, is transferred to the ancilla σ A ′ .
We conjecture that the ability to "distill" the toriccode fixed point state also implies the presence of a topological correction to the entanglement negativity of the input state.Although we cannot prove this statement rigorously, we make the connection more precise in this section.First, we make the plausible assumption that the ancilla σ A ′ is in a trivial mixed state.This ensures all of the topological contribution to the entanglement negativity comes from the system part S ′ .Then, we argue the topological contribution remains after applying inverse LED circuits (coarsening of the Wilson loops).In particular, if we consider local Clifford circuits, we can show this is indeed the case.Together, these arguments suggest that the topological order witness provided by LED should also serve as a witness for other quantities like entanglement negativity in many scenarios of practical interest.
The key assumption we make is that the ancilla σ A ′ is in a trivial mixed state.Concretely, we assume that there exists a local purification of σ A ′ which is connected to a product state under local unitary circuits (Figure 19).This local purification is constructed by doubling the number of qubits, such that σ A ′ = Tr P [|Σ⟩⟨Σ|] A ′ P .Here, FIG.19: Theorem 1 shows that a positive LED classification implies the input mixed state ρS and product state ancilla's (A) can be connected to an output state of the form |ψTC⟩ S ′ ⟨ψTC| ⊗ σ A ′ , where S ′ is typically smaller than S due to coarse-graining.To make a connection between LED and entanglement negativity of ρS, we further assume σ A ′ is trivial.In particular, we assume there is a local purification of σ A ′ that is connected to the product state via local unitaries.Equivalently, we assume σ A ′ can be generated from a product state by applying local unitaries and tracing out some degrees of freedom.
P is the subsystem which implements the purification.Qubits in P are placed next to qubits in A ′ , so that the local structure is preserved.Then, we assume that there is a local unitary U † D which maps |Σ⟩ to a product state.Thus, σ A ′ = Tr P [U D |0⟩⟨0|U † D ] can be "locally purified" to a product state.We note that in the circuit model, the assumption about σ A ′ may be checkable via state tomography.
Taking into account the purified register of qubits, the output state can now be written as a pure state.Further, it is a stabilizer state, with toric code stabilizers A v , B p for the S ′ subsystem, and trivial stabilizers Z i for the combined A ′ P subsystem.Note we assume for simplicity a topologically trivial manifold, so there are no non-trivial logical operators.Our construction then implies that this stabilizer state is connected to a purification of the input state via local unitary circuits.If we then trace out the degrees of freedom associated with P , this produces the input mixed state.We can leverage the stabilizer structure to make concrete statements about the entanglement negativity of this input mixed state.
First, we review the calculation of the entanglement negativity from Ref. [60], for the toric code output state.Consider a partition of the system into region R and its complement R ′ .Note that R is associated with a region of space, and hence contains sites from all three subsystems S ′ , A ′ , and P .The entanglement negativity is given by S , where T A is the partial transpose of the output density matrix, and p ′ i are the associated eigenvalues.The partial transpose of the density matrix ρ, which is defined as where |i⟩ A and |j⟩ A c form an orthonormal basis for the two parts of the system.To start, notice that the only non-zero eigenvalue of the bare output state ρ ′ corresponds to the simultaneous +1 eigenstate of all the stabilizers, A v , B p , and Z i .
Under the inverse LED operations, each individual stabilizer is coarsened, making exact computation of the entanglement negativity difficult.However, the LED circuit provides additional structure.Importantly, the toric code stabilizers map onto the system part.These become the LED Wilson loops which we measure in the input state.In contrast, the trivial stabilizers can also map onto subsystem that will be traced out.As a result, we expect the coarsened toric code stabilizers will still contribute a topological term in the entanglement negativity.We conjecture this is true for any local unitary circuit.However, we are able to calculate it if we consider the specific case of local Clifford circuits.Note that the LED circuits which implement local pairing decoders are not Clifford circuits, and hence the argument does not rigorously apply in that case.
Let A v , B p label the toric code stabilizers in the original state, and Z i the stabilizers of the ancilla.Under the Clifford unitary, these stabilizers are mapped to coarsened versions, Ãv , Bp , Zi .
The reduced density matrix of the input state, before tracing out the auxilliary qubits, can be written as Suppose there are N = V + P + A stabilizers and an equivalent number of qubits.This is the case if we are working on a topologically trivially manifold.Then, ρ has a unique non-vanishing eigenstate with eigenvalue one.Thus, log ||ρ|| 1 = 0. Following Ref. [60], we can equivalently write Next, consider splitting the system into two regions, R and R ′ , and take the partial transpose of ρ on R.
The key to computing the entanglement negativity is to simplify Ãsv In the output state, which is simply the toric code state with product state ancillas, the entanglement negativity can be exactly computed, and has been shown to have a topological correction coming from the long-range topological order [27,60].We extend this computation to show the topological correction survives upon performing local Clifford circuits and tracing out the ancillary degrees of freedom.
We start by reviewing the computation in the output, fixed-point state.The first thing to notice is that Z i trivially commutes with A v and B p , because they are supported on different qubits.Second, Z i is invariant under partial transpose, since the operators are supported on a single site and hence cannot span the boundary between R and R ′ .Thus, we can pull the Z i out from the product.
Next, we discuss the effect of partial transpose on the toric code stabilizers, following Ref.[60].The only stabilizers which are affected non-trivially are those that span the boundary.In particular, if we consider a pair of stabilizers A v and B p that intersect at two sites, but only one of the sites is supported in R, then they pick up a minus sign under partial transpose (see Figure 20 We can now discuss the spectrum of the partially transposed density matrix.Note that an orthonormal basis for the Hilbert space can be formed from simultaneous eigenstates of all the stabilizers.These states are labelled by the stabilizer eigenvalues, which can be ±1.For nontrivial eigenstates of ρ T A , stabilizers which are unaffected by partial transpose must have eigenvalue one.Thus, we can reduce the spectrum calculation to only stabilizers on the boundary.
Therefore, we can associate eigenstates with expectation values of "strange correlators" of the form ⟨+| • |ψ⟩ [60].Order stabilizers around the boundary, so A v are on even sites and B p on odd sites, and consider specifically the correlators, Here, ψ(s) = (−1) i sis (i+1)modL is a wavefunction that encodes the signs coming from partial transpose, and ⟨+| = 2 −L s ⟨s| is a uniform superposition over all configurations.The wavefunction for ψ(s) is the same as the 1D cluster state.Non-vanishing correlators are generated by products of Z 2i−1 X 2i Z 2i+1 and Z 2i X 2i+1 Z 2i+2 , the stabilizers of the cluster state.There are 2 L−2 of such non-vanishing correlators, each with expectation value ±⟨+|ψ⟩.The overlap ⟨+|ψ⟩ is 2 −n+1 , where L = 2n.Thus, the entanglement negativity is S N = (n − 1) log 2 where n is the size of the perimeter.The constant correction is a signature of topological entanglement entropy.
Next, we discuss how the effect of finite-depth Clifford circuits on the entanglement negativity.In particular, since Clifford circuits map stabilizers to stabilizers, eigenstates of ρ T A can still be labelled by stabilizer expectation values, and the entanglement negativity can be calculated by enumerating non-zero strange correlators.However, a few important things change.The set of stabilizers which span the boundary, and hence may have non-trivial twist products with other stabilizers, is considerably larger.Any A v , B p , or Z i stabilizer that is within distance ℓ of the boundary could contribute.Applying the same procedure as in the case of the toric code, we can enumerate non-trivial strange correlators of the form ⟨+|O|ψ ′ ⟩ for a different state ψ ′ (s).However, now the Hilbert space of ψ ′ (s) has one qubit associated with each relevant A v , B p , or Z i .Now, we argue that new state ψ ′ (s) preserves the same cluster-state structure as in the fixed-point case and still has long-range SPT order.First, we show that ψ ′ still has a Z 2 ×Z 2 symmetry, generated by the product of Pauli-X operators on all qubits associated with A v , or all qubits associated with B p .To see this, notice that the product of all relevant A v decomposes into two independent Wilson loops, each supported distance ℓ away from the boundary on the interior and exterior sides.Each of these Wilson loops individually has trivial twist-product with the other transformed stabilizers, implying that it can be applied (on either side) to the partially-transposed state ρ T A without changing the state.This further implies that ψ(s) is invariant under applying the Pauli-X associated with each A v qubit.
Second, we show that there exists long-range SPT order in ψ ′ (s).In particular, to do this, we show that there are coarse-grained stabilizers which have the same behavior under partial transpose as the stabilizers at the toriccode fixed point.Consider large Wilson loops generated by multiplying either A v or B p in a large contiguous region spanning the boundary (see Figure 20).In particular, if we look at regions that are offset, the large Wilson loops associated with A v or B p necessarily anti-commute on either side of the boundary, leading to a twist product of −1.Therefore, we can construct coarse-grained Pauli-'Z' and 'X' operators in the Hilbert space of ψ ′ simply by taking products of single-qubit Pauli operators.This argument shows that the coarse-grained ZXZ operator is a stabilizer of the state.Finally, we discuss the effect of the remaining degrees of freedom on the entanglement negativity.The Zi stabilizers split into two groups: those that contain support on P , and those that are fully supported on SA.Let us start with the first group.Since we trace out all of subsystem P , the effect on the Zi stabilizers is to replace the stabilizer state with the maximally mixed state The operator I/2 has two eigenvectors, each with eigenvalue 1/2.Thus, any stabilizer with support on P becomes fully disentangled from the rest of the system, and has no effect on the entanglement negativity.Next, consider stabilizers that are fully supported on SA.The Zi which are near the boundary between R and R ′ will potentially contribute to the entanglement negativity.Furthermore, they may have non-trivial commutation with Ãv , Bp , and other Zi after partial transposition.Thus, they can contribute to the topological entanglement entropy.However, since only operators near the boundary are affected by partial transpose, these operators only contribute an area-law contribution.Further, we note that they cannot change the long-range SPT order of ψ(s), since they commute with the Z 2 × Z 2 symmetry.
As such, they also should not affect the value of the topological term.The argument presented above relied on the fact that the stabilizers of the state were Pauli operators.This meant the spectrum of ρ T A could be exactly computed, and the techniques of Ref. [60] could be applied.However, the key part of the proof involved generating a sub-algebra of coarse-grained Wilson loops with twistproduct −1.LED provides a constructive method for measuring such coarse-grained Wilson loops, with nontrivial twist products, in generic mixed states, as explained in our proof of Theorem 1.Hence, it would be interesting to directly link the existence of operators with non-trivial twist product to the topological entanglement negativity in general mixed states.

Valence-Bond Solid Phase
In the main text, we argued that the flow of closedloop and open-string Wilson operators suggest that the large ∆/Ω regime is most consistent with a decoherencedominated disorder phase.This in contrast to numerical simulations, which suggest the ground state in this regime is a valance bond solid (VBS) state [29].The VBS fixed-point state can be understood as a single dimer covering, in contrast to the spin-liquid state which is a uniform superposition over dimer coverings.More generally, in VBS phase the m-anyons become condensed and the eanyons become confined.As such, in the VBS phase, we would expect that closed Z-loops flow to +1, and open Z-strings flow to either +1 or −1 depending on how many dimers they intersect.However, our analysis shows that all Z-loops, both open and closed, stay near zero under LED flow.In the main text, we average over all open Z-strings, so the vanishing signal could be due to cancel-   lation of individual loops that flow to opposite values.In Figure 21, we also plot a representative, single Z-string, and see the expectation value still remains close to zero at large ∆/Ω.Since the X-loops also remain at zero, this is the same signature of the high incoherent error regime of the toric code mixed-state phase diagram.
Detecting Gauge-Glass Phases and More The LED techniques developed here can also be applied to characterize generalized toric code orders in higher dimensions.The 2D toric code we study has point-like excitations.However, different models can have higher-dimensional excitations, such as line-like excitations appearing in the 2D Ising model and 3D gauge theories.LED can also be applied in these cases.In particular, simple local decoders for models with line-like excitations also exist.For example Toom's rule, as described in Ref. [64], can be made into a local decoder by restricting the number of update steps to some constant.The patch-based decoder can also be generalized to this case by locally identifying small contractible loops.Another strategy would be to consider spatial slices of the model with line-like excitations.This would result in a lower-dimensional model with point-like excitations, for which the techniques presented in this paper can be directly applied.
A particularly interesting case study is the 3D randomplaquette gauge model.The degrees of freedom live on the links of the 3D square lattice.Products of spin operators around each plaquette measure the magnetic flux.Excitations are line-like magnetic flux tubes, coming from chains of excited plaquettes.The model also has quenched disorder, so that the zero-temperature state has a finite density of magnetic flux tubes.Hence, there are two sources of flux tubes, the quenched disorder as well as thermal fluctuations.Due to the gauge constraints, the combination of flux tubes from quenched disorder and thermal fluctuations always form closed loops.
Let K p be the parameter which determines the density of quenched disorder, and K the effective temperature.The model has three phases of interest to us.The first is an ordered phase for small K and K p , where the density of flux tubes is small.The second is a disordered phase at large K and K p , where flux tubes condense.These two phases can be distinguished by measuring the disorder averaged Wilson loop [⟨W (C)⟩ K ] Kp .In Ref. [44], it is suggested that these two phases be identified by comparing perimeter-law decay vs. area-law decay in each of the distinct phases.Perimeter-law decay indicates that the fluctuations which cause the Wilson loop to decay are local, and hence characterizes the ordered phase.
The third phase is a disordered but glassy phase at large K p but small K.In this phase, quenched disorder is large, leading to a high density of flux tubes.As a result, the disorder averaged Wilson loop obeys an arealaw, consistent with a disordered phase.However, thermal fluctuations remain small, and the pattern of flux tubes is static when averaged over thermal fluctuations.Therefore, the square of the thermal expectation value, [⟨W (C)⟩ 2 K ] Kp , should decay as perimeter-law and can hence distinguish the disordered phase from the glassy phase.
The LED observables we construct here can be used to more robustly classify these phases as well.In particular, as explained in the main text, differentiating between perimeter-law and area-law is difficult in practice.Both of these signals decay exponentially in loop size, causing the sample complexity to increase significantly.Further, area-law generically becomes mixed with perimeter-law in the presence of additional imperfections or perturbations, such as incoherent errors or gauge-constraint violating terms.However, using LED, the Wilson loops will be amplified to one only in the ordered phase.Similarly, the squared Wilson loop ⟨W (C)⟩ 2 K would be amplified in the ordered and glassy phases.This observable can also be efficiently measured from snapshots, as long as we are able to sample multiple times from each quenched disorder realization.Another strategy, which could be more sample efficient, is the following: Given two independent snapshots s 0 , s 1 from the same quenched disorder realization, one can compute the element-wise sum modulo two, s = s 0 ⊕ s 1 , and then measure the LED Wilson loop on the new snapshot s.Intuitively, such a procedure effectively removes the quenched disorder, which is fixed from snapshot-to-snapshot, leaving behind only the thermal fluctuations.Identifying such gauge-glassy models is also difficult in numerical simulations, and hence LED and related ideas could also be applicable in those contexts.

Annulus Decoders
In this section, we consider an alternative approach to constructing error corrected operators, by applying MWPM to an annulus.Anyons supported on the annulus can be paired either with other anyons, or with the boundary of the annulus.Interestingly, MWPM is a global decoder, where introducing or removing anyons can change the pairing far away.However, by construction, the decoder cannot connect the interior of the annulus to the exterior.
We show in Figure 22 the behavior of these corrected loop operators for coherent, incoherent, and mixed errors.In particular, for the incoherent error model, we see the region classified as topological seems to coincide with the known error recovery threshold of ≈ 10.1% for MWPM.This is much closer to the theoretical optimal error correction threshold of ≈ 10.9%, where we expect the phase transition from topological to disordered to occur.
Since this decoder is non-local, our existing theoretical arguments, and the connection to RG, may not apply.Nevertheless, an annulus decoder cannot change the super-selection sector-whether or not an anyon is contained within the annulus.Therefore, if the annuluscorrection decorated loops go to one, then asymptotically large regions have well-defined super-selection sec-

FIG. 1 :
FIG.1: Detecting topological phases via snapshot-based LED.(a) In the absence of perturbations, a topologically-ordered state with zero correlation length such as Kitaev's toric code state[8] is characterized by +1 expectation values of 'bare' Wilson loop operators, which are typically tensor products of single-site operators (dotted blue loop).In realistic systems, however, coherent perturbations give rise to virtual anyon pairs (red dots/straight lines), and incoherent errors introduce physical anyon pairs (orange dots/wavy lines); this causes the expectation value of bare Wilson operators to decay exponentially with the loop's perimeter.To account for these local fluctuations, one can measure 'fattened' Wilson operators supported on an annulus (blue); the LED loops constitute one realization of this.(b) LED method to measure decorated Wilson loop observables for Z2 topological order in a system where qubits live on the links of a square lattice, and stabilizers are associated with vertices.Given an experimental snapshot of all qubits in the Z or X basis, one can obtain values for all stabilizer operators in that basis, thereby identifying the locations of all e or m anyons, respectively.In the first step, neighboring anyons are paired using a local decoder (dashed pairings), and each pair is removed by flipping the value(s) of qubit(s) lying on a path of minimal length connecting the two anyons; subsequently, the lattice is coarse-grained so that only a fraction of the original qubits remain.These two steps are iterated n times (here, n = 2), after which a bare Wilson loop is evaluated on the final, coarse-grained state.(c) The final, bare Wilson loop operator evaluated on the final state is equivalent to decorated Wilson loop operators evaluated at earlier iterations (see Methods).

FIG. 2 :
FIG. 2: Numerical demonstration with coherently perturbed toric code states.(a) In a general construction of our LED Wilson loop operator, we use a local decoder which pairs anyons within a region of radius d (blue annulus).Conjugate LED open string operators (red stripe) anti-commute with Wilson loops, and hence must vanish in the topological phase.(b) Order parameter ⟨X loop ⟩⟨Z loop ⟩ for a trivial state (gZ = 0.0, gX = 0.26) and a topological state (gZ = 0.12, gX = 0.12), upon varying n, using a distance-four patch decoder and coarse-graining blocksize two respectively (see Methods).(c) Output at different n along the gZ = 0.14 line of the phase diagram.Gray dotted line is conjectured phase transition region.(d) Expectation values of generic LED Wilson loops with the same diameter L, using the pairing decoder (d = 1) and distance-four patch decoder (d = 2) without coarse-graining.(e,f) Corresponding expectation values of bare and decorated open string operators.(g) Order parameter values constructed from bare Wilson loops (n = 0) and LED Wilson loops (n = 3), using the same LED procedure as (c,e), across varying values of (gX , gZ ).Dark gray regions are numerical estimates for the phase boundary between topological and trivial (Methods).Light gray regions correspond to locations where sampling is expensive due to large correlation length.

FIG. 3 :
FIG. 3: Application to mixed states.(a) Without error correction, generic points in the topological and trivial, disordered phase (gZ = 0.12, gX = 0.18, p flip = 0.0 and gZ = 0.06, gX = 0.0, p flip = 0.11 resp.shown in the plot) appear very similar qualitatively, as closed loops decay exponentially with loop perimeter in both cases, while open strings remain close to zero (see Methods).In contrast, in the trivial, paramagnet phase (gZ = 0.32, gX = 0.2, p flip = 0), open strings decay with the same perimeter-law as closed loops.(b) gZ = 0.14 slice of mixed state phase diagram, containing topological, disordered, and X-paramagnetic phases.These phases are associated with fixed-point states gx = gz = p flip = 0, gz → ∞, gx → ∞, and p flip → 0.5, respectively.The flow of the closed-loop decay exponent α under LED provides a sharp divider between two kinds of perimeter-law decay, observed in different regimes of the mixed-state phase diagram.(c) In the uncorrectable regime (i), the local decoder of LED pairs anyons incorrectly, resulting in perimeter-law decay with large α in disordered and paramagnetic phases.Moreover, the probability of such an incorrect pairing can increase with the number n of LED iterations.Here, the black pairings are made by LED at or before one specific value of n, and gray pairings are made upon performing one additional LED iteration.In the correctable (topological) regime (ii), increasing n can reduce α to zero, as fluctuations of higher characteristic length ξ can be reliably corrected using only local information.In the conceptual framework where an LED operator is embedded in a surface code on an annulus (see Figure2a), incorrect pairings corresponds to logical errors (e.g.XL).(d) Expectation values of LED loop observables upon increasing n (d, L ∝ 2 n ), in thermal states of varying temperatures (between 0 and 0.35, with darker colors indicating higher temperatures) and p flip = 0.02.

FIG. 4 :
FIG.4: Enhancing experimental detection of Z2 spin liquid.(a,d) In the experiment[28], 219 qubits are placed on the links of a kagome lattice.Upon applying LED, the Z and X closedloop observables are amplified for certain ranges of ∆/Ω.The shaded purple regions show the support of large, decorated Wilson loops after one layer of correction with n = 1.(b,e) Expectation value of Wilson loops depicted in (a,c) for different correction layers n.Plotted error bars (shaded regions) show expected variation (one standard error) of the mean.The regime in which both types of loops are amplified corresponds nicely to the spin-liquid regime identified in Ref.[28] (shaded blue region).(c,f) The behavior of expectation values of open Z-and X-strings under LED further confirms our findings, as both types of open strings stay at 0 in the spinliquid regime.Here, the measured open strings are half of the Wilson loops.By considering the behavior of all types of loops and strings-closed and open, Z and X-we find that there are four regimes (I-IV), corresponding to four phases: (I) Zparamagnet, (II) X-paramagnet, (III) topological spin liquid (blue), and (IV) a phase which is consistent with strong decoherence effects (gray).In our analysis, the progression from Regime (III) to (IV) appears to be smooth.
< l a t e x i t s h a 1 _ b a s e 6 4 = " E N h 6 R G i O g Z b 5 L G e 6 t H p + h v V U Z 4 0 = " > A A A B 7 3 i c b V D L S g N B E O y N r x h f U Y 9 e B o P g K e y K r 2 P Q i 8 c I 5 g H J E n o n s 8 m Q 2 d l 1 Z l Y I S 3 7 C i w d F v P o 7 3 v w b J 8 k e N L G g o a j q p r s r S A TX x n W / n c L K 6 t r 6 R n G z t L W 9 s 7 t X 3 j 9 o 6 j h V l D V o L G L V D l A z w S V r G G 4 E a y e K Y R Q I 1 g p G t 1 O / 9 c S U 5 r F 8 M O O E + R E O J A 8 5 R W O l d h d F M s Q e 7 5 U r b t W d g S w T L y c V y F H v l b + 6 / Z i m E Z O G C t S 6 4 7 m J 8 T N U h l P B J q V u q l m C d I Q D 1 r F U Y s S 0 n 8 3 u n Z A T q / R J G Ct b 0 p C Z + n s i w 0 j r c R T Y z g j N U C 9 6 U / E / r 5 O a 8 N r P u E x S w y S d L w p T Q U x M p s + T P l e M G j G 2 B K n i 9 l Z C h 6 i Q G h t R y Y b g L b 6 8 T J p n V e + y e n F / X q n d 5 H E U 4 Q i O 4 R Q 8 u I I a 3 E E d G k B B w D O 8 w p v z 6 L w 4 7 8 7 H v L X g 5 D O H 8 A f O 5 w 8 N A I / + < / l a t e x i t > ↵ i < l a t e x i t s h a 1 _ b a s e 6 4 = " v D / m b L H G t 4 v j H G c / P I 1 t d P l B c X 4 = " > A A A B 7 3 i c b V D L S g N B E O z 1 G e M r 6 t H L Y B A 8 h V 3 x d Q x 6 8 R j B P C B Z Q u 9 k N h k z O 7 v O z A p h y U 9 4 8 a C I V 3 / H m 3 / j J N m D J h Y 0 F F X d d H c F i e D a u O 6 3 s 7 S 8 s r q 2 X t g o b m 5 t 7 + y 1 1 e j F N I y Y N F a h 1 2 3 M T 4 2 e o D K e C j Y u d V L M E 6 R D 7 r G 2 p x I h p P 5 v e O y b H V u m R M F a 2 p C F T 9 f d E h p H W o y i w n R G a g Z 7 3 J u J / X j s 1 4 Z W f c Z m k h k k 6 W x S m g p i Y T J 4 n P a 4 Y N W J k C V L F 7 a 2 E D l A h N T a i o g 3 B m 3 9 5 k T R O K 9 5 F 5 f z u r F y 9 z u M o w C E c w Q l 4 c A l V u I U a 1 I G C g G d 4 h T f n 0 X l x 3 p 2 P W e u S k 8 8 c w B 8 4 n z 8 O h I / / < / l a t e x i t > ↵ j < l a t e x i t s h a 1 _ b a s e 6 4 = " f O s 6 l 8 T K M c E K O J + p w d 3 8 a u + I

< l a t e x i t s h a 1 _
b a s e 6 4 = " B 6 9 R w I x l v l H h t q e 0 l J D g K w 7 + a f 0 = " > A A A C C X i c b V D L S s N A F J 3 4 r P U V d e l m s A i u S i K + N k L R j c s K 9 g F N C J P J p B 0 7 e T B zI 5 S Q r R t / x Y 0 L R d z 6 B + 7 8 G 6 d p F 9 p 6 4 M L h n H u 5 9 x 4 / F V y B Z X 0 b C 4 t L y y u r l b X q + s b m 1 r a 5 s 9 t W S S Y p a 9 F E J L L r E 8 U E j 1 k L O A j W T S U j k S 9 Y x x 9 e j / 3 O A 5 O K J / E d j F L m R q Q f 8 5 B T A l r y T A x e z u 8 L f I m d U B K a O w E T Q E q t y A O P F 5 5 Z s + p W C T x P 7 C m p o S m a n v n l B A n N I h Y D F U S p n m 2 l 4 O Z E A q e C F V U n U y w l d E j 6 r K d p T C K m 3 L z 8 p M C H W g l w m E h d M e B S / T 2 R k 0 i p U e T r z o j A Q M 1 6 Y / E / r 5 d B e O H m P E 4 z Y D G d L A o z g S H B 4 1 h w w C W j I E a a E C q 5 v h X T A d G J g A 6 v q k O w Z 1 + e J + 3 j u n 1 W P 7 0 9 q T W u p n F U 0 D 4 6 Q E f I R u e o g W 5 Q E 7 U Q R Y / o G b 2 i N + P J e D H e j Y 9 J 6 4 I x n d l D f 2 B 8 / g A 5 T 5 q 0 < / l a t e x i t > t ij = ij d i < l a t e x i t s h a 1 _ b a s e 6 4 = " E N h 6 R G i O g Z b 5 L G e 6 t H p + h v V U Z 4 0 = " > A A A B 7 3 i c b V D L S g N B E O y N r x h f U Y 9 e B o P g K e y K r 2 P Q i 8 c I 5 g H J E n o n s 8 m Q 2 d l 1 Z l Y I S 3 7 C i w d F v P o 7 3 v w b J 8 k e N L G g o a j q p r s r S A T X x n W / n c L K 6 t r 6 R n G z t L W 9 s 7 t X 3 j 9 o 6 j h V l D V o L G L V D l A z w S V r G G 4 E a y e K Y R Q I 1 g p G t 1 O / 9 c S U 5 r F 8 M O O E + R E O J A 8 5 R W O l d h d F M s Q e 7 5 U r b t W d g S w T L y c V y F H v l b + 6 / Z i m E Z O G C t S 6 4 7 m J 8 T N U h l P B J q V u q l m C d I Q D 1 r F U Y s S 0 n 8 3 u n Z A T q / R J G Ct b 0 p C Z + n s i w 0 j r c R T Y z g j N U C 9 6 U / E / r 5 O a 8 N r P u E x S w y S d L w p T Q U x M p s + T P l e M G j G 2 B K n i 9 l Z C h 6 i Q G h t R y Y b g L b 6 8 T J p n V e + y e n F / X q n d 5 H E U 4 Q i O 4 R Q 8 u I I a 3 E E d G k B B w D O 8 w p v z 6 L w 4 7 8 7 H v L X g 5 D O H 8 A f O 5 w 8 N A I / + < / l a t e x i t > ↵ i (4) where d i is the quantum dimension of α i and D = i d 2 i .For example, a key signature of the toric code MTC C = D(Z 2 ) is the −1 twist product between e and m anyon loops (s em = −1).

FIG. 5 :
FIG.5: LED for generic string-net models.(a) An ancilla qudit is used to measure the topological charge within each local region R: we initialize the ancilla in |0⟩, apply a local unitary U = N −1 i,j=0 |(i + j) mod N ⟩⟨j|anc ⊗ Pi, where Pi projects R onto the subspace with topological charge αi, and finally measure the ancilla's state.(b) Local error correction is performed by inputting the fusion rules of C into a maximum-likelihood patch-based decoder.Given any l × l patch, one identifies possible groupings of anyons (including groupings to the boundary) that can remove all nontrivial topological charges within the patch.The decoder performs the grouping of highest probability by fusing anyons or dragging them to the boundary of the patch[38].If C is non-abelian, the vacuum topological charge may only be attained probabilistically with probability 1 − α pα, or a nontrivial topological charge α remains with some probability pα.(c) The system is then coarse-grained by applying a quantum circuit corresponding to a multiscale entanglement renormalization ansatz (MERA) representation of the fixed-point state[39].(d) At the final layer, S-and T -matrix elements can be measured by introducing an ancilla qubit in the |+⟩ state and applying controlled-anyon-braiding operations.More details on implementing Steps (c) and (d) can be found in Methods.

FIG. 6 :
FIG. 6: PEPS sampling algorithm.Expectation values are computing with respect to both |ψ⟩ (back) and ⟨ψ| (front).(a) Tracing, or averaging over measurement outcomes can be done by contracting the physical indices, and is needed to compute marginal probabilities.(b) To compute the probability of a particular Z basis measurement, the physical index is assigned a particular value ab.(c) We can efficiently contract a 2D PEPS tensor network on an infinite strip of finite height, by using a left and right boundary MPS (only top four rows shown).The probability distribution for projective measurements on a particular site, e.g.xy = 11 can then be computed efficiently.(d) Once an entire column has been sampled, the measurementdependent MPO can applied to the boundary MPS.Although performing this contraction exactly causes the bond-dimension to grow rapidly, away from phase boundaries, finite bond dimension is sufficient for accurate simulation.See Supplementary Information for more details.

FIG. 7 :
FIG. 7: LED coarse-graining and operator transformation.(a) In the toric code model, qubits are located on the links of a square lattice, and the stabilizer associated with any plaquette is given by a product of four single-qubit Pauli-Z operators.(b) Coarse-graining maps a b × b block of plaquettes to a single plaquette whose value is the product of the b 2 plaquettes (here b = 2).Microscopically, coarse-grained qubits σ ′ are products of b lower-level qubits σ.Coarse-grained stabilizers B ′ u are therefore equivalent to a product of b × b stabilizers at the lower level.(c) Pairing correction flips a qubit conditioned on the state of its two neighboring stabilizers.This is equivalent to an operator transformation where the qubit is decorated by products of closed loops.

FIG. 11 :
FIG. 11: Perimeter-law decay of Wilson loops is clearly visible at various points in the topological phase-(orange) gZ = 0, gX = 0.18, p flip = 0, (red) gZ = 0.18, gX = 0.18, p flip = 0, (purple) gZ = 0.10, gX = 0.18, p flip = 0.03.This is observed for both (a) uncorrected loops and (b) d = 6 corrected loops under two layers of d = 3 MWPM patch decoding.(c) LED Wilson loops appear to approach one faster than exponential in n.(d) In a model with only incoherent errors (p flip = 0.02 (blue), 0.03 (orange), 0.04 (green), 0.05 (red)), we can study the effect of even more layers, where we see hints that the decay is doubly-exponential in n, or exponential in d ∼ 2 n .

2 = 1+Bp 2 = 1
at every vertex v and plaquette p of the subsystem, then, the input state ρ is topologically-ordered, in the sense that it is connected to an output state of the form ρ f = |ψ TC ⟩ ⟨ψ TC |⊗α anc by generalized local unitary (gLU) transformation of depth O(d).

Theorem 2 . 2 > 1 − ϵ, 1+Bp 2 > 1 Lemma 3 . 2 ϵ 4 .
Consider an arbitrary input state ρ and LED with correction distance d, as in Theorem 1. Suppose the corresponding subsystem of ρ f has stabilizer expectation values 1+Av − ϵ at every vertex v and plaquette p.Then, the input state ρ exhibits topological ordering at least up to a length-scale O(L − d); that is, no purification of ρ can be prepared using a local quantum circuit of depth less than O(L −d), where L ∼ 1/ √ ϵ.Our proof of Theorem 2 hinges on the following two Lemmas, proved in the supplement.Given an output state ρ f satisfying the conditions of Theorem 2, and a simply connected (L − 2) × (L − 2) square region R on the system part, the reduced density matrixρ d = Tr R c [ρ f ] is indistinguishable fromthe toric code reduced density matrix σ TC = Tr R c [|ψ TC ⟩ ⟨ψ TC |] defined on the same region, up to the bound ||ρ d − σ TC || ≤ max √ ϵ, 2L Lemma Consider an input state ρ and an LED procedure satisfying the conditions of Theorem 2. Then the final state ρ f after LED cannot be prepared using a local quantum circuit with depth less than O(L ) ∼ O(1/ √ ϵ).

= 2 , L = 4 d = 4 , L = 8 d = 8 , L = 16 FIG. 12 :
FIG. 12: Over-correction for small Wilson loops.(a) Small LED loops with d > L can give non-zero signal deep in the trivial phase, as in this regime, correction can pump anyons from the interior of the annulus to the exterior.(b) However, once d < L, the effects of over-correction become insignificant.LED Wilson loops are theoretically expected to certify topological order in the regime of d ≪ L.
FIG.13:(a)For a given point (g0, g1) on the phase diagram, the phase transition from topological to e-condensate is signaled by the transfer matrix gap ratio ∆12(g0, g1), while the transition from topological to m-condensate is signaled by ∆13(g1, g0), where both quantities are evaluated at the selfdual point with gz ↔ gx switched.When these two gaps are equal, the system must be at the critical point, due to the self-duality.We observe that the crossing point coincides exactly with the known critical point gc (vertical dotted line), for Ly = 4, 5, 6 (blue, purple, orange resp.).(b) Quatitatively, we extract the phase boundary using Ly = 4 by finding points where the difference |∆12(g0, g1) − ∆13(g1, g0)| ≤ 0.01 is close to zero.(c) Along the cut of the phase diagram with g0 small, the phase boundary computed from the difference has no visible finite size effects.(d) For larger g0 ≥ 0.1, small finite size effects start to appear.Shown are g0 = 0.1, 0.14, 0.18, 0.22, 0.26 from left to right.The phase boundary clearly shifts to larger g1 with increasing g0, but Ly = 4 (blue) appears to slightly overestimate the transition point compared to Ly = 6 (orange).

FIG. 14 :
FIG.14: Sample complexity.(a) Effect of LED on loops of fixed size L = 10.Snapshots are drawn from a toric code defined on a 25 × 25 square lattice with various bit-flip error rates.Sample complexity is computed as described in the main text.Note that sample complexities less than one imply that only a fraction of the system needs to be measured to certify topological order with 95% confidence.As such, the y-axis is also multiplied by the number of unit cells Nuc.(b) The histogram of expectation values averaged over a single snapshot confirms that these expectation values are approximately Gaussian distributed.The distribution for LED loops (purple) has much lower weight at zero than uncorrected loops (green), highlighting how fewer samples are needed to verify with high confidence that the closed loops are non-zero.(c,d) We also study the effect of coarsegraining on sample complexity, where the loop length L = 5 × 2 n grows exponentially with correction layer n.Here, snapshots are taken from a 1024 × 1024 square lattice.Initially, the sample complexity increases due to a reduction in the number of independent loops available at higher layers.However, it eventually reduces and approaches zero in the topological phase.(d) This turnaround occurs in the limit ξ ≪ d, where correction is able to remove almost all errors, and loop expectation values approach one.

FIG. 15 :
FIG. 15: Decoder choice can significantly affect the extent of the region certified as topological.Here we show LED Wilson loops using coarse-graining with block size b = 2 together with (a-c) a d = 1 pairing decoder and (d-f) a d = 3 patch decoder.Coherent perturbations are considered in panels (a,d), while incoherent errors are studied in (b,e).Panels (c,f) show LED expectation values for various combinations gX ,gZ after three layers of correction.Note that in the main text, analogous plots are made using the d = 2 patch decoder, whose classification boundaries roughly match the d = 3 decoder shown here.
in the main text), all A k (v) and B k (p) terms in the above Hamiltonian H commute with each other.Each A(v) and B(p) has d possible eigenvalues: 1, ω, ω 2 , ..., ω d−1 .The ground state(s) of H are then simultaneous +1 eigenstate(s) of all A(v) and B(p).Meanwhile, vertex and plaquette violations correspond to anyonic excitations: a plaquette where B(p) = ω a hosts an e a anyon, while a vertex where A(v) = ω b hosts an m b anyon.Thus, at any site (v, p), there are d 2 possible topological charges e a m b (a, b ∈ {0, 1, ..., d − 1}).
x 3 p 2 P W e u S k 8 8 c w B 8 4 n z 8 O h I / / < / l a t e x i t > ↵ j < l a t e x i t s h a 1 _ b a s e 6 4 = " f O s 6 l 8 T K M c E K O J + p w d 3 8 a u + I s K 9 g F N C J P J p B 0 7 e T B z I 5 S Q r R t / x Y 0 L R d z 6 B + 7 8 G 6 d p F 9 p 6 4 M L h n H u 5 9 x 4 / F V y B Z X 0 b C 4 t L y y u r l b X q + s b m 1 r a 5 s 9 t W S S Y p a 9 F E J L L r E 8 U E j 1 k L O A j W T S U j k S 9 Y x x 9 e j / 3 O A 5 O K J / E d j F L m R q Q f 8 5 B T A l r y T A x e z u 8 L f I m d U B K a O w E T Q E q t y A O P F 5 5 Z s + p W C T x P 7 C m p o S m a n v n l B A n N I h Y D F U S p n m 2 l 4O Z E A q e C F V U n U y w l d E j 6 r K d p T C K m 3 L z 8 p M C H W g l w m E h d M e B S / T 2 R k 0 i p U e T r z o j A Q M 1 6 Y / E / r 5 d B e O H m P E 4 z Y D G d L A o z g S H B 4 1 h w w C W j I E a a E C q 5 v h X T A d G J g A 6 v q k O w Z 1 + e J + 3 j u n 1 W P 7 0 9 q T W u p n F U 0 D 4 6 Q E f I R u e o g W 5 Q E 7 U Q R Y / oG b 2 i N + P J e D H e j Y 9 J 6 4 I x n d l D f 2 B 8 / g A 5 T 5 q 0 < / l a t e x i t > t ij = ij d i < l a t e x i t s h a 1 _ b a s e 6 4 = " E N h 6 R G i O g Z b 5 L G e 6 t H p + h v V U Z 4 0 = " > A A A B 7 3 i c b V D L S g N B E O y N r x h f U Y 9 e B o P g K e y K r 2 P Q i 8 c I 5 g H J E n o n s 8 m Q 2 d l 1 Z l Y I S 3 7 C i w d F v P o 7 3 v w b J 8 k e N L G g o a j q p r s r S A T X x n W / n c L K 6 t r 6 R n G z t L W 9 s 7 t X 3 j 9 o 6 j h V l D V o L G L V D l A z w S V r G G 4 E a y e K Y R Q I 1 g p G t 1 O / 9 c S U 5 r F 8 M O O E + R E O J A 8 5 R W O l d h d F M s Q e 7 5 U r b t W d g S w T L y c V y F H v l b + 6 / Z i m E Z O G C t S 6 4 7 m J 8 T N U h l P B J q V u q l m C d I Q D 1 r F U Y s S 0 n 8 3 u n Z A T q / R J G C t b 0 p C Z + n s i w 0 j r c R T Y z g j N U C 9 6 U / E / r 5 O a 8 N r P u E x S w y S d L w p T Q U x M p s + T P l e M G j G 2 B K n i 9 l Z C h 6 i Q G h t R y Y b g L b 6 8 T J p n V e + y e n F / X q n d 5 H E U 4 Q i O 4 R Q 8 u I I a 3 E E d G k B B w D O 8 w p v z 6 L w 4 7 8 7 H v L X g 5 D O H 8 A f O 5 w 8 N A I / + < / l a t e x i t > ↵ i .

Theorem 1 . 2 = 1+Bp 2 = 1
prove our claim, we consider a local unitary operator O supported on a local region A of diameter l.It follows that O can only flip a stabilizer from +1 to −1 if it overlaps with A, and O cannot couple any ground state |ψ⟩ to another ground state |ψ ′ ⟩ ̸ = |ψ⟩.We now show that LED removes all flipped stabilizers after 1 + log b d layers, where b is the coarse-graining length-scale.Because the coarse-graining step effectively reduces l → l/b, after log b d layers, there are three possibilities: (1) A becomes fully contained within a single b × b region at some layer c < log b d.Then, A has zero support after another layer of coarse-graining and disappears.(2) Before iteration log b d, O is supported on two adjacent b × b regions.Then, O becomes a single-qubit error after this iteration and is removed by the subsequent LED step.(3) Before iteration log b d, O is supported at the corner of three or four regions.In this case, it becomes a two-qubit diagonal error after this iteration, which can also be removed by the subsequent LED step.Notice that handling case (3) requires the inclusion of diagonal pairing in the pairing decoder.Finally, while this proof focuses on the pairing decoder, it also generalizes directly to more advanced local decoders, such as the patch-based decoder, when they are combined with coarse-graining.Proof of Theorem 1 Let |ψ⟩ be an arbitrary input state defined on a surface with trivial topology.Then, after performing LED with correction distance d, assume the resultant state |ψ d ⟩ has, as a subsystem, qubits living on the links of a square lattice, as in the toric code.Then, if the stabilizer expectation values 1+Av at every vertex v and plaquette p of the subsystem, then, the input state |ψ⟩ is topologically-ordered, in the sense that it is connected to an output state of the form |ψ d ⟩ = |ψ TC ⟩ ⊗ |ϕ anc ⟩ by generalized local unitary (gLU) transformation of depth O(d).

Proof of Lemmas 3 and 4 Lemma 3 .
Given an output state |ψ d ⟩ satisfying the conditions of Theorem 2, and a simply connected (L − 2) × (L − 2) square region R on the system part, the reduced density matrix ρ d = Tr R c [|ψ d ⟩ ⟨ψ d |] is indistinguishable from the toric code reduced density matrix σ TC = Tr R c [|ψ TC ⟩ ⟨ψ TC |] defined on the same region, up to the bound ||ρ d − σ TC || ≤ max √ ϵ, 2L 2 ϵ

2 + ⟨O⟩ 2 ≤ 1 .Lemma 4 .
As such, in the toric code where ⟨S⟩ = 1, this implies ⟨O⟩ = 0. Similarly, the condition Tr[ρ d S] ≥ 1 − 2ϵ leads to the upper bound Tr[ρ d O] ≤ 2 √ ϵ.Combining these two results, we see the trace distance is at most T (ρ d , σ TC ) ≤ max √ ϵ, 2L 2 ϵ .Consider an input state ρ and an LED procedure satisfying the conditions of Theorem 2. Then the final state |ψ d ⟩ after LED cannot be prepared using a local quantum circuit with depth less than O(L ) ∼ O(1/ √ ϵ).

FIG. 21 :
FIG. 21: Flow under LED of a representative, single open Zstring.This string operator remains close to zero in the large ∆/Ω regime, which is inconsistent with preparation of a VBS state.
If the system part of the final state, |ψ d ⟩ ∈ H sys ⊗H anc , and plaquette p, then |ψ d ⟩ must belong to the ground state space of the toric code.This is because the projector onto the ground state space is given by the product of all the stabilizers P TC = unique state |ψ TC ⟩, so the output state factors into |ψ d ⟩ = |ψ TC ⟩ ⊗ |ϕ anc ⟩.
These Pauli strings can be analyzed by considering two cases, closed strings and open strings.First consider operators C supported on R, which commute with all stabilizers A v , B p supported on a slightly larger L × L region (1-ball or R) , constructed by expanding on all sides by one unit cell.These operators must be products of contractible Wilson loops, and hence can be written as product of stabilizers.Therefore, Tr[σ TC C] = 1 for the toric code state.For the LED output state, we instead bound the expectation value of P TC = v (resp., p) runs over all vertices (plaquettes) within the L × L region.The expectation value of this projector, evaluated on the output state, is given by ⟨ψ d |P TC |ψ d ⟩.To lower bound this quantity, we first notice that every term in P TC has spectrum {0, 1}, and that the terms are mutually commuting.This allows us to approximate ⟨P TC ⟩ using the indi-To do so, we note that if two commuting operators A and B, each with spectrum {0, 1}, satisfy ⟨A⟩ > 1 − ϵ and ⟨B⟩ > 1 − ϵ, then ⟨AB⟩ > 1 − 2ϵ.To r.This result can be used to bound the distance between the two states,||Π R O |ψ⟩ − O |ψ⟩ || 2 ≤ ∆R/r,(30)by noticing the left side is equal to 1 − ⟨ψ| OΠ R O |ψ⟩.We will use this below, to show that we can replace O |ψ⟩ with Π R O |ψ⟩ without incurring significant error.
1/ √ ϵ) and still certify long-range order.In particular, the state |ψ d ⟩ cannot be generated by a finite depth circuit of depth smaller than r ∼ O(L ).Since |ψ d ⟩ is connected to the input state by a depth-d quantum circuit, this implies LED Wilson loops close to one certify topological order up to length-scales O(L − d).
FIG.20:(a) Calculating entanglement negativity in the toric code state reduces to computing a "strange correlator" in a state that lives on the boundary, where qubits in the state encode stabilizer expectation values.Stabilizers which do not span the boundary do not commute.Hence, they are forced to be +1 and do not contribute to the strange correlators.In contrast, vertex and plaquette stabilizers, whose intersections span the boundary pick up −1 signs under partial transpose.This acts like a CZ gate on the boundary state, essentially preparing a cluster state (see text).The long-range SPT order of the cluster state leads to a topological correction to the entanglement negativity.(b) A local (Clifford) unitary circuit coarse-grains each of the stabilizers in the Heisenberg picture.As a result, a much larger number of stabilizers participate in the boundary state.However, we show the long-range SPT order survives, by looking at products of stabilizers.In particular, a product of a large block of stabilizers is supported only on the boundary.After the unitary circuit, this boundary gets coarsened, but for large enough blocks the intersection structure survives.This ensures the operators pick up −1 signs under partial transpose as well.