# Solving Systems of Linear Equations with a Superconducting Quantum Processor

## Abstract

Superconducting quantum circuits are promising candidate for building scalable quantum computers. Here, we use a four-qubit superconducting quantum processor to solve a two-dimensional system of linear equations based on a quantum algorithm proposed by Harrow, Hassidim, and Lloyd [Phys. Rev. Lett. 103, 150502 (2009)], which promises an exponential speedup over classical algorithms under certain circumstances. We benchmark the solver with quantum inputs and outputs, and characterize it by non-trace-preserving quantum process tomography, which yields a process fidelity of . Our results highlight the potential of superconducting quantum circuits for applications in solving large-scale linear systems, a ubiquitous task in science and engineering.

###### pacs:

03.67.AcLinear system lies at the heart of many areas of science and engineering. To solve a system of linear equations with variables, the best known classical algorithm requires a time of . Harrow, Hassidim, and Lloyd (HHL) (1) showed that in principle quantum computers can solve linear systems exponentially faster by calculating the expectation value of an operator associated with the solution, which may lead to many practical applications of quantum computation other than those previously known (2); (3); (4). For an -sparse system matrix of size and condition number , the HHL algorithm can reach a desired computational accuracy within a running time of under certain circumstances (5), comparing to the best known classical algorithm of . Such an exponential speedup promises widespread applications that address large-scale systems. Indeed, several applications based on the HHL algorithm, such as data processing (6), numerical calculation (7) and artificial intelligence (8); (9), have been proposed in recent years.

Compiled version of the HHL algorithm was previously only demonstrated with parametric down-converted single photons (10); (11) and liquid nuclear magnetic resonance (12), both of which are considered not easily scalable to large number of qubits. For example, the optical demonstration was limited by the probabilistic photon generation and two-photon gate operation. For a deterministic, and more scalable implementation, here we turn to a solid-state system, i.e., a superconducting quantum circuit in this experiment, which has attracted significant attentions due to a number of merits, including the much-improved coherence (15); (13); (14), the excellent scalability (17); (18); (16), and the remarkable high-fidelity and fast control (19); (20); (21). In addition, compiled versions of various quantum algorithms such as the Deutsch-Jozsa algorithm (22); (23), the Grover’s algorithm (22), and the Shor’s algorithm (24) have been successfully tested on this solid-state platform on a small scale.

In this Letter, we demonstrate a nontrivial instance of a quantum linear solver, based on the HHL algorithm for a system, with a superconducting circuit consisting of four Xmon qubits which are variant of the transmon qubits (25). We test the solver with 18 distinct quantum-state inputs that uniformly distribute on the Bloch sphere, from which the non-trace-preserving quantum process tomography (QPT) can be reliably determined (26). For various quantum inputs, our quantum solver can return the desired solutions with reasonably high precision, yielding an averaged QPT fidelity of . As such our experiment represents the first demonstration of the quantum algorithm for solving systems of linear equations on a solid-state platform.

The device was fabricated on the sapphire substrate in three steps following the procedure outlined previously (13): (1) deposit the aluminum film on the degassed substrate; (2) define circuit wirings using wet-etch; (3) double-angle evaporate the Al/AlO/Al Josephson junctions. Figure 1 shows the optical micrograph of the device, with the four Xmon qubits labeled from to . Each qubit has its own frequency-control Z line, for rotations of the qubit state around Z axis on the Bloch sphere. and ( and ) share the microwave XY line on the left (right) that is closer to (), for single-qubit rotations around X and Y axes. The microwave pulses transmitted through each XY line have two-frequency components, and the drive strength to () is more than that to () by a factor of 11.7 (6.7) as experimentally calibrated. Each qubit dispersively couples to its own readout resonator, and all readout resonators couple to a common transmission line, enabling simultaneous single-shot quantum nondemolition measurement on multiple qubits using frequency-domain multiplexing. The signal-to-noise ratio is further improved by a quantum limited parametric amplifier, similar to that described previously (27).

The circuit Hamiltonian under the rotating wave approximation is

(1) |

