Introduction

Quantum error correction (QEC) promises to unlock the full potential of quantum technologies by combating the detrimental effects of noise in quantum systems. The ultimate goal in QEC is to protect quantum information under realistic noise models. However, QEC is most often studied by abstracting away the underlying physics of actual quantum systems, and assumes a simple stochastic Pauli noise model, as opposed to coherent errors which are much more realistic.

Coherent errors are unitary operations that damage qubits collectively, and are ubiquitous in many quantum systems. Especially pertinent are coherent phase errors that occur on any quantum system that comprises non-interacting qubits with identical energy levels. In such systems, coherent phase errors can result from unwanted collective interactions with stray fields1, collective drift in the qubits’ energy levels, and fundamental limitations on the precision in estimating the magnitude of the qubits’ energy levels. To address coherent errors, prior work either (1) analyzes how existing QEC codes perform under coherent errors without any mitigation of the coherent errors, (2) uses active quantum control which incurs additional resource overheads to mitigate coherent errors offers partial immunity against coherent errors2 or (3) completely avoids coherent errors using appropriate decoherence-free subspaces (DFS)3,4,5,6,7,8,9,10,11. In this paper, we focus on a family of QEC codes that are compatible with approach (3), and discuss performing QEC protocols with respect to this family of QEC codes.

To completely avoid coherent phase errors, quantum information can be encoded into a constant-excitation (CE) subspace4,7,11, which is a DFS of any Hamiltonian that describes an ensemble of identical non-interacting qubits. Given the promise of CE QEC codes to completely avoid coherent phase errors, these codes have been studied within both qubit3,4,5,6,7,9,10 and bosonic11,12,13,14 settings. Such codes either additionally avoid other types of coherent errors4,5, or can combat against other forms of errors3,6,7,9,10,11,12,13,14. However, qubit CE QEC codes lack a full-fledged QEC analysis, where explicit encoding, decoding circuits, and QEC circuits remain to be constructed. This impedes the adoption of CE codes in a fault-tolerant QEC setting.

In this paper, we give an accessible procedure to construct QEC codes that not only completely avoid coherent phase errors, but also support fault-tolerant quantum computation. Namely, we concatenate stabilizer codes \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) with a length two repetition code \({{\mathcal{C}}}_{{\mathtt{REP}}2}\), and apply a bit-flip on half of the qubits. We can also naturally interpret these codes within the codeword stabilized (CWS) framework15,16, thereby extending the utility of CWS codes beyond a purely theoretical setting.

Amplitude damping (AD) errors model energy relaxation, and accurately describe errors in many physical systems. By concatenating the four-qubit AD code17 with the dual-rail code18, we construct an eight-qubit CE code that corrects a single AD error. We provide this code’s QEC circuits (Figs. 3 and 4), and analyze its potential as a quantum memory under the AD noise model (Fig. 5).

Our work paves the way towards integrating CE codes with mainstream QEC codes. By doubling the number of qubits required, we make any quantum code immune against coherent phase errors. When coherent phase errors are a dominant source of errors, we expect CE codes to significantly reduce fault-tolerant overheads.

Results

Hybridizing stabilizer and CE codes

Coherent phase errors can arise from the collective interaction of identical qubits with a classical field. Since the collective Hamiltonian of non-interacting identical qubits is proportional to Sz = Z1 +  + ZN where Zj flips the jth qubit’s phase, we model coherent phase errors with unitaries of the form \({U}_{\theta }=\exp (-i\theta {S}^{z})\). Here, θ depends on both the interacting field’s magnitude and the qubits’ energy levels.

Using any CE code, we can completely avoid coherent phase errors. This is because such codes must lie within an eigenspace of Sz, which is spanned by the computational basis states \(\left|{\bf{x}}\right\rangle =\left|{x}_{1}\right\rangle \otimes \cdots \otimes \left|{x}_{N}\right\rangle\) for which the excitation number, given by the Hamming weight wt(x) = x1 +  + xN of x, is constant. The simplest CE code is the dual-rail code18, \({{\mathcal{C}}}_{{\mathtt{KLM}}}\), with logical codewords \(\left|{0}_{{\mathtt{KLM}}}\right\rangle =\left|01\right\rangle\) and \(\left|{1}_{{\mathtt{KLM}}}\right\rangle =\left|10\right\rangle\).

