Quantum Error Correction Via Noise Guessing Decoding

Quantum error correction codes (QECCs) play a central role in both quantum communications and quantum computation. Practical quantum error correction codes, such as stabilizer codes, are generally structured to suit a specific use, and present rigid code lengths and code rates. This paper shows that it is possible to both construct and decode QECCs that can attain the maximum performance of the finite blocklength regime, for any chosen code length when the code rate is sufficiently high. A recently proposed strategy for decoding classical codes called GRAND (guessing random additive noise decoding) opened doors to efficiently decode classical random linear codes (RLCs) performing near the maximum rate of the finite blocklength regime. By using noise statistics, GRAND is a noise-centric efficient universal decoder for classical codes, provided that a simple code membership test exists. These conditions are particularly suitable for quantum systems, and therefore the paper extends these concepts to quantum random linear codes (QRLCs), which were known to be possible to construct but whose decoding was not yet feasible. By combining QRLCs and a newly proposed quantum-GRAND, this work shows it is possible to decode QECCs that are easy to adapt to changing conditions. The paper starts by assessing the minimum number of gates in the coding circuit needed to reach the QRLCs’ asymptotic performance, and subsequently proposes a quantum-GRAND algorithm that makes use of quantum noise statistics, not only to build an adaptive code membership test, but also to efficiently implement syndrome decoding.


I. INTRODUCTION
Quantum technologies have the potential to revolutionize industries across the globe.By harnessing the power of quantum mechanics, technologies such as quantum computing, quantum simulation, quantum communication, and quantum sensing can be used to solve a wide range of hard problems in different areas, such as in the pharmaceutical, materials science, cryptography, machine learning, logistics optimization, finance, energy, and aerospace sectors [1]- [3].Nevertheless, for these technologies to be viable, significant progress needs to be made in quantum error correction, to reduce the error rates of these quantum systems to tolerable levels.
Implementing quantum computers and other devices bearing quantum memories will require quantum error correction of the stored quantum states [4], [5].Moreover, a number of applications, such as quantum key distribution, distributed quantum computing, or the connection of different quantum sensors, require the existence of quantum networks and quantum repeaters in order to sustain end-to-end quantum connections between several devices [6]- [11].Quantum states are notoriously sensitive to noise, so quantum error correction must be employed when establishing entanglement or for preserving quantum states in memory.Quantum gates still exhibit very high error rates, even though they have fallen in the last decade from ≈10 −2 [12] to ≈10 −3 [13]).Thus, it is paramount to have scalable quantum error correction codes (QECCs), meaning that errors can be exponentially corrected while the encoding/decoding complexity increases sub-exponentially with the number of qubits in the codewords.A very recent breakthrough toward this objective was communicated in [13], showing experimental results for a surface code that seem to pave the way for practical and scalable QECCs.The problem of quantum error correction has been looked at in [14] in a broader prospective than the traditional one of designing a fixed code.The authors proposed using quantum neural networks that work as autoencoders that optimally adapt the design of the QECC to the existing noise statistics.Note that making use of noise statistics is also a central idea of the proposal in the present work.QECCs designed for a particular type of channels, where the statistics of the errors show that one type of quantum errors is the most likely one, appeared in [15].[16] presented an encoding method for quantum random codes and analyzed its performance.[17] performed a similar analysis, but using a code construction akin to low-density parity-check codes (LDPCs) and based on constraint satisfaction.The works in [16] and [17] are mainly concerned with the efficiency of the encoding process, and both consider a decoder for an erasure channel, rather than a Pauli decoherence channel, which is considered in our work.Furthermore, important findings for QECCs designed for the deletion channel (i.e., when a qubit is removed without notice from a stream of qubits) have been communicated in [18].

A. Short linear codes: a historical context
Many ideas for designing QEEC can be traced down to the developments made in classical error correction, and in [19] one can find an exhaustive list of those connections.The arXiv:2208.02744v3 [quant-ph] 27 Oct 2023 concept of error correction appeared in tandem with the one of channel capacity in the pioneering work of Claude Shannon [20], who proved that the capacity of a channel could be attained by using a uniform-at-random code that maps any k bits of information onto codewords n bits long.This mapping should be random, in the sense that each of the 2 k codewords should be assigned to one of the 2 n possible words, and should be made according to a uniform distribution.Shannon's random code construction provably reaches capacity when the length of the codewords tends to infinity (n → ∞) and the decoder picks, among all possible codewords, the most likely one, by applying maximum-likelihood (ML) decoding with the received observation and the codewords' prior distribution.Nevertheless, Shannon's codes are too complex and have never been used in practice because that would imply storing all the 2 k codewords at the transmitter side, and applying ML decoding at the receiver, which is an NP-hard problem.
Classical random linear codes (RLCs) offer a solution to the codewords' storage problem, given that only the random generation matrix needs to be stored.Moreover, they are known to achieve capacity in the binary symmetric channel [20], [21].Although an exhaustive search among all the 2 k codewords of a RLC remains prohibitively complex, ML decoding is known to be attainable by other means.An exhaustive search entails searching through all the 2 k = 2 nR codewords when the code rate is R ≤ 1/2, however, when R > 1/2, it is preferable to look at the 2 (n−k) = 2 n(1−R) syndromes and perform syndrome-based decoding, which also delivers the ML decoding performance.In short, as it is well known, the complexity of an exhaustive search approach amounts to 2 n min(R,1−R) [22].It is known that the computational complexity of decoding any (deterministic or random) linear block code (LBC) can be greatly reduced by using set information set decoding algorithms (see [22] and references therein), or by having a trellis representation of the LBC and running the Viterbi algorithm on that trellis.The latter technique has been known since [23], when Wolf showed how to construct a trellis representation of a LBC using its parity-check matrix.However, as described in [24], research on trellis decoding of LBCs was not very active until the paper by Forney (and in particular its appendix) came out [25].In [24], Kschischang and Sorokine provided a (arguably) more elegant manner of constructing the trellis of a LBC by using the spans of the so-called atomic codewords, which is a tool to find the unique minimum trellis of a LBC.A measurement of the complexity of the resulting trellis is the maximum number of states existing across all its sections, and that number can be shown to be s max = 2 min(k,n−k) .This corresponds to the bound given by Wolf [23] and also found in [24], [26].Forney's work was, in fact, much broader, unlocking the trellis representation of lattice codes (of which LBCs are a particular case), and therefore permitting ML lattice decoding of specially designed lattices [27], and also approximate ML decoding of random lattices [28].The path taken by coding theory (and coding practice) in the following years focused on finding practical codes that would achieve Shannon's capacity; regardless of the family of codes being studied, the efforts were concentrated on long codes (with large n) and typically not having a very high rate.This may explain why the work on trellis decoding of LBCs (summarized in [29], [30]), as well as the various information set decoding algorithms, have been overlooked as a possible low-complexity ML decoding solution for RLCs.All these decoding approaches deal with lists of size 2 (n−k) : being it the number of syndromes, or the number of coset representatives described by the trellis of the code.While syndrome decoding would involve storing all those syndrome pairs and the associated coset representative in the so-called standard array, a ML Viterbi trellis decoder implies storing a trellis with the same number of paths (each of which associated with a coset representative).When the redundancy of the code (i.e., n − k) is large, the memory requirements for syndrome decoding become too large, and in the case of trellis decoding, the trellis comprises too many states, in both cases limiting the real-world use of capacity-achieving RLCs.
Motivated by both power-and complexity-limited devices in wireless communications, and also due to the goal of reducing end-to-end coding/encoding latency, research only recently shifted to the finite-blocklength, with an emerging interest for short codes and high rates, eventually culminating in a practical method for decoding RLCs dubbed guessing random additive noise decoding (GRAND) algorithms [31]- [36].At its core, GRAND is focused on guessing the noise that corrupted the transmitted codeword, rather than exhaustively going through all the possible codewords in order to find the one that fits the ML criterion, and is proven to still lead to ML decoding [31].GRAND is a universal decoder, enabling the decoding of any block code of moderate length or high code rate, when dealing with low entropy noise.The only requirement is that a practical membership test exists to assess whether some word belongs to the codebook or not.The decoding complexity is measured by the average number of membership tests needed until a valid codeword is found.Given that the space of possible words has size 2 n , and that there are 2 k valid codewords, that average number of attempts until one finds a codeword is given by the ratio R) .Therefore, that number can be low, provided that the codeword are short or that the code rate is high, which is particularly attractive for quantum setups, where the number of available qubits is modest.
Although ML decoding could be implemented for the particular case of low-redundancy RLCs via the above-listed techniques, one would still face memory constraints.Contrary to information set decoding, syndrome decoding, or trellis-based decoding, GRAND does the decoding on-the-fly, dispensing any type of storage besides the parity-check matrix of the RLC (or any particular LBC).Note that computing a minimal trellis of an RLC is a non-negligible preprocessing that is needed each time the RLC changes.Additionally, GRAND can outperform those techniques (designed for memoryless channels) in the case of non-independent and non-identically distributed noise having memory [37].In fact, any prior information about the structure of the noise can lead to performance improvement or to further complexity reduction.For example, incorporating the geometry of the used symbol constellation can significantly reduce GRAND's complexity [38].

