Letter | Published:

Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets

Nature volume 549, pages 242246 (14 September 2017) | Download Citation


Quantum computers can be used to address electronic-structure 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 high-performance computers1. 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 few-atom electronic-structure problems interesting for implementation using medium-sized quantum computers. Yet experimental implementations have so far been restricted to molecules involving only hydrogen and helium2,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 ground-state energy for molecules of increasing size, up to BeH2. 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 Hamiltonians9 and a robust stochastic optimization routine10. 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 high-performance computing and their implementation on quantum hardware.


The fundamental goal in electronic-structure problems is to solve for the ground-state energy of many-body interacting fermionic Hamiltonians. Solving this problem on a quantum computer relies on a mapping between fermionic and qubit operators11, which restates the problem as a specific instance of a local Hamiltonian problem on a set of qubits. Given a k-local Hamiltonian H, composed of terms that act on at most k qubits, the solution to the local Hamiltonian problem amounts to finding its ground-state eigenvalue EG 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)-complete12; 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 ground-state problem of interacting fermions has been proposed13,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 algorithm15. Although this algorithm can produce extremely accurate energy estimates for quantum chemistry2,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 problems16,17 and in quantum chemistry as variational quantum eigensolvers (VQEs) where they were introduced to reduce the coherence requirements on quantum hardware4,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 considered6,7, which has a number of parameters that scales quartically with the number of spin orbitals that are considered in the single- and double-excitation approximation. Furthermore, when implementing the unitary coupled cluster ansatz on a quantum computer, Trotterization errors need to be accounted for19,20,21. Here we introduce and implement a hardware-efficient 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 electronic-structure problems and use a superconducting quantum processor to perform optimizations of the molecular energies of H2, LiH and BeH2, 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 fixed-frequency transmon qubits, together with a central weakly tunable asymmetric transmon qubit22. 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 read-out resonators.

Figure 1: Quantum chemistry on a superconducting quantum processor.
Figure 1

Solving electronic-structure problems on a quantum computer relies on mappings between fermionic and qubit operators. a, Parity mapping of eight spin orbitals (drawn in blue and red, not to scale) onto eight qubits, which are then reduced to six qubits owing to fermionic spin and parity symmetries. The length of the bars indicate the parity of the spin orbitals that are encoded in each qubit. b, False-coloured optical micrograph of the superconducting quantum processor with seven transmon qubits. These qubits are coupled via two coplanar waveguide resonators (violet) and have individual coplanar waveguide resonators for control and read-out. c, Hardware-efficient quantum circuit for trial-state preparation and energy estimation, shown here for six qubits. For each iteration k, the circuit is composed of a sequence of interleaved single-qubit rotations Uq,d(θk) and entangling unitary operations UENT that entangle all of the qubits in the circuit. A final set of post-rotations (I, X−π/2 or Yπ/2) before the qubits are read out is used to measure the expectation values of the individual Pauli terms in the Hamiltonian and to estimate the energy of the trial state. d, An example of the pulse sequence for the preparation of a six-qubit trial state, in which UENT is implemented as a sequence of two-qubit cross-resonance gates.

The hardware-efficient trial states that we consider use the naturally available entangling interactions of the superconducting hardware, which are described by a drift Hamiltonian H0. This Hamiltonian generates the entanglers, which are unitary operators of the form UENT = exp(−iH0τ), which entangle all the qubits in the circuit, where τ is the evolution time. These entanglers are interleaved with arbitrary single-qubit 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 N-qubit trial states are obtained from the state |00…0〉, applying d entanglers UENT that alternate with N Euler rotations, givingBecause the qubits are all initialized in their ground state |0〉, the first set of Z rotations of Uq,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 H0 can be controlled. However, numerical simulations indicate that accurate optimizations are obtained for fixed-phase entanglers UENT, leaving the p control angles as variational parameters. Our hardware-efficient approach does not rely on the accurate implementation of specific two-qubit gates and can be used with any UENT that generates sufficient entanglement. This is in contrast to unitary coupled-cluster trial states, which require high-fidelity quantum gates that approximate a unitary operator tailored on the basis of a theoretical ansatz. For the experiments considered here, the entanglers UENT are composed of a sequence of two-qubit cross-resonance gates23. 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 software24, 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 single-qubit rotation. The cross-resonance gates that compose UENT are implemented by driving a control qubit Qc with a microwave pulse that is resonant with a target qubit Qt. We use Hamiltonian tomography of these gates to determine the strengths of the various interaction terms, and the gate time for maximal entanglement23. We set our two-qubit 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 post-rotations are applied after trial-state preparation for sampling different Pauli operators (Fig. 1c, d). We group the Pauli operators into tensor product basis sets that require the same post-rotations. 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 fluctuations10. This is crucial for optimizing over many qubits and long depths for trial-state 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 second-quantized fermionic Hamiltonians onto qubits. The Hamiltonian for molecular H2 has four spin orbitals, representing the spin-degenerate 1s orbitals of the two hydrogen atoms. We use a binary tree encoding11 to map the Hamiltonian to a four-qubit system, and remove the two qubits that are associated with the spin parities of the system9. The Hamiltonian for BeH2 is defined on the basis of the 1s, 2s and 2px 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 non-interacting part of the fermionic Hamiltonian. We map the eight-spin-orbital Hamiltonian of BeH2 using parity mapping and, as in the case of H2, remove two qubits associated with the spin–parity symmetries, reducing the Hamiltonian to a six-qubit problem that encodes eight spin orbitals. A similar approach is used to map LiH onto four qubits. The Hamiltonians for H2, LiH and BeH2 at their lowest-energy 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 BeH2 at the interatomic distance of 1.7 Å. Although using a large number of entanglers UENT 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.