However, \({{\mathcal{C}}}_{{\mathtt{KLM}}}\) cannot correct any errors. Therefore, we concatenate it with an [[n, k, d]] stabilizer code \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) to obtain a code \({\mathcal{C}}\) with encoding circuit given in Fig. 1. Then \({\mathcal{C}}\) is an [[2n, k, d]] QEC code that is also impervious to coherent phase errors. Now, concatenating any state \({\sum }_{{\bf{x}}\in {\{0,1\}}^{n}}{a}_{{\bf{x}}}\left|{\bf{x}}\right\rangle \in {{\mathcal{C}}}_{{\mathtt{Stab}}}\) with \({{\mathcal{C}}}_{{\mathtt{KLM}}}\) yields \({\sum }_{{\bf{x}}\in {\{0,1\}}^{n}}{a}_{{\bf{x}}}\left|\varphi ({\bf{x}})\right\rangle\), where φ((x1, x2, …, xn−1, xn)) = (x1, 1 − x1, x2, 1 − x2, …, xn−1, 1 − xn−1, xn, 1 − xn). Since wt(φ(x)) = n for every x {0, 1}n, it follows that the concatenated state must be an eigenstate of Sz with the same eigenvalue. Hence, \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is a CE code, and therefore avoids coherent phase errors.

Fig. 1: Encodings of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) from the encoding EStab of \({{\mathcal{C}}}_{{\mathtt{Stab}}}\).
figure 1

On the right side, CNOTs apply transversally to each pair of control and target qubits in the code blocks. The permutation π maps the jth qubit in the first block of n qubits to the (2j − 1)th qubit and the jth qubit in the second block of n qubits to the (2j)th qubit.

The code \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is very similar to \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\), which is \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) concatenated with a length two repetition code \({{\mathcal{C}}}_{{\mathtt{REP}}2}\) that maps \(\left|0\right\rangle\) to \(\left|00\right\rangle\) and \(\left|1\right\rangle\) to \(\left|11\right\rangle\). Since \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}=R{{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) where R = (IX)n, and I and X denote the identity and bit-flip operations on a qubit respectively, \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is equivalent to \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) up to the Pauli rotation R and we call \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) a rotated-stabilizer code.

We can also cast \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) within the CWS framework by deriving its word stabilizer and word operators. Since \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) and \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) are equivalent up to R, it suffices to derive \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\)’s word stabilizer and word operators. Namely, \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) and \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) have identical word stabilizers generated by the stabilizer and logical Z operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\). Moreover, the word operators \({w}_{1},\ldots ,{w}_{{2}^{k}}\) of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) are its logical X operators and the word operators \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) are \(R{w}_{1},\ldots ,R{w}_{{2}^{k}}\). We supply explicit constructs of the word stabilizer and word operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) in “Methods” section.

The code \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) inherits its logical operators from the logical operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\). Given any single-qubit logical operator U on \({{\mathcal{C}}}_{{\mathtt{Stab}}}\), the corresponding unitary LREP2(U) on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) is given in Fig. 2a. Then the corresponding logical operator on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is \(\tilde{U}=R{{\rm{L}}}_{{\mathtt{REP}}2}(U)R\). Similarly, given an m-qubit logical operator Um on \({{\mathcal{C}}}_{{\mathtt{Stab}}}\), the corresponding logical operator on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) is LREP2(Um) (Fig. 2b), and the corresponding logical operator on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is RmLREP2(Um)Rm. If U is a tensor product of single-qubit Pauli gates, then \(\tilde{U}\) is also a tensor product of single-qubit Pauli gates. Hence, if \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) has transversal gates comprising of single-qubit Paulis, then \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) also has corresponding transversal gates of the same form. If Um is a diagonal unitary in the computational basis, then \({\tilde{U}}_{m}={\pi }_{m}^{\dagger }({U}_{m}\otimes {I}^{\otimes nm}){\pi }_{m}\) is also the logical operator on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\).

Fig. 2: Logical operators for \({\mathcal{C}}_{{\text{Stab}},{\text{REP2}}}\).
figure 2

Given single-qubit and multi-qubit logical operators of \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) denoted by U and Um, respectively, we obtain corresponding logical operators for \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) in a and b, respectively. The permutation πm maps the jth qubit in the first block of mn qubits to the (2j − 1)th qubit and the jth qubit in the second block of mn qubits to the (2j)th qubit.