B. Scope and Contributions
Due to the technical difficulties in manipulating qubits, the error correction codes applied to qubit packets in quantum communication links or quantum memories are necessarily ones with short codewords, and for that reason, quantum error correction is a good fit for GRAND-inspired strategies.Since all quantum operations are required to be unitary, the construction of quantum random linear codes (QRLCs) is not as straightforward as in classical RLCs.This difficulty in adapting classical codes to the quantum setting is typical; it also took an extensive effort to find quantum LDPC codes whose properties matched their classical counterparts, and these issues continue to be the focus of intensive research [39]- [41].Similar issues plagued the development of quantum turbo codes [42].Furthermore, to borrow the performance guarantees existing in the classical setting, many of these adaptations amount to Calderbank-Shor-Steane (CSS) codes, which have suboptimal channel capacity [43], [44].
Fortunately, for QRLCs, simple (randomized) constructions exist [16], [45], leading to codes whose performance is primarily conditioned by the number of quantum gates used as building blocks for the coding circuit.For codewords with n qubits, and in a setup with all-to-all connectivity (i.e., when any qubit can be directly entangled with any other), O n log 2 n two-qubit random Clifford gates and O log 3 (n) circuit depth has been shown to lead to codes with a reasonable Hamming distance [45].More recent results have expanded the capabilities of QRLCs for the case of limited qubit connectivity, and eased the gate requirements [16].In general, the more gates used, the more the code approaches a "truly" random QRLC.As part of the encoding for stabilizer codes, they may also constitute a vital piece in quantum error correction for quantum computing, quantum networks, and quantum memories.However, these codes have suffered from some of the same disadvantages as classical RLCs, as they have been too difficult to decode in practice.In fact, to the authors' best knowledge, only recently has been presented in [46] a practical decoding technique, based on tensor networks, applicable specifically to low-depth circuits with one-dimensional connectivity.They numerically verify that their code reaches the hashing bound [47], but do not prove it mathematically.The recent work in [46] does consider a Pauli decoherence channel, however the results are presented using different variables and parameters, difficulting a direct comparison with our proposal.We note that, from a practical perspective, our model has some limitations.We consider allto-all qubit connectivity, noiseless encoding circuits, as well as a noiseless syndrome extraction procedure.We also consider noiseless quantum gates.These assumptions are regularly used to analyze a code's performance [48], and they are used similarly in other results in the literature [16], [17], [46].These limitations are further addressed in Section VIII.
Interestingly, research on trellis decoding has recently also begun being studied as a possible practical way of implementing ML decoding for any quantum stabilizer code over a finite field of prime dimension [49].As in the case of the trellis decoding of classical RLCs (mentioned in Section I-A), a trellis-based approach may also open doors to the decoding of QRLCs.
The present paper extends the noise-decoding concept to quantum systems, allowing one to tackle the decoding of QRLCs for the first time in the typical Pauli decoherence channel.Meanwhile, results on the use of guesswork in the decoding of designed families of quantum codes have appeared in [50].The concept of universal guessing-based decoding was tested there with non-random codes, i.e., quantum codes that are known and hold a design structure that fits particular decoding methods.
Our work considers a system model with perfect encoding and perfect measurements, focusing on correcting the errors that arise in the communication channel, which is a common model used in the literature [50], [51].By making use of the key features of GRAND, this work shows how to take advantage of QRLCs to construct stabilizer codes that are shown, via semi-analytical simulation, to be near-capacity achieving and decodable in practice, leading to quantum error correction codes able to cope with large channel error rates, even at reasonably high code rates.
As it is a universal decoding method, the proposed quantum-GRAND (QGRAND) constitutes a general approach to QEC that is amenable to any code length size n and a sufficiently high code rate R. Furthermore, it is highly adaptable to on-thefly changes depending on noise statistics, and is likely suitable to scenarios where less than all-to-all connectivity exists.For these reasons, the combination of QRLCs and QGRAND stands out from the well-established QECCs.This combination is potentially of high importance to future implementations of quantum error correction for quantum computing and quantum networks, as recently highlighted in [52, sec.VI.B].
The literature on the use of GRAND to decode classical RLCs is quite recent and it often directly compares the decoding complexity of RLCs via GRAND with the one of ML decoding.The historical context (given in Section I-A) brought to attention several other approaches that enabled the decoding of RLCs.That account is further complemented in Section II.Besides that, the main contributions of the paper are i) the analysis of the requirements for the construction of a good QRLC, including the implications to the associated encoding complexity, measured by the number of gates in the encoding circuit, and ii) the proposal of a quantum-GRAND approach that enables the numerical assessment of the performance of QRLC's for the first time, and measuring how close those results are from the optimal performance, which is analytically derived.