where is the resonant frequency of the -th qubit that can be tuned over time, is the Pauli operator, are the raising and lowering operators, and is the nearest-neighbor coupling strength. The coupling strengths of , for to 3, are measured to be around 13.0, 9.8, and 14.1 MHz, respectively. These Xmon qubits typically have a maximum frequency around 5.1 GHz and an anharmonicity around 250 MHz. In this experiment, qubit idle frequencies , for to 4, are arranged in a zigzag pattern at 5.073, 4.074, 4.948, and 4.547 GHz, respectively, which ensures that the nearest-neighbor and next nearest-neighbor couplings along the qubit chain are effectively turned off when idling. At the above-listed frequencies, the qubit lifetimes s are measured to be around 15.9, 7.4, 7.8, and 14.1 s, and the Gaussian dephasing times (28) s are around 8.7, 2.3, 5.2, and 3.4 s, respectively (see (29) for more information on the device).

The HHL algorithm aims to solve a system of linear equations for , given the Hermitian matrix and the input vector . The process involves three subsets of qubits: a single ancilla qubit, a register of qubits used to store the eigenvalues of to a binary precision of bits, and a memory of qubits used to load and also store the output . For simplicity we assume that is a unit vector, whose entries {} can be encoded in the memory formatted to a quantum state , where denotes the computational basis of the qubits. Next is the core of the HHL algorithm responsible for the exponential speedup: with carefully designed quantum logic gates including mapping the Hermitian matrix to the system Hamiltonian, the quantum state representing the desired solution can be synthesized in the memory conditional upon the state of the ancilla qubit. Afterward one can either map the quantum state to recover all entries of the vector , or, more efficiently, perform the quantum measurement corresponding to an operator , that one is interest in, to extract its expectation value .

With the system initialized in the state , where the subscripts a, r, and m index, respectively, the subsets of qubits in the ancilla, the register, and the memory (here and below we keep the subscripts in wavefunctions only when the states of two or three subsets are quoted simultaneously), a general description of the HHL core is as follows: (1) with quantum phase estimation (1); (30) using the controlled unitary transformations in the form for a variable time , decompose in the eigenbasis of , i.e., , and map the corresponding eigenvalues into the register in a binary form to transform the system to ; (2) perform controlled rotation on the ancilla according to stored in the register, which transforms the system to

(2) |

where () is a constant that can be selected as any real number to make the controlled rotation physical (1); (3) reverse the procedure in (1) to disentangle and clear the register, and the system state evolves to

(3) |

A postselection of the -state outcome of the ancilla will yield the desired output in the memory , with a success probability of .

As argued elsewhere (5), conversions between the
classical vectors and their quantum counterparts, i.e.,
and , take extra time and
may eventually kill the exponential speedup gained during execution of the HHL core.
Nevertheless, the HHL algorithm provides a general template and represents
a real advance in the theory of quantum algorithms. Our immediate goal
in this experiment is to implement a *purely* quantum version of the HHL algorithm,
i.e., we aim to test the above-mentioned HHL core with quantum inputs and outputs.

In our demonstration, the four-qubit solver is set to run a nontrivial instance, where the system matrix is chosen as . Eigenvectors of formatted to quantum are and with eigenvalues of and , respectively. Accordingly, our four qubits are distributed into three subsets: the ancilla (), the register (), and the memory (). The binary representations of “”, “” and “”, record eigenvalues and , respectively. The input is prepared in by single-qubit rotations.

The pre-chosen Hermitian matrix allows us to optimize the circuit that consists of three subroutines as shown in Fig. 2(a), where all two-qubit gates fit to our system Hamiltonian (Eq. 1). Subroutine 1: the phase estimation subroutine is pre-compiled with a controlled-phase (CZ) gate, two gates, and two single-qubit gates acting on the memory () and the register (), which can be described as follows: first prepare in , following which the Hadamard gate transforms to ; meanwhile a rotation on yields in the register; next the sandwiched -CZ- gate combo fulfills a controlled-iSWAP gate, which swaps the states between and up to a phase factor of only if is in . At the end of this subroutine, the state of goes to , which correlates the binary representations of the eigenvalues in the register (ignoring the phase factor as we omit an insignificant single-qubit phase gate here) with the eigenstates in the memory, since and correspond to and , respectively, up to a Hadamard gate. Subroutine 2: the controlled rotation subroutine acts on the ancilla () depending on the state of the register , whose effect can be best visualized using the Bloch sphere representation as illustrated Fig. 2(b). Here we choose , and according to Eq. 2 the rotation angles around Y axis for should be for and for . Subroutine 3: this one is exactly the reverse of Subroutine 1, in which the register is disentangled and cleared, and and are transformed back to the eigenstates and , respectively, with the final Hadamard gate on .