To design error-correction procedures for \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\), we leverage on the error-correction procedures of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) and the interpretation that \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) with an effective R error. We can extract the syndrome of a Pauli error E acting on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) by measuring eigenvalues of Pauli observables. These Pauli observables can be generators associated with \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\)’s stabilizer, and these generators are derived easily from the generators of \({{\mathcal{C}}}_{{\mathtt{Stab}}}\); if G1, …, Gnk are \({{\mathcal{C}}}_{{\mathtt{Stab}}}\)’s stabilizer’s generators, then \({\bar{G}}_{1},\ldots ,{\bar{G}}_{2n-k}\) generate \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\)’s stabilizer, where \({\bar{G}}_{i}={{\rm{L}}}_{{\mathtt{REP}}2}({G}_{i})\) for i = 1, …, n − k and \({\bar{G}}_{n-k+j}={Z}_{2j-1}{Z}_{2j}\) for j = 1, …, n. We complete the QEC procedure by using measured eigenvalues of \({\bar{G}}_{1},\ldots ,{\bar{G}}_{2n-k}\) to estimate the Pauli error \(E^{\prime}\) that could have occurred, and reverse its effect.

The generator \({\bar{G}}_{j}\)’s eigenvalue on \(E\left|\psi \right\rangle\) for \(\left|\psi \right\rangle \in {{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) when measured is \({\theta }_{j}={(-1)}^{{s}_{j}}\) for some sj = 0, 1. Here, sj = 0 when \({\bar{G}}_{j}\) and ER commute and sj = 1 otherwise. Now, denote the eigenvalue of \({\bar{G}}_{j}\) on \(R\left|{\psi }_{{\mathtt{KLM}}}\right\rangle \in {{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) as \({(-1)}^{{r}_{j}}\) for some rj = 0, 1. Whenever E = I2n, we have rs = 0 where r = (r1, …, r2nk) and s = (s1, …, s2nk). Using rs, we estimate the error \(E^{\prime}\) that could have occurred on \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\). For this, we use any decoder DecStab,REP2 that maps a syndrome vector obtained from a corrupted state of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) to an estimated Pauli error. Such a decoder DecStab,REP2 can be a maximum likelihood decoder19,20 or a belief propagation decoder21,22,23. Explicitly, our code \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\)’s decoder has the form

$${{\mathtt{Dec}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}({\bf{s}})={{\mathtt{Dec}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}({\bf{r}}\oplus {\bf{s}}),$$
(1)

and thereby inherits its performance from the decoder DecStab,REP2 on the stabilizer code \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\).

Now let us introduce some terminology related to the decoding of stabilizer codes. Denoting the single-qubit Pauli operators as I, X, the phase-flip operator Z, and Y = iXZ, the set of n-qubit Pauli operators is {I, X, Y, Z}n. Define bin(P) = (ab) as a 2n-bit binary vector where a = (a1, …, an) and b = (b1, …, bn) are n-bit binary vectors such that \(P=w{X}^{{a}_{1}}{Z}^{{b}_{1}}\otimes \cdots \otimes {X}^{{a}_{n}}{Z}^{{b}_{n}}\) for some w = ±1, ± i. Given any two Pauli matrices P and \(P^{\prime}\) with binary representations bin(P) = (a, b) and \({\rm{bin}}(P^{\prime} )=({\bf{a}}^{\prime} ,{\bf{b}}^{\prime} )\), their symplectic inner product24 over \({{\mathbb{F}}}_{2}\) i s defined to be \({\langle {\rm{bin}}(P),{\rm{bin}}(P^{\prime} )\rangle }_{{\rm{sy}}}={\bf{a}}\cdot {\bf{b}}^{\prime} +{\bf{a}}^{\prime} \cdot {\bf{b}}\).

To see how to decode our concatenated code, note that

$$\begin{array}{lll}{r}_{j}\,=\,{\langle {\rm{bin}}({\bar{G}}_{j}),{\rm{bin}}(R)\rangle }_{{\rm{sy}}},\\ {s}_{j}\,=\,{\langle {\rm{bin}}({\bar{G}}_{j}),({\rm{bin}}(E)+{\rm{bin}}(R))\rangle }_{{\rm{sy}}},\end{array}$$
(2)

By linearity of the inner product, it follows that \({r}_{j}\oplus {s}_{j}={\langle {\rm{bin}}({\bar{G}}_{j}),{\rm{bin}}(E)\rangle }_{{\rm{sy}}}\). This shows that \({(-1)}^{{r}_{j}\oplus {s}_{j}}\) is equal to the eigenvalue of Gj when measured on \(R\left|\psi \right\rangle\), the latter of which is a state in \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\), from which we can deduce (1).

When stochastic errors evolve under the influence of \({U}_{\theta }=\exp (-i\theta {S}^{z})\), their weight is preserved. First, note that

$${U}_{\theta }=\mathop{\prod }\limits_{j=1}^{N}\exp (-i\theta {Z}_{j})=\exp {(-i\theta Z)}^{\otimes N}.$$
(3)

Then, for any N-qubit Pauli matrix P = P1PN, we have that

$$\tilde{P}={U}_{\theta }P{U}_{\theta }^{\dagger }=\mathop{\bigotimes }\limits_{j=1}^{N}\exp (-i\theta Z){P}_{j}\exp (i\theta Z).$$
(4)

When Pj = I or Z, we clearly have \(\exp (-i\theta Z){P}_{j}\exp (i\theta Z)={P}_{j}\). When Pj = X or Y, we have \(\exp (-i\theta Z){P}_{j}\exp (i\theta Z)=\exp (-2i\theta Z){P}_{j}\). For any value of θ, \(\exp (-2i\theta Z)X\) and \(\exp (-2i\theta Z)Y\) are never the identity operator. Hence we can see that the weight of \(\tilde{P}\) is identical to the weight of P. By performing stabilizer measurements, the error \(\tilde{P}\) gets projected randomly onto some Pauli of weight equal to the weight of P, if this weight is no greater than half of the code’s distance, it can be corrected according to the earlier-described decoding procedure.

We now show that \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) has a positive fault-tolerant threshold when \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) is a Calderbank–Shor–Steane (CSS) code25,26 that encodes a single logical qubit and has transversal logical Pauli I, X, Y, and Z gates given by \(\bar{I}={I}^{\otimes n}\), \(\bar{X}={X}^{\otimes n}\), \(\bar{Y}={Y}^{\otimes n}\) and \(\bar{Z}={Z}^{\otimes n}\), respectively. (also with transversal Hadamard.) First, \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) has transversal logical Pauli and controlled-not (CNOT) gates. Then \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) has transversal logical X and Z gates given by \({\bar{X}}_{{\mathtt{REP}}2}={\bar{X}}^{\otimes 2}={X}^{\otimes 2n}\) and \({\bar{Z}}_{{\mathtt{REP}}2}=\pi (\bar{Z}\otimes \bar{I}){\pi }^{\dagger }\), respectively, and logical CNOT gate \({\overline{{\rm{CNOT}}}}_{{\mathtt{REP}}2}\) given by 2n transversal CNOT gates. Thus, \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) has its logical X and Z operators given by \({\bar{X}}_{{\mathtt{KLM}}}=R{\bar{X}}_{{\mathtt{REP}}2}R={X}^{\otimes 2n}\) and \({\bar{Z}}_{{\mathtt{KLM}}}=R{\bar{Z}}_{{\mathtt{REP}}2}R={(-1)}^{n}{Z}_{{\mathtt{REP}}2}\), respectively. Furthermore, the logical CNOT gate of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) has the form \({\overline{{\rm{CNOT}}}}_{{\mathtt{KLM}}}=(R\otimes R){\overline{{\rm{CNOT}}}}_{{\mathtt{REP}}2}(R\otimes R)={\overline{{\rm{CNOT}}}}_{{\mathtt{REP}}2}.\) Second, since we can perform these transversal CNOTs and have stabilizers that correspond to a CSS code, we can measure syndromes and logical Paulis fault-tolerantly using Steane’s method for CSS codes27. Relying on gate-teleportation techniques28, we can implement all Clifford and non-Clifford gates fault-tolerantly. Since the fault-tolerant logical operations will have a finite number of circuit components, using the method of counting malignant combinations in extended rectangles29 yields a positive fault-tolerant threshold for stochastic noise.

