7
ARTICLE OPEN Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1 * , Dominic W. Berry 2 , Jarrod R. McClean 1 and Hartmut Neven 1 We present a quantum algorithm for simulating quantum chemistry with gate complexity ~ N 1=3 η 8=3 Þ where η is the number of electrons and N is the number of plane wave orbitals. In comparison, the most efcient prior algorithms for simulating electronic structure using plane waves (which are at least as efcient as algorithms using any other basis) have complexity ~ N 8=3 =η 2=3 Þ. We achieve our scaling in rst quantization by performing simulation in the rotating frame of the kinetic operator using interaction picture techniques. Our algorithm is far more efcient than all prior approaches when N η, as is needed to suppress discretization error when representing molecules in the plane wave basis, or when simulating without the Born-Oppenheimer approximation. npj Quantum Information (2019)5:92 ; https://doi.org/10.1038/s41534-019-0199-y INTRODUCTION The quantum simulation of quantum chemistry is one of the most anticipated applications of both near-term and fault-tolerant quantum computing. The idea to use quantum processors for simulating quantum systems dates back to Feynman 1 and was later formalized by Lloyd, 2 who together with Abrams, also developed the rst algorithms for simulating fermions. 3 The idea to use such simulations to prepare ground states in quantum chemistry was proposed by Aspuru-Guzik et al. 4 That original work simulated the quantum chemistry Hamilto- nian in a Gaussian orbital basis. While Gaussian orbitals are compact for molecules, they lead to complex Hamiltonians. Initial approaches had gate complexity N 10 Þ, 5,6 and the current lowest scaling algorithm in that representation has gate complexity of roughly ~ N 4 Þ, 7 where N is number of Gaussian orbitals. Note that we use the notation ~ OðÞ to indicate an asymptotic upper bound suppressing polylogarithmic factors. Recently, Babbush et al., 8 showed that using a plane wave basis restores structure to the Hamiltonian which enables more efcient algorithms. Currently, the two best algorithms simulating the plane wave Hamiltonian are one with NÞ spatial complexity and N 3 Þ gate complexity (with small constant factors) 9 and one with N log NÞ spatial complexity and ~ N 2 Þ gate complexity (with large constant factors), 10 where N is the number of plane waves. The scaling of refs 9,10 assumes constant resolution and volume proportional to N. However, a more appropriate assumption when studying molecules is to take volume proportional to the number of electrons η, in which case the method of ref. 9 yields gate complexity ~ N 10=3 =η 1=3 þ N 8=3 =η 2=3 Þ and ref. 10 yields gate complexity ~ N 8=3 =η 2=3 Þ. The reason for taking volume propor- tional to η is that for condensed-phase systems (e.g., periodic materials) the electron density is independent of computational cell volume and for single molecules the wavefunction dies off exponentially in space outside of a volume scaling linearly in η. While basis set discretization error is suppressed asymptotically as 1=NÞ regardless of whether N is the number of plane waves 11,12 or Gaussians, 13,14 there is a signicant constant factor difference. Plane waves are the standard for treating periodic systems but one needs roughly a hundred times more plane waves than Gaussians 8 to reach the accuracy needed to predict chemical reaction rates. Since requiring a hundred times more qubits is impractical in most contexts, this limits the applicability of these recent algorithms 810,15,16 for molecules. This work solves the plane wave resolution problem by introducing an algorithm with η log NÞ spatial complexity and ~ N 1=3 η 8=3 Þ gate complexity. With this sublinear scaling in N, one can perform simulations with a huge number of plane waves at relatively low cost. Our approach is based on simulating a rst- quantized momentum space representation of the potential from the rotating frame of the kinetic operator by using recently introduced interaction picture simulation techniques. 10 While the actual implementations have little in common, our algorithm is conceptually dual to the interaction picture work of ref. 10 which simulates a second-quantized plane wave dual representation of the kinetic operator from the rotating frame of the potential. It is also possible to achieve sublinear scaling in basis size without the interaction picture technique; we briey discuss how qubitiza- tion 17 could be used to obtain ~ η 4=3 N 2=3 þ η 8=3 N 1=3 Þ scaling. The reason for our greatly increased efciency is that the complexity scales like the maximum possible energy represen- table in the basis. In second quantization, the basis includes states with up to η = N electrons, which results in very high energy, even though these states are not used in the simulation. In contrast, rst quantization sets the number of electrons at η. There is still some polynomial scaling with N, which is a result of the increased resolution meaning that electrons can be closer together. If we were to consider constant resolution (as in refs 810 ), our complexity would actually be polylogarithmic in N, representing an exponential speedup in basis size. RESULTS Encoding quantum simulations of electronic structure in momentum space rst quantization We will represent our system of η particles in N orbitals using rst quantization. Thus, we require η registers (one for each particle) of size log N (indexing which orbitals are occupied). Since electrons 1 Google Research, Venice, CA 90291, USA. 2 Department of Physics and Astronomy, Macquarie University, Sydney, NSW 2109, Australia. *email: [email protected] www.nature.com/npjqi Published in partnership with The University of New South Wales 1234567890():,;

Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

ARTICLE OPEN

Quantum simulation of chemistry with sublinear scaling inbasis sizeRyan Babbush1*, Dominic W. Berry2, Jarrod R. McClean1 and Hartmut Neven1

We present a quantum algorithm for simulating quantum chemistry with gate complexity ~OðN1=3η8=3Þ where η is the number ofelectrons and N is the number of plane wave orbitals. In comparison, the most efficient prior algorithms for simulating electronicstructure using plane waves (which are at least as efficient as algorithms using any other basis) have complexity ~OðN8=3=η2=3Þ. Weachieve our scaling in first quantization by performing simulation in the rotating frame of the kinetic operator using interactionpicture techniques. Our algorithm is far more efficient than all prior approaches when N≫ η, as is needed to suppress discretizationerror when representing molecules in the plane wave basis, or when simulating without the Born-Oppenheimer approximation.

