+ All Categories
Home > Documents > arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the...

arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the...

Date post: 18-Jan-2021
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
9
Collective optimization for variational quantum eigensolvers Dan-Bo Zhang 1, * and Tao Yin 2, 1 Guangdong Provincial Key Laboratory of Quantum Engineering and Quantum Materials, GPETR Center for Quantum Precision Measurement, SPTE, South China Normal University, Guangzhou 510006, China 2 Yuntao Quantum Technologies, Shenzhen, 518000, China Variational quantum eigensolver (VQE) optimizes parameterized eigenstates of a Hamiltonian on a quantum processor by updating parameters with a classical computer. Such a hybrid quantum- classical optimization serves as a practical way to leverage up classical algorithms to exploit the power of near-term quantum computing. Here, we develop a hybrid algorithm for VQE, emphasizing the classical side, that can solve a group of related Hamiltonians simultaneously. The algorithm incorporates a snake algorithm into many VQE tasks to collectively optimize variational parameters of different Hamiltonians. Such so-called collective VQEs (cVQEs) is applied for solving molecules with varied bond length, which is a standard problem in quantum chemistry. Numeral simulations show that cVQE is not only more efficient in convergence, but also trends to avoid single VQE task to be trapped in local minimums. The collective optimization utilizes intrinsic relations between related tasks and may inspire advanced hybrid quantum-classical algorithms for solving practical problems. I. INTRODUCTION Quantum computing exploits intrinsic quantum prop- erties for computing. It promises to solve some outstand- ing problems with quantum advantages[16], and is influ- encing a broad of computational intensive areas, such as quantum simulation [1, 79] and machine learning [10]. A variational approach for quantum computing sets pa- rameters in a quantum circuit, and learn those parame- ters through hybrid quantum-classical optimization [1127]. Such an approach is well suited for near-term quan- tum processor, and receives lots of attention in recent years [28]. Among them, variational quantum eigensolver (VQE) aims to solve eigenvalues and eigenstates for quan- tum systems [11, 13, 18, 19, 29]. The power of represent- ing exponentially large wavefunction on quantum proces- sors and effective hybrid quantum-classical optimization of VQE enhances the ability to solve hard quantum prob- lems. In many practical problems, a group of related Hamil- tonians needs to be solved. For instance, molecule elec- tronic Hamiltonians under different bond lengths or an- gles, or quantum many-body systems with different inter- acting strengths. VQE can solve such a group of Hamil- tonians one by one independently, without taking advan- tage of previous results. However, those tasks are mostly similar and related to each other, such that one can ex- ploit intrinsic relations for more efficient optimization that can require less quantum resources or avoid local minimums for single tasks. This is also related to meta learning that draws prior experience for new tasks [3032]. In this paper, we propose a hybrid quantum-classical algorithm that can provide a collective optimization for * [email protected] [email protected] VQE to solve a group of related Hamiltonians simulta- neously. It evaluates gradients on the quantum proces- sor and updates variational parameters on the classical computer. Remarkably, the updating process general- izes typically gradient descent into a collective version, which updates variational parameters of different Hamil- tonians simultaneously. This is achieved by a snake al- gorithm [33, 34], originally developed in computer vi- sion [33], which enforces a smooth condition on varia- tional parameters of different Hamiltonians. We call this collective VQE or cVQE. As demonstrations, we use the cVQE to solve ground-state energies for several molecules at different bond lengths. The advantages of collective optimization are investigated and shown through the flow of variational parameters. Remarkably, the snake algo- rithm is revealed as a global optimizer, as collective mo- tion of parameters for different tasks can pull a point of parameters for a single Hamiltonian out of traps of local minimums. The paper is organized as follows. In Sec. II, we re- view variational quantum eigensolver, and then propose cVQE using the snake algorithm. In Sec. III, we present results of several representative molecules using cVQE. In Sec. IV, we investigate the snake algorithm as a global optimizer. Finally, we give some further discussions and a brief summary. II. OPTIMIZATION FOR VARIATIONAL QUANTUM EIGENSOLVERS Solving eigenvalues and eigenstates for a given Hamil- tonian is a basic task. Quantum computers provide an avenue for solving eigenstate problems of quantum systems effectively. Different quantum algorithms have been developed for tracking this hard problem, such as quantum phase estimation [35], variational quantum eigensolver [11, 13], simulating resonance transition of arXiv:1910.14030v1 [quant-ph] 30 Oct 2019
Transcript
Page 1: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

Collective optimization for variational quantum eigensolvers

Dan-Bo Zhang1, ∗ and Tao Yin2, †

1Guangdong Provincial Key Laboratory of Quantum Engineering and Quantum Materials,GPETR Center for Quantum Precision Measurement, SPTE,South China Normal University, Guangzhou 510006, China2Yuntao Quantum Technologies, Shenzhen, 518000, China

Variational quantum eigensolver (VQE) optimizes parameterized eigenstates of a Hamiltonian ona quantum processor by updating parameters with a classical computer. Such a hybrid quantum-classical optimization serves as a practical way to leverage up classical algorithms to exploit thepower of near-term quantum computing. Here, we develop a hybrid algorithm for VQE, emphasizingthe classical side, that can solve a group of related Hamiltonians simultaneously. The algorithmincorporates a snake algorithm into many VQE tasks to collectively optimize variational parametersof different Hamiltonians. Such so-called collective VQEs (cVQEs) is applied for solving moleculeswith varied bond length, which is a standard problem in quantum chemistry. Numeral simulationsshow that cVQE is not only more efficient in convergence, but also trends to avoid single VQE taskto be trapped in local minimums. The collective optimization utilizes intrinsic relations betweenrelated tasks and may inspire advanced hybrid quantum-classical algorithms for solving practicalproblems.

