Implementing the Quantum von Neumann Architecture with Superconducting Circuits

Matteo Mariantoni, H. Wang, T. Yamamoto, M. Neeley, Radoslaw C. Bialczak, Y. Chen, M. Lenander, Erik Lucero, A. D. O'Connell, D. Sank, M. Weides, J. Wenner, Y. Yin, J. Zhao, A. N. Korotkov, A. N. Cleland, John M. Martinis

References

Acknowledgements

This work was supported by IARPA under ARO award W911NF-08-1-0336 and under ARO award W911NF-09-1-0375. M. M. acknowledges support from an Elings Postdoctoral Fellowship. Devices were made at the UC Santa Barbara Nanofabrication Facility, a part of the NSF-funded National Nanotechnology Infrastructure Network. The authors thank A. G. Fowler for useful comments on scalability, and M. H. Devoret and R. J. Schoelkopf for discussions on Toffoli gates.

Author Contributions

M.M. performed the experiments and analyzed the data. M.M. and H.W. fabricated the sample. T.Y., H.W., and Y.Y. helped with the Fourier transform and M.N. with three-qubit gates. M.M., A.N.C., and J.M.M. conceived the experiment and co-wrote the manuscript.

Materials and Methods

In this section, we analyze the statistical properties of the experimental data shown in the main text. First, we explain how to simulate statistical errors. This procedure was used to estimate the confidence intervals for the data of Fig. 2 in the main text. Second, we describe how statistical errors were obtained from statistical ensembles of independent measurements. This procedure was used for the data of Fig. 3 in the main text. Third, we discuss the estimation of statistical errors due to fits to the data. This procedure was used for the data of Fig. 4 in the main text.

In this subsection, we discuss two important sources of statistical errors in our data: Errors associated with qubit’s measurement (binomial-type errors) and errors due to jitter/fluctuations in the electronics (phase errors). Assuming binomial-type and phase errors, we describe the procedures used to simulate the confidence intervals for the elements and metrics of the density matrices shown in Fig. 2C of the main text.

Binomial-type errors are inherent to our qubit measurement process, where the measurement is repeated a fixed number of times NN, each measurement trial has two possible outcomes, i.e., qubit being in the ground state ∣g⟩|\textrm{g}\rangle with probability pgp_{\textrm{g}} or in the excited state ∣e⟩|\textrm{e}\rangle with probability pe=1−pgp_{\textrm{e}}{}={}1-p_{\textrm{g}}, the probability pep_{\textrm{e}} is to good approximation the same for each trial, and the trials can be considered to be statistically independent. The measurement outcome associated with ∣g⟩|\textrm{g}\rangle is counted as , and that associated with ∣e⟩|\textrm{e}\rangle as 11. Under these assumptions, the qubit measurement process can be described by a binomial distribution.

Given a statistical sample XNX^{N} consisting of NN measurement outcomes (i.e., a statistical sample XNX^{N} from a Bernoulli distribution with parameter pep_{\textrm{e}}), the maximum likelihood estimator of pep_{\textrm{e}} (i.e., the estimated probability) is given by

where XkX^{k} represents the kk-th outcome among the NN measured. There are several ways to compute a confidence interval for the parameter pep_{\textrm{e}}. The most common result is based on the approximation of the binomial distribution with a normal distribution. This represents a good approximation in our experiments, where the number of measurements NN is large (typically N⩾1500N{}\geqslant{}1500). In this case, it can be shown that a confidence interval for the parameter pep_{\textrm{e}} is given by

where z(1−α/2)z_{(1-\alpha/2)} is the (1−α/2)(1-\alpha/2) percentile of a standard normal distribution. For example, for a 0.950.95 (9595%) confidence interval, we set α=0.05\alpha{}={}0.05, so that z(1−α/2)=1.96z_{(1-\alpha/2)}{}={}1.96. When analyzing our data we approximate the percentile 1.961.96 with 22, thus obtaining a slightly wider confidence interval;

Phase errors are mostly due to the phase jitter/fluctuations in the room-temperature cables and electronics used to measure the qubits. In order to quantify such errors, the following experiment was performed. First, we initialized one of the two qubits, e.g., qubit Q1, in the ground state, ∣Q1⟩=∣g⟩|\textrm{Q}_{1}\rangle{}={}|\textrm{g}\rangle; second, we applied to Q1 a π/2\pi/2 unitary rotation about the yy-axis, R^yπ/2\hat{R}^{\pi/2}_{y}, bringing the qubit into the state ∣Q1⟩=(∣g⟩+∣e⟩)/2|\textrm{Q}_{1}\rangle{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)/\sqrt{2}. This state is characterized by the density matrix

The plot of Fig. S1C is useful in determining the phase errors associated with different types of two-qubit QST, as well as quantum process tomography (QPT) 2, 3, 4, 5. In fact, two-qubit QST can be realized either by applying to each qubit the set of three unitary operations {I^,R^xπ/2,R^yπ/2}\{\hat{I},\hat{R}^{\pi/2}_{x},\hat{R}^{\pi/2}_{y}\} (I^\hat{I} is the 2×22\times 2 identity matrix, R^xπ/2\hat{R}^{\pi/2}_{x} a π/2\pi/2 unitary rotation about the xx-axis, and R^yπ/2\hat{R}^{\pi/2}_{y} a π/2\pi/2 unitary rotation about the yy-axis), which we call “tomo,” or the set of six unitary operations {I^,R^xπ/2,R^yπ/2,R^x−π/2,R^y−π/2,R^xπ}\{\hat{I},\hat{R}^{\pi/2}_{x},\hat{R}^{\pi/2}_{y},\hat{R}^{-\pi/2}_{x},\hat{R}^{-\pi/2}_{y},\hat{R}^{\pi}_{x}\} (R^x−π/2\hat{R}^{-\pi/2}_{x} is a −π/2-\pi/2 unitary rotation about the xx-axis, R^y−π/2\hat{R}^{-\pi/2}_{y} a −π/2-\pi/2 unitary rotation about the yy-axis, and R^xπ\hat{R}^{\pi}_{x} a π\pi unitary rotation about the xx-axis), which we call “octomo.”

In the case of two-qubit tomo, the number of operations that must be applied to the pair of qubits is given by the permutations of the allowed set of unitary operations, 32=93^{2}{}={}9. This number multiplied by the 44 possible joint probabilities for a two-qubit system, pgg,pge,pegp_{\textrm{gg}},p_{\textrm{ge}},p_{\textrm{eg}}, and peep_{\textrm{ee}} (where, e.g., pgep_{\textrm{ge}} is the probability to measure the first qubit in the ground state with the second qubit in the excited state) gives a total of 3636 probabilities. In the case of octomo, the total number of probabilities is given by the permutations of 66 unitary operations for 22 qubits, 62=366^{2}{}={}36, times the 44 possible joint probabilities for a two-qubit system, for a total of 144144 probabilities.

In the experiments, the maximum likelihood estimator for each of the four probabilities pgg,pge,pegp_{\textrm{gg}},p_{\textrm{ge}},p_{\textrm{eg}}, and peep_{\textrm{ee}} is obtained from the outcome of NN measurements. We note that, in a joint two-qubit measurement each outcome consists of 44 numbers obtained simultaneously, where each number can be either or 11. The statistical sample consisting of NN two-qubit joint measurements will be hereafter defined as XlmNX^{N}_{lm}, with l,m=g,el,m{}={}\textrm{g},\textrm{e}. Similarly to Eq. S5, the maximum likelihood estimator (i.e., the estimated probability) for each of the four probabilities pgg,pge,pegp_{\textrm{gg}},p_{\textrm{ge}},p_{\textrm{eg}}, and peep_{\textrm{ee}} can thus be obtained from

where XlmkX^{k}_{lm} represents the kk-th outcome among the NN measured.

For a given kk, the four possible XlmkX^{k}_{lm}, i.e., XggkX^{k}_{\textrm{gg}}, XgekX^{k}_{\textrm{ge}}, XegkX^{k}_{\textrm{eg}}, and XeekX^{k}_{\textrm{ee}}, are measured simultaneously (with Xggk+Xgek+Xegk+Xeek=1X^{k}_{\textrm{gg}}+X^{k}_{\textrm{ge}}+X^{k}_{\textrm{eg}}+X^{k}_{\textrm{ee}}{}={}1). Hence, the effective number of events that has to be measured for each tomo is 36/4=936/4{}={}9, and for each octomo 144/4=36144/4{}={}36.

We typically measure 25002500 events per second, and repeat each measurement N=15000N{}={}15000 times. As a consequence, a two-qubit tomo takes approximately 11 min, and a two-qubit octomo approximately 44 min.

All data displayed in Fig. 2C of the main text were obtained using tomo, while all data in Fig. 3, D and E, were obtained using octomo. All density matrices used to reconstruct the χ\chi matrix of Fig. 3F in the main text were also obtained with octomo. The standard deviation due to phase errors can be estimated in each case by looking up the fit in Fig. S1C.

Considering for example a two-qubit octomo with N=15000N{}={}15000, the statistical properties of the resulting density matrix ρ^\hat{\rho} and of the corresponding metrics [fidelity F\mathcal{F}, negativity N\mathcal{N}, concurrence C\mathcal{C}, and entanglement of formation E\mathcal{E}; cf. Ref. 6 and references therein for an extensive description of these metrics] are obtained as follows:

