Errors are inevitable in any real information processor. Quantum computers are particularly susceptible to errors as quantum systems are highly sensitive to noise effects that can be exotic compared with the simple bit-flip errors of classical computation. As such, realizing a fault-tolerant quantum computer is a significant challenge that requires encoding the information into a quantum error-correcting code. To add to the difficulty, direct extraction of the information typically destroys the system, and ancillary syndrome systems must be employed to perform non-demolition measurements of the encoded state. Previous work in nuclei1,2,3, trapped ions4,5,6 and superconducting qubits7 has attempted to address similar problems; however, these implementations lack the ability to perform fault-tolerant syndrome extraction, which continues to be a challenge for all physical quantum computing systems.

The surface code (SC)8,9 is a promising candidate to achieve scalable quantum computing due to its nearest-neighbour qubit layout and high fault-tolerant error thresholds10. The SC is an example of a stabilizer code11, which is a code whose state is uniquely defined by the measurement of a set of observables called stabilizers. Code qubits in the SC are placed at the vertices of a two-dimensional array and each stabilizer involves four neighbouring code qubits. The SC stabilizers are, therefore, geometrically local and can be measured fault tolerantly with a single syndrome qubit12. Error detection on a lattice of code qubits is achieved through mapping stabilizer operators onto a complementary lattice of syndrome qubits, followed by classical correlation of measured outcomes. Among the syndrome qubits, a distinction is made between bit-flip syndromes (or Z-syndromes) and phase-flip syndromes (or X-syndromes). Each code qubit in the SC is coupled with two X-syndrome qubits and two Z-syndrome qubits, and, in turn, each syndrome qubit is coupled with four code qubits.

Superconducting qubits have become prime candidates for SC implementation13,14, especially with continuing improvements to coherence times15,16,17 and quantum gates18. Furthermore, implementing superconducting resonators as quantum buses to realize the circuit quantum electrodynamics architecture permits a straightforward path for building connectivity into a lattice of superconducting qubits14. There are numerous ways of building the SC lattice with superconducting qubits and resonators. Here we employ an arrangement in which each qubit is coupled with two bus resonators and each bus couples with four qubits14. Although previously the engineered dissipation of a resonator has been used to stabilize the entanglement of two superconducting qubits to which it is coupled19, it is of note that here the stabilization is achieved via explicitly mapping code qubit stabilizers onto syndrome qubits.

Here we experimentally demonstrate the complete algorithm constituting a quantum error detection code that detects arbitrary single-qubit errors in a non-demolition manner via syndrome measurements. The scheme is implemented in a two-by-two lattice of superconducting qubits that represents a primitive tile for the SC. Stabilizer measurements, ubiquitous to fault-tolerant quantum error-correcting codes, are successfully demonstrated in this work for both bit- and phase-flip errors on an encoded codeword. The non-demolition nature of the protocol is verified by demonstrating the preservation of the entangled state constituting the codeword through high-fidelity syndrome measurements in the presence of an arbitrary applied error. These error detection experiments constitute a key milestone for SC implementation, as our operations now extend into the plane of the two-dimensional surface and we show the ability to concurrently perform bit- and phase-parity checks. Moreover, our results illustrate the ability to build structures of superconducting qubits, which are not co-linear but latticed while preserving high-fidelity operations. Moving forward, on improving the measurement and gate fidelities in these systems, further expanding the lattice will lead to important studies of different error-correcting codes and the encoding of logical qubits, thereby allowing experimental investigation of fault-tolerant quantum computing. Our results bolster the prospect of employing superconducting qubit lattices for large-scale fault-tolerant quantum computing.


Physical device and quantum control

