Non-Pauli errors can be efficiently sampled in qudit surface codes

Surface codes are the most promising candidates for fault-tolerant quantum computation. Single qudit errors are typically modelled as Pauli operators, to which general errors are converted via randomizing methods. In this Letter, we quantify remaining correlations after syndrome measurement for a qudit 2D surface code subject to non-Pauli errors. Using belief propagation and percolation theory, we relate correlations to loops on the lattice. Below the error correction threshold, remaining correlations are sparse and locally constrained. Syndromes for qudit surface codes are therefore efficiently samplable for non-Pauli errors, independent of the exact forms of the error and decoder.

Surface codes are the most promising candidates for fault-tolerant quantum computation.Single qudit errors are typically modelled as Pauli operators, to which general errors are converted via randomizing methods.In this Letter, we quantify remaining correlations after syndrome measurement for a qudit 2D surface code subject to non-Pauli errors.Using belief propagation and percolation theory, we relate correlations to loops on the lattice.Below the error correction threshold, remaining correlations are sparse and locally constrained.Syndromes for qudit surface codes are therefore efficiently samplable for non-Pauli errors, independent of the exact forms of the error and decoder.
Most studies of stabilizer error correction codes focus on incoherent Pauli errors [48], considering their classical simulability [49] and justified by the discretization of errors by stabilizer measurements [1,4,50].However, increasing technological precision has motivated the study of more realistic error models in qubit codes [48,[51][52][53][54][55][56][57][58][59][60][61].Broader classes of channels that can be classically efficiently simulated have been investigated [62][63][64], and the Pauli Twirling Approximation (PTA) turns out to be a practical approach to mapping the non-Pauli error channel to the code-compatible Pauli model [65][66][67][68][69][70][71][72][73].Despite the effort in qubit codes, general error models for qudit codes have received less attention [74], and the implementation of qudit Pauli twirling [75,76] requires a larger set of twirling gates as the dimension d of the qudit increases, making it operationally difficult.Moreover, it has been shown that in both transmon qutrit [34,35,40] and trapped ion qudit [77,78] systems the naturally occurring errors are not the cyclic shifts described by the most common generalization of the Pauli matrices.These considerations call into question the benefit of explicitly applying the Pauli twirling gates, and lead us to ask, to what extent can non-Pauli error models be investigated, such that their intrinsic correlations may be leveraged to improve the codes?
In this Letter, we study the qudit 2D square lattice sur-face code, where each physical qudit has the same probability of having experienced an error described by a general unitary operator.By sampling the syndromes and classifying the error subgraphs [79][80][81], inspired by the notion of belief propagation in computer science [82,83], we connect the problem of the remaining correlations removed in the PTA with the distribution of loop sizes in Bernoulli percolation theory [84].We find that for a physical error rate below the qudit error correction threshold, with an upper limit estimated at 30% [43], the partially discretized coherent errors are sparse and mostly involve only four neighboring qudits, while the largest spatial span of their correlation is local, growing only logarithmically with the code distance.As the computational complexity depends exponentially on the span of these correlations, the strong localization observed implies that explicitly keeping track of correlations remains numerically efficient.Our findings, independent of dimension and the specific forms of the non-Pauli errors, justify the possibility of efficiently exploring qudit code performances beyond Pauli error models.Surface code error discretization -Consider the twodimensional surface code with d-dimensional qudits on a square lattice [45], with size characterized by the two parameters n h and n v .An example is shown in Fig. 1.On the primal lattice, the vertical (horizontal) boundaries are smooth (rough).For later convenience when dealing with deformed stabilizers at the boundaries and logical operators, we contract all the nodes on rough boundaries into a single dummy-node.The d-dimensional Pauli operators are X = We assume a quantum channel L s for each qudit, Each qudit experiences a general unitary error F with probability p.This operator can be decomposed into a linear sum of Pauli operators, as { Xi Ẑj } forms the complete Heisenberg-Weyl basis [85].An example error pattern is shown in Fig. 1, where the erroneous qudit edges are marked in red and labelled a → h.These edges induce the error subgraph.
For each error pattern, syndrome measurements project the erroneous state into a subspace compatible with a specific syndrome [4].As the syndrome subspace is constructed via Pauli operators acting on the code space, we expand the product of the non-Pauli F errors into a sum of multi-qudit Pauli operators.Importantly, if two multi-qudit Pauli operators bring the logical state into the same syndrome subspace, the probability of being projected into this subspace will depend on interference between the complex amplitudes f i,j .This effect, absent under the PTA, increases the computational complexity of numerically sampling the syndrome.Intuitively, this effect appears if the error pattern can lead to the formation of a stabilizer or a logical operator.On the contracted lattice (e.g.Fig. 1), this corresponds to the formation of loops, which we discuss below.
We first argue that for each error pattern, if the error subgraphs on both the contracted primal and dual lattices are forests, the syndrome measurements fully discretize the errors in the Pauli basis.A forest is a graph that contains no loops, and each connected component in a forest is a tree [79,80].Our argument is based on observation of the single-error case, followed by induction using the generalized Bayes' rule for belief propagation in a tree graph [82,83].Consider the primal lattice in Fig. 1.The error subgraph contains three trees: {a}, {b, c, d, e} and {f, g, h}.For each tree, we begin with stabilizer measurements at leaf nodes such as the node (0, 2).Measurement discretizes the error operator for the qudit on the adjacent edge (qudit c).We then continue with sequential measurements along the branches towards the root node (2,2).The tree structure guarantees that measurements centered at leaf nodes are independent of each other, and that at most one adjacent edge corresponds to an error that has not yet been fully discretized by previous measurements [82].Where trees contain the contracted node (such as the tree {f, g, h}), this node is always the root and there is no associated measurement.
Complete discretization of errors in the Pauli basis suggests that the error channel can be replaced by the Pauli twirled channel, whose effect is to keep only the diagonal terms in F ρ F † .Importantly, this equivalence only relies on the relative positions of the erroneous qudits, and is independent of the qudit dimension d and the specific values of f i,j in F .It is straightforward to generalize this equivalence to an arbitrary mixture of single-qudit errors applying some F (k) with probability p k , and even allowing different errors for each qudit.From an operational perspective, this equivalence implies that for forest error subgraphs the computational complexity is the same as that of the PTA channel Eq. ( 2).The error subgraph may contain loops.While edges that do not form part of a loop can be fully discretized following the above argument, errors on loop-edges can only be partially discretized in the Pauli basis (see the Supplemental Material [86] for an explicit example).Consider a loop, for example, consisting of qudits L 1 → L 4 marked in pink dashed lines in Fig. 1.The error FL1 FL2 FL3 FL4 can be expanded as a sum over products of Pauli operators, which contains the stabilizer operator Ŝp = ẐL1 Ẑ−1

L2
Ẑ−1 L3 ẐL4 and all of its powers Ŝk Products of Pauli errors that differ only by a power of Ŝp correspond to the same syndrome: The probability of projection into the compatible subspace differs from the PTA due to the interference of complex amplitudes f i,j on the loop.For each connected component in the error subgraph, the numerical cost is expected to increase with d l , where l is the tree-width of the component [87][88][89].We can therefore study the increase in sampling complexity by quantifying the number and size of loops in the error subgraph, independent of the specific form of the error F .Once the syndrome is sampled, Pauli operators compatible with the syndrome are applied to recover the logical state and decoders developed for Pauli error models can be applied.Relation to percolation theory -The 2D surface code modelled above can be directly mapped into the problem of Bernoulli percolation [90] on the square lattice, which is a bond percolation model [91] where each edge is retained only with probability p, independent of other edges.Bernoulli percolation has been extensively studied, and size distributions for clusters (connected components of the error subgraph) have been investigated both above and below the critical probability p c = 0.5 [84,92].
In the sub-critical regime, for instance, the mean size of the largest connected cluster has been found to scale logarithmically with the total number of edges.However, to the best of our knowledge only at the percolation threshold [93][94][95][96][97] has the distribution of loops been studied [81,94].We are interested in this distribution below the error correction threshold [43], which is in the sub-critical percolation regime.We use two measures to infer the loop size distribution.The first is the proportion of error subgraph edges that are loop-edges, which quantifies how likely loops are to form (scaling with p also providing information on the mean size).The second measure is the maximal one-dimensional span of a loop.This quantifies the size of the largest loop, in contrast to the mean, that can form in the sub-critical lattice.
Proportion of loop-edges -We first consider the ratio between the number of qudits associated with loop-edges on the error subgraphs and the total number of erroneous qudits, denoted p loop−edge .We use Monte-Carlo simulations, finding a cycle-basis in the error subgraph [98,99] for each sampled error pattern on the primal lattice.This process is repeated for the dual lattice, removing redundancies where a qudit is involved in loops on both lattices and taking the sample average.We can obtain an approximate analytical formula for p loop−edge .Below the percolation threshold, the dominant contributions come from the smallest loops, which include the three-edge loops on the rough boundaries and the four-edge loops inside the bulk of each lattice.The primal [or dual] lattice has 2(n v − 1) [or 2(n h − 1)] threeedge loops, each appearing with probability roughly p 3 , and ] four-edge loops, each appearing with probability roughly p 4 .We therefore get The first part of Eq. ( 3) describes the dependence of p loop−edge on the size and shape of the surface code, which matters more for smaller lattices.The second part only depends on p, capturing the asymptotic behavior for larger lattices.In Fig. 2, we show the value of p loop−edge as a function of n h , for the most symmetric shapes, The analytical expression Eq. ( 3) fits well with the numerical simulation result for p ≤ 0.2, but for larger p the analytical formula underestimates p loop−edge .This implies that the contribution from larger loops becomes non-negligible as p increases.We consider a correction term in place of the 4p 3 term in Eq. ( 3).As plotted in Fig. 3, for the four pairs of (n h , n v ) in the asymptotic regime, the linear functions of log(p loop−edge ) versus log(p) are very similar.This verifies the approximate shape-independence of p loop−edge , and indicates that we may take the simulation result of the surface code with the maximum number of physical qudits, which is panel (c) in Fig. 3, to define the correction as 4.745p 3.057 that replaces 4p 3 in Eq. ( 3).The exponent 3.057 implies that for p > 0.2, though the average loop size is slightly larger than 4, most of the correlations remain tightly constrained to the smallest local loops.
We have also numerically verified that the difference between the analytical and numerical results of p loop−edge can be compensated if instead of the linear fitting, we add a term 6p 5 to the analytical expression Eq. ( 3).This implies that in addition to the dominant four-edged loops, a non-negligible number of six-edged loops appear in the error subgraph.Connected components with loops of at most four and six edges both have tree width l = 2.
Based on this modified expression for p loop−edge , we can deduce that they appear approximately 2n h n v p 4 and 2n h n v p 6 times respectively for each error pattern.As a result, the increased time complexity due to residual correlations is expected to be O(2n h n v (p 4 + p 6 )d 2 ).This is polynomial in both the code distance and the qudit dimension with power 2, indicating that numerical sampling remains efficient for lattices of the sizes considered, with n h into the thousands.
In the Supplemental Material [86], we demonstrate the dependence of p loop−edge on the aspect ratio n h /n v .We also describe a further binary criterion based on the simple presence or absence of loops, which is especially useful for bounding the accuracy of logical error rate estimates for small lattices.Maximal one-dimensional span of a loop -The proportion of loop-edges considered above describes the average behavior.Taking a different perspective, we next estimate the maximal loop size, putting an upper bound on the span of the correlations.Specifically, for each loop we take the one-dimensional span, this being the maximal length of its smallest bounding rectangle.For example, for the four-edged elementary loop considered above, the span is 1.Taking the maximum span over all loops on both the primal and the dual lattices results in our target value, L max,loop .
In Fig. 4, we show the numerical result of how L max,loop behaves as a function of n h for symmetric lattices, on linear and logarithmic scales.As n h increases, L max,loop also increases but at a much slower rate.The straight lines, especially for larger values of p, indicate that the maximal one-dimensional span of a loop grows logarithmically with the lattice size.This scaling is similar to the finding in percolation theory that below the percolation threshold, the maximal cluster size increases logarithmically [84], though the full cluster also includes non-loop edges.Our finding focusing on loops only thus supplements the scaling behaviors in percolation theory.
As L max,loop + 1 bounds the maximal tree width of a cluster, its logarithmic scaling with respect to n h indicates that the sampling complexity scales at most polynomially in the lattice size.As shown in Fig. 4, up to n h = 2 × 10 3 and p = 0.3, this complexity is on the order of d 9 .While the exponent increases very slowly with n h , we do observe a rapid increase with p.It was shown in Ref. [43] that p = 0.3 corresponds to the accuracy threshold in the limit d → ∞, while for more practical values of d the threshold will be closer to p = 0.2.Therefore, for numerical investigations of qudit surface code thresholds we expect an upper bound on the sampling complexity closer to d 5 .
In the Supplemental Material [86] we use another measure for the maximum loop size, the total number of nodes in a loop, with similar behavior to Fig. 4(a).We also show that due to the slow increase of L max,loop with n h , lattice asymmetry has little effect.Conclusion -In this Letter, identifying that residual multi-qudit correlations in topological codes are restricted to cell boundaries (or loops, in 2D) of the error subgraph, we assess the computational complexity of syndrome sampling in qudit surface codes under stochastic single-qudit unitary error models from the perspectives of belief-propagation (or tensor-network contraction) and percolation theory.Our analysis is independent of the qudit dimension and the specific form of the errors.
Considering a single-qudit physical error rate p up to 30% (the highest threshold predicted in qudit surface codes [43]), we quantify the average and maximal error loop sizes.We find that the former, which as a mean value is related to the run time of the code simulation, is well modelled accounting only for four-edged loops plus a small correction from six-edged loops on the order of p 2 , both of which have tree-width 2. The latter, which as an upper bound is related to the maximal memory required, grows only logarithmically with the code size n h , dropping rapidly as p decreases, and up to n h = 2000 and p = 0.3 gives an upper bound of 9 for the tree-width.
The efficient scaling observed in our results indicates that syndrome sampling complexity does not prevent the inclusion of non-Pauli errors; the complexity of the decoding step is expected to remain the limiting factor.An investigation of qudit surface codes under general stochastic unitary errors is therefore within reach.Intrinsic correlations may be leveraged to improve the codes, especially for d > 2 qudit systems that have a richer structure than the biased error models of qubit systems.
By taking into account other percolation structures, our method may also be generalized beyond a singlequdit error model, and even to multi-qudit coherent errors [53], where the discretization of errors by stabilizer measurements appears also as a central step.1.An example of a 2D surface code with n h = 4 and nv = 5, after contracting the nodes on the rough boundaries to one node.Both the primal lattice and the dual lattice are shown.On the primal lattice, the horizontal size n h refers to the number of edges in each row, while the vertical size nv refers to the number of nodes in each column.Qudits that have been subject to the error F are marked in red and labelled by blue letters.
As shown in Fig. 1, we consider the error pattern where the edges that correspond to the qudits with error F are colored red and labelled a to h.On the primal lattice, the error subgraph consists of three disconnected components, none of which containing loops.The initial state is Fa Fb Fc Fd Fe Ff Fg Fh |ψ , where subscripts a to h label the qudits, and the state |ψ is in the code space.We start from the isolated qudit with error, qudit a.We measure the vertex operator centered at node (1, 1), obtaining a measurement result x a , which can take a value 0, 1, • • • or d − 1, and correspondingly project the state to Xi a Ẑxa a Fb Fc Fd Fe Ff Fg Fh |ψ .Note that the Pauli-Z operator for qudit a now only has exponential x a .We then measure the vertex operator centered at node (2, 1) to get the measurement result −x a and no change in the state.This additional stabilizer measurement with definite result and without changing the state indicates that the measurements are well-defined at the rough boundaries, which will be shown later.Next we focus on the tree of qudits with errors, labelled as b, c, d, e.The general procedure is to start measuring the vertex operator centered at one end node, and proceed along the chain until for the next vertex measurement there are more than one edge that have not been projected yet.We stop there and start from another end node.Finally we can resume the measurement of vertices that were left before as more projections of edges have been implemented.The order of vertex operator measurements is: (0, 2) Ff Fg Fh |ψ after the final measurement.To deal with the boundary qudits f, g and h which are only covered by one vertex measurement each, we can invert the contraction process such that they are described by ((0, 3), (0, 4)), ((1, 3), (1,4)), ((4, 3), (4, 4)), respectively.Measuring the vertex operators (0, 3), (1, 3) and (4, 3) correspondingly discretize the qudits f, g and h, and the state is projected to |ψ , where all the Z errors are fully discretized.Similarly, measurements of the plaquette operators discretize X errors.As the error subgraph on the dual lattice in Fig. 1 also does not contain loops, the X errors are fully discretized as well.We have therefore demonstrated the complete error discretization by syndrome measurements for a forest error subgraph, where P (••• ) is the projector corresponding to a specific set of syndromes.
For each forest error subgraph, different Pauli errors correspond to distinct syndrome measurement outcomes.Upon relabelling the superscripts we can arrive at the equivalence with the Pauli twirled error channel, as for a forest error subgraph and Γ a,b,••• represents any compatible syndrome measurement outcome.The equivalence shown above does not hold if the error subgraph contains loops.As an example, we consider an error subgraph on the primal lattice formed by the nodes (3, 1), (3, 2), (2, 2) and (2, 1).We label the corresponding qudits with error as A : ((3, 1), (3, 2)), B : ((3, 2), (2, 2)), C : ((2, 2), (2, 1)) and D : ((2, 1), (3,1)).Suppose the Pauli-X errors have been completely discretized by the measurements of plaquette operators and the state is The vertex operators are measured in the order of (3, 1) → (3, 2) → (2, 2) → (2, 1), and the outcomes are The remaining sum of the products of f ij coefficients is due to the fact that there is one less stabilizer measurement for a loop compared with a tree subgraph.It can also be explained as coming from the superposition of equivalent paths that are different by the application of a stabilizer operator, therefore corresponding to the same syndrome.It indicates that due to the correlations this situation cannot be represented by the Pauli-twirled channel Eq. ( 2).We have contracted all the nodes on the rough boundaries node, as illustrated in 1, cover the situations of logical operators and boundary stabilizers as loops.For instance, on the primal lattice, the loop made of nodes (4, 0), (1,1), (1,2), (1, 3) is a logical operator, and the loop made of nodes (4, 0), (0, 1), (1, 1) corresponds to a deformed stabilizer generator.