The probabilities PlmP_{lm} associated with two-qubit octomo are estimated according to Eq. S8. As explained above, this corresponds to a total of 36×4=14436\times 4{}={}144 estimated probabilities. To simplify the notation, we will hereafter refer to these probabilities as PiP_{i}, with i∈{1,2,…,144}i{}\in{}\{1,2,\ldots,144\};

The estimated probabilities PiP_{i} are corrected for measurement errors [cf. Refs. 7 and 8 for our standard procedures to correct for measurement errors in the case of one and two qubits, respectively]. The corrected probabilities PiP_{i} are stored as a 144×1144\times 1 column vector;

By summing each column of such a matrix to the column vector containing the 144144 estimated probabilities PiP_{i}, we obtain a matrix of 144×M144\times M probabilities, where each column simulates the result of a different QST experiment.

For example, Fig. S2A shows the histogram associated with the 66-th probability P6P_{6} of the vector of probabilities PiP_{i} in the case of the octomo for the state ρ^π\hat{\rho}_{\pi} of Fig. 3E in the main text;

Each column of the 144×M144\times M matrix of probabilities obtained in point (44) is inverted by following the usual QST rules 1, 8. This allows us to find the corresponding density matrix ρ^junphys\hat{\rho}^{\textrm{unphys}}_{j}, with j∈{1,2,…,M}j{}\in{}\{1,2,\ldots,M\}, thus obtaining MM density matrices associated with one state;

Physicality constraints are enforced on each, generally unphysical, density matrix ρ^junphys\hat{\rho}^{\textrm{unphys}}_{j} by means of the MATLAB packages SeDuMi 1.211.21 and YALMIP (semidefinite programming) 9. The physical constraints are such that each final - physical - density matrix ρ^j\hat{\rho}_{j} should have unit trace and be positive semidefinite.

In order to obtain the mean physical density matrix ρ^\hat{\rho} associated with the MM physical density matrices ρ^j\hat{\rho}_{j} and the corresponding standard deviations, we calculate the mean value and standard deviation of the real and imaginary part of each matrix element for the MM matrices ρ^j\hat{\rho}_{j}. The mean physical matrix ρ^\hat{\rho} will thus have elements ⟨lm∣ρ^∣pq⟩\langle lm|\hat{\rho}|pq\rangle (with ∣lm⟩,∣pq⟩∈M2|lm\rangle,|pq\rangle{}\in{}\mathcal{M}_{2}), each of them (real and imaginary part) characterized by a given standard deviation. Figure S2B shows the histogram for the real part of the matrix element with mean value ⟨eg∣ρ^π∣ge⟩=0.338\langle\textrm{eg}|\hat{\rho}_{\pi}|\textrm{ge}\rangle{}={}0.338 for the state ρ^π\hat{\rho}_{\pi} of Fig. 3E in the main text. As expected, the distribution is approximately Gaussian with a 0.950.95 confidence interval ±2σb=±0.005\pm{}2\sigma_{\textrm{b}}{}={}\pm 0.005.

The knowledge of the MM matrices ρ^j\hat{\rho}_{j} also allows us to estimate the confidence intervals for the relevant metrics characterizing the state ρ^\hat{\rho}: F\mathcal{F}, N\mathcal{N}, C\mathcal{C}, and E\mathcal{E}. This can easily be accomplished by calculating the metrics for each ρ^j\hat{\rho}_{j}, thus obtaining MM values for each metric, and then computing the mean value and standard deviation of the MM values associated with each metric.

to a 4×44{}\times{}4 measured density matrix ρ^meas\hat{\rho}^{\textrm{meas}}, thus obtaining the jj-th unphysical density matrix

We can then proceed as in step (6) above and obtain a mean physical density matrix ρ^\hat{\rho} and its statistical properties, as in the case of binomial-type errors. This allows us also to find the metrics associated with ρ^\hat{\rho} and their statistical properties. Notice that the unitary transformation of Eq. S9 simulates random rotations along the zz-axis of both qubit Q1Q_{1} and qubit Q2Q_{2}.

The total mean physical density matrix is finally obtained by averaging the mean physical density matrix obtained in the case of binomial-type errors and the matrix obtained in the case of phase errors. The same applies to the mean values of all metrics. The corresponding standard deviations are found by summing in quadrature the values obtained in the case of binomial-type and phase errors. For example, the numerical value with confidence interval of each element of the density matrices in Fig. 2C of the main text were obtained following this procedure. These numbers are reported in Table S1.

Incidentally, we found that phase errors do not add any significant contribution to the confidence intervals of the density matrix elements and of their metrics.

Notice that, the reason why we decided to simulate the statistical properties of the data in Fig. 2 of the main text is because we only had 22 independent measurements of these data. Such a statistical ensemble is obviously insufficient to obtain reliable confidence intervals, which, thus, needed to be simulated.

Experimental estimation of statistical errors

In the case of the density matrices in Fig. 3E and of the χmp\chi^{\textrm{p}}_{\textrm{m}} matrix of the quantum Fourier transform in Fig. 3F of the main text we had ensembles of independent measurements large enough to allow the confidence intervals estimation directly from the data.

In particular, the density matrix ρ^0.28\hat{\rho}_{0.28} in the left panel of Fig. 3E is the average of a statistical ensemble of M=10M{}={}10 independent measurements, and the density matrices ρ^π/2\hat{\rho}_{\pi/2} and ρ^π\hat{\rho}_{\pi} in the center and right panels of Fig. 3E, respectively, are the average of an ensemble of M=6M{}={}6 independent measurements. The standard deviation of each matrix element (real and imaginary part) as well as the mean value and standard deviation of all metrics can easily be estimated from such statistical ensembles.

Finally, the matrix χmp\chi^{\textrm{p}}_{\textrm{m}} of Fig. 3F is the average of an ensemble of 1515 independent measurements. This allows us to estimate the mean value and standard deviation of the process fidelity Fχ\mathcal{F}_{\chi} associated with the quantum Fourier transform (cf. main text).

Statistical errors of fitted parameters

The confidence intervals associated with the quantum phase tomography data shown in Fig. 4, C and F, of the main text are dominated by the statistical errors of the coefficients fitted from the data in Fig. 4, B and E, of the main text. In particular, the coefficient of interest is the phase of each curve in Fig. 4, B and E (or, more in general, of each curve in Fig. S12, C and D).

We remind that the error vector associated with the vector of coefficients fitted to a curve is given by the square root of the vector S⃗\vec{S} of the diagonal elements from the estimated covariance matrix of the coefficient estimates, (X⃗TX⃗)−1 ⟨s⟩2(\vec{X}^{T}\vec{X})^{-1}\,\langle s\rangle^{2}. Here, X⃗\vec{X} is the Jacobian of the fitted values with respect to the coefficients, X⃗T\vec{X}^{T} is the transpose of X⃗\vec{X}, and ⟨s⟩2\langle s\rangle^{2} is the mean squared error. This procedure allows us to estimate the errors associated with the fitted phases. These errors propagate through the quantum tomography process (cf. section on “Quantum phase tomography” at the end of these Methods), finally turning into the confidence intervals reported in Fig. 4, C and F, of the main text.

Definition of the qubit reference frame

In this section, we briefly explain the concepts of reference frame and reference clock rate associated with a qubit. These concepts will be useful in understanding the dynamic phases acquired by the qubits when programming the quantum von Neumann architecture as well as the sequences used to tune up the CZ-ϕ\phi gates and the XOR and M gate.

In the two-level approximation 10, the Hamiltonian of a phase qubit can be written as

with ground state ∣g⟩|\textrm{g}\rangle and excited state ∣e⟩|\textrm{e}\rangle, and eigenenergies EgE_{\textrm{g}} and EeE_{\textrm{e}}, respectively. In Eq. S11, fQ(z)≡ΔEeg/h=(Ee−Eg)/hf_{\textrm{Q}}(z){}\equiv{}\Delta E_{\textrm{eg}}/h{}={}(E_{\textrm{e}}-E_{\textrm{g}})/h represents the qubit transition frequency, which can be tuned by means of z-pulses with amplitude zz, and σ^z\hat{\sigma}_{z} is the usual spin 1/21/2 Pauli operator. At the beginning of a CZ-ϕ\phi gate, each qubit is initialized in ∣g⟩|\textrm{g}\rangle at the so-called idle point, which corresponds to a z-pulse amplitude z=0z{}={}0. The qubit transition frequency at the idle point is thus given by fQ(z=0)≡fQ0f_{\textrm{Q}}(z{}={}0){}\equiv{}f^{0}_{\textrm{Q}}.

In order to prepare a qubit in the excited state ∣e⟩|\textrm{e}\rangle or in a linear superposition ∣g⟩+∣e⟩|\textrm{g}\rangle+|\textrm{e}\rangle, the qubit has to be driven by a microwave pulse. The Hamiltonian governing the interaction between the qubit and the microwave driving is given by 11

