Analysing correlated noise on the surface code using adaptive decoding algorithms

Laboratory hardware is rapidly progressing towards a state where quantum error-correcting codes can be realised. As such, we must learn how to deal with the complex nature of the noise that may occur in real physical systems. Single qubit Pauli errors are commonly used to study the behaviour of error-correcting codes, but in general we might expect the environment to introduce correlated errors to a system. Given some knowledge of structures that errors commonly take, it may be possible to adapt the error-correction procedure to compensate for this noise, but performing full state tomography on a physical system to analyse this structure quickly becomes impossible as the size increases beyond a few qubits. Here we develop and test new methods to analyse blue a particular class of spatially correlated errors by making use of parametrised families of decoding algorithms. We demonstrate our method numerically using a diffusive noise model. We show that information can be learnt about the parameters of the noise model, and additionally that the logical error rates can be improved. We conclude by discussing how our method could be utilised in a practical setting blue and propose extensions of our work to study more general error models.


Introduction
The success of scalable quantum computation depends on our ability to diagnose and repair errors incident to the underlying physical qubits [1,2,3,4,5,6,7] of the system. To this end quantum error-correcting codes [8,9,10,11,12,13,14] have been developed to allow us to correct for a finite density of physical errors that might otherwise irreversibly disturb a quantum computation. Of particular interest are topological codes [10,11], which are experimentally viable due to their local structure and low-weight syndrome measurement operations [15,16].
Quantum error-correcting codes are commonly studied with a simple error model where it is assumed that each physical qubit is subject to some rate of local noise that is independent of the state of other nearby qubits and its local environment. Identifying thresholds [11] and finding the resource overheads [17,18,19] of different codes using simple error models can provide a proof of principle that a code can withstand local noise, and offers a standardised benchmark to uniformly compare different error-correcting codes with one another [20,21]. However, when we consider some realisation of a quantum error-correcting code, where we take into account physical features of its underlying hardware [22,23,24], an independent noise model is unlikely to be realistic. Instead, we might anticipate that correlated errors [25,26,27,28,29,30,31] could occur, where the probability of a qubit suffering an error depends on its neighbouring qubits having also suffered errors.
Correlated noise has been identified in a number of physical systems that might serve to realise quantum error-correcting codes. For example, external fields and proximity effects in solid state systems [30,32] introduce correlated errors, as do quantum codes that are coupled to a boson environment [33,34,35,36,37,13,31,38]. Correlated errors have also been identified when non-Markovian effects are modelled [26,39]. It has also been seen that correlated errors can be introduced by certain schemes of quantum errorcorrection. This has been observed, for instance, in Ref. [19]. Correlated errors also occur when considering syndrome measurements under the circuit-based noise model [40,41,42,43,44], and while applying transversal logical gates to quantum error-correcting codes that are not in their code space [45]. See also recent work. [46].
The aim of this Manuscript is to develop numerical methods to characterise correlated error models. Specifically, we develop families of decoding algorithms, each member of which is designed to correct for a particular correlated error model. We show that we can use a decoder family, which we will refer to as an adaptive decoder, to analyse a source of noise with some unknown parameter by comparing the logical error rates of different members of a decoder family. We perform simulations to demonstrate our methods explicitly by adapting Edmonds' minimumweight perfect matching algorithm [47,48] to identify string-like correlated errors introduced to the toric code [10]. Gaining information on the structure of correlations in noise can be used as a diagnostic tool to minimize the effect of correlations at the hardware level. It may also be used to improve classical post-processing. We show that we can use our adaptive scheme to find a decoder with an improved threshold to deal with the physical error model.
There are a number of methods and results in the literature that look to determine correlations that may emerge in fault-tolerant quantum hardware. In Ref. [49] Combes et al. showed that syndrome data can be used to discriminate between different correlated noise processes acting on small quantum codes including the classical repetition code and the five-qubit code [50]. Our results build on this work by examining different codes and we give numerical evidence that these ideas are applicable to degenerate codes [51]. Moreover, the use of efficient decoding algorithms that we propose make our diagnostic techniques scalable to systems of large size. We point out that recently, during the preparation of the present manuscript Ref. [52] showed that it is possible to monitor time-dependent parameters of uncorrelated noise models to improve threshold error rates using methods similar to ours.
Other methods have also been found to determine correlated errors that occur during the error correction process. In Ref. [42] the authors simulate a circuit-level error model to directly calculate the likelihood that correlated errors occur while syndrome data is measured. The information obtained with this procedure is used to improve decoding schemes. Further, in Ref. [53], drifts in experimental parameters of a small repetition code are identified and corrected by measuring changes in the rate at which errordetection events occur. See also Ref. [54] that recently became available. These works make use of local syndrome data to determine different parameters in the error model. In contrast, we make use of a decoding algorithm that uses global syndrome data to distinguish more generic correlated error models where error events may correlate over a large number of adjacent qubits.
We also remark on previous work to specialise decoders to account for known correlated errors. It has been shown [55,56,57,58,59,60,61,62,63] that we can obtain improved thresholds by using a decoder that specifically accounts for known correlations that occur under depolarising noise. Hutter and Loss have also identified that specialised decoders can be used to correct for known correlated errors introduced by a thermal environment [29]. The present work extends these ideas by demonstrating that we can use learned knowledge to calibrate a decoder to give improved thresholds without complete knowledge of the error model a priori.
The remainder of the Manuscript is structured as follows. In Section 2 we introduce the toric code and develop decoding algorithms for general correlated errors. In Section 3 we show that the generalised decoders we present can be used to find signatures that distinguish correlated errors. Section 4 shows that we can use error model data to obtain improved decoding schemes. In Sec. 5 we give a discussion on how we might apply our scheme to the practical development of fault-tolerant quantum hardware. We conclude in Section 6 by discussing potential directions to develop our methods in order to diagnose more general forms of correlated error.

