Introduction

A universal quantum computer may be able to address a range of challenges1,2,3, but will require many logical qubits for fault-tolerant operation4. While errors on individual qubits are unavoidable, logical qubits can be encoded in multiple physical qubits, facilitating error correction codes that preserve the quantum state5. There are several ways to encode logical qubits that allow for the correction of different errors using a variety of error-correction strategies. The simplest error correction codes, the bit flip code and the phase flip code6,7,8,9,10, correct for the fundamental type of error after which they are named. One of the most promising error correction codes is the surface code11, which can correct any error affecting a sufficiently low number of qubits. Using an error correction code, however, can only help to achieve low logical error rates when all error rates on the physical qubits (of initialization, control and readout) are below a threshold, dependent on the protocol.

The relevance of quantum error correction has spurred significant research in a multitude of platforms and exciting progress has been made in superconducting qubits12,13,14,15, solid-state qubits using NV centers in diamond16,17,18, and trapped-ion qubits19,20. Semiconductor qubits based on spins in quantum dots have not yet advanced to match the larger qubit counts of competing technologies21, but important progress has been made in achieving high-fidelity operations. Fast and high-fidelity readout22,23, single-qubit control24,25,26,27, two-qubit logic28,29,30, and resonant three-qubit and four-qubit gates26 have been demonstrated in separate experiments.

Quantum wells in planar germanium heterostructures (Ge/SiGe) can bring together advantages of several semiconductor quantum dots platforms31. Like silicon, natural germanium contains nuclear-spin-free isotopes and can be isotopically purified32,33. Hole states in Ge/SiGe have a low effective mass34, relaxing the fabrication requirements of nanostructures. Moreover, the strong spin-orbit interaction allows for fast and all-electric qubit operation35,36,37,38. The spin-orbit interaction also creates a channel through which charge noise can couple to the spin states, currently limiting the coherence time. A dephasing time \({{{{\rm{T}}}}}_{2}^{* }\) = 800 ns has been reported for single spin qubits36 and \({{{{\rm{T}}}}}_{2}^{* }\) = 1 μs for singlet-triplet qubits operated at low magnetic fields39. Using dynamical decoupling sequences, coherence times could be extended up to T2 = 100 μs26. On the other hand, hole spin qubits in Ge/SiGe do not suffer from valley degeneracy34, which still presents a major challenge for electrons in silicon40,41. Furthermore, advancements in heterostructure growth have yielded low disorder and charge noise42. These characteristics have facilitated the development of planar germanium quantum dots43 and quantum dot arrays44, spin relaxation times up to 32 ms45, single-hole qubits46, singlet-triplet qubits39, two-qubit logic36, and universal operation of a four-qubit germanium quantum processor26. The spin-orbit coupling in germanium avoids the need to implement components such as striplines and nanomagnets, promising scalability in two dimensions26,47, crucial for the implementation of error correction codes5.

Here, we perform quantum error correction on a two-by-two array of spin qubits in germanium. Similar to other spin qubit platforms, hole spin qubits have long relaxation times45, such that the dominant type of decoherence is dephasing. We therefore focus on the implementation of a rudimentary phase flip code. In order to realize this, we implement a controlled-Z (CZ) gate, a controlled-S−1 (CS−1) gate and a native resonance SWAP gate48. Using the CZ and CS−1 gates, together with single-qubit gates, we construct a Toffoli-like gate. Additionally, we show that we can coherently transfer phase information between the data and ancilla qubits and implement the majority vote for error correction of the phase flip code on three qubits.

Results and discussion

Phase flip code

The error correction code considered here is a three-qubit phase flip code49, the steps of which are depicted in Fig. 1a. At the start of the experiment, the data qubit could in principle hold any quantum state \(\left|{{\Psi }}\right\rangle\) = \(\alpha \left|0\right\rangle +\beta \left|1\right\rangle\) and both ancilla qubits start in the basis state \(\left|0\right\rangle\). In the encoding step, the state of the data qubit is mapped to the ancilla qubits and the system is brought into the state \(\alpha \left|+++\right\rangle +\beta \left|---\right\rangle\). After the encoding, we intentionally induce errors either by deterministically implementing a rotation around the Z axis of the Bloch sphere with angle φ (Z(φ)), a full phase flip Z(φ = π) with a probability p, or by leaving the qubits idle for some time. In the decoding step, we disentangle the logical qubit, where all single-phase errors lead to a unique error syndrome. In the final step of the code, a phase error is corrected. The ancillas are not measured, but the data qubit is corrected using a three-qubit gate depending on the error syndrome of the ancilla qubits50. This correction protocol is capable of correcting any phase error Z(φ) on a single qubit, but it cannot correct phase errors that occur on different physical qubits simultaneously, nor can it handle errors in the encoding, decoding and correction steps.