where ΩD(τ)\Omega_{\textrm{D}}(\tau) is the time-dependent driving amplitude expressed in unit hertz, fDf_{\textrm{D}} the driving frequency, σ^y\hat{\sigma}_{y} the usual spin 1/21/2 Pauli operator, τ\tau the time, and ϕdelay\phi_{\textrm{delay}} an arbitrary phase delay. By calibrating the microwave pulse such that the phase delay ϕdelay=π/2\phi_{\textrm{delay}}{}={}\pi/2, we can rewrite the driving Hamiltonian as

By combining the qubit Hamiltonian of Eq. S11 and the driving Hamiltonian of Eq. S13, we obtain the total Hamiltonian of the driven system, H^QD=H^Q+H^D\widehat{H}_{\textrm{QD}}{}={}\widehat{H}_{\textrm{Q}}+\widehat{H}_{\textrm{D}}.

In our experiments the driving frequency fDf_{\textrm{D}} is a fixed parameter that is set to be equal to the qubit transition frequency at the idle point 12,

For a given qubit, the microwave driving represents the reference frame associated with that qubit, with reference clock rate given by fQ0f^{0}_{\textrm{Q}}. Defining the detuning between the z-dependent qubit transition frequency fQ(z)f_{\textrm{Q}}(z) and the reference clock rate fQ0f^{0}_{\textrm{Q}} as Δ(z)≡fQ(z)−fQ0\Delta(z){}\equiv{}f_{\textrm{Q}}(z)-f^{0}_{\textrm{Q}}, the qubit-driving Hamiltonian H^QD\widehat{H}_{\textrm{QD}} can be expressed in the uniformly rotating reference frame by applying the unitary rotation D^=e+i2πfQ0τσ^z/2\widehat{D}{}={}e^{+i2\pi f^{0}_{\textrm{Q}}\tau\hat{\sigma}_{z}/2} 13. The rotated Hamiltonian is thus given by

where the counter-rotating terms have been already neglected. The dynamics associated with the pulse sequences used to tune up the CZ-ϕ\phi gates and the XOR and M gate can be understood by following the time-evolution of the Hamiltonian of Eq. S14. In particular, the Hamiltonian H~^QD\widehat{\widetilde{H}}_{\textrm{QD}} describes the dynamic phases acquired by the qubits when they are brought outside their reference frame (i.e., qubit rotations about the zz-axis). As it will appear clear when describing the tune-up sequences of the CZ-ϕ\phi gates and of the XOR and M gate, in the experiments we always compensate for such dynamic phases.

Programming the quantum von Neumann architecture

The phase difference between the off-diagonal elements of the density matrices shown in Fig. 2C of the main text (red arrows) are due to the qubits being brought outside their reference frame during the pulse sequence in Fig. 2A (the qubits acquire dynamic phases), and to the angle accumulated by the microwave signal used to excite the qubits. The pulse sequence was calibrated such that the first density matrix ρ^(I)\hat{\rho}_{\textrm{(I)}} has purely imaginary off-diagonal elements [cf. grey and overlayed red arrows in Fig. 2C (I) of the main text]. We can thus calculate the angles of the density matrices ρ^(III)\hat{\rho}_{\textrm{(III)}} and ρ^(V)\hat{\rho}_{\textrm{(V)}} by knowing the time duration of the various steps in the sequence and the corresponding qubit detunings (obtained from independent measurements), as shown by the grey arrows in the matrices of Fig. 2C, (III) and (V). As expected, the experimentally measured red arrows overlay the calculated grey arrows with high accuracy. We will later show a pulse method that allows us to compensate for dynamic phases during the experiment, rather than calibrating the phases a posteriori as in Fig. 2C. Such a compensation pulse method was used to implement the quantum Fourier transform and the XOR and M gate.

The numerical values of all elements (real and imaginary part) of each density matrix in Fig. 2C of the main text are reported in Table S1. The confidence interval for the real and imaginary part of each complex number is also indicated. The confidence intervals correspond to two standard deviations (95 %95\,\% confidence interval), where the standard deviations were calculated as explained in the section on “Statistical errors” of these Methods.

The quantum Fourier transform

The numerical values of all elements (real and imaginary part) of each density matrix in Fig. 3E of the main text are reported in Table S2. The 95 %95\,\% confidence interval for the real and imaginary part of each complex number is also indicated. The standard deviations were calculated as explained in the section on “Statistical errors” of these Methods.

As shown in the main text, the CZ-ϕ\phi gate is a fundamental element for the implementation of the quantum Fourier transform. In the rest of this section, we derive the analytical expression for the phase ϕ\phi of a CZ-ϕ\phi gate by diagonalizing the effective Hamiltonian of the Q1-B-Q2 system and calculating its time evolution. We subsequently describe the experimental pulse sequences required to tune up the CZ-ϕ\phi gate and show three examples of Ramsey experiments used to measure the gate phase ϕ\phi, when ϕ=0.01\phi{}={}0.01, ϕ=π/2\phi{}={}\pi/2, and ϕ=π\phi{}={}\pi. Finally, we discuss the origin of systematic errors in the measurement of the phase ϕ\phi, showing that the global phase shift in the curve of Fig. 3C of the main text is due to a drift of the qubit operation point.

The CZ-ϕ\phi gate demonstrated in the main text makes use of a bus resonator B that mediates the interaction between qubit Q1 and Q2. During the CZ-ϕ\phi gate qubit Q1 is used as a qutrit, where the third eigenstate ∣f⟩|\textrm{f}\rangle plays an active role in the implementation of the gate. Qubit Q1 represents the gate target and qubit Q2 the gate control. The energy diagram of the Q1-B coupled system is displayed in Fig. S3A. The coupled system consists of the states ∣g⟩|\textrm{g}\rangle, ∣e⟩|\textrm{e}\rangle, and ∣f⟩|\textrm{f}\rangle of the target qubit Q1, and of the states ∣0⟩|0\rangle and ∣1⟩|1\rangle of the bus resonator B. In the rotating frame of resonator B and using the rotating-wave approximation, the system effective Hamiltonian can be written as

The diagonalization of the Hamiltonian of Eq. S16 gives the eigenstates

Given the initial state ∣Q1B⟩0=∣e1⟩|\textrm{Q}_{1}\textrm{B}\rangle_{0}{}={}|\textrm{e}1\rangle, after a time τ\tau the evolution U^(τ)=exp⁡(−iH^effτ/ℏ)\widehat{U}(\tau){}={}\exp(-i\widehat{H}_{\textrm{eff}}\tau/\hbar) of the effective Hamiltonian of Eq. S16 acting on ∣Q1B⟩0|\textrm{Q}_{1}\textrm{B}\rangle_{0} results in the state

which, for simplicity, can be rewritten as

Figure S3B depicts the Bloch sphere of the Q1-B coupled system for the states ∣e1⟩|\textrm{e}1\rangle and ∣f0⟩|\textrm{f}0\rangle, showing that the interaction dynamics between the two states always starts and ends at the same pole of the sphere. It is during this interaction that the phase ϕ\phi of Eq. S24 is acquired by the target qubit Q1. In particular, when δQ1B=0\delta_{\textrm{Q}_{1}\textrm{B}}{}={}0 we obtain ϕ=π\phi{}={}\pi, while for δQ1B>0\delta_{\textrm{Q}_{1}\textrm{B}}{}>{}0 we obtain all phases 0≲ϕ<π0{}\lesssim{}\phi{}<{}\pi.

An effective Hamiltonian similar to that of Eq. S16 governs the interaction dynamics for the Q2-B system. Hence, the interaction between the states of both the Q1-B and Q2-B systems always starts and ends at the same pole of the coupling Bloch sphere. This has the important consequence that the CZ-ϕ\phi gates used here are insensitive to the relative phases of qubits Q1 and Q2 when they are brought into resonance via resonator B. This feature allows us to use independent reference frames with incommensurate frequencies (and, hence, no special phase relationship) for each qubit, thus making possible to tune up each qubit with a separate calibration sequence.

CZ-ϕitalic-ϕ\phi gate tuneup

Figure S4, A and B, shows the two sequences used to calibrate the pulses applied to qubit Q1 during the CZ-ϕ\phi gate operation. We note that in the calibration sequence of Fig. S4B a series of pulses is applied to qubit Q1 as well as to qubit Q2. We will show that by comparing the results obtained from the calibration of Q1 without pulsing Q2 (Fig. S4A and Fig. S5A) with those obtained by pulsing Q2 (Fig. S4B and Fig. S5B) it is possible to measure the phase ϕ\phi associated with the CZ-ϕ\phi gate (cf. also main text and Fig. 3C of the main text).

Before delving into the analysis of the calibration sequences, we note that the idle point of qubits Q1 and Q2 was set at a different position depending on the experiment. For the experiments of Fig. 2, C to E, in the main text, the idle point was set in between the memory and bus resonator for both qubits. This is also the case for the swap spectroscopies shown in Fig. 1B of the main text. For all the other experiments, e.g., those described in this section, the idle point was set above the bus resonator for both qubits.

Consistently with the vertical axis in Fig. 1B of the main text, a z-pulse in the upward direction, which increases the qubit transition frequency, always corresponds to a negative z-pulse amplitude with respect to the qubit idle point. The opposite applies to the case of a z-pulse in the downward direction.

The first calibration sequence for qubit Q1, which is shown in Fig. S4A, comprises the following steps:

Qubit Q1 is initialized in the ground state ∣Q1⟩(Ia)=∣g⟩|\textrm{Q}_{1}\rangle_{(\textrm{Ia})}{}={}|\textrm{g}\rangle at the idle point, setting the qubit reference frame with reference clock rate fQ10f^{0}_{\textrm{Q}_{1}}. In Fig. S4A, the reference frame is indicated by the dash-dot magenta line. During the entire calibration sequence, the bus resonator B is maintained in the vacuum state ∣0⟩|0\rangle. Nevertheless, in Fig. S4A we indicate the presence of resonator B by a dotted grey line, which helps visualizing the frequency detuning between qubit and resonator;

Keeping the qubit detuning Δ=0\Delta{}={}0, a Gaussian microwave pulse with full width at half maximum (FWHM) τFWHM\tau_{\textrm{FWHM}} is applied to Q1. The amplitude of the pulse is chosen such that 2πΩDτ=π/22\pi\Omega_{\textrm{D}}\tau{}={}\pi/2. In this case, the time evolution of the Hamiltonian of Eq. S14 yields a π/2\pi/2 unitary rotation about the yy-axis 14, R^yπ/2\hat{R}^{\pi/2}_{y}, which brings the qubit into the new state ∣Q1⟩(IIa)=(∣g⟩+∣e⟩)/2|\textrm{Q}_{1}\rangle_{(\textrm{IIa})}{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)/\sqrt{2};

For the correct operation of the CZ-ϕ\phi gate, the dynamic phase ϕdyn\phi_{\textrm{dyn}} must be compensated. This can be realized by applying a compensation z-pulse to Q1, with fixed length τcmp\tau_{\textrm{cmp}} and variable amplitude zcmpz_{\textrm{cmp}}. In order to avoid crossing the resonance with B, the amplitude of the compensation pulse is swept in the opposite direction as compared to the z-pulse zCZ-ϕz_{\textrm{CZ-}\phi} (cf. Fig. S4A). In this case, the time evolution of H~^QD\widehat{\widetilde{H}}_{\textrm{QD}} acting on ∣Q1⟩(IIIa)|\textrm{Q}_{1}\rangle_{(\textrm{IIIa})} yields the state ∣Q1⟩(IVa)=(∣g⟩ e−iϕa/2+∣e⟩ e+iϕa/2)/2|\textrm{Q}_{1}\rangle_{(\textrm{IVa})}{}={}(|\textrm{g}\rangle\,e^{-i\phi_{\textrm{a}}/2}+|\textrm{e}\rangle\,e^{+i\phi_{\textrm{a}}/2})/\sqrt{2}, where ϕa/2≡ϕdyn−Δ(zcmp) τcmp/2\phi_{\textrm{a}}/2{}\equiv{}\phi_{\textrm{dyn}}-\Delta(z_{\textrm{cmp}})\,\tau_{\textrm{cmp}}/2;

A rotation R^yπ/2\hat{R}^{\pi/2}_{y} similar to that in point (IIa) is applied to Q1, bringing the qubit into the final state ∣Q1⟩(Va)=−isin⁡(ϕa/2)∣g⟩+cos⁡(ϕa/2)∣e⟩|\textrm{Q}_{1}\rangle_{(\textrm{Va})}{}={}-i\sin(\phi_{\textrm{a}}/2)|\textrm{g}\rangle+\cos(\phi_{\textrm{a}}/2)|\textrm{e}\rangle;

In summary, the two qubit rotations R^yπ/2\hat{R}^{\pi/2}_{y} at the beginning and end of the calibration sequence of Fig. S4A realize a generalized Ramsey experiment, which allows us to measure the total phase acquired by Q1 during the z-pulses that bring it outside its reference frame. The experimental data for the calibration sequence of Fig. S4A are shown in Fig. S5A, where the three Ramsey fringes are obtained for three different values of the detuning δQ1B\delta_{\textrm{Q}_{1}\textrm{B}}, corresponding to a CZ-0.010.01, CZ-π/2\pi/2, and CZ-π\pi gate, respectively. For each Ramsey fringe in Fig. S5A, the z-pulse amplitude zcmpz_{\textrm{cmp}} chosen to compensate the dynamic phase ϕdyn\phi_{\textrm{dyn}} is indicated by a vertical dotted black line.

The second calibration sequence for qubit Q1 is shown in Fig. S4B. The sequence, which is the same as the first calibration sequence with the addition of the pulses applied to qubit Q2, comprises the following steps:

Qubit Q1, qubit Q2, and resonator B are initialized in the ground/vacuum state ∣Q1⟩(Ib)⊗∣Q2⟩(Ib)⊗∣B⟩(Ib)=∣g⟩⊗∣g⟩⊗∣0⟩|\textrm{Q}_{1}\rangle_{(\textrm{Ib})}\otimes|\textrm{Q}_{2}\rangle_{(\textrm{Ib})}\otimes|\textrm{B}\rangle_{(\textrm{Ib})}{}={}|\textrm{g}\rangle\otimes|\textrm{g}\rangle\otimes|0\rangle, with both qubits biased at the idle point;

A Gaussian microwave pulse with FWHM τFWHM\tau_{\textrm{FWHM}} is applied to Q2. The amplitude of the pulse is chosen such that ΩDτ=π\Omega_{\textrm{D}}\tau{}={}\pi. In this case, the time evolution of H~^QD\widehat{\widetilde{H}}_{\textrm{QD}} acting on ∣Q2⟩(Ib)|\textrm{Q}_{2}\rangle_{(\textrm{Ib})} realizes a full qubit population transfer, R^yπ\hat{R}^{\pi}_{y}, bringing the qubit into the new state ∣Q2⟩(IIb)=∣e⟩|\textrm{Q}_{2}\rangle_{(\textrm{IIb})}{}={}|\textrm{e}\rangle;

The state ∣Q2⟩(IIb)|\textrm{Q}_{2}\rangle_{(\textrm{IIb})} is moved from Q2 to B by means of an iSWAP of length τiS\tau_{\textrm{iS}}. At the end of the iSWAP, resonator B is in the state ∣B⟩(IIIb)=∣1⟩|\textrm{B}\rangle_{(\textrm{IIIb})}{}={}|1\rangle;

Qubit Q1 is prepared in the state ∣Q1⟩(IVb)=(∣g⟩+∣e⟩)/2|\textrm{Q}_{1}\rangle_{(\textrm{IVb})}{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)/\sqrt{2} by means of a rotation R^yπ/2\hat{R}^{\pi/2}_{y};

The same z-pulse as in point (IIIa) is applied to Q1. In this case, the Q1-B coupled system is in the state ∣Q1B⟩=(∣g⟩+∣e⟩)/2⟩⊗∣1⟩|\textrm{Q}_{1}\textrm{B}\rangle{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)/\sqrt{2}\rangle\otimes|1\rangle, which represents a bright state of the time evolution of the system, as opposed to the dark state ∣Q1B⟩=(∣g⟩+∣e⟩)/2⟩⊗∣0⟩|\textrm{Q}_{1}\textrm{B}\rangle{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)/\sqrt{2}\rangle\otimes|0\rangle. Depending on τCZ-ϕ\tau_{\textrm{CZ-}\phi} and zCZ-ϕz_{\textrm{CZ-}\phi}, and, thus, on δQ1B\delta_{\textrm{Q}_{1}\textrm{B}}, at the end of the z-pulse the excited state ∣e⟩|\textrm{e}\rangle of Q1 has acquired a phase ϕ\phi [cf. main text; when ϕ=π\phi{}={}\pi, the z-pulse is a −SWAP2-\textrm{SWAP}^{2} 5]. As in point (IIIa), at the end of such a pulse Q1 has also acquired a dynamic phase ϕdyn\phi_{\textrm{dyn}}, resulting in the state ∣Q1⟩(Vb)=(∣g⟩ e−iϕdyn+∣e⟩ e+iϕdyn e+iϕ)/2|\textrm{Q}_{1}\rangle_{(\textrm{Vb})}{}={}(|\textrm{g}\rangle\,e^{-i\phi_{\textrm{dyn}}}+|\textrm{e}\rangle\,e^{+i\phi_{\textrm{dyn}}}\,e^{+i\phi})/\sqrt{2};

The dynamic phase ϕdyn\phi_{\textrm{dyn}} acquired by Q1 is compensated by means of a z-pulse, as in point (IVa). At the end of the compensation pulse Q1 is in the state ∣Q1⟩(VIb)=[∣g⟩ e−iϕa/2+∣e⟩ e+i(ϕa/2+ϕ)]/2|\textrm{Q}_{1}\rangle_{(\textrm{VIb})}{}={}[|\textrm{g}\rangle\,e^{-i\phi_{\textrm{a}}/2}+|\textrm{e}\rangle\,e^{+i(\phi_{\textrm{a}}/2+\phi)}]/\sqrt{2};

A rotation R^yπ/2\hat{R}^{\pi/2}_{y} is applied to Q1, bringing the qubit to the final state ∣Q1⟩(VIIb)=−ieiϕ/2sin⁡(ϕa/2+ϕ/2)∣g⟩+eiϕ/2cos⁡(ϕa/2+ϕ/2)∣e⟩|\textrm{Q}_{1}\rangle_{(\textrm{VIIb})}{}={}-ie^{i\phi/2}\sin(\phi_{\textrm{a}}/2+\phi/2)|\textrm{g}\rangle+e^{i\phi/2}\cos(\phi_{\textrm{a}}/2+\phi/2)|\textrm{e}\rangle;