The toric code and error models
We study correlated errors acting on the wellstudied toric code model. In this Section we briefly review the toric code, and introduce the notation we use to describe correlated error events. We go on to describe the minimum-weight perfect-matching (MPWM) algorithm that we will use to analyse correlated errors.

The toric code
The toric code [10] is a quantum error-correcting code of n = 2L 2 qubits, arranged on the edges on a square lattice of L × L vertices with periodic boundary conditions, as shown in Fig. 1. The code space of the toric code is described by its stabilizer group, S [64]. The stabilizer group is an Abelian subgroup of the Pauli group, P, where the code states of the toric code, |ψ j , are the common +1 eigenspace of all elements S k ∈ S S k |ψ j = (+1)|ψ j , ∀j, k. (1) Elements of the stabilizer group are commonly known as stabilizers.
The stabilizer group of the toric code consists of two types of stabilizers, star operators, A v , and plaquette operators, B f , defined as follows where j is an index over the qubits and X j and Z j operators are Pauli-X and Pauli-Z operators acting on qubit j. The set ∂f are the qubits on the boundary of face f and ∂j is the set of vertices v at either end of the edge that supports qubit j. The stabilizer group consists of one star operator for each vertex, v, and one plaquette operator for each face f . Colloquially, a star operator is the product of Pauli-X operators acting on all the qubits on edges incident to vertex v, and a plaquette operator is the product of Pauli-Z operators acting on all the edges that bound faces of the lattice, f . We show pictures of a plaquette and a star operator in Figs. 1(a) and (b), respectively. The code space of the toric code encodes two logical qubits that are acted upon by logical operators L, whose elements are Z j and X j with j = 1, 2. The logical operators are non-contractible loops of Pauli-Z or Pauli-X operators acting on the primal or dual edges of the lattice respectively. One pair of these logical operators, X 1 and Z 1 , is shown in Figs. 1(c) and (d).
Quantum error-correcting codes are designed to identify and correct errors suffered by the code. We consider error operators E ∈ P. The procedure for error correction involves measuring the generators of the stabilizer group. Stabilizers commute with the logical operators of the stabilizer code, and as such we do not disturb encoded logical information when stabilizer measurements are made. The outcomes of the stabilizer measurements can be used to identify the error as the elements of the stabilizer group S j that do not commute with E will return a −1 outcome. We see this with the eigenvalue equation We refer to elements of the generating set of S that return −1 eigenvalues as defects. The collection of measurement outcomes of the selected stabilizer generators is known as the error syndrome. In the case of the toric code that we study here we use the star and plaquette operators in Eqn. 2 to represent the canonical set of stabilizer generators.
We require a decoder, a classical postprocessing algorithm that interprets syndrome information, to estimate the most likely error that might have occurred on the lattice. A decoder will subsequently return a correction operator, C, to attempt to reverse error E. Specifically, we seek a decoder such that the value is optimised. To do so, the decoder must make use of some knowledge of the type of errors that commonly occur in the system. In the remainder of this Section we describe general correlated noise models acting on the toric code, the syndromes they give rise to, and the decoder we use to interpret the syndrome information.

