Introduction

In traditional approaches to quantum error correction, bits of quantum information are redundantly encoded in a register of two-level systems1, 2. Over the past years, elements of quantum error correction have been implemented in a variety of platforms, ranging from nuclear spins3, photons4, and atoms5, to crystal defects6 and superconducting devices7,8,9. However, for performing actual algorithms with an error-protected device, it is necessary not only to create and manipulate separate logical qubits, but also to perform entangling quantum gates between them. To date, a gate between logical qubits has not yet been demonstrated, in part due to the large number of operations required for implementing such a gate. For example, in the Steane code2,10, which protects against bit and phase flip errors, a standard logical CNOT gate would consist of seven pairwise CNOT gates between two seven-qubit registers11. Previous experiments have demonstrated an effective gate between two-qubit registers that are protected against correlated dephasing12. In that case, an entangling gate could be implemented using just a single pairwise CNOT gate between the registers.

We choose to pursue a different strategy by encoding qubits in the higher-dimensional Hilbert space of a single harmonic oscillator13, or more concretely in multiphoton states of a microwave cavity mode14,15. This approach has the advantage of having photon loss as the single dominant error channel, with photon-number parity as the associated error syndrome. Codes whose basis states have definite parity, such as the Schrödinger cat code16 or the binomial kitten code17, can then be used to actively protect quantum information against this error8,18. While preparation of an entangled state between two cavities has been performed before19,20, a quantum gate between two multiphoton qubits has so far not been demonstrated. In contrast to gates between two-level systems, which can be coupled by a linear element such as a cavity bus21, harmonic oscillators can non-trivially interact only if they are coupled by a nonlinear ancillary element. However, the requirement for fast interaction between the cavities without inheriting large undesired nonlinearities and decoherence from the ancilla, presents a challenge to the cavity-based approach to quantum error correction.

In this work, we address this challenge by coupling the two cavities to an RF-driven ancilla transmon. The cavities interact sequentially with the ancilla to effectively implement a CNOT gate between the two encoded multiphoton qubits. We generate a high-fidelity multiphoton Bell state, perform quantum process tomography of the gate, and apply the gate repeatedly in order to quantify imperfections in the operation. The number of CNOT operations that we can coherently apply is ~102, bringing this gate within the regime required for practical quantum operations22,23. We also measure the undesired entangling rate between the cavities during idle times, and infer a high on/off ratio of the entangling rate24,25 of ~300. This figure of merit is important since undesired cross-talk is often a major hurdle when trying to scale up to a larger number of qubits.

Results

System description

The experimental system used for implementing the entangling gate is depicted in Fig. 1. The multiphoton qubits are encoded in two high-Q (\(T_1\) ~ 0.002 s) superconducting coaxial stub cavities. Several different multiphoton encodings are compatible with the entangling gate (see Supplementary Note 7). Here we choose a basis of even-parity Fock states

$$\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{C}} = \left| 0 \right\rangle _{\mathrm{C}},\quad \left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}} = \left| 2 \right\rangle _{\mathrm{C}}$$
(1)

for the control cavity, and Schrödinger kitten states17

$$\left| {0_{\mathrm{L}}{\mathrm{/}}1_{\mathrm{L}}} \right\rangle _{\mathrm{T}} = \frac{1}{{\sqrt 2 }}\left( {\frac{{\left| 0 \right\rangle _{\mathrm{T}} + \left| 4 \right\rangle _{\mathrm{T}}}}{{\sqrt 2 }} \pm \left| 2 \right\rangle _{\mathrm{T}}} \right)$$
(2)

for the target cavity (henceforth omitting normalization). These encodings can allow error detection of a photon loss event in both cavities, as well as error correction in the target cavity.

Fig. 1
figure 1