npj Quantum Information (2019) 5:92 ; https://doi.org/10.1038/s41534-019-0199-y

INTRODUCTIONThe quantum simulation of quantum chemistry is one of the mostanticipated applications of both near-term and fault-tolerantquantum computing. The idea to use quantum processors forsimulating quantum systems dates back to Feynman1 and waslater formalized by Lloyd,2 who together with Abrams, alsodeveloped the first algorithms for simulating fermions.3 The ideato use such simulations to prepare ground states in quantumchemistry was proposed by Aspuru-Guzik et al.4

That original work simulated the quantum chemistry Hamilto-nian in a Gaussian orbital basis. While Gaussian orbitals arecompact for molecules, they lead to complex Hamiltonians. Initialapproaches had gate complexity OðN10Þ,5,6 and the current lowestscaling algorithm in that representation has gate complexity ofroughly ~OðN4Þ,7 where N is number of Gaussian orbitals. Note thatwe use the notation ~Oð�Þ to indicate an asymptotic upper boundsuppressing polylogarithmic factors.Recently, Babbush et al.,8 showed that using a plane wave basis

restores structure to the Hamiltonian which enables more efficientalgorithms. Currently, the two best algorithms simulating theplane wave Hamiltonian are one with OðNÞ spatial complexity andOðN3Þ gate complexity (with small constant factors)9 and one withOðN logNÞ spatial complexity and ~OðN2Þ gate complexity (withlarge constant factors),10 where N is the number of plane waves.The scaling of refs 9,10 assumes constant resolution and volumeproportional to N. However, a more appropriate assumption whenstudying molecules is to take volume proportional to the numberof electrons η, in which case the method of ref. 9 yields gatecomplexity ~OðN10=3=η1=3 þ N8=3=η2=3Þ and ref. 10 yields gatecomplexity ~OðN8=3=η2=3Þ. The reason for taking volume propor-tional to η is that for condensed-phase systems (e.g., periodicmaterials) the electron density is independent of computationalcell volume and for single molecules the wavefunction dies offexponentially in space outside of a volume scaling linearly in η.While basis set discretization error is suppressed asymptotically

as Oð1=NÞ regardless of whether N is the number of planewaves11,12 or Gaussians,13,14 there is a significant constant factordifference. Plane waves are the standard for treating periodicsystems but one needs roughly a hundred times more planewaves than Gaussians8 to reach the accuracy needed to predict

chemical reaction rates. Since requiring a hundred times morequbits is impractical in most contexts, this limits the applicabilityof these recent algorithms8–10,15,16 for molecules.This work solves the plane wave resolution problem by

introducing an algorithm with Oðη logNÞ spatial complexity and~OðN1=3η8=3Þ gate complexity. With this sublinear scaling in N, onecan perform simulations with a huge number of plane waves atrelatively low cost. Our approach is based on simulating a first-quantized momentum space representation of the potential fromthe rotating frame of the kinetic operator by using recentlyintroduced interaction picture simulation techniques.10 While theactual implementations have little in common, our algorithm isconceptually dual to the interaction picture work of ref. 10 whichsimulates a second-quantized plane wave dual representation ofthe kinetic operator from the rotating frame of the potential. It isalso possible to achieve sublinear scaling in basis size without theinteraction picture technique; we briefly discuss how qubitiza-tion17 could be used to obtain ~Oðη4=3N2=3 þ η8=3N1=3Þ scaling.The reason for our greatly increased efficiency is that the

complexity scales like the maximum possible energy represen-table in the basis. In second quantization, the basis includes stateswith up to η= N electrons, which results in very high energy, eventhough these states are not used in the simulation. In contrast, firstquantization sets the number of electrons at η. There is still somepolynomial scaling with N, which is a result of the increasedresolution meaning that electrons can be closer together. If wewere to consider constant resolution (as in refs 8–10), ourcomplexity would actually be polylogarithmic in N, representingan exponential speedup in basis size.

RESULTSEncoding quantum simulations of electronic structure inmomentum space first quantizationWe will represent our system of η particles in N orbitals using firstquantization. Thus, we require η registers (one for each particle) ofsize log N (indexing which orbitals are occupied). Since electrons

1Google Research, Venice, CA 90291, USA. 2Department of Physics and Astronomy, Macquarie University, Sydney, NSW 2109, Australia. *email: [email protected]

www.nature.com/npjqi

Published in partnership with The University of New South Wales

1234567890():,;

Page 2: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

are antisymmetric our registers will encode the wavefunction as

jψi ¼ Pp‘2G

αp1���pη jp1 � � � pi � � � pj � � � pηi

¼ � Pp‘2G

αp1���pη jp1 � � � pj � � � pi � � � pηi(1)

where G is a set of N spin-orbitals, so the summation goes over allsubsets of the orbitals that contain η unique elements. The secondline of the above equation is being used to convey that, due toantisymmetry, swapping any two electron registers induces aphase of −1. We will specialize to plane wave orbitals in threedimensions and ignore the spin for simplicity, so G= [−N1/3/2,N1/3/2]3⊂ Z

3. Using plane waves,

hr1 � � � rηjp1 � � � pηi �ffiffiffiffiffiffi1Ωη

r Yηj¼1

e�i kpj �rj (2)

where rj is the position of electron j in real space, Ω is thecomputational cell volume, and kp= 2πp/Ω1/3 is the wavenumberof plane wave p.Unlike in second quantization where antisymmetry is enforced

in the operators so that product states of qubits encode Slaterdeterminants,18–23 the antisymmetrization indicated in the secondline of Eq. (1) must be enforced explicitly in the wavefunctionsince the computational basis states in Eq. (2) are not antisym-metric. However, any initial state can be antisymmetrized withgate complexity Oðη log η logNÞ using the techniques recentlyintroduced in ref. 24. Evolution under the Hamiltonian willmaintain antisymmetry provided that it exists in the initial state(a consequence of fermionic Hamiltonians commuting with theelectron permutation operator).The use of first quantization dates back to the earliest work in

