Quantum interference device for controlled two-qubit operations

Universal quantum computing relies on high-fidelity entangling operations. Here, we demonstrate that four coupled qubits can operate as a quantum gate, where two qubits control the operation on two target qubits (a four-qubit gate). This configuration can implement four different controlled two-qubit gates: two different entangling swap and phase operations, a phase operation distinguishing states of different parity, and the identity operation (idle quantum gate), where the choice of gate is set by the state of the control qubits. The device exploits quantum interference to control the operation on the target qubits by coupling them to each other via the control qubits. By connecting several four-qubit devices in a two-dimensional lattice, one can achieve a highly connected quantum computer. We consider an implementation of the four-qubit gate with superconducting qubits, using capacitively coupled qubits arranged in a diamond-shaped architecture.


INTRODUCTION
The goal of quantum computing is to implement a programmable quantum information processor. Such a processor requires access to a universal gate set from which any quantum algorithm can be constructed. Universal gate sets can be formed from single-qubit gates supplemented by a two-qubit entangling gate 1 . Furthermore, fault-tolerance is necessary in order to perform arbitrarily long and precise computations, which, for the most lenient errorcorrecting surface codes, puts a lower bound of around 0.99 on the required gate fidelities [2][3][4][5] . Extensible high-fidelity entangling two-qubit gates are thus key elements in any multi-purpose quantum information processor.
In this work, we propose the implementation of controlled twoqubit operations utilizing quantum interference patterns in a network of four qubits. As a specific architecture, where this fourqubit gate can be implemented natively, we consider superconducting transmon qubits placed in a diamond-shaped geometry. The qubits are coupled only through simple capacitive couplings. A similar 2D array of transmons was considered in refs. 42,43 , but with different couplings and purpose. The realization of quantum gates on spin networks with exchange interactions has also been studied in refs. 44,45 , although they consider a different qubit encoding. The system comprises a four-qubit quantum gate ('the diamond gate'), where the state of two qubits control a two-qubit gate operation on the remaining two qubits. Since the diamond gate natively implements multiple unitaries, it is a useful addition to the gate set used for quantum simulation and quantum compilation. Due to its ability to perform (controlled) two-qubit entangling operations, supplementing the diamond gate with single-qubit operations allows for universal quantum computing on the target qubits.
The "Results" section is divided into four subsections. First, we discuss the operation of the diamond gate, and secondly, how it can constitute a building block in an extensible quantum computer. Thirdly, we simulate the transmon implementation of the gate, using parameters from state-of-the-art superconducting qubits, in a Lindblad master equation simulation. We find that the gate generally operates with fidelity around 0.99 in <100 ns. Finally, we consider the effects of couplings to higher-energy states in the transmon spectrum, leading to undesired leakage across the control. We show how this behavior can be counteracted by engineering a cross-coupling to cancel the effects. This is a passive scheme, in contrast to the microwave pulse-based scheme recently shown to reduce leakage in the CZ gate 30 .
Throughout this paper, we use units where h = 1.