Experimental implementation of an entangling gate between multiphoton qubits encoded in two cavities. a Example of the CNOT operation. In the initial state, illustrated by the Wigner distributions in the top panel, the control qubit is in \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\), and the target qubit in \(\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\) (as defined in Eqs. (1) and (2)). Under the action of the CNOT gate, enabled by a nonlinear coupling between the cavities (in green), the target state at the output (bottom panel) is inverted to \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\). b Sketch of the device, which is housed inside an aluminum box, and cooled down to 20 mK. The control and target qubits are encoded in photon states of the fundamental modes (yellow and purple arrows) of two coaxial cavities with frequencies ωC/2π = 4.22 GHz and ωT/2π = 5.45 GHz, respectively. The ancilla transmon (ω q /2π = 4.79 GHz) has two coupling pads (orange circles) that overlap with the cavity fields. Cavity-ancilla interaction is achieved by application of a frequency-matched RF drive (green arrow) to the coupling pin near the Josephson junction (marked by X). The ancilla also serves to prepare and read out the cavity state, and is measured by its dispersive coupling to a stripline readout resonator (orange rectangle). More details on this device can be found in Supplementary Note 1 and ref. 20

The operation of the gate relies on two types of nonlinear interaction between the cavities and the ancilla, enabled by the ancilla’s Josephson junction. The first is the naturally occurring dispersive interaction, which can be understood as a rotation of the cavity phase space conditioned on the ancilla state. Here we consider the ancilla ground and second excited states \(\left| g \right\rangle\) and \(\left| f \right\rangle\) only, since the first excited state \(\left| e \right\rangle\) is ideally not populated during the gate operation. In this case the Hamiltonian is

$$\hat H_{{\mathrm{disp}}}{\mathrm{/}}\hbar = - \tilde \chi _{\mathrm{T}}\hat a_{\mathrm{T}}^\dagger \hat a_{\mathrm{T}}\left| f \right\rangle \left\langle f \right| - \tilde \chi _{\mathrm{C}}\hat a_{\mathrm{C}}^\dagger \hat a_{\mathrm{C}}\left| f \right\rangle \left\langle f \right|,$$
(3)

where \(\hat a_{{\mathrm{C}}\left( {\mathrm{T}} \right)}\) is the control (target) annihilation operator. As a result of this interaction, the target (control) cavity phase space rotates at \(\tilde \chi _{{\mathrm{C(T)}}}{\mathrm{/}}2\pi = 1.9\) MHz (3.3 MHz) when the ancilla is in \(\left| f \right\rangle\), but remains unchanged when the ancilla is in \(\left| g \right\rangle\).

We can also drive a sideband interaction between the control cavity and the ancilla using an RF tone that satisfies the frequency matching condition \(\omega _{\mathrm{p}} = \omega _{gf} - \omega _{\mathrm{C}} - \left( {n_{\mathrm{C}} - 1} \right)\tilde \chi _{\mathrm{C}}\), with ω gf /2π = 9.46 GHz the ancilla transition frequency between \(\left| g \right\rangle\) and \(\left| f \right\rangle\) (Fig. 2b), and nC the number of control photons (we discuss the effect of the target photon number nT in Supplementary Note 4). This interaction, described by the Hamiltonian

$$\hat H_{{\mathrm{sb}}}{\mathrm{/}}\hbar = \frac{{{\mathrm{\Omega }}_{\mathrm{C}}(t)}}{2}\left( {\hat a_{\mathrm{C}}\left| f \right\rangle \left\langle g \right| + \hat a_{\mathrm{C}}^\dagger \left| g \right\rangle \left\langle f \right|} \right),$$
(4)
Fig. 2
figure 2

Protocol of the entangling gate. a The sequence starts with preparation of the desired initial two-cavity state, while leaving the ancilla transmon in the ground state. The cavity–cavity CNOT gate (dashed black rectangle) consists of two entangling gates between the control cavity and the ancilla (dashed blue rectangles), interleaved by a CNOT gate between the ancilla and the target, implemented by a conditional π/2 phase-space rotation of the target cavity. The joint Wigner distribution of the final two-cavity state is measured using a method similar to ref. 20. b Schematic level diagram illustrating the RF-driven control-ancilla sideband transition. Through the absorption of a single drive photon (in green) and a single control photon, the ancilla is doubly excited from \(\left| g \right\rangle\) to \(\left| f \right\rangle\) (solid blue arrows). However, when the control cavity is in vacuum, the absence of a control photon prevents the ancilla from being excited to \(\left| f \right\rangle\) (dashed blue arrow)