quantum simulation.2,3,25–27 Though less common for fermionicsystems, several papers have analyzed chemistry simulationsusing first quantization of real space grids.28–30 Such grids areincompatible with a Galerkin formulation (the usual discretizationstrategy used in chemistry involving integrals over the basis) andrequire methods such as finite-difference discretization, which lackthe variational bounds on basis error guaranteed by the Galerkinformulation. Real space grids also have different convergenceproperties; for example, ref. 30

finds that in order to maintainconstant precision in the representation of certain states, theinverse grid spacing must sometimes scale exponentially inparticle number.Two previous papers31,32 have presented simulation algorithms

within a Gaussian orbital basis at spatial complexity Oðη logNÞ.These approaches do not use first quantization (they still enforcesymmetry in the operators rather than in the wavefunction);instead, refs 31,32 simulate a block of fixed particle number in thesecond-quantized Hamiltonian known as the configuration inter-action matrix. The more efficient of these two approaches has~Oðη2N3Þ gate complexity,32 so our ~Oðη8=3N1=3Þ gate complexity isa substantial improvement.By integrating the plane wave basis functions with the

Laplacian and Coulomb operators in the usual Galerkin formula-tion33 we obtain H= T+ U+ V such that

T ¼Xηj¼1

Xp2G

kp�� ��22

jpihpjj (3)

U ¼ � 4πΩ

XL‘¼1

Xηj¼1

Xp;q2Gp≠q

ζ‘ei kq�p�R‘

kp�q

�� ��2 !

jpihqjj (4)

V ¼ 2πΩ

Xηi;j¼1i≠j

Xp;q2G

Xν2G0

ðpþ νÞ 2 Gðq� νÞ 2 G

1

kνk k2 jpþ νihpji � jq� νihqjj(5)

where T is the kinetic operator, U is the external potentialoperator, and V is the two-body Coulomb operator. The set G0 is[−N1/3, N1/3]3/{(0, 0, 0)}⊂Z

3, R‘ are nuclear coordinates, ζ‘ arenuclear charges, L is the number of nuclei, and we use |q⟩⟨p|j asshorthand notation for

I1 � � � � � jqihpjj � � � � � Iη: (6)

While this Hamiltonian corresponds to a cubic cell with periodicboundaries, our approach can be easily extended to differentlattice geometries (including non-orthogonal unit cells) andsystems of reduced periodicity.34 Note that we have chosen thefrequencies in G0 to span twice the range as those in G in order tocover the maximum momenta that may be exchanged.

Simulating chemistry in the interaction pictureOur scheme for simulation builds on the interaction pictureapproach introduced in ref. 10. This approach is useful forperforming simulation of a Hamiltonian H= A+ B where normsof A and B differ significantly so that ||A||≫ ||B||. The idea is toperform the simulation in the interaction picture in the rotatingframe of A so that the large norm of A does not enter thesimulation complexity in the usual way.The principle in ref. 10 is similar to Hamiltonian simulation via a

Taylor series,35 except that the expression used to approximatethe evolution for time t is

e�iðAþBÞt �XK�1

k¼0

ð�iÞkZ t

0dt1

Z t

t1

dt2 � � �Z t

tk�1

dtkI k (7)

I k ¼ e�iAðt�tkÞBe�iAðtk�tk�1ÞB � � � e�iAðt2�t1ÞBe�iAt1 :

The operation given by this expression can be implemented byusing a linear combination of unitaries (LCU) approach.36 Theoperator B is expressed as a linear combination of unitaries andthe time is discretized, so Eq. (7) is a linear combination ofunitaries which can be implemented using a control register andoblivious amplitude amplification.37 For a short time, the cutoff Kcan be chosen logarithmic in the inverse error. To implementevolution for long times, the time is broken up into a number oftime segments of length τ, and this expression is used on each ofthose segments.The overall complexity depends on the value of λ, which is

the sum of the weights of the unitaries when expressing B as asum of unitaries. To simulate within error ϵ the number ofsegments used is OðλtÞ, and K ¼ Oðlogðλt=ϵÞ=log logðλt=ϵÞÞ. Thecomplexity in terms of LCU applications of B and evolutionse−iAτ is therefore

O λtlogðλt=ϵÞ

log logðλt=ϵÞ� �

: (8)

There is also a multiplicative factor of log(t∥A∥/ϵλ) for the gatecomplexity, which originates from the complexity of preparingthe ancilla states used for the time. This result is given in

R. Babbush et al.

2

npj Quantum Information (2019) 92 Published in partnership with The University of New South Wales

1234567890():,;

Page 3: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

Lemma 6 of ref. 10. To interpret the result as given in ref. 10, notethat the ‘HAM−T’ oracle mentioned in that work includes theevolution under A. That is why the complexity quoted there forthe number of applications of e−iAτ does not include alogarithmic factor.In quantum chemistry one often decomposes the Hamiltonian

into three components H= T+ U+ V, and it is natural to group Uand V together, because they usually commute with each otherbut not with T. The work of ref. 10 focused on the simulation ofchemistry in second quantization where U þ Vk k ¼ OðN7=3=Ω1=3Þand Tk k ¼ OðN5=3=Ω2=3Þ, so U þ Vk k � Tk k. However, for first-quantized momentum space we will observe the reverse trendthat U þ Vk k � Tk k when N � η.We therefore choose that A= T and B= U+ V, and need to

express the potential as a linear combination of unitaries inmomentum space,

B ¼ U þ V ¼XSs¼1

wsHs ; λ ¼XSs¼1

ws ; (9)

where ws are positive scalars and Hs are unitary operators. Theconvention in this paper is that the ws are real and non-negative,with any phases included in the Hs. A subtlety here is that whenexpressing U and V as a sum of unitaries we need to account forcases where addition or subtraction with ν would give valuesoutside G. To account for this, we can express U and V as

U ¼Xν2G0

XL‘¼1