Fig. 1: Error-correction circuit diagram and properties of the four-spin qubit register.
figure 1

a Quantum error correction circuit using one data qubit and two ancilla qubits. Qubits are encoded to a logical state (beige) in which they are resilient against single-qubit phase errors (soft red), since these errors result in distinct states of the ancilla qubits which, after the decoding (turquoise), can be used to correct the data qubit (gray). b Schematic drawing giving an impression of the electrostatic potential of the quantum device. Using electrostatic potentials on metallic gates, four quantum dots are defined, each containing a single hole spin qubit. The qubits are indicated with a color: qubit 1 (Q1) in blue, qubit 2 (Q2) in orange, qubit 3 (Q3) in yellow and qubit 4 (Q4) in purple. The spin states are read out by spin-to-charge-conversion using latched Pauli spin blockade using the two charge sensors, S1 and S2, indicated in red and green respectively. c Table showing the relevant time scales of the four qubits used in this work. The spin relaxation time is measured on the same device but at a higher magnetic field26.

Properties of the four-qubit register

The implementation of the phase flip code strongly depends on the design and properties of the quantum device. The quantum dots are defined in a strained germanium quantum well, using two layers of metallic gates and low resistance Ohmic contacts are made by diffusing aluminium contacts directly into the quantum well26,44. Figure 1b gives an impression of the potential landscape which is formed by applying negative voltages on four plunger gates, forming quantum dots underneath. Each quantum dot is occupied by a single hole spin. The coupling between the quantum dots is controlled by dedicated barrier gates. We construct virtual barrier and plunger gates at the software level, to independently control the detuning, on-site energy, and exchange26. Two additional quantum dots (S1 and S2) act as charge sensors and are operated using radio frequency reflectometry for rapid readout26. Spin state readout is achieved using spin-to-charge-conversion in the form of latched Pauli spin blockade (PSB)26,51 (see Supplementary Methods 1). We can read out the spin state of Q1 and Q2 using S1 (readout system Q1Q2, red) and the spin state of Q3 and Q4 using S2 (readout system Q3Q4, green).

An external magnetic field of 0.65 T is applied in plane of the quantum well, resulting in energy splittings of 1.393 GHz, 2.192 GHz, 2.101 GHz and 2.412 GHz for Q1, Q2, Q3 and Q4 respectively, between the spin down \(\left|\downarrow \right\rangle\) (which we define to be \(\left|0\right\rangle\)) and spin up (\(\left|1\right\rangle\)). Here, we use the convention of an X (Y) gate as a π/2 rotation, X2 (Y2) as a π rotation and X−1 (Y−1) as a − π/2 rotation around the \(\hat{x}\) (\(\hat{y}\)) axis of the Bloch sphere52. Single-qubit rotations are implemented by electric dipole spin resonance.

The choice of two-qubit gate is also dictated by the properties of the device. Fast controlled-Z (CZ) gates53 are possible by controlling the exchange interaction using the barrier gates26. The CZ gate is calibrated using a Ramsey experiment52, where we use a Tukey shaped pulse to turn exchange on and off. Details of this experiment can be found in Supplementary Methods 2. We use CZ gates between Q1 and Q4 and between Q3 and Q4 for the entangling and disentangling in the phase flip code.

Two-qubit phase flip code

As a stepping stone towards the three-qubit phase flip code, we first implement a two-qubit phase flip code. The two-qubit code consists of the same steps (encode, phase errors, decode, and correct) but differs from the three-qubit code in that a phase error can only be corrected on the data qubit. However, it does demonstrate that information can be coherently transferred between data and ancilla qubits.