Error events
In the previous Subsection we introduced error operators E ∈ P. However, we wish to design a decoder which takes into account more information about the structure of an error operator.
Here we make rigorous the concept of a structured error model by considering an error operator as a series of error events.
To study the performance of quantum errorcorrection procedures against correlated errors we generate random Pauli errors of the form where operators e j ∈ P describe a set of error events that may occur through the noise channel. Error event e j occurs with likelihood p j such that σ j = −1 with probability p j and σ j = +1 otherwise.
Typically quantum error-correcting codes are tested using an independent and identically distributed(i.i.d.) noise model. For instance, the error events of the bit-flip noise model are single qubit Pauli errors acting on each qubit of the code i.e. e j = X j for all j that index the qubits of the system. Each error event in the model occurs with uniform probability p j = p for all j. Alternatively, the depolarising noise model is sometimes considered, where similarly, error events e j act uniformly on all qubits j of the system, i.e. p j = p, and then error events can take values X j , Y j or Z j with uniform probability 1/3. In our analysis that follows we will consider more general bit-flip error models with error events that are supported on multiple qubits. The restriction to bit-flip errors simplifies the problem of decoding as all of the stabilizer defects are detected by the plaquette operators.

Decoding with the minimum-weight perfect matching algorithm
In the next Section we generalise the well-studied MWPM decoding algorithm [11]. For numerical Figure 2: Defects on the lattice (left) are mapped onto a graph with weighted edges (right) where the weights correspond to the probabilities that its adjacent pair of defects were created by an event that corresponds to errors along that edge.
studies we make use of the Blossom-V implementation of Edmonds MWPM algorithm [47] due to Kolmogorov [48]. This decoding algorithm is particularly well suited to the diffusive noise model we will introduce in the next Section.
The algorithm due to Edmonds takes as input a graph with weighted edges and returns a matching graph, i.e. a graph where each vertex has one and only one incident edge, such that the sum of the weights of all the edges are minimal. We denote edges, e, by pairs of vertices of the graph such that e = (u, v) where u and v denote vertices of the graph. We also denote by W (e) the weight assigned to edge e.
To apply the MWPM algorithm to the problem of decoding we assign to each stabilizer defect measured by a plaquette operator a vertex of the matching graph. Ideally we then construct a complete weighted graph where we weight each edge with the function where prob(e) is the probability that the error model introduced an error event, or a combination of error events, such that defects u and v of edge e occurred. In general evaluating W (e) may be a complex summation of exponentially many terms. We will typically approximate this value by calculating only low-order terms of the summation. We summarise the construction of the complete graph in Fig. 2.
To find a correction operator we apply the Edmonds MWPM algorithm to the generated graph to find a matching graph where the edges correspond to a collection of error events that is likely to have caused the error syndrome. We use this information to find correction operator C.
We remark that for the well-studied case of i.i.d. noise we will typically have W (e) = − log(prob(e)) ∝ d (u, v) where d(u, v) is the separation of vertices u and v of edge e on the lattice [11]. Throughout this work we consider the Manhattan distance where where d x (d y ) is the separation between u and v along the x(y) direction on the lattice. We refer to the MWPM decoder where W (e) ∝ d (u, v) which is designed to deal with i.i.d. noise model as the standard decoder. Other work has also considered introducing an extra logarithmic term to account for degeneracy in errors that cause defects at vertices u and v [65,59], but for simplicity we do not use this extension here. In this work we will generalise the construction of the MWPM decoder by assigning different functions to W (e) depending on the anticipated correlated noise model.
The MWPM decoder will find a single error that was likely to have caused a given syndrome with respect to an error model that is determined by W . We expect that our methods can be improved using maximum-likelihood decoding schemes that identify the most-likely equivalence class of errors that caused a given syndrome [65,55,56,66]. However, in general, few efficient maximum-likelihood decoding algorithms are known [66]. Here we assume that identifying a single error that was likely to cause the syndrome is a good approximation of maximumlikelihood decoding. This has been demonstrated to be the case for the independent and identically distributed noise model in Ref. [11,67].

Noise characterisation
In this Section we consider how to adapt the MWPM decoding algorithm, such that it can be parametrised to target different noise models. This parameterisation allows us to define a family of decoders, which we call an adaptive decoder. Specifically, we consider a MWPM decoder where edges are assigned weights by the function W λ (d) where d is the distance between the two defects, and the parameter λ denotes different members of the decoder family. In general, λ can represent many variables, but here, for simplicity, we will consider only integer values. We show that we can distinguish different noise models by studying logical error rates as a function of λ with an adaptive decoder. We find that, for certain noise models with unknown parameters, the logical error rates, or thresholds of different decoders can allow us to deduce the noise parameters.
We first consider a simple example noise model to analytically justify the use of logical error rates to learn noise parameters. We will then test two different adaptive decoders, which we will define shortly, to analyse a diffusive noise model using numerical experiments.

