Constrained Variational Quantum Eigensolver: Quantum Computer

Dec 4, 2018 - ... of the constrained VQE by simulating PESs of various states of H2 and H2O on Rigetti Computing Inc.'s 19Q-Acorn quantum processor...
0 downloads 0 Views 650KB Size
Article Cite This: J. Chem. Theory Comput. 2019, 15, 249−255

pubs.acs.org/JCTC

Constrained Variational Quantum Eigensolver: Quantum Computer Search Engine in the Fock Space Ilya G. Ryabinkin,†,‡ Scott N. Genin,§ and Artur F. Izmaylov*,†,‡ †

Department of Physical and Environmental Sciences, University of Toronto Scarborough, Toronto, Ontario M1C 1A4, Canada Chemical Physics Theory Group, Department of Chemistry, University of Toronto, Toronto, Ontario M5S 3H6, Canada § OTI Lumionics Inc., 100 College Street No. 351, Toronto, Ontario M5G 1L5, Canada

Downloaded via EASTERN KENTUCKY UNIV on January 24, 2019 at 12:47:06 (UTC). See https://pubs.acs.org/sharingguidelines for options on how to legitimately share published articles.



ABSTRACT: Variational quantum eigensolver (VQE) is an efficient computational method promising chemical accuracy in electronic structure calculations on a universal-gate quantum computer. However, such a simple task as computing the electronic energy of a hydrogen molecular cation, H2+, is not possible for a general VQE protocol because the calculation will invariably collapse to a lower energy of the corresponding neutral form, H2. The origin of the problem is that VQE effectively performs an unconstrained energy optimization in the Fock space of the original electronic problem. We show how this can be avoided by introducing necessary constraints directing VQE toward the electronic state of interest. The proposed constrained VQE can find an electronic state with a certain number of electrons, a certain spin, or any other property. Moreover, the new algorithm naturally removes unphysical kinks in potential energy surfaces (PESs), which frequently appeared in the regular VQE and required significant additional quantum resources for their removal. We demonstrate the performance of the constrained VQE by simulating PESs of various states of H2 and H2O on Rigetti Computing Inc.’s 19Q-Acorn quantum processor.

1. INTRODUCTION Quantum chemistry seeks the exact solution of the electronic Schrödinger equation,1 Ĥ e|Ψi(R)⟩ = Ei(R)|Ψi(R)⟩

rigorously equivalent to the exact solution of the electronic structure problem;14,15 rather, it gives numerical results of chemical accuracy and is exponentially hard for a classical computer. Recent experimental work by Kandala et al.16 demonstrated successful quantum simulations by means of the tailored VQE ansatz for PESs of a few selected small molecules: H2, LiH, and BeH2. Despite the impressive results, there were still visible imperfections, or “kinks”, in the simulated PESs, the origins of which were not clear. The authors attributed them to the limited accuracy of simulations and claimed that they could be removed by increasing resource requirements. Yet, it is still desirable to disentangle the difficulties related to experimental realization from a possible incompleteness of the employed formalism. One of the main goals of quantum chemistry is to produce smooth PESs that can be used further in modeling chemical dynamics. Therefore, having kinks is a significant drawback that cannot be left unresolved. Another problem that has not received enough attention is how to obtain information about electronic states with different numbers of electrons (e.g., cations and anions) or different spins (e.g., singlets, triplets, etc.). The key to understanding both problemseliminating PES kinks and obtaining PESs for different charge and spin electronic states

(1)

where Ĥ e is the electronic Hamiltonian of a molecule with a fixed nuclear configuration R, Ei(R) are its eigenvalues, also known as potential energy surfaces (PESs), and |Ψi(R)⟩ are the corresponding electronic wave functions. Even though this is only the electronic part of the total molecular quantum problem, it determines systems’ properties crucial for designing new materials2,3 and pharmaceutical compounds.4 The main computational difficulty in tackling this problem is the exponential growth of complexity with the number of interacting particles (electrons). This exponential scaling makes it infeasible to obtain high accuracy for large systems (e.g., materials and proteins) on a classical computer. Various approximations compromising the accuracy become necessary.1,5 There is a hope to overcome the exponential scaling by using a universal quantum computer.6,7 The earliest proposal was the quantum phase estimation algorithm,8−10 which was quite successful in terms of accuracy but placed strong requirements on quantum hardware to maintain coherence for a long time. As an alternative with reduced coherency requirements, the variational quantum eigensolver (VQE) has been suggested.11−13 However, a unitary coupled cluster (UCC) ansatz with a fixed excitation rank used in VQE is not © 2018 American Chemical Society