Figure 2: Experimental implementation of six-qubit optimization.
Figure 2

The minimum energy of the six-qubit Hamiltonian describing BeH2 with an interatomic distance of l = 1.7 Å (data points) is plotted along with the exact value (black dashed line). For each iteration k, the gradient at each control θk is approximated using 1,000 samples for energy estimation at (blue) and (red), which are perturbations to θk along opposite directions of a random axis in parameter space. The error bars correspond to the standard error of the mean. The inset shows the simultaneous optimization of 30 Euler angles that control the trial state preparation. Each colour refers to a particular qubit (Q1–Q6; q = 1, 2, …), following the colour scheme in Fig. 1. The final energy estimate (green dashed line) is obtained using the average angle over the last 25 angle updates (indicated by the green dotted arrow), to mitigate the effect of stochastic fluctuations, and with a higher number of samples (100,000), to obtain a more accurate energy estimation.

To obtain the potential-energy surfaces for H2, LiH and BeH2, we search for the ground-state 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 ground-state 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 cross-resonance 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 T1 and . In addition to the effects of decoherence and noisy energy estimates, the deviations are also due to low circuit depth for trial-state 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 H2, LiH and BeH2, respectively; critical depths of d = 1, d = 6 and d = 16 are required to achieve chemical accuracy on the respective all-to-all connectivities; see Supplementary Information. By contrast, a generic unitary coupled-cluster ansatz truncated to second order for an eight-orbital molecule such as our model of BeH2 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 hardware-efficient 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 fixed-frequency, all-microwave-controlled qubit architecture. Furthermore, the effect of incoherent errors can be mitigated as recently proposed25,26,27, without requiring additional quantum resources.

Figure 3: Application to quantum chemistry.
Figure 3

ac, Experimental results (black filled circles), exact energy surfaces (dotted lines) and density plots (shading; see colour scales) of outcomes from numerical simulations, for several interatomic distances for H2 (a), LiH (b) and BeH2 (c). The experimental and numerical results presented are for circuits of depth d = 1. The error bars on the experimental data are smaller than the size of the markers. The density plots are obtained from 100 numerical outcomes at each interatomic distance. The top insets in each panel highlight the qubits used for the experiment and the cross-resonance gates (arrows, labelled CRc–t; where ‘c’ denotes the control qubit and ‘t’ the target qubit) that constitute UENT. The bottom insets are representations of the molecular geometry (not to scale). For all the three molecules, the deviation of the experimental results from the exact curves is well explained by the stochastic simulations.

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 four-qubit Heisenberg model on a square lattice, in the presence of an external magnetic field. The model is described by the Hamiltonianwhere 〈ij〉 indicates the nearest-neighbour 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 ions28. We use our technique to solve for the ground-state 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 trial-state preparation. This behaviour is shown in Fig. 4a for J/B = 1. The experimental results are compared with the exact ground-state 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 Mz.

Figure 4: Application to quantum magnetism.
Figure 4

The optimization of a four-qubit Heisenberg model on a square lattice, in an external magnetic field, using circuits of depth d = 0 (blue) and d = 2 (red) for state preparation is compared. a, Energy optimization for J/B = 1 (data points, with dashed lines indicating the final energy estimate, determined as in Fig. 2), plotted along with the exact energy (dashed black line). The inset highlights the qubits used for the experiment and the cross-resonance gates (arrows) that constitute UENT. b, c, Experimental results for d = 0 (blue squares) and d = 2 (red circles) plotted along with exact values (black dashed lines) and density plots of 100 numerical outcomes, for energy (b) and magnetization (c), for a range of values of J/B.