leads to sideband oscillations26 between the states \(\left| {n_{\mathrm{C}},g} \right\rangle\) and \(\left| {n_{\mathrm{C}} - 1,f} \right\rangle\)27,28,29. By strongly driving this transition we obtain an oscillation rate of \(\sqrt {n_{\mathrm{C}}} {\mathrm{\Omega }}_{\mathrm{C}}{\mathrm{/}}2\pi = 11.2\) MHz with nC = 2, close to the theoretical prediction (see Supplementary Note 3). However, for nC = 0 the pump does not drive sideband oscillations, and the ancilla remains in its ground state (Fig. 2b).

Gate protocol

The basic mechanism behind the gate is to make the cavities interact sequentially with the ancilla, enabling an effective nonlinear interaction between the cavities without requiring a significant direct cavity–cavity coupling. This method is similar to the one used in a recent experiment on a gate between single optical photons30. We start by preparing the desired initial state using optimal control pulses on the ancilla and on the cavities31,32,33, after ensuring that the ancilla is initialized in \(\left| g \right\rangle\). The gate sequence itself is then performed in three steps (Fig. 2a). First, we apply the sideband drive for \(\pi {\mathrm{/}}\left( {\sqrt 2 \Omega _{\mathrm{C}}} \right) = 45\) ns, exciting the ancilla to \(\left| f \right\rangle\) conditioned on the control being in \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\). We then turn off the drive for 100 ns (~\(\pi {\mathrm{/}}2\tilde \chi _{\mathrm{T}}\), see Supplementary Note 4), during which the ancilla dispersively interacts with the target cavity. This flips \(\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\) into \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\) and vice versa, conditioned on the ancilla being in \(\left| f \right\rangle\). We then apply the sideband drive a second time to disentangle the ancilla from the cavities, thereby effectively achieving a CNOT gate between the two cavities after a total gate time of \(t_{\mathrm{g}}\sim 190\) ns. Finally, we use the ancilla to perform joint Wigner tomography on the two-cavity state20,34, from which we can reconstruct the density matrix (see Supplementary Note 6).

Gate characterization

The hallmark of a CNOT gate is its ability to entangle two initially separable systems. As a demonstration of this capability, we apply the gate to \(\left| {\psi _{{\mathrm{in}}}} \right\rangle = \left( {\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{C}} + \left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}} \right) \otimes \left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\) (Fig. 3a). Ideally, this should result in a logical Bell state \(\left| {\psi _{{\mathrm{ideal}}}} \right\rangle = \left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{T}} + \left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\). By reconstructing the output density matrix ρmeas (Fig. 3b), we deduce a state fidelity of \(F_{{\mathrm{Bell}}} \equiv \left\langle {\psi _{{\mathrm{ideal}}}\left| {\rho _{{\mathrm{meas}}}} \right|\psi _{{\mathrm{ideal}}}} \right\rangle = \left( {90 \pm 2} \right)\%\). This is within the measurement uncertainty of the input state fidelity Fin = (92 ± 2)%. Therefore, we conclude that the effect of nonidealities in the gate operation on the Bell state fidelity is obscured by imperfections in state preparation and measurement (see Supplementary Note 5).

Fig. 3
figure 3

Generation of a multiphoton Bell state. Reconstructed density matrices (solid bars) of a, the initial separable two-cavity state \(\left( {\left| 0 \right\rangle _{\mathrm{C}} + \left| 2 \right\rangle _{\mathrm{C}}} \right) \otimes \left( {\frac{{\left| 0 \right\rangle _{\mathrm{T}} + \left| 4 \right\rangle _{\mathrm{T}}}}{{\sqrt 2 }} + \left| 2 \right\rangle _{\mathrm{T}}} \right)\) (ideal shown by transparent bars) and b, the output state after application of the CNOT gate, turning the kitten state into \(\left( {\frac{{\left| 0 \right\rangle _{\mathrm{T}} + \left| 4 \right\rangle _{\mathrm{T}}}}{{\sqrt 2 }} - \left| 2 \right\rangle _{\mathrm{T}}} \right)\), provided the control state is \(\left| 2 \right\rangle _{\mathrm{C}}\). We reconstruct the density matrices assuming a Hilbert space spanned by the Fock states \(\left| n \right\rangle _{\mathrm{C}}\left| m \right\rangle _{\mathrm{T}}\) with n < 3 and m < 5 after confirming the absence of population at higher levels. Components of the density matrices below 0.05 are colored in gray for clarity. The imaginary parts are small as well, and are shown in Supplementary Note 8 for completeness