An amplitude damping CE code

The simplest CE code that detects AD errors is the four-qubit \({{\mathcal{C}}}_{{\mathtt{ABC}}+}\) code6. AD errors are introduced by an AD channel \({{\mathcal{A}}}_{\gamma }\), which has Kraus operators \({A}_{0}=\left|0\right\rangle \langle 0| +\sqrt{1-\gamma }| 1\rangle \left\langle 1\right|\) and \({A}_{1}=\sqrt{\gamma }\left|0\right\rangle \left\langle 1\right|\). These Kraus operators model the damping an excited state’s amplitude and the relaxation of an excited state to the ground state with probability γ. While \({{\mathcal{C}}}_{{\mathtt{ABC}}+}\) detects a single AD error, it cannot correct any AD errors. Other CE codes that can correct some AD errors have been designed, but either have overly complicated encoding and QEC circuits3, or lack explicit QEC circuits5,7,8,9,10.

Here, we present a CE code that is the concatenation of the four-qubit AD code \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\)17 with \({{\mathcal{C}}}_{{\mathtt{KLM}}}\), and permute the qubits to get \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) with logical codewords

$$\begin{array}{l}\left|{0}_{L}\right\rangle =(\left|11110000\right\rangle +\left|00001111\right\rangle )/\sqrt{2}\\ \left|{1}_{L}\right\rangle =(\left|00111100\right\rangle +\left|11000011\right\rangle )/\sqrt{2}.\end{array}$$
(5)