An illustrative example of the diagnostic tools
We first develop some intuition for our diagnostic method using a simple correlated noise model, that we call the ballistic noise model, by quoting some results that are shown in Appendix A. We will argue that improved logical error rates are achieved with a targeted decoder that uses information about the noise model in the regime where the error rate is small. We use this example to motivate the simulations we conduct in the remainder of the paper.
In the ballistic error model, error events form 'straight lines' of Pauli errors with a fixed weight, Figure 4: An error caused by the ballistic noise model in the path-counting regime. The noise model introduces strings of length ξ = L/4. A standard decoder will have difficulty dealing with this error configuration as there are two inequivalent correction operators that have the same weight. Conversely the targeted decoder which is designed to anticipate errors that introduce defects that are separated by a distance ξ will correct errors from this error model with high probability.
ξ. More specifically, the error event associated to vertical(horizontal) qubit edge j introduces a bitflip to edge j and the subsequent ξ − 1 edges that are located immediately to the right of edge j (below edge j). Each error event occurs on edge j with uniform probability p j = p. We show examples of error events of the ballistic noise model where ξ = 3 in Fig. 3.
In Appendix A we show that for arbitrary ξ ≥ 3 in the regime where p is very low, otherwise known as the path-counting regime [11,18], the logical error rates can be improved by using a targeted decoder. It follows that we can construct a family of two different decoders to distinguish i.i.d. noise from the ballistic noise model for fixed ξ ≥ 3 by comparing the logical error rates of the two different decoders. The two MWPM decoders of this family are the following, the first is the standard decoder, where the matching graph is constructed with edges weighted according to the separation of stabilizer defects. This decoder seeks the lowest-weight correction operator. The second decoder in the family is the targeted decoder, which anticipates the ballistic noise model and assigns weight a to edges where stabilizer defects are separated by distance aξ, and otherwise assigns very high weights to edges of the matching graph.
Consider the ballistic noise model with ξ = L/4 in the path-counting regime where 1/p 4ξL. In this example the common error configurations that will cause either the standard decoder or the targeted decoder to fail are those where two non-overlapping error events occur on the same row or column. However, there are far fewer nonoverlapping error configurations that will cause the targeted decoder to fail compared with the standard decoder. We give an example error configuration in Fig. 4 caused by the ballistic noise model that will be corrected using the targeted decoder, but will not be corrected by the standard decoder.
For the case of the error configuration shown in Fig. 4, the standard decoder will construct a graph that will assign equal probabilities to two inequivalent correction operators, C 1 and C 2 , independent of L, where C 1 repairs the error, C 1 E ∈ S, and the other correction is such that C 2 E ∈ S. The standard decoder will struggle to deal with this case as both C 1 and C 2 will have weight ∼ L/2 and as such, the standard decoder will not be able to identify the error events that have caused the given syndrome. In contrast, the targeted decoder that is designed to identify the error events that introduce defects separated by distance ξ, and will assign very low weights to the edges of the set that correspond to the correct correction operator, and very high weights to the other edges.
One can count the number of non-overlapping error configurations using Eqn. (11). There are exactly L(L − 2ξ + 1)/2 error configurations of two error events where ξ = L/4 such that there are are exactly L/2 bit flips along a given row. Each of these error configurations will cause the standard decoder to fail with probability 1/2 independent of the size of the system. However, of these non-overlapping configurations, there are only 6ξ = 3L/2 error configurations where the targeted decoder will fail with probability 1/2, other non-overlapping error configurations of weight L/2 will be decoded successfully by the targeted decoder.
Having shown that there are O(L 2 ) low-weight error configurations that will cause the standard decoder to fail for the ballistic noise model, compared with only O(L) low weight configurations that will cause the targeted decoder to fail, we can expect to be able to identify the ballistic noise model by comparing logical error rates of the noise source with respect to the two different decoding algorithms of the family by taking system of suitably large size. In general, we show in Appendix A that R, the ratio of the failure probability of the targeted decoder and the failure probability of the standard decoder in the path counting regime calculated with respect to the ballistic noise model, vanishes exponentially with L for constant ξ ≥ 3. Specifically, we find To this end we can expect to easily identify the ballistic noise model in the path counting regime by comparing the logical error rates of the two decoders of the family.