C. Organization and Notation
The paper is organized as follows: Section II presents a brief introduction to classical RLCs, and introduces GRAND in the classical domain.Section III provides some quantum error correction basics, and Section IV details the approach taken by stabilizer codes.Section V presents some theoretical and numerical results (using a semi-analytical framework) for QRLCs, and the noise model considered.Section VI describes how to construct a stabilizer code from this quantum RLC encoding.These ideas are later combined in Section VII, where QGRAND is showcased.The numerical results are displayed in Section VIII, and a final discussion appears in Section IX.
For the sake of clarity, we opted to denote matrices and vectors in non-bold, as that is the traditional notation in the field of quantum signal processing, with the exception of the classical vector s and the zero vector 0.
It should be noted that error rate is used throughout the paper in the same sense that bit error rate is used in classical communications, meaning that herein the term is used with respect to qubits after their discretization.The literature on QECCs often calls it error probability instead, and rather associates the error rate with the continuous errors of the physical qubits [53].

II. TOWARD SHANNON'S CODES: CLASSICAL RLCS
In 1948, Shannon proved [20] that (classical) random error correcting codes with codewords of length n and having 2 k valid codewords randomly chosen out of the 2 n possible words are able to achieve the capacity of the Gaussian noise channel, as n → ∞.Even so, randomly selecting the codebook members leads to: i) a storage problem, given that all codewords would have to be stored both at the encoding side and at the decoding side, and ii) a decoding complexity problem, given that, when applying ML decoding, a corrupted codeword needs to be compared with all codewords in the codebook.
The storage problem posed by Shannon's construction (to generate uniform-at-random codes) has been overcome by RLCs, of rate R = k/n, because, as in the case of any LBC, its generator matrix constitutes a very short description of the code.Without the size constraints of many families of classical structured codes, that impose constraints both on the admissible codeword lengths and code rates, RLCs can be constructed with any size and rate, and having those degrees of freedom is a major practical advantage for most engineering applications.

A. Decoding Classical RLCs by Noise Guessing
A paradigm change in the decoding of classical codes recently occurred for codes with short codewords or having low redundancy (i.e., high rate).GRAND [31], [33]- [36] fundamentally shifts the role of detection from searching codewords in the codebook to searching for the error pattern that took place.
Let us assume that a received block Y = X ⊕ E i has been affected by some error pattern E i , which could have occurred with probability p i .The statistics N of the possible error patterns are known, and the N candidate error patterns E i are ordered from the most likely (i = 1) to least likely (i = N ).GRAND consists of subtracting the error pattern E i from Y , starting from i = 1 and progressing down the list in N .If X = Y ⊖ E i is a valid codeword, then X is accepted as the decoded data.Otherwise, it moves to the next error pattern E i+1 and the process is repeated.Here, it is important to note that having a tool to test if X is a codeword (i.e., a membership test [31]) is absolutely necessary.If our noise statistics N encompasses all possible error patterns, it is guaranteed that a valid codeword X is found at some iteration.As proven in [31], for noise with Shannon entropy H(N ) (or entropy per bit h(N ) ≜ H(N )/n) and a code rate R = k/n below capacity (i.e., R < 1 − h(N )), the expected number of error patterns needed to be tested until finding the true noise pattern is 2 n min {h1/2(N ),1−R} , for large n, where h 1/2 is the Renyi entropy of order 1/2 [54], per bit.GRAND works best when the noise entropy is low or the code rate is high.In that case, the set of 2 n words is densely populated by codewords, and therefore the number of tests can easily be much lower than 2 nR , the expected number of tested patterns for standard ML decoding.Given the focus on decoding the noise, exploiting the prior knowledge of the noise statistics plays a central role in boosting the overall decoding performance of GRAND [37].
GRAND performs ML decoding and can therefore provide capacity-achieving performance when decoding structured capacity-achieving codes or RLCs.For practical reasons, one may be interested in the most likely errors only, and the search may be abandoned after iterating through slightly more than the first 2 nh(N ) error patterns, and quit afterward.This variant is called GRAND with abandonment (GRANDAB) and still provides ML decoding.In this manner, GRANDAB is also capacity-achieving, using many fewer iterations.
Although these results have been rigorously proven for uniform-at-random codes as n → ∞, experimental applications using structured linear codes of small blocklength, and also RLCs in particular, have produced striking results [32], [37], [55]- [58], consistent with these theoretical guarantees.
It should be credited that very related ideas appear in [59, pp.220-227], namely i) codeword guessing decoding based on the posterior probability of the noise, and ii) proving Shannon's capacity theorem for RLCs via counting arguments based on the number of distinct syndromes.

III. QUANTUM ERROR CORRECTION
Quantum error correction attempts to restore a decohered quantum state, which has undergone some error, back to a quantum state encoding the original data [4], [5].Qubits can undergo more types of errors than their classical counterparts, making QECCs in general more complex.Moreover, while classical use cases, such as wired communications or data storage, commonly offer error rates below 10 −5 , current quantum technologies need to be able to handle much higher error rates, similar to the ones encountered in uncoded classical wireless links (between 10 −3 and 10 −2 ) [12], [13].In addition to that, the construction and decoding of QECCs faces extra difficulties [60]: i) the non-cloning theorem shows it is impossible to copy an arbitrary quantum state, thereby forbidding the use of copies as redundancy; ii) quantum errors are continuous in nature, as the quantum state can be in any superposition of the basis states; iii) any measurement performed on a state in superposition destroys that superposition, and thus its quantum information is lost.Surprisingly, it is possible to circumvent these issues and construct QECCs that reliably protect quantum data against errors.Just as in the classical case, QECCs work by encoding a quantum state composed of k qubits into one with n qubits, in such a way that errors can be detected and corrected.
Any quantum channel error E, discrete or continuous, acting on a quantum state, can be written as a linear combination of these Pauli matrices.For one qubit only, one has for some set of complex values α i .I is a 2 × 2 identity matrix and are Pauli matrices.Since Y = iXZ, as long as QECCs can correct X (bit-flip) and Z (phase-flip) errors simultaneously and for each qubit, then they can also correct any arbitrary n-qubit error.
From this digitization, it can be shown [60] that a quantum error channel for n qubits may be decomposed as a combination of Pauli strings and ⊗ denotes the tensorial (or Kronecker) product.This description is named Pauli channel.The Clifford group is the set of unitary transformations that transform any Pauli string into a Pauli string.Clifford circuits are built solely from unitaries of the Clifford group.Any such Clifford unitary can be implemented via composition of the simple 1-and 2-qubit unitaries With these Clifford circuits, it is possible to construct an encoding for a QECC, in order to protect the desired quantum data.The backbone and inspiration for most quantum error correction methods are the so-called stabilizer codes [61], and for that reason, this work will chiefly focus on these codes as the core machinery needed to produce random QECCs.