2πζ‘Ω kνk k2

Xηj¼1

Xx2f0;1g

�e�i kν �R‘Xp2G

ð�1Þx½ðp�νÞ=2Gjp� νihpjj !

(10)

V ¼Xν2G0

π

Ω kνk k2Xηi;j¼1i≠j

Xx2f0;1g

Xp;q2G

ð�1Þxð½ðpþνÞ=2G_½ðq�νÞ=2GÞjpþ νihpji � jq� νihqjj !

;

(11)

and it is apparent that the parts in between the large parenthesesabove are unitary, so we take them to be the operators Hs in Eq.(9). In Eq. (10) we use the convention that Booleans correspond to0 for false and 1 for true. This modification ensures that there is nocontribution to the sum from parts where the additions orsubtractions would result in values outside G. For example, for U, if(p− ν) is not in G, then the value of (p− ν)∉ G is interpreted as 1.This means that we haveXx2f0;1g

ð�1Þx ¼ 1� 1 ¼ 0: (12)

Thus, we see that λ is asymptotically equal to η2 times

Xν2G0

Ω2=3

ν2 1

Ω

Z 2π

0

Z π

0

Z N1=3

0dr dϕ dθ

Ω2=3

r2r2 sinθ

¼ O N1=3=Ω1=3� �

¼ O N1=3=η1=3� �

(13)

where in the last line we use Ω∝ η, which is typical for molecules.8

From this, we find that λ ¼ Oðη5=3N1=3Þ.The scaling obtained in Eq. (13) corresponds to the maximum

possible value of U+ V. Changing the orbital basis does notchange the maximum possible energy. If one considers the dualbasis to the plane waves, then the orbitals are spatially localizedwith a minimum separation proportional to (Ω/N)1/3.8 Theminimum separation between electrons proportional to (Ω/N)1/3

gives a potential energy scaling as (N/Ω)1/3, as given in Eq. (13). Incontrast, the kinetic energy T has worse scaling with N becausethe maximum speed scales as (N/Ω)1/3 (the inverse of theseparation), which is squared to give a kinetic energy proportionalto (N/Ω)2/3.8

Performing simulation in the kinetic frameTo implement our algorithm we need to realize e−iTτ as well asrealize (U+ V)/λ via a linear combination of unitaries. Using Eq. (3)we express e−iTτ as

Xp‘2G

exp � iτ2

Xηj¼1

kpj�� ��2" #

jp1ihp1j1 � � � jpηihpηjη: (14)

Therefore, in order to apply this operator, we just need toincrement through each of the η electron registers to calculate thesum of ∥kp∥2, then apply a phase rotation according to that result.The complexity of calculating the square η times is Oðη log2 NÞ(assuming we are using an elementary multiplication algorithm).The complexity of the controlled rotations is OðlogðηNÞÞ, thoughthere will be an additional logarithmic factor if we considercomplexity in terms of T gates for circuit synthesis.To apply the U+ V operator we will need a SELECT operation and

a PREPARE operation. We use one qubit which selects betweenperforming U and V. For V (the two-electron potential) the SELECT

LCU oracle will be

selectj0ijiijjijνijp1i1 � � � jpiii � � � jpjij � � � jpηiη 7!

j0ijiijjijνijp1i1 � � � jpi þ νii � � � jpj � νij � � � jpηiη: (15)

This operation has complexity Oðη logNÞ, because we can iteratethrough each of the η electron registers checking if the registernumber is equal to i or j, and if it is then adding ν (for i) orsubtracting ν (for j). For U (the nuclear term), we need to apply

selectj1ij‘ijjijνijp1i1 � � � jpjij � � � jpηiη 7!

�e�ikν �R‘ j1ij‘ijjijνijp1i1 � � � jpj � νij � � � jpηiη: (16)

We again need to iterate through the registers, and subtract ν ifthe register number is equal to j, which gives complexityOðη logNÞ. The register |i⟩ is replaced with j‘i, and we need toapply a phase factor e�ikν �R‘ . This phase factor can be obtained byfirst computing the dot product kν � R‘, which has complexityOðlogN logð1=δRÞÞ, where δR is the relative precision with whichthe positions of the nuclei are specified. For L nuclei (note that L ≤η), we will have an additional complexity of OðL logð1=δRÞÞ inorder to access a classical database for the positions of the nucleiR‘. Then, applying the controlled rotation has complexityOðlogN þ logð1=δRÞÞ.In order to take account of the modification involving x that is

referred to in Eq. (12), we would have an additional control qubitfor x which would be prepared in an equal superposition. Whendoing the additions and subtractions, one would check if they givevalues outside G and perform a Z operation on that ancilla if any ofthe results were outside G.Let δ be the allowable error in the PREPARE and SELECT operations.

The number of times these operations need to be performed is~OðλtÞ, so to obtain total error no greater than ϵ we can takelogð1=δÞ ¼ O log λt=ϵð Þð Þ. Since λ is polynomial in η and N, wehave logð1=δÞ ¼ O log ηNt=ϵð Þð Þ. The error in the implementationof U/λ due to the error in the positions of the nuclei isOðδRN1=3Z=ηÞ. Since the total nuclear charge should be the sameas the number of electrons (since the total charge is zero), we cancancel Z and η. Then we also obtain logð1=δRÞ ¼ O log ηNt=ϵð Þð Þ.The PREPARE operation must act as

preparej0i�ðlogNþ2logηþ1Þ

7! j0i Pηi;j¼1

Pν2G0

ffiffiffiffiffiffiffiffiffiffiffiffi2π

λΩ kνk k2q

jνijiijji

þj1iPηj¼1

PL‘¼1

Pν2G0

ffiffiffiffiffiffiffiffiffiffiffiffi4πζ‘

λΩ kνk k2q

jνij‘ijji!:

(17)

This state preparation can be performed by initially rotating thefirst qubit to give the correct weighting between the U and V

R. Babbush et al.

3

Published in partnership with The University of New South Wales npj Quantum Information (2019) 92