Our physical device (Fig. 1a,b) consists of a 2 × 2 lattice of superconducting transmons, with each coupled with its two nearest neighbours via two independent superconducting coplanar waveguide (CPW) resonators serving as quantum buses (Fig. 1b; blue). Each qubit is further coupled with an independent CPW resonator for both qubit control and readout. Dispersive readout signals for each qubit are amplified by distinct Josephson parametric amplifiers (JPAs) giving high single-shot readout fidelity20,21. We implement two-qubit echo cross-resonance (ECR) gates22, ECR=ZX90XI, which are primitives for constructing controlled-NOT (CNOT) operations. Given the latticed structure of our device, we implement four different such gates, ECRij between qubits Qi (control) and Qj (target), with ij{12,23,34,41}. In this arrangement, we use Q1 and Q3 (Fig. 1b; purple) as code qubits, Q2 as the Z-syndrome qubit (Fig. 1b; green) and Q4 as the X-syndrome qubit (Fig. 1b; yellow). All ECR gates are benchmarked22 with fidelities between 0.93 and 0.97 (for further details see Methods). Single-qubit gates are benchmarked to fidelities above 0.998 with <0.001 reduction in fidelity due to crosstalk, as verified via simultaneous randomized benchmarking23. The four independent single-shot readouts yield assignment fidelities (see Methods) all above 0.94. These and other relevant system experimental parameters including qubit frequencies, anharmonicities, energy relaxation and coherence times are further discussed in the Methods.

Figure 1: Surface code implementation and error detection quantum circuit.
figure 1

(a) Cartoon schematic of SC consisting of alternating square tiles of X- (yellow) and Z- (green) plaquettes for detecting phase-flip (Z) and bit-flip (X) errors, respectively. Semi-circular pieces reflect parity checks at the boundaries of the lattice. These plaquette tiles can be mapped onto a lattice of physical superconducting qubits with appropriate nearest-neighbour interconnectivity, as shown in the layer labelled MAP. Here there are code qubits (purple spheres), X-syndrome qubits (yellow) for phase parity detection of surrounding code qubits, and Z-syndrome qubits (green) for bit parity detection of surrounding code qubits. The physical connectivity for superconducting qubits can be realised via coupling every qubit to two quantum bus resonators, shown as wavy blue diamonds in the MAP. The device studied in this work (false-colored optical micrograph in b) embodies two half-plaquettes of the SC as circled in a, and allows for independent and simultaneous detection of X and Z errors on two-code qubits, shaded purple in b and labelled Q1 and Q3. (c) The circuit to implement the half-plaquette operations encodes the bit (ZZ) and phase (XX) parities of the two-code qubits' Bell state onto the respective syndrome qubits, Q2 (green) and Q4 (yellow). Arbitrary errors ɛ are intentionally introduced on the code qubit Q1 and detected from the correlated measurement of the syndrome qubits. Q2 (Q4) is initialized to . A Hadamard operation, H, is applied to Q4 before measurement.

Quantum error detection protocol implementation

Our four-qubit square lattice is a non-trivial cut-out of the SC layout (circled in Fig. 1a), and can be used to demonstrate both the ZZ and XX parity check. The XX (ZZ) stabilizer is measured by the X-syndrome (Z-syndrome) qubit. Although previous work14,24,25,26 implemented parity checks on linear arrangements of qubits, our experiment goes beyond into the other planar dimension. The extra dimension allows us to demonstrate the [[2,0,2]] code, which contains 2 physical qubits, 0 logical qubits (and hence a single fixed code state), and has a distance of 2, which means arbitrary single-qubit errors are detectable. The codeword is the two-qubit entangled state , which is protected from any single-qubit error on the codespace via syndrome detection. An arbitrary single-qubit error revealed in the stabilizer syndrome as a bit- (phase) flip simply maps to a negative eigenstate of ZZ (XX), and a joint bit- and phase-flip (Y rotation) maps to the negative eigenstate of both ZZ and XX. By encoding both the XX and the ZZ stabilizers in the four-qubit lattice, we can protect a maximally entangled state of the two-code qubits against an arbitrary error.

To demonstrate the SC sub-lattice stabilizer measurement protocol (Fig. 1c), we first prepare the two-code qubits in codeword state , which is a maximally entangled Bell state. Subsequently, the ZZ stabilizer is encoded onto the Z-syndrome qubit Q2, which is initialized in the ground state . The XX stabilizer is encoded onto the X-syndrome qubit Q4, which is initialized in the state. Since we perform measurements of the syndrome qubits in the Z measurement basis, Q4 also undergoes a Hadamard transformation H right before measurement. The complete circuit as shown in Fig. 1c will detect an arbitrary single-qubit error ɛ to the code qubits via the projective measurements of the syndrome qubits. We choose to apply the error on Q1, but there is no loss of generality if applied on Q3 instead. Each of the four possible outcomes of the syndrome qubit measurements projects the code qubits onto one of the four maximally entangled Bell states. If no error is present in the sequence, the syndrome qubits are both found to be in their ground state after the measurement, and the prepared codeword state of the code qubits is preserved.