IV. STABILIZER CODES
A stabilizer S i of the quantum state |ψ⟩ is any Pauli string that acts as the identity on |ψ⟩, that is, S i |ψ⟩ = |ψ⟩.The stabilizer group S is the set of all such stabilizers.As there is a one-to-one correspondence between |ψ⟩ and its stabilizer group, stabilizer circuits can be efficiently simulated using only Clifford unitaries (see [62], [63]).The stabilizer group can be generated by some (non-unique) subset S min , whose elements are the minimal stabilizers.These minimal stabilizers can be used to create a type of QECC, called a stabilizer code (see Fig. 1).For simplicity, henceforth we will refer to the minimal stabilizers of stabilizer codes simply as stabilizers.
Starting with the k-qubit quantum data |ψ⟩ D and (n − k) redundancy qubits in the state |0 . . .0⟩ R , which have been entangled by some Clifford unitary encoder U , then the resulting n-qubit logical state |ψ⟩ L (amounting to a codeword) must have s ≜ (n − k) stabilizers S min , which must commute with each other.It also has 2k logical operators Xi , Zi , for  4)), we obtain Since both the error patterns and the stabilizers are Pauli strings, they must necessarily commute or anticommute.If they commute, the state in (7) will be E |ψ⟩ L |0⟩, otherwise, we will have E |ψ⟩ L |1⟩.Consequently, the conditional application of each stabilizer provides us with 1 bit of information about the nature of the error.With s stabilizers, we have a s-bit syndrome, allowing one to discern between S ≜ 2 s error patterns, while in the case of no error, one obtains the zero syndrome.This information enables us to correct the quantum state by undoing the effect of the error.This recovery process R will consist of applying the inverse of the error pattern E ascertained from the syndrome.Since all Pauli strings are both Hermitian and unitary, for a Pauli channel, we have E −1 = E.

V. QUANTUM RLCS ENCODING
The construction of classical RLCs mentioned in Section II involves random generator matrices, whose only constraint is that they ought to be full-rank.Because quantum operators should be unitary, the construction of QRLCs is a rather more constrained problem.The generation of QRLCs is nevertheless possible: starting with a quantum state of k qubits, to be encoded into n > k qubits, [45] presents a method of generating a random qubit encoding.One starts by randomly selecting Clifford unitaries from the C 2 group (i.e., Clifford unitaries for 2 qubits).There are |C 2 | = 11 520 such unitaries, and all of them can be built by simple combinations of the Hadamard, CNOT, and phase gates, which have efficient physical implementations in virtually any quantum setting.After selecting these random unitaries from C 2 , one successively applies each of them to a random pair of qubits, taken from the set of n qubits, assuming that all-to-all connectivity (between any of the n qubits) is possible in practice.This assumption is required for the scaling results in [45], and is used in this work.However, it may be dropped for practical reasons, as the more recent results in [16] suggest, and it is the subject of future work.This process leads to an encoding unitary for our stabilizer code which, when applied to the initial k qubits and (n − k) extra |0⟩ qubits added, returns a n-qubit encoded quantum state.As shown in [45], as long as O n log 2 n gates are used, with a circuit depth of O log 3 n , the construction leads to a highly performant (n, k) code, and from [16] it is already known that these complexity orders can be further lowered.

A. Robust encoding
In this context, the QRLCs' performance will also depend on the noise statistics.Nonetheless, in order to effectively protect our quantum data from noise in an efficient and practical manner, the noise statistics about the particular environment in question should be known.In the quantum setting, assuming we wish to correct the N error patterns in the error set and we know the probability of them affecting our data to be P ≜ {p i } N i=0 , with p 0 ≜ P (no error), then our encoding and decoding procedure should have into account the noise statistics, denoted by the set of pairs with the error patterns ordered by decreasing probability, so that p i ≥ p i+1 , for all i.For an encoding with n qubits, using GRAND requires N + 1 = 4 n , with i p i = 1, as 4 n is the total number of Pauli strings of n qubits.If using GRANDAB, the unlikely errors may be disregarded, so a much lower N , and i p i ≤ 1, is assumed.As the encoding is randomly chosen, to ascertain the code's performance, we may compute the syndromes associated with every error pattern in E, and check whether the code is robust to all of them, in O(N ) time.The code is robust if each E i ∈ E has a unique syndrome or, for degenerate codes, if E i shares a syndrome with E j and E i E j ∈ S, that is, the combined action of the two errors does not change the quantum state.
Nonetheless, we may not require that all errors in E be correctable.For low entropy noise, some errors may be very unlikely to surface.If a random code happens to not correct these unlikely errors, it may still function adequately in the high probability case that more likely errors occur.
Classically, for a channel with input X and output Y , its capacity is given by the maximum of the mutual information I(X, Y ) over the possible probability distributions of X.In the quantum case, for the case of stabilizer codes, the quantum capacity is given by the coherent information of the quantum channel [60, sec.7.6], [47, sec.24.6.3].For a Pauli channel, this capacity is associated with the so-called hashing bound [47, sec.24.6.3],[64].Using the results in [47, sec. 24.6.3]we observe that, as long as the code is able to correct the error patterns in N with high probability.This is a direct consequence of informationtheoretic arguments based on set counting, and interpreting the entropy of the noise, H(N ), as the number of bits needed to describe the noise, which establishes how many different noise patterns can occur.Note that, in theory, due to the possibility of degenerate error patterns, it is sometimes possible to surpass the hashing bound [65], [66].Nonetheless, in Section V-B we motivate why degenerate errors have negligible effects in our setting, and consequently, in our numerical analysis in Section VII, these error patterns are approximately considered to be uncorrectable.Therefore, to obtain a near-capacity achieving code, we must only ensure that ( 10) is satisfied, and that sufficient 2−qubit gates are used to create the random encoding, as indicated previously, and as will be analyzed in Section V-C.This result is derived for large n, but similar results are applicable to lower n, as we see in the next section.