Finally, a measurement pulse is applied to Q1 in order to obtain the probability to find the qubit in ∣e⟩|\textrm{e}\rangle, Pe=∣eiϕ/2cos⁡(ϕa/2+ϕ/2)∣2=(1+cos⁡ϕb)/2P_{\textrm{e}}{}={}|e^{i\phi/2}\cos(\phi_{\textrm{a}}/2+\phi/2)|^{2}{}={}(1+\cos\phi_{\textrm{b}})/2, where ϕb≡ϕa+ϕ\phi_{\textrm{b}}{}\equiv{}\phi_{\textrm{a}}+\phi.

The phase difference between the probability PeP_{\textrm{e}} for the first and second calibration sequence allows us to measure the CZ-ϕ\phi gate phase, ϕb−ϕa=ϕ\phi_{\textrm{b}}-\phi_{\textrm{a}}{}={}\phi. This is illustrated in Fig. S5, where the phase difference between the Ramsey fringe in each panel of Fig. S5A and the corresponding fringe in each panel of Fig. S5B gives the phase of a CZ-0.010.01, CZ-π/2\pi/2, and CZ-π\pi gate, respectively.

The second calibration sequence can also be used to cross check the amplitude zcmpz_{\textrm{cmp}} of the compensation pulse chosen to cancel the dynamic phase ϕdyn\phi_{\textrm{dyn}}. For example, when ϕ=π\phi{}={}\pi, the Ramsey fringe obtained from the second calibration sequence should reach a minimum for the same value of zcmpz_{\textrm{cmp}} for which it reaches a maximum in the first calibration sequence. This is confirmed by comparing the experimental data shown in the rightmost panel of Fig. S5A and Fig. S5B.

Figure S6A shows the sequence used to calibrate the pulses applied to qubit Q2 during the CZ-ϕ\phi gate operation. The sequence comprises the following steps:

The system is initialized in the state ∣Q1⟩(Ic)⊗∣Q2⟩(Ic)⊗∣B⟩(Ic)=∣g⟩⊗∣g⟩⊗∣0⟩|\textrm{Q}_{1}\rangle_{(\textrm{Ic})}\otimes|\textrm{Q}_{2}\rangle_{(\textrm{Ic})}\otimes|\textrm{B}\rangle_{(\textrm{Ic})}{}={}|\textrm{g}\rangle\otimes|\textrm{g}\rangle\otimes|0\rangle, with both qubits biased at the idle point;

A rotation R^yπ/2\hat{R}^{\pi/2}_{y} with FWHM τFWHM\tau_{\textrm{FWHM}} is applied to Q2;

The state of Q2 is moved into B by means of an iSWAP;

Q1 is moved on resonance or close to resonance with B through the same z-pulse as point (Vb);

The state of B is moved back to Q2 via an iSWAP. During and between the iSWAPs of point (IIIc) and (Vc), Q2 acquires an unwanted dynamic phase.

At the same time as the iSWAP in point (Vc), the compensation pulse tuned up in the Q1 calibration sequence of Fig. S4, A and B [point (IVa) or (VIb)], is applied to Q1 (this is not strictly necessary due to the independence of the calibration sequences for Q1 and Q2);

A compensation pulse with fixed length τcmp\tau_{\textrm{cmp}} and variable amplitude zcmpz_{\textrm{cmp}} is applied to Q2;

A rotation R^yπ/2\hat{R}^{\pi/2}_{y} with FWHM τFWHM\tau_{\textrm{FWHM}} is applied to Q2;

The state ∣e⟩|\textrm{e}\rangle of Q2 is measured, thus obtaining the probability PeP_{\textrm{e}} as a function of zcmpz_{\textrm{cmp}} (cf. Fig. S6B). Choosing a maximum of the probability PeP_{\textrm{e}} allows us to cancel the effect of the unwanted dynamic phase acquired by Q2 during and between the two iSWAPs.

Systematic errors

The origin of the detuning δdrift\delta_{\textrm{drift}}, and of the corresponding phase shift, could be attributed to two main causes: (i) - Drift of the transition frequency of qubit Q1 during the experiment; (ii) - drift in the room-temperature electronics. Each pair of Ramsey fringes used to obtain the phase ϕ\phi (e.g., the fringe in the leftmost panel of Fig. S5A and the corresponding fringe in the leftmost panel of Fig. S5B) was measured within a few minutes. This time can be considered short enough to exclude the electronics drift as a main cause of the detuning between theory and data. We can thus assume the drift in the qubit transition frequency as the main reason for the detuning. This seems a fair assumption since the measurement of the time-domain swaps of Fig. 3B in the main text, which were used to calibrate the z-pulse amplitude zCZ-ϕz_{\textrm{CZ-}\phi} and swapping time τCZ-ϕ\tau_{\textrm{CZ-}\phi} necessary to obtain each phase ϕ\phi (cf. main text and the two previous supporting sections on the CZ-ϕ\phi gate theory and tuneup), took approximately four hours. Both the swaps and Ramsey fringes were measured starting from large detuning δQ1B=70\delta_{\textrm{Q}_{1}\textrm{B}}{}={}70 MHz to zero detuning, resulting in a time delay between swaps and Ramsey fringes for each value of δQ1B\delta_{\textrm{Q}_{1}\textrm{B}} of approximately four hours. From independent measurements (not shown), in such a time interval we expect the qubit transition frequency to drift by a few mega hertz.

In order to quantify the detuning δdrift\delta_{\textrm{drift}}, we can fit the data of Fig. 3C in the main text with the function

The function of Eq. S25 represents the best fit we found for the data of Fig. 3C in the main text. Figure S7 shows the same data as Fig. 3C of the main text (blue dots), together with the theory of Eq. S24 (solid green line), and the fit of Eq. S25 (solid magenta line). The detuning obtained from the fit is ∣δdrift∣≃4|\delta_{\textrm{drift}}|{}\simeq{}4 MHz, which is consistent with our expectation for a qubit frequency drift in approximately four hours.

We note that the qubit frequency drift as well as the data scatter in Fig. 3C of the main text (or, equivalently, of Fig. S7) are peculiar to that measurement, where we intended to show all phases ϕ∈(0,π]\phi{}\in{}(0,\pi] in a single, long scan. When it will be required to use a specific phase ϕ\phi to perform a quantum Fourier transform during an algorithm, we will first theoretically estimate the parameters zCZ-ϕz_{\textrm{CZ-}\phi} and τCZ-ϕ\tau_{\textrm{CZ-}\phi} and, then, search for the phase ϕ\phi in the close vicinity of these parameters. This will allow us to measure only a small portion of the swaps of Fig. 3B in the main text and a few corresponding Ramsey fringes, which can be realized in a much shorter time than the long scan of Fig. 3C in the main text, thus significantly reducing the incidence of systematic errors.

XOR gate and M gate tuneup

In this section, we describe the experimental pulse sequences required to tune up the XOR gate and M gate shown in the main text. We also explain in detail the complete experimental sequence used to obtain one nontrivial entry of the truth table associated with the M gate. Finally, we outline the mathematical procedure at the basis of quantum phase tomography.

The quantum logic circuit of the XOR gate considered here is sketched in Fig. 4A of the main text. Figure S8, A to C, shows the three sequences and the corresponding Ramsey fringes required to tune up the XOR gate. The concept behind each sequence is similar to the compensation of a dynamic phase acquired during a CZ-ϕ\phi gate, which has been elucidated in the section “The quantum Fourier transform” of these Methods. The third sequence needs special attention as it is applied to a resonator rather than a qubit state.

The first sequence, which is displayed in Fig. S8A (Left), acts on control qubit Q1. During the entire sequence, the control qubit Q2 and the target bus resonator B remain in the state ∣Q2B⟩=∣g0⟩|\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}0\rangle, and all pulses acting on Q2 are turned off. Qubit Q1 is initialized in the ground state ∣Q1⟩=∣g⟩|\textrm{Q}_{1}\rangle{}={}|\textrm{g}\rangle at the idle point.

As for the case of the CZ-ϕ\phi gate, the sequence consists of a Ramsey-type experiment used to determine and calibrate away the total dynamic phase acquired by Q1 during the XOR gate. Hence, the first step of the sequence is an R^yπ/2\hat{R}^{\pi/2}_{y} unitary rotation on Q1, which brings the qubit to the equator of the Bloch sphere.

Then, a z-pulse with amplitude zCZ-πz_{\textrm{CZ-}\pi} and time τCZ-π≃39.08\tau_{\textrm{CZ-}\pi}{}\simeq{}39.08 ns, brings the ∣e⟩↔∣f⟩|\textrm{e}\rangle{}\leftrightarrow{}|\textrm{f}\rangle transition of Q1 into resonance with B. The time τCZ-π\tau_{\textrm{CZ-}\pi} is inversely proportional to the coupling strength between states ∣Q1B⟩=∣e1⟩|\textrm{Q}_{1}\textrm{B}\rangle{}={}|\textrm{e}1\rangle and ∣f0⟩|\textrm{f}0\rangle. However, we note that in the sequence (11-XOR), B is always in the vacuum state ∣0⟩|0\rangle and, thus, no dynamics takes place between Q1 and B during the z-pulse. The only effect of the z-pulse is to detune Q1 outside its reference frame, which causes the qubit to acquire an unwanted dynamic phase ϕdyn\phi_{\textrm{dyn}}.