In our experiment, since the two-code qubits (Q1 and Q3) are non-nearest neighbours in the lattice, the preparation of the codeword state is performed via two-qubit interactions with a shared neighbouring qubit, Q2. The gate sequence for this state preparation can be compiled together with portions of the ZZ stabilizer encoding. The resulting complete gate decomposition of the circuit from Fig. 1c in terms of our available single- and two-qubit ECR gates is described in detail in the Methods.

To implement arbitrary errors to the entangled code qubit state, we apply single-qubit rotations to Q1 of the form ɛ=Uθ, where U defines the rotation axis and θ is the rotation angle (when no angle is given it is assumed θ=π). Following the error detection protocol of Fig. 1c, we acquire single-shot measurements of the syndrome qubits and correlate independent measurements around various axes of the code qubits for quantum state tomography27. First, for the case where ɛ=U0, when no error is added, the two syndrome qubits Q2 and Q4 should both be measured to be in their ground states, and from correlating their single-shot measurements, M2 and M4, we detect the colour map as shown in Fig. 2a. Here, we can clearly see that a majority of the resulting measurements are located in the lower left quadrant, and we will use the notation {M2,M4}={0,+}, with both syndromes signalling a ground state detection (note that measuring Q4 in the ground state signals a detection given the H before measurement). Conditioned on {0,+}, state tomography of the code qubits is performed, with a reconstructed final state (Pauli vector shown in Fig. 2a), commensurate with the originally prepared codeword state with a fidelity of 0.8491±0.0005. Next, for the case of a bit-flip error to Q1, or ɛ=Xπ, the resulting syndrome histograms are shown in the colour map in Fig. 2b, where a majority of results are consistent with {1,+}, where the Z-syndrome Q2 is excited to and the X-syndrome Q4 remains in its ground state. Conditioned on {1,+}, the reconstructed final state Pauli vector of the code qubits is now , verifying the bit-flip parity error. Then, for the case of a phase-flip error on Q1, or ɛ=Zπ, we find that the syndromes give {0,−}, with the X-syndrome having changed its state (Fig. 2c). Similarly, conditioned on {0,−}, the code qubit state agrees with , showing the phase flip. Finally, an error ɛ=Yπ results in both syndromes flipped, {1,−}, as shown in Fig. 2d with corresponding code qubit Pauli vector in agreement with both a bit and phase flip of the original codeword state .

Figure 2: Correlated syndrome single-shot histograms and quantum state tomography of code qubits.
figure 2

The quantum state of the syndrome qubits reveals the entangled state of the code qubits. The colormaps show the single-shot histograms of the syndrome measurements on Q2 and Q4. The dashed white lines indicate the threshold used to condition the reconstruction of the code qubit states, represented by a Pauli vector. The pink-, blue- and purple-shaded regions signify Q1, Q3 and joint Pauli operators, respectively (black filled bars, experiment, white bars in background, ideal). Each of the possible four outcomes of correlated single-shot measurements of the syndrome qubits is mapped onto one of the four maximally entangled Bell states of the code qubits. Since we always prepare the code qubits in the codeword state at the beginning of the quantum process, when no error is applied to Q1, state tomography of Q1 and Q3 conditioned on outcomes in the lower left quadrant {0,+} of the colormap recover the same state with fidelity 0.8491±0.0005 (a). Introducing an error ɛ equal to X (b), Z (c) and Y (d) on Q1, and conditioning on outcomes in the upper left {1,+}, lower right {0,−} and upper right {1,−} quadrants results in the code qubits reconstructed as (fidelity 0.8195±0.0006), (with fidelity 0.8046±0.0005) and (fidelity 0.8148±0.0006), respectively. The X-syndrome qubit, Q4, is found in its excited state when a phase-flip error has occurred (c,d), whereas the Z-syndrome qubit, Q2, is found in its excited state as a result of bit-flip errors (b,d). The quoted uncertainties in reconstructed state fidelities are statistical (see Methods), but we note that systematic errors due to coherence time fluctuations, state preparation and measurement errors can lead to indifelity 0.01–0.02.