B. Comparison with ideal random codes
In order to assess the results obtained numerically, we may compare the QRLCs' performance with the expected performance of a simpler approximation.Similar techniques [16] have been previously employed in the literature, since they allow us to better gauge the behavior of QRLCs, as it is too difficult to analytically estimate their performance.
As an ideal approximation, we consider a code that maps each of N error patterns (plus the no error case) randomly, using an i.i.d.uniform distribution, to one of the S syndromes.This approximation constitutes a more manageable mapping for analytical study, when compared with the mapping produced by a QRLC, since it does not present the linearity constraint, nor the added structure present in quantum codes.Nonetheless, since QRLCs may be thought of as a subset of the codes that this ideal approximation may generate, its performance may be considered to provide an upper bound for the QRLCs of interest.
For N error patterns, plus the no-error case, let u be the number of unique error syndromes associated with them.In general, the average number of unique syndromes is and the correctable error fraction is given by If we wish to correct all N error patterns (i.e., f = 1), we must have (N + 1) distinct error syndromes, which happens with probability with the approximation achieved by the Taylor expansion of e x .Note that the probability of correcting absolutely all N error patterns P (f = 1) may be very low, while still having In fact, reminding that S = 2 n−k , we have These equations directly showcase the relation between the choice of n for the encoding and the code's performance.Unlike (10), their derivation does not assume large n.
For (n, k) QRLCs, each of the possible 4 n Pauli strings will be associated with one of the S = 2 n−k syndromes.Due to the linearity of the code, the strings will be distributed equally through the syndromes, so that each syndrome will have 2 n+k = SL associated Pauli strings.In fact, for s = 0, the associated strings will amount to all the combinations of the S total stabilizers and the L = 2 2k total logical operators.
When creating a QRLC, it is possible to obtain a degenerate code.For an error pattern E i ∈ E, we obtain a degenerate code when ∃i, j such that i ̸ = j and E i E j ∈ S. In these situations, E i and E j have the same effect on the encoded state and, consequently, can be treated as the same error.For two random error patterns E 1 , E 2 with the same syndrome, the probability of E 1 E 2 being a stabilizer is ∼ 1/L.
For simplicity, we consider a code that can fully correct the error patterns in E a (good) degenerate code, while making no distinction between faulty codes that do or do not present some level of degeneracy.
The probability of obtaining a "good" code, i.e., a code that is capable of correcting all the N error patterns, can be estimated by considering the probability that either the syndrome of E i E j differs from 0 (non-degenerate case) or equals a stabilizer (degenerate case).As there are N +1 2 such E i E j , this probability is given approximately by P (good) ≃ (P (non-degen.)+ P (degen.)) As the probability of obtaining a working non-degenerate code is approximately given by ( 13), the probability of obtaining a Figure 2. Probability of obtaining a "good" code (blue), that corrects all N error patterns, vs. the ratio N/S, for a (16, 1) code, for the maximum noise entropy case.Even if obtaining a good code is unlikely, it still corrects almost all errors, so the probability of a successful correction is high (red).The dots indicate the theoretical approximations given by ( 20), ( 13), (21), and ( 12), respectively, which closely match the observed behavior.
working degenerate code can be estimated by Fig. 2 presents 2000 samples of (16, 1) random codes.Most of the "good" codes are non-degenerate, so every error pattern has its distinct syndrome, but a small percentage may be degenerate, since k = 1 is very low.As expected, the probability of obtaining a code that corrects all N error patterns present quickly decreases with increasing N .Nonetheless, the probability that faulty codes will succeed in correcting any particular error is still high for larger N (red).For the highest shown N/S, with N/S = 0.025, P (success) = 0.99, while P (good) ≃ 0. As noted previously, this large discrepancy between P (success) and P (good) stems from the fact that we may have P (f > 1 − ϵ) ≃ 1 while also having P (f = 1) ≃ 0. 1) Bernoulli process: As an example, we may consider the noise model in which quantum errors consist of a Bernoulli process, with each individual qubit having a probability p of suffering an error.The error can be of type X, Y, or Z (i.e., depolarizing noise), and the error types are identical and independently distributed (i.i.d.) for each qubit.
The number of distinct error patterns of weight t ′ ≤ t is For t ′ < t, as error patterns of weight t ′ are always more likely than error patterns of weight t, for this noise model, then whenever an error pattern of weight t has the same syndrome as a weight-t ′ error pattern, it cannot be corrected.Here, the degenerate scenarios are disregarded, since they are negligible for large k.The expected number of syndromes M t with a weight-t error pattern as the most likely one mapped to them is M t = ⟨u⟩ S,Bt − ⟨u⟩ S,Bt−1 .The correctable error fraction f of weight-t error patterns that can be corrected will be, on average, This expression enables a useful comparison for the performance of QRLCs, as shown in Fig. 3 (and later in figures 5 and 6).

C. Minimum number of random gates
It is important to assess how deep (i.e., number of concatenated gates) the generator circuits need to be such that the QRLC they generate approximates the ideal performance.In order to do so, we have implemented the methodology in [45] and, for a varying number of gates, we measured the relative deviation where the f stands for the fraction of weight-t error patterns a code can correct.f theory amounts to the average correctable fraction coming from the approximation in (12), and f exp is the result of averaging the observed correctable fraction of 31 QRLC samples, for a given number of gates.Similarly, P (f = 1) theory is given by ( 13), and P (f = 1) exp is the ratio of the 31 samples that had f = 1 for weight t = 1.For the noise statistics, we assume a Bernoulli process, as previously described in Section V-B1.
The simulation results presented in Fig. 3 indicate that, as the number of gates used for the encoding increases, so do the codes' correction capabilities, eventually reaching (δ < 0.02) those of the ideal random code.The codes' error correction capabilities start off worse for error patterns of larger weight, but converge to a similar minimum number of gates needed.We considered codes for several n and k to estimate this behavior.These results, shown in Fig. 3, indicate that this minimum number of gates is given by N min.gates = mn log 2 2 (n).From [45], we expect the minimum number of gates to scale with O n log 2 (n) .Although this theoretical result is only proved there for some codes, here we experimentally observe it for the mean (n, k) code (with m ≃ 0.13 − 0.15), which is of more practical relevance, and for the case where we require that all t = 1 error patterns must be correctable (m ≃ 0.21).Consequently, even for larger quantum codes with n = 128, 1000 C 2 Clifford gates should suffice to ensure that the resulting code has a very high performance for that rate and code length.Given that most of these gates will be applied in parallel, with depth O log 3 n , this approach enables the creation of high-capacity codes with low-depth quantum circuits.

D. Determining the stabilizers
The traditional approach in the construction of stabilizer codes is to start by defining the stabilizers, and then find the associated encoding process.The proposal in this paper uses a random code construction, and therefore the first step is the definition of the encoding circuit and only after one determines the stabilizers associated with that particular code.
The construction of a QRLC only involves Clifford unitaries, and therefore the encoding process U is a stabilizer circuit.The Gottesman-Knill theorem indicates that stabilizer circuits with n qubits can be simulated using only O(poly(n)) classical resources (see [62], [63]).From this efficient classical simulation, the desired stabilizers may be extracted [16].In particular, the (n − k) ancilla qubits used for the encoding, in state |0⟩, start by having the associated minimal stabilizers The classical simulation takes these starting stabilizers and modifies them through the encoding U , resulting in the desired minimal stabilizers S i , which can be used for the stabilizer code.