I. INTRODUCTION

Quantum computing exploits intrinsic quantum prop-erties for computing. It promises to solve some outstand-ing problems with quantum advantages[1–6], and is influ-encing a broad of computational intensive areas, such asquantum simulation [1, 7–9] and machine learning [10].A variational approach for quantum computing sets pa-rameters in a quantum circuit, and learn those parame-ters through hybrid quantum-classical optimization [11–27]. Such an approach is well suited for near-term quan-tum processor, and receives lots of attention in recentyears [28]. Among them, variational quantum eigensolver(VQE) aims to solve eigenvalues and eigenstates for quan-tum systems [11, 13, 18, 19, 29]. The power of represent-ing exponentially large wavefunction on quantum proces-sors and effective hybrid quantum-classical optimizationof VQE enhances the ability to solve hard quantum prob-lems.

In many practical problems, a group of related Hamil-tonians needs to be solved. For instance, molecule elec-tronic Hamiltonians under different bond lengths or an-gles, or quantum many-body systems with different inter-acting strengths. VQE can solve such a group of Hamil-tonians one by one independently, without taking advan-tage of previous results. However, those tasks are mostlysimilar and related to each other, such that one can ex-ploit intrinsic relations for more efficient optimizationthat can require less quantum resources or avoid localminimums for single tasks. This is also related to metalearning that draws prior experience for new tasks [30–32].

In this paper, we propose a hybrid quantum-classicalalgorithm that can provide a collective optimization for

[email protected][email protected]

VQE to solve a group of related Hamiltonians simulta-neously. It evaluates gradients on the quantum proces-sor and updates variational parameters on the classicalcomputer. Remarkably, the updating process general-izes typically gradient descent into a collective version,which updates variational parameters of different Hamil-tonians simultaneously. This is achieved by a snake al-gorithm [33, 34], originally developed in computer vi-sion [33], which enforces a smooth condition on varia-tional parameters of different Hamiltonians. We call thiscollective VQE or cVQE. As demonstrations, we use thecVQE to solve ground-state energies for several moleculesat different bond lengths. The advantages of collectiveoptimization are investigated and shown through the flowof variational parameters. Remarkably, the snake algo-rithm is revealed as a global optimizer, as collective mo-tion of parameters for different tasks can pull a point ofparameters for a single Hamiltonian out of traps of localminimums.

The paper is organized as follows. In Sec. II, we re-view variational quantum eigensolver, and then proposecVQE using the snake algorithm. In Sec. III, we presentresults of several representative molecules using cVQE. InSec. IV, we investigate the snake algorithm as a globaloptimizer. Finally, we give some further discussions anda brief summary.

II. OPTIMIZATION FOR VARIATIONALQUANTUM EIGENSOLVERS

Solving eigenvalues and eigenstates for a given Hamil-tonian is a basic task. Quantum computers providean avenue for solving eigenstate problems of quantumsystems effectively. Different quantum algorithms havebeen developed for tracking this hard problem, suchas quantum phase estimation [35], variational quantumeigensolver [11, 13], simulating resonance transition of

arX

iv:1

910.

1403

0v1

[qu

ant-

ph]

30

Oct

201

9

Page 2: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

2

molecules on quantum processors [36, 37]. The VQE ap-proach uses a parameterized quantum circuit to preparea wavefunction. The parameters are obtained by opti-mizing the energy with the hybrid quantum-classical al-gorithm.

To solve quantum systems on a quantum computer,it is necessary to firstly map the original Hamiltonianin a qubit (spin-half) Hamiltonian. For electronic sys-tems, a nonlocal transformation such as Jordan-Wignertransformation [38] or Bravyi-Kitaev transformation [39],is required to firstly transform fermionic operators intoPauli operators. For a quantum system of interest (e.g.,molecules), the resulting qubit Hamiltonian typically hasmany terms,

H =∑i

ciHi, (1)

where Hi can be written as a tensor product of Pauli ma-trices, Hi = ⊗kσαk

k . Here αk = x, y, z and k the index ofqubits. We now discuss how to solve a single Hamiltonianand a group of related Hamiltonians, respectively.

A. Optimization by gradient descent

To find the eigenstate for a single H, one can usean ansatz |ψ(θ)〉 = U(θ)|ψ0〉 to represent a candidateground state. Here |ψ0〉 is an initial state as a goodclassical approximation as the ground state of H. Forinstance, |ψ0〉 can be chosen as a Hartee-Fock state inquantum chemistry. U(θ) is an unitary operator pa-rameterized with θ, which can take quantum correlationinto consideration. As a variational method, the essentialtask is to find parameters θ0 that minimizes the energyE(θ) = 〈ψ(θ)|H|ψ(θ)〉. The optimization is a hybridquantum-classical one: the quantum processor runs thequantum circuit and performs measurements to evaluateE(θ); the classical computer updates parameters θ ac-cording to received data from the quantum processor. Toobtain a quantum average of H, one can perform mea-surements for each term Hi, as it is a tensor productof Pauli matrices thus corresponds to a joint measure-ment on multi-qubits. Measurements of all terms thenare added,

E(θ) =∑i

ci〈ψ(θ)|Hi|ψ(θ)〉. (2)

