Abstract
Quantum computers can be used to address electronicstructure problems and problems in materials science and condensed matter physics that can be formulated as interacting fermionic problems, problems which stretch the limits of existing highperformance computers^{1}. Finding exact solutions to such problems numerically has a computational cost that scales exponentially with the size of the system, and Monte Carlo methods are unsuitable owing to the fermionic sign problem. These limitations of classical computational methods have made solving even fewatom electronicstructure problems interesting for implementation using mediumsized quantum computers. Yet experimental implementations have so far been restricted to molecules involving only hydrogen and helium^{2,3,4,5,6,7,8}. Here we demonstrate the experimental optimization of Hamiltonian problems with up to six qubits and more than one hundred Pauli terms, determining the groundstate energy for molecules of increasing size, up to BeH_{2}. We achieve this result by using a variational quantum eigenvalue solver (eigensolver) with efficiently prepared trial states that are tailored specifically to the interactions that are available in our quantum processor, combined with a compact encoding of fermionic Hamiltonians^{9} and a robust stochastic optimization routine^{10}. We demonstrate the flexibility of our approach by applying it to a problem of quantum magnetism, an antiferromagnetic Heisenberg model in an external magnetic field. In all cases, we find agreement between our experiments and numerical simulations using a model of the device with noise. Our results help to elucidate the requirements for scaling the method to larger systems and for bridging the gap between key problems in highperformance computing and their implementation on quantum hardware.
Main
The fundamental goal in electronicstructure problems is to solve for the groundstate energy of manybody interacting fermionic Hamiltonians. Solving this problem on a quantum computer relies on a mapping between fermionic and qubit operators^{11}, which restates the problem as a specific instance of a local Hamiltonian problem on a set of qubits. Given a klocal Hamiltonian H, composed of terms that act on at most k qubits, the solution to the local Hamiltonian problem amounts to finding its groundstate eigenvalue E_{G} and ground state Φ_{G}〉, which satisfySo far, no efficient algorithm is known that can solve this problem in its fully general form. For k ≥ 2, the problem is known to be quantum Merlin Arthur (QMA)complete^{12}; however, it is expected that physical systems have Hamiltonians that can be solved efficiently on a quantum computer, while remaining hard to solve on a classical computer.
Following Feynman’s idea for quantum simulation, a quantum algorithm for the groundstate problem of interacting fermions has been proposed^{13,14}. The approach relies on a ‘good’ initial state—one that has a large overlap with the ground state—and solves the problem using the quantum phase estimation algorithm^{15}. Although this algorithm can produce extremely accurate energy estimates for quantum chemistry^{2,3,5,8}, it applies stringent requirements on the coherence of the quantum hardware.
An alternative approach is to use quantum optimizers, which have previously demonstrated utility, for example, for combinatorial optimization problems^{16,17} and in quantum chemistry as variational quantum eigensolvers (VQEs) where they were introduced to reduce the coherence requirements on quantum hardware^{4,18,19}. The VQE uses Ritz’s variational principle to prepare approximations to the ground state and its energy. In this approach, the quantum computer is used to prepare variational trial states that depend on a set of parameters. The expectation value of the energy is then estimated and used in a classical optimizer to generate a new set of improved parameters. The advantage of a VQE over classical simulation methods is that it can prepare trial states that are not amenable to efficient classical numerics.
The VQE approach realized in experiments has so far been limited by different factors. Typically, a unitary coupled cluster ansatz for the trial state is considered^{6,7}, which has a number of parameters that scales quartically with the number of spin orbitals that are considered in the single and doubleexcitation approximation. Furthermore, when implementing the unitary coupled cluster ansatz on a quantum computer, Trotterization errors need to be accounted for^{19,20,21}. Here we introduce and implement a hardwareefficient ansatz preparation for a VQE, whereby trial states are parameterized by quantum gates that are tailored to the physical device that is available. We show numerically the viability of such trial states for small electronicstructure problems and use a superconducting quantum processor to perform optimizations of the molecular energies of H_{2}, LiH and BeH_{2}, and extend its application to a Heisenberg antiferromagnetic model in an external magnetic field.
The device used in the experiments is a superconducting quantum processor with six fixedfrequency transmon qubits, together with a central weakly tunable asymmetric transmon qubit^{22}. The device is cooled in a dilution refrigerator, where it is thermally anchored to its mixing chamber plate at 25 mK. The experiments discussed here make use of six of these qubits (labelled Q1–Q6; Fig. 1b). The qubits are coupled via two superconducting coplanar waveguide resonators, and can be controlled individually and read out using independent readout resonators.
The hardwareefficient trial states that we consider use the naturally available entangling interactions of the superconducting hardware, which are described by a drift Hamiltonian H_{0}. This Hamiltonian generates the entanglers, which are unitary operators of the form U_{ENT} = exp(−iH_{0}τ), which entangle all the qubits in the circuit, where τ is the evolution time. These entanglers are interleaved with arbitrary singlequbit Euler rotations, which are implemented as a combination of Z and X gates, , where θ represents the Euler angles, q identifies the qubit and i = 0, 1, …, d refers to the depth position, as depicted in Fig. 1c. The Nqubit trial states are obtained from the state 00…0〉, applying d entanglers U_{ENT} that alternate with N Euler rotations, givingBecause the qubits are all initialized in their ground state 0〉, the first set of Z rotations of U^{q,0}(θ) is not implemented, resulting in a total of p = N(3d + 2) independent angles. In the experiment, the evolution time τ and the individual couplings in H_{0} can be controlled. However, numerical simulations indicate that accurate optimizations are obtained for fixedphase entanglers U_{ENT}, leaving the p control angles as variational parameters. Our hardwareefficient approach does not rely on the accurate implementation of specific twoqubit gates and can be used with any U_{ENT} that generates sufficient entanglement. This is in contrast to unitary coupledcluster trial states, which require highfidelity quantum gates that approximate a unitary operator tailored on the basis of a theoretical ansatz. For the experiments considered here, the entanglers U_{ENT} are composed of a sequence of twoqubit crossresonance gates^{23}. Simulations as a function of entangler phase show plateaus of minimal energy error around gate phases that correspond to the maximal pairwise concurrence; see Supplementary Information. We therefore set the entangler evolution time τ at the beginning of such plateaus, to reduce decoherence effects.
In our experiments, the Z rotations are implemented as frame changes in the control software^{24}, whereas the X rotations are implemented by appropriately scaling the amplitude of calibrated X_{π} pulses, using a fixed total time of 100 ns for every singlequbit rotation. The crossresonance gates that compose U_{ENT} are implemented by driving a control qubit Q_{c} with a microwave pulse that is resonant with a target qubit Q_{t}. We use Hamiltonian tomography of these gates to determine the strengths of the various interaction terms, and the gate time for maximal entanglement^{23}. We set our twoqubit gate times at 150 ns, to try to minimize the effect of decoherence without compromising the accuracy of the optimization outcome; see Supplementary Information.
After each trial state is prepared, we estimate the associated energy by measuring the expectation values of the individual Pauli terms in the Hamiltonian. These estimates are affected by stochastic fluctuations due to finite sampling. Different postrotations are applied after trialstate preparation for sampling different Pauli operators (Fig. 1c, d). We group the Pauli operators into tensor product basis sets that require the same postrotations. We numerically show that such grouping reduces the energy fluctuations, while keeping the same total number of samples, thereby reducing the time overhead for energy estimation; see Supplementary Information. The energy estimates are then used in a gradient descent algorithm that relies on a simultaneous perturbation stochastic approximation (SPSA) to update the control parameters. The SPSA algorithm approximates the gradient using only two energy measurements, regardless of the dimensions of the parameter space p, achieving a level of accuracy comparable to that of standard gradient descent methods, in the presence of stochastic fluctuations^{10}. This is crucial for optimizing over many qubits and long depths for trialstate preparation, enabling us to optimize over a number of parameters as large as p = 30.
To address molecular problems on our quantum processor, we rely on a compact encoding of the secondquantized fermionic Hamiltonians onto qubits. The Hamiltonian for molecular H_{2} has four spin orbitals, representing the spindegenerate 1s orbitals of the two hydrogen atoms. We use a binary tree encoding^{11} to map the Hamiltonian to a fourqubit system, and remove the two qubits that are associated with the spin parities of the system^{9}. The Hamiltonian for BeH_{2} is defined on the basis of the 1s, 2s and 2p_{x} orbitals that are associated with Be, and the 1s orbital that is associated with each H atom, for a total of ten spin orbitals. We then assume perfect filling of the innermost two 1s spin orbitals of Be, after shifting their energies by diagonalizing the noninteracting part of the fermionic Hamiltonian. We map the eightspinorbital Hamiltonian of BeH_{2} using parity mapping and, as in the case of H_{2}, remove two qubits associated with the spin–parity symmetries, reducing the Hamiltonian to a sixqubit problem that encodes eight spin orbitals. A similar approach is used to map LiH onto four qubits. The Hamiltonians for H_{2}, LiH and BeH_{2} at their lowestenergy interatomic distances (bond distance) are given explicitly in Supplementary Information.
The results from an optimization procedure are illustrated in Fig. 2, using the Hamiltonian for BeH_{2} at the interatomic distance of 1.7 Å. Although using a large number of entanglers U_{ENT} helps to achieve better energy estimates in the absence of noise, the combined effect of decoherence and finite sampling sets the optimal depth for optimizations on our quantum hardware to 0–2 entanglers. The results presented in Fig. 2 were obtained using a circuit of depth d = 1, with a total of 30 Euler control angles associated with six qubits. The inset of Fig. 2 shows the simultaneous perturbation of 30 Euler angles as the energy estimates are updated.
To obtain the potentialenergy surfaces for H_{2}, LiH and BeH_{2}, we search for the groundstate energy of their molecular Hamiltonians, using two, four and six qubits, respectively, a depth d = 1 and a range of different interatomic distances. The experimental results are compared with the groundstate energies obtained from exact diagonalization and outcomes from numerical simulations in Fig. 3. The coloured density plots in each panel are obtained from 100 numerical optimizations for each interatomic distance, using crossresonance entangling gates with the same topology as in the experiments. These numerics account for decoherence effects, which are simulated by adding amplitude damping and dephasing channels after each layer of quantum gates. The effect of finite sampling on the optimization algorithm is taken into account by numerically sampling the individual Pauli terms in the Hamiltonian, and adding their averages. The strengths of the noise channels are derived from the measured values of the coherence times T_{1} and . In addition to the effects of decoherence and noisy energy estimates, the deviations are also due to low circuit depth for trialstate preparation, which, for example, explains the kink in the range l = 2.5–3 Å in Fig. 3b. In the absence of noise, critical depths of d = 1, d = 8 and d = 28 are required to achieve chemical accuracy (an energy error of approximately 0.0016 hartree) on the current experimental connectivities for H_{2}, LiH and BeH_{2}, respectively; critical depths of d = 1, d = 6 and d = 16 are required to achieve chemical accuracy on the respective alltoall connectivities; see Supplementary Information. By contrast, a generic unitary coupledcluster ansatz truncated to second order for an eightorbital molecule such as our model of BeH_{2} would require 4,160 fermionic variational terms, which, after accounting for fermionic mappings and Trotterization, would generate a number of quantum gates that is of the same order. The scaling of resources and the noise requirements necessary for achieving chemical accuracy using hardwareefficient trial states are detailed in Supplementary Information. We emphasize that our approach is unaffected by coherent gate errors, which shifts the focus to reducing incoherent errors, favouring our fixedfrequency, allmicrowavecontrolled qubit architecture. Furthermore, the effect of incoherent errors can be mitigated as recently proposed^{25,26,27}, without requiring additional quantum resources.
We now demonstrate the applicability of our technique to a problem of quantum magnetism, and show that, with the same noisy quantum hardware, the advantage of using greater circuits depths is crucially dependent on the target Hamiltonian. Specifically, we consider a fourqubit Heisenberg model on a square lattice, in the presence of an external magnetic field. The model is described by the Hamiltonianwhere 〈ij〉 indicates the nearestneighbour pairs, J is the strength of the spin–spin interaction and B the magnetic field along the Z direction. Similar spin models have previously been simulated using trapped ions^{28}. We use our technique to solve for the groundstate energy of the system for a range of J/B values. When J = 0, the ground state is completely separable and the best estimates are obtained for a depth of d = 0. As J is increased, the ground state is increasingly entangled and the best estimates are instead obtained for d = 2, despite the increased decoherence that is caused by using two entanglers for trialstate preparation. This behaviour is shown in Fig. 4a for J/B = 1. The experimental results are compared with the exact groundstate energies for a range of J/B values in Fig. 4b, and our deviations are captured by the density plots of the numerical outcomes that account for noisy energy estimations and decoherence. Furthermore, in Fig. 4c, we show that our approach can be used to evaluate observables such as the magnetization of the system M_{z}.
The experiments presented here demonstrate that a hardwareefficient VQE implemented on a sixqubit superconducting quantum processor is capable of addressing molecular problems beyond period I elements, up to BeH_{2}. A numerical investigation of the hardware involved suggests that substantial improvements in coherence and sampling are needed to improve the accuracy of a VQE for the molecules that we addressed; see Supplementary Information. For more complex problems, increased coherence and faster gates would enable larger circuit depths for state preparation, whereas increased onchip qubit connectivity is crucial for reducing the critical depth requirements to achieve chemical accuracy. The use of fast reset schemes^{29} would enable increased sampling rates, improving the effectiveness of the classical optimizer and reducing time overheads. The performance of the quantum–classical optimization could be further improved by using variants^{30} of the SPSA protocol. Trialstatepreparation circuits, which combine ansatzes from classical approximation methods and hardwareefficient gates, could be investigated further to improve on the current state ansatz. Finally, even before the advent of faulttolerant architechtures, the agreement of our experimental results with the noise models that we considered opens up a path to errormitigation protocols for experimentally accessible circuit depths^{25,26,27}.
Data Availability
The data that support the findings of this study are available from the corresponding author on reasonable request.
References
 1.