The experiments presented here demonstrate that a hardware-efficient VQE implemented on a six-qubit superconducting quantum processor is capable of addressing molecular problems beyond period I elements, up to BeH2. 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 on-chip qubit connectivity is crucial for reducing the critical depth requirements to achieve chemical accuracy. The use of fast reset schemes29 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 variants30 of the SPSA protocol. Trial-state-preparation circuits, which combine ansatzes from classical approximation methods and hardware-efficient gates, could be investigated further to improve on the current state ansatz. Finally, even before the advent of fault-tolerant architechtures, the agreement of our experimental results with the noise models that we considered opens up a path to error-mitigation protocols for experimentally accessible circuit depths25,26,27.

Data Availability

The data that support the findings of this study are available from the corresponding author on reasonable request.


  1. 1.

    National Energy Research Scientific Computing Center 2015 Annual Report (2015)

  2. 2.

    et al. Towards quantum chemistry on a quantum computer. Nat. Chem. 2, 106–111 (2010)

  3. 3.

    et al. NMR implementation of a molecular hydrogen quantum simulation with adiabatic state preparation. Phys. Rev. Lett. 104, 030502 (2010)

  4. 4.

    et al. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014)

  5. 5.

    et al. Quantum simulation of helium hydride cation in a solid-state spin register. ACS Nano 9, 7769–7774 (2015)

  6. 6.

    et al. Scalable quantum simulation of molecular energies. Phys. Rev. X 6, 031007 (2016)

  7. 7.

    et al. Quantum implementation of the unitary coupled cluster for simulating molecular electronic structure. Phys. Rev. A 95, 020501 (2017)

  8. 8.

    et al. Experimental Bayesian quantum phase estimation on a silicon photonic chip. Phys. Rev. Lett. 118, 100503 (2017)

  9. 9.

    , , & Tapering off qubits to simulate fermionic hamiltonians. Preprint at (2017)

  10. 10.

    Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Trans. Automat. Contr. 37, 332–341 (1992)

  11. 11.

    & Fermionic quantum computation. Ann. Phys. 298, 210–226 (2002)

  12. 12.

    , & The complexity of the local Hamiltonian problem. SIAM J. Comput. 35, 1070–1097 (2006)

  13. 13.

    & Simulation of many-body Fermi systems on a universal quantum computer. Phys. Rev. Lett. 79, 2586–2589 (1997)

  14. 14.

    , , & Simulated quantum computation of molecular energies. Science 309, 1704–1707 (2005)

  15. 15.

    Quantum measurements and the Abelian stabilizer problem. Preprint at (1995)

  16. 16.

    , & A quantum approximate optimization algorithm. Preprint at (2014)

  17. 17.

    , , & Quantum algorithms for fixed qubit architectures. Preprint at (2017)

  18. 18.

    et al. From transistor to trapped-ion computers for quantum chemistry. Sci. Rep. 4, 3589 (2014)

  19. 19.

    , , & The theory of variational hybrid quantum-classical algorithms. New J. Phys. 18, 023023 (2016)

  20. 20.

    , & Progress towards practical quantum variational algorithms. Phys. Rev. A 92, 042303 (2015)

  21. 21.

    et al. Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz. Preprint at (2017)

  22. 22.

    et al. Tunable superconducting qubits with flux-independent coherence. Preprint at (2017)

  23. 23.

    , , & Procedure for systematically tuning up cross-talk in the cross-resonance gate. Phys. Rev. A 93, 060302 (2016)

  24. 24.

    , , , & Efficient Z-gates for quantum computing. Preprint at (2017)

  25. 25.

    , , & Hybrid quantum-classical hierarchy for mitigation of decoherence and determination of excited states. Phys. Rev. A 95, 042308 (2017)

  26. 26.

    & Efficient variational quantum simulator incorporating active error minimisation. Phys. Rev. X 7, 021050 (2017)

  27. 27.

    , & Error mitigation for short depth quantum circuits. Preprint at (2017)

  28. 28.

    et al. Universal digital quantum simulation with trapped ions. Science 334, 57–61 (2011)

  29. 29.

    et al. Active resonator reset in the nonlinear dispersive regime of circuit QED. Phys. Rev. Appl. 6, 034008 (2016)

  30. 30.

    Adaptive stochastic approximation by the simultaneous perturbation method. IEEE Trans. Automat. Contr. 45, 1839–1853 (2000)

Download references


We thank J. Chavez-Garcia, 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 W911NF-10-1-0324.

Author information

Author notes

    • Abhinav Kandala
    •  & Antonio Mezzacapo

    These authors contributed equally to this work.


  1. 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


  1. Search for Abhinav Kandala in:

  2. Search for Antonio Mezzacapo in:

  3. Search for Kristan Temme in:

  4. Search for Maika Takita in:

  5. Search for Markus Brink in:

  6. Search for Jerry M. Chow in:

  7. Search for Jay M. Gambetta in:


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. 1.

    Supplementary Information

    This file contains supplementary Text, Supplementary Figures 1-9 and additional references.

About this article

Publication history






Further reading


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.