II. PROBABILITY OF NOT EQUIVALENT TO THE PAULI-TWIRLED CHANNEL
We can estimate the probability of having error patterns that do not contain loops in both the primal lattice and the dual lattice.To achieve this, we assume each qudit is subject to the original error channel L s [see main text Eq. ( 1)] and sample the error patterns via the Monte-Carlo simulation.The probability that the result is not equivalent to the Pauli-twirled channel is estimated by the number of sampled error patterns that contains loops divided by the total number of samples.
We can also derive an approximate analytical expression to estimate the probability of having loops.As discussed in the main text, by taking into account only the smallest loops (three-edge on the rough boundaries and four-edge in the bulk), we have In Fig. 2, we illustrate p not−Pauli−twirled as a function of the lattice size n h + n v , for almost symmetric lattice shapes n h = n v ± 1.The analytical formula Eq. ( 4) fits well with the numerical results.For a fixed physical error rate p, a larger lattice corresponds to a larger probability of deviation from the Pauli-twirled error channel.This is because a larger number of qudits also indicate a larger number of error edges, therefore forming a loop in one of the error subgraphs is more likely.Similarly, increasing the single qudit error rate results in a larger probability of the error channel not being exactly equivalent to the Pauli-twirled version.As shown in Fig. 2, for a single-qudit error rate p = 0.04, up to n h ≈ n v ≈ 70, the probability of not being equivalent to the Pauli-twirled error model is bounded by p not−Pauli−twirled ≤ 0.04.For a larger single qudit error rate p = 0.05, if we require p not−Pauli−twirled ≤ 0.05, the lattice size has to satisfy n h + n v < 100.
In Fig. 3, we demonstrate how the aspect ratio of the surface code, defined as the ratio between the horizontal size n h and the vertical size n v , changes the probability p not−Pauli−twirled .For fixed p and n h + n v , a more symmetric lattice corresponds to a larger probability of not being exactly equivalent to the Pauli-twirled error model.This is because the total number of physical qudits in the surface code is 2n a larger product of n h n v .This means more errors for a fixed physical error rate p, therefore the error edges are more likely to form a loop.As seen in the red data points in Fig. 3 (b), for the most asymmetric lattices considered, namely, (n h , n v ) = (16,97), (23,90), (94,19), (99,14), p not−Pauli−twirled < 0.05 is satisfied, even though for more symmetric lattices p not−Pauli−twirled > 0.05.In Fig. 4, we show how the probability p not−Pauli−twirled depends on the single qudit physical error rate p.For each pair of (n h , n v ), which corresponds to a certain value of n h + n v and n h /n v , p not−Pauli−twirled increases with p.This can be expected from the analytical expression Eq. ( 4), which implies that the dependence contains both p 3 scaling coming from the boundaries and p 4 scaling coming from the inside of the lattices.In fact, for the cases where p not−Pauli−twirled is much smaller than the saturation value 1, the size of the lattice is relatively small such that the boundary contributions are comparable to the non-boundary contributions, or even dominate over the latter ones.In Fig. 4 (b), the more symmetric lattices result in larger p not−Pauli−twirled , as discussed before, but in Fig. 4 (a), the most asymmetric lattices turn out to lead to larger values of p not−Pauli−twirled .This might be a result of the small size of the lattice, such that logical errors occur at a comparable probability to stabilizers.The value of p not−Pauli−twirled is useful in setting the upper bound of the logical error rate.To be specific, suppose we have taken N samples, of which (1 − p not−Pauli−twirled )N samples have forest error subgraphs and p not−Pauli−twirled N samples have non-forest error subgraphs.Suppose the logical error rate for forest graphs, p l , can be straightforwardly simulated.Then the largest possible number of samples that cannot be error-corrected is (1 − p not−Pauli−twirled )p l N + p not−Pauli−twirled N , where we have assumed that all the samples with non-forest error subgraphs cannot be error-corrected.The logical error rate without the Pauli twirling approximation is thus upper bounded by p l − p not−Pauli−twirled p l + p not−Pauli−twirled .