National Energy Research Scientific Computing Center 2015 Annual Report http://www.nersc.gov/assets/AnnualReports/2015NERSCAnnualReportFinal.pdf (2015)
 2.
Lanyon, B. P. et al. Towards quantum chemistry on a quantum computer. Nat. Chem. 2, 106–111 (2010)
 3.
Du, J. et al. NMR implementation of a molecular hydrogen quantum simulation with adiabatic state preparation. Phys. Rev. Lett. 104, 030502 (2010)
 4.
Peruzzo, A. et al. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014)
 5.
Wang, Y. et al. Quantum simulation of helium hydride cation in a solidstate spin register. ACS Nano 9, 7769–7774 (2015)
 6.
O’Malley, P. J. J. et al. Scalable quantum simulation of molecular energies. Phys. Rev. X 6, 031007 (2016)
 7.
Shen, Y. et al. Quantum implementation of the unitary coupled cluster for simulating molecular electronic structure. Phys. Rev. A 95, 020501 (2017)
 8.
Paesani, S. et al. Experimental Bayesian quantum phase estimation on a silicon photonic chip. Phys. Rev. Lett. 118, 100503 (2017)
 9.
Bravyi, S., Gambetta, J. M., Mezzacapo, A. & Temme, K. Tapering off qubits to simulate fermionic hamiltonians. Preprint at https://arxiv.org/abs/1701.08213 (2017)
 10.
