Quantum error correction aims at the creation of logical qubits1, 2 whose information storage and processing capabilities exceed those of its constituent parts. Significant progress has been made toward quantum state preservation by repeated error detection using stabilizer measurements in trapped ions3, 4, nitrogen vacancy centers5, and superconducting circuits6,7,8. In order to go beyond storage and to manipulate the encoded information, one must perform operations on the whole system in such a way that it results in the desired transformation within the two-dimensional subspace defining the logical qubit. Any encoding scheme will consist of multiple interacting components where the system dynamics are not naturally confined within the logical subspace. Therefore, implementing operations requires carefully tailored controls which address each component of the system and manage their mutual interactions. Recent efforts have achieved this level of control and have demonstrated operations on a five qubit code in nuclear spin ensembles9 and a seven qubit code in trapped ions4.

An alternative to logical qubit implementations based on multiple two level systems is to encode quantum information in continuous variable systems or oscillators, for which there are several schemes10, 11. In particular so called “cat states”, which are superpositions of coherent states, can be used as the logical states of an encoded qubit12. They are attractive because coherent states are eigenstates of the photon annihilation operator (\(\hat a\)) and therefore single-photon loss induces simple, tractable errors13.

Replacing several two level systems by an oscillator drastically reduces the hardware cost and complexity by requiring fewer components to fabricate and manipulate. However, introducing higher dimensional modes raises the issue of how to realize complete control over the system. Driving an isolated harmonic oscillator results in a displacement operation, which can only produce coherent states from the vacuum. Any oscillator-based logical qubit scheme will require a richer class of operations, which one can access via coupling to a nonlinear system.

In the case of a frequency-tunable qubit coupled to an oscillator with the Jaynes-Cummings (JC) interaction (\({H_{{\rm{JC}}}} = {\sigma _ + }\hat a + {\sigma _ - }{\hat a^\dag }\)), it has been demonstrated that it is possible to prepare arbitrary states in the oscillator14, 15.

In the far off-resonant case, where the JC interaction reduces to the dispersive Hamiltonian (\({H_{\rm{d}}}/\hbar = \chi {a^\dag }a\left| e \right\rangle \left\langle e \right|\)), a small set of operations acting on a timescale of 2π/χ is in principle sufficient for universal control16, 17 and has been used for non-trivial operations18, 19. Generally, however, any approach decomposing an arbitrary operation into a sequence of elementary gates generates only a small subset of physically allowed control fields. It, therefore, suffers from two issues limiting the achievable fidelity. First, the constructed sequences may require an unacceptably large number of gates, limiting operations which are feasible in the presence of decoherence. Second, the idealized model used by a constructive approach typically fails to account for the existence of higher order Hamiltonian terms such as the Kerr non-linearity \({H_{{\rm{Kerr}}}}/\hbar = \frac{K}{2}{\left( {{{\hat a}^\dag }} \right)^2}{\hat a^2}\) and spurious residual couplings in multi-qubit systems.

In this work, we address these problems by considering a full model of the time dependent Hamiltonian in the presence of arbitrary control fields. Nuclear magnetic resonance experiments have shown that, if the available controls are universal, numerical optimization procedures can reliably solve the inversion problem of finding control fields to implement an intended operation. These optimal control algorithms, in particular the Gradient Ascent Pulse Engineering (GRAPE) method20, 21, have been successfully employed in a variety of other fields22, 23. Since GRAPE crucially depends on the model of the system, its successful application is powerful evidence that the Hamiltonian used accurately captures the system dynamics over a broad range of driving conditions.


System and control protocol demonstration

The physical system used in our experiments is schematically depicted in Fig. 1a. The seamless aluminum λ/4 coax-stub cavity resonator24 with a fundamental frequency 4452.6 MHz has an energy relaxation time of 2.7 ms. A single-junction transmon with transition frequency 5664.0 MHz and an harmonicity of 236 MHz is dispersively coupled to the oscillator, resulting in an interaction term \(\chi {\hat a^\dag }\hat a\left| e \right\rangle \left\langle e \right|\), with χ/2π = −2.2 MHz. Crucially, additional higher order terms are determined accurately through a separate set of calibration experiments (Supplementary Note 1, Supplementary Fig. 1, Supplementary Table 1). Control of the system is implemented through full in-phase/quadrature modulated microwave fields centered on the transmon (oscillator) frequency and sent to the pin coupling to the transmon (oscillator) mode (setup schematic in Supplementary Fig. 2). In the rotating wave approximation, this results in the drive Hamiltonian H c/ħ = ϵC a + ϵT σ _ + h.c. Modulation using an arbitrary waveform generator allows the coefficients ϵC and ϵT to be arbitrary complex-valued functions of time.