In order to compensate ϕdyn\phi_{\textrm{dyn}}, a second z-pulse must be applied to Q1. Such a pulse is characterized by a fixed time-length τcmp=5\tau_{\textrm{cmp}}{}={}5 ns and a variable amplitude zcmpz_{\textrm{cmp}}. We note that all compensation pulses in the XOR- and M-gate tuneup sequences have the same time length of 55 ns. By continuously varying the amplitude zcmpz_{\textrm{cmp}}, the Ramsey fringe shown in Fig. S8A (Right) is obtained. The dynamic phase ϕdyn\phi_{\textrm{dyn}} is totally compensated when the probability PeP_{\textrm{e}} reaches a maximum. In the figure, the vertical dotted black line indicates the compensation pulse amplitude chosen for this purpose, zcmp≃−0.106z_{\textrm{cmp}}{}\simeq{}-0.106;

The second tuneup sequence is displayed in Fig. S8B (Left). The sequence is analogous to sequence (11-XOR), but acting on control qubit Q2 instead of Q1. In this case, zcmp≃−0.127z_{\textrm{cmp}}{}\simeq{}-0.127 [cf. Fig. S8B (Right)];

The third and last tuneup sequence of the XOR gate, which is shown in Fig. S8C (Left), acts on target resonator B. Sequence (33-XOR) represents a departure from the analogy between the tuneup of the XOR gate and the CZ-ϕ\phi gate, where only two compensation pulses were needed for the gate operation.

As already explained in the main text, resonator B plays the role of the third qubit in our implementation of three-qubit phase gates. In order to use resonator B as an effective qubit, its state must be prepared and measured using either qubit Q1 or Q2 as an ancilla qubit. In our experiments, we have chosen Q2 to perform this function because of slightly better coherence times and measurement fidelities compared to Q1. It is important to note that Q2 is actively used during the XOR gate. Consequently, the state of B can only be controlled before and/or after the gate operation. This issue does not constitute an experimental limitation since B represents the target of the gate and, thus, its state will not be controlled during the gate. However, once a state has been loaded in target B, it has to remain stored for a significantly longer time than any state stored in the control qubits Q1 and Q2. This is not an experimental limitation either, as the much longer coherence times of B compared to Q1 and Q2 (cf. caption of Fig. 1B in the main text for numerical values) largely reduce the effect of a longer storing time. This experiment further proves the importance of the quantum von Neumann architecture, where the ability to store states in a memory makes possible to realize longer quantum computations.

As for the control qubits Q1 and Q2, also the state loaded in the target resonator B acquires a dynamic phase due to the detuning between the transition frequency of B and the reference clock rate of Q2. Note that only the frequency detuning with respect to Q2 contributes to the dynamic phase of the state in B because Q2 is the ancilla qubit chosen to manipulate and measure B.

Following the pulses in Fig. S8C (Left), the Ramsey experiment necessary to compensate the dynamic phase acquired by B is indirectly preformed through Q2 15, 16. Resonator B is initialized in the vacuum state ∣B⟩=∣0⟩|\textrm{B}\rangle{}={}|0\rangle, and qubit Q1 and Q2 in the state ∣Q1Q2⟩=∣gg⟩|\textrm{Q}_{1}\textrm{Q}_{2}\rangle{}={}|\textrm{g}\textrm{g}\rangle, with both qubits at the idle point. While Q1 remains in ∣g⟩|\textrm{g}\rangle during the whole sequence, Q2 is rotated into a linear superposition ∣g⟩+∣e⟩|\textrm{g}\rangle+|\textrm{e}\rangle by means of an R^yπ/2\hat{R}^{\pi/2}_{y} rotation. Afterwards, an iSWAP with amplitude ziSz_{\textrm{iS}} and time τiS≃25.72\tau_{\textrm{iS}}{}\simeq{}25.72 ns is used to write the state from Q2 into B, which is thus prepared in the state ∣0⟩+∣1⟩|0\rangle+|1\rangle. This state remains loaded in B until it is read out by Q2 via a second iSWAP before the end of the sequence. Between the two iSWAPs, the control qubits Q1 and Q2 remain in the state ∣Q1Q2⟩=∣gg⟩|\textrm{Q}_{1}\textrm{Q}_{2}\rangle{}={}|\textrm{g}\textrm{g}\rangle, and all pulses acting on both Q1 and Q2 are turned off. Due to the excursion outside Q2’s reference frame, the state ∣0⟩+∣1⟩|0\rangle+|1\rangle in B acquires a dynamic phase, which grows until the end of the readout iSWAP. Since the resonance frequency of B cannot be tuned, in order to calibrate away the effect of such a dynamic phase we delay the starting time of the readout iSWAP by a variable time τdel\tau_{\textrm{del}}.

Finally, after the readout iSWAP, a second R^yπ/2\hat{R}^{\pi/2}_{y} rotation followed by a measurement pulse on Q2 completes the Ramsey experiment on B. The corresponding Ramsey fringe measured as a function of τdel\tau_{\textrm{del}} is plotted in Fig. S8C (Right). Similar to sequence (11-XOR) and (22-XOR), choosing τdel\tau_{\textrm{del}} such that the Ramsey fringe reaches one maximum allows us to fully compensate the dynamic phase acquired by the state in B. The vertical dashed black line in the figure indicates the delay time chosen in the experiment, τdel≃3.46\tau_{\textrm{del}}{}\simeq{}3.46 ns. As a check, from the fit we also obtained a Ramsey fringe frequency of ≃385.0\simeq{}385.0 MHz, which agrees well with the Q2-B detuning ≃369.8\simeq{}369.8 MHz.

M gate tuneup

The quantum logic circuit of the M gate considered here is sketched in Fig. 4D of the main text. Figure S9, A to E, shows the five sequences and the corresponding Ramsey fringes required to tune up the M gate. The tuneup concept is similar to that used for the XOR gate, but with a few important differences due to the \nicefrac12\nicefrac{{1}}{{2}} CZ-π\pi gates.

The first tuneup sequence for the M gate, which is displayed in Fig. S9A (Left), acts on control qubit Q1. The only difference between this sequence and sequence (11-XOR) is that the single z-pulse with amplitude zCZ-πz_{\textrm{CZ-}\pi} and length τCZ-π\tau_{\textrm{CZ-}\pi} is now split into two z-pulses, z-pulse α\alpha and z-pulse β\beta, with amplitude z\nicefrac12 CZ-π=zCZ-πz_{\nicefrac{{1}}{{2}}\,\textrm{CZ-}\pi}{}={}z_{\textrm{CZ-}\pi} and time τ\nicefrac12 CZ-π=τCZ-π/2\tau_{\nicefrac{{1}}{{2}}\,\textrm{CZ-}\pi}{}={}\tau_{\textrm{CZ-}\pi}/2. This fact, however, does not affect the compensation of the dynamic phase acquired by Q1, as the total excursion of Q1 outside its reference frame remains unchanged. It is worth reminding that the z-pulse α\alpha and z-pulse β\beta bring the qubit ∣e⟩↔∣f⟩|\textrm{e}\rangle{}\leftrightarrow{}|\textrm{f}\rangle transition on resonance with bus resonator B. As a consequence, in sequence (11-M) the resonator remains in the vacuum state ∣0⟩|0\rangle.

From the Ramsey fringe in Fig. S9A (Right) we obtain one possible value of the compensation pulse amplitude that maximizes the probability PeP_{\textrm{e}} of Q1, zcmp≃−0.119z_{\textrm{cmp}}{}\simeq{}-0.119;

The second tuneup sequence, which is displayed in Fig. S9B (Left), acts on control qubit Q2. The sequence is the same as sequence (22-XOR) for the XOR gate. As in sequence (11-M), the z-pulse brings the qubit ∣e⟩↔∣f⟩|\textrm{e}\rangle{}\leftrightarrow{}|\textrm{f}\rangle transition on resonance with bus resonator B.

From the Ramsey fringe in Fig. S9B (Right) we obtain one possible value of the compensation pulse amplitude that maximizes the probability PeP_{\textrm{e}} of Q2, zcmp≃−0.077z_{\textrm{cmp}}{}\simeq{}-0.077;

The third tuneup sequence, which is displayed in Fig. S9C (Left), acts again on control qubit Q1, with control qubit Q2 and target resonator B either in state ∣Q2B⟩=∣g0⟩|\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}0\rangle or ∣Q2B⟩=∣g1⟩|\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}1\rangle. In addition, all pulses acting on Q2 are turned off. Qubit Q1 is initialized in the ground state ∣Q1⟩=∣g⟩|\textrm{Q}_{1}\rangle{}={}|\textrm{g}\rangle at the idle point.