To fully characterize the CNOT gate, we next perform quantum process tomography35 (QPT). We achieve this by applying the gate to sixteen logical input states that together span the entire code space. By performing quantum state tomography on the resulting output states we can reconstruct the quantum process \(\epsilon\)(ρin), which captures the action of the gate on an arbitrary input state ρin. The result can be expanded in a basis of two-qubit generalized Pauli operators E i on the code space as \(\epsilon \left( {\rho _{{\mathrm{in}}}} \right) = \mathop {\sum}\nolimits_{m,n = 0}^{15} {\kern 1pt} \chi _{m,n}E_m\rho _{{\mathrm{in}}}E_n\), where χ is the process matrix. Using the measured χ (Fig. 4a), we determine a process fidelity of \(F_{{\mathrm{CNOT}}} \equiv {\mathrm{Tr}}\left\{ {\chi _{{\mathrm{ideal}}{\kern 1pt} {\mathrm{\chi }}}} \right\} = \left( {89 \pm 2} \right)\%\). We can estimate the effect of nonideal state preparation and measurement by performing QPT on the process consisting of encoding and measurement only, yielding a fidelity with the identity operator of Fidentity = (92 ± 2)%.

Fig. 4
figure 4

Characterization of the controlled NOT gate. a Quantum process tomography. The solid (transparent) bars represent the measured (ideal) elements of the process matrix χ. The corresponding process fidelity is FCNOT = (89 ± 2)%. For clarity, only the corners of the process matrix are presented. The full χ-matrix is shown in Supplementary Note 8 for completeness. b State fidelity under repeated gate applications for various input states, chosen to highlight different error mechanisms of the gate (the dashed lines are linear fits). The solid gray line depicts the simulated average slope of state fidelity imposed by ancilla decoherence. The state fidelities are calibrated by the value measured for the vacuum state (Supplementary Note 6). The standard errors are derived from bootstrapping, and are equal in size to the symbols

To more accurately determine the performance of the gate and highlight specific error mechanisms, we apply it repeatedly to various input states (Fig. 4b). We then measure how the state fidelity decreases with the number of gate applications. A first observation is that no appreciable degradation in state fidelity occurs when the control qubit is in \(\left| {0_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\). Indeed, the control cavity contains no photons in this case, and as a result the ancilla remains in its ground state at all times. When the initial two-cavity state is \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\left| {X_{\mathrm{L}}^ - } \right\rangle _{\mathrm{T}}\) (introducing \(\left| {X_{\mathrm{L}}^ \pm } \right\rangle \equiv \left( {\left| {0_{\mathrm{L}}} \right\rangle \pm \left| {1_{\mathrm{L}}} \right\rangle } \right)\) and \(\left| {Y_{\mathrm{L}}^ \pm } \right\rangle \equiv \left( {\left| {0_{\mathrm{L}}} \right\rangle \pm i\left| {1_{\mathrm{L}}} \right\rangle } \right)\)), corresponding to \(\left| 2 \right\rangle _{\mathrm{C}}\left| 2 \right\rangle _{\mathrm{T}}\) in the Fock-state basis, the ancilla does get excited to the \(\left| f \right\rangle\)-state, and we measure a small decay in fidelity of (0.6 ± 0.3)% per gate application. This is consistent with the ancilla decay time from \(\left| f \right\rangle\) to \(\left| e \right\rangle\), measured to be 40 μs. While the qubit is irreversibly lost when a decay occurs, the final ancilla state is outside the code space, and therefore this is a detectable error. If the control qubit is initially in a superposition state, the first sideband pump pulse will entangle the control cavity with the ancilla, making the state prone to both ancilla decay and dephasing (\(T_2^f = 17\) μs). For example, for \(\left| {X_{\mathrm{L}}^ + } \right\rangle _{\mathrm{C}}\left| {X_{\mathrm{L}}^ - } \right\rangle _{\mathrm{T}}\), we measure a decay in fidelity of (0.9 ± 0.2)% per gate. When the target cavity state is not rotationally invariant (i.e. not a Fock state), we observe larger decay rates ((2.0 ± 0.3)% for \(\left| {1_{\mathrm{L}}} \right\rangle _{\mathrm{C}}\left| {0_{\mathrm{L}}{\mathrm{/}}1_{\mathrm{L}}} \right\rangle _{\mathrm{T}}\), and (2.1 ± 0.2)% for \(\left| {Y_{\mathrm{L}}^ + } \right\rangle _{\mathrm{C}}\left| {Y_{\mathrm{L}}^ + } \right\rangle _{\mathrm{T}}\)). Possible mechanisms for these increased decay rates are discussed in Supplementary Note 4. While an accurate determination of the gate fidelity would require randomized benchmarking36, the data presented in Fig. 4b is sufficient to infer an average degradation in state fidelity of ~1% per gate application, close to the ~ 0.5% limit set by ancilla decoherence.