III. DEPENDENCE OF THE PROPORTION OF ERRONEOUS QUDITS THAT ARE IN LOOPS ON THE LATTICE ASYMMETRY
In the main text, we have shown how p loop−edge changes with n h for the symmetric lattices (see main text Fig. 2).Here we demonstrate the dependence of p loop−edge on the aspect ratio n h /n v .This is important for small lattices where the contributions from the boundaries are comparable to the contributions from the bulk.Examples are plotted in Fig. 5.For a small p = 0.1, the analytical formula in Eq. (3) in the main text agrees well with the numerical simulations.For a larger p = 0.25, including the correction as shown in Fig. 3 in the main text leads to a better fit to the simulation data.As the product n h n v is in the denominator in Eq. (3) in the main text, a more symmetric lattice results in a smaller value of p loop−edge .

IV. MAXIMAL ONE-DIMENSIONAL SPAN OF A LOOP FOR ASYMMETRIC LATTICES
In the main text Fig. 4, we have demonstrated how the maximal one-dimensional span of a loop for a symmetric lattice increases with the lattice size.Here we show how it depends on the asymmetry of the lattice in Fig. 6.For the considered large values of n h + n v , we find that increasing p leads to a larger L max,loop , and increasing n h + n v leads to a larger L max,loop as well, but L max,loop is relatively insensitive to the value of log(n h /n v ) if both p and n h + n v are fixed.This is due to the slow logarithmic growth of L max,loop with respect to the lattice size as illustrated in the main text Fig. 4, effectively suppressing the difference in n h n v for fixed n h + n v and changing n h /n v .Similar to the one-dimensional span of a loop in the main text, we can define another quantity to describe the size of a loop, namely, the total number of nodes in a loop, N max,loop .The results for symmetric lattices are shown in Fig. 7.The slow increase of N max,loop as a function of n h follows the same trend as in Fig. 4(a) in the main text.This is because for symmetric lattices the loops are expected to be symmetric in the horizontal and vertical directions, resulting in a fixed relation between N max,loop and L max,loop .