Optimization methods for updating parameters θ in gen-eral can be categorized as gradient free [19, 23], such asNelder-Mead method, and gradient descent [18, 27, 29].Gradient descent methods update parameters using in-formation of gradients. On a quantum processor, cal-culating gradient with respect to a target cost function(here is E(θ)) can be obtained with the same quantumcircuit, using the shift rule [40, 41] or numeral differential.Then parameters θ are updated with gradient descent as

θt = θt−1 − η ∂∂θE(θt−1), (3)

where η is the learning rate or step size.

B. Collective optimization

In the above, variational quantum eigensolver solvesthe eigenvalue problem for a single Hamiltonian. In prac-tice, there may be a group of Hamiltonians to be solved.For instance, what is needed in quantum chemistry usu-ally is a potential surface, corresponding to ground stateenergies for a molecule at different bond lengths or bondangles. Of course, one can use VQE to solve Hamiltoni-ans one by one. However, this does not exploit relationsbetween Hamiltonians. Here, we develop a more efficientmethod that can collectively optimize all variational gateparameters for different Hamiltonians at the same time.

The motivation behind collective optimization can bepresented as follows. Consider quantum chemistry prob-lems. Two Hamiltonians should be close to each other iftheir underlying molecules are the same and bond lengthsvary a little. In such a case, the same ansatz can be ap-plied, and it is expected that optimized parameters ofwavefunction should be very close to each other. De-noted θ0(λ) as the optimized parameter for HamiltonianH(λ), then θ0(λ) ∼ λ should form a continuous curve inthe space of θ and λ, which we call as enlarged parameterspace. We expect that the optimization of one Hamilto-nian can help optimize other Hamiltonians with nearbysystem parameters λ. We use gradient descent for theoptimization. Instead of updating a single point in theparameter space, the optimization updates a sequence ofpoints in the enlarged parameter space, each point corre-sponding to a Hamiltonian. At the continuous limit, thisis an optimization of a string.

Now let us elaborate on a concrete algorithm. To in-corporate a snake algorithm, the cost function shouldconsider energy of the snake itself, and can be written asfollows:

L[θ(λ)] =

∫ λT

λ0

(L(θ(λ)) + E(θ(λ))) (4)

Here E(θ(λ)) = 〈ψ(θ(λ))|Hλ|ψ(θ(λ))〉 is the local poten-tial the snake feels and the internal property is

L(θ(λ)) = α|∂θ(λ)

∂λ|2 + β|∂

2θ(λ)

∂2λ|2, (5)

where α and β terms make the snake stretchable andbendable [33, 34], respectively.

Solving the snake can be achieved by minimizing Eq. 4,which can converted to solve a differential equation(seeEq. A1 in the Appendix). For this we discrete the snakeas a sequence of parameters at different bond lengths ri =(θi(λ1),θi(λ2), ...,θi(λM )), where i is the i-th component

Page 3: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

3

for each θi(λm). Then, the discrete snake can be solvediteratively as

rti = (ηA+ I)−1(rt−1i − η dE(rt−1)

dri

)(6)

where E(r) =∑m E(θλm

), and A is a pentadiagonalbanded matrix with nonzero elements depending on αand β. Details can be found in the Appendix A. Com-pared with Eq. (3), Eq. (6) can be viewed as a collectivegradient descent, as the later is reduced to the former atα = β = 0.

There is an issue for incorporating the snake algorithminto optimizing variational quantum eigensolver. Theequilibrium condition Eq. (A2) (or Eq. (A1)) is actually

not the original one dE(θ(λi))dθ(λi)

= 0, as there are interac-

tions between neighbor θ(λi). As a result, optimizationwith a gradient flow using Eq. (6) may not give the re-quired optimal results. In practice, nevertheless, this is-sue may be largely ignored, as explained in the following.For neighbor λi, it can expected that θ(λi+1)+θ(λi−1) ≈2θ(λi)) and θ(λi+2) + θ(λi−2) ≈ 2θ(λi)) once the op-timization is good enough and M is large enough. Itcan be checked that the first term of Eq. A2 can be ap-proximated as zero, which is consist with the equilibriumcondition for VQE, namely by omitting the first term.

In practice, we can introduce a decaying matrixA(t) =A0 exp(−tΓ) in the optimization process. For large tlimit, this become the gradient descent of Eq. 3. Ananalog may be made with the annealing methods widelyapplied for optimization. Internal forces play the roleof temperature. Initially, internal forces are large andparameters for different Hamiltonians flow in the spacecollectively. With decaying internal forces flows of dif-ferent parameters become more independent. This mayinspire us that the snake algorithm may help avoid theoptimization to be trapped in a local minimum for a sin-gle VQE, which will be investigated at Sec. IV.

III. APPLICATION OF CVQE FORMOLECULES

In this section, we apply cVQE for several represen-tative molecules, including molecular hydrogen, Lithiumhydride and Helium hydride cation and present their re-sults. The numerical simulations are performed by us-ing Huawei HiQsimulator framework [42]. It is shownthat ground state energies are obtained with great ac-curacy compared with results using variational quantumeigensolver for Hamiltonian at each bond length alone.Remarkably, variational parameters for ground states ofHamiltonians at different bond lengths collectively flowto optimal values. We present the main results and de-tails of the calculation of Hamiltonians for all moleculesat different bond lengths as well as their wavefunctionansatz are put in Appendix. B.

A. Molecular hydrogen

For H2, we consider an effective qubit Hamiltonian in-volves two qubits, following Ref. [19]. The unitary cou-pled cluster (UCC) ansatz is used, with unitary operator