The reconstructed states reveal important information about our system. First, the measured state fidelity (0.80–0.84) is higher than expected (0.75) from the measured fidelities of the five two-qubit gates and two independent single-shot measurements. This is because the gates used to prepare the codeword state do not contribute to the accumulated state fidelity loss, but rather reveal themselves as measurement errors. Second, the reconstructed conditional states have little to no weight in the single-qubit subspace. This suggests that in our system there are negligible crosstalk errors (as expected since the code qubits are not directly connected via a bus).

Tracking arbitrary errors

We can track the outcome of the syndrome qubits as we slowly vary θ in an applied error ɛ=Yθ between −π and +π (see Fig. 3). The state population of the four syndrome qubit states, {0,+} (black dots), {1,+} (red dots), {0,−} (green dots) and {1,−} (blue dots), obtained from the (normalized) number of counts in the correlated histograms conditioned on a readout threshold extracted from calibration measurements (see Methods), are plotted versus θ. For an error induced by a unitary operation, the data is explained by cosines (solid lines in Fig. 3). For θ near 0, the ground state, {0,+}, is found in both syndrome qubits as expected, whereas for |θ|π, we recover both the syndrome flips {1,−}. The observed contrast between the different syndrome qubit state populations, near 0.6 in Fig. 3, is commensurate with a master-equation simulation that takes into account the measured coherence times of our qubits and the assignment fidelities of the readouts (dashed lines in Fig. 3). Similarly, varying θ for X and Z rotations are shown in the Methods.

Figure 3: Syndrome qubits single-shot correlated measurement for different Y-error magnitudes.
figure 3

The magnitude of each type of error in the code qubits can be extracted from the correlated single-shot traces of the syndrome qubits. Errors of ɛ=Yθ, with θ[−π,π] are detected by both syndromes, as Y errors can be decomposed into a combination of bit- and phase-flip errors. As the magnitude of the Y error increases from 0 to π, the majority of the outcomes of the syndrome qubits changes from {M2,M4}={0,+} (black dots) to {M2,M4}={1,−} (blue dots), while the states {M2,M4}={1,+} (red dots) and {M2,M4}={0,−} (green dots), which indicate pure bit- and phase-flip errors, respectively, remain low probability. Solid lines are simple cosine fits to the data. Dashed lines are master-equation simulations that take into account the measured coherence times and assignment fidelities. Histograms of the correlated single-shot syndrome qubit measurements are shown in the density plots on top for θ{−π,−π/2,0,π/2,π}, as indicated by the vertical dashed lines, with the syndrome states corresponding to |θ|=π/2 showing significant populations in two quadrants.

To demonstrate arbitrary error detection, we construct ɛ via combinations of X and Y errors. Each panel of Fig. 4 shows a teal bar plot reflecting the experimentally extracted population of each of the four possible syndrome qubit measurement outcomes for the set of errors {Yπ/3, Xπ/3, Xπ/3Yπ/3, Xπ/3Y2π/3, X2π/3Yπ/3, X2π/3Y2π/3, R, H}, where R=Yπ/2Xπ/2 and H is the Hadamard operation. Overall, we find decent agreement between the experiment and ideal population outcomes (dark blue bars). The measured populations are renormalized by the observed contrast at θ0 in Fig. 3, and in the equivalent plots for X and Z errors shown in the Methods, to account for relaxation and decoherence fidelity loss. Although this renormalization provides an overall fairer comparison with the ideal case, it tends to increase the uncertainty in the bars, especially for the Z error due to the loss of contrast and larger data scatter observed for the X-syndrome qubit Q4 (see Methods). This diminished contrast is due to the fact that the XX stabiliser is encoded last in our sequence and therefore suffers more from decoherence.

Figure 4: Detection of arbitrary errors.
figure 4