d− 1 j=0 |j ⊕ 1
j| and Ẑ = d−1 j=0 ω j |j j|, where ⊕ is the sum modulo d and ω = exp(i2π/d).They satisfy the commutation relation Xj Ẑk = ω −jk Ẑk Xj .Stabilizer generators are vertex operators in the Pauli-X basis and plaquette operators in the Pauli-Z basis, though for our purposes the Z-basis stabilisers are better viewed as vertex operators on the dual lattice.

FIG. 1 .
FIG.1.An example 2D surface code with n h = 4 and nv = 5.On the primal lattice, the horizontal (vertical) size n h (nv) refers to the number of edges (nodes) in each row (column).Qudits subject to the error F are marked in thick red lines and labelled by blue letters.An example of a vertex [plaquette] operator is shown on the primal [dual] lattice centered at the node (3,2) [(3,2)], where relevant qudits on the edges are marked by green dashed lines and the Pauli operators are labelled in green.An example loop is shown in pink dotted lines, with the qudits labelled as L1 → L4.

FIG. 2 .
FIG. 2. The proportion of erroneous qudits in loops as a function of the lattice size n h , for near-symmetric lattices n h = nv ± 1. Colors correspond to different single qudit physical error rates.Solid lines follow the analytical expression Eq. (3).Markers are from the Monte-Carlo simulations, and error bars represent the standard deviation.The left (right) half of the figure shows the behavior for smaller (larger) values of n h , for a Monte-Carlo sample size of 2000 (200).