U(θ) = exp(−iθσx0σy1 )

performing on Hartree-Fock reference state is |01〉. Wechose 54 points uniformly from bond lengths rangingfrom 0.25 a.u. to 2.85 a.u. Effective Hamiltonians corre-sponding to those bond lengths are obtained with Open-Fermion [43] Variational parameters are randomly ini-tialized. We set α = 0.1, β = 3, η = 0.5 in the Eq. (6)(note that A depends on α and β). Ground state en-ergies at different bond lengths fit perfectly with idealresults. Remarkably, variational parameters for differentbond lengths, while initialized randomly, quickly form asmooth curve and evolve to the target optimal values, asshown in Fig. (1). This can be understood as a collectiveoptimization process that exploits intricate relations be-tween VQE tasks for Hamiltonians with different bondlengths.

B. Lithium hydride

For LiH, STO-6G basis is used to construct the elec-tronic Hamiltonian, which is mapped into a qubit Hamil-tonian with BK transformation. Following Ref. [19],three orbitals are chosen that the final qubit Hamilto-nian evolves three qubits. The UCC operator U(θ1, θ2) =exp(−iθ1σx0σ

y1 ) exp(−iθ2σx0σ

y2 ) performs on an initial

state |111〉. The operator can be taken as two UCCs,and each can be decomposed as in the Eq.(5). EffectiveHamiltonians are calculated with OpenFermion from 50bond lengths, uniformly chosen from 0.3 a.u. to 5.0 a.u.Variational parameters are randomly initialized. We setα = 0.1, β = 3, η = 0.2 in the Eq. (6). It can be seenin Fig. (1) that potential surface fit well with ideal re-sults. Evolution of variational parameters turns to berather impressive. Unlike the case of molecular Hydro-gen, there are two parameters for each VQE, and thus allpoints form a curve in the parameter space. The initialcurve is random (due to random initialization) and is faraway from the target. Nevertheless, the curve flows tothe target curve by both shifting and changing its shape.Such a collective optimization process strikingly remindsof the behavior of a crawling snake.

C. Helium hydride cation

We now turn to consider Helium hydride cation, whichis a more complicated molecular carrying one positivecharge. Under STO-3G basis, four qubits are requiredto describe the Hamiltonian [17]. To capture essen-tial quantum correlation, the UCC ansatz should in-clude a two-particle scattering component [17]. The

Page 4: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

4

FIG. 1. Collective optimization with the snake algorithm for molecules at different bond lengths. The first row shows the targetenergies and optimization results for the cVQE algorithm, and the second row presents optimization process of variationalparameters. The left, the middle and the right columns correspond molecules H2, LiH and HeH+, with one, two, and threevariational parameters, respectively.

unitary operator can be written as U(θ1, θ2, θ3) =exp(−iθ3σx0σx1σx2σ

y3 ) exp(−iθ2σx1σ

y3 ) exp(−iθ1σx0σ

y2 ). Ef-

fective Hamiltonians are calculated with OpenFermionfrom 30 bond lengths, ranging from 0.25 a.u. to 2.5 a.u.Hyper parameters for the snake are set as α = 0.1, β =3, η = 0.2 in the Eq. (6). As there are three variationalparameters, their evolution can be visualized as a crawl-ing snake in a three dimensional space. Although ini-tialized randomly, the snake becomes more smooth andmoves to the target position. This again demonstratesthe feature of the snake algorithm as a collective opti-mization process.

IV. NONCONVEX OPTIMIZATION OF CVQE

In the above, we have applied cVQE for solvingground-state energies of several molecules at differentbond lengths. The process of optimization shows that pa-rameters for different bond lengths evolve more smoothly,a remarkable feature of the snake algorithm for collectiveoptimization. In this section, we further reveal that thesnake algorithm trends for a global optimization, avoid-ing to be trapped at local minimums.

A. Snake algorithm for nonconvex function

We first use a toy example to illustrate how a collec-tive optimization with the snake algorithm can avoid an

FIG. 2. Optimization for a group of Styblinski-Tang functionsparameterized with t (0 ≤ t ≤ 6). f(x; t) = 1

2(x4−16x2 + tx).

(a). The landscape for a ST function has two minimums forfixed t. (b). Optimizations with gradient descent and thesnake algorithm. It is shown that local minimums are oftenachieved by gradient descent why the snake algorithm canmostly achieve global minimums.

optimization process to be trapped in local minimums.We consider to minimize the Styblinski-Tang (ST) func-tion [44], a nonconvex function used to benchmark op-

timization algorithms, defined as f(x) = 12

∑Ni=1 x

4i −

16x2i + tixi. To illustrate the mechanism of the snake al-gorithm for nonconvex optimization, we take N = 1 andconsider a group of ST functions, parameterized with t asf(x; t) = 1

2 (x4−16x2+tx), where t ≥ 0. For fixed t, thereare two minimums locating at ±x0(t) and the global onelocates at −x0(t) (assuming x0(t) > 0). However, thosetraps are deep that a optimizer may be easily trappedat local minimums, especially for optimizers based on

Page 5: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

5

FIG. 3. Optimization processes for nonconvex function. (a).Optimization by gradient descent. The flow of x at fixed tdepends on the sign of initial value x0, and if x0 is positivethen the optimization goes to the local minimum. (b). Opti-mization by the snake algorithm. It can be seen that almostall x flow to global minimums collectively, even if they areinitialized as positive and negative randomly.

