Main

In this experiment, we scaled up from an architecture initially implemented with two qubits and three resonators16 to a nine-element quantum processor capable of realizing rapid entanglement and a compiled version of Shor’s algorithm. The device is composed of four phase qubits and five superconducting co-planar waveguide (CPW) resonators, where the resonators are used as qubits by accessing only the two lowest levels. Four of the five CPWs can be used as quantum memory elements as in ref. 16 and the fifth can be used to mediate entangling operations.

The quantum processor can create entanglement and execute quantum algorithms19,20 with high-fidelity single-qubit gates21,22 (X, Y, Z and H) combined with swap and controlled-phase (Cϕ) gates15,16,23, where one qubit interacts with a resonator at a time. The quantum processor can also use fast-entangling logic by bringing all participating qubits on resonance with the resonator at the same time to generate simultaneous entanglement24. At present, this combination of entangling capabilities has not been demonstrated on a single device. Previous examples have shown spectroscopic evidence of the increased coupling for up to three qubits coupled to a resonator17, as well as coherent interactions between two and three qubits with a resonator14, although these lacked tomographic evidence of entanglement.

Here we show coherent interactions for up to four qubits with a resonator and verify genuine bi- and tripartite entanglement including Bell11 and |W〉 states12 with quantum state tomography (QST). This quantum processor has the further advantage of creating entanglement at a rate more than twice that of previous demonstrations12,14.

In addition to these characterizations, we chose to implement a compiled version of Shor’s algorithm25,26, in part for its historical relevance19 and in part because this algorithm involves the challenge of combining both single- and coupled-qubit gates in a meaningful sequence. We constructed the full factoring sequence by first performing automatic calibration of the individual gates and then combined them, without additional tuning, so as to factor the composite number with co-prime a = 4, (where and the greatest common divisor between a and is 1). We also checked for entanglement at three points in the algorithm using QST.

Figure 1a shows a micrograph of the quantum processor, made on a sapphire substrate using Al/AlOx/Al Josephson junctions. Figure 1b shows a complete schematic of the device. Each qubit Qi is individually controlled using a bias coil that carries d.c., radiofrequency and gigahertz pulses to adjust the qubit frequency and to pulse microwaves for manipulating and measuring the qubit state. Each qubit’s frequency can be adjusted over an operating range of 2 GHz, allowing us to couple each qubit to the other quantum elements on the chip. Each Qi is connected to a memory resonator Mi, as well as the bus B, through interdigitated capacitors. Although the coupling capacitors are fixed, Fig. 1c illustrates how the effective interaction can be controlled by tuning the qubits into or near resonance with the coupling bus (coupling on) or detuning Qi to fB±500 MHz (coupling off)27.

Figure 1: Architecture and operation of the quantum processor.
figure 1

a, Photomicrograph of the sample, fabricated with aluminium (coloured) on sapphire substrate (dark). b, Schematic of the quantum processor. Each phase qubit Qi is capacitively coupled to the central half-wavelength bus resonator B and a quarter-wavelength memory resonator Mi. The control lines carry gigahertz microwave pulses to produce single-qubit operations. Each Qi is coupled to a superconducting quantum interference device (SQUID) for single-shot readout. c, Illustration of quantum processor operation. By applying pulses on each control line, each qubit frequency is tuned in and out of resonance with B (M) to perform entangling (memory) operations. d, Swap spectroscopy16 for all four qubits. Qubit excited state |e〉 probability Pe (colour scale) versus frequency (vertical axis) and interaction time Δτ. The centres of the chevron patterns gives the frequencies of the resonators B, M1–M4, f = 6.1,6.8,7.2,7.1,6.9 GHz, respectively. The oscillation periods give the coupling strengths between Qi and B (Mi), which are all ().

The quantum processor is mounted in a superconducting aluminium sample holder and cooled in a dilution refrigerator to 25 mK. Qubit operation and calibration are similar to previous works10,11,12,15,16, with the addition of an automated calibration process28. As shown in Fig. 1d, we used swap spectroscopy16 to calibrate all nine of the engineered quantum elements on the quantum processor, the four phase qubits (Q1–Q4), the four quarter-wave CPW quantum-memory resonators (M1–M4) and one half-wave CPW bus resonator (B). The coupling strengths between Qi and B (Mi) were measured to be within 5% (10%) of the design values.

The qubit–resonator interaction can be described by the Jaynes–Cummings model Hamiltonian29 , where gi is the coupling strength between the bus resonator B and the qubit Qi, a and a are, respectively, the photon creation and annihilation operators for the resonator, σi+ and σi are, respectively, the qubit Qi raising and lowering operators and  = h/2π. The dynamics during the interaction between the i = {1,2,3,4} qubits and the bus resonator are shown in Fig. 1c and Fig. 2a,b,c respectively.

Figure 2: Rapid entanglement for two to four qubits.
figure 2