Page 4: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

terms. We prepare the register |j⟩ in an equal superposition. If thefirst qubit is zero (for the V component) we also prepare thepenultimate register in an equal superposition over |i⟩. We do notneed to explicitly eliminate the case i= j, because in that case theoperation performed is the identity and therefore has no effect onthe evolution. Preparing an equal superposition over η values hascomplexity Oðlog ηÞ.In the case that the first qubit is one (for the U component), we

need to prepare the penultimate register in a superposition overj‘i with weightings

ffiffiffiffiζ‘

p. The nuclear charges ζ‘ will be given by a

classical database with complexity OðLÞ. To accomplish this onecan use the QROM and subsampling strategies discussed inrefs 7,9,38. Again recall that L ≤ η. In fact, usually L≪ η and theequality is only saturated for systems consistingly entirely ofhydrogen atoms. For a material, in practice there will be a limitednumber of nuclear charges with nuclei in a regular array, so thiscomplexity will instead be logarithmic in L. Similarly, for theselected operation, a regular array of nuclei will mean that thecomplexity of applying the phase factor e�ikν �R‘ is logarithmic in L.The key difficulty in implementing PREPARE is realizing the

superposition over ν with weightings 1/∥kν∥. That is, we aim toprepare a state proportional toXν2G0

1kνk kjνi: (18)

We describe this procedure in the next section. If there is a regulararray of nuclei then the overall complexity obtained isOðlogðηNt=ϵÞlogNÞ, where we use the fact that L < η. If a fullclassical database for the nuclei is required, then the complexitywill have an additional factor of OðL logðηNt=ϵÞÞ.Between implementing e−iTτ, SELECT, and PREPARE, the dominant

cost is Oðη log2NÞ for implementing e−iTτ. There is also a cost ofOðlogðηNt=ϵÞlogNÞ for computing kν � R‘, but in practice it shouldbe smaller. The factor of logðt Ak k=ϵλÞ from ref. 10 will also besmaller. These are the costs of a single segment, and the numberof segments is given by Eq. (8) as ~OðλtÞ, with λ ¼ Oðη5=3N1=3Þ.Thus, the total complexity is ~Oðη8=3N1=3tÞ.

Preparing the momentum stateIn this section we develop a surprisingly efficient algorithm forpreparing the state in Eq. (18). Since this step would otherwise bethe bottleneck of our algorithm, our implementation is crucial forthe overall scaling. The general approach is to use a series of largerand larger nested cubes, each of which is larger than the previousby a factor of 2. The index μ controls which cube we consider. Foreach μ we prepare a set of ν values in that cube. We initiallyprepare a superposition state

1ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2nþ1 � 4

pXnμ¼2

ffiffiffiffiffi2μ

pjμi (19)

which ensures that we obtain the correct weighting for each cube.This state may be prepared with complexity OðnÞ, which is lowcost because n is logarithmic in N. The overall preparation will beefficient since the value of 1/∥kν∥ does not vary by a large amountwithin each cube, so the amplitude for success is large. Thevariation of 1/∥kν∥ between cubes is accounted for by weightingin the initial superposition over μ.To simplify the description of the state preparation, we

assume that the representation of the integers for ν uses signbits. The sign bits will need to be taken account of in theaddition circuits. It also needs to be taken account of in thepreparation, because there are two distinct combinations thatcorrespond to zero. If each νx, νy, and νz is represented by n bits,then each will give numbers from −(2n−1− 1) to 2n−1− 1. Thatis, we have N1/3= 2n−1− 1. Controlled by μ we perform

Hadamards on μ of the qubits representing νx, νy, νz to representthe values from −(2μ−1− 1) to 2μ−1− 1.As mentioned above, due to the representation of the integers

the number zero is represented twice, with a plus sign and aminus sign. To ensure that all numbers have the same weightingat this stage, we will flag a minus zero as a failure. The totalnumber of combinations before flagging the failure is 23μ so thesquared amplitude is the inverse of this. Therefore, the state at thisstage is

1ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2nþ1 � 4

pXnμ¼2

X2μ�1�1

νx ;νy ;νz¼�ð2μ�1�1Þ2�μjμijνxijνyijνzi: (20)

Next, we test whether all of νx, νy, νz are smaller than (inabsolute value) 2μ−2. If they are, then the point is inside the boxfor the next lower value of μ, and we flag failure on an ancillaqubit. Note that for μ= 2 this means that we test whether ν= 0,which we need to omit. This requires testing if all of three bits forνx, νy, νz are zero. The three bits that are tested depend on μ, so thecomplexity is OðnÞ (due to the need to check all 3n qubits). Thestate excluding the failures can then be given as

1ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2nþ1 � 4

pXnμ¼2

Xν2Bμ

12μjμijνxijνyijνzi; (21)

where Bμ (for box μ) is the set of ν such that the absolute values ofνx, νy, νz are less than 2μ−1, but it is not the case that they are allless than 2μ−2. That is,

Bμ ¼ νjð0 jνxj<2μ�1Þ ^ ð0 jνy j<2μ�1Þ� ^ ð0 jνzj<2μ�1Þ^ ðjνx j � 2μ�2Þð _ðjνy j � 2μ�2Þ _ ðjνzj � 2μ�2ÞÞ:

(22)

Next we prepare an ancilla register in an equal superposition of|m⟩ for m= 0 to M− 1, where M is a power of two and is chosento be large enough to provide a sufficiently accurate approxima-tion of the overall state preparation. The preparation of thesuperposition for m can be obtained entirely using Hadamards.We test the inequality

ð2μ�2= νk kÞ2 >m=M: (23)

The left-hand side can be as large as 1 in this region, because wecan have just one of νx, νy, νz as large as 2μ−2, and the other twoequal to zero. That is, we are at the center of a face of the innercube. In order to avoid divisions which are costly to implement,the inequality testing will be performed as

ð2μ�2Þ2M>m ν2x þ ν2y þ ν2z