Received: September 17, 2018 Published: December 4, 2018 249

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation is the first step in the formulation of the electronic structure problem for quantum computing. To encode the electronic Hamiltonian using qubits, one needs to start not with the Hilbert space formulation (eq 1) but rather with the so-called second-quantized formulation of the Hamiltonian, which operates in the Fock space. The Fock space for a particular molecule combines the Hilbert spaces of all molecular forms with all possible numbers of electrons. This leads to an interesting problem: for molecule A there is only one Hamiltonian, whose eigenvalues are electronic energies of A, A±, A2±, etc. Since the electronic energy of a cation is always higher than that for a neutralotherwise a molecule would be auto-ionizingit becomes an excited state in the full spectrum. Any variational method aimed at unconditional minimization of energy will converge to the state of a neutral A, leaving A+ inaccessible. Even worse, for any molecule with a positive electron affinity, the lowest-energy solution is an anion rather than the neutral form. A similar situation occurs with the total electron spin, when the spin multiplicity of the lowest energy state could be different from the one that is of interest. The problem of finding excited states within VQE has already received some attention. Later on, several approaches, including both constraints and explicit parametrization of the electronic excitation manifolds, were considered in refs 17 and 18. However, these works did not make a sharp distinction between excited states that have the same exact fermionic symmetries, such as the number of electrons and spin, and those that do not. This distinction is quite important though. The physical electronic Hamiltonian does not couple states with different spins and the number of electrons; thus, any approximate method that introduces such a coupling must be remedied. We will show that, in its current form, VQE leads to kinks in PESs due to variational instabilities that cause switches between electronic states of different symmetries within the Fock space. These issues also lead to the inability of current simulation protocols to compute PESs of molecular cations. A particularly simple example of this problem is H2+, which is an exactly solvable problem that dates back to the early days of quantum mechanics.19,20 We resolve all these issues by introducing the constrained modification of the VQE, which is indispensable for quantum chemistry applications. The idea of symmetry constraints and constraint optimization was first discussed in ref 21 in the context of preserving correct symmetries after the Trotterization in the UCC method.

A Hamiltonian of a free molecule in the absence of an external electromagnetic field forms a set of commuting operators with the electron number operator, N̂ , the zprojection of the total molecular spin, Ŝ z, and the square of the total spin, Ŝ 2. (The last two should not be confused with the corresponding qubit operators.) All of these operators have second-quantized forms that can be found in ref 1. Quantum computers employ two-level systems (“qubits”) as the computational basis. Qubits can be thought of as spin-1/2 particles, although real quantum computers may not use genuine spins.11,16 The fermionic Hamiltonian (eq 2) is translated from fermionic to qubit representation by one of the fermion-to-qubit mappings, either the Jordan−Wigner (JW) or the more recent and resource-efficient Bravyi−Kitaev (BK) transformation.22,23 After the JW or BK transformation, all operators become operators in qubit space; for instance, Ĥ e assumes the form Ĥ =

I

Nb

∑ hijaî †aĵ + ij

1 2

TÎ = ··· ω1(I )ω0(I )

ijkl

(4)

which we call “Pauli words” for the sake of brevity. Each ω(I) i denotes one of the Pauli matrices, xi, yi, or zi, operating on the ith qubit. Ĥ is an Nb-qubit operator that has a 2Nb×2Nb matrix representation. Importantly, not only the matrix dimension but also the whole spectrum of the qubit Hamiltonian (eq 3) are identical to their fermionic counterparts (eq 2). Thus, finding the eigenstates of the qubit Hamiltonian (eq 3) is equivalent to the solving the quantum chemistry problem. As an illustration, we consider the H2 molecule in the minimal STO-3G basis (Nb = 4). The fermionic Hamiltonian of this system describes 2Nb = 16 electronic states. The presence of states of different spin and number of electrons does not pose a difficulty in ordinary quantum chemistry on a classical computer because the electronic Hamiltonian is projected onto a Hilbert subspace corresponding to the electronic state of interest. This projection is done via use of Slater determinants. They implicitly fix the number of particles N = ⟨N̂ ⟩, Sz = ⟨Ŝ z⟩, and even ⟨Ŝ 2⟩ = S(S + 1) if appropriate combinations (configurations) of Slater determinants are chosen. Figure 1 presents the lowest singlet and triplet electronic PESs of the H2 molecule and the ground-state PES of its cation obtained by the full configuration interaction approach. Using the BK transformation, the electronic Hamiltonian in the STO-3G basis is mapped to the same number (Nb = 4) of qubits. The resulting Hamiltonian (all Hamiltonians are generated using the OpenFermion software24) has 15 Pauli words multiplied by a coefficient inferred from one- and twoelectron integrals (hij and gijkl) at a given interatomic distance R. For example, at R = 0.75 Å, we have

Nb

∑ gijklaî †ak̂ †al̂ aĵ

(3)

where CI coefficients are functions of one- and two-electron integrals and T̂ I are products of several spin operators,

2. RESULTS 2.1. Operators in the Fock and Qubit Spaces. Formulation of the electronic structure problem for a quantum computer starts from the electronic Hamiltonian Ĥ e in the second-quantized form, Ĥ e =

∑ CITÎ

(2)

where â†i and âi are fermionic creation and annihilation operators corresponding to a one-electron state ϕi within an Nb one-electron basis set.1 The coefficients hij and gijkl are oneand two-electron integrals, respectively. Nb determines the computational cost of solving the electronic Schrödinger equation because computational expenses grow exponentially with Nb if no approximations are made. 250

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation

Figure 2. The two lowest eigenstates of the Hamiltonian Ĥ BK(R) (solid lines) and the PES corresponding to the minimum of the qubit mean field (QMF) functional, eq 12 (dashed line). Points with error bars correspond to QMF calculations performed on Rigetti’s 19QAcorn quantum computer. Error bars show the standard deviation over measured values.

Figure 1. The two lowest PESs of the H2 molecule and the groundstate PES of the H2+ cation obtained using the full configuration interaction method in the STO-3G basis.