The probability of each type of error, identity (Id), X, Y or Z, is extracted from the correlated syndrome measurements for all the applied ɛ, as indicated above each panel. Dark blue bars represent the ideal outcome for each ɛ and teal bars are measurements calibrated by the full X, Y and Z error rotation curves. The errors labelled as R and H correspond to a Yπ/2Xπ/2 operation, which maps the xyz axes in the Bloch sphere to yzx, and the Hadamard gate, respectively. The results are consistent with a higher uncertainty in the phase-flip error detection, likely due to decoherence during the full sequence and the order of syndrome detection.


We have provided a set of experiments that demonstrate the detection of arbitrary single-qubit quantum errors on a square lattice of qubits. The experiments combine a variety of key components required for scaling quantum systems up to larger numbers of qubits: high-fidelity one- and two-qubit gates, high single-shot assignment fidelities allowing for non-demolition measurements of code qubits and improved system design to minimize crosstalk effects in non-trivial lattices of nearest-neighbour-coupled qubits. Moving forward, continued improvement of gate and assignment fidelities will be required to reach fault-tolerance thresholds. This will require continued understanding of potential sources of error in our system, such as calibration and crosstalk effects, as well as improved system design and engineering. In addition, achieving shorter measurement times and measurement repeatability will be key for demonstrating large-scale experimental quantum error correction. While there remain significant challenges in implementing complex operations on larger lattices of qubits, the work we have presented here demonstrates that a high degree of control and microwave hygiene can be achieved with superconducting qubits arranged in geometries useful for fault-tolerant quantum computation.


Device fabrication and parameters

The device is fabricated on a 720-μm-thick Si substrate. The superconducting CPW resonators, the qubit capacitors and coupling capacitors are defined in the same step via optical lithography. Reactive ion etching of a sputtered 200-nm-thick Nb film is used to make this layer. The Josephson junctions, patterned via electron beam lithography, are made by double-angle deposition of Al (layer thicknesses of 35 and 85 nm) followed by a liftoff process. The chip is mounted on a printed circuit board and wirebonded for signal delivery and crosstalk mitigation.

The four-qubit transition frequencies are ωi/2π={5.303,5.101,5.291,5.415} GHz with i{1,2,3,4}. The readout resonator frequencies are ωRi/2π{6.494,6.695,6.491,6.693} GHz, while the four bus resonators, unmeasured, are designed to be at ωBii/2π={8,7.5,8,7.5} GHz for ij{12,23,34,41}. All qubits show around 330 MHz anharmonicity, with energy relaxation times T1(i)={33,36,31,29} μs and coherence times  μs. The dispersive shifts and line widths of the readout resonators are measured to be 2χi/2π={−3.0,−2.0,−2.5,−2.8} MHz and κi/2π={615,440,287,1210} kHz, respectively.

Gate calibration and characterization

Single-qubit gates are 53.3-ns long Gaussian pulses with width σ=13.3 ns. We use single-sideband modulation to avoid mixer leakage at the qubit frequencies in between operations. The sideband frequencies, which are chosen taking into account all qubit frequencies and anharmonicities, are +60, −80, +180 and +100 MHz for Q1, Q2, Q3 and Q4, respectively. Every single-qubit pulse is accompanied by a scaled Gaussian derivative in the other quadrature to minimize the effect of leakage of information into higher qubit energy levels28. All microwave mixers are independently calibrated at the operational frequencies to minimize carrier leakage as well as to ensure orthogonality of the quadratures. Following these calibrations, the single-qubit rotations are tuned by a series of repeated rotations described elsewhere29.

Randomized benchmarking (RB) of single-qubit gates30 is performed for all four qubits independently and in all possible simultaneous configurations (Table 1). This allows us to establish the degree of addressability error23 present in our system. Comparing the individual and simultaneous RB experiments, we can see that the addressability error is 0.001 or lower in all cases.

Table 1 Summary of simultaneous single-qubit RB.

