<<

Variational Quantum Computation of Excited States

Oscar Higgott1,2, Daochen Wang1,3, and Stephen Brierley1

1 Riverlane, 3 Charles Babbage Road, Cambridge CB3 0GT 2 Department of Physics and Astronomy, University College London, London, WC1E 6BT 3Joint Center for and Computer Science, University of Maryland, College Park, MD 20742 July 1, 2019

The calculation of excited state of materials, or to understand some chemical reactions, electronic structure Hamiltonians has many im- such as those that involve photodissociation. However, portant applications, such as the calculation of classical methods such as density functional theory are optical spectra and reaction rates. While low- often unable to determine excited states, even for ma- depth quantum algorithms, such as the varia- terials where calculations are pos- tional quantum eigenvalue solver (VQE), have sible. been used to determine ground state ener- Quantum computers have the potential to solve these gies, methods for calculating excited states cur- and other problems significantly faster than any known rently involve the implementation of high-depth methods using classical computers [1, 11, 19, 36]. How- controlled-unitaries or a large number of addi- ever many quantum algorithms will require quantum tional samples. Here we show how overlap esti- error correction, limiting their usefulness in the near mation can be used to deflate eigenstates once future [31]. Here we study hybrid quantum-classical al- they are found, enabling the calculation of ex- gorithms, which dramatically reduce the required gate cited state energies and their degeneracies. We depth to run and somewhat mitigate errors, by closely propose an implementation that requires the integrating classical and quantum subroutines [2,9, 14, same number of qubits as VQE and at most twice 15, 21, 23, 26, 40]. the circuit depth. Our method is robust to con- The variational quantum eigensolver (VQE), intro- trol errors, is compatible with error-mitigation duced in Ref. [30], is the first algorithm designed to strategies and can be implemented on near-term find the lowest eigenvalue of a Hamiltonian on a near- quantum computers. term, non-fault-tolerant quantum computer. VQE is based on the variational principle and utilises the fact 1 Introduction that quantum computers can store quantum states us- ing exponentially fewer resources than required classi- Eigenvalue problems are ubiquitous in almost all fields cally. VQE uses parameterised quantum circuits to pre- of science and engineering. Google’s PageRank al- pare trial wavefunctions and compute their energy, and gorithm alone has had a significant impact on mod- a classical computer to find the parameters minimising ern society, and at its core solves an eigenvalue prob- this energy. The low circuit depth of VQE has led to the lem associated with a stochastic matrix describing the hope that it may enable near-term quantum-enhanced World Wide Web [28]. Another important example is computation. Principal Component Analysis (PCA) [13, 29], which Since its introduction, modifications have been sug- arXiv:1805.08138v5 [quant-ph] 28 Jun 2019 has widespread applications in bioinformatics, neuro- gested to enable VQE to find excited state ener- science, image processing, and quantitative finance. gies: e.g. a folded spectrum method [30] which re- The time-independent Schr¨odinger equation provides quires finding the expectation of the squared Hamil- yet another example of a fundamental eigenvalue prob- tonian with quadratically more terms, or symmetry- lem. Its numerical solution enables properties of , based methods which are non-systematic [23]. Such and materials to be predicted, with far- suggestions have been more recently superseded by reaching applications in materials design, drug discov- two proposals: a method that minimises the von Neu- ery and fundamental science [38]. Characterisation of mann entropy [35] and the quantum subspace expansion excited state energies of molecules is required to predict method [5, 24]. However, the von Neumann entropy charge and energy transfer processes in photovoltaic method (“WAVES”) requires a large number of high- depth controlled-unitaries, and the quantum subspace Oscar Higgott: [email protected] expansion method requires a large number of additional

Accepted in Quantum 2019-06-14, click title to verify 1 VARIATIONAL QUANTUM DEFLATION ALGORITHM (VQD) samples compared to VQE and introduces a new ap- QUANTUM CIRCUITS CLASSICAL CIRCUITS proximation.

Expectation estimation i )

Our algorithm extends VQE to systematically find k

of (k) P1 (k) h | | i ( excited states at almost no extra cost. We achieve this | i H 2 0 | |

| Expectation estimation ) i ) k k

of (k) P2 (k)