The compiled gate set of the two-qubit phase flip code is depicted in Fig. 2a. We use Q4 as data qubit and Q1 as ancilla qubit. The encoding (beige) is performed by a Hadamard-CZ-Hadamard sequence49, where the Hadamards are replaced by Y−1 gates. The phase errors are induced by leaving the qubits idle for some time (soft red). Since this code should correct for a phase error on the data qubit, one would expect that the dephasing time of the ancilla qubit Q1 is the limiting factor. Ramsey experiments (Fig. 2e) yield pure dephasing times (\({{{{\rm{T}}}}}_{2}^{* }\)) of 0.28 ± 0.1 μs and 0.23 ± 0.1 μs for Q1 and Q4 respectively. These are comparable to the decay time (τ) of 0.26 ± 0.01μs corresponding to the two-qubit phase flip code, shown in Fig. 2b. The fact that the phase errors on the ancilla qubit are limiting can be seen even more clearly when a refocusing pulse is applied to the ancilla qubit (blue box in Fig. 2a). The result of this experiment is shown in Fig. 2c and gives τ = 1.86 ± 0.05 μs. We have also run this experiment with the data qubit starting in the basis state \(\left|\downarrow \right\rangle\) (Supplementary Fig. 1). The result is shown in Fig. 2d and gives τ = 2.31 ± 0.02 μs. For comparison, the results of a Hahn echo experiment are shown for both Q1 and Q4 in Fig. 2e. We extract \({{{{\rm{T}}}}}_{2}^{{{{\rm{Hahn}}}}}\) = 2.72 ± 0.05 μs and 3.26 ± 0.04 μs for Q1 and Q4 respectively. The two-qubit phase flip code is also performed with Q3 as ancilla qubit instead of Q1 (Supplementary Fig. 1), in which case we find τ = 3.16 ± 0.03 μs. Note that when a different ancilla qubit is used (Q3 instead of Q1), but the same data qubit (Q4), τ changes. The fact that τ is limited by the decoherence of the ancilla qubit, instead of the data qubit, shows that the quantum information is indeed transferred to the ancilla qubit and we implemented the two-qubit phase flip code successfully.

Fig. 2: Two-qubit phase flip code.
figure 2

a Circuit diagram. The encoding, decoding and correction are implemented using a combination of Y, Y−1 and CZ gates. By adding a wait time (twait) after the encoding, phase errors will occur due to the dephasing of the qubits. Q4 is the data qubit and Q1 the ancilla qubit. bd Pup as a function of twait when executing the two-qubit phase flip code, which gives a decay time τ. Results for the data qubit prepared in \(\left|{{\Psi }}\right\rangle\) = X\(\left|\downarrow \right\rangle\) and through single-qubit gates projected to a basis state for readout, without an echo pulse Y2 (b), with an echo pulse Y2 (c), and with an echo pulse with the data qubit prepared to \(\left|{{\Psi }}\right\rangle\) = \(\left|\downarrow \right\rangle\) (d). e For comparison we show the individual qubit dephasing \({{{{\rm{T}}}}}_{2}^{* }\) and coherence \({{{{\rm{T}}}}}_{2}^{{{{\rm{Hahn}}}}}\) times for Q1 (blue) and Q4 (purple).

Resonant SWAP, CS−1 and Toffoli-like gate

Since we use PSB readout, we can only read out the state of an individual qubit when the state of the other qubit in the readout system is known. Therefore, when using Q4 as data qubit and Q3 as one of the ancilla qubits, it is necessary to reinitialize Q3. We enable this by performing a SWAP gate on Q3 and Q2, with Q2 initialized to the state \(\left|\downarrow \right\rangle\). Implementing a diabatic SWAP gate is difficult due to the relatively large Zeeman energy difference between Q2 and Q354,55. While a SWAP can be compiled from a series of CZ gates and single-qubit operations, here we implement a resonant SWAP48 by applying an electric pulse as depicted in Fig. 3a to the barrier gate. This pulse is an oscillating exchange pulse, resonant with the difference in Zeeman energy of Q2 and Q3, superimposed on a Tukey-shaped pulse (see Supplementary Methods 3 for details on calibration). Figure 3a shows the circuit diagram to demonstrate resetting the state of Q3 using the SWAP. The result is shown in Fig. 3b, reading out either system Q1Q2 (red) or system Q3Q4 (green). This measurement shows that the states of Q2 and Q3 are swapped, but imperfections in the readout and initialization and in the calibration of the resonant exchange pulse result in a small residual amplitude on Q3.

Fig. 3: SWAP, CS−1 and Toffoli-like gate.
figure 3

