Detecting arbitrary quantum errors via stabilizer measurements on a sublattice of the surface code

To build a fault-tolerant quantum computer, it is necessary to implement a quantum error correcting code. Such codes rely on the ability to extract information about the quantum error syndrome while not destroying the quantum information encoded in the system. Stabilizer codes are attractive solutions to this problem, as they are analogous to classical linear codes, have simple and easily computed encoding networks, and allow efficient syndrome extraction. In these codes, syndrome extraction is performed via multi-qubit stabilizer measurements, which are bit and phase parity checks up to local operations. Previously, stabilizer codes have been realized in nuclei, trapped-ions, and superconducting qubits. However these implementations lack the ability to perform fault-tolerant syndrome extraction which continues to be a challenge for all physical quantum computing systems. Here we experimentally demonstrate a key step towards this problem by using a two-by-two lattice of superconducting qubits to perform syndrome extraction and arbitrary error detection via simultaneous quantum non-demolition stabilizer measurements. This lattice represents a primitive tile for the surface code, which is a promising stabilizer code for scalable quantum computing. Furthermore, we successfully show the preservation of an entangled state in the presence of an arbitrary applied error through high-fidelity syndrome measurement. Our results bolster the promise of employing lattices of superconducting qubits for larger-scale fault-tolerant quantum computing.