VI. QUANTUM-GRAND PROPOSALS
We are now ready to construct GRAND-inspired decoding techniques to decode QRLCs.This common framework of quantum-GRAND (QGRAND), in the case of stabilizer codes, consists of the steps herein summarized: 1) Generate a random QRLC encoding U , robust to the noise statistics N .This can be efficiently done, for instance, by combining random 2-qubit Clifford unitaries (Sections V-A and V-C); 2) Determine stabilizers of the chosen encoding by efficiently simulating the stabilizer circuit (Section V-D); 3) Perform syndrome measurement using all the minimal stabilizers (Section IV); 4) Apply decoding using an iterative noise guessing recovery procedure, similar to the one in classical GRAND (Section II-A), by applying the inverse of the error pattern determined to the encoded quantum data.These steps can be implemented in slightly different manners, as will be described in the following subsections.

A. The syndrome as membership test
Syndrome measurement setups are a central building block in QEEC [40], [41], [51].As in classical GRAND, the syndrome measurement step of the stabilizer code may be considered simply as a membership test, accepting the quantum state if the syndrome s is zero, and rejecting the error-affected state if s ̸ = 0 (see Fig. 4(a)).If the syndromes associated with each error pattern are not known a priori, then it will be necessary to measure all s = n − k minimal stabilizers to verify if no error has occurred.Since the encoding and subsequent stabilizers are random, it will take only ∼ 2 stabilizer measurements, on average, to obtain a nonzero syndrome bit when an error actually occurred.
For a (n, k) code, we do not necessarily require the measurement of the full syndrome to perform the GRAND iteration procedure.If we are not taking advantage of the information encoded in the syndrome, and wish to use it only as a membership test for the codebook, then we just need to check whether or not the syndrome is nonzero.
As the chosen encoding is random, so are its stabilizers.Consequently, each error pattern has a probability of p = 1/2 of anticommuting (and thereby being detected) by each stabilizer, and this behavior is independent for each error pattern.Therefore, the average number of stabilizers measured until encountering a 1 bit, for some error pattern, is As we generally don't know a priori whether or not an error has occurred at the first iteration, before the trial-and-error correction process commences, there is the possibility that we will need to measure all s minimal stabilizers, in the case with probability p 0 where no error has occurred.In that case, the average number of stabilizer measurements required to determine whether an error has occurred or not will be If an error is observed, then at each iteration i > 0 of the trial-and-error correction attempt, the average number of measurements is C s (p i /q i ), with q i ≜ 1 − i−1 j=0 p j .The average total number of iterations in the trial-and-error procedure, for N error patterns, is I ≜ N i=0 (i + 1)p i .Consequently, the average total number of stabilizer measurements until the procedure is completed is A downside of this approach is that the error correction and syndrome extraction must be applied physically in the quantum circuit at each iteration.As this correction consists of applying E † i = E i to the circuit, and the syndrome extraction step might have a non-negligible number of gates (see Fig. 1), then, for error-prone implementations, this approach may lead to a costly error correction process, as each application of correction gates adds error itself to the encoded state.
For the case without abandonment, the error correction process can fail solely when an observed error pattern has the same syndrome as an error pattern that was more likely to occur, given the noise statistics.This amounts to the scenario where the coset leader chosen for a syndrome is not the error that occurred.As previously alluded to in Section II-A, when abandonment is implemented, a second source of failure is the probability that an unlikely error occurs, beyond the errors that one wishes to correct.Nonetheless, as indicated in Section V-A, n should be chosen to ensure that this probability of failure is low.

B. Syndrome decoding
Alternatively, as long as partial or full access to the actual syndrome is available, one may use that information to improve the error correction process, while still taking advantage of the known noise statistics (see Fig. 4(b)).There are several possible approaches along this route.For instance, one may rely on the classical computation of the syndromes associated with each relevant error pattern, both before and during the correction process.
To take advantage of syndrome decoding, let N P ⊆ N be the set of error patterns for which we wish to precompute and store the error syndrome, and N J = N \N P the error patterns for which we wish to compute the error syndrome on the fly, as necessary.We have N = N P + N J , with N P ≜ |N P |, N J ≜ |N J |.Its N P × s syndrome matrix M S , which stores the N P syndromes, each s-bits long, can be computed by the matrix product of the N P ×2n error matrix M E and the S ×2n parity check matrix A, through M S = M E A T [60].If N P is small, this syndrome matrix can be classically stored in memory.
Additionally, the precomputation of the N P error patterns' syndromes enables checking a priori whether or not our random linear code can distinguish between all the N P error patterns, lest it have more than one relevant error pattern with the same syndrome (cf.Section V-B).Therefore, we may try other random encodings until we are sure that one satisfies the requirements at hand, instead of relying on (10).
Given the random nature of the linear code, it takes, on average, log 2 N P bits to identify each of the N P error patterns, for a total of at most ∼ 2N P bits to store, using a binary tree.To single out a particular error pattern in N , we require, on average, log 2 (N + 1) stabilizer measurements.Note that log 2 (N +1) may be much less than s bits in practice (see (10)).After log 2 (N P + 1) stabilizer measurements, we are likely to rule out almost all error patterns in N P .However, the error patterns in N J have not yet been ruled out.To be sure of which error actually occurred, log 2 (N P + N J + 1) measurements are needed.For that, the syndromes of the other N J error patterns needed to be checked.These are error patterns that we still wish to correct, but whose syndrome we did not keep in memory due to memory constraints.These computations can be performed in parallel, and we only need to compare, and thus compute, on average, < 2 bits among the measured syndrome bits, to check whether one of these error patterns is the measured one.
In the case with abandonment, it is possible that none of the N P or N J error patterns explain the observed syndrome, if the error that occurred was very unlikely and not worth correcting.

C. Ordering the stabilizers
With direct access to the syndrome information, it might be tempting to order the stabilizer measurements so that, at each iteration, there is maximum information gain.However, it can be shown that this costly computation results in negligible savings in the average number of measurements that need to be performed to determine the error (see Appendix A), when compared with a random ordering.Similarly, ordering the stabilizers to try and create a more efficient membership test would also result in minimal improvement in performance.
If s ≫ log 2 (N + 1) > H, one may work with a smaller subset of the s minimal stabilizers, since, on average, we only require log 2 (N + 1) measurements (in the highest entropy case) to determine the error.In this case, it is possible to choose stabilizers that have low weight or that are easier to implement, based on the hardware restrictions.However, this biased sampling may negatively affect performance.In any case, it should be noted that, if the encoding is chosen according to (10), then one should not have s ≫ H.

D. Adapting to changing noise statistics
As the set of noise statistics N takes center stage in the decoding process, QGRAND may be adapted on the fly to suit a changing noise environment, or changing error tolerances.For the latter case, less (more) strict correction expectations can be achieved by discarding (including) some error patterns E i with low associated p i .Similarly, for the former case, if N no longer accurately represents the new noise environment, a new N ′ may be considered, resulting in different errors having correction priority.
If changing N is not sufficient, the code can still be quickly adapted by undoing the old encoding U and implementing a new encoding U ′ , keeping in mind the expected performance indicated by (10), (15), and ( 16).