FIG. 4. Nonconvex optimization for hydrogen molecule withthe cVQE algorithm. (a). Optimization results using boththe cVQE algorithm (marked as cVQE) and gradient de-scent (marked as GD).(b). Evolving of parameters θ1 for theoptimization process using the cVQE algorithm (greed line)and gradient descent(red triangular).(c). The landscape forVQE of hydrogen molecule has several different minimums.The random initial point flows to global minimum in cVQEmetheod and to a local minimum in gradient descent.

gradient descents. The snake algorithm, although usinggradient descent, can avoid this issue. As seen in Fig. (2),most optimal points for different TS functions locate atglobal minimums. This is because all points are intercon-nected and can be optimized collectively. Initially, thereare some points located at traps of global minimums withrandom initialization. Then, those points will pull otherpoint out of traps of local minimums, as seen in Fig. (3)b.Such a mechanism can explain why the snake algorithmcan be used as an optimizer for nonconvex function.

B. Nonconvex optimization for VQE

For variational quantum eigensolver, an expectation ofHamiltonian with regard to the variational wavefunctionansatz is in general a nonconvex function of variationalparameters. As for illustration, we still consider the hy-drogen molecule with the same Hamiltonian as Eq.(B1),but the wavefunction ansatz is changed to

U(θ1, θ2) = exp(−iθ2(aσx0 + bσx1 )) exp(−iθ1σx0σy1 ).

Here a and b are fixed and we set a = 2, b = 1.5 forinstance. Compared to the origin unitary coupled clus-ter ansatz, there is an extra term exp(−iθ2(aσx0 + bσx1 )).As seen in Fig. (4)b, the landscape has several differentminimums. The global one locates at the center, corre-sponding to θ2 = 0. This is expected as the case of θ2 = 0the wavefunction respects particle conservation, which isrequired for the system of hydrogen molecule. A simplegradient descent as Eq. (3) may lead to local minimums,once initially parameters of (θ1, θ2) are in traps of localminimums (Fig. (4)a). In fact, θ2 corresponding to thoselocal minimums are far from zero, as seen in Fig. (4)c.However, the snake algorithm can perfectly overcome theissue of local minimums for optimizing VQE. During theoptimization process, θ1 at different bond lengths evolvecollectively. The curve connecting different θ2 becomesmore smooth when approaching the target. Meanwhile,and all θ1 shrink to zero. Those present nice feature fornonconvex optimizations that are often met in VQE forquantum chemistry problems.

V. DISCUSSION AND SUMMARY

Optimization is a key component for variational quan-tum eigensolvers. Here we have incorporated the snakealgorithm for optimization of a group of VQE to findground state energies for a molecular at different bondlengths. As the first step for collective optimization forquantum chemistry/many-body problems, it is expectedthat cVQE can be tested on more general wavefunctionansatzes. We have applied the unitary coupled clusteransatz for quantum chemistry problem, and only con-sider a small number of variational parameters. For manyquantum chemistry/many-body problems, more varia-tional parameters are required and also other wavefunc-tion ansatzes may be more suitable [29]. The snake algo-rithm can be studied for such high dimensional optimiza-tion problem. It is expected that the snake algorithmcan help to escape local minimums that often appear ina high-dimensional landscape.

In summary, we have incorporated the snake algo-rithm to optimize variational quantum eigensolvers fora group of Hamiltonians. The cVQE has been used tosolve ground states of molecules at different bond lengthssimultaneously, which is enhanced by the collective op-timization. Remarkably, we have demonstrated that the

Page 6: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

6

snake algorithm is a global optimizer, as the collectivemotion of variational parameters for different tasks canhelp pull parameters out of traps of local minimums.

ACKNOWLEDGMENTS

The authors thank the hosting by Peng Cheng Lab-oratory, where the manuscript is finalized. Thanks forDr. Lei Wang’s helpful discussion. This work is sup-ported by the National Key Research and DevelopmentProgram of China (Grant No. 2016YFA0301800), theNational National Science Foundation of China (GrantsNo. 91636218, No.11474153, and No. U1801661), theKey Project of Science and Technology of Guangzhou(Grant No. 201804020055).

Appendix A: Collective gradient descent

In this section, we give details of deriving Eq. (6). Thesnake is determined from the least action principal. Thisis achieved by minimizing L[θ(λ)]. By Euler-Lagrangeequation, this leads to a fourth-order differential equa-tion,

α∂2θ(λ)

∂2λ+ β

∂4θ(λ)

∂4λ+

dE

dθ(λ)= 0. (A1)

Here E =∫ λT

λ0E(θ(λ)). The last term of Eq.(A1) should

be evaluated on a quantum processor, which makesEq. (A1) rather special and it is expected a solution witha hybrid quantum-classical algorithm.

The Eq. (A1) should be solved numerally in a discreteversion. M different parameters are chosen uniformlyfrom [λ0, λT ] as {λ1, λ2, ..., λM}, and λT − λ0 = Mδ.Using finite difference, the second and forth orders ofdifferentials turns to be Eq. (A1),

[θ(λi+1)− 2θ(λi) + θ(λi−1)] /δ2,

[θ(λi−2)− 4θ(λi−1) + 6θ(λi)− 4θ(λi+1) + θ(λi+2)] /δ4

respectively. Then we have

Ari +dE(r)

dri= 0, i = 1, 2, ..., N. (A2)

For convenience we also introduce ri =(θi(λ1),θi(λ2), ...,θi(λM )), and denote E(r) =∑i E(θλi

). A is a pentadiagonal banded matrixwith nonzero elements (under the periodic condition),Ai−2,i = Ai,i−2 = β, Ai−1,i = Ai,i−1 = −α − 4β,Ai,i =2α+ 6β, where δ2 and δ4 are absorbed accordingly.