To build a fault-tolerant quantum computer, it is necessary to implement a quantum error correcting code. Such codes rely on the ability to extract information about the quantum error syndrome while not destroying the quantum information encoded in the system. Stabilizer codes 1 are attractive solutions to this problem, as they are analogous to classical linear codes 2 , have simple and easily computed encoding networks, and allow efficient syndrome extraction. In these codes, syndrome extraction is performed via multi-qubit stabilizer measurements, which are bit and phase parity checks up to local operations. Previously, stabilizer codes have been realized in nuclei [3][4][5] , trapped-ions [6][7][8] , and superconducting qubits 9 . However these implementations lack the ability to perform fault-tolerant syndrome extraction which continues to be a challenge for all physical quantum computing systems. Here we experimentally demonstrate a key step towards this problem by using a twoby-two lattice of superconducting qubits to perform syndrome extraction and arbitrary error detection via simultaneous quantum non-demolition stabilizer measurements. This lattice represents a primitive tile for the surface code (SC) 10,11 , which is a promising stabilizer code for scalable quantum computing. Furthermore, we successfully show the preservation of an entangled state in the presence of an arbitrary applied error through high-fidelity syndrome measurement. Our results bolster the promise of employing lattices of superconducting qubits for larger-scale fault-tolerant quantum computing.
The surface code (SC) has become a popular choice for physical implementation due to its nearest-neighbour qubit layout and high fault-tolerant error thresholds 12 . Code qubits are placed at the vertices of a twodimensional array and each stabilizer involves four neighbouring code qubits (see Fig. 1a). These stabilizers are therefore geometrically local and can be measured fault tolerantly with a single syndrome qubit 13 . 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. Amongst the syndrome qubits, a distinction is made between bit-flip syndromes (or Zsyndromes) and phase-flip syndromes (or X-syndromes).
Each code qubit in the SC is coupled to two X-syndrome qubits and two Z-syndrome qubits, and in turn, each syndrome qubit is coupled to four code qubits.
Furthermore, implementing superconducting resonators as quantum buses to realize the circuit quantum electrodynamics architecture permits a straightforward path to building connectivity into a lattice of superconducting qubits 15 . Although there are numerous ways of building the SC lattice with superconducting qubits and resonators, we employ an arrangement in which each qubit is coupled to two bus resonators, and each bus couples to four qubits 15 . The breakdown of the surface code into such an arrangement is shown in Fig. 1a. Although previously the engineered dissipation of a resonator has been used to stabilize the entanglement of two superconducting qubits to which it is coupled 20 , it is of note that here the stabilization is achieved via explicitly mapping code qubit stabilizers onto syndrome qubits.
For this work, we construct a four-qubit square lattice, which is a non-trivial cut-out of the SC layout (circled in Fig. 1a) and demonstrate both the ZZ and XX parity check. The XX (ZZ) stabilizer is measured by the X-syndrome (Z-syndrome) qubit. Although previous work 15,21 implemented a ZZ parity check on a linear arrangement of three qubits, our experiment goes beyond into the other planar dimension, allowing the demonstration of the [[2, 0, 2]] code. Here, a codeword |ψ = (|00 + |11 )/ √ 2 = (|++ + |−− )/ √ 2 is stored in two code qubits and protected from any single error to 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.
Our physical device (Fig. 1b) consists of a 2 × 2 lattice of superconducting transmons, with each coupled to its two nearest neighbours via two independent superconducting coplanar waveguide (CPW) resonators serving as quantum buses (Fig. 1b, blue). Each qubit is further coupled to an independent CPW resonator for both qubit control and readout. Dispersive readout signals for Figure 1. Surface code implementation and error detection quantum circuit. 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 labeled 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 labeled 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 |0 (|+ = (|0 + |1 )/2). A Hadamard operation, H, is applied to Q4 before measurement. each qubit are amplified by distinct Josephson parametric amplifiers (JPAs) giving high single-shot readout fidelity 22,23 . We implement two-qubit echo cross-resonance gates 24 , ECR = ZX 90 − XI, which are primitives for constructing controlled-NOT (CNOT) operations. Given the latticed structure of our device, we implement four different such gates, ECR ij between qubits Q i (control) and Q j (target), with ij ∈ {12, 23, 34, 41}. In this arrangement, we use Q 1 and Q 3 (Fig. 1b, purple) as code qubits, Q 2 as the Z−syndrome qubit (Fig. 1b, green) and Q 4 as the X−syndrome qubit (Fig. 1b, yellow). All ECR gates are benchmarked 24 with fidelities between 0.93-0.97 (for further details see Methods). Single-qubit gates are benchmarked to fidelities above 0.998 with less than 0.001 reduction in fidelity due to crosstalk, as verified via simultaneous randomized benchmarking 25 . 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.
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 Q 2 , which is initialized in the ground state |0 . The XX stabilizer is encoded onto the X−syndrome qubit Q 4 , which is initial-ized in the |+ = (|0 + |1 )/ √ 2 state. Since we perform measurements of the syndrome qubits in the Z measurement basis, Q 4 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 Q 1 , but there is no loss of generality if applied on Q 3 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 (Q 1 and Q 3 ) are non-nearest neighbours in the lattice, the preparation of the codeword state is performed via two-qubit interactions with a shared neighbouring qubit, Q 2 . 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 twoqubit ECR gates is described in detail in the Methods and shown in Extended Data Fig. 3.
To implement arbitrary errors to the entangled code qubit state, we apply single-qubit rotations to Q 1 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 tomography 26 . First, for the case where ε = U 0 , when no error is added, the two syndrome qubits Q 2 and Q 4 should both be measured to be in their ground states, and from correlating their single-shot measurements, M 2 and M 4 , 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 {M 2 , M 4 } = {0, +}, with both syndromes signaling a ground state detection (note that measuring Q 4 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 Q 1 , or ε = X π , the resulting syndrome histograms are shown in the colour map Fig. 2b, where a majority of results are consistent with {1, +}, where the Z-syndrome Q 2 is excited to |1 and the X-syndrome Q 4 remains in its ground state. Conditioned on {1, +}, the reconstructed final state Pauli vector of the code qubits is now verifying the bitflip parity error. Then, for the case of a phase-flip error on Q 1 , or ε = Z π , we find that the syndromes give {0, −}, with the X-syndrome having changed its state (Fig. 2c).
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. Secondly, 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).
We can track the outcome of the syndrome qubits as we slowly vary θ in an applied error ε = Y θ between −π and +π (see  1  IX  IY  IZ  YI  ZI  XX  XY  XZ  YX  YY  YZ  ZX  ZY  ZZ  XI  IX  IY  IZ  YI  ZI  XX  XY  XZ  YX  YY  YZ  ZX  ZY  ZZ  XI   IX  IY  IZ  YI  ZI  XX  XY  XZ  YX  YY  YZ  ZX  ZY  ZZ  XI  IX  IY  IZ  YI  ZI   , 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. 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 syndrome flips {1, −}. The observed contrast between the different syndrome qubit state populations, near 0.6 in Fig. 3, is commensurate with a masterequation 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 Extended Data Fig. 4.
In order 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 π/3 Y π/3 , X π/3 Y 2π/3 , X 2π/3 Y π/3 , X 2π/3 Y 2π/3 , R, H}, where R = Y π/2 X π/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 renormalised by the observed contrast at θ ∼ 0 in Fig. 3, and in the equivalent plots for X-and Z-errors in Extended Data Fig. 4, to account for relaxation and decoherence fidelity loss. Although this renormalisation provides an overall fairer comparison to 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 Q 4 (see Methods, Extended Data Fig. 4b). This diminished contrast is due to the fact that the XX stabiliser is encoded last in our sequence and therefore suffers more from decoherence. Further improvements to coherence times and assignment fidelities will translate to more accurate error detection.
In conclusion, we have experimentally realised arbitrary quantum error detection using a two-by-two lattice of superconducting qubits. Stabilizer measurements, ubiquitous to fault-tolerant quantum error correcting codes, are successfully demonstrated for both bit-and phaseflip errors on an encoded codeword. The error detection experiments presented constitute a key milestone for surface code implementation, as our operations now extend into the plane of the two-dimensional surface and we show the ability to concurrently perform bitand 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, 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.