Fig. 1
figure 1

Experimental system and demonstration of control strategy. a Schematic drawing of the experimental system. A λ/4 coax-stub cavity resonator is coupled to a transmon and readout resonator on a sapphire substrate. Input couplers close to the transmon and cavity deliver the respective time-dependent microwave control fields ϵT(t) and ϵC(t). b Lower panel: optimized transmon and oscillator control waveforms of length approximately 2π/χ to take the oscillator from vacuum to the 6-photon Fock state. Solid (dotted) lines represent the in-phase (quadrature) field component. Upper panel: oscillator photon-number population trajectory vs. time conditioned on transmon in \(\left| g \right\rangle \). A complex trajectory occupying a wide range of photon numbers is taken to perform the intended operation. c Characterization of the oscillator state using Wigner tomography (bottom) and transmon spectroscopy (top), where grey dashed lines indicate the transition frequency associated with the first seven Fock states. The single peak in the spectroscopy data directly reveals the oscillator’s population due to the dispersive interaction giving a frequency shift of 6χ/2π ≈ 13 MHz

As an example application of GRAPE to our system (Supplementary Note 2), we find ϵC(t) and ϵT(t) such that, starting from the vacuum (Supplementary Fig. 3, Supplementary Note 3), after 500 ns of driven evolution the system ends up in the state \(\left| {g,6} \right\rangle \), as shown in Fig. 1b, c. This highly nontrivial operation, effectively realizing a \(\left| 6 \right\rangle \left\langle 0 \right|\) coupling term on the oscillator, is enabled by the dispersive Hamiltonian using only linear drives on the transmon and the oscillator.

Encoding a logical cat-qubit

Using our control strategy, we can target the creation and manipulation of a logical qubit encoded in an even-parity four-component cat subspace. Omitting normalization, the code states in this subspace can be written as

$$\left| { \pm {{\rm{Z}}_{\rm{L}}}} \right\rangle = \left| \alpha \right\rangle + \left| { - \alpha } \right\rangle \pm \left| {i\alpha } \right\rangle \pm \left| { - i\alpha } \right\rangle $$

where we use \(\alpha = \sqrt 3 \). These code words are both of even photon number parity, and are distinguished by their photon number modulo 4:

$$\left| { + {{\rm{Z}}_{\rm{L}}}} \right\rangle = \mathop {\sum}\limits_n \frac{{{\alpha ^{4n}}}}{{\sqrt {(4n)!} }}\left| {4n} \right\rangle $$
$$\left| { - {{\rm{Z}}_{\rm{L}}}} \right\rangle = \mathop {\sum}\limits_n \frac{{{\alpha ^{4n + 2}}}}{{\sqrt {(4n + 2)!} }}\left| {4n + 2} \right\rangle $$

Single photon loss, the dominant error channel for the system, transforms both code words to states of odd photon number parity. The encoded information, however, is preserved by this process as long as one can keep track of the number of photons that have been lost. Since parity measurements can be performed efficiently and non-destructively25, single photon loss is a correctable error13.

Using GRAPE, we create a universal set of gates on our logical qubit, which includes X and Y rotations by π and π/2, as well as Hadamard and T gates. These pulses are each 1100 ns ≈ 2.4 × 2π/χ in length with a 2 ns time resolution, although 99% of the spectral content lies within a bandwidth of 33 MHz (27 MHz) for the transmon (oscillator) drive (Supplementary Fig. 4). Each operation is designed to begin and end with the transmon in the ground state. Additionally, we create encode (Uenc) and decode (Udec) pulses to transfer a bit of quantum information between our transmon \(\{ \left| {g,0} \right\rangle ,{\kern 1pt} \left| {e,0} \right\rangle \} \) subspace, which we can easily prepare and measure, and our encoded subspace \(\{ \left| {g, + {{\rm{Z}}_{\rm{L}}}} \right\rangle ,{\kern 1pt} \left| {g, - {{\rm{Z}}_{\rm{L}}}} \right\rangle \} \) (Fig. 2a).

Fig. 2
figure 2