a A resonant SWAP gate is implemented by applying a Tukey-shaped pulse with an oscillation superimposed to the barrier gate between Q2 and Q3. It is tested using the depicted circuit diagram. b To demonstrate the SWAP gate, a Rabi pulse X(θ) is applied to Q3, followed by a SWAP gate between Q2 and Q3. Then, either Q2 is read out using readout system Q1Q2 (red) or Q3 is read out using readout system Q3Q4 (green). c Circuit diagram of the experiment demonstrating the CS−1 gate. d The CS−1 gate is obtained by calibrating the phase difference to be − π/2, for the experiments with (blue) and without (black) an X2 gate on the control qubit Q1. e Circuit diagram of the Toffoli-like gate (gray) composed of CS−1 and CZ gates. f Demonstration of the Toffoli-like gate with target qubit Q4 and control qubits Q1 and Q3. An X(θ) pulse is applied to Q1 and the final state of Q4 is measured using readout system Q3Q4. Results of the experiment in e with (pink) and without (black) a preparation pulse X2 on ancilla qubit Q3.

Figure 3c shows the circuit diagram to demonstrate the controlled-S−1 (CS−1) gate. The calibration of the CS−1 gate is similar to the CZ gate (see Supplementary Methods 2), however, for the CS−1 gate the exchange pulse is calibrated to give a phase difference of −π/2 between the experiments with and without a preparation pulse on the control qubit. This is demonstrated in Fig. 3d, where the results of a Ramsey experiment are shown with (blue) and without (black) an X2 pulse on the control qubit Q1.

The Toffoli gate is a three-qubit gate, also called Controlled-Controlled-NOT gate. In the three-qubit phase flip code, the combination of the decoding step and the Toffoli gate performs the majority vote. A resonant i-Toffoli was demonstrated in previous work26, which would be the fastest implementation when working in a regime where the exchange is on56. However, the qubit states are also strongly sensitive to noise in this regime. Here, we implement a Toffoli-like gate composed of CZ and CS−1 gates (Fig. 3e). This is equal to a Toffoli gate up to single and two-qubit rotations on the control qubits57,58, which are irrelevant in the protocol under study10. The matrix representation of this gate is shown in Supplementary Discussion 1. We test the Toffoli-like gate by applying it to different input states, as shown in Fig. 3e. Here a Rabi pulse X(θ) is applied to control qubit Q1 and the state of the target qubit Q4 is measured using readout system Q3Q4. Figure 3f shows the result with (pink) and without (black) an additional preparation pulse on the second control qubit, Q3. If neither of the control qubits is in the \(\left|\uparrow \right\rangle\) state (when X(θ = 0)) or when only one control qubit is in the \(\left|\uparrow \right\rangle\) state (when X(θ = π) on Q1), the target qubit remains in the \(\left|\downarrow \right\rangle\) state. Only when both control qubits are in the \(\left|\uparrow \right\rangle\) state, the target qubit flips. The result of a similar experiment, where a Rabi pulse X(θ) is applied to the other control qubit, Q3, is shown in the Supplementary Discussion 1. By applying a Rabi pulse X(θ) on Q1 (Q3), it is shown that this implementation of the Toffoli-like gate works for all X\((\theta )\left|\downarrow \right\rangle\) of Q1 (Q3).

Three-qubit phase flip code

We now turn to the three-qubit phase flip code, of which the circuit diagram is shown in Fig. 4a. The four-qubit system is initialized to the \(\left|\downarrow \downarrow \downarrow \downarrow \right\rangle\) state, after which we prepare the data qubit, Q4, in a state \(\left|{{\Psi }}\right\rangle\). After the encoding step (beige), refocusing pulses are applied to all three qubits. The errors are implemented by either sweeping the phase Z(φ) or by applying a full phase flip Z(φ = π) with probability p (soft red). Subsequently, the qubits are decoded (turquoise). The correction step (gray) is implemented with the Toffoli-like gate shown in Fig. 3e. The data qubit state is projected through single-qubit gates to \(\left|\downarrow \right\rangle\), the states of Q3 and Q2 are swapped and finally the data qubit, Q4, is read out using readout system Q3Q4.

Fig. 4: Three-qubit phase flip code.
figure 4

a Implementation of the three-qubit phase flip code. Q4 serves as data qubit, Q1 and Q3 as ancilla qubits, and Q2 as reset qubit for Q3. The correction step is implemented with the Toffoli-like gate as shown in Fig. 3e. The data qubit is read out with readout system Q3Q4, which makes it necessary to reset Q3 using a resonant SWAP operation with Q2. b, c Results of the phase flip code while introducing a phase error Z(φ) on none of the qubits (gray), on Q4 (purple), Q1 (blue) or Q3 (yellow) or on all three qubits simultaneously (dark blue). The initial state of the data qubit is \(\left|\downarrow \right\rangle\) in b and X\(\left|\downarrow \right\rangle\) in c. d Phase flip code with introducing phase errors Z(φ = π) with probability p. The data qubit is prepared to the state X\(\left|\downarrow \right\rangle\) and through single-qubit gates projected to the \(\left|\downarrow \right\rangle\) state for readout. Plotted is the state probability (Γ), the error bars indicate the standard deviation. The results are fitted using a model which takes into account the readout and reset errors (see Supplementary Discussion 4). The standard deviation of the fit is indicated by the light blue area. The inset shows the curve for ideal phase flip correction (Γideal) and the linear line for no phase flip correction (Γlinear).