The two-qubit ECR gates consist of two cross-resonance pulses of different signs, each of duration τ, separated by a π rotation in the control qubit. This sequence selectively removes the IX part of the Hamiltonian while enhancing the ZX term22. Each cross-resonance pulse has a Gaussian turn-on and off of width 3σ with σ=24 ns, included in τ. The gates ECR12, ECR23, ECR34 and ECR41, where ECRij is the ECR gate between Qi (control) and Qj (target), had τ of 400, 360, 440 and 190 ns, respectively, for a total gate time of 2 × τ+53.3 ns. We also characterise the two-qubit gates via Clifford RB22. Figure 5 shows the RB decays for each of the four gates, yielding an error per two-qubit Clifford gate of 0.0604±0.0006, 0.0631±0.0007, 0.0569±0.0015 and 0.0353±0.0015 for ECR12, ECR23, ECR34 and ECR41, respectively.

Figure 5: Two-qubit randomized benchmarking.
figure 5

Average population of the ground state of the target qubit, P0, versus number of two-qubit Cliffords generated via ECR gates between (a) Q1 and Q2, (b) Q2 and Q3, (c) Q3 and Q4, and (d) Q4 and Q1. Each RB experiment is averaged over 50 different sequences. Fits to the experiments are shown as solid lines and yield average errors per two-qubit Clifford of (a) 0.0604±0.0006, (b) 0.0631±0.0007, (c) 0.0569±0.0015 and (d) 0.0353±0.0015. Inset shows ZX oscillations22 of the target qubit state population as a function of the cross-resonance drive length when the control qubit is in the ground (blue) or in the excited (red) state.

Experimental setup

We cool our device to 15 mK in an Oxford Triton dilution refrigerator. Figure 6 shows a full schematic of the measurement setup. We achieve independent single-shot readout for each qubit using a high-electron-mobility transistor (HEMT) amplifier following a JPA (provided by UC Berkeley) in each readout line. The device is protected from environmental radiation by an Amuneal cryoperm shield with an inner coat of Emerson & Cuming CR-124 Eccosorb. All qubit control lines are heavily attenuated at different thermal stages and home-made Eccosorb microwave filters are added at the coldest refrigerator plate. Figure 7 shows the circuit schematic at chip level, including the design of the qubit capacitance and coupling lines.

Figure 6: Experimental setup.
figure 6

Detailed wiring scheme for all room temperature control electronics and internal configuration of the Oxford Instruments Triton dilution refrigerator.

Figure 7: Device and circuit schematic and qubit geometry.
figure 7

The optical image shows all components of the device, including the four qubits, Q1Q4, the four readout resonators R1R4 and the four coupling buses B12, B23, B34 and B41. The readout resonators also serve as qubit control lines, with single- and two-qubit gates applied at frequencies ωi with i{1,2,3,4}. Readout is performed at the resonator frequency ωMi. Each readout signal is reflected off a JPA, pumped at frequency ωPi, before being sent to a HEMT amplifier at 4 K. A blowup of one of the qubits is also shown, depicting the capacitor geometry as well as the coupling lines to the readout resonator (green coupler) and to the buses (red couplers). The black scale bar represents a length of 100 μm.

Single-qubit and two-qubit control pulses as well as resonator readout pulses are generated using single-sideband modulation. The modulating tones are produced by Tektronix arbitrary waveform generators (model AWG5014) for qubit operations. Modulating shapes for readout are produced by Arbitrary Pulse Sequencers from Raytheon BBN Technologies. We either use external Marki I/Q mixers with a Holzworth microwave generator or an Agilent vector signal generator (E8257D) as depicted in Fig. 6. For data acquisition, we use two AlazarTech two-channel digitizers (ATS9870) and the single-shot readout time traces are processed with an optimal quadrature rotation filter27.

Circuit gate decomposition

The circuit in Fig. 1c calls for four two-qubit gates. In addition, the code qubits Q1 and Q3 need to be prepared in an entangled state. Since these qubits are not nearest neighbours and there is no provision for interaction between them—a key feature of the SC—we first entangle Q1 and Q2 and then perform a swap operation between Q2 and Q3 (Fig. 8a). A SWAP gate operation is equivalent to three CNOT gates alternating direction (Fig. 8b). Since two consecutive identical CNOT gates are equal to the identity operation and Q3 starts from the ground state, the red shadowed regions in Fig. 8 can be omitted. The actual circuit implemented in our experiments is shown in Fig. 8c, where the Bell state preparation and the ZZ encoding have been combined.

Figure 8: Quantum circuit and CNOT gate decomposition.
figure 8