Characterization of encoded states. a Uenc and Udec are operations that coherently map between two distinct two-dimensional subspaces, represented by Bloch spheres. The first subspace consists of the transmon \(\left| g \right\rangle \) and \(\left| e \right\rangle \) levels, with the oscillator in the vacuum. The second is given by the oscillator-encoded states \(\left| { + {{\rm{Z}}_{\rm{L}}}} \right\rangle \) and \(\left| { - {{\rm{Z}}_{\rm{L}}}} \right\rangle \) (Eq. (1)), with the transmon in the ground state. b Wigner tomography sequence that characterizes the encoded states. A transmon state is prepared by applying an initial rotation Ui and is mapped to the oscillator using Uenc. An oscillator displacement D β followed by a parity mapping operation Π (implemented using an optimal control pulse) allows one to measure the oscillator Wigner function W(β). The transmon can be re-used to measure the oscillator’s parity because the encoding pulse leaves the transmon in the ground state with high probability (p>98%). c Applying Uenc to the transmon states \(\left| g \right\rangle \) and \(\left| e \right\rangle \) produces states whose Wigner functions are consistent with the intended encoded basis states (Eq. (1)). A transmon spectroscopy experiment (top panel) illustrates that only photon number states with n = 0 mod 4 and n = 2 mod 4 are present for logical state \(\left| { + {{\rm{Z}}_{\rm{L}}}} \right\rangle \) and \(\left| { - {{\rm{Z}}_{\rm{L}}}} \right\rangle \) , respectively. d Applying Uenc to superpositions of the transmon basis states demonstrates that the relative phase is preserved and that Uenc is a faithful map between the transmon and logical qubit Bloch spheres. These states, on the equator of the Bloch sphere, are equally weighted superpositions of \(\left| { + {{\rm{Z}}_{\rm{L}}}} \right\rangle \) and \(\left| { - {{\rm{Z}}_{\rm{L}}}} \right\rangle \) and, therefore, contain all even photon numbers present in the basis states

We characterize the encode operation by preparing all six cardinal points on the transmon Bloch sphere, applying the encode pulse and performing Wigner tomography on the oscillator (Fig. 2b–d). Maximum likelihood reconstruction of the density matrix associated with the measured Wigner functions indicates an average state fidelity of 0.96. This metric underestimates the fidelity of Uenc because it is affected by several sources of error not intrinsic to the encoding operation itself, including error in the parity mapping and measurement infidelity.

Gate characterization

Process tomography provides a full characterization of a quantum operation, but depends on pre-existing trusted operations and measurements which are not available for our encoded subspace. However, an indirect characterization of a gate UX on our logical qubit can be performed using the operation UdecUXUenc, which maps the transmon subspace onto itself. This allows one to use the trusted state preparations and measurements on the transmon to perform tomography on the composite process (Fig. 3a). The reconstructed process matrices in Fig. 3b show qualitative agreement with the intended encoded qubit gates. The process fidelities we report are average gate fidelities \({\cal F}({{\cal E}_1},{{\cal E}_2}) \equiv {\int} {\rm{d}}\psi F({{\cal E}_1}(\psi ),{{\cal E}_2}(\psi ))\), where F is the usual quantum state fidelity F(ρ 1,ρ 2) = Tr(ρ 1 ρ 2). We can break the measured infidelity down into three parts: transmon preparation and measurement error, encode-decode error and gate error. Using the experimentally determined process fidelities both without any operation \({{\cal F}_{{\rm{PT}}}}({\rm{No}}\,{\rm{Op}}.) = 0.982\), as well as with the encode and decode pulses \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}\,{{\rm{U}}_{{\rm{enc}}}}) = 0.964\), we estimate an infidelity contribution of approximately 1.8% for each of the first two components. To account for these factors to first order, the infidelity of operations on the encoded qubit are reported relative to \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}{{\rm{U}}_{{\rm{enc}}}})\). We find an average infidelity of 0.75% over our set of nine gates (Table 1).

Fig. 3
figure 3