� �: (24)

The resulting state will be (omitting the parts where theinequality is not satisfied)

1ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiMð2nþ1 � 4Þp Xn

μ¼2

Xν2Bμ

XQ�1

m¼0

12μjμijνxijνyijνzijmi; (25)

where Q ¼ dMð2μ�2= νk kÞ2e is the number of values of msatisfying the inequality. The amplitude for each ν will then beproportional to the square root of the number of values of m, andso isffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

Mð2μ�2= νk kÞ2l mM22μð2nþ1 � 4Þ

vuut � 1

4ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2nþ1 � 4

p 1νk k :

(26)

The two sides are approximately equal for large M, and in thatlimit we obtain amplitudes proportional to 1/∥ν∥, as required. Wehave omitted the parts of the state flagged as failure, and thenorm squared of the success state gives the probability for

R. Babbush et al.

4

npj Quantum Information (2019) 92 Published in partnership with The University of New South Wales

Page 5: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

success. In the limit of large M, the norm squared is

Pn ¼ 125ð2n � 2Þ

X2n�1�1

νx ;νy ;νz¼�ð2n�1�1Þν≠0

1ν2x þ ν2y þ ν2z

: (27)

In the limit of large n, this expression can be approximated byan integral, which gives

Pn � 18

Z 1

0dxZ 1

0dyZ 1

0dz

1x2 þ y2 þ z2

: (28)

The integral is the box integral B3(−2) in ref. 39. In ref. 39, B3(−2)=3C2(−2, 1), and C2(−2, 1) is given by Eq. (40) of that work with a=1. That gives the asymptotic value

Pn � 38

Ti2ð3�ffiffiffi8

pÞ � Gþ π

2logð1þ

ffiffiffi2

h i¼ 0:2398¼ ; (29)

where Ti2 is the Lewin inverse tangent integral and G is theCatalan constant. After a single step of amplitude amplification,the probability of failure is

sin2 3arccosffiffiffiffiffiPn

p� �� �� 0:001261¼ : (30)

Numerically we find P2= 11/48, and it increases with n towardsthe analytically predicted value. Using a single step of amplitudeamplification brings the probability of success close to 1 (see Fig. 1).Note that the “failure” here does not mean that the entirealgorithm fails. In the case of “failure” of the state preparation onecan simply perform the identity instead of the controlled unitariesin the SELECT operation. The result is that a small known amount ofthe identity is added to the Hamiltonian, which can just besubtracted from any eigenvalue estimates. The amplitudeamplification triples the complexity for the state preparation.Next we consider the error in the state preparation due to the

finite value of M. The relevant quantity is the sum of the errors inthe squared amplitudes, as that gives the error in the weightingsof the operations applied to the target state. That error is upperbounded by

1Mð2nþ1 � 4Þ

Xnμ¼2

Xν2Bμ

122μ

<1

Mð2nþ1 � 4ÞXnμ¼2

2μ ¼ 1M: (31)

This error corresponds to the error in implementation of (U+ V)/λ.As discussed above, the error in this implementation, δ, can satisfylogð1=δÞ ¼ OðlogðηNt=ϵÞÞ. Since δ ¼ Oð1=MÞ, we can take the

number of bits of M as logM ¼ OðlogðηNt=ϵÞÞ. The complexitiesof the steps of this procedure are:

1. The register |μ⟩ can be represented in unary, so the statepreparation takes a number of gates (rotations andcontrolled rotations) equal to n� 1 ¼ OðlogNÞ, becausethe dimension is logarithmic in N.

2. The superposition over νx, νy, νz can be produced with 3n ¼OðlogNÞ controlled Hadamards. These Hadamards can becontrolled by qubits of the unary register used for |μ⟩.

3. Testing whether the negative zero has been obtained canbe performed with a multiply-controlled Toffoli with ncontrols, which has complexity OðnÞ ¼ OðlogNÞ.

4. Testing whether the value of ν is inside the inner box can beperformed by using a series of n multiply-controlled Toffoliswith 4 controls (with a unary qubit for |μ⟩), and one qubiteach from the registers for each of the components of ν. Thecomplexity is therefore OðnÞ ¼ OðlogNÞ.

5. The preparation of the equal superposition over m hascomplexity Oðlogð1=δÞÞ Hadamards.

6. The inequality test involves multiplications, and thereforehas complexity given by the product of the number of digits(better-scaling algorithms would only perform better for anunrealistically large number of digits). The complexity istherefore Oðlogð1=δÞlogNÞ.

The inequality test is the most costly step due to the multi-plications, and gives the overall cost of the state preparationalgorithm. Nevertheless, it still has logarithmic cost, so thecomplexity of the PREPARE operation will be negligible comparedto the costs of the other steps. This concludes our procedure forrealizing the state in Eq. (18), which completes our presentation ofthe overall simulation procedure.

DISCUSSIONThe low scaling dependence of our methods on N allows us toeasily overcome the constant factor difference in resolutionbetween plane waves and Gaussians. In fact, using thesealgorithms we expect that one can achieve precisions limitedonly by relativistic effects and the Born-Oppenheimer approxima-tion. However, the latter limitation can also be alleviated by ourapproach since one can use enough plane waves to reasonablyspan the energy scales required for momentum transfer betweennuclei and electrons, and thus support simulations with explicitquantum treatment of the nuclei. We also expect that ourapproach could be viable for the first generation of fault-tolerantquantum computers.Let us consider the calculation of the FeMoco cofactor of the

Nitrogenase enzyme discussed in refs 40–42 which involved 54electrons and 108 Gaussian spin-orbitals. FeMoco is the active siteof biological Nitrogen fixation and its electronic structure hasremained elusive to classical methods. The work of ref. 40 foundthat roughly 1015 T gates would be required, which translates toneeding roughly 108 physical qubits if implemented in the surfacecode with gates at 10−3 error rate. The large qubit count herearises from needing to parallelize magic state distillation (thesystem register would need only about 105 physical qubits). Incomparison, the OðN3Þ scaling algorithm of ref. 9 has been shownto require less than 109 T gates to solve a molecule with 100 planewave spin-orbitals (which is not enough resolution for FeMoco).Supposing we use 106 plane wave spin-orbitals for these 54