by adding “overlap” terms onto the optimisation func- ( h | | i (

| ) ... i tion in order to exploit the fact that Hermitian ma- ⌘h ) to minimise ( k k

Expectation estimation h ( | Classical adder calculates trices admit a complete set of orthogonal eigenvectors. i of (k) Pn (k) E h | | i 1 from fiducial state =0 k i Exploiting further the fact that VQE retains the clas- i ) P k ( Overlap estimation sical parameters of ansatz states that enable their re- 2 | | 2 )+ i of ( ) ( ) k 0 k ) |h | i| k ( ( preparation, low-depth quantum circuits can then be E

|

Overlap estimation ) i 2 = ) prepares readily used to calculate these overlap terms. of (1) (k) ( k

|h | i| h obj ( | Classical optimiser updates F i R ... 1 =0 k Overlap estimation i

2 P of (k 1) (k) Classical adder calculates 2 Variational quantum deflation algo- |h | i| rithm

AAAT4XiczVj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mEFpNbyctRUtP9OqqOADKTCQknFoyFyUUMQT2HWDUgVCR4zn/jI44KBsioKKaNhHKID6queu+aFE1KP0G5PuTbQFDlUyCNMEUH8KvIFPnDbAfb6VdShQeAC9eqatb+UgUC5sa0Ejsg7GoPe8RIFpKOQQeTetLIbQltMd2zbOik8VISvHcRkGmAkuEeknI7QR7LIBeibsekTj+oMGqM+xSFn/kcz2RWEsP+Dl6lN54yMvs/PtTOyOe8A/ffJxELwg6SsehRYa3eqd1ypCA5Ub8RI1MDjTGFoI+KHupFzB1o9 λ In VQE, the real parameters for the ansatz state Figure 1: A schematic of our variational quantum deflation |ψ(λ)i are classically optimised with respect to the ex- method for finding the k-th excited state of a Hamiltonian H. pectation value: X E(λ) := hψ(λ)| H |ψ(λ)i = cj hψ(λ)| Pj |ψ(λ)i , (1) calculated by minimising F in Eq. (2) for k = 1, after j which λ2 can be determined using the same procedure λ λ λ P with the known 0 and 1, and so on until k is deter- of the Hamiltonian H = cjPj, computed using a low- mined. depth . As a result of the variational A schematic of our variational quantum deflation principle, finding the global minimum of E(λ) is equiv- (VQD) algorithm is shown in Fig.1. An initial guess of alent to finding the ground state energy of H. VQE λk is used to generate a state preparation circuit R(λk) has been implemented on many experimental platforms, that prepares the state |ψ(λk)i when applied to the fidu- and has been shown to be more resilient to control er- cial state |0i. This circuit is used repeatedly to compute rors than the quantum phase estimation algorithm [27]. each of the expectation values hψ(λk)| Pj |ψ(λk)i (see Our method extends VQE to calculate the k-th ex- 2 Refs. [30, 40]) and overlap terms |hψ(λk)|ψ(λi)i| for cited state by instead optimising the parameters λk for i < k. The overlap terms are computed using circuits the ansatz state |ψ(λk)i such that the cost function: described in Section4 or AppendixB or by following

k−1 the method in Ref. [17]. X 2 A classical computer then uses the results of these F (λk) := hψ(λk)| H |ψ(λk)i + βi |hψ(λk)|ψ(λi)i| , i=0 quantum computations to calculate the objective func- (2) tion F (λk) of Eq. (2) and update λk using a classi- is minimised. This can be seen as minimising E(λk) cal optimiser. The new λk is then used to prepare a subject to the constraint that |ψ(λk)i is orthogonal to new ansatz state on the quantum computer, and the the states |ψ(λ0)i , ..., |ψ(λk−1)i. In the next section, we whole process is repeated until some stopping criterion show how choosing sufficiently large β0, ..., βk−1 means is reached. the minimum of F (λk) is guaranteed to be the energy As shown in AppendixA, the total number of samples of the k-th state, provided that the ansatz is sufficiently M (k) required to measure the VQD objective function expressive. to precision  when finding the kth excited state (as- While the first term in Eq. (2) is E(λk), and can suming states 0 . . . k − 1 can be perfectly prepared) is be computed using the same quantum circuits as used bounded above by: for VQE, the second term is a sum of overlaps of the 2 L−1 k−1  ansatz state with states 0 to k − 1, and can be com- 1 X 1 X M (k) ≤ |c | + β , (3) puted efficiently on a quantum computer using one of 2  j 2 i the methods given in Section4. j=0 i=0 Note that evaluating Eq. (2) requires knowledge of compared to the VQE sampling cost of M ≤ λ0, ..., λk−1 and so an iterative procedure is required to 2 1 PL−1  calculate the k-th eigenvalue. First, λ0 is calculated 2 j=0 |cj| . For well-chosen βi, we expect this ad- using VQE by minimising E in Eq. (1). Then, λ1 is ditional sampling cost relative to VQE to be very small,

Accepted in Quantum 2019-06-14, click title to verify 2 as explained in more detail in AppendixA. This method requires knowing the inverse of the preparation circuit for each previously-computed state, † R(λi) . While this inverse is often known in theory 3 Overlap weighting by inverting gates in a decomposition of the original preparation circuit, device errors may mean that the An equivalent viewpoint of our optimisation procedure implementation is inaccurate in practice. If we define is that we are finding the ground state of the effective ∗ λi to be the optimal parameters originally found to pre- Hamiltonian at stage k: ∗ pare the i-th state R(λi ) |0i using VQD, then its inverse ∗ k−1 can be found by fixing λi and varying the trial state pa- X λ | h0| R(λ )†R(λ∗) |0i |2 Hk := H + βi |ii hi| , (4) rameters i such that the overlap i i i=0 is maximised. This technique enables VQD to retain the robustness to control errors that is characteristic of where |ii is the (previously found) i-th eigenstate of H VQE [27]. 1 with energy Ei := hi| H |ii . It can be easily verified This implementation of VQD requires the same num- P that for an arbitrary state |ψi := ai |ii: ber of qubits as VQE and around twice the circuit depth. In AppendixB, we describe an alternative k−1 d−1 X X method which uses the destructive SWAP test and re- hψ| H |ψi = |a |2(E + β ) + |a |2E , k i i i i i quires almost the same circuit depth as VQE but twice i=0 i=k the number of qubits. If a larger gate-depth is avail- where d is the total number of eigenvectors of H. able, then α-QPE [40] can be used to reduce the total 1 1 Therefore, if the ansatz is sufficiently powerful, then runtime of overlap estimation from O( 2 ) up to O(  ). to guarantee a minimum at Ek, it suffices to choose βi > Ek−Ei. Since ∆ := Ed−1−E0 ≥ Ek−Ei, it suffices to possess an accurate estimate of ∆, e.g. by using VQE to find E0 and then Ed−1 (using the Hamiltonian −H to 0 find the latter). When we readily have a specification of P H = cjPj as a linear combination of Pauli matrices, e.g. when H is the electronic structure Hamiltonian, 0 P then we have the upper bound ∆ ≤ 2kHk ≤ 2 |cj|. In this case, we can readily choose βi to guarantee the validity of our procedure. 00 Choosing valid βi can also be self-correcting. For ex- ample, if we incorrectly chose βi = γ − Ei ≤ Ek − Ei for all i, we will discover that we have set βi too small 0 since we will eventually find a minimum at F (λk) = γ. However, by repeating the algorithm with a larger γ until an energy strictly less than γ is found (doubling 0 γ each time, say), we can pick a large enough γ after O(log (Ek − E0)) runs of the algorithm. 0 0 0 Å

4 Low-depth implementations Figure 2: All ground and excited state energy levels of H2 in the STO-3G basis, calculated using exact diagonalisation (blue dot- A low-depth method for overlap estimation, proposed ted line) and our variational quantum deflation (VQD) method in Ref. [12], can be seen by writing the overlap (red filled circles) over a range of internuclear separations. 2 † 2 | hψ(λi)|ψ(λk)i | as | h0| R(λi) R(λk) |0i | . We can pre- † pare the state R(λi) R(λk) |0i using the trial state preparation circuit followed by the inverse of the prepa- 5 Numerical simulation: H2 ration circuit for the i-th previously-computed state. The overlap is then estimated to precision  by the We simulated VQD on H2 in the STO-3G basis for a fraction of all-zero bitstrings when measuring this state range of internuclear separations and compared it to O(1/2) times in the computational basis. exact diagonalisation, as shown in Fig.2. Using βi = 3 Ha for all i and a generalised unitary sin- 1We assume these are true eigenstates with possibly non- gles and doubles (UCCGSD) ansatz, the median error of distinct energies. our method relative to exact diagonalisation is less than

Accepted in Quantum 2019-06-14, click title to verify 3 4×10−6 Ha for all energy levels, significantly better than chemical accuracy of 1.6 × 10−3 Ha (the precision re- quired to determine reaction rates to within an order of 0 magnitude at room using the Eyring equa- 0 tion [8]). Our method finds all 6 eigenstates systemat- 0 ically, including all those in the 3-dimensional degener- ate subspace spanned by the 1st, 2nd and 3rd excited 0 states. The ability to find degenerate states is another key advantage of our method; the folded spectrum and WAVES methods rely on the energies of states to dif- ferentiate between them and have no systematic way of determining the degeneracy of the eigenvalues. Further discussion of our simulation, including optimiser and 0 ansatz used, can be found in AppendixC. 0

6 Error accumulation Figure 3: Median error using VQD to determine each k in the spectrum of H2 at bond distance (0.7414 A)˚ in In general, we cannot assume perfect state preparation the STO-3G basis. Red, blue and green lines show results using ˜ 6 7 8 for states i < k. Suppose a state |ψ0i (with energy 10 , 10 and 10 samples (per Hamiltonian subterm and over- lap term) respectively. For the solid lines, the standard VQD E˜0) is prepared instead of the true ground state |ψ0i ˜ 2 algorithm was used, whereas for dashed lines states i < k in such that hψ0|ψ0i = 1 − 0, leading to an error in Hk were computed exactly for comparison. Chemical accuracy 0 ˜ −3 the ground state energy 0 = E0 − E0 = O(20||H||). (1.6 × 10 Ha) is also shown for reference (black solid line). If we now use this ground state estimate along with Error bars show 1σ standard errors for the median estimates VQD to find the first excited state |ψ1i using a new (calculated using bootstrap resampling [6]). ˜ trial state |ψ1i, the lowest-energy state of the deflated Hamiltonian no longer corresponds to the exact excited E state energy 1. in the analysis. The median errors for the remaining The inexact deflated Hamiltonian is now given by ∼ 180 runs for each state k are shown in Fig.3. For H˜ = H + β |ψ˜ i hψ˜ | 1 0 0 0 and, to assess the accumulation comparison, we also simulated 130 runs (dashed lines) of errors, we wish to find upper and lower bounds for −7 ˜ ˜ using ‘exact‘ states i < k in Hk (< 10 energy error min ˜ [hψ1| H˜1 |ψ1i]. ψ1 in each state i < k). For all three sampling rates, the β > In AppendixD we show that, provided we set 0 median error in the first excited state is similar in mag- E1−E0 , the ground state energy of the inexact deflated 1−0 nitude to the error in the ground state, as expected from  Hamiltonian is bounded by terms linear in 0: our analysis earlier in this section and in AppendixD. k < 4 E1 −O((E1 −E0)0) ≤ min hψ| H˜1 |ψi ≤ E1 +β00. (5) Furthermore, the median errors for all states are ψ very similar (for a given M) to the errors when using an In reality we will not find the exact ground state of the exact Hk, and are all below chemical accuracy, demon- strating that error accumulation is negligible for these deflated Hamiltonian H˜1 and will incur an additional states. For k = 4 and k = 5 the accumulated error is error 1 as was the case for the ground state of the substantially higher than the error using an exact Hk, original Hamiltonian H. However, provided 1 ≈ 0, 0 however, showing that VQD is most effective for low- our total error 1 = O(0β0 + 21||H||) in the energy is still linear in our original ground state error. An lying states. Achieving chemical accuracy for k = 5 7 6 alternative analysis of error accumulation is provided requires 10 samples, instead of 10 for 0 < k < 4. by Lee et al.[18]. One way to address this accumulation of errors within We analysed this accumulation of errors further VQD to find higher excited states may be to use the al- through numerical simulations of VQD in the presence ternative effective Hamiltonians discussed in Section7. of sampling error, shown in Fig.3. We analysed three Another solution is to use a hybrid approach, using different sampling rates: M = 106, 107 and 108 sam- VQD instead of excitation operators in the WAVES pro- ples per Hamiltonian subterm and overlap term, run- tocol [35]. Here, VQD may provide a more effective ning 225 simulations of VQD (with random initial pa- method of approximating excited states than the exci- rameters) for each of these three scenarios. Of these tation operators proposed in WAVES, whereas the von- runs, ∼ 20% of the simulations found the eigenstates in Neumann entropy “eigenstate witness” used in WAVES the incorrect order and were discarded for consistency does not have the same problem of error accumulation,

Accepted in Quantum 2019-06-14, click title to verify 4 and could help refine the energy estimate. Both of these 8 Discussion alternative approaches require a larger gate depth than the version of VQD we have studied here, but may be We have introduced a new method–variational quan- a good approach to finding higher excited states in the tum deflation (VQD)–for calculating low-lying excited era of fault-tolerant . state energies of quantum systems using a quantum computer. Our method requires the same number of qubits as the variational quantum eigensolver (VQE) for ground state methods, at most twice the maximum 7 Choice of effective Hamiltonian circuit depth (for any given ansatz) and a negligible in- crease in the number of required measurements. By con- The form of our effective Hamiltonian in Eq. (4) is only trast, existing methods for quantum computing excited one choice within the broad category of deflation meth- states require a large overhead in resources compared ods. Such methods are typically employed to find eigen- to ground state methods. values and eigenvectors of positive semi-definite matri- While we used a Nelder-Mead optimiser and UCCSD ces, often covariance matrices in the context of PCA, ansatz in our simulation of molecular here, starting from the largest eigenvalues. we note that many other optimisers and ansatz circuits To make direct use of deflation methods for posi- can also be used for VQD. After the first version of tive semi-definite matrices, note that the Hamiltonian this paper was released, interesting work by Jones et al. 0 0 0 0 H := −H + E for some E ≥ Ed−1, e.g. E = kHk, compared the use of two different optimisation methods is positive semi-definite. Under this transformation, as applied to our protocol to calculate the spectrum of a we find that Hotelling’s deflation corresponds to our Lithium Hydride [15]. More recently, work by 0 method and would set βi = E − Ei in Eq. (4). Lee et al. showed that using a multi-determinental ref- Other deflation methods exist such as projection de- erence state or their k-UpCCGSD ansatz can improve flation or Schur complement deflation which are de- the precision of finding the first excited state of N2 us- signed to address the problem of not obtaining true ing VQD [18]. Further work could include numerical eigenstates at each stage. These two methods, in con- analysis of different optimisers and ansatz circuits for trast to Hotelling’s, ensure that the true ground state of use within VQD in the presence of noise, as well as the effective Hamiltonian at each stage does not overlap the effectiveness of the alternative effective Hamiltoni- with the previously found eigenstate estimate irrespec- ans presented in Section7. tive of its accuracy. Empirically, these two methods Given its low resource requirements and compatibil- have been found to perform better than Hotelling’s in ity with error-mitigation techniques, we hope that VQD the context of PCA on some datasets [20]. may enable the quantum-enhanced computation of ex- For example, in projection deflation, the effective cited state energies in the near-future. Hamiltonian at stage k is defined as:

† 0 A Sampling cost Hk = Ak(H − E )Ak, (6)

2 where: In VQE, the variance  in the energy expectation value hHi after using Mj samples for the measurement of k−1 k−1 each subterm hP i in the Hamiltonian H = P c P is Y X j j j Ak := (1 − |ii hi|) ≈ 1 − |ii hi| , (7) bounded by [30, 33]: i=0 i=0 L−1 2 2 X cj σj and the last approximation holds when the previously 2 = (8) M found eigenvectors |ii are truly orthogonal. j=0 j With this approximation, writing H again as a lin- L−1 2 2 L−1 2 X cj (1 − hPji ) X cj ear combination of Pauli matrices Pj, the value of = ≤ . (9) Mj Mj hψ| Hk |ψi for an ansatz |ψi is a linear combination of j=0 j=0 2 terms of forms: hψ| Pj |ψi, |hψ | ii| as in Hotelling’s 2 2 2 deflation, but now additionally hψ | ii, hψ| Pj |ii and where σj = Var [hPji] = hPj i − hPji is the intrinsic hi| Pj |li (for i, l < k). Without this approximation, we variance of the projective measurement of hPji. Using also need to calculate hi | li. The important point now the method of Lagrange multipliers, Rubin et al.[33] is that all these additional terms can still be quantum showed that the optimal choice of Mj to minimise the P computed, e.g. following the method in Ref. [17]. total number of samples M = j Mj used to achieve

Accepted in Quantum 2019-06-14, click title to verify 5 precision  is: the optimisation rather than just at convergence, and PL−1 L−1 if we choose βi = 2 j=0 |cj| since this always guaran- 1 X (k) 2 Mj = |cj|σj |ci|σi, (10) tees βi is large enough, then we find M = (1 + k) M 2 (k) i=0 (where we have used the upper bounds for both M which leads to a total number of samples and M). 2 2 L−1  L−1  1 X 1 X M = |cj|σj ≤ |cj| . (11) B Destructive SWAP test 2   2   j=0 j=0 The SWAP test enables the overlap |hφ|ψi|2 of two Assuming perfect state preparation for states i < k in states |ψi and |φi to be determined to precision  us- VQD, we find that the variance of the energy expecta- ing O(1/2) repeated measurements after applying a tion value hH i of the deflated Hamiltonian H is in- k k circuit to a quantum register in the state |ψi ⊗ |φi. stead given by: While the original SWAP test acting on two N-qubit L−1 2 2 k−1 2 2 states required an ancilla and a controlled-SWAP gate, 2 X cj σj X βi σ˜i  = + (12) leading to a 2N + 1-qubit circuit with depth O(N), M k M˜ k j=0 j i=0 i it was shown in Refs. [4, 10] that the same outcome L−1 2 k−1 2 distribution can be attained more efficiently without X cj X βi ≤ + (13) an ancilla, using parallel Bell-basis measurements and M k 4M˜ k j=0 j i=0 i classical logic. This so-called “destructive SWAP test” 2N where M k is the number of samples used for measuring (shown in Fig.4) requires just qubits and depth j O(1), achieving significant savings compared to the hP i, M˜ k is the number of samples used to estimate the j i original SWAP test. overlap of the ansatz with the ith previously found state 2 2 2 and σ˜i = |hi|ki| (1 − |hi|ki| ) is the intrinsic variance 0 H mi of this overlap measurement. From a straightforward | i • ··· 0 i 0 ~ H m1 extension of the Lagrange multiplier approach used by | i R(i) • ··· Rubin et al.[33], we now find the optimal M k and M˜ k j i 0 H mi | i ··· • n for the deflated Hamiltonian Hk to be: ' ⌧ ⇡ mi mk (mod 2) L−1 k−1 ! · 7 ? F 1 X X k k 0 m0 Mj = 2 |cj|σj |cl|σl + βiσ˜i , (14) | i ···  k l=0 i=0 0 m1 | i R(~k) ··· L−1 k−1  1 k k X X 0 mn M˜ = β σ˜ |c |σ + β σ˜ . (15) |AAAHKXicrZXNbhMxEMfdQkIJXy0ckZBFRVRAinaLEL1URFRCPbYV/ZDiJfJ6ncRae3exvUWVZYkLT9MrPANnbsCVR+AF8G5ayMdGLaUjRflnxuPxbzybDTPOlPa873PzV67W6tcWrjdu3Lx1+87i0t09leaS0F2S8lQehFhRzhK6q5nm9CCTFIuQ0/0w3iji+4dUKpYmb/RRRgOB+wnrMYK1c3WXag/QNmGS5EzD9sa611qjArZ31v2W54RpQIi40ozEBsVUG89a2IRI5FyzPtbUPLNmZwUJrAcEc4MOKTGIu/IRtrbLHperiZbcPC9lmbNZynfvYWnNQjVdHRKlWrnfo7G/8o8uylNNZblzkYmyXA2M6Hpv2enGCMuOjJwFhQPNoOgPUqXPOD6cOsgMoMui8KcpTiCa41ZgTVH9F1aVrMCqoD8bK5nEqoaCT552XgcGhcIIl4HClEfqSLgvUx7BDiOxdRuLNDKr1s7swzmHNB4Oqcay/299uOCQxqN9yGUwHNAL3WQ86yarYC5vQMcJThEuazxnQp3zWirYZ0ONzOcEVcnVsN3FZa/llQanhX8ill9+aax/AABsdRd/oSgluaCJJhwr1fG9TAcGS9cJTm0D5YpmmMS4Tzt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ybnrjFn952+QXygSsha1_base64="cdueTHkY3dOux/2pmjp1qDyOEM4=">AAAHKXicrZXdbtMwFMezQcooH+vgEglZTFQDpCoZQuxmUsUktMttYh9SHSrHcVsrdhJsZ6iyfMnT7BYehDvglkfgBXDSDvqRamPsSFX/PcfHx7/jkybMGJXK874vLd+46dZurdyu37l77/5qY+3BkUxzgckhTlkqTkIkCaMJOVRUMXKSCYJ4yMhxGO8U8eNTIiRNk3dqmJGAo35CexQjZV3dNfcx3MdU4Jwq0N7Z9lpbhIP2wbbf8qzQdQAgk4riWMOYKO0ZA5oA8pwp2keK6JdGH2xAjtQAI6bhKcEaMls+QsZ06bNyNVaC6VelLHN2S/nhIyitWaimrYOjVEn7ezL2V/7RRXmiiCh3LjJhlsuB5l3vPT3fGCLREZG1oHDABRT9QSrVBccHcwdZAHRdFP48xRiiOW0F1hzVf2FVyQqsCvqLsZJZrGoo8PxF522gYcg1txkwTFkkh9x+6fIIZhSJjd2Yp5HeNGZhHy45pPFoSBUS/X/rwxWHNJ7sQy6C0YBe6SbjRTdZBXN9AzpNcI5wXeO5EOqS11LBvhhqYj5nqEquuuk21r2WVxqYF/5YrDtj2+s2fsEoxTknicIMSdnxvUwFGgnbCUZMHeaSZAjHqE86ViaIExno8o/cgKfWE4FeKuwnUaD0TmZoxGXxONiVRffkbKxwVsU6ueptBZomWa5IgkeFejkDKgXFWwFEVBCs2NAKhAW1ZwV4gATCtlnTVUJuGcqN9PmLw9Rtl/zZnsyLo82W77X8fW+9/WbcrxXnkfPE2XB857XTdnadPefQwe4n98z97H6pndW+1r7VfoyWLi+Ncx46U1b7+RvEKCTR i ··· i 2 i i  j j l l j=0 l=0 Figure 4: The N-qubit generalisation of the destructive SWAP test as applied to two ansatz states |ψ(λ )i and |ψ(λ )i, pre- This leads to a total number of samples M (k) given by: i k pared using state preparation circuits R(λi) and R(λk) respec- L−1 k−1 tively. (k) X k X ˜ k M = Mj + Mi (16) j=0 i=0 2 If the ansatz used can be implemented on a linear L−1 k−1  1 X X chain of qubits with nearest neighbour connectivity, = |c |σ + β σ˜ (17) 2  j j i i e.g. parameterised adiabatic state preparation using the j=0 i=0 fermionic SWAP network Trotter step [16], then the 2 L−1 k−1  SWAP test to compare two ansatz states can be im- 1 X 1 X ≤ |c | + β . (18) plemented on a N × 2 nearest-neighbour grid quantum 2  j 2 i j=0 i=0 computer architecture with a depth-one circuit that is subgraph isomorphic to the architecture (i.e. no routing From a comparison of M (k) with M we expect the of quantum information required). This implementa- sampling overhead of VQD relative to VQE to be very tion makes the assumption that the same ansatz state small, since the sum of the L = O(N 4) Hamiltonian co- can be prepared with the same parameters on two sepa- efficients will likely be far larger than the sum of well- rate registers of qubits. If this cannot be assumed (e.g. if chosen weights βi for low-lying excited states in prac- qubit errors are inhomogeneous), then the SWAP test 2 tice. Furthermore, the variances σ˜i tend to zero at con- can be used to “copy” the state from the first register vergence. However, if we require precision  throughout to the second register, by maximising the overlap of the

Accepted in Quantum 2019-06-14, click title to verify 6 two states, with the parameters of the state on the sec- that other optimisers, such as LGO, have been shown to ond register allowed to vary. This technique allows the offer improved performance in VQE [23], and possible SWAP test implementation of VQD to maintain robust- further work includes analysis of alternative optimisa- ness to control errors. tion strategies in the context VQD. While we initialised the UCCGSD parameters ran- domly in this work, choosing a good initial guess for the C Methods for numerical simulation parameters can significantly reduce the number of itera- tions required for the optimiser to converge. For ground The standard UCCSD ansatz [32] is defined relative to state VQE problems, second order Møller-Plesset per- |ψ i a reference state 0 by: turbation theory (MP2) has previously been proposed

T −T † as a UCC ansatz initialisation method [32]. Another |ψi = e |ψ0i , method, for either ground or excited states, initialises a UCC ansatz with optimised expectation values that where T := T + T with: 1 2 are classically estimated using a truncated BCH expan- X l † sion [18]. T1 := t a ai, i m We also note that the overlap terms | hψ(λ )|ψ(λ )i |2 i∈occ k i l∈vir in Eq. (2) of the state k with a known state i are sim- X † † t 2 lk ilar to the overlap terms | hψ(λs)|ψ(λi)i | of the same T2 := tij al akaiaj, i,j∈occ known state i with another previously-computed state l,k∈vir s (where i < s < k) in the t-th iteration of the VQD optimisation procedure used to compute that state. It l lk for some parameters ti, tij ∈ R and occ and vir are the may therefore be advantageous to cache the outputs of sets of occupied and virtual orbitals of |ψ0i. t 2 these | hψ(λs)|ψ(λi)i | terms, and use them to inform We instead use a generalised unitary coupled cluster and improve the optimisation procedure for the k-th ansatz (UCCGSD) with |ψ0i = |HFi set to the Hartree- state, hopefully reducing the number of optimisation Fock state but with the cluster operator T = T1 + T2 steps and quantum circuits required. now using the definitions:

X q † T1 := tpaqap, D Bounds for error accumulation pq X rs † † In Section6 we stated that, to assess the accumulation T2 := tpqarasapaq, pqrs of errors, we would like to find upper and lower bounds for the ground state energy minψ[hψ| H˜1 |ψi] of the inex- ˜ ˜ where p, q, r, s can now index any orbital (irrespective act deflated Hamiltonian H˜1 = H + β0 |ψ0i hψ0|, where ˜ of its occupation in the reference state). A variant of ψ0 is the (inexact) estimate of the ground state found this ansatz was suggested by McClean et al.[23] in the in the first iteration of VQD. context of VQE, and UCCGSD has since been investi- Using the same notation as in Section6, and writ- ˜ gated numerically [18, 41]. Lee et al. found UCCGSD ing states in the eigenbasis of the Hamiltonian, |ψ0i = to perform significantly better than UCCSD in VQE for Pd−1 ˜ Pd−1 i=0 ai |ψii and |ψ1i = i=0 bi |ψii, an O(β00) up- a number of small molecules [18]. per bound is given straightforwardly by hψ1| H˜1 |ψ1i ≤ → → Since we are only interested in the parameterisa- E1 + β00. Writing a := (a1, . . . , ad−1) and b := † 1 1 tion of T − T , and fermionic operators obey the anti- (b1, . . . , bd−1) for compactness, we find the lower bound commutation relations: to be:

† † † k {aj, ak} = 0, {aj, ak} = 0, {aj, ak} = δj , hψ˜ | H˜ |ψ˜ i (19) it can be directly verified that there are only 6 and 3 in- 1 1 1 1 2 3 2 3 3 d−1 dependent parameters for T1 (e.g. t0, t0, t0, t1, t1, t2) 2 X 2 ∗ → → 2 23 13 12 = |b0| E0 + |bi| Ei + β0|a0b0 + ha1 , b1 i| (20) and T2 (e.g. t01, t02, t03) respectively. The results in Fig.2 were simulated using ProjectQ i=1 d−1 and FermiLib [25, 37]. A tolerance of 10−2 was used X = |b |2(E + β |a |2) + |b |2E with a Nelder-Mead optimiser (xatol=fatol=10−2, as 0 0 0 0 i i i=1 implemented in the scipy Python scientific library), and ∗ → → ∗ → → 2 the best of two consecutive (randomly initialised) runs + β0(2<(a0b0ha1 , b1 i ) + |ha1 , b1 i| ) (21) 2 √ was used for each bond length and energy level. We note ≥ |b0| (E0 + β0(1 − 0)) − |b0|(2β0 0)

Accepted in Quantum 2019-06-14, click title to verify 7 d−1 X 2 fermionic unitary coupled cluster ansatz we use in Sec- + min |bi| Ei (22) → tion5 conserves the desired number of ( η = 2) b1 i=1 of neutral molecular Hydrogen for all input parameters. 2 ≥ |b0| (β0(1 − 0) − (E1 − E0)) √ Alternatively, penalty terms can be included in the − |b0|(2β0 0) + E1 (23) objective function such that the ansatz state has the β2 desired symmetry at the global minimum of the objec- ≥ E −  0 . (24) 1 0 β (1 −  ) − (E − E ) tive function [23, 34]. This leads to a modified objective 0 0 1 0 function: where the first inequality is Cauchy-Schwarz, the sec- X  2 Pd−1 2 FC (λk) := F (λk) + µi hψ(λk)| Cˆi |ψ(λk)i − ci , ond inequality follows from i=0 |bi| = 1, and the third inequality follows by minimising a quadratic over i E1−E0 (28) |b0| (assuming β0 > ). From the Taylor series 1−0 where Cˆ are symmetry constraining operators (e.g. Nˆ , expansion in  of the second inequality we find: i e 0 ˆ2 S , Sˆz) and ci are constants corresponding to their de- sired expectation values. ˜ ˜ ˜ β0(E1 − E0) 2 hψ1| H1 |ψ1i ≥ E1 − 0 + O(0), (25) β0 − (E1 − E0) Clearly, by incorporating any of these techniques, we can find the excited states of a Hamiltonian constrained E1−E0 from which it is clear that, for any fixed β0 > , to any particular symmetry of interest. 1−0 we have a lower bound of:

˜ ˜ min hψ1| H˜1 |ψ1i ≥ E1 − O((E1 − E0)0). (26) F Error mitigation ψ˜1 In Refs. [3, 22, 34], an error-mitigating post-processing ˆ E Symmetry constraints procedure was introduced that uses the operators Ci (defined in AppendixE) to detect and discard all mea- It is often the case that the Hilbert space of the Hamil- surements that violate a required symmetry for energy tonian being considered is larger than the Hilbert space expectation circuits in VQE-type algorithms. This pro- relevant to the particular problem of interest. For ex- cedure can produce more accurate expectation values in ample, consider the electronic structure Hamiltonian in the presence of bit-flip errors and some combinations of second quantised form: two-qubit errors. After the first version of this paper was released, X † X † † Ref. [15] incorporated our VQD technique to calcu- H = hijai aj + hijklai ajakal, (27) ij ijkl late excited states using imaginary time evolution. The authors also proposed a method to detect symmetry- † breaking errors when using the ancilla-based SWAP- where ai and ai are the fermionic creation and anni- hilation operators for an in the i-th or- test, by performing symmetry measurements on the ansatz registers while measuring the overlap with the bital, and where the coefficients hij and hijkl denote the one- and two-electron integrals, respectively. After the ancilla. However, using the low-depth overlap estima- Hamiltonian is transformed through the Jordan-Wigner tion circuit given in Section4, we can detect and dis- or Bravyi-Kitaev transformation, converting creation card any error that does not commute with a symmetry ˆ and annihilation operators into qubit operators, the di- operator Ci using classical post-processing alone, pro- ˆ mension of the Hilbert space remains 2N , where N is the vided that Ci is diagonal in the computational basis and number of spin orbitals. However, if one is interested commutes with the ansatz. In the Jordan-Wigner and only in states with a particular symmetry, the dimen- Bravyi-Kitaev encodings, the operators for the num- ˆ ˆ sion of the Hilbert space restricted only to these states ber of electrons Ne, spin up electrons N↑ and spin N  η N down electrons Nˆ↓ are diagonal in the computational can be much smaller, e.g. η = O(N ) instead of 2 if only η-electron states are of interest. basis, allowing these quantities to be computed classi- If we wish to apply VQD to find excited states of a cally in post-processing for both encodings. For exam- molecular Hamiltonian with a particular symmetry, it ple, starting from |0i, the UCC ansatz is prepared by is necessary that the ansatz state for a desired excited RUCC(λ) = V (λ)RHF, where RHF prepares the Hartree- † state, at the global minimum of Eq. (2), be contained Fock state |HFi and V := eT −T is the UCC opera- entirely within the restricted Hilbert space of interest. tor. Now, rather than measuring the fraction of all-zero † One way of ensuring this is to use an ansatz that al- bitstrings after performing RUCC(λi) RUCC(λk) |0i = † † ways conserves the correct symmetry. For example, the RHFV (λi) V (λk)RHF |0i, we can instead measure the

Accepted in Quantum 2019-06-14, click title to verify 8 fraction of bitstrings corresponding to |HFi after per- applications. Phys. Rev. X, 8:031027, Jul 2018. † forming V (λi) V (λk)RHF |0i. Since V conserves elec- DOI: 10.1103/PhysRevX.8.031027. URL https: tron number, we know that all measured bitstrings that //doi.org/10.1103/PhysRevX.8.031027. do not correspond to the correct electron number can be [8] Henry Eyring. The activated complex in chemi- discarded as per the post-processing procedure. There- cal reactions. The Journal of Chemical Physics, 3 fore, this method for error-mitigated overlap estimation (2):107–115, 1935. DOI: 10.1063/1.1749604. URL is more efficient than the ancilla-based method proposed https://doi.org/10.1063/1.1749604. ˆ in Ref. [15] if Ci is diagonal in the computational ba- [9] Edward Farhi, Jeffrey Goldstone, and Sam Gut- sis. We also note that the error-mitigation techniques mann. A quantum approximate optimization algo- proposed in Refs. [7, 39] can be readily applied to our rithm. arXiv preprint arXiv:1411.4028, 2014. URL algorithm. https://arxiv.org/abs/1411.4028. [10] Juan Carlos Garcia-Escartin and Pedro Chamorro- References Posada. The swap test and the Hong-Ou- Mandel effect are equivalent. Phys. Rev. A, [1] Al´anAspuru-Guzik, Anthony D. Dutoi, Peter J. 87:052330, May 2013. DOI: 10.1103/Phys- Love, and Martin Head-Gordon. Simulated quan- RevA.87.052330. URL https://doi.org/10. tum computation of molecular energies. Science, 1103/PhysRevA.87.052330. 309(5741):1704–1707, 2005. ISSN 0036-8075. DOI: [11] Lov K. Grover. A fast quantum mechanical algo- 10.1126/science.1113479. URL https://doi.org/ rithm for database search. In Proceedings of the 10.1126/science.1113479. Twenty-eighth Annual ACM Symposium on The- [2] Marcello Benedetti, Delfina Garcia-Pintos, Os- ory of Computing, STOC ’96, pages 212–219, New car Perdomo, Vicente Leyton-Ortega, Yunseong York, NY, USA, 1996. ACM. ISBN 0-89791-785- Nam, and Alejandro Perdomo-Ortiz. A generative 5. DOI: 10.1145/237814.237866. URL https: modeling approach for benchmarking and train- //doi.org/10.1145/237814.237866. ing shallow quantum circuits. npj Quantum In- [12] Vojtˇech Havl´ıˇcek, Antonio D C´orcoles, Kristan formation, 5(1):45, 2019. DOI: 10.1038/s41534- Temme, Aram W Harrow, Abhinav Kandala, 019-0157-8. URL https://doi.org/10.1038/ Jerry M Chow, and Jay M Gambetta. Su- s41534-019-0157-8. pervised learning with quantum-enhanced feature [3] X. Bonet-Monroig, R. Sagastizabal, M. Singh, spaces. Nature, 567(7747):209, 2019. DOI: and T. E. O’Brien. Low-cost error mitiga- 10.1038/s41586-019-0980-2. URL https://doi. tion by symmetry verification. Phys. Rev. org/10.1038/s41586-019-0980-2. A, 98:062339, Dec 2018. DOI: 10.1103/Phys- [13] Harold Hotelling. Analysis of a complex of statis- RevA.98.062339. URL https://doi.org/10. tical variables into principal components. Journal 1103/PhysRevA.98.062339. of educational psychology, 24(6):417, 1933. DOI: [4] Lukasz Cincio, Yi˘gitSuba¸sı,Andrew T Sornborger, 10.1037/h0071325. URL https://doi.org/10. and Patrick J Coles. Learning the quantum algo- 1037/h0071325. rithm for state overlap. New Journal of Physics, 20(11):113022, nov 2018. DOI: 10.1088/1367- [14] Peter D Johnson, Jonathan Romero, Jonathan Ol- 2630/aae94a. URL https://doi.org/10.1088% son, Yudong Cao, and Al´anAspuru-Guzik. QVEC- 2F1367-2630%2Faae94a. TOR: an algorithm for device-tailored quantum er- [5] J. I. Colless, V. V. Ramasesh, D. Dahlen, ror correction. arXiv preprint arXiv:1711.02249, M. S. Blok, M. E. Kimchi-Schwartz, J. R. Mc- 2017. URL https://arxiv.org/abs/1711.02249. Clean, J. Carter, W. A. de Jong, and I. Sid- [15] Tyson Jones, Suguru Endo, Sam McArdle, Xiao diqi. Computation of molecular spectra on a Yuan, and Simon C. Benjamin. Variational quan- quantum processor with an error-resilient algo- tum algorithms for discovering hamiltonian spec- rithm. Phys. Rev. X, 8:011021, Feb 2018. DOI: tra. Phys. Rev. A, 99:062304, Jun 2019. DOI: 10.1103/PhysRevX.8.011021. URL https://doi. 10.1103/PhysRevA.99.062304. URL https:// org/10.1103/PhysRevX.8.011021. doi.org/10.1103/PhysRevA.99.062304. [6] B. Efron. Bootstrap methods: Another look at the [16] Ian D. Kivlichan, Jarrod McClean, Nathan jackknife. Ann. Statist., 7(1):1–26, 01 1979. DOI: Wiebe, Craig Gidney, Al´anAspuru-Guzik, Gar- 10.1214/aos/1176344552. URL https://doi.org/ net Kin-Lic Chan, and Ryan Babbush. Quan- 10.1214/aos/1176344552. tum simulation of electronic structure with lin- [7] Suguru Endo, Simon C. Benjamin, and Ying Li. ear depth and connectivity. Phys. Rev. Lett., Practical quantum error mitigation for near-future 120:110501, Mar 2018. DOI: 10.1103/Phys-

Accepted in Quantum 2019-06-14, click title to verify 9 RevLett.120.110501. URL https://doi.org/10. package for quantum computers. arXiv preprint 1103/PhysRevLett.120.110501. arXiv:1710.07629, 2017. URL https://arxiv. [17] Emanuel Knill, Gerardo Ortiz, and Rolando D. org/abs/1710.07629. Somma. Optimal quantum measurements of [26] Nikolaj Moll, Panagiotis Barkoutsos, Lev S Bishop, expectation values of . Phys. Rev. Jerry M Chow, Andrew Cross, Daniel J Egger, A, 75:012328, Jan 2007. DOI: 10.1103/Phys- Stefan Filipp, Andreas Fuhrer, Jay M Gambetta, RevA.75.012328. URL https://doi.org/10. Marc Ganzhorn, et al. Quantum optimization 1103/PhysRevA.75.012328. using variational algorithms on near-term quan- [18] Joonho Lee, William J Huggins, Martin Head- tum devices. Quantum Science and Technol- Gordon, and K Birgitta Whaley. General- ogy, 3(3):030503, jun 2018. DOI: 10.1088/2058- ized unitary coupled cluster wavefunctions for 9565/aab822. URL https://doi.org/10.1088% quantum computation. Journal of chemi- 2F2058-9565%2Faab822. cal theory and computation, 2018. DOI: [27] P. J. J. O’Malley, R. Babbush, I. D. Kivlichan, 10.1021/acs.jctc.8b01004. URL https://doi. J. Romero, J. R. McClean, R. Barends, J. Kelly, org/10.1021/acs.jctc.8b01004. P. Roushan, A. Tranter, N. Ding, B. Campbell, [19] Seth Lloyd, Masoud Mohseni, and Patrick Reben- Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, A. G. trost. Quantum principal component analy- Fowler, E. Jeffrey, E. Lucero, A. Megrant, J. Y. sis. Nature Physics, 10(9):631, 2014. DOI: Mutus, M. Neeley, C. Neill, C. Quintana, D. Sank, 10.1038/nphys3029. URL https://doi.org/10. A. Vainsencher, J. Wenner, T. C. White, P. V. 1038/nphys3029. Coveney, P. J. Love, H. Neven, A. Aspuru-Guzik, [20] Lester W. Mackey. Deflation methods and J. M. Martinis. Scalable quantum simulation for sparse PCA. pages 1017–1024, 2009. of molecular energies. Phys. Rev. X, 6:031007, Jul URL http://papers.nips.cc/paper/ 2016. DOI: 10.1103/PhysRevX.6.031007. URL 3575-deflation-methods-for-sparse-pca. https://doi.org/10.1103/PhysRevX.6.031007. pdf. [28] Lawrence Page, Sergey Brin, Rajeev Motwani, and [21] Sam McArdle, Suguru Endo, Ying Li, Simon Ben- Terry Winograd. The PageRank citation ranking: jamin, and Xiao Yuan. Variational quantum simu- Bringing order to the web. Technical Report 1999- lation of imaginary time evolution with applica- 66, Stanford InfoLab, November 1999. URL http: tions in chemistry and beyond. arXiv preprint //ilpubs.stanford.edu:8090/422/. arXiv:1804.03023, 2018. URL https://arxiv. [29] Karl Pearson. On lines and planes of closest fit org/abs/1804.03023. to systems of points in space. The London, Ed- [22] Sam McArdle, Xiao Yuan, and Simon Ben- inburgh, and Dublin Philosophical Magazine and jamin. Error-mitigated digital quantum simula- Journal of Science, 2(11):559–572, 1901. DOI: tion. Phys. Rev. Lett., 122:180501, May 2019. DOI: 10.1080/14786440109462720. URL https://doi. 10.1103/PhysRevLett.122.180501. URL https:// org/10.1080/14786440109462720. doi.org/10.1103/PhysRevLett.122.180501. [23] Jarrod R McClean, Jonathan Romero, Ryan [30] Alberto Peruzzo, Jarrod McClean, Peter Shad- Babbush, and Al´an Aspuru-Guzik. The the- bolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, ory of variational hybrid quantum-classical algo- Al´anAspuru-Guzik, and Jeremy L O’brien. A rithms. New Journal of Physics, 18(2):023023, variational eigenvalue solver on a photonic quan- feb 2016. DOI: 10.1088/1367-2630/18/2/023023. tum processor. Nature communications, 5, 2014. URL https://doi.org/10.1088%2F1367-2630% DOI: 10.1038/ncomms5213. URL https://doi. 2F18%2F2%2F023023. org/10.1038/ncomms5213. [24] Jarrod R. McClean, Mollie E. Kimchi-Schwartz, [31] John Preskill. Quantum computing in the Jonathan Carter, and Wibe A. de Jong. Hybrid NISQ era and beyond. Quantum, 2:79, August quantum-classical hierarchy for mitigation of deco- 2018. ISSN 2521-327X. DOI: 10.22331/q-2018- herence and determination of excited states. Phys. 08-06-79. URL https://doi.org/10.22331/ Rev. A, 95:042308, Apr 2017. DOI: 10.1103/Phys- q-2018-08-06-79. RevA.95.042308. URL https://doi.org/10. [32] Jonathan Romero, Ryan Babbush, Jarrod R Mc- 1103/PhysRevA.95.042308. Clean, Cornelius Hempel, Peter J Love, and Al´an [25] Jarrod R McClean, Kevin J Sung, Ian D Kivlichan, Aspuru-Guzik. Strategies for quantum comput- Yudong Cao, Chengyu Dai, E Schuyler Fried, ing molecular energies using the unitary coupled Craig Gidney, Brendan Gimby, Pranav Gokhale, cluster ansatz. Quantum Science and Technol- et al. OpenFermion: the electronic structure ogy, 4(1):014008, Oct 2018. DOI: 10.1088/2058-

Accepted in Quantum 2019-06-14, click title to verify 10 9565/aad3e4. URL https://doi.org/10.1088% ational algorithms. Phys. Rev. A, 92:042303, 2F2058-9565%2Faad3e4. Oct 2015. DOI: 10.1103/PhysRevA.92.042303. [33] Nicholas C Rubin, Ryan Babbush, and Jarrod Mc- URL https://doi.org/10.1103/PhysRevA.92. Clean. Application of fermionic marginal con- 042303. straints to hybrid quantum algorithms. New Jour- nal of Physics, 20(5):053020, may 2018. DOI: 10.1088/1367-2630/aab919. URL https://doi. org/10.1088%2F1367-2630%2Faab919. [34] Ilya G Ryabinkin, Scott N Genin, and Ar- tur F Izmaylov. Constrained variational quan- tum eigensolver: Quantum computer search en- gine in the Fock space. Journal of chemi- cal theory and computation, 15(1):249–255, 2018. DOI: 10.1021/acs.jctc.8b00943. URL https:// doi.org/10.1021/acs.jctc.8b00943. [35] Raffaele Santagati, Jianwei Wang, Antonio A. Gentile, Stefano Paesani, Nathan Wiebe, Jar- rod R. McClean, Sam Morley-Short, Peter J. Shad- bolt, Damien Bonneau, Joshua W. Silverstone, David P. Tew, Xiaoqi Zhou, Jeremy L. O’Brien, and Mark G. Thompson. Witnessing eigenstates for quantum simulation of hamiltonian spectra. Science Advances, 4(1), 2018. DOI: 10.1126/sci- adv.aap9646. URL https://doi.org/10.1126/ sciadv.aap9646. [36] Peter W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput., 26(5): 1484–1509, October 1997. ISSN 0097-5397. DOI: 10.1137/S0097539795293172. URL https://doi. org/10.1137/S0097539795293172. [37] Damian S. Steiger, Thomas H¨aner,and Matthias Troyer. ProjectQ: an open source software frame- work for quantum computing. Quantum, 2: 49, January 2018. ISSN 2521-327X. DOI: 10.22331/q-2018-01-31-49. URL https://doi. org/10.22331/q-2018-01-31-49. [38] Attila Szabo and Neil S. Ostlund. Modern Quan- tum Chemistry: Introduction to Advanced Elec- tronic Structure Theory. Dover Publications, Inc., Mineola, first edition, 1996. [39] Kristan Temme, Sergey Bravyi, and Jay M. Gam- betta. Error mitigation for short-depth quan- tum circuits. Phys. Rev. Lett., 119:180509, Nov 2017. DOI: 10.1103/PhysRevLett.119.180509. URL https://doi.org/10.1103/PhysRevLett. 119.180509. [40] Daochen Wang, Oscar Higgott, and Stephen Brier- ley. Accelerated variational quantum eigensolver. Phys. Rev. Lett., 122:140504, Apr 2019. DOI: 10.1103/PhysRevLett.122.140504. URL https:// doi.org/10.1103/PhysRevLett.122.140504. [41] Dave Wecker, Matthew B. Hastings, and Matthias Troyer. Progress towards practical quantum vari-

Accepted in Quantum 2019-06-14, click title to verify 11