Process tomography of operations on encoded qubit. a In order to characterize a gate UX on the encoded qubit, transmon process tomography is performed on the operation UdecUXUenc. Process tomography is implemented by performing an initial transmon rotation Ui right after state preparation (Supplementary Note 3), as well as a final transmon rotation Uf, right before measurement of the transmon. b Process tomography results for selected operations (for additional operations, see Supplementary Fig. 5). The process tomography yields an estimated quantum channel G. We represent this channel in the Pauli transfer representation. The bar labeled with operators AB (A, B ϵ {I,X,Y,Z}, the Pauli basis matrices) represents Tr(AG(B))/2. Red and pink bars indicate the experimental and ideal values, respectively. The infidelity \(\Delta {{\cal F}_{{\rm{PT}}}}\) of operation UX is estimated as the difference between \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}{{\rm{U}}_{\rm{X}}}{{\rm{U}}_{{\rm{enc}}}})\) and \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}{{\rm{U}}_{{\rm{enc}}}}) = 0.964\). The selected set of operations, {X180,X90,Y90,T}, allows universal control of the logical qubit

Table 1 Operation fidelities

In order to establish the fidelity of this set of operations more accurately, we perform randomized benchmarking26 (RB) on our encoded qubit (Fig. 4a). Careful analysis is required to infer the actual gate fidelity, as leakage out of the logical space in the oscillator does not present itself directly in the binary measurement of the state of the transmon qubit. Simulations show that such an RB experiment on a logical qubit with a larger associated Hilbert space typically overestimates the fidelity by a factor 1.7 ± 0.1 (Supplementary Fig. 6, Supplementary Note 4). From the resulting data (Fig. 4c) we infer an average gate fidelity of 0.985. This measurement is so sensitive to the quality of the applied gates that it is the ideal metric to use to fine-tune several experimental parameters (Supplementary Fig. 7, Supplementary Fig. 8, Supplementary Note 5). The infidelity of each of the individual gates is isolated using interleaved randomized benchmarking27 (iRB), which alternates between a single fixed and a random gate (Fig. 4b). Comparing the fitted decay constants of the RB and iRB results allows us to extract the fidelity of the fixed gate. The results are summarized in Table 1, together with the gate fidelities based on process tomography (Fig. 3) and Lindblad master equation simulations accounting for finite T 1 and T 2 of the transmon and oscillator. We note that all gates are implemented with an approximately equal infidelity of 1.5%. The results obtained using process tomography and iRB are not consistent, leading us to conclude that the approximation of the infidelity as the differrence between \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}{{\rm{U}}_{\rm{X}}}{{\rm{U}}_{{\rm{enc}}}})\) and \({{\cal F}_{{\rm{PT}}}}({{\rm{U}}_{{\rm{dec}}}}{{\rm{U}}_{{\rm{enc}}}})\) leads to an underestimation of the underlying infidelity of UX. While several sources of decoherence are accounted for in the master equation simulations, the dominant source of infidelity in the model is transmon dephasing (T 2 ≈ 43 μs). The good agreement between simulations and experiment indicates that the infidelity is primarily caused by decoherence and that additional contributions associated with imperfections in the model Hamiltonian and the applied pulses are a significantly smaller effect.

Fig. 4
figure 4

Randomized benchmarking of operations on encoded qubit. a Randomized benchmarking (RB) sequence. In RB a sequence of Clifford operations of length n is chosen at random (U{X,Y,…}), followed by the operation which inverts the effect of the sequence (Ucorr). In order to apply this technique to the operations on the encoded qubit, we begin the experiment by encoding, and decode before measurement. Our implementation of RB creates a new random gate sequence for every measurement, and is thus not biased by the distribution of sequences which are measured. b Interleaved randomized benchmarking (iRB) sequence: In order to establish the fidelity of a single operation (here, UX), the operation is interleaved with random operations, and the benchmarking result is compared with the non-interleaved case. c The probability of measuring the correct result vs. sequence length n is fit to a two parameter model p correct = 0.5 + Ae n/τ. The lower panel shows the fit residuals. Each data point is the result of 2000 averages, with a new sequence realization every shot. The error averaged over all gates is computed as r = c(1−e −1/τ(RB))/226. The average error for a single gate X is computed as r(X) = c(1−e1/τ(X)−1/τ(RB))/227. The factor c = 1.7 ± 0.1 is a correction factor to compensate for the underestimation of the error rate in the presence of leakage to a larger Hilbert space (Supplementary Note 4)