FIG. 3 .
FIG. 3. Linear fitting of y = log(p loop−edge ) as a function of x = log(p) for four different lattice sizes.Blue markers are for the numerical data from the Monte-Carlo simulations, while orange lines are the results of the fitting (expressions shown).

FIG. 4 .
FIG. 4. The maximal one-dimensional span of a loop as a function of the lattice size n h for almost symmetric lattices n h = nv ± 1. Points are obtained via Monte-Carlo simulation with 2000 samples, and error bars represent the standard deviation.Colors correspond to different single qudit physical error rates.(a) Linear scale.(b) Logarithmic scale.
FIG.1.An example of a 2D surface code with n h = 4 and nv = 5, after contracting the nodes on the rough boundaries to one node.Both the primal lattice and the dual lattice are shown.On the primal lattice, the horizontal size n h refers to the number of edges in each row, while the vertical size nv refers to the number of nodes in each column.Qudits that have been subject to the error F are marked in red and labelled by blue letters.
2).The measurement results are denoted as x c , x b , x d , x e , and −x c − x b − x e − x d , respectively, where x b , x c , x d , x e can take a value from 0, 1, • • • , d − 1.The state is projected to

FIG. 2 .
FIG. 2. The probability of not equivalent to the Pauli-twirled error model as a function of the lattice size characterized by n h + nv, for almost symmetric lattices n h = nv ± 1. Different colors correspond to different single qudit physical error rates.Solid lines follow the analytical expression Eq. (4).Markers are from the Monte-Carlo simulations, where for each data point 10000 samples are taken.Error bars represent the standard deviation.

FIG. 3 .
FIG.3.The probability of not being equivalent to the Pauli-twirled error model as a function of the aspect ratio of the lattice, fixing n h + nv = 41 (blue) or n h + nv = 113 (red).We fix the single qudit physical error rate as (a) p = 0.03, (b) p = 0.05.Solid lines follow the analytical expression Eq. (4).Markers are from the Monte-Carlo simulations, and error bars represent the standard deviation.

FIG. 4 .
FIG. 4. Monte-Carlo simulation results of the probability of not being equivalent to the Pauli-twirled error model as a function of the single qudit physical error rate.We fix the aspect ratios of the lattice to different values, each one corresponding to a different color.We consider two fixed values of the perimeter of the lattice, (a) n h + nv = 23, (b) n h + nv = 137.Error bars are small, thus not shown for clarity.

FIG. 6 .FIG. 7 .
FIG.6.The maximal one-dimensional span of a loop as a function of the lattice aspect ratio n h /nv, fixing the single qudit physical error rate p and the perimeter n h + nv.Data points are from Monte-Carlo simulations, where each data point consists of 200 samples for the asymmetric cases and 2000 samples for the symmetric cases.Error bars represent the standard deviation.