ac, The measured state occupation probabilities P Q 1 4 (colour) and Pb (black) for increasing number of participating qubits N = {2,3,4} versus interaction time Δτ. In all cases, B is first prepared in the n = 1 Fock state10 and the participating qubits are then tuned on resonance with B for the interaction time Δτ. The single excitation begins in B, spreads to the participating qubits and then returns to B. These coherent oscillations continue for a time Δτ and increase in frequency with each additional qubit. d, Oscillation frequency of Pb for increasing numbers of participating qubits. The error bars indicate the −3 dB point of the Fourier transformed Pb data. The inset schematics illustrate which qubits participate. The coupling strength increases as , plotted as a black line fit to the data, with . e,f, The real part of the reconstructed density matrices from QST. e, Bell singlet with fidelity FBell = 〈ψs|ρBell|ψs〉 = 0.89±0.01 and EOF = 0.70. f, Three-qubit with fidelity FW = 〈W|ρW|W〉 = 0.69±0.01. The measured imaginary parts (not shown) are found to be small, with (e) and (f), as expected theoretically.

For these interactions the qubits Q1–Q4 are initialized in the ground state |g g g g〉 and tuned off-resonance from B at an idle frequency f6.6 GHz. Q1 is prepared in the excited state |e〉 by a π-pulse. B is then pumped into the first Fock state n = 1 by tuning Q1 on resonance (f6.1 GHz) for a duration 1/2g1 = τ9 ns, long enough to complete an iSWAP operation between Q1 and B, (ref. 10).

The participating qubits are then tuned on resonance (f6.1 GHz) and left to interact with B for an interaction time Δτ. Figure 2ac shows the probability P Q i of measuring the participating qubits in the excited state, and the probability Pb of B being in the n = 1 Fock state, versus Δτ. At the beginning of the interaction the excitation is initially concentrated in B (Pb maximum) then spreads evenly between the participating qubits (Pb minimum) and finally returns back to B, continuing as a coherent oscillation during this interaction time.

When the qubits are simultaneously tuned on resonance with B they interact with an effective coupling strength that scales with the number N of qubits as (ref. 17), analogous to a single qubit coupled to a resonator in an n-photon Fock state10. For N qubits, , where . The oscillation frequency of Pb for each of the four cases i = {1,2,3,4} is shown in Fig. 2d. These results are similar to those of refs 17, 30, but with a larger number N of qubits interacting with the resonator, we can confirm the scaling of the coupling strength with N. From these data we find a mean value of .

By tuning the qubits on resonance for a specific interaction time τ, corresponding to the first minimum of Pb in Fig. 2a,b we can generate Bell singlets and |W〉 states . Stopping the interaction at this time (τBell = 6.5 ns and τW = 5.1 ns) leaves the single excitation evenly distributed among the participating qubits and places the qubits in the desired equal superposition state similar to the protocol in ref. 14. We are able to further analyse these states using full QST. Figure 2e,f shows the reconstructed density matrices from this analysis18. The Bell singlet is formed with fidelity FBell = 〈ψs|ρBell|ψs〉 = 0.89±0.01 and entanglement of formation31 EOF = 0.70. The three-qubit |W〉state is formed with fidelity FW = 〈W|ρW|W〉 = 0.69±0.01, which satisfies the entanglement witness inequality FW>2/3 for three-qubit entanglement32. Generating either of these classes of entangled states (bi- and tripartite) requires only a single entangling operation that is short relative to the characteristic time for two-qubit gates (tg50 ns). This entanglement protocol has the further advantage that it can be scaled to an arbitrary number of qubits.

The quantum circuit for the compiled version of Shor’s algorithm is shown in Fig. 3a for factoring the number with a = 4 co-prime25,26, which returns the period r = 2 (10 in binary) with a theoretical success rate of 50%. Although the success of the algorithm hinges on quantum entanglement, the final output is ideally a completely mixed state, σm = (1/2)(|0〉〈0|+|1〉〈1|). Therefore, measuring only the raw probabilities of the output register does not reveal the underlying quantum entanglement necessary for the success of the computation. Thus, we perform a runtime analysis with QST at the three points identified in Fig. 3b, in addition to recording the raw probabilities of the output register.

Figure 3: Compiled version of Shor’s algorithm.
figure 3

a, Four-qubit circuit to factor , with co-prime a = 4. The three steps in the algorithm are initialization (Init), modular exponentiation and the quantum Fourier transform, which computes and returns the period r = 2. b, Recompiled three-qubit version of Shor’s algorithm. The redundant qubit Q1 is removed by noting that H H = I. Circuits a and b are equivalent for this specific case. The three steps of the runtime analysis are labelled 1,2 and 3. c, CNOT gates are realized using an equivalent CZ circuit. d, Step 1: Bell singlet between Q2 and Q3 with fidelity FBell = 〈ψs|ρBell|ψs〉 = 0.75±0.01 and EOF = 0.43. e, Step 2: Three-qubit between Q2, Q3 and Q4 with fidelity FGHZ = 〈GHZ|ρGHZ|GHZ〉 = 0.59±0.01. f, Step 3: QST after running the complete algorithm. The three-qubit |GHZ〉 is rotated into |ψ3〉 = H2|GHZ〉 = (|g g g〉+|e g g〉+|g e e〉−|e e e〉)/2 with fidelity F = 0.55. g,h, The density matrix of the single-qubit output register Q2 formed by: tracing-out Q3 and Q4 from f (g), and directly measuring Q2 with QST (h), both with and Sl = 0.78. From 1.5×105 direct measurements, the output register returns the period r = 2, with probability 0.483±0.003, yielding the prime factors 3 and 5. i, The density matrix of the single-qubit output register without entangling gates, H2H2|g〉 = I|g〉. Ideally this calibration algorithm returns r = 0 100% of the time. Compared with the single quantum state |ψout〉 = |g〉, the fidelity Fcal = 〈ψg|ρcal|ψg〉 = 0.83±0.01, which is less than unity owing to the energy relaxation.