Following Ref.[33], the equation Eq. (A2) can be solvedby introducing gradient flow (with an explicit Euler step,so it uses Arti instead of Art−1i ),

−rti − rt−1i

η= Arti +

dE(rt−1)

dri, (A3)

which leads to Eq. (6).

Appendix B: Hamiltonians and unitary clusteransatz

Solving eigenvalues of electronic structures ofmolecules is the central problem for quantum chemistry.The ground-state energy is especially important as itlargely determines the chemical properties of molecules.The electronic Hamiltonian for a molecule consists ofnuclear charges and electrons with Coulomb interac-tions. By Born-Oppenheimer approximation locations ofnuclear are fixed. The electronic Hamiltonian is usuallyreformulated in the second quantized formulation,with a basis of N molecular orbitals that are a linearcombination of atomic orbitals. This can reduce theinfinite dimension space of the original real space into afinite Hilbert space. Solving eigenvalues and eigenstatescan be done in this subspace. The dimensionality N canbe adjusted for the sake of precision demanded.

In the second quantization, the Hilbert space stillgrows exponentially with the number of orbitals N . It isimportant to only consider orbitals that contribute signif-icantly to the low state energy. In practices, only activeorbitals are considered, and inactive ones, such as occu-pied orbitals very close to the nuclear, or outside emptyorbitals are ignored. This leads to an effective electronicHamiltonian that allows for feasible solutions.

The electronic Hamiltonian is fermionic and still cannot be solved on a quantum processor. To map fermionicoperators into qubit operators, one can refer to Jordan-Wigner transformation or Bravyi-Kitaev transformation.Those transformations are nonlocal and may introduce atensor product of a string of Pauli matrices in the qubitHamiltonian.

We consider three kinds of molecules, molecular hy-drogen and Lithium hydride, and helium hydride cation.Their qubit Hamiltonians with varying bond lengthsare calculated with the open source software Open-Fermion [43], following setups in Ref.[19] for hydrogenand Lithium hydride, and Ref.[17] for helium hydridecation.

For H2, and STO-3G minimal basis are adopted, thefinal effective qubit Hamiltonian involves two qubits,which can be written as

HH2(λ) = c0(λ)I + c1(λ)σz0 + c2(λ)σz1 + c3(λ)σz0σ

z1

+ c4(λ)σx0σx1 + c5(λ)σy0σ

y1 . (B1)

Here, coefficients ci(λ) depend on the bond length λ andtheir values can be found in the code. The Hartree-Fockreference state is |01〉.

For LiH, STO-6G basis is used to construct the elec-tronic Hamiltonian, which is mapped into a qubit Hamil-tonian with BK transformation. Following ref.cite, threeorbitals are chosen that the final qubit Hamiltonian

Page 7: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

7

evolves three qubits,

HLiH(λ)

= c0(λ)I + c1(λ)σz0 + c2(λ)σz1 + c3(λ)σz2 + c4(λ)σz0σz1

+c5(λ)σz0σz2 + c6(λ)σz1σ

z2 + c7(λ)σx0σ

x1 + c8(λ)σx0σ

x2

+c9(λ)σx1σx2 + c10(λ)σy0σ

y1 + c10(λ)σy0σ

y2 + c11(λ)σy1σ

y2

(B2)

The reference state is |001〉.For the above two effective qubit Hamiltonians, we

adopt simple unitary coupled cluster ansatz [11, 17, 19,45, 46], which can establish entanglement between dif-ferent qubits and thus take quantum correlations intoaccount. For H2, the unitary operator is

U(θ) = exp(−iθσx0σy1 )

and the wavefunciton ansatz is U(θ)|01〉. The parameterθ can character the degree of entanglement the electronand the hole. For LiH, the UCC ansatz is

U(θ1, θ2) = exp(−iθ2σx0σy2 ) exp(−iθ1σx0σ

y1 ),

and the wavefunciton ansatz is U(θ1, θ2)|111〉. U(θ1, θ2)can be decoupled as two entanglers that establish an en-tanglement of the zeroth and the first orbitals, the zerothand the second orbitals, respectively. Two parameters θ1and θ2 characterize the degrees of entanglement, corre-spondingly.

We also consider helium hydride cation (HeH+). Un-der STO-3G basis, its qubit Hamiltonian includes bothtwo, three and four spin interactions.

HHeH+(λ) = c0I +3∑i=0

ciZi +

3∑i,j=0

(zijZiZj + xijXiXj + yijYiYj) +

1∑i=0

t3(XiZi+1Xi+2 + YiZi+1Yi+2)

+f0X0X1Y2Y3 + f1Y0Y1X2X3 + f2X0Y1Y2X3 + f3Y0X1X2Y3

+f4X0Z1X2Z3 + f5Z0X1Z2X3 + f6Y0Z1Y2Z3 + f7Z0Y1Z2Y3.

(B3)

An UCC ansatz for HHeH+(λ) should consider both firstand second excitation. Following ref. [17], we use

U(θ1, θ2, θ3) =

exp(−iθ3σx0σx1σx2σy3 ) exp(−iθ2σx1σ

y3 ) exp(−iθ1σx0σ

y2 ).

(B4)

The wavefunciton ansatz is U(θ1, θ2, θ3)|0011〉.To implement the above ansatzes on quantum proces-

sors, we need to decompose Hamiltonian evolution of