Spall, J. C. Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Trans. Automat. Contr. 37, 332–341 (1992)
 11.
Bravyi, S. & Kitaev, A. Fermionic quantum computation. Ann. Phys. 298, 210–226 (2002)
 12.
Kempe, J., Kitaev, A. & Regev, O. The complexity of the local Hamiltonian problem. SIAM J. Comput. 35, 1070–1097 (2006)
 13.
Abrams, D. S. & Lloyd, S. Simulation of manybody Fermi systems on a universal quantum computer. Phys. Rev. Lett. 79, 2586–2589 (1997)
 14.
AspuruGuzik, A., Dutoi, A. D., Love, P. J. & HeadGordon, M. Simulated quantum computation of molecular energies. Science 309, 1704–1707 (2005)
 15.
Kitaev, A. Y. Quantum measurements and the Abelian stabilizer problem. Preprint at https://arxiv.org/abs/quantph/9511026 (1995)
 16.
Farhi, E., Goldstone, J. & Gutmann, S. A quantum approximate optimization algorithm. Preprint at https://arxiv.org/abs/1411.4028 (2014)
 17.
Farhi, E., Goldstone, J., Gutmann, S. & Neven, H. Quantum algorithms for fixed qubit architectures. Preprint at https://arxiv.org/abs/1703.06199 (2017)
 18.