The first breakpoint in the algorithm verifies the existence of bipartite entanglement. A Bell singlet |ψs〉 is formed after a Hadamard gate22 (H) on Q2 and a controlled-NOT (CNOT; refs 15, 16) between Q2 and Q3. As illustrated in Fig. 3c, the CNOT gates are processed by inserting a controlled-Z (CZ) between two H gates on the target qubit. The CZ is realized as in ref. 16 by bringing the target qubit transition on resonance with B to execute an (iSWAP)2. The target qubit acquires a phase shift of π conditioned on the control qubit. Figure 3d is the real part of the density matrix reconstructed from QST on |ψs〉. The singlet is formed with fidelity FBell = 〈ψs|ρBell|ψs〉 = 0.75±0.01 ( not shown) and EOF = 0.43. The primary cause of the reduced fidelites were energy relaxation and dephasing of the qubits, with characteristic times of T1400 ns and T2200 ns, respectively, for all four qubits and T13 μs for the bus resonator. Measurement fidelities for |g〉 and |e〉 for the four qubits are M1,g = 0.9523, M1,e = 0.8902, M2,g = 0.9596, M2,e = 0.9049, M3,g = 0.9490, M3,e = 0.9365, M4,g = 0.9579 and M4,e = 0.8323. For all reported QST fidelities, measurement errors have been subtracted.

The next breakpoint in the algorithm is after the second CNOT gate between Q2 and Q4 to check for tripartite entanglement. At this point a three-qubit , with fidelity FGHZ = 〈GHZ|ρGHZ|GHZ〉 = 0.59±0.01 ( not shown), is formed between Q2, Q3 and Q4, as shown in Fig. 3e. This state is found to satisfy the entanglement witness inequality FGHZ>1/2 (ref. 32), indicating three-qubit entanglement.

The third step in the runtime analysis captures all three qubits at the end of the algorithm, where the final H gate on Q2 rotates the three-qubit |GHZ〉 into |ψ3〉 = H2|GHZ〉 = (|g g g〉+|e g g〉+|g e e〉−|e e e〉)/2. Figure 3f is the real part of the density matrix with fidelity F = 〈ψ3|ρ3|ψ3〉 = 0.54±0.01. From the three-qubit QST we can trace out the register qubit to compare with the experiment where we measure only the single-qubit register and the raw probabilities of the algorithm output. Ideally, the algorithm returns the binary output 00 or 10 (including the redundant qubit) with equal probability, where the former represents a failure and the latter indicates the successful determination of r = 2. We use three methods to analyse the output of the algorithm: three-qubit QST, single-qubit QST and the raw probabilities of the output register state. Figure 3g,h is the real part of the density matrices for the single-qubit output register from three-qubit QST and one-qubit QST with fidelity for both density matrices. From the raw probabilities calculated from 150,000 repetitions of the algorithm, we measure the output 10 with probability 0.483±0.003, yielding r = 2, and after classical processing we compute the prime factors 3 and 5.

The linear entropy Sl = 4[1−Tr(ρ2)]/3 is another metric for comparing the observed output to the ideal mixed state, where Sl = 1 for a completely mixed state33. We find Sl = 0.78 for both the reduced density matrix from the third step of the runtime analysis (three-qubit QST), and from direct single-qubit QST of the register qubit.

As an extra calibration to verify that the system possesses coherence throughout the duration of the algorithm, we remove the entangling operations and use QST to measure the single-qubit output register. The circuit reduces to two H gates separated by the time of the two entangling gates, equivalent to the time of the full algorithm. Ideally Q2 returns to the ground state and the algorithm output is 0 100% of the time. Figure 3i is the real part of the density matrix for the register qubit after running this calibration. The fidelity of measuring the register qubit in |g〉 is Fcal = 〈g|ρcal|g〉 = 0.83±0.01, indicating that the system is coherent over the algorithm time.

We have implemented a compiled version of Shor’s algorithm on a quantum processor that correctly finds the prime factors of 15. We showed that the quantum processor can create Bell states, both classes of three-qubit entanglement and the requisite entanglement for properly executing Shor’s algorithm. In addition, we produce coherent interactions between four qubits and the bus resonator with a protocol that can be scaled to create an N-qubit |W〉 state, by adding more qubits to the bus resonator. During these coherent interactions, we observe the dependence of the effective coupling strength with the number N of participating qubits. These demonstrations represent an important milestone for superconducting qubits, further proving this architecture for quantum computation and quantum simulations.