Diffusive noise
We now consider a diffusive error model where each error event introduces a continuous random walk of bit-flip errors that extends across a number of nearby qubits such that two defects appear at its end points. We use this error model to numerically demonstrate our diagnostic method. We index error events e f with the faces of the lattice f . Event e f will occur with probability p f = p where p is uniform for all faces. Given event e f occurs, a random walk is generated for a fixed number of steps, ξ L, between adjacent faces of the lattice. At a given step the walk direction is chosen uniformly from the four adjacent faces. Each edge, indexed j, that is crossed during the walk an integer w times will suffer error X w j . An error event of this kind generates a single error chain, that is, where only two syndrome defects are created at the initial and final face of the walk.
Finally, we point out that while we observe the behaviour in the case of odd and even values of ξ to be qualitatively similar, we do not compare odd and even values of ξ directly, as we observe there to be a slight discrepancy in their performance. We clearly see this effect in Fig. 5. We speculate that this is due the fact that, unlike the odd case, for even ξ there is a non-zero probability that error events are members of the stabilizer group, and therefore act trivially on the code space.

Evaluating ξ for the diffusive noise model using the single-weight adaptive decoder
Here we demonstrate numerically that using adaptive decoding the unknown parameter ξ of the diffusive noise model can be identified. We use an adaptive decoder based on the MWPM decoding algorithm that we refer to as the singleweight adaptive decoder. The weighting function for this decoder assigns low weights to edges of the matching graph with length λ, and to all other edges assigns high weights that scale with the separation of pairs of stabilizer defects. Specifically, it assigns edge weights with the function where d is the Manhattan distance between two defects, with ∆ L. The weighting function for the single-weight adaptive decoder is shown in the inset of Fig. 5(a). We will see that the logical failure rate of the single-weight decoder depends on the choice of λ relative to ξ.
We numerically simulate this scenario for integer values of λ between 1 and 10 and values of ξ = 1, 3, 5, 7, 9. To obtain the threshold error rate we plot the logical error rate P fail as a function of p for at least three large system sizes. To minimise the effects of simulating finite size systems we study systems where L √ ξ given that we expect random walks to typically achieve walks of length ∼ √ ξ. The value of p for which P fail coincides for all L determines p th . We find the crossing point by fitting the data to the function P fail = A 0 + A 1 x + A 2 x 2 where x = (p − p th )L 1/µ and A j , p th and µ are constants to be evaluated. We show an example threshold plot for ξ = 3 using the single-weight adaptive decoder with λ = 2, 3 in Fig. 5(b).
We remark on the clear trend in Fig. 5(a) where the threshold presented as a function of p tend to decay quickly with ξ. This decay is partly due to the fact that the weight of the error increases with ξ even while p remains constant. A comparison of the effective single qubit error rates are shown In fact, given good knowledge of the value of ξ the threshold remains relatively high even in the presence of the spatial correlations. We discuss this further in Sec. 4.
Having calculated the threshold for each error model using a range of decoders from the family, we go on to estimate the value of ξ by plotting p th as a function of λ for each noise model, as shown in Fig. 5(a). We observe that each value of ξ generates a distinct plot as λ is varied. We can therefore regard this as a signature of a given noise model, as such, we refer to this plot as a signature plot. We now investigate how we can use the signature plot to estimate the unknown parameter of the noise model, ξ and determine other features of the noise model.
Studying Fig. 5(a) we first remark on the discrepancy between the data obtained for even and odd values of λ. We have considered only odd length error chains, which means single error events will never introduce defects separated by an even distance. As such, a decoder with even λ will predominantly be correcting for second order error events, which we would expect to have a poor performance. This effect is indeed observed in the data. When the value of λ is odd, even when it does not match ξ the decoder is preferentially correcting for first-order error events. It is interesting to see that this feature of the noise model, namely that the noise model only introduces error strings of odd length, can be readily identified from the signature plot.
In Fig. 6 we plot estimates for the value of λ for which the threshold error rate is maximal. We denote this value λ * . We determine λ * using two rudimentary methods. First of all we estimate λ * as the discrete value of λ for which the threshold is maximal. We show these discrete data points in orange in the Figure. Notably, for the relatively small values of ξ we study, we observe that λ * increases with ξ in one discrete step. This observation indicates that λ * is sensitive to changes in the value of ξ.
Ideally, we would like to determine ξ precisely using the signature plot. However, using the method for estimating λ * we have suggested so far, it is difficult to resolve ξ from λ * as there are error models with different values of ξ that return the same value λ * . To deal with this we refine the estimate of λ * by using more data points from the signature plot. In the Fig. 6(b) we fit a quadratic curve to the odd λ data points close to λ * , which are shown in Fig. 5. The maximal values of the quadratic fittings are shown in Fig. 6(a) with red data points. We observe that the maximal values increase like λ * ∼ 1.3 · ξ 0.39 which is plotted in blue against the acquired data points. We might expect a relationship λ * ∼ √ ξ that represents the average distance covered by an error event that performs a uniform random walk. We speculate that this discrepancy in the fitting is due to microscopic details and small size effects. Nonetheless, our numerical results show that the value of λ * , which is found using the signature plot, estimates the unknown parameter ξ precisely.