We elucidate the connection between \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\), \({{\mathcal{C}}}_{{\mathtt{ABC+}}}\), \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\), \({{\mathcal{C}}}_{{\mathtt{KLM}}}\), and \({{\mathcal{C}}}_{{\mathtt{REP2}}}\) in Fig. 3b. We prove that \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) corrects a single AD error by verifying that the Knill–Laflamme QEC criterion30 holds with respect to the Kraus operators K1, …, K8 and \({A}_{0}^{\otimes 8}\) where Ka denotes an n-qubit operator that applies A1 on the ath qubit and A0 on each of the remaining qubits. The simplicity of \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) allows for the direct construction of a simple error-correction strategy for AD errors, without referring to the properties of \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\), \({{\mathcal{C}}}_{{\mathtt{ABC+}}}\), and \({{\mathcal{C}}}_{{\mathtt{KLM}}}\).

Fig. 3: An amplitude damping CE code, its relationship with other codes, encoding circuits and logical computations.
figure 3

a A table of various CE and stabilizer codes. The logical codewords are listed without their normalization factors. REP2 is the two-qubit repetition code, KLM is the dual-rail code18, LNCY code is the four-qubit AD code17, a up to a permutation of qubits, ABC+ is a four-qubit CE code6, 2LNCY is LNCY concatenated with REP2 and is a step to obtain our construct, and the 8qubit code is our eight-qubit code. b We depict the relationship between the codes in a pictorially. Here Xj denotes a bit ip on the jth qubit. c State preparation circuits for \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\), such as \(\left|{0}_{L}\right\rangle\) and \(\left|{+}_{L}\right\rangle\) and the logical encoding of an arbitrary logical codestate. d Logical computations on \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\) are depicted. Here, Rz(θ) = eiZθ. The logical Hadamard is performed via logical gate-teleportation after preparing a logical \(\left|{+}_{L}\right\rangle\) ancilla. aThe four-qubit AD code is also a subcode of the [[4,2,2]] code.

In Fig. 3, we illustrate accessible constructs for \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\)’s encoding circuits and logical computations. In Fig. 4, we give decoding procedures when an AD error is detected. We measure the eigenvalues m1, m2, m3, and m4 of the respective operators Z1Z2, Z3Z4, Z5Z6, and Z7Z8 to determine if any AD error has occurred. Denoting ba = (1 − ma)/2 for a = 1, …, 4, we have five correctible outcomes with respect to the syndrome vector b = (b1, b2, b3, b4). When b = 0, the codespace is damped uniformly and no AD error has occurred. When b has a Hamming weight equal to one, each logical codeword is mapped to a unique product state, and we can ascertain that exactly one AD error must have occurred. When ba = 1 and the other syndrome bits are zero, an AD error must have occurred on either the (2a − 1)th or the (2a)th qubit. Since the effect of an AD error on the (2a − 1)th and (2a)th qubit is identical, this makes \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) a degenerate quantum code with respect to AD errors, and explains why \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) has five correctible outcomes as opposed to nine if it were non-degenerate. The elegant structure of the four corrupted codespaces with a single AD error aids our construction of decoding circuits for \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) (see details in the “Methods” section).

Fig. 4: Syndrome extraction and decoding of \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\).
figure 4

The syndrome vector is b = (b1; b2; b4; b4) = (1 − (m1; m2; m3; m4))/2. If the Hamming weight of the syndrome vector is one, we can still correctly decode the logical qubit. For this, we discard four qubits and subsequently employ the same decoding circuit up to a permutation. If the Hamming weight of b is 0, we can use any of the above decoding circuits.