ĤBK(R )|R = 0.75Å = −0.109731 + 0.169885z 0 + 0.168212z1 + 0.169885z1z 0

2.2. Variational Quantum Eigensolver (VQE). VQE relies on parametrization of a wave function that can be implemented as a quantum circuit. Originally,11 it was proposed to use the UCC ansatz,

+ 0.0454429x 2z1x0 − 0.218863z 2 + 0.0454429y2 z1y0 + 0.120051z 2z 0 + 0.165494z 2z1z 0 + 0.173954z 3z1 + 0.0454429z 3x 2z1x0 + 0.120051z 3z 2z 0

† |Ψ⟩ = exp(T̂ − T̂ )|Φref ⟩

+ 0.0454429z 3y2 z1y0 − 0.218863z 3z 2z1 + 0.165494z 3z 2z1z 0

where T̂ is a sum of fermionic single-, double-, etc. excitation operators, and |Φref⟩ is a suitably chosen reference function, usually the qubit image of the Hartree−Fock ground state. Contrary to the traditional coupled-cluster form, UCC leads to non-terminating Baker−Campbell−Hausdorff series,25 even at the fixed excitation rank, and hence is exponentially hard for a classical computer but only polynomially complex (via Trotterization26) for a quantum computer. However, a large prefactor of the UCC form prompted Kandala et al.16 to propose a more general, “hardware-efficient” alternative, which we consider below with some further simplifications. A trial wave function for an Nb-qubit problem is

(5)

(The nuclear−nuclear repulsion energy 1/R = 0.705333 au is included in this Hamiltonian.) Diagonalization of this Hamiltonian in the 2Nb = 16-dimensional qubit space provides the same eigenvalues, but the information about the number of electrons N, or ⟨Ŝ 2⟩ for corresponding eigenstates, is now hidden. Let us consider the two lowest exact PESs of the H2 molecule that were calculated by full diagonalization of the qubit Hamiltonian Ĥ BK(R) for different R (Figure 2). We track the physical nature of the solutions using properties corresponding to commuting observables: first, we constructed the BK-transformed operators N̂ and Ŝ 2: N̂BK = 2 − (z 0 + z1z 0 + z 2 + z 3z 2z1)/2

|Ψ(Ω, τ )⟩ = UENT(τ )UMF(Ω)|00 ... 0⟩

(9)

where |00...0⟩ is an initialized Nb-qubit state and UMF(Ω) is a q product of rotations of individual qubits, U MF (θ) = 3 exp(−iθq1zq) exp(−iθ2qxq) exp(−iθq3 zq), where {θqj }j=1 are three Euler angles of the qth qubit. Ω is a subset of Euler angles for all qubits that transforms product states into each other up to a global phase. Below we show that Ω conveniently parametrizes the product of the so-called spin-coherent (Bloch) states. UENT(τ) is a product of operators that entangle two or more qubits. Individual factors in UENT(τ) are the exponent of Pauli words multiplied by the corresponding amplitude, exp(−iτIT̂ I); they are responsible for post-meanfield treatment of electron−electron correlation effects. Kandala et al.16 used only two-qubit Pauli words and fixed amplitudes to protect entanglement from noise and decoherence, and they relied on single-qubit rotations interleaved with entanglers to provide variational parameters associated with multi-qubit transformations, but in general, amplitudes τ can be varied directly. Once the trial form (eq 9) for a fixed set of parameters is implemented as a quantum circuit and executed, the expectation value of the Hamiltonian (eq 3) is calculated from measurements of individual Pauli words, T̂ I, as

(6)

2

̂ = (6 − 3z1 + x 2x0 − x 2z1x0 + y y + z 2z 0 − z 2z1z 0 SBK 2 0 − 3z 3z1 − y2 z1y0 + z 3x 2x0 − z 3x 2z1x0 + z 3y2 y0 − z 3y2 z1y0 + z 3z 2z 0 − z 3z 2z1z 0)/8

(8)

(7)

and then evaluated the mean values of these operators on the calculated exact states. First, for R ≤ 0.7 Å, the first excited state corresponds to the state of H2+, N = 1, while for larger R, it is a triplet state of the neutral molecule, N = 2, ⟨Ŝ 2⟩ = 2. Thus, in the STO-3G basis set, the triplet state changes its position in the spectrum as R varies. The cationic ground state is among the excited states and intersects with the triplet H2 state, forming a kink due to the energy ordering of the electronic states. Therefore, one of the reasons for kinks in quantum calculations can be intersections of states that originally belonged to different Hilbert spaces of the fermionic problem and are brought within the same qubit space by using the Fock-space second-quantized Hamiltonian (eq 2). 251

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation E(Ω, τ ) = ⟨Ψ(Ω, τ )|Ĥ |Ψ(Ω, τ )⟩ =

,(Ω, τ , μ) = ⟨Ψ(Ω, τ )|Ĥ |Ψ(Ω, τ )⟩

∑ CI⟨Ψ(Ω, τ )|TÎ |Ψ(Ω, τ )⟩

+

i

(10)

I

(11)

Ω, τ

(13)