Estimating ξ using the Gaussian decoder
One might argue that the adaptive decoder we used in the previous section uses too much knowledge of the error model to be applicable in any real system, since we use the fact that the random walk is of a fixed length. In this section we show that a similar result is achieved with a more 'general purpose' adaptive decoder, which could apply to many more possible noise models. We call this the Gaussian decoder, as it assigns weights to the edges of the matching graph according to a Gaussian function based on the separation of two defects where d is the separation of the two defects measured via the Manhattan distance on the lattice, µ = λ and σ = λ/2. A schematic of the weighting function of the Gaussian adaptive decoder is shown in the inset of Fig. 7. The decoder is designed to assign bias to identify common error events that cause defects that are separated by a distance that is on average d ∼ λ which we expect from the diffusive noise model. Errors that are not consistent with a diffusive random walk are assigned probabilities that are proportional to their separation as we would using the standard decoder.
In the previous section we produced signature plots by computing the threshold error rate for each decoder parameter λ, and then using the result to estimate the correlation length ξ. In practice it will be simpler to use logical failure rates directly, rather than thresholds, as they can be computed for a single code of fixed size, and a single value of physical error rate. As such, for this case, we use logical error rates instead of threshold error rates to find a signature plot.
At the top of Fig. 7(a) we generate a signature plot using the logical failure rate of the adaptive decoder as a function of λ for different odd values of ξ ranging from ξ = 3 to ξ = 51, for a lattice size of L = 100 such that √ ξ L. Only the odd values of λ are shown. We see that, as in the previous Subsection, the peak logical success rate varies with ξ. In Fig. 7(b) we aim to estimate ξ using the signature plot. Two different estimates Estimation of the optimal decoder parameter λ * . We identify the discrete value of λ for which the logical error rate is maximal (orange data points), and make a continuous estimation by fitting a quadratic function around the peak (red data points). We observe that λ * ∼ √ ξ as we expect from a diffusive noise model where each error event will typically introduce a pair of stabilizer defects that are separated by distance √ ξ.
of λ * are shown, a discrete estimation by choosing the value of λ for which the logical success rate is the greatest, and an estimate based on a quadratic fit around the peak values. We observe a trend λ * ∼ √ ξ as we might expect from the diffusive noise model.
We finally remark that we chose a fixed relationship between µ and σ in our weighting function, but more generally the functional form can be parametrized by more variables to explore a wider space of functions. This may be an interesting route for further work. Using our choice of adaptive decoder the results we have presented show that the logical failure rate of the decoder is sensitive to our choice of λ, and that we can use this information to improve the failure rates of our decoding scheme.