The compiled HHL circuits in Fig. 2(a) consist of more than 15 one- and two-qubit gates, excluding phase compensation and tomography gates that are not shown. Execution of these gates with reasonably high precisions are therefore important, though phase errors may not be critical at certain steps, e.g., the process of mapping eigenvalues to the register. Our single-qubit rotations have been calibrated by randomized benchmarking to be of reasonably high fidelity as limited by qubit coherence (31). ’s gate is 300 ns in length, and qubit coherence would limit the gate fidelity to be just under 0.98. For the - and iSWAP gates, we tune the qubits on-resonance for periods of and , respectively, similar to those demonstrated using the qubit-resonator architecture (32). However, here due to the crosstalk issue, which likely results from insufficient crossover wirings to tie the grounds together (33), our and iSWAP gates show slightly lower performances, with fidelity values estimated to be slightly above 0.98 and 0.97, respectively. For the CZ gate we include the qubit’s second excited state and implement similarly as that demonstrated using the qubit-resonator-qubit architecture (34). The fidelity of our CZ gate is estimated to be about 0.95 using the calibrated Ramsey interference data shown in Fig. 2(c). We note that the CZ gate can also be implemented, with high fidelity and without exchange of excitations, by optimizing one qubit’s frequency trajectory to mediate the two-qubit state close to the avoided-level crossing with the state (19), which would be hard to be implemented in our device due to the crosstalk issue.

We prepare 18 different input states , for to 18, on the Bloch sphere as shown in Fig. 3(a). With the output state stored in , we can measure the expectation value of a certain operator that we are interested in (see, e.g., the case of in Fig. 3(b)). We can also characterize the input and output states of the above instance by quantum state tomography (QST): qubit polarization along Z axis of the Bloch sphere can be directly measured; for polarizations along X and Y axes the qubit is rotated around Y and X axes, respectively, before measurement. The corresponding output in and the state of are simultaneously measured (29), which allows us to reconstruct using only the data corresponding to the -state outcome of . As shown in Fig. 3(c), fidelity values of the 18 output states by QST are reasonably high, ranging from to .

With all the input and output states being measured, we are able to characterize the solver more exactly by QPT, where a non-trace-preserving process matrix in the Pauli basis is used to linearly map to . The experimental matrix, inferred reliably only with all 18 input states being used, and the ideal matrix are shown together in Fig. 4 for comparison, which yields a process fidelity (35) of . Here the error bar is estimated using simulated random normal distributed noise associated with the QST data (36). has a trace of 0.497, which indicates the averaged success probability of our solver for the 18 input states, while ideally the trace is 0.625 for . (29)

In summary, we have demonstrated a superconducting quantum linear solver for a system with output state fidelities ranging from to and quantum process fidelity of . The achieved fidelities are limited by decoherence and by errors in our implementation of the two-qubit gates, the latter of which is related to the insufficient grounding that can be fixed by adding an extra lithography layer in the device fabrication (19); (17). With future improvements on superconducting qubit coherence and circuit complexity, the superconducting quantum circuits could be used to implement more intricate quantum algorithms on a larger scale and ultimately reach quantum computational speedup.

Acknowledgments. We thank Masoud Mohseni for helpful discussions. This work was supported by the Chinese Academy of Sciences, the NBRP of China (Grants No. 2014CB921201 and No. 2014CB921401), the NSFC (Grants No. 11434008, No. 11374344, No. 11404386 and No. 11574380), and the Fundamental Research Funds for the Central Universities of China (Grant No. 2016XZZX002-01).

### Footnotes

- Y. Z. and C. S. contributed equally to this work.
- Electronic mail: hhwang@zju.edu.cn
- Electronic mail: cylu@ustc.edu.cn
- Electronic mail: xbzhu16@ustc.edu.cn

### References