Yung, M.H. et al. From transistor to trappedion computers for quantum chemistry. Sci. Rep. 4, 3589 (2014)
 19.
McClean, J., Romero, J., Babbush, R. & AspuruGuzik, A. The theory of variational hybrid quantumclassical algorithms. New J. Phys. 18, 023023 (2016)
 20.
Wecker, D., Hastings, M. B. & Troyer, M. Progress towards practical quantum variational algorithms. Phys. Rev. A 92, 042303 (2015)
 21.
Romero, J. et al. Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz. Preprint at https://arxiv.org/abs/1701.02691 (2017)
 22.
Hutchings, M. et al. Tunable superconducting qubits with fluxindependent coherence. Preprint at https://arxiv.org/abs/1702.02253 (2017)
 23.
Sheldon, S., Magesan, E., Chow, J. M. & Gambetta, J. M. Procedure for systematically tuning up crosstalk in the crossresonance gate. Phys. Rev. A 93, 060302 (2016)
 24.
McKay, D. C., Wood, C. J., Sheldon, S., Chow, J. M. & Gambetta, J. M. Efficient Zgates for quantum computing. Preprint at https://arxiv.org/abs/1612.00858 (2017)
 25.
McClean, J. R., Schwartz, M. E., Carter, J. & de Jong, W. A. Hybrid quantumclassical hierarchy for mitigation of decoherence and determination of excited states. Phys. Rev. A 95, 042308 (2017)
 26.