Improved decoding schemes
In the previous subsection we demonstrated that we can establish features of noise models by use of an adaptive decoder, and we showed this explicitly for the case of the diffusive noise model. Being able to gain a knowledge of the noise acting on underlying hardware is a valuable tool for improving the performance of quantum error-correcting codes. Particularly in the regime where the system is too large to allow for tomography. Information about the error processes involved may make it easier to identify the source of the noise, and it may be possible to improve the decoding algorithm to account for these known errors in classical post-processing. In this Section we show that we can use signature plot data to improve decoding algorithms to increase both threshold error rates and logical success rates.
We will focus on the data obtained in Subsec. 3.3 to design better decoding algorithms. Our aim is to use signature plots to design a decoder that performs better than the best decoder we had already identified by sweeping the parameter λ. We propose a specialised decoder, that identifies the two highest peaks on the signature plot, and uses a weighting function that assigns very low weight two both of these values of λ, and high values elsewhere, otherwise the function assigns a large weight that scales with the separation of the defects.
We compare the specialised decoder with both the standard decoder, and the fixed-weight de-  Figure 8: The threshold under diffusive noise for varying values of ξ for the standard decoder, the fixed weight decoder with λ = λ * and a specialised decoder where we assign a very low weight to more than one value of the λ. The threshold is shown as a function of the correlation parameter ξ, for the three approaches to decoding. We see that for ξ > 3, with an appropriate choice of a non-monotonic weighting function we obtain improved threshold error rates, thus indicating that we can design better decoders using the data available in the signature plot. The thresholds in the effective single qubit error rate are shown in the solid lines. The dashed blue line gives a comparison to the event error rate. coder which has been calibrated with λ = λ * where we use the discrete value of λ * found in the previous section, i.e. the orange points shown in Fig. 6(a). Fig. 8 compares the thresholds of the different decoders. We find that the specialised decoder outperforms the other decoders for sufficiently high ξ. The calibrated fixed-weight decoder also outperforms the standard decoder for larger values of ξ, but does not perform as well as the specialised decoder. Importantly, our results show that updating the weighting function using information from the signature plot improves the logical failure rates of the surface code.
We remark that the specialised decoder we have suggested here is by no means optimal, we have only demonstrated that even using a very simple method for using information from the signature plot the decoder can be improved. We expect that more sophisticated techniques will allow further improvements in the threshold, but we leave a thorough exploration of the decoder performance that can be achieved using signature plots to future work.
It is common to think about noise only as a rate of Pauli errors on single qubits, and it is useful to consider how the correlations in the noise affect this effective single qubit error threshold. Fig. 8 shows the thresholds in the single qubit error rate, which is defined as the probability with which any individual qubit has suffered a Pauli error at the end of the round of noise application. The effective single qubit error thresholds for the standard decoder (solid blue line) can be compared with the error event thresholds (dashed blue line). The latter decreases rapidly, since a smaller number of events introduces more single qubit Pauli errors. However, we see that even with the standard decoder, the effective error threshold decreases only gradually as correlations increase. We also plot the effective error threshold using the fixed weight decoder, and specialised decoder, as described in the previous sections. Here, we see a more gradual decline in the threshold.
It is often believed that any correlations in the noise model are highly destructive, and should be avoided. While this may sometimes be the case, for example with very long range correlations in which a single error event spans the code, the effect on the threshold depends strongly on the exact structure of the correlations. These results show that for a diffusive noise model resulting in spatial correlations much smaller than the code distance, the threshold is not strongly affected, and using a targeted decoding strategy the loss of logical error rate can be reduced.

Practical considerations
It is worth noting the practicality of the scheme we have discussed for analysis of a real experimental setup. Given that some hardware has been developed to implement an error correcting code, we can perform the following operations: prepare the code in a known logical state, perform stabilizer measurements, and measure out the logical qubit with the intention of implementing the identity gate. We can repeat this process many times to build up a large data set of measurement outcomes. A decoder can analyse the measurement outcomes to determine if a logical error occurred. We can then perform the analysis we have described in classical post-processing on this data set, using a large suite of decoders targeted at errors over a large space of possible noise models. The fact that this analysis is a classical and offline makes it a very low cost way of studying the performance of a logical qubit. Furthermore, since no direct interaction is needed with the physical device, there need be no requirement that the decoder is fast, in the sense that it can keep up with the operating speed of the physical qubits. Given that we would expect to apply our method offline, we remark that this may be a practical use case for slow decoders with high thresholds, or other useful properties, even if such decoders are impractical for online decoding.
The results of such an analysis, giving some characterization of the noise model, could then be used in multiple ways to improve a device. For example, adjustments at the hardware level may be possible to minimize sources of noise, and as we have shown, we can also improve the classical processing accompanying the error correcting code to account for the known structure of the noise.

