Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Jan;625(7994):259-263.
doi: 10.1038/s41586-023-06846-3. Epub 2024 Jan 10.

Encoding a magic state with beyond break-even fidelity

Affiliations

Encoding a magic state with beyond break-even fidelity

Riddhi S Gupta et al. Nature. 2024 Jan.

Abstract

To run large-scale algorithms on a quantum computer, error-correcting codes must be able to perform a fundamental set of operations, called logic gates, while isolating the encoded information from noise1-8. We can complete a universal set of logic gates by producing special resources called magic states9-11. It is therefore important to produce high-fidelity magic states to conduct algorithms while introducing a minimal amount of noise to the computation. Here we propose and implement a scheme to prepare a magic state on a superconducting qubit array using error correction. We find that our scheme produces better magic states than those that can be prepared using the individual qubits of the device. This demonstrates a fundamental principle of fault-tolerant quantum computing12, namely, that we can use error correction to improve the quality of logic gates with noisy qubits. Moreover, we show that the yield of magic states can be increased using adaptive circuits, in which the circuit elements are changed depending on the outcome of mid-circuit measurements. This demonstrates an essential capability needed for many error-correction subroutines. We believe that our prototype will be invaluable in the future as it can reduce the number of physical qubits needed to produce high-fidelity magic states in large-scale quantum-computing architectures.

PubMed Disclaimer

Conflict of interest statement

A patent (application no. 18/053087) was filed on 7 November 2022 with listed inventors B.J.B., A.W.C., R.S.G., T.J.-O. and T.J.Y. The authors declare no other competing financial or non-financial interests.

Figures