one-particle transition and two-particle transition intoa set of universal quantum gates involving single-qubitrotations and two-qubit CNOT gate, as can be seen inFig (5) The decomposition makes the UCC operator im-plementable on quantum chips. Moreover, variationalparameters only appear in a single-qubit rotation Rz(θ).Thus, an analytic gradient can be evaluated using theshift rule.

[1] Richard P. Feynman, “Simulating physics with comput-ers,” Int. J. Theor. Phys. 21, 467–488 (1982).

[2] Peter W. Shor, “Polynomial-time algorithms for primefactorization and discrete logarithms on a quantum com-puter,” Siam. J. Comput. 26, 1484–1509 (1997).

[3] A. W. Harrow, A. Hassidim, and S. Lloyd, “Quantumalgorithm for linear systems of equations,” Phys. Rev.Lett. 103, 150502 (2009).

[4] Scott Aaronson and Alex Arkhipov, “The computationalcomplexity of linear optics,” in Research in Optical Sci-ences, OSA Technical Digest (online) (Optical Society ofAmerica, 2014) p. QTh1A.2.

[5] Sergey Bravyi, David Gosset, and Robert Knig, “Quan-tum advantage with shallow circuits,” Science 362, 308–311 (2018).

[6] Frank Arute, Kunal Arya, Ryan Babbush, Dave Bacon,Joseph C. Bardin, Rami Barends, Rupak Biswas, Ser-

gio Boixo, Fernando G. S. L. Brandao, et al., “Quantumsupremacy using a programmable superconducting pro-cessor,” Nature 574 (2019), 10.1038/s41586-019-1666-5.

[7] Daniel S. Abrams and Seth Lloyd, “Simulation of many-body fermi systems on a universal quantum computer,”Phys. Rev. Lett. 79, 2586–2589 (1997).

[8] Iulia Buluta and Franco Nori, “Quantum simulators,”Science 326, 108–111 (2009).

[9] Andreas Trabesinger, “Quantum simulation,” Nat. Phys.8, 263 (2012).

[10] J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost,N. Wiebe, and S. Lloyd, “Quantum machine learning,”Nature 549, 195–202 (2017).

[11] M. H. Yung, J. Casanova, A. Mezzacapo, J. McClean,L. Lamata, A. Aspuru-Guzik, and E. Solano, “Fromtransistor to trapped-ion computers for quantum chem-istry,” Scientific Reports 4, 3589 (2014).

Page 8: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

8

FIG. 5. Decomposition of basic operator in unitary coupledcluster ansatz into a set of universal quantum gates.

[12] Edward Farhi, Jeffrey Goldstone, and Sam Gut-mann, “A quantum approximate optimization algo-rithm,” arXiv:1411.4028 (2014).

[13] Jarrod R. McClean, Jonathan Romero, Ryan Babbush,and Aln Aspuru-Guzik, “The theory of variational hybridquantum-classical algorithms,” New Journal of Physics18, 023023 (2016).

[14] P. J J OMalley, R. Babbush, I. D Kivlichan, J. Romero,J. R McClean, R. Barends, J. Kelly, P. Roushan, A. Tran-ter, N. Ding, et al., “Scalable quantum simulation ofmolecular energies,” Physical Review X 6, 031007 (2016).

[15] Ying Li and Simon C. Benjamin, “Efficient variationalquantum simulator incorporating active error minimiza-tion,” Physical Review X 7, 021050 (2017).

[16] Jarrod R. McClean, Mollie E. Kimchi-Schwartz,Jonathan Carter, and Wibe A. de Jong, “Hybridquantum-classical hierarchy for mitigation of decoherenceand determination of excited states,” Phys. Rev. A 95,042308 (2017).

[17] Yangchao Shen, Xiang Zhang, Shuaining Zhang, Jing-Ning Zhang, Man-Hong Yung, and Kihwan Kim, “Quan-tum implementation of the unitary coupled cluster forsimulating molecular electronic structure,” Phys. Rev. A95, 020501 (2017).

[18] Abhinav Kandala, Antonio Mezzacapo, Kristan Temme,Maika Takita, Markus Brink, Jerry M. Chow, andJay M. Gambetta, “Hardware-efficient variational quan-tum eigensolver for small molecules and quantum mag-nets,” Nature 549, 242 (2017).

[19] Cornelius Hempel, Christine Maier, Jonathan Romero,Jarrod McClean, Thomas Monz, Heng Shen, Petar Ju-rcevic, Ben P. Lanyon, Peter Love, and et al., “Quantumchemistry calculations on a trapped-ion quantum simu-lator,” Physical Review X 8, 031022 (2018).

[20] Eric R. Anschuetz, Jonathan P. Olson, Aln Aspuru-Guzik, and Yudong Cao, “Variational quantum factor-ing,” arXiv:1808.08927 (2018).

[21] K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii,“Quantum circuit learning,” Phys. Rev. A 98, 032309(2018).

[22] Nikolaj Moll, Panagiotis Barkoutsos, Lev S. Bishop,Jerry M. Chow, Andrew Cross, Daniel J. Egger, StefanFilipp, Andreas Fuhrer, Jay M. Gambetta, et al., “Quan-tum optimization using variational algorithms on near-

term quantum devices,” Quantum Science and Technol-ogy 3, 030503 (2018).

[23] C. Kokail, C. Maier, R. van Bijnen, T. Brydges, M. K.Joshi, P. Jurcevic, C. A. Muschik, P. Silvi, R. Blatt, C. F.Roos, and P. Zoller, “Self-verifying variational quan-tum simulation of lattice models,” Nature 569, 355–360(2019).