An important figure of merit for an entangling gate is the ability to turn off the interaction, to prevent unwanted entanglement between the cavities. In practice, the cross-Kerr interaction between the cavities, described by the Hamiltonian \(\hat H_{{\mathrm{CT}}}{\mathrm{/}}\hbar = \chi _{{\mathrm{CT}}}\hat a_{\mathrm{C}}^\dagger \hat a_{\mathrm{C}}\hat a_{\mathrm{T}}^\dagger a_{\mathrm{T}}\), induces entanglement even when the gate operation is not applied. To measure the interaction rate χCT, we prepare a separable two-cavity state in a code space spanned by vacuum and the single-photon Fock state (Supplementary Note 7), and perform state tomography after variable delay times. When extracting the concurrence37 of the measured density matrices (Fig. 5), we observe first an increase, then a subsequent decrease, of the entanglement between the cavities.

Fig. 5
figure 5

Undesired entanglement induced by the coupling ancilla. Concurrence vs. wait time for an initially separable state (red) using single-photon encoding, and for an initial Bell state (blue) obtained by applying the CNOT gate to the separable state. The presence of the cross-Kerr interaction between the two cavities is responsible for the observed oscillatory behavior, whereas dephasing due to thermal excitations in the ancilla results in a gradual decay of the entanglement. By fitting simulations (solid curves) to the measured data, we determine a cross-Kerr interaction rate of χCT/2π = 2 kHz. Error bars indicate the standard error derived from bootstrapping

In a similar vein, when starting with a Bell state, the cross-Kerr interaction first disentangles, and then re-entangles the two cavities. The cavity dephasing times of ~ 500 μs lead to a gradual overall loss of entanglement in both cases. From the measured curves, we infer a cross-Kerr interaction rate of χCT/2π = 2 kHz. However, the residual entanglement rate for the multiphoton encoding is increased to Ωres\(= n_{\mathrm{C}}\bar n_{\mathrm{T}}\chi _{{\mathrm{CT}}}=\) 2π × 8 kHz, where \(\bar n_{\mathrm{T}} = 2\) is the average number of photons in the target cavity. We can therefore infer the on/off ratio of the entangling rate, defined by the ratio of the times to generate maximal entanglement without and with gate application, to be π/(Ωrestg) ~ 300.

Discussion

In conclusion, we have realized a high-fidelity entangling gate between multiphoton states encoded in two cavities. Together with single-qubit gates33, this provides a universal gate set on encoded qubits that can be actively protected8 against single-photon loss. The gate relies on correct operation of the control-ancilla sideband drive, restricting the choice of control encodings. In fact, the encoding used in this demonstration, as well as a variety of similar encodings compatible with the CNOT gate, provides full error-correctability for the target cavity, but only detectability of a photon loss error in the control cavity. However, a generalization of the kitten code exists which could potentially allow for identical error-correctable encodings in both cavities (Supplementary Note 7). An important criterion of a gate on error-corrected logical qubits is whether errors before or during the gate operation can be detected or corrected. Using our scheme, ancilla or cavity decay events can be detected since they lead to a final state outside the code space. However, the gate fidelity is ultimately limited by ancilla dephasing, and with the current encoding the control cavity is subject to uncorrectable no-jump evolution17. These remaining imperfections need to be addressed in future fault-tolerant gate implementations. The demonstrated gate is especially useful for practical applications that are limited by decoherence processes or spurious interactions during long idle times. In particular, it establishes the potential of multicavity registers for distributed quantum computing, combining long-lived storage qubits with high-fidelity local operations22,38.

Data availability

Relevant data are available from S.R. upon request.