Four-qubit diamond gate
Consider the four-qubit Hamiltonian being a sum of the noninteracting part where Ω + Δ (Ω) is the fixed frequency of the target (control) qubits, and the interaction terms Here Pauli operators on qubit j, and the qubit frequencies are assumed positive such that 0 j i j is the non-interacting qubit ground state. For simplicity we have assumed that the two target (control) qubits are on resonance, which can be achieved with sufficient accuracy with flux tunable superconducting qubits. Here we also assume that all the couplings between the target and control qubits have the same strength J, although, as we will show later, this contraint is not needed for high performance of the gate. The four-qubit system is sketched in Fig. 1a. As we will discuss in the following, the system implements a four-qubit gate, which we will refer to as 'the diamond gate' due to the geometry of the system. Superconducting circuits offer a natural platform for implementing this type of Hamiltonian 46 . Specifically, by truncating the Hilbert space for each degree of freedom to qubits, the circuit of four capacitively coupled transmon qubits in Fig. 1b implements the Hamiltonian. Later, we analyze the model including the second excited state of the transmon qubits.
We now consider the interaction Hamiltonian, H int , in the frame rotating with H 0 and simplify the expression by assuming |2Ω| ≫ |J| (rotating wave approximation), which allows us to ignore the most rapidly oscillating terms. The system Hamiltonian is then with σ j þ ¼ 1 j i 0 h j j and σ j À ¼ 0 j i 1 h j j on qubit j. This Hamiltonian governs the dynamics resulting from the interactions in the model. The effective unitary time-evolution of H gives rise to a four-qubit gate (the diamond gate) operating by means of controlled quantum interference (see "Methods"). The analysis in "Methods" is based on a Magnus expansion of H within Floquet theory, which assumes |Δ| ≫ |J|, |J C |, i.e. a qubit detuning much larger than the coupling strengths.
The diamond gate is a four-way controlled two-qubit gate operation on the target qubits T1 and T2. Consider the following gates in the target qubit computational basis, f 00 j i T ; 01 j i T ; 10 j i T ; 11 j i T g, where the superscripts refer to the control setting (discussed below): Here t g is the gate time given by t g ¼ πjΔj Equations (4)- (7) show the two-qubit operations in terms of wellknown gates from the literature, see e.g. ref. 47 . Here ZZ is understood as a Z gate on each target qubit. Thus we see that U 00 T and U 11 T are two different combined swap and phase operations. Access to just one of these entangling gates will facilitate universal quantum computing. The third gate, U Ψ À T , is a phase operation distinguishing target states with different parity (addition of T1 and T2's bit value modulo 2) by application of a relative sign. The final gate, U Ψ À T , which just adds a global phase, is the identity gate. We can therefore regard the preceding three gates as actual computational gates, while U Ψ À T is the idle position of the device. The above two-qubit gates are controlled by the state of the control qubits, which we describe in the following orthonormal basis: f 00 j i C ; 11 j i C ; Ψ þ j i C ; Ψ À j i C g. We refer to this basis, which mixes computational basis states and the Bell states Ψ ± j i C ¼ ð 01 j i C ± 10 j i C Þ= ffiffi ffi 2 p , as the control basis. The full fourqubit unitary operation of the diamond gate is Cast this way, it is evident that U describes a four-way controlled operation on the target qubits. If the control qubits are initialized in one of the control basis states, only the corresponding gate among (4)-(7) is performed. The control state is unchanged after the gate operation. Figure 1c and d illustrate the gate operation on the target state 01 j i T in the cases where the control is 00 j i C and Ψ þ j i C , respectively. However, these gate diagrams only show the gate operation for these two control states, and in general the diamond gate performs a unitary operation on any initial fourqubit state. A more sophisticated decomposition of the full unitary U is given in Supplementary Fig. 1 in the Supplementary Information, where we note that the complexity in terms of number of CNOT gates is 42. Having access to four controlled twoqubit operations natively is useful for quantum simulation and may ease quantum gate compilation significantly.
The unitary time-evolution under the Hamiltonian of Eq. (3) approximately gives rise to U (see "Methods" and the Supplementary Information). Within the first-order Magnus expansion, the approximation is exact when J C = 0, however a non-zero coupling between the control qubits is needed in order to initialze the control Bell states. Such a coupling allows the triplet states f 00 j i C ; 11 j i C ; Ψ þ j i C g to mix slightly during the gate operation, in which case the separation of control states in Eq. (9) is no longer exact. This leads to small gate infidelities of the order (2J/Δ) 2 = π/ (t g Δ) when then control qubits are initialized in 00 j i C or 11 j i C , and twice as large when the control is in Ψ þ j i C . For typical superconducting circuit parameter values, like the ones used in the following section, these infidelities are on the order 10 −3 to 10 −2 . Notice that the infidelity scales inversely with the gate time, leading to a trade-off between a fast gate and high-fidelity coherent operations. Since the singlet state Ψ À j i C does not mix with the triplet states, the idle gate operation is not affected by the coupling J C , and the gate fidelity is only limited by other factors, e.g. qubit decoherence.
As mentioned above, the performance of the gate is increased if J C = 0, however a non-zero direct coupling between the control qubits is necessary if we wish to prepare the entangled Bell states. In the following, we will assume a fixed value of J C , although ideally a tunable coupler 48 can be used to turn on the coupling only during control state preparation. If the control qubits are detuned from the target qubits, |Δ| ≫ |J|, we can initialize the control state without affecting the target qubits. This detuning can be achieved by flux tunable devices, or by fabricating singlejunction qubits with different frequencies. Thus, ignoring the oscillating terms of Eq. (3), we have effectively decoupled the control and target qubits. We note that the effective Hamiltonian of the control qubits in the rotating frame, þ Þ, has a zero-energy subspace spanned by 00 j i C and 11 j i C , and eigenstates Ψ ± j i C of energy ±J C . An energy separation of J C /2π2 0 MHz allows us to initialize the control in Ψ ± j i C by driving energy transitions 32,37 . To initialize the control in 00 j i C or 11 j i C , we can induce Rabi oscillations between these two states by driving the control qubits similarly to the procedure analyzed in ref. 49 .

Extensible quantum computer
The four-qubit quantum interference device can constitute a building block in an extensible quantum computer by connecting several copies. One possible architecture is illustrated in Fig. 2a, where a 16-qubit quantum computer is constructed by connecting four copies of the four-qubit device, for instance through capacitive couplings. On the plaquettes labeled A the control qubits are oriented vertically (1, 2, 13, and 14) and the target qubits horizontally (3, 4, 15, and 16), while the diamond gate devices on the plaquettes B are rotated by 90°, such that control and target qubits from different plaquettes are connected. This design of alternating A and B plaquettes can be extended in a straight-forward manner in one or two dimensions.
Single-qubit rotations can be implemented via microwave control lines to each qubit on the chip. In order to address each qubit individually, we decouple the qubits by detuning them from each other. Only when we wish to run the diamond gate or perform two-qubit operations do we tune the appropriate qubits into resonance.
The quantum algorithm shown in Fig. 2b is a generic algorithm spreading entanglement in the computer. Supplemented with single-qubit rotations, it may serve as a variational quantum eigensolver 50 . The algorithim can be implemented in the following way. Initially, the plaquette A qubits are far detuned from the plaquette B qubits, allowing each four-qubit diamond gate device to run the unitary gate U of Eq. (9) independently. After the completion of the gates, we can prevent further dynamics within each plaquette by switching the controls to the idle state. Then, by tuning pairs of connected qubits from different plaquettes into resonance, for instance 4 and 5, we can perform swap gates or use a suitable microwave driving to perform other desired two-qubit operations. Finally, by tuning the qubits out of resonance, and potentially switching certain controls, we are ready to run the diamond gate again.
Numerical simulations Although the analytic results suggest a functioning four-qubit diamond gate, we use numerical simulations to quantify the performance of the gates for state-of-the-art superconducting qubit parameters [51][52][53] . Decoherence is included via the Lindblad master equation, Here ρ is the density matrix, H is the Hamiltonian of Eq. (3), and the sum is taken over the following eight collapse operators, C n : ffiffi ffi γ p σ i z inducing pure dephasing and ffiffi ffi γ p σ i À inducing qubit relaxation (photon loss), with i running over all four qubits, denoting by γ the decoherence rate. We solve the master equation numerically using the Python toolbox QuTiP 54 .
As a quality measure of the gate, we consider the average fidelity 55 (or simply 'fidelity' in the following), Detuning the qubits on the plaquettes A from the qubits on the plaquettes B allows each four-qubit device to run the diamond gate independently, while tuning the connecting qubits into resonance allows swap operations between plaquettes A and B. b A sequence of diamond gates U of Eq. (9) in each plaquette and two-qubit swaps between the plaquettes running on the 16-qubit quantum computer.
which quantifies how well the quantum map E t approximates the target unitary gate U target over a uniform distribution of input quantum states. If the diamond gate is run with an arbitrary initial state, the integral is taken over all possible four-qubit states, and can be reduced to a sum over a density matrix basis, as shown in ref. 55 . Putting U target = U from Eq. (9) and E t ðρð0ÞÞ ¼ ρðtÞ found from solving Eq. (10), the computed fidelity quantifies the overall performance of the diamond gate with arbitrary initial states. We denote this fidelity by F. Its maximum value (the gate fidelity) defines the gate time, which generally matches the predicted value of Eq. (8) within a few percent. The sources of gate infidelity are qubit decoherence and state mixing accommodated by a nonzero J C . In order to study the performance of the four individual gates of Eqs.
(4)- (7), In this case the target operation is a single term in Eq. (9), U target ¼ ϕ j i ϕ h j C U ϕ T , and the integral is taken over all states on the form ϕ j i C ψ j i T , i.e. only varying the target qubits' state, ψ j i T . These states span a subspace of the entire four-qubit Hilbert space characterized by the fixed control state, however couplings to other control states leads to leakage out of the subspace, which we take into account with the appropriate modification of the sum formula in ref. 55 . The resulting fidelity is denoted F ϕ , and the value at the gate time is denoted the gate fidelity for the associated gate.
Two example parameter sets relevant for superconducting qubits are shown in Table 1, which also includes the corresponding gates times and gate fidelities (at the simulated gate time). We use the state-of-the art decoherence rate γ = 0.01 MHz, leading to coherent qubits on the time-scale of γ −1 = 100 μs 51 . Figure 3 shows the simulated fidelities as functions of time. As expected, there is a trade-off between a fast gate and high-fidelity operations. Parameter set 1 operates in 59.3 ns with gate fidelities 0.99, which decreases to~0.96 for the very fast 31.5 ns gate of parameter set 2. The gate infidelities for each controlled gate follow the expectations discussed in the previous section. In particular, the idle gate fidelity, F Ψ À ðtÞ, is only limited by qubit decoherence, reducing its value from 1 to 0.9983 and 0.9968, respectively, during the operation time in the two cases. For the remaining three controlled gates, a longer gate time can improve the gate fidelity, with the drawback of increased susceptibility to qubit decoherence. Ultimately this limits the number of computations the diamond gate device can run successfully. For the purpose of demonstrating the model, we will use parameter set 1 in the following, unless otherwise stated.
To probe the sensitivity to the model parameters, we vary each of Δ, J, and J C . As is evident from Fig. 4a-c, the simulated gate times follow closely the prediction of Eq. (8). Specifically, the gate time is tunable through Δ and J. The gate fidelities for the individually controlled gates and the total diamond gate are shown in Fig. 4a-f. Except for the phase gate controlled by Ψ þ j i C , which is affected most strongly by couplings to other control states, the fidelities are above 0.99 over a wide range of parameters. Due to the mathematical equivalence between the two swapping gates controlled by 00 j i C and 11 j i C , the gate fidelities for these operations are very similar. We attribute the difference to qubit relaxation, which only affects 11 j i C and becomes more pronounced as the gate time increases. The identity gate controlled by Ψ À j i C is only limited by decoherence, and its gate fidelity decreases linearly with the gate time.
With a superconducting circuit implementation in mind, we consider a variety of system infidelites and their impact on the gate fidelities (see Fig. 5). Most harmful is a direct capacitive coupling between the target qubits (Fig. 5a), which allows the target qubits to bypass the control qubits, thereby circumventing the interference condition set by the control qubits. The gate fidelities roughly decrease with the square of the cross-coupling strength J T , leading to noticable gate infidelities even for a relatively weak coupling. However, as we will show in the next section, crosstalk should not be suppressed, but rather utilized to combat another effect appearing in superconducting qubits: couplings to higher-energy states in the qubits' spectrum. Figure  5b shows simulation results with random noise on the couplings between the target and control qubits emulating asymmetries present in an actual circuit due to fabrication limits. Each data point in the plot corresponds to a simulation with random deviations from the noiseless value, J, denoting by δJ the maximum deviation over the four couplings. The gate performance is very robust towards this type of noise.
Bell state generation, which is required for the control states Ψ ± j i C , has been shown with a state infidelity of~0.005 12 . We introduce control state infidelity in the following way. For each data point in Fig. 5c we contruct a random four-by-four Hermitian matrix M, from which we construct a unitary matrix V = e iϵM , where ϵ is a small real parameter. In the simulations, we apply V to the initial state of the control qubits in order to model imperfect state preparation. The resulting gate fidelity is shown as a function of the maximum infidelity among the four control states. The diamond gate suffers a linear decrease in gate fidelity, but remains high-performing for realistic control state infidelity.
Qubit decoherence in the form of relaxation and dephasing is included in the master Eq. (10) with rate γ. In Fig. 5d we see that the gate fidelity decreases linearly with γ. Even for qubits with γ = 0.05 MHz, i.e. coherent on the time-scale of γ −1 = 20 μs, the gate fidelity is~0.98. We attribute this robustness to the relatively short gate time of 59.3 ns.

Higher-energy states
In the previous section, we treated a model for four coupled qubits. In the superconducting circuit implementation of Fig. 1, these qubits are comprised of the two lowest energy states of the each transmon, 0 j i and 1 j i. However, in an actual superconducting circuit, the qubits may couple to higher-energy states in the transmon spectrum, which is the spectrum of a slightly anharmonic oscillator 39 . In this section, we analyze the effects from including the second excited state, 2 j i, in the spectrum, thereby turning each qubit into a qutrit.
The full analysis of the circuit of Fig. 1b is given in the Supplementary Information. The resulting four-qutrit Hamiltonian is a sum of the non-interacting part and the interaction terms which are analogous to Eqs. (1) and (2). The 'Pauli z-operator' on qutrit j, denotedσ j , includes 2 j i j in such a way that it has an energy Ω j + α j above 1 j i j , with Ω j and α j the frequency and anharmonicity, respectively. Typically α j /Ω j~− 0.05, yielding a small detuning of the second excited state compared to an equidistant spectrum (i.e. to vanishing anharmonicity). The operator is given as The 'Pauli y-operator' on qutrit j is where T j 0 % 1 and T j 2 % ffiffi ffi 2 p can be expressed in terms of Ω j and α j (see the Supplementary Information). Hence, the coupling between the first and second excited state is as strong as the coupling between the two lowest (qubit) levels. Due to the small anharmonicity in transmons, i.e. that the energy separation between the qubit levels almost equals the separation between the first and second excited states, couplings that exchange a single excitation like 11 j i ! 02 j i are not strongly energetically suppressed. In fact, this transition is sometimes used for the CZ gate 46 . Notice that this lack of suppression holds for transmons in general, and is not a consequence of the specific model considered here.
This has two undesired consequences. Firstly, unless J C =α C j j( 1, it allows the control state 11 j i C to mix with 02 j i C  and 20 j i C , leading to a non-conserved control state during the gate operation. This can be resolved by redefining the control state as with the mixing angleθ ¼ À 1 2 arctan (2 ffiffi ffi 2 p J C T C 1 T C 2 =α C )~0.5, such that it is an eigenstate of an effective control state Hamiltonian. This introduces a significant component of ð 02 j i C þ 20 j i C Þ= ffiffi ffi 2 p , which is avoided if J C = 0. Details are found in the Supplementary Information.
Secondly, excitations to the second excited states allow unwanted processes which bypass the control. For instance, when the diamond gate is desired to be idle, leakage across the control can occur via: Since this is a second-order process in the qutrit model Hamiltonian, it would not pose a threat to the functionality of the diamond gate if it only relied on (generally faster) first-order processes. However, the swap operations of Eqs. (4) and (5) are also second-order processes, leading to a failure of the idle diamond gate on the same time-scale as the operation of the swap gates. Similarly, the control state Ψ þ j i fails to prevent excitation leakage across the control, corrupting the operation of Eq. (6).
However, these undesired processes can be mitigated by taking advantage of the effects of crosstalk. The circuit analysis in the Supplementary Information reveals a weak unavoidable crosstalk coupling of strength J T in the interaction Hamiltonian (13), which by itself has a significant negative impact on the gate fidelities (cf. Fig. 5a). This leads directly to leakage across the control through processes of the type This process has the same unwanted outcome as the one of Eq. (17). As we show below, we can therefore restore the gate functionality by tuning the value of J T such that these two unwanted leakage processes cancel each other. Analyzing the problem with second-order perturbation theory in order to calculate the amplitude of the leaked state (see the Supplementary Information), we find destructive interference between these processes when the crosstalk strength takes the optimal value Thus by tuning the crosstalk strength to J T ¼ J opt T , we expect the fidelity for the target qubit swap 01 j i T $ 10 j i T to diminish, or equivalently a vanishing swap rate, when the control state is Ψ ± j i C . Figure 6 shows the swap rate for varying J T , with control qubits in each of the four control states. We find two distinct zeropoints, one for the data related to the control states 00 j i C and Ψ ± j i C at the expected value J opt T (vertical line), and one for11 i C . Thus, it is possible to prevent the unwanted swap operation for the control states Ψ ± j i C , but as a consequence also the swap operation controlled by 00 j i C is obstructed. On the other hand, the swap operation controlled by11 i C is preserved at J T ¼ J opt T , although the gate time is prolonged to around 220 ns. Remarkably, for J T /2π ≈ −2.5 MHz the situation is reversed. Here, putting the control in11 i C prevents swapping, while the three remaining control states permit it. At each zero-point, the gate time (inverse swap rate) for the swapping gate(s) is prolonged compared to the results in the previous section. To reduce the gate time, one should pick parameters such that the zero-points are further apart, or such that the inclination of the graphs are steeper. Figure 7 illustrates in more detail the cancellation of unwanted transfer by crosstalk engineering. Each subfigure shows the swap fidelity for different initial target qubit states. The control is initialized in the state indicated above each column. Figure 7a-d (the top row) show simulations for J T = 0, while the crosstalk has been put to its optimal value, J T ¼ J opt T , in Fig. 7e-h (the bottom row). As expected from Fig. 6, the swap 01 j i T $ 10 j i T (dark lines) occurs for any control state when there is no crosstalk, but is controlled uniquely by11 i C when the crosstalk is at the optimal value. In the cases of 00 j i T and 11 j i T , we wish to maintain a unit fidelity across all control states, i.e. the states should acquire at most a phase. Tuning the crosstalk to J opt T also improves the gate operation in this regard.
Engineering crosstalk to mitigate unwanted leakage through higher-excited states is killing two birds with one stone: Each process is harmful to the functionality of the diamond gate, but letting them cancel each other preserves the ability to control the swap operation. The price is the loss of swap functionality in the gate controlled by 00 j i C , and an increased gate time for the model parameters considered here. Generally, the phases applied to each target state will be modified for all four controlled gates, but we do not pursue an analysis here, as other factors specific to the implementation will contribute to this as well. Rather, our main goal was to demonstrate a passive method for dealing with undesired leakage processes.

DISCUSSION
We have proposed a quantum interference device by coupling four qubits with exchange interactions. By analyzing the unitary dynamics of the system, we have shown that it realizes the diamond gate: a four-way controlled two-qubit gate, with the ability to run two different entangling swap and phase operations, a (parity) phase operation, an idling gate with no dynamics, or an arbitrary superposition of these. We considered an implementation in superconducting qubits using transmon qubits, and found that it generally operated fast and with high fidelity using state-ofthe-art model and noise parameters. When taking second excited states into account, we had to prevent leakage across the control by engineering crosstalk, demonstrating a general method to avoid leakage in superconducting qubit systems. The cost of this was a single redefined control state, one swap gate turning into a phase gate, altered phases on the gates, and a slower gate for the considered parameters. However, we only consider this analysis a starting point for an actual implementation, which might also include active microwave driving to optimize the operations or to prevent certain transitions. It might also be worthwhile to consider other types of superconducting qubits with larger anharmonicity, or entirely different platforms such as lattices of ultracold atoms or ions, where qubit encoded in hyperfine states or vibrational modes are far detuned from the rest of the spectrum. We illustrated how the four-qubit diamond gate device can constitute an essential building block in an extensible quantum computer, and proposed a simple scheme where quantum algorithms are run on the computer by parallel processing on each four-qubit module interspersed with two-qubit operations spreading entanglement in the system, and single-qubit operations. Evidently, this scheme is adaptable to many different algorithms, and future work will investigate which algorithms are suitable to be implemented in the diamond-plaquette device. In order to compute the time-evolution operator, UðtÞ ¼ e ÀiHFt , we notice that H F is on the form where P i ¼ i j i i h j is the projector onto the i'th orthonormal basis state of the N-dimensional subsystem A, and H i is a Hamiltonian on a disjoint subsystem B, such that H i commute with every P j . Operators on this form has the property that the product of any two terms is zero, (P i H i )(P j H j ) = 0 for i ≠ j, enabling an algebraic property known as "freshman's dream": ðH F Þ n ¼ P N i¼1 ðP i H i Þ n for any integer n > 0. This has the consequence that the operator exponential can be written as a sum: e ÀiPi Hi t : Since ðP i Þ n ¼ P i for any integer n > 0, we can pull the projector out of each exponential in the sum: e ÀiPi Hi t ¼ Finally, utilizing P N i¼1 P i ¼ 1, we find that the time-evolution operator can be expressed as The above decomposition of the time-evolution can used whenever one or more control qubits (subsystem A) catalyze a unitary gate operation on a set of target qubits (subsystem B) in the sense that the Hamiltonian does not mix the chosen control states. In our case, we can easily express the Hamiltonians (26)-(29) as matrices and find the unitary matrix exponentials. In the computational basis of the target qubits, they are as follows: U 00 T ðtÞ ¼ e ÀiH 00 T t ¼ with ζ = 4J 2 /Δ. The time-evolution operator for the four-qubit system is then UðtÞ ¼ 00 j i 00 h j C U 00 T ðtÞ þ 11 j i 11 h j C U 11 T ðtÞ þ Ψ þ j i Ψ þ h j C U Ψ þ T ðtÞ þ Ψ À j i Ψ À h j C U Ψ À T ðtÞ: Thus, each of the four unitaries (34)-(37) above is a gate operation performed on the target qubits, controlled entirely by the four control states, which are unaltered by the operation. The control states 00 j i C and 11 j i C induce oscillations between the target qubit states combined with a phase on either 00 j i T or 11 j i T , depending on the control state, and Ψ þ j i C controls a pure phase operation that distinguishes between the number of excitations in the target qubits. The singlet control state, Ψ À j i C , on the other hand, does nothing to the target qubits, and this control state can therefore be used to turn off the gate between the target qubits. The gate is fully quantum mechanical, as superpositions of control states will run the corresponding computations on the target qubits in parallel. The system comprise a true four-qubit quantum interference device in the form of a four-way controlled two-qubit gate (the diamond gate).
Of particular interest is the gate operation at the time t = t g ≡ π/|ζ|, which results in the operations discussed in the "Results" section. Setting t = t g in Eq. (38) produces the four-qubit unitary gate U of Eq. (9).
The case of a non-zero J C is treated in the Supplementary Information. Here we argue that, to a good approximation, the only modification to the J C = 0 case is the inclusion of the phase factors, e ± itgJC , in Eqs. (6) and (7).

DATA AVAILABILITY
The data that support the findings in this study are available from the corresponding author upon reasonable request.