[24] Tyler Takeshita, Nicholas C. Rubin, Zhang Jiang, Eun-seok Lee, Ryan Babbush, and Jarrod R. McClean, “In-creasing the representation accuracy of quantum simu-lations of chemistry without extra quantum resources,”arXiv:1902.10679 (2019).

[25] Sam McArdle, Tyson Jones, Suguru Endo, Ying Li, Si-mon C. Benjamin, and Xiao Yuan, “Variational ansatz-based quantum simulation of imaginary time evolution,”npj Quantum Information 5, 75 (2019).

[26] Oscar Higgott, Daochen Wang, and Stephen Brierley,“Variational Quantum Computation of Excited States,”Quantum 3, 156 (2019).

[27] Ryan Sweke, Frederik Wilde, Johannes Meyer, MariaSchuld, Paul K. Fhrmann, Barthlmy Meynard-Piganeau,and Jens Eisert, “Stochastic gradient descent for hybridquantum-classical optimization,” arXiv:1910.01155v1(2019).

[28] John Preskill, “Quantum Computing in the NISQ eraand beyond,” Quantum 2, 79 (2018).

[29] Jin-Guo Liu, Yi-Hong Zhang, Yuan Wan, and Lei Wang,“Variational quantum eigensolver with fewer qubits,”arXiv:1902.02663 (2019).

[30] Marcin Andrychowicz, Misha Denil, Sergio Gomez,Matthew W. Hoffman, David Pfau, Tom Schaul, BrendanShillingford, and Nando de Freitas, “Learning to learn bygradient descent by gradient descent,” arXiv:1606.04474(2016).

[31] Chelsea Finn, Pieter Abbeel, and Sergey Levine,“Model-agnostic meta-learning for fast adaptation ofdeep networks,” in ICML.

[32] Guillaume Verdon, Michael Broughton, Jarrod R. Mc-Clean, Kevin J. Sung, Ryan Babbush, Zhang Jiang, Hart-mut Neven, and Masoud Mohseni, “Learning to learnwith quantum neural networks via classical neural net-works,” arXiv:1907.05415 (2019).

[33] Michael Kass, Andrew Witkin, and Demetri Terzopou-los, “Snakes: Active contour models,” Int. J. Comput.Vision. 1, 321–331 (1988).

[34] Ye-Hua Liu and Evert P. L van Nieuwenburg, “Discrim-inative cooperative networks for detecting phase transi-tions,” Phys. Rev. Lett. 120, 176401 (2018).

[35] Aln Aspuru-Guzik, Anthony D. Dutoi, Peter J. Love,and Martin Head-Gordon, “Simulated quantum compu-tation of molecular energies,” Science 309, 1704–1707(2005).

[36] Hefeng Wang, S. Ashhab, and Franco Nori, “Quantumalgorithm for obtaining the energy spectrum of a physicalsystem,” Phys. Rev. A 85, 062304 (2012).

[37] Zhaokai Li, Xiaomei Liu, Hefeng Wang, Sahel Ash-hab, Jiangyu Cui, Hongwei Chen, Xinhua Peng, andJiangfeng Du, “Quantum simulation of resonant transi-tions for solving the eigenproblem of an effective waterhamiltonian,” Phys. Rev. Lett. 122, 090504 (2019).

[38] P. Jordan and E. Wigner, “ber das paulische quivalen-zverbot,” Zeitschrift fr Physik 47, 631–651 (1928).

[39] Sergey B. Bravyi and Alexei Yu Kitaev, “Fermionic quan-tum computation,” Ann. Phys-new. York. 298, 210–226

Page 9: arXiv:1910.14030v1 [quant-ph] 30 Oct 2019 · sor and updates variational parameters on the classical computer. Remarkably, the updating process general-izes typically gradient descent

9

(2002).[40] Jun Li, Xiaodong Yang, Xinhua Peng, and Chang-Pu

Sun, “Hybrid quantum-classical approach to quantumoptimal control,” Phys. Rev. Lett. 118, 150503 (2017).

[41] Maria Schuld, Ville Bergholm, Christian Gogolin, JoshIzaac, and Nathan Killoran, “Evaluating analytic gra-dients on quantum hardware,” Phys. Rev. A 99, 032331(2019).

[42] Huawei HiQ team, “Huawei hiq: A high-performancequantum computing simulator and programming frame-work” .

[43] Jarrod R. McClean, Kevin J. Sung, Ian D. Kivlichan,Yudong Cao, Chengyu Dai, E. Schuyler Fried, Craig Gid-ney, Brendan Gimby, Pranav Gokhale, Thomas Hner,

et al., “Openfermion: The electronic structure packagefor quantum computers,” arXiv:1710.07629 (2017).

[44] M. A. Styblinski and T. S. Tang, “Experiments innonconvex optimization: Stochastic approximation withfunction smoothing and simulated annealing,” NeuralNetworks 3, 467–483 (1990).

[45] Garnet Kin-Lic Chan, Mihly Kllay, and Jrgen Gauss,“State-of-the-art density matrix renormalization groupand coupled cluster theory studies of the nitrogen bindingcurve,” The Journal of Chemical Physics 121, 6110–6116(2004).

[46] Andrew G. Taube and Rodney J. Bartlett, “New perspec-tives on unitary coupled-cluster theory,” Int. J. Quan-tum. Chem. 106, 3393–3401 (2006).


Recommended