electrons our algorithm would require roughly 103 logical qubits(which can be encoded in roughly 106 physical qubits under thearchitecture assumptions discussed in ref. 9, which are moreconservative than those in ref. 40). Under these assumptions thevalue of η8/3N1/3 is only about 4 × 106, though there will besignificant logarithmic and constant factors in the gate complex-ity. In comparison N8/3/η2/3 for the approach of ref. 10 would be

2 4 6 8 10 12 14 16 180

1

2

3

4

5

6

failu

re p

roba

bilit

y

10-3

Fig. 1 The failure probability for the state preparation after a singlestep of amplitude amplification. The horizontal dotted line showsthe predicted asymptotic value from Eq. (30)

R. Babbush et al.

5

Published in partnership with The University of New South Wales npj Quantum Information (2019) 92

Page 6: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

about 7 × 1014. While further work would be needed to determinethe precise gate counts, it seems reasonable that gate countswould be low enough to perform magic state distillation in serieswith a single T factory. This back-of-the-envelope estimate suggeststhat our approach could surpass the accuracy of the FeMocosimulation discussed in ref. 40 while using fewer physical qubits.Using such a large basis may also alleviate the need for active spaceperturbation techniques such as those discussed in ref. 43.Although we have used the interaction picture to achieve our

~Oðη8=3N1=3tÞ complexity, it is also possible to achieve sublinearcomplexity in N without the interaction picture. This is because thevalue of λ associated with the kinetic operator T is Oðη1=3N2=3Þ.8Thus, one could use qubitization and signal processing17,44 whereT is simulated using LCU methods. Then, the overall complexity ofour approach would be ~Oðη8=3N1=3t þ η4=3N2=3tÞ, and the constantfactors in the scaling might be smaller.

Received: 19 June 2019; Accepted: 9 September 2019;

REFERENCES1. Feynman, R. P. Simulating physics with computers. Int. J. Theor. Phys. 21, 467–488

(1982).2. Lloyd, S. Universal quantum simulators. Science 273, 1073–1078 (1996).3. Abrams, D. S. & Lloyd, S. Simulation of many-body Fermi systems on a universal

quantum computer. Phys. Rev. Lett. 79, 2586–2589 (1997).4. Aspuru-Guzik, A., Dutoi, A. D., Love, P. J. & Head-Gordon, M. Simulated quantum

computation of molecular energies. Science 309, 1704 (2005).5. Whitfield, J. D., Biamonte, J. & Aspuru-Guzik, A. Simulation of electronic structure

Hamiltonians using quantum computers. Mol. Phys. 109, 735–750 (2011).6. Wecker, D., Bauer, B., Clark, B. K., Hastings, M. B. & Troyer, M. Gate-count estimates

for performing quantum chemistry on small quantum computers. Phys. Rev. A 90,022305 (2014).

7. Berry, D. W., Gidney, C., Motta, M., McClean, J. & Babbush, R. Qubitization ofarbitrary basis quantum chemistry by low rank factorization. https://arxiv.org/abs/1902.02134 (2019).

8. Babbush, R. et al. Low-depth quantum simulation of materials. Phys. Rev. X 8,011044 (2018).

9. Babbush, R. et al. Encoding electronic spectra in quantum circuits with linear Tcomplexity. Phys. Rev. X 8, 041015 (2018).

10. Low, G. H. & Wiebe, N. Hamiltonian simulation in the interaction picture. https://arxiv.org/abs/1805.00675 (2018).

11. Harl, J. & Kresse, G. Cohesive energy curves for noble gas solids calculated byadiabatic connection fluctuation-dissipation theory. Phys. Rev. B 77, 45136 (2008).

12. Shepherd, J. J., Grüneis, A., Booth, G. H., Kresse, G. & Alavi, A. Convergence ofmany-body wave-function expansions using a plane-wave basis: From homo-geneous electron gas to solid state systems. Phys. Rev. B 86, 35111 (2012).

13. Helgaker, T., Klopper, W., Koch, H. & Noga, J. Basis-set convergence of correlatedcalculations on water. J. Chem. Phys. 106, 9639–9646 (1998).

14. Halkier, A. et al. Basis-set convergence in correlated calculations on Ne, N2, andH2O. Chem. Phys. Lett. 286, 243–252 (1998).

15. Kivlichan, I. D. et al. Quantum simulation of electronic structure with linear depthand connectivity. Phys. Rev. Lett. 120, 110501 (2018).

16. Kivlichan, I. D. et al. Improved fault-tolerant quantum simulation of condensed-phase correlated electrons via Trotterization. https://arxiv.org/abs/1902.10673(2019).

17. Low, G. H. & Chuang, I. L. Hamiltonian simulation by qubitization. Quantum 3, 163(2019).

18. Ortiz, G., Gubernatis, J. E., Knill, E. & Laflamme, R. Quantum algorithms for fer-mionic simulations. Phys. Rev. A 64, 22319 (2001).

19. Bravyi, S. & Kitaev, A. Fermionic quantum computation. Ann. Phys. 298, 210–226(2002).

20. Seeley, J. T., Richard, M. J. & Love, P. J. The Bravyi-Kitaev transformation forquantum computation of electronic structure. J. Chem. Phys. 137, 224109 (2012).

21. Setia, K. & Whitfield, J. D. Bravyi-Kitaev Superfast simulation of fermions on aquantum computer. J. Chem. Phys. 148, 164104 (2018).

22. Bravyi, S., Gambetta, J. M., Mezzacapo, A. & Temme, K. Tapering off qubits tosimulate fermionic Hamiltonians. https://arxiv.org/abs/1701.08213 (2017).