The ZZ and XX parity checks are performed on a pair of maximally entangled qubits. This entanglement is achieved in our architecture with one CNOT and one SWAP gate (a). The three CNOTs that define the SWAP gate can be combined with the following ZZ parity check operation to simplify the circuit and three CNOT gates can be eliminated (b). The final circuit implemented in our experiments has a total of five CNOT gates (c). We implement our CNOT gates using a simplified version of the gate, ECRij, consisting of two cross-resonance pulses of different sign separated by a π rotation in the control qubit. With that definition, a CNOT gate can be obtained with four single-qubit rotations plus a ECRij operation. An example, not unique, of such decomposition is shown in d. The complete gate sequence in our error detection experiments is presented in e, where the dark boxes indicate refocus pulses during every two-qubit gate on the two qubits not involved on it.

Our CNOT operations require an entangling gate between the control and the target qubits. We use the ECRij as our CNOT genesis. The ECRij gate plus four single-qubit rotations as depicted in Fig. 8c correspond to a CNOT operation between Qi and Qj in our device.

Tracking bit- and phase-flip errors

As introduced in the main text (Fig. 3), we can measure the magnitude of the error ɛ from the correlated single-shot traces of the syndrome qubits. Here we show the figures complementing Fig. 3 in the main text, corresponding to pure bit-flip error (Fig. 9a) and pure phase-flip error (Fig. 9b). We attribute the increased loss of contrast in the phase-flip error detection (Fig. 9b) to the order of the stabilizer encoding in our circuit, which makes our error detection protocol less sensitive to phase-flip errors.

Figure 9: Continuous tracking of pure bit- and phase-flip errors.
figure 9

Errors of ɛ=Xθ (a) and ɛ=Zθ (b) with θ[−π,π] are applied to the code qubit Q1. The syndrome qubit states {M2,M4}={0,+} (black), {M2,M4}={0,−} (green), {M2,M4}={1,+} (red) and {M2,M4}={1,−} (blue) indicate the magnitude and nature of the error ɛ. Since the ZZ and XX parities are encoded into Q2 and Q4, respectively, pure bit-flip errors are detected by Q2, whereas pure phase-flip errors are detected by Q4.

Error propagation and syndromes

After the SWAP gate and error in the circuit in Fig. 8a, the state of the code qubits is given by , where ɛ is some unitary operator acting on the first-code qubit. We will find how the different Pauli errors propagate through the rest of the circuit to produce the different error syndromes.

First, suppose ɛ is the bit-flip operation on the first-code qubit C1. In this case,

where the sub-indexes S1 and S2 refer to the Z- and X-syndrome qubits, Q2 and Q4 in our experiment, respectively. Similarly for the phase-flip operation ,

and for

Since the state after the SWAP gate is (the qubits are ordered and Q1, Q3 are the code qubits), the error syndromes are given by

Hence, if the error is a general single-qubit unitary operation

the different error syndromes have the following probabilities of occurring

where ni is the ith component of the unit vector.

Readout characterization

To characterize each readout, we create the 24=16 standard computational basis (calibration) states and record the full time-dependent trajectory of the state of the cavity over a measurement integration time of 3 μs. This process is repeated 19,200 times to gather sufficient statistics. Integrating kernels are obtained for each measurement channel, which extract the full time-dependent readout information27. Histograms are fitted to the integrated shots and thresholds for each channel are set at the point of maximum distance between cumulative distributions of the histograms.

The assignment fidelity of each channel is calculated according to the standard formula

where P(0|1) (P(1|0)) is the probability of obtaining ‘0’ (‘1’) when state () is created. The assignment fidelities are given in Supplementary Table 1.

State tomography

The conditional states of the code qubits (Q1 and Q3) for the different error types (I, X, Y and Z) were reconstructed by applying the complete set of 36 unitary rotations to the state of code qubits to attain a complete set of measurement operators. The fundamental measurement observables that are rotated by elements of are constructed from the calibration states by first normalizing the shots for each of the code qubit channels to lie in [−1,1] and then correlating the shots. Note that if the calibrations were perfect, then are equal to ZI, IZ and ZZ.