Conclusions
To summarise, we have developed diagnostic tools to analyse an unknown parameter of a correlated error model acting on the toric code. Our method generalises the MWPM algorithm to define a parametrised family of decoders. We go on to compare the logical error rates of the family of decoders to hypothesise the types of correlated errors a code suffers. We have shown that a code can tolerate a higher error rate if we calibrate a decoder under the error events that commonly occur, and furthermore that an increased threshold can be found for certain spatially correlated noise models. We also discussed how our scheme could be implemented in a practical setting.
In this work we have studied only a simple noise model, but we expect that other correlated error models where string-like errors are drawn from some distribution, such as thermal noise, will display a similar behaviour. Beyond spatial correlations, the methods we have proposed can be more broadly applied to other experimentally relevant models of correlated noise, as long as an appropriate family of decoders could be found to characterize the error. For example, errors correlated between X and Z bases, higher probabilities of error in certain physical locations, and temporal error correlations, per-haps due to malfunctions in measurement apparatus [68,69,70,71], are all sources of concern. Many known decoders exist which could potentially be adapted to handle these types of correlations [55,56,72,73,74,75,76,63]. As a first step, it will be interesting to extend the ideas we have presented here to identify multiple unknown parameters of an error model to enable us to use decoding algorithms to identify features of more realistic noise models.
Beyond the toric code, similar techniques to those we have demonstrated could potentially be used to probe string-like correlated errors in other error-correction procedures that use adaptations of the MWPM algorithm [77,78,79]. This readily extends to decoders for the toric code in the setting where measurements are not ideal [80]. Moreover, it will be interesting to study local correlated error events that introduce many stabilizer defects. We expect the Metropolis-based decoders presented in Refs. [56,72], neural network decoders [81], tensor-network approximants of maximum likelihood decoders [66,76] or perhaps minimum-weight matching decoders that are supplemented by belief propagation [57,58,59] may be suitable for this purpose, but we leave this for future work.
As hardware rapidly progresses towards the first implementations of small error correcting codes, it is important to consider practical methods for analysing and optimising the performance of these systems. The methods we have proposed here offer a simple way of studying and correcting for correlated errors with offline classical post processing. With further development, we hope these methods will prove a useful tool for evaluating the performance of the first generation of fault-tolerant quantum processors. dation, the University of Sydney Fellowship Programme and the Australian Research Council via the Centre of Excellence in Engineered Quantum Systems(EQUS) project number CE170100009.
A Logical Error Rates for the ballistic error model in the path-counting regime Here we show that a targeted decoder will have better logical error rates in the path-counting regime for the ballistic noise model for ξ ≥ 3. For simplicity we assume only lattice sizes L = kξ for even integers k.
In the path-counting regime the errors that will most frequently cause the decoder to fail are where k/2 = L/2ξ errors align along the same row or column of the lattice in a suitable configuration. The standard decoder will fail with probability independent of the size of the system if all of these k/2 error events occur in a configuration where no errors overlap. However, as discussed in the main text, we can design a targeted decoder that makes use of value ξ to improve logical failure rates.
There are N st. configurations of k/2 nonoverlapping error events that will cause the standard decoder to fail where N st. = 2ξ ξ + 1 (k(ξ + 1)/2)! (k/2)!(kξ/2)! . (11) In the case of the targeted decoder however there are only N sp. error configurations that will cause logical failure with high probability. This is because the targeted decoder is designed such that in the path-counting regime the decoder will fail if and only if all stabilizer defects of a given error configuration are separated from each other by distances that are all factors of ξ. There are only of such configurations. We can use the expressions given in Eqn. (11) and Eqn. (12) to bound the ratio which is proportional to the ratio of the decoder failure probabilities for the targeted decoder and the standard decoder for the ballistic noise model.
Clearly, for small ξ ≥ 3 the logical failure probability for the targeted decoder is exponentially smaller than the logical failure probability of the standard decoder when dealing with ballistic noise. The remainder of this Appendix will prove Eqn (11). We consider two families of functions, the first, N l (t), denotes the number of configurations that t error events of fixed length ξ can be aligned on a ring of l sites such that none of the t error events overlap. The second, M l (t), is the number of configurations that t error events of size ξ can be arranged along a line of l sites with open boundary conditions such that none of the error events overlap.
We show Eqn. (11) recursively by finding a relationship between N l (t) and N l (t − 1). To do so, we derive some facts relating the function N l (t) to M l (t). Specifically, we have that We find N l (t) of Eqn. (15) by first considering a single error event of size ξ that can be placed on any of the l possible positions along a onedimensional lattice with periodic boundary conditions. The remaining t − 1 non-overlapping error events can be placed on the vacant l − ξ lattice sites that are not occupied by the first error event. We thus count lM l−ξ (t − 1) different non-overlapping configurations. With this expression, each error configuration counted by N l (t) is counted t times. The right-hand side of the expression thus includes an additional factor of 1/t to account for the degeneracy. We also require the relationship This expression is found by realising that the number of configurations included in N l (t) that are not included in M l (t) are those where a single error event crosses one particular fixed point of the ring of l sites. There are ξ − 1 positions that one error event may lie to cross this particular fixed point, and the remaining t − 1 non-overlapping error events may lie in any of M l−ξ (t − 1) configurations. We substitute Eqn. (16) into Eqn. (15) to find We finally combine Eqn. (15) and Eqn. (17) to obtain We recursively apply Eqn. (18) to Eqn. (14) to obtain the result of Eqn. (11).