where Ô i are constraining operators (e.g., N̂ , Ŝ 2, etc.), Oi are their desired mean values, and μi are large fixed numbers.31 Comparing operators in eqs 5 and 6, one can see that they share the same Pauli words, which means that the value ⟨Ψ(Ω,τ)|Ô i|Ψ(Ω,τ)⟩ can be formed by reusing values of ⟨Ψ(Ω,τ)|T̂ I|Ψ(Ω,τ)⟩ at zero additional cost. To obtain the lowest energy mean-field solutions of neutral H2 with well-defined electron spin, we minimize the following functional:

Finally, the function E(Ω,τ) is minimized on a classical computer, E = min E(Ω, τ )

∑ μi [⟨Ψ(Ω, τ )|Oî |Ψ(Ω, τ )⟩ − Oi]2

giving the estimate of the lowest-energy eigenvalue of the qubit Hamiltonian (eq 3). Such a two-step procedure allows for a feedback loop where the classical optimizer directs the quantum computer to encode trial wave functions that are closer in variational sense to the ground-state wave function of a system with the fermionic Hamiltonian (eq 2). For a single-qubit rotation in UMF(Ω) of eq 9, only two out of the three Euler angles change the total energy; the third angle defines a global phase change, which does not affect the energy. A convenient basis for the Hilbert space of individual qubits representing these relations is a basis of spin coherent states,27−30 {|Ωq⟩}, q = 1, 2, ..., Nb, where Ω = (ϕ,θ) encodes a position of a qubit orientation on the Bloch sphere (see Methods for more formal definitions). The direct product of individual qubit coherent states forms the Nb-qubit mean-field solution,