E. A general approach: beyond stabilized codes
The QGRAND concept is not limited to stabilizer codes.A general high-level implementation of QGRAND-inspired decoders may be applied to other QECCs, consisting of the following steps, as depicted in Fig. 4(c): 1) Preprocessing/Encoding: The initial quantum data, ρ D , is preprocessed by U , possibly composed by ancilla qubits, unitary transformations, and projective measurements, into its encoded version ρ j (with j = 0).ρ j enables the desired operations W j on the quantum data to take place, transforming the state into ρ j>0 .All of these states ρ j , j ≥ 0 should be robust to errors.At desired intermediate steps, the data is verified.3) Iterative correction attempt: A recovery operation R is attempted on the state ρ j .This operation is chosen based on the information I k provided by the previous membership tests, and on the noise statistics N known about the setup a priori.This verification should be reversible, so that subsequent iterations may undo the effects of failed correction attempts.4) Error correction: Steps 2 and 3 are repeated either until no feasible further recovery attempts are possible -leading to a failed correction -or until a membership test indicates that ρ j is now in an acceptable state, and the potential operations W j can resume.

VII. PERFORMANCE VS CODE RATE TRADE-OFF
As motivated in Section V-A, the alteration of quantum states follows a noise model where a quantum state σ, in density matrix form, gets transformed into After measuring some syndrome s, and applying the associated correction (either directly, if possible, or by iteratively guessing), we obtain the corrected state.Unlike the classical case, where bit-flip errors definitely map a codeword to a different word, in the quantum case the error's actual effect will depend on the original quantum data |ψ⟩, and it may go from doing nothing to mapping |ψ⟩ to an orthogonal quantum state.As an example, consider k = 1 and only the error Z.If which may be any value from zero (if |α| = |β|) to one (if |α| or |β| equal one).As we wish to determine an estimate of the QGRAND's performance which is independent of the initial quantum data of interest, we may estimate a lower bound F min for the fidelity of the corrected state, averaged over the noise probability distribution, for any given initial quantum state.A straightforward lower bound may be obtained by considering the worst-case scenario, where all errors in E (except E 0 = I) map the initial quantum data to an orthogonal state, resulting in F = 0 if an error occurs.Therefore, we have the lower bound with C the set of indices for error patterns that can be successfully corrected by the code.C non−degen.⊆ C considers only errors that are correctable thanks to a distinct syndrome, and not thanks to code degeneracy. 1 − F min turns out to be further lower bounded by the block error rate (BLER) in classical error correction, with the difference resulting from code degeneracy.Since the probability of an error being degenerate roughly scales with 1/L = 1/2 2k (cf.Section V-B), this possibility can be disregarded for moderate or high k.
Nonetheless, by computing the BLER, our results slightly underestimate the codes' performance for very low values of k.
The error probability associated with quantum communications and quantum computation is typically in the order of 10 −3 − 10 −1 ( [67]- [69]), higher than what is usually encountered in classical applications.For fault-tolerant computation, it is estimated that an error probability below ∼ 10 −2 would be required [12].To motivate the use of QGRAND for near-future applications, for this work, we consider error probabilities in this range.
Figures 5 and 6 show how both the block error rate (BLER, which is an upper bound to the infidelity in the quantum setting) and the fraction of error patterns of weight t evolve as a function of the code rate for QRLCs with codeword lengths n = 128 and n = 32, respectively.
These results are obtained semi-analytically, as the QRLCs are constructed randomly, but their performance is computed exactly from each QRLCs' list of minimal stabilizers, represented by the parity check matrix A. The implementation uses the Python package Qiskit.For n = 128, we compute 31 samples for each k ≥ 90.For n = 32, all k are considered.For each sample, a QRLC with the indicated number of gates (it varies for n = 128, and it is always 2000 for n = 32) is constructed.Its performance is obtained by summing the probabilities p i of the most likely error patterns E i ∈ E associated with each syndrome.These are the error patterns that can, in fact, be corrected by QGRAND (disregarding degeneracies).The syndrome of each error is efficiently computed as s i = M Ei A T , with M Ei the binary matrix representation of E i .Only error patterns up to the desired weight t are considered; thus N = B t as in (22).
As the code rate increases, the code manages to correct fewer and fewer error patterns, with an error rate approaching the case where no error can be corrected.Lower code rates eventually plateau for each weight t, as the codes can eventually correct all error patterns with that weight.As expected from Fig. 3, if the encoding has too few C 2 gates, it is not expressive enough to reach the performance of an ideal random code (marked by dots, ( 23)), but, as more gates are used, the observed performance of these QRLCs matches it, qualitatively suggesting that GRAND's results for uniform-at-random codes may be applicable to quantum random encodings.Note that the variance of the code performance also decreases with an increasing number of gates, indicating that a good code is obtained with high probability.
Approximating QRLCs by their ideal counterparts, we may estimate their performance's dependence on the noise probability.As seen in Fig. 7, increasing n improves the code's performance, with a lower p observing greater improvements.The ideal approximation from Section V-B (dots) continues to provide a quick and good estimate of QGRAND's performance.

