Abstract
Solid-state spin qubits is a promising platform for quantum computation and quantum networks1,2. Recent experiments have demonstrated high-quality control over multi-qubit systems3,4,5,6,7,8, elementary quantum algorithms8,9,10,11 and non-fault-tolerant error correction12,13,14. Large-scale systems will require using error-corrected logical qubits that are operated fault tolerantly, so that reliable computation becomes possible despite noisy operations15,16,17,18. Overcoming imperfections in this way remains an important outstanding challenge for quantum science15,19,20,21,22,23,24,25,26,27. Here, we demonstrate fault-tolerant operations on a logical qubit using spin qubits in diamond. Our approach is based on the five-qubit code with a recently discovered flag protocol that enables fault tolerance using a total of seven qubits28,29,30. We encode the logical qubit using a new protocol based on repeated multi-qubit measurements and show that it outperforms non-fault-tolerant encoding schemes. We then fault-tolerantly manipulate the logical qubit through a complete set of single-qubit Clifford gates. Finally, we demonstrate flagged stabilizer measurements with real-time processing of the outcomes. Such measurements are a primitive for fault-tolerant quantum error correction. Although future improvements in fidelity and the number of qubits will be required to suppress logical error rates below the physical error rates, our realization of fault-tolerant protocols on the logical-qubit level is a key step towards quantum information processing based on solid-state spins.
Similar content being viewed by others
Main
Large-scale quantum computers and quantum networks will require quantum error correction to overcome inevitable imperfections15,16,17,18,19. The central idea is to encode each logical qubit of information into several physical data qubits. Non-destructive multi-qubit measurements, called stabilizer measurements, can then be used to identify and correct errors15,16,17,18. If the error rates of all the components are below a certain threshold, it becomes possible to perform arbitrarily large quantum computations by encoding into increasingly more physical qubits15,17,18. A crucial requirement is that all logical building blocks, including the error-syndrome measurement, must be implemented fault tolerantly. At the lowest level, this implies that any single physical error should not cause a logical error.
Over the past several years, steps towards fault-tolerant quantum error correction have been made using spin qubits in silicon6,7,8 and in diamond13,14, as well as in various other hardware platforms, such as superconducting qubits23,24,25,26,27 and trapped-ion qubits20,21,31,32. Pioneering experiments have demonstrated codes that can detect but not correct errors22,25,26,33, quantum error-correction protocols that can correct only one type of error13,14,34, as well as non-fault-tolerant quantum error-correction protocols20,24,34,35. A recent experiment with trapped-ion qubits has demonstrated the fault-tolerant operation of an error-correction code, albeit through destructive stabilizer measurements and post-processing21.
In this work, we realize fault-tolerant encoding, gate operations and non-destructive stabilizer measurements for a logical qubit of a quantum error-correction code. Our logical qubit is based on the five-qubit code and we use a total of seven spin qubits in a diamond quantum processor (Fig. 1). Fault tolerance is made possible through the recently discovered paradigm of flag qubits28,29,30. First, we demonstrate a new fault-tolerant encoding protocol based on repeated multi-qubit measurements, which herald the successful preparation of the logical state. Then, we realize the (non-universal) set of transversal single-qubit Clifford gates. Finally, we demonstrate stabilizer measurements on the logical qubit and include a flag qubit to ensure compatibility with fault tolerance. Our stabilizer measurements are non-destructive, the post-measurement state is available in real time and we use feedforward based on the measurement outcomes. Although the logical qubit fidelities do not yet outperform the constituent physical qubits, these results demonstrate the key components of fault-tolerant quantum error correction in a solid-state spin-qubit processor.
The logical qubit
Stabilizer error-correction codes use auxiliary qubits to perform repeated stabilizer measurements that identify errors. A key requirement for fault tolerance is to prevent errors on the auxiliary qubits from spreading to the data qubits and causing logical errors18,28 (Fig. 1b). The paradigm of flag fault tolerance provides a solution with minimal qubit overhead28,29,30. Auxiliary qubit errors that would cause logical errors are detected using extra flag qubits, so that they can be subsequently corrected (Fig. 1b).
Our logical qubit is based on the five-qubit code, the smallest distance-3 code which can correct any single-qubit error35,36. Any logical state is a simultaneous +1 eigenstate of the four stabilizers s1 = XXYIY, s2 = YXXYI, s3 = IYXXY and s4 = YIYXX, and the logical operators are XL = XXXXX and ZL = ZZZZZ. Because any error on a single data qubit corresponds to a unique 4-bit syndrome, given as the eigenvalues of the stabilizers, arbitrary single-qubit errors can be identified and corrected. Combined with an auxiliary qubit for stabilizer measurements and a flag qubit to capture harmful auxiliary qubit errors, this makes fault-tolerant error correction possible using seven qubits in total28.
System: spin qubits in diamond
Our processor consists of a single nitrogen-vacancy (NV) centre and its surrounding nuclear-spin environment at 4 K (Fig. 1a). These spins are high-quality qubits with coherence times up to seconds for the NV electron spin37 and minutes for the nuclear spins3. The NV electron spin can be read out optically, couples strongly to all other spins and is used as an auxiliary qubit for stabilizer measurements3,14 (Methods). We use the intrinsic 14N nuclear spin as the flag qubit. Unlike the other qubits, the flag qubit does not need to maintain coherence during the optical readout. In this device, 27 13C nuclear-spin qubits and their lattice positions have been characterized, so that the 406 qubit–qubit interactions are known38. Each 13C qubit can be controlled individually owing to their distinct couplings to the NV electron spin (Methods). Here we use five of the 13C spin qubits as the data qubits to encode the logical qubit.
A challenge for controlling such a quantum processor is that the spins continuously couple to each other. We realize selective control gates through various echo sequences that isolate interactions between the targeted spins, while also protecting them from environmental decoherence. For all two-qubit gates, we use previously developed electron–nuclear gates, which are based on decoupling sequences on the electron spin3 (Methods). Furthermore, we introduce interleaved and asynchronous echo stages that cancel unwanted couplings between the data qubits (Methods). These extra echo stages are essential for the relatively long gate sequences realized here.
Non-destructive stabilizer measurements
We start by demonstrating non-destructive four-qubit stabilizer measurements with real-time feedforward operations based on the measurement outcomes (Fig. 2). Despite the central role of such measurements in many error-correction codes, including the five-qubit code, the Steane code and the surface code15,16,17,18, experimental implementations with feedforward have remained an outstanding challenge.
We benchmark the measurement by using it to deterministically create a four-qubit entangled state. We prepare the state \(|0000\rangle \) and measure the operator XXXX. This projects the qubits into the Greenberger–Horne–Zeilinger (GHZ) state \(({| {\rm{\psi }}\rangle }_{\pm }=(| 0000\rangle \pm | 1111\rangle )/\sqrt{2}),\) with the sign determined by the measurement outcome. We process the measurement outcomes in real time using a microprocessor and apply the required correction to deterministically output the state \(({| {\rm{\psi }}\rangle }_{+})\) with a fidelity of 0.86(1). Because this result is obtained without any post-selection, it highlights that the post-measurement state is available for all measurement outcomes, satisfying one of the key requirements for error correction.
Fault-tolerant encoding
To prepare the logical qubit, we introduce a new scheme that uses repeated stabilizer measurements and a flag qubit to herald successful preparation (Fig. 3a). In contrast to the scheme introduced by Chao and Reichardt28, no direct two-qubit gates between the data qubits are required (fifth section of the Supplementary Information). We demonstrate the preparation of the logical state \(({|-\rangle }_{{\rm{L}}}=\frac{1}{\sqrt{2}}({|0\rangle }_{{\rm{L}}}-{|1\rangle }_{{\rm{L}}})\). This state is the unique +1 eigenstate of five independent weight-3 logical -X operators, namely, p1 = IZXZI, p2 = ZIIZX, p3 = XZIIZ, p4 = ZXZII and p5 = IIZXZ. Therefore, one can prepare \({|-\rangle }_{{\rm{L}}}\) by initializing the data qubits into the product state \(|00+0+\rangle \), which is an eigenstate of p1 and p2, and subsequently measuring p3 to p5 (Fig. 3a). This preparation scheme is not fault tolerant because faults involving the auxiliary qubit can cause weight-2 errors, which can result in logical errors (Fig. 3a). We refer to these steps as the non-FT encoding scheme.
We make the preparation circuit fault tolerant by adding two stabilizer measurements, T1 = p2·p4·p5 = IXIYY and T2 = p1·p3·p5 = XIYYI with a flag qubit (Fig. 3a). Successful preparation is heralded by the following conditions: (1) the measurement outcomes of T1 and T2 are compatible with the measurement outcomes mi of the logical operators \({p}_{{\rm{i}}}\), that is, \({m}_{{T}_{1}}={m}_{2}{\times m}_{4}{\times m}_{5}\) and \({m}_{{T}_{2}}={m}_{1}{\times m}_{3}{\times m}_{5}\); (2) the flag is not raised (that is, the flag qubit is measured to be in \(|0\rangle \)). Otherwise, the state is rejected. The order of two-qubit gates is carefully chosen to ensure fault tolerance while minimizing the number of operations. Further details and a proof of the fault tolerance of this scheme are given in the sixth section of the Supplementary Information. We refer to this preparation as the FT encoding scheme.
To reduce the impact of auxiliary qubit measurement errors10,14, we also require all stabilizer measurement outcomes to be +1 (that is, the NV electron spin is measured to be in \(|0\rangle \)). These outcomes are more reliable3 (Methods), increasing the fidelity of the state preparation, at the cost of a lower success probability (Supplementary Table 1).
We compare the non-FT and FT encoding schemes. We define the logical state fidelity FL as (Methods)
in which ρ is the prepared state and \(\varepsilon =\left\{I,{X}_{i},{Y}_{i},{Z}_{i},{i}=\mathrm{1,2},\ldots ,5\right\}\) is the set of all single-qubit Pauli errors. The fidelity FL gives the probability that there is at most a single-qubit error in the prepared state, that is, there is no logical error. We characterize the prepared state by measuring the 31 operators that define the target state (Extended Data Fig. 2 and Methods). We find that the FT encoding scheme (FL = 95(2)%) outperforms the non-FT scheme (FL = 81(2)%).
To understand this improvement, we analyse the underlying error probability distributions (Figs. 3b,c). For the five-qubit code, the \({|-\rangle }_{{\rm{L}}}\) state plus any number of Pauli errors is equivalent to either \({|-\rangle }_{{\rm{L}}}\) with at most one Pauli error (no logical error) or to \({|+\rangle }_{{\rm{L}}}\) with at most one Pauli error (a logical error). We calculate the overlaps between the prepared state and those states. The results show that the FT scheme suppresses logical errors, consistent with fault tolerance preventing single faults propagating to multi-qubit errors. The overall logical state fidelity FL is improved, despite the higher probability of single-qubit errors owing to the increased complexity of the sequence.
Fault-tolerant logical gates
The five-qubit code supports a complete set of transversal single-qubit Clifford gates, which are naturally fault tolerant16,39. We apply four transversal logical gates to \({|-\rangle }_{{\rm{L}}}\) (Fig. 4): XL = X1X2X3X4X5, YL = Y1Y2Y3Y4Y5, the Hadamard gate HL = Pπ H1H2H3H4H5 and the phase gate SL = Pπ S1S2S3S4S5, in which Pπ is a permutation of the data qubits16,39 (Fig. 4b). These permutations are fault tolerant because we realize them by relabelling the qubits rather than by using SWAP gates39. For completeness, we note that universal computation requires further non-transversal gates, constructed—for example—with auxiliary logical qubits, which are not pursued here18.
Our control system performs the underlying single-qubit gates by tracking basis rotations and compiling them with subsequent gates or measurements (Methods). In the sequence considered here (Fig. 4a), such compilation does not increase the physical operation count and there is no reduction of fidelity (Fig. 4c). For comparison, we also implement the ‘worst-case’ scenario, in which the logical gates are applied physically (Fig. 4c). This includes five single-qubit gates and the corresponding extra echo sequences between the state preparation and the measurement stage. Together, the demonstrated transversal logical gates enable the fault-tolerant preparation of all six eigenstates of the logical Pauli operators.
Fault-tolerant stabilizer measurements
Finally, we demonstrate and characterize a flagged stabilizer measurement on the encoded state (Fig. 5a). Such measurements are a primitive for fault-tolerant quantum error-correction protocols28. To ensure that the measurement is compatible with fault tolerance, the two-qubit gates are carefully ordered and a flag qubit is added to capture the auxiliary qubit errors that can propagate to logical errors28.
We prepare the logical state \({|-\rangle }_{{\rm{L}}}\) and measure the stabilizer s1 = XXYIY (Fig. 5a). The resulting output consists of the post-measurement state and two classical bits of information from the measurements of the auxiliary and flag qubits (Fig. 5b). The logical state fidelity FL is given by the probability that the logical information can be correctly extracted (no logical error) when taking into account the flag measurement outcome. The interpretation of the error syndrome changes if the flag is raised (Methods). We find FL = 0.77(4) for the post-measurement state without any post-selection. Higher logical state fidelities can be obtained by post-selecting on favourable outcomes, but this is incompatible with error correction.
To illustrate the benefit of the flag qubit, we compare the logical state fidelities with and without taking the flag measurement outcome into account. Because auxiliary qubit errors that propagate to logical errors are naturally rare, no marked difference is observed (Fig. 5c). Therefore, we introduce a Pauli Y error on the auxiliary qubit (Fig. 5a). This error propagates to the two-qubit error Y3Y5. For the case without flag information, this error causes a logical flip ZL (Methods) and the logical state fidelity drops below 0.5. By contrast, with the flag qubit, this non-trivial error is detected (Fig. 5b) and remains correctable, so that the logical state fidelity is partly recovered (Fig. 5c).
Conclusion
In conclusion, we have demonstrated encoding, gates and non-destructive stabilizer measurements for a logical qubit of an error-correction code in a fault-tolerant way. Our results advance solid-state spin qubits from the physical-qubit level to the logical-qubit level, at which fault-tolerant operations become possible. Such fault tolerance is a necessity for large-scale quantum computation, in which error rates must ultimately be suppressed to extremely low levels.
Future challenges are to perform complete quantum error-correction cycles, encode several logical qubits, realize universal fault-tolerant gates and—ultimately—suppress logical error rates exponentially below physical error rates. Although the demonstrated operations are of high fidelity—the experiments consist of up to 40 two-qubit gates and eight mid-circuit auxiliary qubit readouts (Fig. 5a)—improvements in both the fidelities and the number of qubits will be required.
Improved gates might be realized through tailored optimal control schemes that leverage the precise knowledge of the system and its environment40 (Fig. 1a). Coupling to optical cavities can further improve readout fidelities1,41. Scaling to large code distances and several logical qubits can be realized through already-demonstrated magnetic40 and optical42 NV–NV connections that enable modular, distributed, quantum computation based on the surface code and other error-correction codes19. Therefore, our demonstration of the building blocks of fault-tolerant quantum error correction is a key step towards quantum information processing based on solid-state spin qubits.
Methods
Sample
We use a naturally occurring NV centre in a homo-epitaxially chemical-vapour-deposition-grown diamond with a 1.1% natural abundance of 13C and a \(\langle 111\rangle \) crystal orientation (grown by Element Six). A solid-immersion lens is used to enhance the photon-collection efficiency43. The NV centre has been selected for the absence of 13C spins with hyperfine couplings >500 kHz. These experiments are performed at a temperature of 4 K, at which the electron-spin relaxation is negligible (T1 = 3.6(3) × 103 s)37.
Qubits and coherence times
The NV electron-spin auxiliary qubit is defined between the states ms = 0 \((|0\rangle )\) and ms = −1 \((|1\rangle )\). The NV electron-spin coherence times are \({T}_{2}^{* }=4.9(2)\,{\rm{\mu }}{\rm{s}}\), T2 = 1.182(5) ms and up to seconds under dynamical decoupling37. The 14N nuclear-spin flag qubit is defined between the states mI = 0 \((|0\rangle )\) and mI = −1 \((|1\rangle )\). The 13C nuclear-spin data qubits in this device have been characterized in detail in previous work3,38,44 (Fig. 1a). See Supplementary Tables 2–5 for the hyperfine parameters, coherence times and qubit–qubit interactions for the qubits used here.
Magnetic field
A magnetic field of about 403 G is applied using a room-temperature permanent magnet on a XYZ translation stage. This applied field lifts the degeneracy of the ms = ±1 states owing to the Zeeman term (first section of the Supplementary Information). We stabilize the magnetic field to <3 mG using temperature stabilization and an automatic recalibration procedure (every few hours). We align the magnetic field along the NV axis using thermal echo sequences with an uncertainty of 0.07° in the alignment38.
Single-qubit and two-qubit gates
Single-qubit gates and echo pulses are applied using microwave pulses for the NV electron spin (ms = 0 ↔ ms = −1 transition, Hermite pulse shapes37,45, Rabi frequency of about 15 MHz) and using radio-frequency (RF) pulses for the 13C spin qubits (error function pulse shapes3, typical Rabi frequency of about 500 Hz) and the 14N spin qubit (error function pulse shapes, Rabi frequency of about 2 kHz).
The Hermite pulse envelopes of the microwave pulses are defined as
in which c = 0.956 for π pulses and c = 0.667 for π/2 pulses, μ = 0.5tpulse, T = 0.1667tpulse, tpulse is the microwave pulse length and A is the pulse amplitude, which is experimentally calibrated to achieve a π or π/2 rotation. For this work, we use tpulse = 168 ns for π pulses and tpulse = 100 ns for π/2 pulses. The envelope of the RF pulses is defined as
in which Δt is the rise time, t0 is the start time of the pulse, tpulse is the pulse length and erf(x) is the error function3. We ensure that the RF pulses consisted of an integer number of periods of the RF waveform, that is, we ensure that ωtpulse = 2πn for integer n. This ensures that any phase picked up on the electron spin owing to the RF pulse is cancelled. Note that the 13C spin qubits (data qubits) are distinguishable in frequency owing to their hyperfine coupling to the NV electron spin (Supplementary Table 2).
Electron–nuclear two-qubit gates are realized using two different gate designs, depending on the properties of the targeted nuclear spin. For data qubits 1, 2, 4 and 5, two-qubit gates are realized through dynamical decoupling sequences of N equally spaced π-pulses on the electron spin of the form3,46 (τr − π − τr)N. This design requires a notable hyperfine component perpendicular to the applied magnetic field46. For data qubit 3 and the flag qubit (the 14N spin), the perpendicular hyperfine coupling is small and we perform two-qubit gates by interleaving the dynamical decoupling sequence with RF pulses3. Both gate designs simultaneously decouple the NV electron spin from the other qubits and the environment3. The parameters and fidelities for the two-qubit gates are given in Supplementary Table 4. Note that direct nuclear–nuclear two-qubit gates can also be constructed47, but because the natural interaction is much weaker than the electron–nuclear interaction, we don't use such gates here and designed the FT encoding circuit based on electron–nuclear gates only.
Compilation of gate sequences
Our native two-qubit gates are electron-controlled nuclear-spin rotations and are equivalent to the CNOT gate up to single-qubit rotations (Supplementary Fig. 4). To implement the sequences shown in the figures, we first translate all gates into these native gates and compile the resulting sequence. Afterwards, the circuit is translated into the actual pulse sequence. At the core of this compilation process is the tracking and synchronization of the qubit phases and the corresponding pulse timings. See Supplementary Information for the details of this compilation process (Supplementary Figs. 4–9 and pseudocode 1–8).
Echo sequences for the data qubits
To mitigate decoherence of the data qubits owing to their spin environment, we use echo sequences that are interleaved throughout the experiments. These echo sequences ensure that the data qubits rephase each time they are operated on. Furthermore, the sequence design minimizes the time that the auxiliary electron-spin qubit is idling in superposition states, which are prone to dephasing. We use two echo stages between stabilizer measurements, as well as before and after the logical gates of Fig. 4, which provides a general and scalable solution for the timing of all gates and echoes (third section of the Supplementary Information).
An extra challenge is that, owing to the length of the sequences (up to 100 ms), we need to account for the small unwanted interactions between the nuclear-spin data qubits. The measured coupling strengths show that the strongest couplings are between qubits 3 and 2 (16.90(4) Hz) and between qubits 3 and 5 (12.96(4) Hz)38 (Supplementary Table 5). Such interactions can introduce correlated two-qubit errors that are not correctable in the distance-3 code considered here, which can only handle single-qubit errors in the code block.
To mitigate these qubit–qubit couplings, we decouple qubit 3 asynchronously from the other qubits (Supplementary Fig. 8). Ultimately, such local correlated errors can be suppressed entirely by larger distance codes.
Real-time control and feedforward operations
Real-time control and feedforward operations are implemented through a programmable microprocessor (Jaeger ADwin Pro II) operating on microsecond timescales. The microprocessor detects photon events coming from the detectors, infers the measurement outcomes and controls both the subsequent sequences in the arbitrary waveform generator (Tektronix AWG 5014c) and the lasers for the auxiliary qubit readout. The precise timing for quantum gates (1-ns precision) is based on the clock of the arbitrary waveform generator. Furthermore, the microprocessor operates various control loops that prepare the NV centre in the negative charge state, on resonance with the lasers and in the focus of the laser beam (see second and third sections of the Supplementary Information).
Readout of the auxiliary qubit
The electron spin (auxiliary qubit) is read out by resonantly exciting the ms = 0 to Ex optical transition43. For one or more photons detected, we assign the ms = 0 outcome; for zero photons, we assign ms = ±1. The single-shot readout fidelities are F0 = 90.5(2)% and F1 = 98.6(2)% for ms = 0 and ms = −1, respectively (average fidelity 94.6(1)%).
Uncontrolled electron-spin flips in the excited state cause dephasing of the nuclear spins through the hyperfine interaction. To minimize such spin flips, we avoid unnecessary excitations by using weak laser pulses, so that a feedback signal can be used to rapidly turn off the laser on detection of a photon (within 2 μs). The resulting probability that the electron spin is in state ms = 0 after correctly assigning ms = 0 in the measurement is 0.992 (ref. 14).
For measurements that are used for heralded state preparation, that is, for which we only continue on a ms = 0 outcome (see, for example, Fig. 3), we use shorter readout pulses. This improves the probability that a ms = 0 outcome correctly heralds the ms = 0 state, at the cost of reduced success probability (Supplementary Table 1).
System preparation and qubit initialization
At the start of the experiments, we first prepare the NV centre in its negative charge state and on resonance with the lasers. We then initialize the NV electron spin in the ms = 0 state through a spin pumping process (fidelity > 99.7%)43. We define the electron-spin qubit between the states ms = 0 \((|0\rangle )\) and ms = −1 \((|1\rangle )\). We initialize the data qubits through SWAP sequences (Supplementary Fig. 6) into \(|0\rangle \) and subsequent optical reset of the auxiliary qubit (initialization fidelities 96.5–98.5%; see Supplementary Table 4). The flag qubit is initialized through a projective measurement that heralds preparation in \(|0\rangle \) (initialization fidelity 99.7%). Other product states are prepared by subsequent single-qubit gates.
Final readout of the data qubits
Measuring single-qubit and multi-qubit operators of the data qubits is performed by mapping the required correlation to the auxiliary qubit (through controlled rotations) and then reading out the auxiliary qubit14. To provide best estimates for the measurements, we correct the measured expectation values (Fig. 2 and Extended Data Figs. 1 and 2) for infidelities in the readout sequence; see Bradley et al.3 for the correction procedure.
Fidelity of the GHZ state
The fidelity of the prepared state ρ (in Fig. 2 and Extended Data Fig. 1) with respect to the target GHZ state \(({|{\rm{\psi }}\rangle }_{+})\) is obtained as
Assessing the logical state fidelity
The logical state fidelity FL is defined in equation (1) and gives the probability that the state is free of logical errors. Said differently, FL is the fidelity with respect to the ideal five-qubit state after a round of perfect error correction, or the probability to obtain the correct outcome in a perfect fault-tolerant logical measurement. Although fault-tolerant circuits for logical measurement exist28, we do not experimentally implement these here. Instead, we extract FL from a set of measurements, as described in the following using \({|-\rangle }_{{\rm{L}}}\) as an example.
The logical state \({|-\rangle }_{{\rm{L}}}\) is the unique simultaneous eigenstate of the five weight-3 operators \({p}_{{\rm{i}}}\) with eigenvalue +1. Thus, we can describe the state \(E{|-\rangle }_{{\rm{L}}}\) (with E a Pauli error) as the projector
in which mi = ±1 is the measurement outcome of \({p}_{{\rm{i}}}\) and mi = −1 when E anticommutes with \({p}_{{\rm{i}}}\). This projector can be expanded as a summation of 31 multi-qubit Pauli operators (including a constant), which are listed in Extended Data Fig. 2. The logical state fidelity \({p}_{{\rm{i}}}\) in equation (1) can then be written as
Here \(\varepsilon =\left\{I,{X}_{i},{Y}_{i},{Z}_{i},{i}=\mathrm{1,2},\ldots ,5\right\}\) is the set of correctable errors for the five-qubit code. To obtain FL experimentally, we measure this set of expectation values.
Logical state fidelity with flag
If the flag in the circuit in Fig. 5a is not raised, then a cycle of error correction would correct any single-qubit error on a logical state. The logical state fidelity is then given by equation (1), which we now refer to as \({F}_{{\rm{L}}}^{{\rm{not\; raised}}}\). A raised flag leads to a different interpretation of the error syndrome28 (Supplementary Table 7).
For example, the Y error on the auxiliary qubit in Fig. 5a leads to the output state \({Y}_{3}{Y}_{5}{|-\rangle }_{{\rm{L}}}\), for which the eigenvalues of s1 = XXYIY, s2 = YXXYI, s3 = IYXXY and s4 = YIYXX give the syndrome [+1, −1, −1, −1]. Without flag, the corresponding single-qubit recovery is Z4, which changes the syndrome back to all +1 (Supplementary Table 7). This recovery leads to the remaining error Y3Z4Y5, which is a logical Z error. However, taking the flag measurement outcome into account, the syndrome is interpreted differently and the recovery is Y3Y5, so that no error is left (Supplementary Table 7).
For the cases in which the flag is raised, the logical state fidelity with respect to \({|-\rangle }_{{\rm{L}}}\) is now given by:
with \({\varepsilon }^{{\prime} }\) being another set of correctable errors
A detailed derivation for this set of errors and their corresponding syndromes are given in the fifth section of the Supplementary Information.
The logical state fidelity after the stabilizer measurement (Fig. 5) is calculated as the weighted sum of the fidelities conditioned on the two flag outcomes:
with pf being the probability that the flag is raised and \({F}_{{\rm{L}}}^{{\rm{raised}}}\) and \({F}_{{\rm{L}}}^{{\rm{not\; raised}}}\) are as defined above.
Finally, to construct the logical state fidelity as a function of pe (Fig. 5c), we measure FL with (pe = 0) and without (pe = 1) the auxiliary qubit error and calculate the outcomes for other error probabilities pe from their weighted sum:
Error distribution in the prepared state
The overlaps between the prepared state ρ and the state \(E{|-\rangle }_{{\rm{L}}}\) with E identity or a single-qubit error are written as P0,− and P1,−, respectively. These correspond to the cases that there is no logical error. The overlaps between the prepared state ρ and the state \(E{|+\rangle }_{{\rm{L}}}\) with E identity or a single-qubit error are written as P0,+ and P1,+, respectively. In these cases, there is a logical error. These overlaps are shown in Fig. 3b,c and calculated as (\(\alpha =\pm \))
These overlaps can be explicitly expressed in terms of the 31 measured expectation values (see seventh section of the Supplementary Information).
Error analysis
The uncertainties in the measured fidelities, logical state fidelities and probabilities (P0/1,±) are obtained from the uncertainties in the measured expectation values using error propagation. For example, the logical state fidelity FL is calculated as
in which Ai are the 16 expectation values shown in equation (5). Assuming that the errors in the measured expectation values are independent, the standard deviation in FL is:
in which \({\sigma }_{{A}_{i}}\) is the standard deviation of the expectation value Ai and is given by a binomial distribution42. Note that \({\sigma }_{{A}_{i}}\) is also corrected for the readout correction process described in Bradley et al.3.
Note added
While finalizing this manuscript, two related preprints appeared that demonstrate destructive stabilizer measurements with a flag qubit48 and flag fault-tolerant quantum error correction49 with trapped-ion qubits. Furthermore, during the revision process, three related preprints appeared that demonstrate quantum error correction on a surface code using superconducting qubits50,51 and realize a flag-based universal fault-tolerant gate set using trapped ions52.
Data availability
The underlying data and software code for generating the plots presented in the main text and Supplementary Information are available at Zenodo https://doi.org/10.5281/zenodo.6461872.
References
Awschalom, D. D., Hanson, R., Wrachtrup, J. & Zhou, B. B. Quantum technologies with optically interfaced solid-state spins. Nat. Photonics 12, 516–527 (2018).
Chatterjee, A. et al. Semiconductor qubits in practice. Nat. Rev. Phys. 3, 157–177 (2021).
Bradley, C. E. et al. A ten-qubit solid-state spin register with quantum memory up to one minute. Phys. Rev. X 9, 031045 (2019).
Nguyen, C. et al. Quantum network nodes based on diamond qubits with an efficient nanophotonic interface. Phys. Rev. Lett. 123, 183602 (2019).
Bourassa, A. et al. Entanglement and control of single nuclear spins in isotopically engineered silicon carbide. Nat. Mater. 19, 1319–1325 (2020).
Madzik, M. T. et al. Precision tomography of a three-qubit donor quantum processor in silicon. Nature 601, 348–353 (2022).
He, Y. et al. A two-qubit gate between phosphorus donor electrons in silicon. Nature 571, 371–375 (2019).
Xue, X. et al. Quantum logic with spin qubits crossing the surface code threshold. Nature 601, 343–347 (2022).
Van der Sar, T. et al. Decoherence-protected quantum gates for a hybrid solid-state spin register. Nature 484, 82–86 (2012).
van Dam, S. B., Cramer, J., Taminiau, T. H. & Hanson, R. Multipartite entanglement generation and contextuality tests using nondestructive three-qubit parity measurements. Phys. Rev. Lett. 123, 050401 (2019).
Vorobyov, V. et al. Quantum Fourier transform for nanoscale quantum sensing. npj Quantum Inf. 7, 124 (2021).
Unden, T. et al. Quantum metrology enhanced by repetitive quantum error correction. Phys. Rev. Lett. 116, 230502 (2016).
Waldherr, G. et al. Quantum error correction in a solid-state hybrid spin register. Nature 506, 204–207 (2014).
Cramer, J. et al. Repeated quantum error correction on a continuously encoded qubit by real-time feedback. Nat. Commun. 7, 11526 (2016).
Preskill, J. Reliable quantum computers. Proc. R. Soc. A Math. Phys. Eng. Sci. 454, 385–410 (1998).
Gottesman, D. E. Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology (1997).
Aliferis, P., Gottesman, D. & Preskill, J. Quantum accuracy threshold for concatenated distance-3 code. Quantum Inf. Comput. 6, 97–165 (2006).
Terhal, B. M. Quantum error correction for quantum memories. Rev. Mod. Phys. 87, 307–346 (2015).
Nickerson, N. H., Li, Y. & Benjamin, S. C. Topological quantum computing with a very noisy network and local error rates approaching one percent. Nat. Commun. 4, 1756 (2013).
Nigg, D. et al. Quantum computations on a topologically encoded qubit. Science 345, 302–305 (2014).
Egan, L. et al. Fault-tolerant control of an error-corrected qubit. Nature 598, 281–286 (2021).
Linke, N. M. et al. Fault-tolerant quantum error detection. Sci. Adv. 3, e1701074 (2017).
Rosenblum, S. et al. Fault-tolerant detection of a quantum error. Science 361, 266–270 (2018).
Campagne-Ibarcq, P. et al. Quantum error correction of a qubit encoded in grid states of an oscillator. Nature 584, 368–372 (2020).
Andersen, C. K. et al. Repeated quantum error detection in a surface code. Nat. Phys. 16, 875–880 (2020).
Marques, J. et al. Logical-qubit operations in an error-detecting surface code. Nat. Phys. 18, 80–86 (2021).
Google Quantum AI. Exponential suppression of bit or phase errors with cyclic error correction. Nature 595, 383–387 (2021).
Chao, R. & Reichardt, B. W. Quantum error correction with only two extra qubits. Phys. Rev. Lett. 121, 050502 (2018).
Chamberland, C. & Beverland, M. E. Flag fault-tolerant error correction with arbitrary distance codes. Quantum 2, 53 (2018).
Chao, R. & Reichardt, B. W. Flag fault-tolerant error correction for any stabilizer code. PRX Quantum 1, 010302 (2020).
Negnevitsky, V. et al. Repeated multi-qubit readout and feedback with a mixed-species trapped-ion register. Nature 563, 527–531 (2018).
Erhard, A. et al. Entangling logical qubits with lattice surgery. Nature 589, 220–224 (2021).
Takita, M., Cross, A. W., Córcoles, A. D., Chow, J. M. & Gambetta, J. M. Experimental demonstration of fault-tolerant state preparation with superconducting qubits. Phys. Rev. Lett. 119, 180501 (2017).
Gong, M. et al. Experimental exploration of five-qubit quantum error-correcting code with superconducting qubits. Natl Sci. Rev. 9, nwab011 (2021).
Knill, E., Laflamme, R., Martinez, R. & Negrevergne, C. Benchmarking quantum computers: the five-qubit error correcting code. Phys. Rev. Lett. 86, 5811–5814 (2001).
Laflamme, R., Miquel, C., Paz, J. P. & Zurek, W. H. Perfect quantum error correcting code. Phys. Rev. Lett. 77, 198–201 (1996).
Abobeih, M. H. et al. One-second coherence for a single electron spin coupled to a multi-qubit nuclear-spin environment. Nat. Commun. 9, 2552 (2018).
Abobeih, M. H. et al. Atomic-scale imaging of a 27-nuclear-spin cluster using a quantum sensor. Nature 576, 411–415 (2019).
Yoder, T. J., Takagi, R. & Chuang, I. L. Universal fault-tolerant gates on concatenated stabilizer codes. Phys. Rev. X 6, 031039 (2016).
Dolde, F. et al. High-fidelity spin entanglement using optimal control. Nat. Commun. 5, 3371 (2014).
Bhaskar, M. K. et al. Experimental demonstration of memory-enhanced quantum communication. Nature 580, 60–64 (2020).
Pompili, M. et al. Realization of a multinode quantum network of remote solid-state qubits. Science 372, 259–264 (2021).
Robledo, L. et al. High-fidelity projective read-out of a solid-state spin quantum register. Nature 477, 574–578 (2011).
Jung, K. et al. Deep learning enhanced individual nuclear-spin detection. npj Quantum Inf. 7, 41 (2021).
Warren, W. S. Effects of arbitrary laser or NMR pulse shapes on population inversion and coherence. J. Chem. Phys. 81, 5437–5448 (1984).
Taminiau, T. H., Cramer, J., Sar, T. V. D., Dobrovitski, V. V. & Hanson, R. Universal control and error correction in multi-qubit spin registers in diamond. Nat. Nanotechnol. 9, 171–176 (2014).
Randall, J. et al. Many-body–localized discrete time crystal with a programmable spin-based quantum simulator. Science 374, 1474–1478 (2021).
Hilder, J. et al. Fault-tolerant parity readout on a shuttling-based trapped-ion quantum computer. Phys. Rev. X 12, 011032 (2022).
Ryan-Anderson, C. et al. Realization of real-time fault-tolerant quantum error correction. Phys. Rev. X 11, 041058 (2021).
Krinner, S. et al. Realizing repeated quantum error correction in a distance-three surface code. Nature 605, 669–674 (2022).
Zhao, Y. et al. Realization of an error-correcting surface code with superconducting qubits. Preprint at https://arxiv.org/abs/2112.13505 (2021).
Postler, L. et al. Demonstration of fault-tolerant universal quantum gate operations. Nature 605, 675–680 (2022).
Acknowledgements
This work was supported by the Netherlands Organisation for Scientific Research (NWO/OCW) through a Vidi grant and the Quantum Software Consortium programme (project no. 024.003.037/3368). This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement no. 852410). We gratefully acknowledge support from the joint research programme ‘Modular quantum computers’ by Fujitsu Limited and Delft University of Technology, co-funded by the Netherlands Enterprise Agency under project number PPS2007. This project (QIA) has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 820445. This work is part of the project QCDA (with project number 680.91.033) of the research programme QuantERA, which is (partly) financed by the Dutch Research Council (NWO). This publication is part of the QuTech NWO funding 2020–2024 – Part I ‘Fundamental Research’ with project number 601.QT.001-1, which is financed by the NWO.
Author information
Authors and Affiliations
Contributions
M.H.A., Y.W. and T.H.T. devised the experiments. M.H.A. performed the experiments and collected the data. Y.W. and B.M.T. developed the fault-tolerant preparation scheme and its analysis. M.H.A., Y.W., J.R., B.M.T. and T.H.T. analysed the data. M.H.A., J.R., S.J.H.L. and C.E.B. prepared the experimental apparatus. M.M. and D.J.T. grew the diamond sample. M.H.A., Y.W. and T.H.T. wrote the manuscript, with input from all authors. B.M.T. and T.H.T. supervised the project.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature thanks the anonymous reviewers for their contribution to the peer review of this work. Peer reviewer reports are available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended data figures and tables
Extended Data Fig. 1 Non-destructive stabilizer measurements with a flag and real-time feedforward.
a, Circuit diagram for the deterministic preparation of a four-qubit GHZ entangled state \(({|{\rm{\psi }}\rangle }_{+}=(|0000\rangle +|1111\rangle )/\sqrt{2})\) using a flagged measurement of the stabilizer XXXX. b, Measured expectation values of the 15 operators that define the ideal state. The average obtained fidelity is 0.79(1). c, Data post-selected on the flag not being raised. The obtained fidelity with the target state is 0.82(1). d, When the flag is raised, the obtained fidelity is 0.47(5). Grey bars show the ideal expectation values. Note that we perform this measurement as a test of the circuit, but that the flag information in this case does not carry any specific significance.
Extended Data Fig. 2 Measured expectation values for the encoded state.
Measured expectation values of the 31 operators that define the encoded state (for the circuit in Fig. 3). Grey bars show the ideal expectation values.
Supplementary information
Supplementary Information
This file contains eight sections: System Hamiltonian; Experimental setup; Experimental sequence; Parameters of the nuclear-spin qubits; Flag fault-tolerant quantum error correction; Proof of fault tolerance of the preparation scheme; Error distribution in the prepared state; Pseudocode and references.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Abobeih, M.H., Wang, Y., Randall, J. et al. Fault-tolerant operation of a logical qubit in a diamond quantum processor. Nature 606, 884–889 (2022). https://doi.org/10.1038/s41586-022-04819-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1038/s41586-022-04819-6
This article is cited by
-
An elementary review on basic principles and developments of qubits for quantum computing
Nano Convergence (2024)
-
Machine learning on quantum experimental data toward solving quantum many-body problems
Nature Communications (2024)
-
Mapping a 50-spin-qubit network through correlated sensing
Nature Communications (2024)
-
Na in diamond: high spin defects revealed by the ADAQ high-throughput computational database
npj Computational Materials (2024)
-
Autonomous error correction of a single logical qubit using two transmons
Nature Communications (2024)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.