We illustrate \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\)’s performance as a quantum memory assuming perfect encoding and decoding and that AD errors only occur during the memory storage. We calculate probabilities ϵ and ϵbase of having uncorrectable AD errors occurring on \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) and an unprotected qubit after T applications of \({{\mathcal{A}}}_{\delta }^{\otimes 8}\) and \({{\mathcal{A}}}_{\delta }\) respectively. Since the transmissivity (1 − δ) of an AD channel \({{\mathcal{A}}}_{\delta }\) is multiplicative under composition, (1 − ϵbase) = (1−δ)T and

$$\epsilon =1-{(1-{\epsilon }_{{\rm{base}}})}^{8}-8{\epsilon }_{{\rm{base}}}{(1-{\epsilon }_{{\rm{base}}})}^{7}\le 28{\epsilon }_{{\rm{base}}}^{2}.$$
(6)

Whenever \(28{\epsilon }_{{\rm{base}}}^{2}\le {\epsilon }_{{\rm{base}}}\), it is advantageous to use \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\). Hence, whenever T ≤ T*, where

$${T}^{\star }=\frac{{\rm{log}}(27/28)}{{\rm{log}}(1-\delta )},$$
(7)

using \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) is advantageous as compared to leaving a qubit unprotected (Fig. 5).

Fig. 5: Failure probability of using \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\) and an unprotected qubit versus the number of timesteps when exposed to AD errors.
figure 5

The baseline error probability is ϵbase and the logical error probability is ϵ. At each timestep, \({{\mathcal{A}}}_{\delta }\) afflicts each qubit with δ = 10−4. When the target failure probability is 0.01, using \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\) increases the number of timesteps T from about 100 to 200. When the target failure probability is over 0.0424, there is no advantage in using \({{\mathcal{C}}}_{8{\mathtt{qubit}}}\).

Discussion

When coherent phase errors occur more frequently than stochastic errors, we expect CE codes to outperform generic QEC codes. For future work, the numerical fault-tolerant thresholds of our codes can be calculated when the noise model is a convex combination of stochastic errors and coherent phase errors. In particular, the outer codes could be chosen to be surface codes31,32,33, quantum LDPC codes34,35 and Aliferis–Preskill concatenated codes for biased noise36. One can also study other choices for the inner codes in our construction to obtain concatenated codes with different structures and residing in different types of decoherence-free subspaces. For instance, we can consider other CE codes37, quantum codes that avoid exchange errors38,39,40,41,42, and quantum codes that avoid other different errors4,5,8,18,43.

Methods

Our CE code as a CWS code

Here, we derive the word stabilizer and word operators of our CE code \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\). Now denote SStab as the stabilizer of \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) and G1, …, Gnk as its generators. Then the operators LREP2(Gi), Z2j−1Z2j generate \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\)’s stabilizer where i = 1, …, n − k and j = 1, …, n. Denoting the logical X and Z operators of \({{\mathcal{C}}}_{{\mathtt{Stab}}}\) as \({\bar{X}}_{1},\ldots ,{\bar{X}}_{k}\) and \({\bar{Z}}_{1},\ldots ,{\bar{Z}}_{k}\) respectively, the logical X and Z operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) are given by \({{\rm{L}}}_{{\mathtt{REP}}2}({\bar{X}}_{1}),\ldots ,{{\rm{L}}}_{{\mathtt{REP}}2}({\bar{X}}_{k})\) and \({{\rm{L}}}_{{\mathtt{REP}}2}({\bar{Z}}_{1}),\ldots ,{{\rm{L}}}_{{\mathtt{REP}}2}({\bar{Z}}_{k})\), respectively. Since \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) is a stabilizer code, its word stabilizer of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) is

$$W=\left\{{S}_{{\mathtt{Stab}},{\mathtt{REP}}2}^{a}\mathop{\prod }\limits_{j=1}^{k}{{\rm{L}}}_{{\mathtt{REP}}2}{({\bar{Z}}_{j})}^{{z}_{j}}:a,{z}_{1},\ldots ,{z}_{k}=0,1\right\}.$$
(8)

Since the word stabilizer of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is identical to the word stabilizer of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\), the word stabilizer of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) is then given by W.