Device fabrication
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 cross-talk mitigation.  Figure 4. Detection of arbitrary errors. 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 labeled as R and H correspond to a Y π/2 X π/2 operation, which maps the x − y − z axes in the Bloch sphere to y − z − x, 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.

Gate calibration and characterisation
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 Q 1 , Q 2 , Q 3 and Q 4 , respectively. Every single-qubit pulse is accompanied by a scaled Gaussian derivative in the other quadrature to minimise the effect of leakage of information into higher qubit energy levels 27 . All microwave mixers are independently calibrated at the operational frequencies to minimise 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 elsewhere 28 .
Randomised Benchmarking (RB) of single-qubit gates 29 is performed for all four qubits independently and in all possible simultaneous configurations (Table I). This allows us to establish the degree of addressability error 25 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.
The two-qubit ECR gates consist of two crossresonance 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 whilst enhancing the ZX term 24 . Each crossresonance pulse has a Gaussian turn-on and off of width 3σ with σ = 24 ns, included in τ . The gates ECR 12 , ECR 23 , ECR 34 , and ECR 41 , where ECR ij is the ECR gate between Q i (control) and Q j (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 RB 24 . Extended Data Fig. 1 shows the RB decays for each of the four gates, yielding an error per  We cool our device to 15 mK in an Oxford Triton dilution refrigerator. Extended Data Fig. 2 shows a full schematic of the measurement setup. We achieve independent single-shot readout for each qubit by using a HEMT amplifier following a JPA (provided by UC Berkeley) in each readout line. The device is protected from environmental radiation by an Ammuneal 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.
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 Extended Data Fig. 2. For data acquisition we use two Alaz-arTech two-channel digitizers (ATS9870) and the singleshot readout time traces are processed with an optimal quadrature rotation filter 26 .

Circuit gate decomposition
The circuit in Fig. 1c calls for four two-qubit gates. In addition, the code qubits Q 1 and Q 3 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 Q 1 and Q 2 and then perform a swap operation between Q 2 and Q 3 (Extended Data Fig. 3a). A SWAP gate operation is equivalent to three CNOT gates alternating direction (Extended Data Fig. 3b). Since two consecutive identical CNOT gates are equal to the identity operation and Q 3 starts from the ground state, the red shadowed regions in Extended Data Fig. 3 can be omitted. The actual circuit implemented in our experiments is shown in Extended Data Fig. 3c, where the Bell state preparation and the ZZ encoding have been combined.
Our CNOT operations require an entangling gate between the control and the target qubits. We use the ECR ij as our CNOT genesis. The ECR ij gate plus four single-qubit rotations as depicted in Extended Data Fig. 3c correspond to a CNOT operation between Q i and Q j in our device.  Extended Data Figure 3. Quantum circuit and CNOT gate decomposition. 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 by using a simplified version of the ZX ij 90 gate, ECR ij , 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 ECR ij 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. 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 (Extended Data Fig. 4a) and pure phase-flip error (Extended Data Fig. 4b). We attribute the increased loss of contrast in the phase-flip error detection (Extended Data Fig. 4b) to the order of the stabilizer encoding in our circuit, which makes our error detection protocol less sensitive to phase-flip errors.

Error propagation and syndromes
After the SWAP gate and error in the circuit in Extended Data Fig. 3a, the state of the code qubits is given by ε(|00 + |11 )/ √ 2 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 X C1 on the first code qubit C 1 . In this case where the sub-indexes S 1 and S 2 refer to the Z− and X−syndrome qubits, Q 2 and Q 4 in our experiment, respectively. Similarly for the phase-flip operation Z C1 , and for Y C1 Since the state after the SWAP gate is |00; 00 +|11; 00 (the qubits are ordered |Q 1 Q 3 ; Q 2 Q 4 and Q 1 , Q 3 are the code qubits) the error syndromes are given by No error : |00; 00 + |11; 00 → 00, X error : |01; 10 + |10; 10 → 10, Z error : |00; 01 − |11; 01 → 01, Y error : |01; 11 − |10; 11 → 11. (4) Hence if the error is a general single-qubit unitary operation where n i is the i th component of the unit vector.

Readout characterization
To characterize each readout, we create the 2 4 = 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 19200 times to gather sufficient statistics. Integrating kernels are obtained for each measurement channel which extract the full time-dependent readout information 26 . 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 |1 (|0 ) is created. The assignment fidelities are given in Table (II).
For each label ab we have a measurement vector m ab of length 108 (36 unitary rotations × 3 fundamental observables). Choosing any representation x ab 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 x 0 = 1/4. x j P j ≥ 0, to obtain a physically valid state. Here V ab 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 estimate 30 . We quantify the state reconstruction via the state fidelity between ρ noisy = ρ ab and the ideal target state ρ ideal = |ψ ab ψ ab |; where, as mentioned in the main text, the ideal states for the different syndrome results are given by 00 (no error) : 10 (X error) : The results are contained in Table III. The variance in the state fidelity is computed via a bootstrapping protocol described in 28 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. 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 |ψ 00 is rotated via some error operator E to the state |ψ init = a|ψ 0 + b|ψ 1 + c|ψ 2 + d|ψ 3 .
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 re-scaling of the measurement variances by 1 |a| 2 . Hence, for each of the 108 different measurement observables O j , tr(ρ 00 O j ) has a single-shot variance that scales as V 00 jj |a| 2 . 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 ε = exp −i θ 2n · σ and the probabilities for the different syndromes are given by Eq. (6). For simplicity, we chose a purely X rotation so ε = cos(θ)I − i sin(θ)X and varied the size of the angle in 30 steps from −π to π. The state fidelity F state (ρ 00 , |ψ 00 ψ 00 |) as a function of θ is shown in Extended Data Fig. 5. 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 statepreparation 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 twoqubit RB the average gate fidelity of our CNOT gates is approximately 0.94. Hence, assuming depolarizing errors, we can obtain an approximate gate fidelity for the comprised circuit of ∼ 0.94 3 = 0.83 and state fidelities with similar values, which is consistent with our obtained fidelities in Table III.