A Variational Eigenvalue Solver On A Quantum Processor
A Variational Eigenvalue Solver On A Quantum Processor
of a given eigenvector but requires fully coherent evolution. We present an alternative approach
that greatly reduces the requirements for coherent evolution and we combine this method with a
new approach to state preparation based on ansätze and classical optimization. We have imple-
mented the algorithm by combining a small-scale photonic quantum processor with a conventional
computer. We experimentally demonstrate the feasibility of this approach with an example from
quantum chemistry—calculating the ground state molecular energy for He–H+, to within chem-
ical accuracy. The proposed approach, by drastically reducing the coherence time requirements,
enhances the potential of the quantum resources available today and in the near future.
In chemistry, the properties of atoms and molecules can ments for coherent evolution. We have developed a re-
be determined by solving the Schrödinger equation. How- configurable quantum processing unit (QPU), which effi-
ever, because the dimension of the problem grows expo- ciently calculates the expectation value of a Hamiltonian
nentially with the size of the physical system under con- (H), providing an exponential speedup over conventional
sideration, exact treatment of these problems remains methods. The QPU is combined with an optimization al-
classically infeasible for compounds with more than 2–3 gorithm run on a classical processing unit (CPU), which
atoms [1]. Many approximate methods [1] have been de- variationally computes the eigenvalues and eigenvectors
veloped to treat these systems, but efficient exact meth- of H. By using a variational algorithm, this approach
ods for large chemical problems remain out of reach for reduces the requirement for coherent evolution of the
classical computers. Beyond chemistry, the solution of quantum state, making more efficient use of quantum
large eigenvalue problems [3] would have applications resources, and may offer an alternative route to practical
ranging from determining the results of internet search quantum-enhanced computation.
engines [4] to designing new materials and drugs [5]. Algorithm 1: Quantum expectation estimation
Recent developments in the field of quantum compu- This algorithm computes the expectation value of a given
tation offer a way forward for efficient solutions of many Hamiltonian H for an input state |ψi. Any Hamiltonian
instances of large eigenvalue problems which are classi- may be written as
cally intractable [6–12]. Quantum approaches to finding X X
eigenvalues have previously relied on the quantum phase H= hiα σαi + hij i j
αβ σα σβ + ... (1)
iα ijαβ
estimation (QPE) algorithm. The QPE algorithm offers
an exponential speedup over classical methods and re-
for real h where Roman indices identify the subspace on
quires a number of quantum operations O(1/p) to obtain
which the operator acts, and Greek indices identify the
an estimate with precision p [13–18]. In the standard
Pauli operator, e.g. α = x. By exploiting the linearity of
formulation of QPE, one assumes the eigenvector |ψi of
quantum observables, it follows that
a Hermitian operator H is given as input and the prob-
lem is to determine the corresponding eigenvalue λ. The X X
time the quantum computer must remain coherent is de- hHi = hiα hσαi i + hij i j
αβ hσα σβ i + ... (2)
iα ijαβ
termined by the necessity of O(1/p) successive applica-
tions of e−iHt , each of which can require on the order of
We consider Hamiltonians that can be written as a num-
millions or billions of quantum gates for practical appli-
ber of terms which is polynomial in the size of the sys-
cations [17, 19], as compared to the tens to hundreds of
tem. This class of Hamiltonians encompasses a wide
gates achievable in the short term.
range of physical systems, including the electronic struc-
Here we introduce and experimentally demonstrate an ture Hamiltonian of quantum chemistry, the quantum
alternative to QPE that significantly reduces the require- Ising Model, the Heisenberg Model [20, 21], matrices that
2
Algorithm 2
Algorithm 1
QPU CPU
classical adder
quantum module 2
quantum module 3
quantum module n
FIG. 1. Architecture of the quantum-variational eigensolver. Algorithm 1: Quantum states that have been previously
prepared, are fed into the quantum modules which compute hHi i, where Hi is any given term in the sum defining H. The
results are passed to the CPU which computes hHi. Algorithm 2: The classical minimization algorithm, run on the CPU,
takes hHi and determines the new state parameters, which are then fed back to the QPU.
are well approximated as a sum of n-fold tensor prod- O(1). In essence, we dramatically reduce the coherence
ucts [5, 22], and more generally any k−sparse Hamilto- time requirement while maintaining an exponential ad-
nian without evident tensor product structure (see Ap- vantage over the classical case, by adding a polynomial
pendix for details). Thus the evaluation of hHi reduces number of repetitions with respect to QPE.
to the sum of a polynomial number of expectation val- Algorithm 2: Quantum variational eigensolver
ues of simple Pauli operators for a quantum state |ψi, The procedure outlined above replaces the long coher-
multiplied by some real constants. A quantum device ent evolution required by QPE by many short coherent
can efficiently evaluate the expectation value of a tensor evolutions. In both QPE and Algorithm 1 we require a
product of an arbitrary number of simple Pauli opera- good approximation to the ground state wavefunction to
tors [5], therefore with an n-qubit state we can efficiently compute the ground state eigenvalue and we now consider
evaluate the expectation value of this 2n × 2n Hamilto- this problem. Previous approaches have proposed to pre-
nian. pare ground states by adiabatic evolution [15], or by the
One might attempt this using a classical computer quantum metropolis algorithm [25]. Unfortunately both
by separately optimizing all reduced states correspond- of these require long coherent evolution. Algorithm 2 is a
ing to the desired terms in the Hamiltonian, but this variational method to prepare the eigenstate and, by ex-
would suffer from the N -representability problem, which ploiting Algorithm 1, requires short coherent evolution.
is known to be intractable for both classical and quantum Algorithm 1 and 2 and their relationship are shown in
computers (it is in the quantum complexity class QMA- Fig. 1 and detailed in the Appendix.
Hard [24]). The power of our approach derives from the It is well known that the eigenvalue problem for an
fact that quantum hardware can store a global quantum observable represented by an operator H can be re-
state with exponentially fewer resources than required by stated as a variational problem on the Rayleigh-Ritz quo-
classical hardware, and as a result the N-representability tient [26, 27], such that the eigenvector |ψi corresponding
problem does not arise. to the lowest eigenvalue is the |ψi that minimizes
As the expectation value of a tensor product of an arbi- hψ| H |ψi
trary number of Pauli operators can be measured in con- . (3)
hψ|ψi
stant time and the spectrum of each of these operators is
bounded, to obtain an estimate with precision p, our ap- By varying the experimental parameters in the prepa-
proach incurs a cost of O(|h|2 /p2 ) repetitions. Thus the ration of |ψi and computing the Rayleigh-Ritz quotient
total cost of computing the expectation value of a state using Algorithm 1 as a subroutine in a classical mini-
|ψi is given by O(|hmax |2 M/p2 ), where M is the number mization, one may prepare unknown eigenvectors. At
of terms in the decomposition of the Hamiltonian. The the termination of the algorithm, a simple prescription
advantage of this approach is that the coherence time to for the reconstruction of the eigenvector is stored in the
make a single measurement after preparing the state is final set of experimental parameters that define |ψi.
3
(a)
QPU CPU
dc6 Optimization
D1 algorithm
dc1 dc2 dc9 dc10
D2
dc7
D3
dc3 dc4 dc5 dc11 dc12 dc13
D4
dc8
(b)
from CPU
from SPDC
source to detectors
QPU
1 cm
FIG. 2. Experimental implementation of our scheme. (a) Quantum state preparation and measurement of the expectation
values hψ|σi ⊗ σj |ψi are performed using a quantum photonic chip. Photon pairs, generated using spontaneous parametric
down-conversion are injected into the waveguides encoding the |00i state. The state |ψi is prepared using thermal phase shifters
φ1−8 (orange rectangles) and one CNOT gate and measured using photon detectors. Coincidence count rates from the detectors
D1−4 are passed to the CPU running the optimization algorithm. This computes the set of parameters for the next state and
writes them to the quantum device. (b) A photograph of the QPU.
If a quantum state is characterized by an exponentially The unitary version of this ansatz is thought to yield
large number of parameters, it cannot be prepared with superior results to even this “gold standard” [4]. Details
a polynomial number of operations. The set of efficiently of efficient construction of the unitary coupled cluster
preparable states are therefore characterized by polyno- state using a quantum device are given in the Appendix
mially many parameters, and we choose a particular set (see also Ref. [29]).
of ansatz states of this type. Under these conditions, a Prototype demonstration
classical search algorithm on the experimental parame- We have implemented the QPU using integrated quan-
ters which define |ψi, needs only explore a polynomial tum photonics technology [30]. Our device, shown
number of dimensions—a requirement for the search to schematically in Fig. 2 is a reconfigurable waveguide chip
be efficient. that implements several single qubit rotations and one
One example of a quantum state parametrized by a two-qubit entangling gate and can prepare an arbitrary
polynomial number of parameters is the unitary coupled two-qubit pure state. This device operates across the
cluster ansatz [4] full space of possible configurations with mean statisti-
† cal fidelity F > 99% [31]. The state is prepared, and
|Ψi = eT −T |Φiref (4) measured in the Pauli basis, by setting 8 voltage driven
where T is the cluster operator (defined in the Appendix ) phase shifters and counting photon detection events with
and |Φiref is some reference state, normally taken to be silicon single photon detectors.
the Hartree-Fock ground state. There is currently no The ability to prepare an arbitrary two-qubit separable
known efficient classical algorithm based on these ansatz or entangled state enables us to investigate 4 × 4 Hamil-
states. However, non-unitary coupled cluster ansatz is tonians. For the experimental demonstration of our al-
sometimes referred to as the “gold standard of quantum gorithm we choose a problem from quantum chemistry,
chemistry” as it is the standard of accuracy to which namely determining the bond dissociation curve of the
other methods in quantum chemistry are often compared. molecule He-H+ in a minimal basis. The full configura-
4
(a) −0.5 1
20
−1.5
Energy (MJ mol
Tangle
−10
0 100 200 300 400
−2
Atomic separation R (pm)
−2.4
−2.5
−2.5
0 20 40 60 80 100 −2.6
Optimization step j
−2.7
(b) 1
0.8 −2.8
State overlap
0.6
0.4 −2.9
molecular system in the same basis. More than 96% of to the number of terms in the Hamiltonian. While the
the experimental data are within chemical accuracy with effect of errors on each of these calculations is the same
respect to the theoretical values. At the conclusion of as in QPE, the reliance on a number of separate calcula-
the optimization, we retain full knowledge of the exper- tions makes the algorithm sensitive to variations in state
imental parameters, which can be used for efficient re- preparation between the separate quantum calculations.
construction of the state |ψi in the event that additional This effect requires further investigation. In Algorithm 2,
physical or chemical properties are required. we experimentally implemented a ground state prepara-
Discussion tion procedure through a direct variational algorithm on
Algorithm 1 uses relatively few quantum resources com- the control parameters of the quantum hardware. Larger
pared to QPE. Broadly speaking, QPE requires a large calculations will require a choice of ansatz, for which
number of n-qubit quantum controlled operations to be there are two possibilities. One could experimentally im-
performed in series—placing considerable demands on plement chemically motivated ansätze such as the uni-
the number of components and coherence time—while tary coupled cluster method described in the Appendix.
the inherent parallelism of our scheme enables a small Alternatively one could pursue those ansätze that are
number of n-qubit gates to be exploited many times, most easy to implement experimentally—creating a new
drastically reducing these demands. Moreover, adding set of device ansätze states which would require classi-
control to arbitrary unitary operations in practice is dif- fication in terms of their overlap with chemical ground
ficult if not impossible for current quantum architectures states. Such a classification would be a good way to
(although a proposed scheme to add control to arbitrary determine the value of a given experimental advance—
unitary operations has recently been demonstrated [34]). for ground state problems it is best to focus limited
To give a numerical example, the QPE circuit for a 4 experimental resources on those efforts that will most
x 4 Hamiltonian such as that demonstrated here would enhance the overlap of preparable states with chemical
require at least 12 CNOT gates, while our method only ground states. In addition to the above issues, which we
requires one. leave to future work, an interesting avenue of research is
In implementing Algorithm 2, the device prepares to ask whether the conceptual approach described here
ansatz states that are defined by a polynomial set of could be used to address other intractable problems with
parameters. This ansatz might be chosen based on quantum-enhanced computation. Examples that can be
knowledge of the physical system of interest (as for the mapped to the ground state problem, and where the n-
unitary coupled cluster and typical quantum chemistry representability problem does not occur, include search
ansätze) thus determining the device design. However, engine optimisation and image recognition. It should
our architecture allows for an alternative, and poten- be noted that the approach presented here requires no
tially more promising approach, where the device is first control or auxiliary qubits, relying only on measurement
constructed based on the available resources and we de- techniques that are already well established. For exam-
fine the set of states that the device can prepare as the ple, in the two qubit case, these measurements are iden-
“device ansatz”. Due to the quantum nature of the de- tical to those performed in Bell inequality experiments.
vice, this ansatz can be very distinct from those used Quantum simulators with only a few tens of qubits are
in traditional quantum chemistry. With this alterna- expected to outperform the capabilities of conventional
tive approach the physical implementation is then given computers, not including open questions regarding fault
by a known sequence of quantum operations with ad- tolerance and errors/precision. Our scheme would allow
justable parameters—determined at the construction of such devices to be implemented using dramatically less
the device—with a maximum depth fixed by the coher- resources than the current best known approach.
ence time of the physical qubits. This approach, while ap-
proximate, provides a variationally optimal solution for
the given quantum resources and may still be able to pro-
vide qualitatively correct solutions, just as approximate ∗
These authors contributed equally to this work.
methods do in traditional quantum chemistry (for exam-
[1] L. Thogersen and J. Olsen, Chem. Phys. Lett. 393, 36
ple Hartree Fock). The unitary coupled cluster ansatz (2004).
(Eq. 4) provides a concrete example where our approach [1] T. Helgaker, P. Jorgensen, and J. Olsen, Molecular Elec-
provides an exponential advantage over known classical tronic Structure Theory (Wiley, Sussex, 2002).
techniques. [3] Y. Saad, Numerical methods for large eigenvalue prob-
We have developed and experimentally implemented lems, Vol. 158 (SIAM, 1992).
[4] L. Page, S. Brin, R. Motwani, and T. Winograd, (1999).
a new approach to solving the eigenvalue problem with
[5] G. H. Golub and H. A. van der Vorst, J. Comput. Appl.
quantum hardware. Algorithm 1 shares with QPE the Math. 123, 35 (2000).
need to prepare a good approximation to the ground [6] M. A. Nielsen and I. L. Chuang, Quantum Computation
state, but replaces a single long coherent evolution by and Quantum Information, edited by C. S. o. Information
a number of shorter coherent calculations proportional and t. N. Sciences (Cambridge University Press, 2000).
6
where repeated indices imply summation as in the main efficient algorthim for finding the locations and values of
text, and higher order terms follow logically. It is clear the non-zero matrix elements in each row of H.
that by construction the operator (T − T † ) is anti- Let H be a 2n × 2n k−sparse row-computable Hamil-
hermitian, and exponentiation maps it to a unitary op-
† Pm et al. [8] shows that H may be
tonian. A result by Berry
erator U = e(T −T ) . For any fixed excitation level k, the decomposed as H = j=1 Hj with m = 6k 2 , Hj being
reduced cluster operator is written as a 1−sparse matrix and each Hj may be efficiently simu-
lated (e−iHj t may be acted on the qubits) by making only
k
(k)
X O(log∗ n) queries to the Hamiltonian H. Alternatively, a
T = Ti (16) more recent result by Childs et al. [9] has found that it
i=1
possible to use a star decomposition of the Hamiltonian
Unfortunately, in general no efficient implementation of such that m = 6k and each Hj is now a galaxy which can
this ansatz has yet been developed for a classical com- be efficiently simulated using O(k+log∗ N ) queries to the
puter, even for low order cluster operators due to the Hamiltonian. Either of these schemes may be used to im-
non-truncation of the BCH series [4]. The reduced anti- plement our algorithm efficiently for a general k−sparse
hermitian cluster operator (T (k) − T (k)† ) is the sum of matrix, and the choice may be allowed to depend on the
a polynomial number of terms in the number of one particular setup available. Following a prescription by
electron basis functions, namely it contains a number of Knill et al. [10], the ability to simulate Hj is sufficient
terms O(N k (M − N )k ) where M is the number of sin- for efficient measurement of the expectation value hHj i.
gle particle orbitals. By defining an effective Hermitian After determining these values, one may proceed as be-
Hamiltonian H = i(T (k) − T (k)† ) and performing the fore in the algorithm as outlined in the main text and
Jordan-Wigner transformation to reach a Hamiltonian use them to determine new parameters for the classical
that acts on the space of qubits, H̃, we are left with a minimization.
Hamiltonian which is a sum of polynomially many prod-
ucts of Pauli operators. The problem then reduces to Classical optimization algorithm
the quantum simulation of this effective Hamiltonian, H̃, For the classical optimization step of our integrated
which can be done in polynomial time using the proce- processor we implemented the Nelder-Mead (NM) algo-
dure outlined by Ortiz et al. [5]. This represents one rithm [11], a simplex-based direct search (DS) method
example of a state which can be efficiently prepared on a for unconstrained minimization of objective functions.
quantum device, which cannot be efficiently prepared by Although in general NM can fail because of the dete-
any known means on a classical computer. rioration of the simplex geometry or lack of sufficient
decrease, the convergence of this method can be greatly
Finding excited states improved by adopting a restarting strategy. Although
Frequently, one may be interested in eigenvectors and other DS methods, such as the gradient descent, can per-
eigenvalues related to excited states (interior eigenval- form better for smooth functions, these are not robust to
ues). Fortunately our scheme can be used with only mi- the noise which makes the objective function non-smooth
nor modification to find these excited states by repeating under experimental conditions. NM has the ability to
the procedure on Hλ = (H − λ)2 . The folded spectrum explore neighboring valleys with better local optima and
method [6, 7] allows a variational method to converge likewise this exploring feature usually allows NM to over-
to the eigenvector closest to the shift parameter λ. By come non-smoothnesses. We verified that the gradient
scanning through a range of λ values, one can recover descent minimization algorithm is not able to converge
the eigenvectors and eigenvalues of interest. Although to the ground state of our Hamiltonian under the experi-
this operation incurs a small polynomial overhead —the mental conditions, mainly due to the poissonian nature of
number of terms in the Hamiltonian is quadratic with our photon source and the accidental counts of the detec-
respect to the original Hamiltonian— this extra cost is tion system, while NM converged to the global minimum
marginal compared to the cost of solving the problem in most optimization runs.
classically.
Computational Scaling
Application to k−sparse Hamiltonians In this section, we demonstrate the polynomial scaling
The method described in the main body of this work of each iteration of our algorithm with respect to system
may be applied to general k−sparse Hamiltonian ma- size, and contrast that with the exponential scaling of
trices which are row-computable even when no efficient the current best-known classical algorithm for the same
tensor decomposition is evident with only minor modi- task. Suppose that the algorithm has progressed to an
fication. A Hamiltonian H is referred to as k−sparse if iteration j in which we have prepared a state vector |ψ j i
there are at most k non-zero elements in each row and which is stored in n qubits and parameterized by the set
column of the matrix and row computable if there is an of parameters {θij }.
9
ration of the state |ψi. This results in a shift of the duty-cycle of ∼ 5%. The purpose of this is to overcome
measured energy hψ| H |ψi. Higher order terms could be instability of the fibre-to-chip coupling due to thermal
effectively eliminated by use of true single photon sources expansion of the chip during operation. This will not be
(such as quantum dots or nitrogen vacancy centers in di- an issue in future implementations where fibres will be
amond), and there is no fundamental limit to the degree permanently fixed to the chip’s facets. Moreover the ther-
of indistinguishability which can be achieved through im- mal phase shifters used here will also likely be replaced by
proved state engineering. alternative technologies based on the electro-optic effect.
Secondly, imperfections in the implementation of the Brighter single photon sources will considerably reduce
photonic circuit also reduce the fidelity with which |ψi the measurement time.
is prepared and measured. Small deviations from de-
signed beamsplitter reflectivities and interferometer path
lengths, as well as imperfections in the calibration of
voltage-controlled phases shifters used to manipulate the ∗
These authors contributed equally to this work.
state, all contribute to this effect. However, these are
[1] T. Helgaker, P. Jorgensen, and J. Olsen, Molecular Elec-
technological limitations that can be greatly improved in tronic Structure Theory (Wiley, Sussex, 2002).
future realizations. [2] P. Jordan and E. Wigner, Zeitschrift für Physik 47, 631
Finally, unbalanced input and output coupling effi- (1928).
ciency also results in skewed two-photon statistics, again [3] T. D. Crawford, C. D. Sherrill, E. F. Valeev, J. T. Fer-
shifting the measured expectation value of hHi. mann, R. A. King, M. L. Leininger, S. T. Brown, C. L.
Janssen, E. T. Seidl, J. P. Kenny, and W. D. Allen, J.
Another systematic effect that can be noted in Fig. Comp. Chem. 28, 1610 (2007).
4 is that the magnitude of the error on the experimen- [4] A. G. Taube and R. J. Bartlett, Int. J. Quant. Chem.
tal estimation of the ground state energy increases with 106, 3393 (2006).
R. This is due to the fact that as R increases, the first [5] G. Ortiz, J. E. Gubernatis, E. Knill, and R. Laflamme,
and second excited eigenstates of this Hamiltonian be- Phys. Rev. A 64, 022319 (2001).
come degenerate, resulting in increased difficulty for the [6] J. K. L. MacDonald, Phys. Rev. 46, 828 (1934).
[7] L.-W. Wang and A. Zunger, J. Chem. Phys. 100, 2394
classical minimization, generating mixtures of states that
(1994).
increases the overall variance of the estimation. [8] D. Berry, G. Ahokas, R. Cleve, and B. Sanders, Comm.
Math. Phys. 270, 359 (2007).
Count rate [9] A. Childs and R. Kothari, in Theory of Quantum Com-
In our experiment the mean count rate, which directly putation, Communication, and Cryptography, Lecture
Notes in Computer Science, Vol. 6519, edited by W. Dam,
determines the statistical error, was approximately 2000-
V. Kendon, and S. Severini (Springer Berlin Heidelberg,
4000 twofold events per second. For example, for the 2011) pp. 94–103.
bond dissociation curve we measured about 100 points [10] E. Knill, G. Ortiz, and R. D. Somma, Phys. Rev. A 75,
per optimization run. The expectation value of a given 012328 (2007).
Hamiltonian was reconstructed at each point from four [11] J. A. Nelder and R. Mead, The Computer Journal 7, 308
two-qubit Pauli measurements. In the full dissociation (1965).
curve we found the ground states of 79 Hamiltonians. [12] R. Fletcher, Practical methods of optimization, 2nd ed.
(Wiley-Interscience, New York, NY, USA, 1987).
Hence the full experiment was performed in about 158
[13] J. Kempe, A. Kitaev, and O. Regev, SIAM J. Comput.
hours. 35, 1070 (2006).
State preparation is relatively fast, requiring a few mil- [14] A. R. Conn, N. I. Gould, and P. L. Toint, Trust re-
liseconds to set the phases on the chip. However 17 gion methods, Vol. 1 (Society for Industrial Mathematics,
seconds are required for cooling the chip, resulting in a 1987).