For each of the 36 different measurement settings, we bin each shot according to the measurement results of the syndrome qubits Q2 and Q4. As there are two syndrome qubits, there are four bins labelled by down–down, down–up, up–down and up–up. Denoting the conditional states ρdd, ρdu, ρud and ρuu and we have full tomographic information of the state of the code qubits for each of the four bins. The shots are correlated to create the expectation values of each conditional state. Hence, for each , label ab, and observable , we have an estimate of trace.

For each label ab, we have a measurement vector mab of length 108 (36 unitary rotations × 3 fundamental observables). Choosing any representation xab of ρab in some operator basis allows us to write

where M is a constant matrix whose entries depend only on the choice of operator basis. We choose to use the standard Pauli basis to represent ρab,

which implies M is a 108 × 16 matrix. Enforcing ρab to be trace 1 sets x0=1/4.

xab can be solved for in a variety of ways, the most straightforward of which is linear inversion via computing the pseudoinverse of M. While linear inversion provides a valid statistical estimator, it does not enforce positivity of the state. Alternatively, one can maximize the likelihood function for the measurement results under the assumption of Gaussian noise29 and solve the following constrained quadratic optimization problem

to obtain a physically valid state. Here Vab is the variance matrix of the measurement matrix. When only Gaussian noise is present, solving this optimization problem is equivalent to finding the closest physical state to the linear inversion estimate31.

We quantify the state reconstruction via the state fidelity between ρnoisy=ρab and the ideal target state ;

where, as mentioned in the main text, the ideal states for the different syndrome results are given by

The results are contained in Supplementary Table 2. The variance in the state fidelity is computed via a bootstrapping protocol described in ref. 29 and the physicality is the sum of the negative eigenvalues of the linear inversion estimate. We see that linear inversion produces physical estimates in all cases and there is negligible difference between the fidelities of the physical and linear inversion estimates.

Insensitivity to state-preparation errors

Since we are conditioning on the measurement results of the syndrome qubits, the error detection circuit has the useful feature that rotation errors on the prepared (encoded) two-qubit state correspond only to decreasing the success probability of preserving the desired state. From a tomographic standpoint, we can accurately reconstruct the conditioned state as long as the total number of shots is large relative to the error syndrome probability, so that sufficient measurement statistics are available.

To make this precise, suppose that the ideal initial state is rotated via some error operator E to the state

This gives the following syndrome probabilities:

and so the probability of successfully obtaining the correct state is |a|2. Since the shots producing the error syndromes are evenly distributed throughout the different unitary rotation pulses on the code qubits, the effect on the code state is to reduce the number of shots by a factor of |a|2, which can also be thought of as a rescaling of the measurement variances by . Hence, for each of the 108 different measurement observables , has a single-shot variance that scales as . This implies we expect that, to first order in θ, state tomography is robust to over-under rotation errors.

We can model and verify this effect by directly applying a unitary error of varying strength on the first-code qubit. The general unitary Kraus operator is and the probabilities for the different syndromes are given by equation (6). For simplicity, we chose a purely X rotation so ɛ=cos(θ)Ii sin(θ)X and varied the size of the angle in 30 steps from −π to π. The state fidelity as a function of θ is shown in Supplementary Fig. 1. As expected, the first derivative appears to smoothly converge to 0 as θ converges to 0 and the loss in fidelity is a result of insufficient statistics for the 00-syndrome state.

This discussion also allows us to more accurately predict the output conditional state fidelities. As demonstrated, we can effectively ignore coherent errors in the first two CNOT gates, since they are used for state preparation and errors in these operations show up as a reduction in the number of shots available for tomography. Assuming the number of shots is large enough, and ignoring single-qubit errors, we are only concerned with errors in the final three CNOT gates. From two-qubit RB, the average gate fidelity of our CNOT gates is 0.94. Hence, assuming depolarizing errors, we can obtain an approximate gate fidelity for the comprised circuit of 0.943=0.83 and state fidelities with similar values, which is consistent with our obtained fidelities in Supplementary Table 2.

Additional information

How to cite this article: Córcoles, A.D. et al. Demonstration of a quantum error detection code using a square lattice of four superconducting qubits. Nat. Commun. 6:6979 doi: 10.1038/ncomms7979 (2015).