Li, Y. & Benjamin, S. C. Efficient variational quantum simulator incorporating active error minimisation. Phys. Rev. X 7, 021050 (2017)
 27.
Temme, K., Bravyi, S. & Gambetta, J. M. Error mitigation for short depth quantum circuits. Preprint at https://arxiv.org/abs/1612.02058 (2017)
 28.
Lanyon, B. P. et al. Universal digital quantum simulation with trapped ions. Science 334, 57–61 (2011)
 29.
Bultink, C. C. et al. Active resonator reset in the nonlinear dispersive regime of circuit QED. Phys. Rev. Appl. 6, 034008 (2016)
 30.
Spall, J. C. Adaptive stochastic approximation by the simultaneous perturbation method. IEEE Trans. Automat. Contr. 45, 1839–1853 (2000)
Acknowledgements
We thank J. ChavezGarcia, A. D. Córcoles and J. Rozen for experimental contributions, J. Hertzberg and S. Rosenblatt for room temperature characterization, B. Abdo for design and characterization of the Josephson Parametric Converters, S. Brayvi, J. Smolin, E. Magesan, L. Bishop, S. Sheldon, N. Moll, P. Barkoutsos and I. Tavernelli for discussions, and W. Shanks for assistance with the experimental control software. We thank A. D. Córcoles for edits to the manuscript. We acknowledge support from the IBM Research Frontiers Institute. The research is based on work supported by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via the Army Research Office contract W911NF1010324.
Author information
Author notes
 Abhinav Kandala
 & Antonio Mezzacapo
These authors contributed equally to this work.
Affiliations
IBM T.J. Watson Research Center, Yorktown Heights, New York 10598, USA
 Abhinav Kandala
 , Antonio Mezzacapo
 , Kristan Temme
 , Maika Takita
 , Markus Brink
 , Jerry M. Chow
 & Jay M. Gambetta
Authors
Search for Abhinav Kandala in:
Search for Antonio Mezzacapo in:
Search for Kristan Temme in:
Search for Maika Takita in:
Search for Markus Brink in:
Search for Jerry M. Chow in:
Search for Jay M. Gambetta in:
Contributions
A.K. and A.M. contributed equally to this work. J.M.G. and K.T. designed the experiments. A.K. and M.T. characterized the device and A.K. performed the experiments. M.B. fabricated the devices. A.M. developed the theory and the numerical simulations. A.K., A.M. and J.M.G. interpreted and analysed the experimental data. A.K., A.M., K.T., J.M.C. and J.M.G. contributed to writing the manuscript.
Competing interests
The authors declare no competing financial interests.
Corresponding authors
Correspondence to Abhinav Kandala or Antonio Mezzacapo.
Reviewer Information Nature thanks N. Linke and the other anonymous reviewer(s) for their contribution to the peer review of this work.
Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
PDF files
 1.
Supplementary Information
This file contains supplementary Text, Supplementary Figures 19 and additional references.
Rights and permissions
To obtain permission to reuse content from this article visit RightsLink.
About this article
Further reading

Synthesis of antisymmetric spin exchange interaction and chiral spin clusters in superconducting circuits
Nature Physics (2019)

Simulating the vibrational quantum dynamics of molecules using photonics
Nature (2018)

Tuneable hopping and nonlinear crossKerr interactions in a highcoherence superconducting circuit
npj Quantum Information (2018)

On the complexity and verification of quantum random circuit sampling
Nature Physics (2018)

Quantum machine learning for electronic structure calculations
Nature Communications (2018)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.