This quantum error correction code corrects for a full phase flip as well as an arbitrary Z(φ) rotation on a single qubit. When a phase error Z(φ) occurs on a qubit, it is in a superposition of being in the correct state (with the ancillas indicating as such) and a state with a phase error (with one or both ancillas being flipped), and the Toffoli-like gate will be able to correct this superposition state. Figure 4b, c show the state probability (Γ) (i.e. the chance that the data qubit is successfully rotated back to the \(\left|\downarrow \right\rangle\) state) for errors implemented by sweeping the phase Z(φ). This error is applied to one qubit at a time, the results are plotted in purple, blue and yellow for an error implemented on Q4, Q1 and Q3 respectively. For comparison, the result is also shown when the phase flip code is performed while implementing the error Z(φ) on all three qubits simultaneously (dark blue) and without implementing an error at all (gray). These experiments are performed for two different input states of the data qubit, a basis state (\(\left|{{\Psi }}\right\rangle\) = \(\left|\downarrow \right\rangle\)) and a superposition state (\(\left|{{\Psi }}\right\rangle\) = X\(\left|\downarrow \right\rangle\)), shown in Fig. 3b, c respectively. Only when the data qubit is prepared in a superposition state, does the encoding step entangle the data qubit with the two ancilla qubits. One expects that when sweeping the phase Z(φ) on one of the qubits, the error is corrected and the result is a constant high Γ. For sweeping the phase on all three qubits simultaneously, it is expected that the error is not corrected and Γ varies from high to low and back. It is apparent from the results in Fig. 4b, c that for both input states the single-qubit errors are not corrected perfectly. This is due to unintentional errors, i.e. errors occurring in the encoding, decoding and correction steps of the algorithm. These errors are caused by decoherence of the qubits, and are coherent errors such as residual exchange between the qubits (Supplementary Fig. 2), cross talk27,59 and imperfect two-qubit gates. When comparing the results for the different input states of the data qubit, it becomes clear that for an input state \(\left|\downarrow \right\rangle\) of the data qubit the visibility is higher and the correction of the single-qubit errors is more successful. We ascribe this improvement to the decreased time during which any unintentional errors can affect the data qubit when it starts in a basis state, and the fact that is less sensitive to imperfections in the two-qubit gates. To gain further insight into the results of this experiment, we performed a simulation (Supplementary Discussion 2). We ran the simulation with only coherent errors and with coherent errors plus decoherence, in order to understand which of these unintentional errors are the main limiting factors for the implementation of the phase flip code. When including both coherent errors and decoherence, the simulation results are in qualitative agreement with the measurement results. Both the experimental and simulated data show that errors have a more profound impact when starting in a superposition state compared to starting in a basis state. We can therefore conclude from the simulations that a limiting factor for the implementation of the phase flip code is the decoherence of the qubits.