Fig. 1
Fig. 1. A fault-tolerant circuit to make parity measurements.
a, A circuit that measures SX, SZ and W¯ using flag qubits on the heavy-hexagonal lattice architecture. b, The four-qubit code is encoded on qubits with even indices and the other qubits are used to make the fault-tolerant parity measurement. The circuit measures SX by setting U=1 and SZ by setting U = H, where H is the Hadamard gate. The circuit measures W¯ if we set U = T. The measurement outcome M gives the reading of the parity measurement. Essential to the fault-tolerant procedure are flag fault-tolerant readout circuits,,, that identify errors that occur during the parity measurement. Outcomes f and g are flag qubit readings that indicate that the circuit may have introduced a logical error to the data qubits.
Fig. 2
Fig. 2. Fault-tolerant schemes for magic-state preparation and logical tomography.
a, Preparation of a CZ state on a four-qubit code in three steps. In the code-preparation step, the four-qubit code is prepared in the logical +¯+¯ state by measuring +4 with the SZ operator. We can use adaptive circuits or post-selection to correct for SZ = −1 outcomes. In the magic-state initialization step, we measure the W¯ operator and post-select on the +1 outcome. In the final error-detection step, we identify the errors that may have occurred during preparation. We measure W¯ a second time to identify if a measurement error occurred during the magic-state initialization step. We finally measure SX and SZ a second time to identify Pauli errors that may have occurred, and to determine if the initial SZ measurement gave a readout error. b,c, We replace the parity measurements in the dashed box of a with circuits b and c to make logical tomographic measurements and, at the same time, infer a complete set of stabilizer data for error detection. For example, if we set SQ = SX and measure qubits in the R = Z basis, we infer the value of SZ, as in a, and we also obtain readings of the logical Z¯1, Z¯2 and Z¯1Z¯2. Likewise, we can set SQ = SZ with either R = X to infer SX as well as logical Pauli operators X1¯, X2¯ and X1¯X2¯, or R = Y to infer SY as well as logical Pauli operators X1¯Z2¯, Z1¯X2¯ and Y1¯Y2¯. In c, we include a Y¯j measurement for logical qubit j = 1, 2 to measure logical operators of the form Y¯j, Y¯jXk¯ and Y¯jZk¯ with k ≠ j and k = 1, 2, where we take an appropriate choice of R. The Y¯j operator is measured twice to identify the occurrence of measurement errors. Operators Y¯j are supported on three of the data qubits and can therefore be read out with an appropriate modification of the circuit shown in Fig. 1.
Fig. 3
Fig. 3. Infidelities measured in magic-state preparation experiments.
State infidelity for error-suppressed (error supp.) and standard schemes are shown in blue and orange, respectively. On the x-axis, a state is reconstructed with either logical or physical tomography. The correction for the initial SZ measurement in Fig. 2a is implemented using either real-time feedforward (FF) or post-selection (PS). For the physical data points, the state from physical tomography is projected onto the logical subspace before computing the infidelity by fitting to ideal projectors. Error bars represent 1σ from bootstrapping. For all tomographic methods, the error-suppressed scheme achieves a lower state infidelity compared with the standard scheme. The unencoded magic state prepared directly on two physical qubits gives an average (avg.) infidelity across 28 qubit pairs as approximately 6.2 × 10−2 (green dashed line) using 18 repetitions over a 24-h period with 105 shots per circuit. Of these, the best-performing pair yields a minimum (min.) infidelity of (2.354 ± 0.271) × 10−2 (red solid line) found over all repetitions for all qubit pairs. In all cases, the error-suppressed scheme exceeds the fidelity of the best two-qubit unencoded magic state.
Fig. 4
Fig. 4. Magic-state yield for feedforward versus post-selection.
Yield is calculated for logical tomography circuits shown in Fig. 2b,c for the error-suppressed (error supp.) scheme with feedforward (blue circles) versus post-selection (blue squares); a standard scheme is shown for reference (orange squares). All rates use datasets reported in Fig. 3 where error bars represent 1σ from bootstrapping. The shaded area of the graph shows the increase in yield for the error-suppressed scheme using feedforward (FF) compared with the post-selection (PS) scheme or the standard scheme. The optimal acceptance rate assuming no noise is 75% for the feedforward scheme, 37.5% for the post-selection scheme and 25% for the standard scheme. The observed acceptance rates are because of the additional detection of errors. We estimate the yield in the presence of noise in the section ‘Estimates for magic-state yield’. We observe a stark difference in yields between experiments conducted with the logical tomography circuit shown in Fig. 2b,c, shown to the left and right of the dashed line, respectively. We can attribute this to the depth of the logical tomography circuit, in which deeper circuits, such as those shown in Fig. 2c, are more likely to introduce detectable errors. This is discussed in the section ‘Estimates for magic-state yield’.
Extended Data Fig. 1
Extended Data Fig. 1. A generic magic-state distillation protocol.
Encoded input magic states are combined such that higher fidelity magic states are produced with some probability. For a single use of a magic-state distillation protocol, the error of an input magic state ϵ is suppressed like ϵ → ϵd where d is a constant determined by the magic-state distillation protocol. Applying distillation recursively allows us to produce magic states with an arbitrarily high fidelity. By initializing error-suppressed magic states in the first step, where the error is suppressed as ϵ2 we obtain a quadratic improvement in the fidelity of the output magic state.
Extended Data Fig. 2
Extended Data Fig. 2. Small codes.
We describe how to encode these codes into higher distance codes. (left) The error-detecting code prepared in the main text. We refer to this code as the [[4, 2, 2]] code to distinguish it from the [[4, 1, 2]] code shown to the right of the figure. The [[4, 2, 2]] code has stabilizer generators SX = X1X2X3X4 and SZ = Z1Z2Z3Z4 and logical operators X¯A=X1X2, Z¯A=Z1Z3, X¯B=X1X3 and Z¯B=Z1Z2 for logical operators indexed A and B. (right). The [[4, 1, 2]] code is an error detecting code that encodes a single logical qubit. It is closely related to the error detecting code shown (left). It has stabilizer generators SX = X1X2X3X4, STZ=Z1Z2 and SBZ=Z3Z4, and logical operators X¯=X1X2, Z¯=Z1Z3.
Extended Data Fig. 3
Extended Data Fig. 3. Injecting an encoded magic state into the surface code.
The magic state is initially encoded on a [[4, 1, 2]] code. (left) The standard surface code with physical qubits on the vertices of a square lattice and standard Pauli-X and Pauli-Z type stabilizers marked by lattice faces. Supports for the logical Pauli-X and Pauli-Z operators are shown in green and blue, respectively. (right) We show the initial state that is injected into the surface code. The [[4, 1, 2]] code is shown in red in the bottom-left corner. The remaining qubits of the surface code lattice are prepared in a product state, where blue (green) qubits are prepared in the 0v (+v) state. We show the code deformation stabilizers, i.e. Sdef.=Sinit.Sfin., shaded on the right lattice.
Extended Data Fig. 4
Extended Data Fig. 4. Injecting an encoded state into the heavy-hex code.
The injected state is initially encoded on the [[4, 1, 2]] code. (left) A lattice with qubits on the vertices. We show the support of a single Pauli-Z gauge check and a Pauli-X stabilizer operator. The support of the Pauli-Z gauge check is shown in dark gray. The Pauli-X stabilizer operator is shaded grey towards the top of the lattice. We also show the support of a Pauli-X- and Pauli-Z-type stabilizer in green and blue, respectively. (right) The stabilizer group for Sinit.. The [[4, 1, 2]] code is outlined in red in the bottom-left corner of the lattice. The other qubits are initialized in a product state with blue (green) qubits initialized in the 0 (+) state. Stabilizer operators Sdef.=Sinit.Sfin. are shaded in the figure.
Extended Data Fig. 5
Extended Data Fig. 5. Injecting an encoded two-qubit state into the color code.
The state is initially encoded with the [[4, 2, 2]] code. A qubit is supported on each of the vertices of the lattice. We initialize the system Sinit. such that the [[4, 2, 2]] code, shaded in red, is supported on a weight-four face in the bottom left corner of the lattice. The other qubits are prepared in Bell pairs on the highlighted blue and green edge terms. As such, we shade the faces of Sdef. where both a Pauli-X and Pauli-Z stabilizer is supported. The support of the logical operators on the left and bottom boundaries are highlighted in blue and green, respectively.
Extended Data Fig. 6
Extended Data Fig. 6. Preparing a CZ state over two [[4, 1, 2]]-codes.
At step 1 the codes are prepared. The [[4, 2, 2]] code that encodes the two-qubit CZ-state is represented by the red square where its four qubits lie at the vertices of the square. This preparation is described in the main text. The code is prepared adjacent to a [[4, 1, 2]]-code that is initialized in an eigenstate of the + state. The qubits in the figure are indexed according to the qubit-map shown in Extended Data Fig. 7. At step 2 the qubits are transported in order to perform a logical parity measurement in step 3 using the heavy-hex lattice geometry. Note that the qubit indices have changed. This step can be performed with swaps, for instance, as shown in Extended Data Fig. 7(top). At step 3 a logical parity measurement is made. It can be performed in a fault-tolerant manner using qubits 5, 10, and 16, as shown in the green box in Extended Data Fig. 7(bottom). We complete the operation by measuring the logical operator Z¯2 in step 4. This weight-two measurement can be repeated in two locations on the [[4, 2, 2]] code such that a single measurement error can be detected. This final measurement projects the [[4, 2, 2]] code onto the [[4, 1, 2]]-code by reassigning the Z¯B logical operators as stabilizers of the system.
Extended Data Fig. 7
Extended Data Fig. 7. Mapping the encoding onto the heavy-hexagonal lattice geometry.
We encode the CZ-state onto two copies of the [[4, 1, 2]]-code. (top) We prepare the encoded CZ-state as defined in the main text using the qubits outlined in the purple box. We additionally prepare a [[4, 1, 2]]-code in the logical + state using the qubits outlined in the orange box. To perform step 3, as shown in Extended Data Fig. 6, we first move the codes, as in step 2. This can be performed using swap gates between adjacent qubits. Swap gates are performed, first, between pairs of qubits marked by a blue arrow, and then between pairs of qubits marked with green arrows. Each set of swap gates, the blue set and the green set, can be performed in parallel. Completing the swap operations moves the codes over the qubit map. We show the locations of the codes after the swap operations by outlining their supporting qubits with a purple and orange box, respectively, in the bottom figure. In their new locations, the logical parity measurement of step 3 can be performed using ancillary qubits 5,10 and 16, outlined in the green box in the bottom figure. At the final step we facilitate the measurement of Z4Z6 and Z15Z17 using ancillary qubits 5 and 16, respectively.
Extended Data Fig. 8
Extended Data Fig. 8. Magic-state preparation without error suppression.
We can encode a physical CZ state using the circuit outlined in (a), where the preparation step, Prep., is shown in (b). The magic state is then encoded using stabilizer measurements SX and SZ. The preparation circuit, (b), first prepares a CZ state on two physical qubits before preparing the state to encode it in the four-qubit code by stabilizer measurements. The circuit makes use of V=exp(iθY) a Pauli-Y rotation with tanθ=2, a controlled-Hadamard gate and a bitflip. We find that we can simplify the circuit once the CZ state is prepared by making use of the stabilizer operators of the CZ state. As discussed in the main text we observe that the circuit element in the box with a dotted outline acts trivially on the CZ-state. The inclusion of this stabilizer operator allows us to remove all of the Pauli-X and controlled-not operations shown in the circuit, as the circuit elements in the box negate their adjacent self-inverse gates. Indeed, the circuit elements that lie in between the vertical dashed lines act like the identity operator. (c) The CZ state is prepared on two physical qubits, where the circuit elements are defined above. We perform state tomography on this state by making different choices of single-qubit Pauli measurements, P and Q, on the output of this circuit.
Extended Data Fig. 9
Extended Data Fig. 9. Combining readout-error mitigation with state tomography methods.
(a) State infidelity for the standard (orange) vs. error-suppressed (blue) schemes using different tomographic methods; error-bars represent 1σ std. dev. from bootstrapping. On the x-axis, a state is reconstructed with either logical tomography (Logical) or physical tomography after logical projection (Physical); tomography assumes either ideal projectors, as in the main text, or noisy POVMs representing uncorrelated, local readout errors (RO) on terminal data qubit measurements. Raw physical tomography (Raw Phys.) refers to the state on four physical qubits prior to logical projection. Red dotted (green dot-dashed) lines show lowest (average) state infidelities of the two-qubit unencoded magic state prepared with RO mitigation. With RO mitigation, logical tomography outperforms the min. unencoded state supporting conclusions in the main text. (b)-(e) Heatmap of state infidelity vs. avg. measurement error, p ≡ P(1∣0), q ≡ P(0∣1). Experimental tomography data is fit to noisy POVMs using a parameterized A-matrix, A ≔ [[1 − p, q], [p, 1 − q]], where p, q are constant for all qubits and time. Experimental readout calibrations data are averaged over time and qubits, and correspond to a single state infidelity in (b)-(e) (black dots). These state infidelities (black dots) do not coincide with local minima (red stars) or even high-fidelity regions. (f)-(g) Readout calibration measurements of p, q vs. time for all four data qubits over several days; average rates (black solid) are used in (b)-(e) for state fidelities marked by black dots.

References

    1. Harper R, Flammia ST. Fault-tolerant logical gates in the ibm quantum experience. Phys. Rev. Lett. 2019;122:080504. doi: 10.1103/PhysRevLett.122.080504. - DOI - PubMed
    1. Ryan-Anderson C, et al. Realization of real-time fault-tolerant quantum error correction. Phys. Rev. X. 2021;11:041058.
    1. Egan L, et al. Fault-tolerant control of an error-corrected qubit. Nature. 2021;598:281–286. doi: 10.1038/s41586-021-03928-y. - DOI - PubMed
    1. Chen EH, et al. Calibrated decoders for experimental quantum error correction. Phys. Rev. Lett. 2022;128:110504. doi: 10.1103/PhysRevLett.128.110504. - DOI - PubMed
    1. Sundaresan N, et al. Demonstrating multi-round subsystem quantum error correction using matching and maximum likelihood decoders. Nat. Commun. 2023;14:2852. doi: 10.1038/s41467-023-38247-5. - DOI - PMC - PubMed