In order to understand the dynamics of the interaction between Q1 and B, we refer to the energy diagram of Fig. S3A. If ∣B⟩=∣0⟩|\textrm{B}\rangle{}={}|0\rangle, after the first R^yπ/2\hat{R}^{\pi/2}_{y} rotation on Q1, the Q1-B coupled system is in state ∣Q1⟩⊗∣B⟩=(∣g⟩+∣e⟩)⊗∣0⟩|\textrm{Q}_{1}\rangle\otimes|\textrm{B}\rangle{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)\otimes|0\rangle. In this case, during the z-pulse α\alpha and z-pulse β\beta no dynamics takes place. As a consequence, in the time interval τsh\tau_{\textrm{sh}} between the two z-pulses, Q1 remains biased at the idle point in state ∣Q1⟩=∣g⟩+∣e⟩|\textrm{Q}_{1}\rangle{}={}|\textrm{g}\rangle+|\textrm{e}\rangle, without acquiring any dynamic phase. The only dynamic phase acquired by Q1 is that developed during the z-pulse α\alpha and z-pulse β\beta, which has already been compensated in sequence (11-M) (cf. Fig. S9A). The compensation pulse for such a dynamic phase remains turned on during sequence (33-M).

If instead ∣B⟩=∣1⟩|\textrm{B}\rangle{}={}|1\rangle, after the first R^yπ/2\hat{R}^{\pi/2}_{y} rotation on Q1, the Q1-B coupled system is in state ∣Q1⟩⊗∣B⟩=(∣g⟩+∣e⟩)⊗∣1⟩|\textrm{Q}_{1}\rangle\otimes|\textrm{B}\rangle{}={}(|\textrm{g}\rangle+|\textrm{e}\rangle)\otimes|1\rangle. In this case, the reference clock rate is given by fQ1+fBf_{\textrm{Q}_{1}}+f_{\textrm{B}}. After the z-pulse α\alpha, the state ∣Q1B⟩=∣e1⟩|\textrm{Q}_{1}\textrm{B}\rangle{}={}|\textrm{e}1\rangle gets shelved into the state ∣Q1B⟩=∣f0⟩|\textrm{Q}_{1}\textrm{B}\rangle{}={}|\textrm{f}0\rangle for a time τsh\tau_{\textrm{sh}}, at the end of which the z-pulse β\beta is applied. We remind that the ∣g⟩↔∣f⟩|\textrm{g}\rangle{}\leftrightarrow{}|\textrm{f}\rangle frequency is (2fQ1−δnl)(2f_{\textrm{Q}_{1}}-\delta_{\textrm{nl}}), where δnl\delta_{\textrm{nl}} is the qubit nonlinearity defined as the frequency difference between the ∣e⟩↔∣f⟩|\textrm{e}\rangle{}\leftrightarrow{}|\textrm{f}\rangle and the ∣g⟩↔∣e⟩|\textrm{g}\rangle{}\leftrightarrow{}|\textrm{e}\rangle qubit transitions. In this experiment, fQ1≃7.2161f_{\textrm{Q}_{1}}{}\simeq{}7.2161 GHz, δnl≃140.6\delta_{\textrm{nl}}{}\simeq{}140.6 MHz, and fB≃6.8150f_{\textrm{B}}{}\simeq{}6.8150 GHz. During the time τsh\tau_{\textrm{sh}}, the coupled system is in state ∣Q1B⟩=(∣g1⟩+∣f0⟩)|\textrm{Q}_{1}\textrm{B}\rangle{}={}(|\textrm{g}1\rangle+|\textrm{f}0\rangle) and Q1 acquires a dynamic phase ϕsh=(fQ1−δnl−fB) τsh\phi_{\textrm{sh}}{}={}(f_{\textrm{Q}_{1}}-\delta_{\textrm{nl}}-f_{\textrm{B}})\,\tau_{\textrm{sh}}. This dynamic phase is independent from the dynamic phase acquired during the z-pulse α\alpha and z-pulse β\beta.

In order to compensate the phase ϕsh\phi_{\textrm{sh}}, we delay the starting point of the z-pulse β\beta by a time τdel1\tau_{\textrm{del}1}. By continuously varying τdel1\tau_{\textrm{del}1}, the two Ramsey fringes plotted in Fig. S9C (Right) are obtained. The magenta squares correspond to the case ∣Q2B⟩=∣g0⟩|\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}0\rangle. As expected, in this case nothing happens as the dynamic phases acquired during the z-pulse α\alpha and z-pulse β\beta were already corrected by the compensation pulse tuned up in sequence (11-M). The Ramsey fringe thus remains at the maximum probability chosen in that sequence. This fringe indicates that no resonator state has been shelved to the qutrit state ∣Q1⟩=∣f⟩|\textrm{Q}_{1}\rangle{}={}|\textrm{f}\rangle. The blue dots, instead, correspond to the case ∣Q2B⟩=∣g1⟩|\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}1\rangle. In this case, the sinusoidal dependence of the fringe clearly shows an excursion outside the Q1-B reference frame, which causes the dynamic phase ϕsh\phi_{\textrm{sh}} to be acquired by the state in Q1. This phase is totally compensated when the probability PeP_{\textrm{e}} of Q1 reaches a minimum. The reason why a minimum has to be chosen is because the Ramsey fringe is obtained with one excitation in the system, instead of no excitation as in sequences (11-M) and (22-M). This is analogous to the CZ-ϕ\phi gate tuneup sequence displayed in Fig. S4B. This can also be understood from the phase-gate cube of Fig. S11E (or the second row in Table S3), as the Ramsey fringe in sequence (33-M) measures the phase difference between vertex (55) and vertex (11) of the cube, which is π\pi rad instead of rad. The vertical dotted black line in Fig. S9C (Right) indicates the delay time chosen in the experiment, τdel1≃4.2\tau_{\textrm{del}1}{}\simeq{}4.2 ns. As a check, a least-squares fit to the data (solid green line) allows us to extract the frequency of the Ramsey fringe, which is ≃248.2\simeq{}248.2 MHz. This number is close to the expected value (fQ1−δnl−fB)≃260.5(f_{\textrm{Q}_{1}}-\delta_{\textrm{nl}}-f_{\textrm{B}}){}\simeq{}260.5 MHz (note that the data consists of one Ramsey oscillation period only. Hence, the ≃10\simeq{}10 MHz difference between the theoretically expected value and that obtained from the fit is within the fit confidence interval);

The fourth tuneup sequence, which is displayed in Fig. S9D (Left), acts on target resonator B. The sequence is the same as sequence (33-XOR) for the XOR gate. In this sequence, the two iSWAPs bring the qubit ∣g⟩↔∣e⟩|\textrm{g}\rangle{}\leftrightarrow{}|\textrm{e}\rangle transition on resonance with bus resonator B.

From the Ramsey fringe in Fig. S9D (Right) we obtain one possible value of the delay time that maximizes the probability PeP_{\textrm{e}} of Q2, τdel2≃2.77\tau_{\textrm{del}2}{}\simeq{}2.77 ns (vertical dotted black line). Since the XOR gate and M gate experiments were performed several hours apart, the delay time for the M gate differs slightly from that for the XOR gate because of drifts in the qubit transition frequency (cf. section on “Systematic errors” in these Supporting Online Material). In addition, from a least-squares fit to the data (solid green line) we extracted a Ramsey fringe frequency ≃365.8\simeq{}365.8 MHz, which agrees well with the detuning between the reference clock rate of Q2 and the transition frequency of B, ≃369.8\simeq{}369.8 MHz;

The fifth tuneup sequence, which is displayed in Fig. S9E (Left), acts again on target resonator B.

Sequence (33-M) served to compensate the dynamic phase acquired by Q1 during the shelving dynamics. Because B takes also part in the shelving, its state acquires a similar dynamic phase that must be compensated. Sequence (55-M) is analogous to sequence (33-M), with two differences. First, the Ramsey experiment is now performed on B via Q2 [as for sequence (44-M)]. Second, instead of adding a time delay, qubit Q1 is detuned in the z direction by a quantity zdetz_{\textrm{det}} for the entire interval between the z-pulse α\alpha and z-pulse β\beta. In fact, we are not allowed to use two times the same degree of freedom, i.e., the delay time τdel1\tau_{\textrm{del}1} of sequence (33-M), for the compensation of two independent dynamic phases. By continuously varying zdetz_{\textrm{det}}, the two Ramsey fringes plotted in Fig. S9E (Right) are obtained. The interpretation of the fringes is the same as for sequence (33-M). The detuning value chosen in the experiment to compensate the dynamic phase acquired by the state in B during the shelving is zdet≃−0.012z_{\textrm{det}}{}\simeq{}-0.012 (vertical dotted black line);

The sixth and last tuneup sequence for the M gate, which is not shown in Fig. S9, consists in repeating sequence (11-M). The compensation pulse for Q1 needs to be recalibrated due to the detuning zdetz_{\textrm{det}} set in sequence (55-M). The final value of the compensation pulse amplitude for Q1 chosen in the experiment is zcmp≃−0.125z_{\textrm{cmp}}{}\simeq{}-0.125.

M gate pulse sequence