23. Jiang, Z., McClean, J., Babbush, R. & Neven, H. Majorana loop stabilizer codes forerror correction of fermionic quantum simulations. https://arxiv.org/abs/1812.08190 (2018).

24. Berry, D. W. et al. Improved techniques for preparing eigenstates of fermionicHamiltonians. npj Quantum Inf. 4, 22 (2018).

25. Boghosian, B. M. & Taylor, W. Simulating quantum mechanics on a quantumcomputer. Phys. D: Nonlinear Phenom. 120, 30–42 (1998).

26. Zalka, C. Efficient simulation of quantum systems by quantum computers.Fortschr. der Phys. 46, 877–879 (1998).

27. Lidar, D. A. & Wang, H. Calculating the thermal rate constant with exponentialspeedup on a quantum computer. Phys. Rev. E 59, 2429–2438 (1999).

28. Kassal, I., Jordan, S. P., Love, P. J., Mohseni, M. & Aspuru-Guzik, A. Polynomial-timequantum algorithm for the simulation of chemical dynamics. Proc. Natl Acad. Sci.USA 105, 18681–18686 (2008).

29. Ward, N. J., Kassal, I. & Aspuru-Guzik, A. Preparation of many-body states forquantum simulation. J. Chem. Phys. 130, 194105–194114 (2008).

30. Kivlichan, I. D., Wiebe, N., Babbush, R. & Aspuru-Guzik, A. Bounding the costs ofquantum simulation of many-body physics in real space. J. Phys. A: Math. Theor.50, 305301 (2017).

31. Toloui, B. & Love, P. J. Quantum algorithms for quantum chemistry based on thesparsity of the CI-matrix. https://arxiv.org/abs/1312.2579 (2013).

32. Babbush, R. et al. Exponentially more precise quantum simulation of fermions inthe configuration interaction representation. Quantum Sci. Technol. 3, 015006(2018).

33. Martin, R. Electronic Structure. (Cambridge University Press, Cambridge, UK, 2004).34. Füsti-Molnar, L. & Pulay, P. Accurate molecular integrals and energies using

combined plane wave and gaussian basis sets in molecular electronic structuretheory. J. Chem. Phys. 116, 7795–7805 (2002).

35. Berry, D. W., Childs, A. M., Cleve, R., Kothari, R. & Somma, R. D. SimulatingHamiltonian dynamics with a truncated Taylor series. Phys. Rev. Lett. 114, 90502(2015).

36. Childs, A. M. & Wiebe, N. Hamiltonian simulation using linear combinations ofunitary operations. Quantum Inf. Comput. 12, 901–924 (2012).

37. Berry, D. W., Childs, A. M., Cleve, R., Kothari, R. & Somma, R. D. Exponentialimprovement in precision for simulating sparse Hamiltonians. In STOC ’14 Pro-ceedings of the 46th Annual ACM Symposium on Theory of Computing, 283–292(2014).

38. Low, G. H., Kliuchnikov, V. & Schaeffer, L. Trading T-gates for dirty qubits in statepreparation and unitary synthesis. https://arxiv.org/abs/1812.00954 (2018).

39. Bailey, D. H., Borwein, J. M. & Crandall, R. E. Advances in the theory of boxintegrals. Math. Comput. 79, 1839–1866 (2010).

40. Reiher, M., Wiebe, N., Svore, K. M., Wecker, D. & Troyer, M. Elucidating reactionmechanisms on quantum computers. Proc. Natl Acad. Sci. USA 114, 7555–7560(2017).

41. Motta, M. et al. Low rank representations for quantum simulation of electronicstructure. https://arxiv.org/abs/1808.02625 (2018).

42. Li, Z., Li, J., Dattani, N. S., Umrigar, C. J. & Chan, G. K.-L. The electronic complexityof the ground-state of the FeMo cofactor of nitrogenase as relevant to quantumsimulations. J. Chem. Phys. 150, 024302 (2019).

43. Takeshita, T. et al. Increasing the representation accuracy of quantum simulationsof chemistry without extra quantum resources. Rev. Lett. 118, 010501 (2017).

44. Low, G. H. & Chuang, I. L. Optimal Hamiltonian simulation by quantum signalprocessing. Phys. Rev. Lett. 118, 010501 (2017).

ACKNOWLEDGEMENTSThe authors thank Ian Kivlichan and Craig Gidney for helpful discussions, as well asArtur Scherer, Yuan Su and Zhang Jiang for feedback on an early draft. D.W.B. isfunded by Australian Research Council Discovery projects (Grant Nos. DP160102426and DP190102633).

AUTHOR CONTRIBUTIONSR.B. and D.W.B. jointly developed the algorithms, performed the complexity analysis,and co-wrote the manuscript. J.M. and H.N. assisted with writing and discussions ofthe first-quantized representation.

COMPETING INTERESTSThe authors declare no competing interests.

R. Babbush et al.

6

npj Quantum Information (2019) 92 Published in partnership with The University of New South Wales

Page 7: Quantum simulation of chemistry with sublinear scaling in basis … · Quantum simulation of chemistry with sublinear scaling in basis size Ryan Babbush 1*, Dominic W. Berry2, Jarrod

ADDITIONAL INFORMATIONCorrespondence and requests for materials should be addressed to R.B.

Reprints and permission information is available at http://www.nature.com/reprints

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claimsin published maps and institutional affiliations.

Open Access This article is licensed under a Creative CommonsAttribution 4.0 International License, which permits use, sharing,

adaptation, distribution and reproduction in anymedium or format, as long as you giveappropriate credit to the original author(s) and the source, provide a link to the CreativeCommons license, and indicate if changes were made. The images or other third partymaterial in this article are included in the article’s Creative Commons license, unlessindicated otherwise in a credit line to the material. If material is not included in thearticle’s Creative Commons license and your intended use is not permitted by statutoryregulation or exceeds the permitted use, you will need to obtain permission directlyfrom the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2019

R. Babbush et al.

7

Published in partnership with The University of New South Wales npj Quantum Information (2019) 92