Furthermore, we study the three-qubit phase flip code by inserting a full phase flip Z(φ = π) with probability p. The data qubit starts in the state \(\left|{{\Psi }}\right\rangle\) = \(X\left|\downarrow \right\rangle\) and before the data qubit is measured, we project the state to \(\left|\downarrow \right\rangle\) by applying corresponding single-qubit gates. In Fig. 4d the state probability Γ is plotted against the probability of implementing a phase flip (p). Ideally, the data is described by Γideal(p) = 1 − 3p2 + 2p3 49. The ideal function shows a modest improvement of the state probability for p < 0.5, compared to the linear line Γlinear(p) = 1 − p expected for no error correction (see inset Fig. 4d). While the data in Fig. 4d follows the overall trend, there are some interesting differences. We first note that since the data qubit starts in the \(\left|{{\Psi }}\right\rangle\) = \(X\left|\downarrow \right\rangle\) state, the data qubit is very sensitive to unintentional errors, resulting in a reduced visibility. Second, the data in Fig. 4d does not show a trend symmetric around Γ(p = 0.5). This asymmetry can be caused by errors in the reset of Q3 combined with asymmetry in the readout scheme (illustrated in the Supplementary Methods 1). For example, when the reset of Q3 using the SWAP is imperfect, the error that is introduced is not random, but depends on the history of Q3. Due to the asymmetry of the readout, an imperfect reset of Q3 affects the measurement results of zero or a single intentional error differently than the measurement results for two or three intentional errors. This physical knowledge of the qubit system is taken into account as boundary conditions for the fit and gives the fit function: Γ(p) = b + a(0.95 − 1.73ϵp − 2.79 p2 + 3.9ϵp2 + 1.86p3 − 2.17ϵp3), where a is the visibility, b the offset and ϵ the error parameter modeling asymmetry (See Supplementary Discussion 4 for the derivation). We obtain the fit parameters a = 0.272 ± 0.007, b = 0.394 ± 0.003 and ϵ = 0.37 ± 0.13. As expected a and b reflect that the visibility is reduced and that the offset is significant. We note that if ϵ = 0, the symmetric shape of Γideal is recovered, meaning that Γ is improved for p < 0.5 when comparing to Γlinear with similar visibility (dashed purple line in the main panel of 4d). For ϵ = 0.37 as fitted here, the state probability still shows a small improvement for p < 0.27, compared to Γlinear. When we insert the found fit parameters into the fit function, it simplifies to a polynomial with a linear term of −0.17 ± 0.06. This corresponds to a modest flattening of the curve for small error probability as is visible in Fig. 4d.

When considering Fig. 4d, it is important to realize that the experiment performed to obtain this data is significantly different compared to prior works9,10. In these works, the effective probability of a phase error was calculated using peff = sin2(φ/2), where the error Z(φ) is implemented on all three qubits simultaneously. We instead run the phase flip code numerous times and randomly implement a phase flip error with a certain probability on all three qubits. Rather than changing φ, we actually changed the probability of the error. This procedure requires significantly more data and time, thus results in larger error bars, but it does capture the realistic scenario in which it is not known a priori if an error would occur and on which qubit. For completeness, we used the data shown in Fig. 4b, c to also plot Γ as a function of peff (Supplementary Discussion 3). This data is fitted using a polynomial and gives a linear term of −0.07 ± 0.05. The conclusion we can draw from this analysis is similar to the conclusion we draw from the data shown in Fig. 4d: although not perfectly, the logical error rate has a suppressed first-order contribution in p, meaning that single errors are suppressed.

In summary, we have shown a rudimentary quantum error correction circuit. We have executed a two-qubit phase flip code and confirmed that by applying an echo pulse to the ancilla qubit we can preserve the state of the data qubit. We have demonstrated a resonant SWAP gate and have implemented a Toffoli-like gate using CZ and CS−1 gates. Utilizing these gates has allowed us to implement a three-qubit phase flip code. Though scaling quantum dots in two dimensions and readout using Pauli spin blockade are central aspects in virtually all semiconductor qubit architectures60, we have also observed that they affect the quantum gate compilation as well as the correction itself. Running quantum error correction codes such as the surface code11 will require significant advances. Both the quantity and the quality of the qubits will need to increase. In particular, scaling the number of qubits in two dimensions will require the development of architectures. The qubit coherence is currently limited, but this may be improved by several means. First, by using purified germanium the hyperfine interaction can be avoided. Second, sweet spots with respect to charge noise have recently been proposed and observed for hole qubits61. Finally, tailored pulses will need to be implemented to optimize the initialization, readout and qubit operation. While formidable improvements will have to be made to obtain fault-tolerant operation, we envision that the capability to test tailored quantum algorithms in real devices will serve as a crucial link in developing scalable quantum technology.

Methods

The four-qubit quantum processor and methods to operate are described in previous work26. Additional methods are detailed in the Supplementary Information, which contains more information about the latched PSB readout protocol (Supplementary Methods 1), details on the calibration of the CZ and CS−1 gates (Supplementary Methods 2), details on the calibration of the resonant SWAP gate (Supplementary Methods 3), additional data on the two-qubit phase flip code (Supplementary Fig. 4), data on the residual exchange (Supplementary Fig. 5), additional data on the Toffoli-like gate (Supplementary Discussion 1), simulation results of the phase flip code with error Z(φ) (Supplementary Discussion 2), state probability versus effective probability (Supplementary Discussion 3), and the derivation of the fit function for the results of the three-qubit phase flip (Supplementary Discussion 4).