Clearly, the word operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{REP}}2}\) are generated by \({{\rm{L}}}_{{\mathtt{REP}}2}({\bar{X}}_{1}),\ldots ,{{\rm{L}}}_{{\mathtt{REP}}2}({\bar{X}}_{k}).\) Hence, the word operators of \({{\mathcal{C}}}_{{\mathtt{Stab}},{\mathtt{KLM}}}\) are

$${w}_{({x}_{1},\ldots ,{x}_{k})}=R\mathop{\prod }\limits_{j=1}^{k}{{\rm{L}}}_{{\mathtt{REP}}2}{({\bar{X}}_{j})}^{{x}_{j}}$$
(9)

where x1, …, xk = 0, 1. 

An amplitude damping CE code: additional details

We now explain the connection between the codes \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\), \({{\mathcal{C}}}_{{\mathtt{ABC+}}}\), \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\), \({{\mathcal{C}}}_{{\mathtt{KLM}}}\), and \({{\mathcal{C}}}_{{\mathtt{REP2}}}\) as illustrated in Fig. 4b. Now recall that the four-qubit amplitude damping code17 has logical codewords

$$\left|{0}_{{\mathtt{LNCY}}}\right\rangle =(\left|0000\right\rangle +\left|1111\right\rangle )/\sqrt{2}$$
(10)
$$\left|{1}_{{\mathtt{LNCY}}}\right\rangle =(\left|1100\right\rangle +\left|0011\right\rangle )/\sqrt{2}.$$
(11)

Concatenating this with the dual-rail code \({{\mathcal{C}}}_{{\mathtt{KLM}}}\) gives the code

$$\left|{0}_{{\mathtt{LNCY}},{\mathtt{KLM}}}\right\rangle =(\left|01010101\right\rangle +\left|10101010\right\rangle )/\sqrt{2}$$
(12)
$$\left|{1}_{{\mathtt{LNCY}},{\mathtt{KLM}}}\right\rangle =(\left|10100101\right\rangle +\left|01011010\right\rangle )/\sqrt{2}.$$
(13)

It is visually easier to work with a code if we collect the odd and even qubits in separate blocks of four qubits. We can achieve this by applying the permutation π, which maps qubits 1, 3, 5, 7 to qubits 1, 2, 3, 4 and qubits 2, 4, 6, 8 to qubits 5, 6, 7, 8, to get our code with logical codewords

$$\left|{0}_{L}\right\rangle =(\left|00001111\right\rangle +\left|11110000\right\rangle )/\sqrt{2}$$
(14)
$$\left|{1}_{L}\right\rangle =(\left|11000011\right\rangle +\left|00111100\right\rangle )/\sqrt{2}.$$
(15)

Note that the above code can be obtained from the four-qubit code \({{\mathcal{C}}}_{{\mathtt{ABC}}+}\) with logical codewords

$$\left|{0}_{{\mathtt{ABC}}+}\right\rangle =(\left|0011\right\rangle +\left|1100\right\rangle )/\sqrt{2}$$
(16)
$$\left|{1}_{{\mathtt{ABC}}+}\right\rangle =(\left|1001\right\rangle +\left|0110\right\rangle )/\sqrt{2},$$
(17)

after concatenation with \({{\mathcal{C}}}_{{\mathtt{REP2}}}\). Note that by concatenating \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\) with \({{\mathcal{C}}}_{{\mathtt{REP2}}}\), we get a concatenated code \({{\mathcal{C}}}_{2{\mathtt{LNCY}}}={{\mathcal{C}}}_{{\mathtt{LNCY}}}\circ {{\mathcal{C}}}_{{\mathtt{REP2}}}\) with logical codewords

$$\begin{array}{lll}\left|{0}_{2{\mathtt{LNCY}}}\right\rangle &=&(\left|00000000\right\rangle +\left|11111111\right\rangle )/\sqrt{2},\\ \left|{1}_{2{\mathtt{LNCY}}}\right\rangle &=&(\left|00110011\right\rangle +\left|11001100\right\rangle )/\sqrt{2}.\end{array}$$
(18)

Since the stabilizer code \({{\mathcal{C}}}_{2{\mathtt{LNCY}}}\) is equivalent to \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) up to a Pauli rotation given by X4I4, we can interpret \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\) as a rotated concatenated stabilizer code.

To encode an arbitrary single-qubit logical state into \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\), we concatenate the encoding circuits of \({{\mathcal{C}}}_{{\mathtt{LNCY}}}\) and \({{\mathcal{C}}}_{{\mathtt{REP2}}}\), and apply a Pauli rotation. Quantum circuits can be further simplified when encode the logical stabilizer states \(\left|{0}_{L}\right\rangle\) and \(\left|{+}_{L}\right\rangle =(\left|{0}_{L}\right\rangle +\left|{1}_{L}\right\rangle )/\sqrt{2}\).