̂ 2 |Ω⟩ − S(S + 1)]2 ,S(Ω, μ) = EQMF(Ω) + μ[⟨Ω|SBK (14)

where S is either 0 (singlet) or 1 (triplet). The PESs of such constrained minimizations do not exhibit any kinks and retain their target spin values at all R (Figure 3). The constrained

|Ω⟩ = UMF(Ω)| ´00 ÖÖÖÖÖÖ≠...ÖÖÖÖÖÖ0Æ ⟩ Nb

The optimal values of Ω can be obtained using the variational principle:30 if E0 is the ground-state energy for the Hamiltonian in eq 3, then E0 ≤ ⟨Ω|Ĥ |Ω⟩ = EQMF(Ω). Therefore, ⟨Ω|Ĥ |Ω⟩ defines the qubit mean-f ield energy functional, EQMF(Ω) =

∑ I

CIFI (n1(I ),

...,

n(NI)b)

Figure 3. Three constrained mean-field PESs for the lowest singlet (S = 0) and triplet (S = 2) electronic states of H2 and the ground electronic state of H2+ (N = 1). The exact PESs for all but the singlet H2 state coincide with the constrained mean-field solutions. Points with error bars correspond to constrained QMF calculations performed on Rigetti’s 19Q-Acorn quantum computer. Error bars show the standard deviation over measured values.

(12)

where each FI is obtained from T̂ I in eq 3 by substituting ω(I) i → n(I) i and converting the operator into products of functions. (I) n(I) i is a shorthand notation for the ωi component of the unit vector on a Bloch sphere: n = (cos ϕ sin θ, sin ϕ sin θ, cos θ). The ground-state mean-field solution for H2, EQMF (Figure 2), which behaves like the restricted Hartree−Fock (RHF) curve for small R, has a second type of kink near R ≈ 1.6 Å. This kink is due to switching of a mean-field minimum from a singlet (S = 0) to a triplet (S = 1) solution. To expose the second type of kink in quantum computing for PESs in their most vivid form, we avoided using entanglers. Generally, entanglers are supposed to bring the mean-field solution closer to the exact one. The latter is smooth in this case (Figure 2); therefore, if the entanglers fully accomplished the task, there would be no kink. However, in practical calculations, there is no general prescription how to choose the entangler that rigorously guarantees convergence to the exact answer. Thus, any approximate entangler can make kinks originating in mean-field solutions less pronounced but still present. 2.3. Constrained Variational Quantum Eigensolver. To modify the variational procedure to include information about N and ⟨Ŝ 2⟩ of the target state, we use the constrained optimization. A constrained minimization is readily applicable to VQE by adding a penalty to the energy functional,

mean-field singlet PES coincides with the RHF curve and demonstrates the same asymptotic behavior by going to the incorrect dissociation limit that is exactly in between purely covalent H• + H• and ionic H+ + H− solutions. To correct for this behavior requires addition of an entangler. On the other hand, the triplet mean-field counterpart reproduces the exact triplet PES because there is no electron−electron correlation for the triplet state in this minimal basis setup. Similarly, the constrained minimization of the functional ,N (Ω, μ) = EQMF(Ω) + μ[⟨Ω|N̂BK |Ω⟩ − 1]2

(15)

that imposes the N = 1 constraint has been employed to extract the lowest PES of H2+ (Figure 3). The resulting curve is smooth and coincides with the exact H2+ PES due to the absence of electron−electron correlation. The constrained methodology can be easily extended to larger systems, where constraints become especially useful due to increasing density of electronic states. As an example, we consider the ground singlet state of the water molecule in the STO-3G basis. The water qubit Hamiltonian contains 193 Pauli words. It simulates six electrons (the remaining four 252

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation

We found that restriction of Sz was not giving any improvements in the considered cases. Moreover, the operators of conserved quantities can be used to post-process the results of measurements done on the quantum computer to reduce the noise due to qubit interactions with the environment. This post-processing does not affect the statistics of the true quantum distribution arising from the ideal projective measurement.

electrons are frozen) on four orbitals (three occupied and one virtual). Figure 4 shows its PES obtained by changing a single

3. METHODS 3.1. Spin Coherent States. A spin coherent state, also known as a “Bloch state”, for a single particle with spin j (j ≥ 0 is integer or half-integer) is defined by the action of an appropriately scaled exponent of the lowering operator ŝ− on the normalized eigenfunction of ŝz operator, ŝz|jm⟩ = m|jm⟩, with maximal projection m = j:30 ÄÅ ÉÑ θ yz ÅÅÅ ij θ yz iϕ ÑÑÑ 2j i j |Ω⟩ = cos jj zz expÅÅtanjj zz e s−̂ ÑÑ | jj⟩ ÅÅÇ k 2 { ÑÑÖ k2{ 1/2 j ij 2j yz zz cos j + mjij θ zyz sin j − mjij θ zyz e i(j − m)ϕ | jm⟩ = ∑ jjj j z j z j m + j zz k2{ k2{ m =−j k {

Figure 4. Restricted Hartree−Fock PESs for the lowest singlet (blue line) and triplet (red line) electronic states of H2O obtained on a classical computer. Points with error bars correspond to the constrained QMF calculations for the lowest singlet state performed on the Rigetti 19Q-Acorn quantum computer. Error bars show the standard deviation over measured values.

(16)

where the | jm⟩ states are normalized as

OH-bond length from the symmetric equilibrium configuration with R(OH) = 0.9605 Å and ∠HOH = 104.95°. Here, we used both spin and number of electrons constraints to obtain the mean-field solution. The spin constraint is invaluable for avoiding convergence to the closely spaced triplet solution (Figure 4). Another advantage of using the constraints in quantum computing is their capacity to reduce the noise in the measurement process.32 Generally, there are two sources of uncertainty when the Hamiltonian components are measured on the quantum computer: (1) the wave function encoded in qubits is not an eigenfunction of a particular Pauli word (TI), and hence there is an intrinsic quantum uncertainty for the TI measurement; (2) uncontrolled interactions of qubits with their environment introduce noise that is unrelated to the ideal, quantum uncertainty. A typical measurement on a quantum computer produces an eigenstate of a measured Pauli word, TI. We found that re-weighting results of the measurement based on overlaps of a collapsed wave function with eigenfunctions of the property operators (e.g., N̂ ) with target eigenvalues (fixed charge) strongly reduces the noise coming from the second source and does not alter the statistics originating from the truly quantum uncertainty. Our constraint-based post-processing scheme is detailed in the Methods section. 2.4. Discussion. We have proposed a simple constrained VQE approach that is indispensable if one seeks a solution of a quantum chemistry problem for an electronic state with a welldefined electronic spin, charge, or any other property of interest. The corresponding procedure requires minimal modification of the current VQE protocol and incurs virtually no additional quantum costs. Using the constrained VQE not only allows one to target specific states but also removes kinks in PESs arising due to numerical instabilities associated with the root switching. In the current study, only the electron number and the total spin operators have been used for imposing constraints. The zprojection of the total electron spin (Ŝ z) has not been constrained, although it is another symmetry that one can use.

ij 2j | jm⟩ = jjj jm + k

yz zz z j z{

1/2

[(j − m) !]−1 s−j − m | jj⟩ (17)

{|Ω⟩} constitutes an overcomplete non-orthogonal set of states on a unit Bloch sphere, parametrized by spherical angles Ω = (ϕ,θ), 0 ≤ ϕ < 2π, and 0 ≤ θ ≤ π. 3.2. Classical Minimization. Constrained (eqs 14 and 15) and unconstrained (eq 12) minimizations on a classical computer were done using the sequential quadratic programming (SQP) algorithm as implemented by the fmincon routine of the MATLAB33 software. All mean-field solutions were obtained by minimizing the corresponding energy functions with respect to all 4 × 2 = 8 Bloch angles. 3.3. Quantum Computer Simulation Details. We performed the simulations on the Rigetti 19Q-Acorn quantum processor unit (QPU)34 using pyQuil and Forest API.35 Our wave function ansatz was obtained by performing RZ and RX gate operations on individual qubits. This corresponds to mean-field rotations, i.e., without qubit entanglement. Qubits were selected on the basis of ensuring that the one-gate fidelity of the qubits was greater than 0.99. After the BK transformation, terms of the resulting Hamiltonian that form a mutually commutative set of operators simultaneously diagonalizable by single qubit rotations are grouped together to perform a measurement on all of them at the same time. Since all the operators within a commutative set share eigenfunctions, this procedure reduces the spread of measurement results due to general noncommutativity of the BK Hamiltonian and its terms. The expectation value of each commutative group was obtained by averaging over 1000 and 10 000 measurements for H2 and H2O, respectively. A post-processing procedure that removed results with incorrect electron numbers evaluated for each read was used for these measurements. It is shown below that this post-processing removes only results that appear due to experimental noise and does not alter quantum distributions of measurements. Upon assembling the expectation value of 253

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation the total Hamiltonian from the expectation values of commutative groups, this procedure was repeated 20 (4) times for H2 (H2O) to obtain representative statistics for the Hamiltonian expectation values. Averages and standard deviations calculated over these 20 (4) Hamiltonian expectation values are reported as the final averages and standard deviations obtained on the QPU. Since our time was limited on the Rigetti system, we were not able to perform a more indepth sampling procedure. All four experiments were performed in 24 h over the course of five sessions. For the classical optimization step for the VQE, we implemented the Nelder−Mead (NM) algorithm.36 Methods such as conjugate gradient descent were tried, but the NM algorithm demonstrated more robustness to the noise that was generated by errors. 3.4. Post-processing Procedure. Description of the Procedure. For illustration, let us assume that our Hamiltonian has two non-commuting parts, Ĥ =  + B̂ , [ ,B̂ ] ≠ 0 (e.g.,  and B̂ are two non-commuting Pauli words). Estimation of the average Ĥ on a wave function |Ψ⟩ is done by adding the averages from non-commuting parts, ⟨Ψ|Ĥ |Ψ⟩ = ⟨Ψ| |Ψ⟩ + ⟨Ψ|B̂ |Ψ⟩. The averages for both parts are computed by doing repetitive measurements, but these measurements collapse |Ψ⟩ to different eigenfunctions, because (1)  and B̂ do not share eigenfunctions, and (2) |Ψ⟩ is not generally an eigenfunction of  or B̂ . If we denote the eigenfunctions and eigenvalues of  (B̂ ) as |f n⟩(|gn⟩) and an(bn), respectively, then the Hamiltonian average is ⟨Ψ|Ĥ |Ψ⟩ =

∑ an |⟨Ψ|fn ⟩|2 + bn |⟨Ψ|gn⟩|2 n

̂ N̂ |Ψ⟩ = ⟨Ψ|PN̂ HP

∑ an |⟨Ψ|PN̂ |fn ⟩|2 + bn |⟨Ψ|PN̂ |gn⟩|2 n

(19)

Indeed, eigenvalues associated with |⟨Ψ|P̂ N|f n⟩|2 and |⟨Ψ|P̂ N| gn⟩|2 will not contribute if the corresponding eigenfunctions are orthogonal to the N-subspace: P̂ N|f n⟩ = 0 and P̂ N|gn⟩ = 0. On the other hand, assuming that |Ψ⟩ is within the N-subspace, ⟨Ψ|P̂ N = ⟨Ψ|, it is straightforward to see that ⟨Ψ|P̂ NĤ P̂ N|Ψ⟩ = ⟨Ψ|Ĥ |Ψ⟩, and hence, the Hamiltonian expectation values are not affected by the post-processing procedure. Noise Reduction. To understand how the post-processing reduces the noise related to uncontrolled qubit interactions with the environment, it is convenient to employ the density matrix formalism. Let us denote the ideal pure-state density as ρ0 = |Ψ0⟩ ⟨Ψ0|, while the real mixed-state density, appearing due to spurious interactions, is ρ = ∑i=0ωi |Ψi⟩ ⟨Ψi|. Some components associated with the noise ({|Ψi⟩}i≠0) violate the correct value for the number operator, and therefore, P̂ N|Ψi⟩ = 0; we will refer to the associated part of the density as reducible, ρR, while the rest of ρ will be referred to as irreducible, ρI = P̂ NρP̂ N. Substituting the Hamiltonian average with ρ, E̅ = Tr[ρĤ ]/Tr[ρ] by that with ρI, E̅ I = Tr[ρIĤ ]/ Tr[ρI] makes the results more accurate because it removes the density part associated with the wrong electron numbers, ρR. As in the pure-state consideration, the post-processing procedure is equivalent to considering the following average: ̂ N̂ ] Tr[ρPN̂ HP Tr[PN̂ ρPN̂ Ĥ ] = (20) Tr[ρPN̂ ] Tr[PN̂ ρPN̂ ]

(18)

=

The probabilities |⟨Ψ|f n⟩|2 and |⟨Ψ|gn⟩|2 are not measured but instead emerge as a result of collecting results of individual measurements of  and B̂ . The post-processing procedure simply removes the eigenvalues an and bn if corresponding eigenfunctions |f n⟩ and |gn⟩, available as read-outs of QPU, are orthogonal to those for the number of electrons operator. This procedure can be extended to involve the spin operator, but its eigenstates are more complicated and were not used in this work. In the case when eigenfunctions |f n⟩ (or |gn⟩) have nonzero overlap with eigenfunctions of symmetry operators, the corresponding results are not altered. As shown below, the reweighting does not change the correct statistics; it only removes contributions of wrong symmetry. Practically, the Rigetti 19Q-Acorn quantum processor provides access to read-outs using the read_and_measure routine.37 This routine generates bit strings of 0’s and 1’s encoding a wave function resulting from the collapse of the original wave function onto one of the eigenstates of the measured operator. Simultaneously, one can measure only Pauli words that commute qubit-wise, and extension of this restrictive protocol has been recently suggested.38 For the postprocessing, we used a group of Pauli words that commute with the electron number operator because its eigenstate has either zero or unit overlap with the eigenstate of the correct number of electrons. Those measurements that correspond to zero overlap are discarded. Invariance of the Quantum Average to the Postprocessing Procedure. The post-processing procedure based on the electron number operator is equivalent to introducing a projector P̂ N = |N⟩ ⟨N| to the eigen-subspace corresponding to the correct number of electrons, N̂ |N⟩ = N|N⟩:

Tr[ρI Ĥ ] Tr[ρI ]

(21)

Hence, it removes the reducible part of the density in the Hamiltonian average and produces a less noisy result. In eq 20, we used the projector property P̂ N = P̂ 2N and the invariance of trace with respect to cyclic permutations.



AUTHOR INFORMATION

Corresponding Author

*E-mail: [email protected]. ORCID

Artur F. Izmaylov: 0000-0001-8035-6020 Notes

The authors declare no competing financial interest.



ACKNOWLEDGMENTS The authors thank P. Brumer, M. Mosca, and V. Gheorghiu for stimulating discussions. The authors are grateful to the support that Will Zeng, Nick Rubin, and Ryan Karle provided in terms of discussion of applying the theory onto their hardware and for access to the 19Q-Acorn Quantum computer. OTI Lumionics Inc. would like to acknowledge the support the Creative Destruction Lab provided in facilitating the interbusiness collaborations between OTI Lumionics Inc. and Rigetti Computing Inc. A.F.I. acknowledges financial support from Natural Sciences and Engineering Research Council of Canada through the Engage grant.



REFERENCES

(1) Helgaker, T.; Jorgensen, P.; Olsen, J. Molecular Electronicstructure Theory; Wiley, 2000. 254

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255

Article

Journal of Chemical Theory and Computation (2) Martin, R. M. Electronic Structure: Basic Theory and Practical Methods; Cambridge University Press, 2004. (3) Prasad, R. Electronic Structure of Materials; Taylor & Francis, 2013. (4) Roy, K. Quantitative Structure-Activity Relationships in Drug Design, Predictive Toxicology, and Risk Assessment; Advances in Chemical and Materials Engineering; IGI Global, 2015. (5) Parr, R. G.; Yang, W. Density-functional theory of atoms and molecules; Oxford University Press, 1989; Vol. 16. (6) Lanyon, B. P.; Whitfield, J. D.; Gillett, G. G.; Goggin, M. E.; Almeida, M. P.; Kassal, I.; Biamonte, J. D.; Mohseni, M.; Powell, B. J.; Barbieri, M.; Aspuru-Guzik, A.; White, A. G. Towards quantum chemistry on a quantum computer. Nat. Chem. 2010, 2, 106−111. (7) Nielsen, M.; Chuang, I. Quantum Computation and Quantum Information: 10th Anniversary Edition; Cambridge University Press, 2010. (8) Abrams, D. S.; Lloyd, S. Simulation of Many-Body Fermi Systems on a Universal Quantum Computer. Phys. Rev. Lett. 1997, 79, 2586−2589. (9) Abrams, D. S.; Lloyd, S. Quantum Algorithm Providing Exponential Speed Increase for Finding Eigenvalues and Eigenvectors. Phys. Rev. Lett. 1999, 83, 5162−5165. (10) Aspuru-Guzik, A.; Dutoi, A. D.; Love, P. J.; Head-Gordon, M. Simulated Quantum Computation of Molecular Energies. Science 2005, 309, 1704−1707. (11) Peruzzo, A.; McClean, J.; Shadbolt, P.; Yung, M.-H.; Zhou, X.Q.; Love, P. J.; Aspuru-Guzik, A.; O’Brien, J. L. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 2014, 5, 4213. (12) O’Malley, P. J. J.; Babbush, R.; Kivlichan, I. D.; Romero, J.; McClean, J. R.; Barends, R.; Kelly, J.; Roushan, P.; Tranter, A.; Ding, N.; Campbell, B.; Chen, Y.; Chen, Z.; Chiaro, B.; Dunsworth, A.; Fowler, A. G.; Jeffrey, E.; Lucero, E.; Megrant, A.; Mutus, J. Y.; Neeley, M.; Neill, C.; Quintana, C.; Sank, D.; Vainsencher, A.; Wenner, J.; White, T. C.; Coveney, P. V.; Love, P. J.; Neven, H.; Aspuru-Guzik, A.; Martinis, J. M. Scalable Quantum Simulation of Molecular Energies. Phys. Rev. X 2016, 6, 031007. (13) Colless, J. I.; Ramasesh, V. V.; Dahlen, D.; Blok, M. S.; KimchiSchwartz, M. E.; McClean, J. R.; Carter, J.; de Jong, W. A.; Siddiqi, I. Computation of Molecular Spectra on a Quantum Processor with an Error-Resilient Algorithm. Phys. Rev. X 2018, 8, 011021. (14) Evangelista, F. A. Alternative single-reference coupled cluster approaches for multireference problems: the simpler, the better. J. Chem. Phys. 2011, 134, 224102. (15) Harsha, G.; Shiozaki, T.; Scuseria, G. E. On the difference between variational and unitary coupled cluster theories. J. Chem. Phys. 2018, 148, 044107. (16) Kandala, A.; Mezzacapo, A.; Temme, K.; Takita, M.; Brink, M.; Chow, J. M.; Gambetta, J. M. Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets. Nature 2017, 549, 242−246. (17) McClean, J. R.; Kimchi-Schwartz, M. E.; Carter, J.; de Jong, W. A. Hybrid quantum-classical hierarchy for mitigation of decoherence and determination of excited states. Phys. Rev. A: At., Mol., Opt. Phys. 2017, 95, 042308. (18) Higgott, O.; Wang, D.; Brierley, S. Variational Quantum Computation of Excited States. arXiv:1805.08138 [quant-ph], ArXiv.org e-prints 2018; https://arxiv.org/abs/1805.08138. (19) Wilson, A. H. The Ionised Hydrogen Molecule. Proc. R. Soc. London, Ser. A 1928, 118, 635−647. (20) Morse, P. M.; Stueckelberg, E. C. G. Diatomic Molecules According to the Wave Mechanics I: Electronic Levels of the Hydrogen Molecular Ion. Phys. Rev. 1929, 33, 932−947. (21) McClean, J. R.; Romero, J.; Babbush, R.; Aspuru-Guzik, A. The theory of variational hybrid quantum-classical algorithms. New J. Phys. 2016, 18, 023023. (22) Seeley, J. T.; Richard, M. J.; Love, P. J. The Bravyi-Kitaev transformation for quantum computation of electronic structure. J. Chem. Phys. 2012, 137, 224109−224109.

(23) Tranter, A.; Sofia, S.; Seeley, J.; Kaicher, M.; McClean, J.; Babbush, R.; Coveney, P. V.; Mintert, F.; Wilhelm, F.; Love, P. J. The Bravyi-Kitaev transformation: Properties and applications. Int. J. Quantum Chem. 2015, 115, 1431. (24) McClean, J. R.; Kivlichan, I. D.; Steiger, D. S.; Cao, Y.; Fried, E. S.; Gidney, C.; Häner, T.; Havlíček, V.; Jiang, Z.; Neeley, M.; Romero, J.; Rubin, N.; Sawaya, N. P. D.; Setia, K.; Sim, S.; Sun, W.; Sung, K.; Babbush, R. OpenFermion: The Electronic Structure Package for Quantum Computers. arXiv:1710.07629v3 [quant-ph] ArXiv e-prints, 2017; https://arxiv.org/abs/1710.07629. (25) Taube, A. G.; Bartlett, R. J. New perspectives on unitary coupled-cluster theory. Int. J. Quantum Chem. 2006, 106, 3393−3401. (26) Poulin, D.; Hastings, M. B.; Wecker, D.; Wiebe, N.; Doherty, A. C.; Troyer, M. The Trotter Step Size Required for Accurate Quantum Simulation of Quantum Chemistry. Quantum Info. Comput. 2015, 15, 361−384. (27) Perelomov, A. Generalized Coherent States and Their Applications; Theoretical and Mathematical Physics; Springer Science & Business Media, 2012. (28) Radcliffe, J. M. Some properties of coherent spin states. J. Phys. A: Gen. Phys. 1971, 4, 313. (29) Arecchi, F. T.; Courtens, E.; Gilmore, R.; Thomas, H. Atomic Coherent States in Quantum Optics. Phys. Rev. A: At., Mol., Opt. Phys. 1972, 6, 2211−2237. (30) Lieb, E. H. The classical limit of quantum spin systems. Commun. Math. Phys. 1973, 31, 327−340. (31) Nocedal, J.; Wright, S. J. Numerical Optimization, 2nd ed.; Springer Series in Operations Research and Financial Engineering; Springer: New York, 2006; Chapter 17. (32) Rubin, N. C.; Babbush, R.; McClean, J. Application of fermionic marginal constraints to hybrid quantum algorithms. arXiv:1801.03524 [quant-ph], ArXiv e-prints, 2018; https://arxiv. org/abs/1801.03524. (33) MATLAB, version 8.6.0.267246 (R2015b); The MathWorks Inc.: Natick, MA, 2015. (34) Otterbach, J. S.; Manenti, R.; Alidoust, N.; Bestwick, A.; Block, M.; Bloom, B.; Caldwell, S.; Didier, N.; Schuyler Fried, E.; Hong, S.; Karalekas, P.; Osborn, C. B.; Papageorge, A.; Peterson, E. C.; Prawiroatmodjo, G.; Rubin, N.; Ryan, C. A.; Scarabelli, D.; Scheer, M.; Sete, E. A.; Sivarajah, P.; Smith, R. S.; Staley, A.; Tezak, N.; Zeng, W. J.; Hudson, A.; Johnson, B. R.; Reagor, M.; da Silva, M. P.; Rigetti, C. Unsupervised Machine Learning on a Hybrid Quantum Computer. arXiv:1712.05771 [quant-ph], ArXiv e-prints, 2017; https://arxiv.org/ abs/1712.05771. (35) Smith, R. S.; Curtis, M. J.; Zeng, W. J. A Practical Quantum Instruction Set Architecture. arXiv:1608.03355 [quant-ph], ArXiv eprints, 2016; https://arxiv.org/abs/1608.03355 (36) Nelder, J. A.; Mead, R. A Simplex Method for Function Minimization. Comput. J. 1965, 7, 308−313. (37) Rigetti Computing. pyQuil 1.9, 2018; http://docs.rigetti.com/ en/1.9/qpu.html. (38) Izmaylov, A. F.; Yen, T.-C.; Ryabinkin, I. G. Revising measurement process in the variational quantum eigensolver: Is it possible to reduce the number of separately measured operators? arXiv:1810.11602 [quant-ph], ArXiv e-prints, 2018; https://arxiv.org/ abs/1810.11602.

255

DOI: 10.1021/acs.jctc.8b00943 J. Chem. Theory Comput. 2019, 15, 249−255