VIII. CONCLUSIONS AND FUTURE DIRECTIONS
This work introduced a novel approach to quantum error correction by bringing together quantum random linear encod- ing and noise guessing decoding, considering a system model with channel errors only, as a first extension of the GRAND concept to the quantum realm.QGRAND is particularly suitable for codes with short codewords, or with high code rate, as highlighted in [52, sec.VI-B].Given the difficulties of manipulating large quantities of qubits, this type of error protection seems particularly fit to the presently envisaged quantum technologies requiring error correction, such as the transmission of quantum entanglement, quantum repeaters, quantum memories, and quantum computing.
It was first verified by numerical simulations that the construction leading to random quantum codes can be efficiently implemented, even outside the regime with theoretical guarantees.Although we focus on the case of all-to-all qubit connectivity, this method can be easily generalized to more restrictive connectivities.A possible approach would be to limit the 2-qubit gates composing the encoding to only connect pairs of qubits with a direct connection.Employing higher circuit depths to achieve similarly powerful encodings, and limiting the stabilizer weight [16] would enable versatile practical implementations.
By taking advantage of the noise statistics, known from the medium at hand, an efficient and flexible decoding process is obtained.One may even consider a scenario where the syndrome measurements are not promptly available, and rather there is only access to a membership test, flagging whether the syndrome is zero or not.The QGRAND methodology is generalizable beyond stabilizer codes, and is suitable for time-variant noise statistics and changing setup requirements, updated on the fly.
In the quantum setting, we may consider different forms of abandonment.In the classical GRANDAB approach, the iterative noise guessing process is stopped after a chosen number of attempts, depending on the noise entropy.In the case where the syndrome information is being actively used, we may not only stop testing error patterns after a given threshold, but we may also stop measuring stabilizers after a given number of measurements, if the conducted measurements rule out all but very unlikely errors.In general, we expect the QGRAND approach to be directly amenable to the GRANDAB formalism.This work considered QECCs mostly for quantum communications and quantum memories, where the errors mostly arise during the quantum state transmission or storage.However, in contexts such as quantum computation, the errors during the encoding and decoding process themselves may be of the same order of magnitude as those encountered in the intended computations, and therefore, an important research question is to find how robust the whole encoding-decoding chain is when considering such errors in the system model.The first step should be assessing the impact of imperfect measurements when obtaining the syndrome, and how the binary decision they control (i.e., the membership test) is perturbed.The application and efficiency of QGRAND (and GRANDAB) for practical applications with limited qubit connectivity, and also in the context of fault-tolerant systems, is the subject of ongoing work.
APPENDIX A STABILIZER ORDER For the syndrome decoding process, we may choose the order in which we apply the stabilizers.For a random ordering of the s minimal stabilizers, it will take, on average, measuring ∼ log 2 (N + 1) stabilizers to identify which specific error pattern in E has occurred.If the syndrome is only being used as a membership test, then one needs to distinguish each error pattern in E × E, which takes ∼ 2 log 2 (N + 1).
Instead of choosing the stabilizer ordering at random, we may try to choose the stabilizer with highest information gain, which, thanks to the random assignment of syndromes to error patterns, will likely correspond to the stabilizer with which the most error patterns anticommute.
Using this information, one may precompute a decision tree that maximizes the information gain at each measurement step.An example can be seen in Fig. 8, where we see the average number of stabilizers required to determine the error that occurred, or if no error occurred at all, for different error distributions, as a function of the noise entropy H(N ).The shaded region marks one standard deviation.Random (30, 1) codes are used, and only error patterns of weight t = 1 are considered.When all cases are equally likely and the entropy is maximal, the decision tree method will require about the same number of stabilizers, log 2 (N +1) (black solid line), as the naïve method, where the stabilizers are chosen at random.For lower entropy distributions, only minor savings can be achieved.In the limit of zero entropy, where no errors can occur, fewer stabilizers are required (with the minimum given by the dashed line, computed using (33)).The decaying and constant distributions correspond to {p i = exp(−αi)} and {p i = ϵ, p 0 = 1 − N ϵ}, respectively, with both distributions normalized and α, ϵ chosen so as to form a probability distribution with the indicated Shannon entropy H(N ).
This approach might even be used to create a membership test requiring a smaller number of stabilizers.However, here we show that such a procedure will lead to very minor savings in the necessary number of iterations, when compared with the straightforward random ordering.
Let X i be the distribution for the number of error patterns in E that anticommute with stabilizer S i ∈ S min .Then,  approximately, X i ∼ Binomial(N, 1/2), using the binomial distribution.For large N , X i can be approximated by the normal distribution Normal(n/2, n/4).The stabilizer that can detect the highest number of error patterns, will detect on average Z ∼ max i X i error patterns.By Jensen's inequality, its expected value is upper-bounded by µ + σ √ 2 ln s = n/2 + (n/2) ln s.Assuming that the stabilizer chosen for each iteration matches this upper bound and the X i distributions are independent, we have N j error patterns remaining at iteration j, on average, when starting with N error patterns.The recursion relation is given by An approximate lower bound for the minimum number of measurements is given by I, such that N I ≃ 1.This bound is not exact as the substitution of the binomial distribution for a normal distribution is only valid for large N j , which necessarily cannot hold for j ≫ 1.Nonetheless, it provides us with a simple rule of thumb to check whether the ordering approach can potentially have large savings in measurements.Using A j ≜ N j /2, we have By solving this recursion relation, it can be shown that the number of iterations required will be, approximately, for large N and s, I ≃ log 2 N − log 2 log 2 s − 1.
(35) Fig. 9 provides numerical confirmation of that.Suppose that our setup follows (10), so that s ∝ log 2 N .As N increases, we expect no significant increase in savings for the number of iterations, when compared with the approach of picking stabilizers at random, which takes ∼ log 2 N iterations.Thus, it is not justifiable, in practice, to compute a syndrome table to construct a decision tree leading to the highest information gain per iteration, as the gains are negligible.

Figure 1 .
Figure 1.Quantum circuit for a (n, k) stabilizer code, depicting the encoding and decoding process.

t = 1 ,
Figure (a) Relative deviation δ, for different (n, k) codes and error patterns of weight t.The shaded region indicates the 80% confidence interval, obtained by constructing 31 random codes for each case presented.(b) Minimum number of gates to achieve a relative deviation δ < 0.02, for varying n log 2 2 (n).

Figure 4 .
Figure 4. Flowchart of QGRAND, when (a) using the syndrome solely as a membership test, or (b) also as an aid for decoding.Going beyond stabilizer codes, (c) QGRAND may also be employed in a more general context.

Figure 5 .
Figure 5. BLER and correctable error fraction f for QRLCs with n = 128, considering p = 10 −2 , when trying to correct error patterns of weight up to t = 3. Top curves: BLER, with shaded areas marking an 80% confidence interval.Bottom curves: fraction f of error patterns of weight t that can be corrected by the code, for a given code rate.

Figure 6 .
Figure 6.BLER and correctable error fraction for QRLCs with n = 32, considering different p values, when trying to correct error patterns of weight up to t = 3. Top curves: BLER, with an overall behavior similar for both p = 10 −2 and p = 10 −3 , but the lower p enables 2 to 3 orders of magnitude lower error rate.Bottom curves: fraction f of error patterns of weight t that can be corrected by the code, for a given code rate.This value is independent of p.

Figure 7 .
Figure 7. Codes' performance as a function of the probability p of each qubit suffering an error for different code lengths n, with R = 0.7.A Bernoulli noise model is used.

Figure 8 .
Figure 8.Average number of stabilizers required to determine the error that occurred, or if no error occurred at all, for different error distributions, as a function of the noise entropy H(N ).The shaded region marks one standard deviation.Random (30, 1) codes are used, and only error patterns of weight t = 1 are considered.

Figure 9 .
Figure 9. Expected number of iterations, using the decision tree method, for large N and s.Using I = a log 2 N − b log 2 log 2 s − c, a least squares fit obtains the parameters (a, b, c) = (0.96, 0.91, 0.84), which is approximately in agreement with(35).
which act on |ψ⟩ L similarly to X i , Z i on |ψ⟩ D , and which can be combined to form a total of L ≜ 2 2k logical operators.Suppose that a Pauli error string E affects |ψ⟩ L , resulting in |ψ⟩ L = E |ψ⟩ L .If we conditionally apply a stabilizer to |ψ⟩ L ,

2 )
Data verification: A membership test is performed to verify if the encoded state ρ j has been corrupted by errors beyond the maximum tolerable error weight -fail case -or if it is still in a state acceptable for further operations -pass case.Depending on the implementation, the membership test may provide further information I i about the failure, facilitating its subsequent correction.Note that the use of the membership test may itself modify ρ j , as long as this modification simply aids the correction, and does not induce further significant errors in ρ j .