Figure S10 shows the complete pulse sequence utilized to measure the entry of the M gate truth table associated with state ∣Q1Q2⟩⊗∣B⟩=∣ee⟩⊗(∣0⟩+∣1⟩)|\textrm{Q}_{1}\textrm{Q}_{2}\rangle\otimes|\textrm{B}\rangle{}={}|\textrm{e}\textrm{e}\rangle\otimes(|0\rangle+|1\rangle). Step (11): Both control qubits Q1 and Q2 and target resonator B are initialized in the ground state, ∣Q1Q2B⟩=∣gg0⟩|\textrm{Q}_{1}\textrm{Q}_{2}\textrm{B}\rangle{}={}|\textrm{g}\textrm{g}0\rangle. The qubits are biased at the idle point. Step (22): Q2 is prepared in state ∣g⟩+∣e⟩|\textrm{g}\rangle+|\textrm{e}\rangle by means of an R^yπ/2\hat{R}^{\pi/2}_{y} rotation. Step (33): The state in qubit Q2 is written into B via an iSWAP. Until this step, qubit Q2 serves as ancilla qubit to load resonator B. The iSWAP effectively zeros Q2, which can be now used as a control qubit in the M gate. Step (44): Both control qubits Q1 and Q2 are loaded in state ∣e⟩|\textrm{e}\rangle by means of an R^yπ\hat{R}^{\pi}_{y} rotation. Step (55): First \nicefrac12\nicefrac{{1}}{{2}} CZ-π\pi gate between Q1 and B. Step (66): CZ-π\pi gate between Q2 and B. In the same time frame, the delay and detune necessary to compensate the dynamic phase on Q1 and B due to the shelving are applied. Step (77): Second \nicefrac12\nicefrac{{1}}{{2}} CZ-π\pi gate between Q1 and B. Step (88): Compensation pulse on Q2. Step (99): Compensation pulse on Q1. Step (1010): Compensation delay for the dynamic phase on B. Step (1111): Zeroing gate applied to Q2. This step is necessary to re-use Q2 as ancilla qubit for controlling B. The zeroing is performed through an iSWAP between Q2 and Z2. Step (1212): The state of B is read out by the zeroed Q2 via an iSWAP. Steps (1313) and (1414): A second R^yπ/2\hat{R}^{\pi/2}_{y} rotation on Q2 followed by a measurement pulse completes the Ramsey experiment on B. The Ramsey fringe obtained from this sequence is plotted in Fig. 4E of the main text (magenta dots).

Quantum phase tomography

The most general unitary operation describing a three-qubit controlled-phase quantum gate can be written as

In the ideal case, the amplitude of each diagonal element of Eq. S26 is unity, while the phase ϕ∣lmn⟩\phi_{|lmn\rangle} depends on which state ∣lmn⟩∈M3|lmn\rangle{}\in{}\mathcal{M}_{3} is considered (cf. main text). All off-diagonal elements are zero.

It is straightforward to show that only seven of the eight phases of Eq. S26 are physically independent. In fact, the first complex exponential ei ϕ∣gg0⟩e^{i\,\phi_{|\textrm{g}\textrm{g}0\rangle}} can be factored out from the equation, allowing us to write the matrix

which is equivalent to U~ϕ\widetilde{U}^{\phi} up to a global phase ϕ∣gg0⟩\phi_{|\textrm{g}\textrm{g}0\rangle}.

The phases associated with each diagonal element in Eq. S27 can be grouped in a column vector τ{\bm{\tau}} defined as

In the main text we have shown that by performing Ramsey experiments on the control qubits Q1 and Q2 and on the target resonator B, it is possible to obtain the quantum phase tomography of the three-qubit XOR phase gate and of the Toffoli-class OR phase gate (M gate). In each Ramsey experiment one of the control qubits (or the target resonator) has to be prepared in a ∣g⟩+∣e⟩|\textrm{g}\rangle+|\textrm{e}\rangle (or ∣0⟩+∣1⟩|0\rangle+|1\rangle) state, while the other control qubit and the target resonator (or the two control qubits) are prepared in all four possible combinations of ground and excited state. In the case of an M gate, for example, the twelve states for each Ramsey experiment are reported in the first three columns of Table S3. The fourth column shows the ideal value of the phase difference associated with each Ramsey experiment 17. A similar Table can easily be obtained for the XOR gate (not shown).

We note that the states of the control qubits Q1 and Q2 and of the target resonator B displayed in the first three columns of Table S3 constitute a general set of states for quantum phase tomography and, thus, can be used to characterize any type of three-qubit controlled-phase quantum gate. The phase differences associated with these states can be grouped in a column vector φ{\bm{\varphi}} defined as

The aim of quantum phase tomography is to obtain the seven phase differences in vector τ{\bm{\tau}} from the twelve phase differences in vector φ{\bm{\varphi}}, which are measured by means of Ramsey experiments. In order to facilitate the explanation of quantum phase tomography, we now introduce a geometric representation of the phases associated with any three-qubit controlled-phase quantum gate. Figure S11A shows a cube, hereafter termed the phase-gate cube, the vertices of which contain information on the diagonal elements of a three-qubit controlled-phase quantum gate. The vertices of the phase-gate cube are enumerated according to the notation given in the space between Fig. 4C and Fig. 4F of the main text. Note that the phase-gate cube can directly be generalized to NN-qubit gates, in which case it has to be promoted to an NN-dimensional hypercube.

Here, we will only consider the case of three-qubit gates, namely the XOR gate and M gate. The quantum logic circuits of these gates are shown in Fig. 4A and Fig. 4D of the main text, respectively. For convenience, these circuits are also displayed in Fig. S11, B and D. The sign of each element τkXOR\tau^{\textrm{XOR}}_{k}, with k∈{0,1,…,7}k{}\in{}\{0,1,\ldots,7\}, of vector τXOR{\bm{\tau}}^{\textrm{XOR}} and of each element τkM\tau^{\textrm{M}}_{k} of vector τM{\bm{\tau}}^{\textrm{M}} (cf. main text) is given on the vertices of the phase-gate cube (cf. Fig. S11, C and E, respectively). As explained in the main text, a positive sign corresponds to a phase and a negative sign to a π\pi phase. As shown in Fig. S11, C and E, the difference between the phases associated with each pair of vertices connected by a segment of the cube is indicated on the segment connecting that pair of vertices. For each gate, this gives a total of twelve phase differences corresponding to the elements in vector φ{\bm{\varphi}} of Eq. S29.

We now use the phase-gate cube to determine the transformation matrix Tφ τT_{\varphi\,\tau} between vector φ{\bm{\varphi}} and vector τ{\bm{\tau}}. Each row of Tφ τT_{\varphi\,\tau} must correspond to a segment of the phase-gate cube, and each column to a vertex, giving a matrix with dimensions (12,8)(12,8). The first row of Tφ τT_{\varphi\,\tau} is associated with the phase difference between states ∣eg0⟩|\textrm{e}\textrm{g}0\rangle and ∣gg0⟩|\textrm{g}\textrm{g}0\rangle, ϕ∣eg0⟩−ϕ∣gg0⟩\phi_{|\textrm{e}\textrm{g}0\rangle}-\phi_{|\textrm{g}\textrm{g}0\rangle} (cf. Eq. S29 and, for the case of the M gate, Table S3). Adopting the enumeration in Fig. S11A, state ∣eg0⟩|\textrm{e}\textrm{g}0\rangle corresponds to the vertex (44) of the phase-gate cube, and state ∣gg0⟩|\textrm{g}\textrm{g}0\rangle to the vertex (). In the case of the M gate, for example, the first raw of Tφ τT_{\varphi\,\tau} must then be −1, 0, 0, 0, 1, 0, 0, 0-1,\,0,\,0,\,0,\,1,\,0,\,0,\,0. Following a similar procedure for all twelve segments of the phase-gate cube for the M gate, we readily find the entire M gate transformation matrix Tφ τT_{\varphi\,\tau},

Notably, the rank of the matrix Tφ τT_{\varphi\,\tau} of Eq. S30 is 77, as expected from the number of physically independent phases of the unitary matrix of a general three-qubit controlled-phase quantum gate, UϕU^{\phi}. A similar procedure can be used to obtain the transformation matrix associated with the XOR gate (not shown) or any other three-qubit controlled-phase quantum gate.

Given the shape of vectors τ{\bm{\tau}} and φ{\bm{\varphi}}, and of the matrix Tφ τT_{\varphi\,\tau}, vectors τ{\bm{\tau}} and φ{\bm{\varphi}} are related by the simple linear system

Since the phase differences in φ{\bm{\varphi}} are the only phases measured in the experiments, the system of Eq. S31 has to be solved in order to find τ{\bm{\tau}}. The matrix Tφ τT_{\varphi\,\tau} is actually not invertible. However, the system of Eq. S31 is overconstrained by the experimental data and so it can be solved in a least-squares best fit sense, allowing us to obtain τ{\bm{\tau}}.

Figure S12A shows the twelve Ramsey fringes used to measure the phase differences plotted in Fig. S12C in the case of the XOR gate. Figure S12, B and D, shows similar results for the M gate. The phase differences associated with each Ramsey fringe are indicated in the space between panels A and B and, together with the corresponding pair of vertices of the phase-gate cube, in the space between panels C and D. Solving the system of Eq. S31 for the phase differences shown in Fig. S12, C and D, finally allows us to obtain the phases shown in Fig. 4, C and F, of the main text, thus realizing a full quantum phase tomography of the XOR and M gate.

We note that the quantum phase tomography used here is inherently different from that developed in Ref. 18, where the time evolution of the quantum phase of the qubit state was used to infer information on the qubit dephasing mechanisms.

Supporting References