To show that our QEC code spanned by \(\left|{0}_{L}\right\rangle\) and \(\left|{1}_{L}\right\rangle\), corrects single AD errors, it suffices to verify the Knill–Laflamme QEC conditions. In particular, we show that for i, j = 0, 1 and a, b = 1, …, 8, we have 〈iLKaKbjL〉 = δi,jδa,bga for some real number ga. Now let us explain the effects of correctible AD errors on \({{\mathcal{C}}}_{{\mathtt{8qubit}}}\). Recall that the correctible AD errors are given by \({K}_{0}={A}_{0}^{\otimes 8}\), \({K}_{1}={A}_{1}\otimes {A}_{0}^{\otimes 7}\), \({K}_{2}={A}_{0}\otimes {A}_{1}\otimes {A}_{0}^{\otimes 6}\), …, \({K}_{7}={A}_{0}^{\otimes 6}\otimes {A}_{1}\otimes {A}_{0}\), and \({K}_{8}={A}_{0}^{\otimes 7}\otimes {A}_{1}\). Then we can see the following.

  1. 1.

    \({K}_{0}\left|{0}_{L}\right\rangle ={(1-\gamma )}^{2}\left|{0}_{L}\right\rangle\)

    \({K}_{0}\left|{1}_{L}\right\rangle ={(1-\gamma )}^{2}\left|{1}_{L}\right\rangle\).

  2. 2.

    \({K}_{1}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|01110000\right\rangle\)

    \({K}_{1}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|01000011\right\rangle\).

  3. 3.

    \({K}_{2}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|10110000\right\rangle\)

    \({K}_{2}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|10000011\right\rangle\).

  4. 4.

    \({K}_{3}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|11010000\right\rangle\)

    \({K}_{3}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00011100\right\rangle\).

  5. 5.

    \({K}_{4}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|11100000\right\rangle\)

    \({K}_{4}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00101100\right\rangle\).

  6. 6.

    \({K}_{5}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00000111\right\rangle\)

    \({K}_{5}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00110100\right\rangle\).

  7. 7.

    \({K}_{6}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00001011\right\rangle\)

    \({K}_{6}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00111000\right\rangle\).

  8. 8.

    \({K}_{7}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00001101\right\rangle\)

    \({K}_{7}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|11000001\right\rangle\).

  9. 9.

    \({K}_{8}\left|{0}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|00001110\right\rangle\)

    \({K}_{8}\left|{1}_{L}\right\rangle =\sqrt{\gamma }\sqrt{{(1-\gamma )}^{3}}\left|11000010\right\rangle\).

In the above, we can see that the effect of K2j−1 is identical to K2j for j = 1, …, 4. Hence there are only five unique correctible outcomes that correspond to the correctible errors K0, K1, K3, K5 and K7. Each of these correctible outcomes are clearly orthogonal. Hence to perform quantum error correction, it suffices to rotate the orthogonal corrupted codespaces back to the original codespace.

Now, to extract the error syndrome, it suffices to measure the stabilizers Z2j−1, Z2j for j = 1, 2, 3, 4. These stabilizer measurements leave the codespace afflicted with correctible AD errors unchanged, and measure the parity of the (2j − 1)th and (2j)th qubits. We can then make the following decisions.

  1. 1.

    If the parity of the all blocks is even, then we can ascertain that no AD error has occured, which corresponds to the effect of the Kraus operator K0.

  2. 2.

    If the parity of the first and second qubit is odd, while the parity of the remaining blocks is even, then we can ascertain that either K1 or K2 has occured.

  3. 3.

    If the parity of the third and fourth qubit is odd, while the parity of the remaining blocks is even, then we can ascertain that either K3 or K4 has occured.

  4. 4.

    If the parity of the fifth and sixth qubit is odd, while the parity of the remaining blocks is even, then we can ascertain that either K5 or K6 has occured.

  5. 5.

    If the parity of the seventh and eight qubit is odd, while the parity of the remaining blocks is even, then we can ascertain that either K7 or K8 has occured.

The structure of the corrupted codespaces allows us to decode them into a physical qubit by first discarding four qubits, and subsequently employing the same decoding circuit up to a permutation.