- A. W. Harrow, A. Hassidim, and S. Lloyd, Phys. Rev. Lett. 103, 150502 (2009).
- L. K. Grover, in Proceedings of 28th Annual ACM Symposium on Theory of Computing, (ACM, New York, USA, 1996), pp. 212-219.
- D. Deutsch, and R. Jozsa, Proceedings of the Royal Society of London Series A: Mathematical Physical and Engineering Sciences, 439, 553 (1992).
- P. W. Shor, in Proceedings of 35th Annual Symposium on Foundations of Computer Science (IEEE, New York, USA, 1994), pp. 124-134.
- S. Aaronson, Nat. Phys. 11, 291 (2015).
- N. Wiebe, D. Braun, and S. Lloyd, Phys. Rev. Lett. 109, 050505 (2012).
- A. Montanaro, and S. Pallister, Phys. Rev. A 93, 032324 (2016).
- S. Lloyd, M. Mohseni, and P. Rebentrost, arXiv:1307.0411.
- P. Rebentrost, M. Mohseni, and S. Lloyd, Phys. Rev. Lett. 113, 130503 (2014).
- X. D. Cai, C. Weedbrook, Z. E. Su, M. C. Chen, M. Gu, M. J. Zhu, L. Li, N. L. Liu, C. Y. Lu, and J. W. Pan, Phys. Rev. Lett. 110, 230501 (2013).
- S. Barz, I. Kassal, M. Ringbauer, Y. O. Lipp, B. Dakić, A. Aspuru-Guzik, and P. Walther, Sci. Rep. 4, 6115 (2014).
- J. Pan, Y. D. Cao, X. W. Yao, Z. K. Li, C. Y. Ju, H. W. Chen, X. H. Peng, S. Kais, and J. F. Du, Phys. Rev. A 89, 022313 (2014).
- R. Barends, J. Kelly, A. Megrant, D. Sank, E. Jeffrey, Y. Chen, Y. Yin, B. Chiaro, J. Mutus, C. Neill, P. O’Malley, P. Roushan, J. Wenner, T. C. White, A. N. Cleland, and J. M. Martinis, Phys. Rev. Lett. 111, 080502 (2013).
- C. Rigetti, J. M. Gambetta, S. Poletto, B. L. T. Plourde, J. M. Chow, A. D. Córcoles, J. A. Smolin, S. T. Merkel, J. R. Rozen, G. A. Keefe, M. B. Rothwell, M. B. Ketchen, and M. Steffen, Phys. Rev. B 86, 100506 (2012).
- H. Paik, D. I. Schuster, L. S. Bishop, G. Kirchmair, G. Catelani, A. P. Sears, B. R. Johnson, M. J. Reagor, L. Frunzio, L. I. Glazman, S. M. Girvin, M. H. Devoret, and R. J. Schoelkopf, Phys. Rev. Lett. 107, 240501 (2011).
- Y. Chen, C. Neill, P. Roushan, N. Leung, M. Fang, R. Barends, J. Kelly, B. Campbell, Z. Chen, B. Chiaro, A. Dunsworth, E. Jeffrey, A. Megrant, J. Y. Mutus, P. J. J. O’Malley, C. M. Quintana, D. Sank, A. Vainsencher, J. Wenner, T. C. White, M. R. Geller, A. N. Cleland, and J. M. Martinis, Phys. Rev. Lett. 113, 220502 (2014).
- J. Kelly, R. Barends, A. G. Fowler, A. Megrant, E. Jeffrey, T. C. White, D. Sank, J. Y. Mutus, B. Campbell, Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, I. C. Hoi, C. Neill, P. J. J. O’Malley, C. Quintana, P. Roushan, A. Vainsencher, J. Wenner, A. N. Cleland, and J. M. Martinis, Nature 519, 66 (2015).
- A. D. Córcoles, E. Magesan, S. J. Srinivasan, A. W. Cross, M. Steffen, J. M. Gambetta, and J. M. Chow, Nat. Commun. 6, 6979 (2015).
- R. Barends, J. Kelly, A. Megrant, A. Veitia, D. Sank, E. Jeffrey, T. C.White, J. Mutus, A. G. Fowler, B. Campbell, Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, C. Neill, P. O’Malley, P. Roushan, A. Vainsencher, J. Wenner, A. N. Korotkov, A. N. Cleland, and J. M. Martinis, Nature 508, 500 (2014).
- S. Sheldon, E. Magesan, J. M. Chow, and J. M. Gambetta, Phys. Rev. A 93, 060302 (2016).
- D. Ristè, M. Dukalski, C. A. Watson, G. de Lange, M. J. Tiggelman, Y. M. Blanter, K. W. Lehnert, R. N. Schouten, and L. DiCarlo, Nature 502, 350 (2013).
- L. DiCarlo, J. M. Chow, J. M. Gambetta, L. S. Bishop, B. R. Johnson, D. I. Schuster, J. Majer, A. Blais, L. Frunzio, S. M. Girvin, and R. J. Schoelkopf, Nature 460, 240 (2009).
- T. Yamamoto, M. Neeley, E. Lucero, R. C. Bialczak, J. Kelly, M. Lenander, M. Mariantoni, A. D. O’Connell, D. Sank, H. Wang, M. Weides, J. Wenner, Y. Yin, A. N. Cleland, and J. M. Martinis, Phys. Rev. B 82, 184515 (2010).
- E. Lucero, R. Barends, Y. Chen, J. Kelly, M. Mariantoni, A. Megrant, P. O’Malley, D. Sank, A. Vainsencher, J. Wenner, T. White, Y. Yin, A. N. Cleland, and J. M. Martinis, Nat. Phys. 8, 719 (2012).
- J. Koch, T. M. Yu, J. Gambetta, A. A. Houck, D. I. Schuster, J. Majer, A. Blais, M. H. Devoret, S. M. Girvin and R. J. Schoelkopf, Phys. Rev. A 76, 042319 (2007).
- I. L. Chuang, and M. A. Nielsen, J. Mod. Opt. 44, 2455 (1997).
- J. Y. Mutus, T. C. White, R. Barends, Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, E. Jeffrey, J. Kelly, A. Megrant, C. Neill, P. J. J. O’Malley, P. Roushan, D. Sank, A. Vainsencher, J. Wenner, K. M. Sundqvist, A. N. Cleland, and J. M. Martinis, App. Phys. Lett. 104, 263513 (2014).
- D. Sank, R. Barends, R. C. Bialczak, Y. Chen, J. Kelly, M. Lenander, E. Lucero, M. Mariantoni, A. Megrant, M. Neeley, P. J. J. O’Malley, A. Vainsencher, H. Wang, J. Wenner, T. C. White, T. Yamamoto, Y. Yin, A. N. Cleland, and J. M. Martinis, Phys. Rev. Lett. 109, 067001 (2012).
- See Supplement Material for more information on the device and the non-trace-preserving process tomography.
- M. A. Nielsen, and I. L. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, Cambridge, UK 2000).
- H. K. Xu, C. Song, W. Y. Liu, G. M. Xue, F. F. Su, H. Deng, Y. Tian, D. N. Zheng, S. Y. Han, Y. P. Zhong, H. Wang, Y. X. Liu, and S. P. Zhao, Nat. Commun. 7, 11018 (2016).
- M. Hofheinz, H. Wang, M. Ansmann, R. C. Bialczak, E. Lucero, M. Neeley, A. D. O’Connell, D. Sank, J. Wenner, J. M. Martinis, and A. N. Cleland, Nature 459, 546 (2009).
- Z. Chen, A. Megrant, J. Kelly, R. Barends, J. Bochmann, Y. Chen, B. Chiaro, A. Dunsworth, E. Jeffrey, J. Y. Mutus, P. J. J. O’Malley, C. Neill, P. Roushan, D. Sank, A. Vainsencher, J. Wenner, T. C. White, A. N. Cleland, and J. M. Martinis, Appl. Phys. Lett. 104, 052602 (2014).
- M. Mariantoni, H. Wang, T. Yamamoto, M. Neeley, R. C. Bialczak, Y. Chen, M. Lenander, E. Lucero, A. D. O’Connell, D. Sank, M. Weides, J. Wenner, Y. Yin, J. Zhao, A. N. Korotkov, A. N. Cleland, and J. M. Martinis, Science 334, 61 (2011).
- N. Kiesel, C. Schmid, U. Weber, R. Ursin, and H. Weinfurter, Phys. Rev. Lett. 95, 210505 (2005).
- J. L. O’Brien, G. J. Pryde, A. Gilchrist, D. F. V. James, N. K. Langford, T. C. Ralph, and A. G. White, Phys. Rev. Lett. 93, 080502 (2004).