A logical quantum bit consists of a quantum system with multiple degrees of freedom that can be used to correct for a finite set of errors, at the expense of being more complicated to control. Before one can realize the ultimate goal of robust and high fidelity operations that surpass the performance of the physical qubits, there are several challenging steps which must be demonstrated. First one must devise a code that can detect and correct for the dominant errors, second is to implement the code by demonstrating encoding and decoding operations, third is to show the ability to detect and correct the errors, and fourth is to manipulate the information in the encoded system by performing logical operations. Finally, one must eventually combine all of these components to improve the systems lifetime and the fidelity of operations.

In this work, we show an important step along this path, namely the first manipulations of a logical qubit encoded in cat-states. At this level one should generally expect the overall error rate to actually increase relative to the physical components. This is due to the additional overhead of implementing a logical qubit, which originates from the redundant encoding required to detect and correct errors. For instance, the seven qubits in the Steane code28 result in an effective error rate, which is larger by a factor 7. Our scheme, the cat-code using several levels in an oscillator, increases the error rate by a factor \(\bar n \approx 3\) in the best case scenario.

The increased system complexity of a logical qubit poses additional challenges and sources of errors when performing logical operations. First of all, implementing any of the operations is non-trivial as the logical basis states are typically not easily constructed using the available controls. In fact, this is a key property of the encoding as it prevents the information to decohere due to interaction with the environment. When starting from the system’s ground state, for example, a sequence of several single- and two-qubit gates is required to produce a logical basis state in the Steane code, or a complex pulse in our scheme. Additionally, when integrating many physical systems it remains an open experimental question whether control-field cross-talk and inter-qubit interactions, which introduce coherent and correlated errors, can be engineered sufficiently small. Therefore, demonstrating accurate manipulation of a logical qubit is an important and necessary first step toward error-corrected quantum computation. Such experiments lead to a better understanding of experimental nonidealities and other sources of errors.

By mapping a bit of quantum information from the transmon onto cat-states in the oscillator, we have transferred the information onto a system with a coherence time which is more than an order of magnitude larger (Supplementary Fig. 9). The overhead of encoding/decoding is approximately 3%, and, therefore, it is beneficial when storing a state for more than around 3% of the transmon coherence time, or 1.3 μs. The dispersive coupling to the transmon still allows the information encoded in the logical qubit to be manipulated directly, albeit with a fidelity smaller than that of transmon operations. There are a number of protocols where this trade-off between operation fidelity and lifetime is desirable, such as entanglement distillation29 and quantum repeaters30. Photon-loss error correction can enhance the lifetime of the logical cat-code qubit even further13, but would not enhance the operation fidelity. The reason is twofold: first of all, the system is not in a cat-state during the gate operation (Supplementary Fig. 10), and second, photon-loss is a much less significant source of errors than transmon dephasing. Although improving the transmon coherence time would directly result in higher fidelity gates, it is likely that this will remain the dominant source of errors.

However, simulations show that a large fraction of the errors that occur during an operation are detectable (Supplementary Table 2), and could, therefore, be mitigated using erasure correcting codes31. This originates from the fact that the oscillator-transmon system takes a complicated trajectory through its Hilbert space during an operation. An error drastically alters this trajectory and, therefore, the final state at the end of the operation. For example, in approximately 50% of the cases an error occurs, the transmon will be left in the excited state. Additionally, it is unlikely that the oscillator will remain in the logical subspace after an error, and if this could be measured efficiently it would imply that, for the designed pulses, approximately 95% of the errors are detectable.

It might be possible to increase the fraction of detectable errors by optimizing control pulses in the presence of decoherence, an established technique32, combined with an appropriate modification the cost function; we have not yet thoroughly explored this approach. A more fundamental open question is whether the GRAPE algorithm can be used to design pulses which implement operations fault-tolerantly (e.g., with respect to transmon dephasing).

In conclusion, we have demonstrated a high-fidelity implementation of a universal set of gates on a qubit encoded into an oscillator using the cat-code. The low error rates for these operations are verified using both process tomography and randomized benchmarking, and the results are consistent with simulations which account for decoherence. We obtained these operations by numerically optimizing time-dependent drives which make use of the well-characterized dispersive interaction between the far detuned oscillator and transmon modes. While in this Article we have focused on realizing and characterizing single-qubit operations on cat-encoded qubits, this control technique is not restricted to these goals, and is in principle capable of crafting arbitrary unitary operations on the transmon-oscillator system. The high quality of these operations depends critically on an accurate characterization of the system Hamiltonian, and demonstrates the utility of numerical optimal control for realizing quantum information processing.

Data availability

Relevant data is available from R.W.H. upon request.