<<

PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

Efficient two- ansatz for benchmarking chemistry on a quantum computer

Scott E. Smart and David A. Mazziotti* Department of Chemistry and James Franck Institute, The University of Chicago, Chicago, Illinois 60637, USA

(Received 18 December 2019; accepted 16 March 2020; published 17 April 2020)

Quantum chemistry provides key applications for near-term , but these are greatly complicated by the presence of noise. In this work we present an efficient ansatz for the computation of two- electron and molecules within a hybrid quantum-classical algorithm. The ansatz exploits the fundamental structure of the two-electron system, treating the nonlocal and local degrees of freedom on the quantum and classical computers, respectively. Here the nonlocal degrees of freedom scale linearly with respect to basis-set size, giving a linear ansatz with only O(1) circuit preparations required for reduced state tomography. We implement this benchmark with error mitigation on two publicly available quantum computers, calculating + accurate dissociation curves for four- and six- calculations of H2 and H3 .

DOI: 10.1103/PhysRevResearch.2.023048

I. INTRODUCTION separation between the nonlocal and local fermionic degrees of freedom in the system [17], scaling linearly and polynomi- Quantum computers possess a natural affinity for quantum ally, respectively, and can be leveraged in a variational hybrid simulation and can transform exponentially scaling problems quantum-classical algorithm. The entangled nonlocal degrees into polynomial ones [1–3]. , the ability are treated on the quantum computer while the local degrees of a quantum computer to surpass its classical counterpart are treated on the classical computer, leading to an efficient on a designated task with lower asymptotic scaling, is poten- simulation of the system. tially realizable for the simulation of quantum many-electron For a to exhibit quantum supremacy, systems [4,5]. Work over the previous decade has been to- obtaining the solution classically will be impractical except wards this goal with a focus on calculating the energy of for cases that are close to the classical limits of feasibil- small molecules and exploring strategies to leverage emerging ity [4,5]. For some problems such as prime factorization, the quantum technologies, especially those designed to correct solution can be quickly verified, but for many-body quantum or mitigate quantum errors [6–8]. In this paper we introduce systems this is not the case [18–22]. Possessing “easy” classi- an efficient ansatz for a two-electron quantum-mechanical cally solvable problems to implement and verify will be cru- system that can be employed as a benchmark for assessing cial to evaluate the performance of quantum devices and error the capabilities and accuracy of quantum computers. The twin mitigation schemes [23]. Our proposed quantum-classical hy- goals of the work are (i) to present a quantum-computing brid algorithm targets only the necessary entanglement needed benchmark based on the correlated but polynomial scaling on the quantum computer, scales linearly with respect to basis two-electron problem, solvable on classical computers, that size, and has O(1) circuit preparations, making it an ideal can be used to assess the accuracy of quantum computers benchmark for molecular simulation. We highlight this by and (ii) to develop an efficient ansatz for solving the two- + evaluating this ansatz through the computation of H and H electron problem on quantum computers, based on an effec- 2 3 on two generations of publicly available quantum devices. tive partitioning of the computational work between classical and quantum computers that is applicable to more general N-electron molecular systems. II. THEORY The two-electron density (2DM) of any two- Because the representation of the 2DM in terms of electron system can be expressed as a functional of its one- the 1RDM and phase factors has been well studied else- electron reduced (1RDM) and a set of phase where [11,24–26], we present in Sec. II A only the aspects factors. This representation of the 2DM has important con- of the theory that are relevant to the quantum-classical hybrid nections to natural-orbital functional theories and geminal- algorithm in Sec. II B. We also discuss the preparation of the based theories in [9–16]. It offers a natural linear-scaling ansatz in Sec. II C and practical error mitigation techniques in Sec. II D that are employed in the benchmarks in Sec. III. *Corresponding author: [email protected] A. Structure of the two-electron system Published by the American Physical Society under the terms of the For a two-electron system the energy is given as the trace Creative Commons Attribution 4.0 International license. Further of the Hamiltonian and the density matrix distribution of this work must maintain attribution to the author(s) and the published article’s title, journal citation, and DOI. E = Tr(HD), (1)

2643-1564/2020/2(2)/023048(8) 023048-1 Published by the American Physical Society SCOTT E. SMART AND DAVID A. MAZZIOTTI PHYSICAL REVIEW RESEARCH 2, 023048 (2020) where H and D are 2r × 2r, with 2r being the rank of the is simply the of the term that can easily be measured one-electron basis set and on a quantum computer. That is, we need the phase ξii where Dij = g g∗ (2) kl ij kl √ g˜ii = niξii . (8) in which the wave-function expansion coefficients gij are elements of the coefficient matrix G. From the antisymmetric nature of fermions, G must be a skew-symmetric matrix, In general, the phases can be measured through tomography ˜ and from a theorem by Zumino [26], G must have a block- on the quantum computer of certain terms of D requiring diagonal form G˜ with 2 × 2 matrices G : only O(1) additional circuit preparations. The details of the i specific ansatz for the tomography are discussed in the next G˜ = diag(G0, G1,...,Gr ), (3) section.     After convergence criteria in the optimization of D˜ on the 0˜gii 0˜gii quantum computer are satisfied through gradient-free opti- Gi = = . (4) g˜ii 0 −g˜ii 0 mization (see Appendix A), we optimize the energy on the classical computer through one-body unitary transformations The block-diagonal form of G in Zumino’s theorem defines of the Hamiltonian. Specifically, we optimize the orbitals an orbital basis set with a natural pairing of the orbitals where  through a series of Givens rotations. These complementary we denote the indices of an orbital and its pair by i and i , quantum and classical optimizations are sequentially repeated respectively. until the energy and 2DM converge. The 2DM in Zumino’s basis has only nonzero elements of the form ˜ ii = ∗ . C. Preparation of the efficient quantum ansatz Dkk g˜ii g˜kk (5) To create a state of the form in Eq. (3) on the quantum The 1RDM, containing the one-body information, can be computer, we need to implement double excitations from obtained from the 2DM by contraction, orbitals ii to kk. If we consider an initial  ˜ i ik ii ∗ G0 from a standard Hartree-Fock calculation, the ansatz to 1 ˜ = ˜ = ˜ = = =  , Di Dik Dii g˜ii g˜ii ni ni (6) generate a generic G˜ is k 1 ˜ i = , r−1 D j 0 (7)    ˜ = ¯i¯i ˜ , G exp tii G0 (9) where all 2DM elements in the contraction vanish except i=1 when k = i. Because the 1RDM is diagonal in Zumino’s basis set, we find that Zumino’s basis set is identically the ¯ = + ¯i¯i where i i 1 and tii is an anti-Hermitian, antisymmetric natural-orbital basis set and that the occupations ni are the  two-body matrix with nonzero elements corresponding to an natural-orbital occupations. The paired orbitals i and i ,we excitation between i, i and (i + 1), (i + 1). The operators observe, have equal occupations ni and ni . For a system of acting on G˜ can be easily expressed in second quantiza- = 0 two with Sz 0, these paired orbitals the same tion as shown in the Appendixes. The ansatz is a subset of spatial component with different components, denoted by the unitary coupled cluster [32] or anti-Hermitian contracted α β convention by and . This decomposition can be viewed Schrödinger equation ansatz [33]. From there we perform a = as a particular case (N 2) of a more general result derived Jordan-Wigner transformation (though others may be utilized) by Schmidt [27] and later by Carlson and Keller [28]. The which yields an exponential of Pauli strings that are imple- importance of this decomposition as a quantum-computing mentable on a quantum device as strings of controlled-NOT ansatz for two electrons will be manifest below. (CNOT) gates [34]. Additionally, the implementation naturally requires only a nearest-neighbor connectivity among . B. Variational hybrid algorithm Finally, the tomography of the state involves only the Hybrid quantum-classical algorithms with a variational measurement of the orbital occupations for a given qubit in the computational basis as well as the sign. Because there eigenvalue solver are among the most promising algorithms − for near-term applications [6,29–31]. For our approach we are only r 1 phase terms since the last phase is equivalent to a global phase, we only require the tomography of a utilize a variational eigensolver on the quantum device but jj linear number of sequential terms in D˜ of the form D˜  , apply it only to the optimization of the 2DM in the natural-   ii = + ˜ jj ˜ ( j+2)(j+2) orbital basis set. Optimization of the natural orbitals by or- with j i 1. Because terms like Dii and D(i+2)(i+2) are bital rotations is performed with polynomial scaling on the qubitwise commuting, we can measure r/2 terms simultane- classical computer. In this manner we are able to partition the ously, leading to a constant number of circuit preparations. In + nonlocal and local degrees of freedom between the quantum this work we evaluated H2 and H3 using the Jordan-Wigner and classical calculations respectively. transformation in four- and six-qubit cases. There is only one Using the structure given in Eqs. (3)–(7), we see that phase term in the four-qubit calculations of H2, which we to evaluate the D˜ matrix, we need only (a) the natural- measured by direct tomography on the quantum computer, + orbital occupations, measured as the orbital populations on whereas the two phases of the six-qubit calculation of H3 the quantum computer, and (b) the phase corresponding to were computed by optimization on the classical computer to the natural-orbital coefficients, which for a real wave function avoid degradation from noise on the quantum computer.

023048-2 EFFICIENT TWO-ELECTRON ANSATZ FOR … PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

D. Error mitigation strategies Even if we model a two-electron system on a quantum computer and construct the state through the above tomog- −0.95 raphy, we may find that the occupations ni and ni do not match for a given i, which implies a violation of the fermion statistics. Because the two-electron ansatz in Sec. II B for- −1.00 “Chemical Accuracy” mally guarantees a two-electron wave function, any deviation 1 in pure-state N representability (up to sampling errors) is due −1.05 to errors on the quantum computer [11,35,36]. 0 Error (mhartree) The effect of errors on current quantum computers can Energy (hartree) 12 N easily influence the representability of a system [11,37] −1.10 FCI with the extent somewhat depending on the fermionic map- RDM-QC, -5 ping. For a compact mapping, Sz and N will typically remain RDM-QC, ibm-14 constant, but for more general mappings, this is not the case. −1.15 0.51.01.52.02.5 Other errors can also accumulate, making it difficult to reach ˚ certain extrema of the set of density matrices. To address this, H-H Distance (A) we use a projective technique where we map the set of accessi- FIG. 1. Dissociation curves for the of H2 from the ble points onto the ideal set of points (see the Appendixes). We variational quantum algorithm on the quantum computer and the full achieve this by finding an affine transformation A that maps  configuration interaction (FCI) method are shown. Both results were from the accessible but error-prone set S to the ideal set S. run with 4 qubits, but on 5- and 14-qubit frameworks. The inset For a general mapping, it is easy for the quantum system shows the difference in energy from the FCI results in millihartrees. to violate N and Sz. By utilizing a verification The increased error for the shortest distance relates to the difficulty in technique [20,21], along with the structure of our tomography reaching the Hartree-Fock state on a quantum computer when using requiring only measurements of diagonal terms, we can filter entangling gates. For more experimental details, see the Appendixes. out results which do not obey the correct N and Sz values, which effectively projects the resulting state into an eigenstate and we also show the effect of the symmetry verification in of the chosen . This can be extended to other operators correcting the occupations. S which commute with the Hamiltonian: While the ibm-5 device maintains continuity with respect 22 to t11 , it has distinct problems. First, we observe (see the top [S, H] = 0. (10) left panel) a correlated measurement error in the set of qubit

As will be seen in the results, the symmetry verification is 1.00 1.00 useful in bringing the results back to the set of all two-electron states, and then the projection restores the equality of the two 0.75 0.75 pairing-related sets of occupations ni and ni .  i 0.50 0.50 i n n III. RESULTS 0.25 0.25 Using the two-electron ansatz, we first treat the molecular dissociation of H2 in a minimal Slater-type-orbital–expanded- 0.00 0.00 in-three-Gaussians basis set of two electrons in four orbitals. 1.00 1.00 The quantum algorithm is implemented on both the 5- and 14-qubit devices, denoted by ibm-5 and ibm-14, representing 0.75 0.75 two generations of superconducting quantum devices by IBM.  i With the Jordan-Wigner transformation [38] the system can be 0.50 0.50 i n represented with four qubits, though more compact mappings n are certainly possible. Note that in this basis only a single 0.25 0.25 excitation is possible. Figure 1 shows the potential energy curve of the H2 molecule, computed with full error mitigation. 0.00 0.00 With the help of error mitigation techniques, both quantum −2.50.02.5 −2.50.02.5 22 22 devices are able to capture the dissociation of the molecule, t11 t11 achieving millihartree accuracy across the spectrum of states, leaving differences in the devices somewhat unclear. Inspec- FIG. 2. Measured (unordered) occupation numbers with respect tion of the device calibration (Appendix A, Table II) indicates 22 to the coefficient t11 of the single double-excitation operator within that large measurement errors likely occur on ibm-5 with the entangling circuit. Blue triangles represent the first qubit and superior performance expected from ibm-14. Scans of the green circles represent the second qubit, unordered. Open sym- 22 1RDMs with respect to the t11 parameter controlling the bols show the raw occupations and closed symbols the symmetry- single double excitation are shown in Fig. 2. The ibm-5 device corrected occupations. Uncertainties for the values are similar in size is shown in the top row and the ibm-14 in the bottom row, to the markers.

023048-3 SCOTT E. SMART AND DAVID A. MAZZIOTTI PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

TABLE I. Area between the two occupations (V ) obtained for the To quantify the effects of symmetry verification, we calcu- entangling circuit described in the text for the two different quantum late the area between the two changing orbital occupations for  devices with different post-measurement . The Vi and Vi both {ni} and {ni } (denoted by Vi and Vi , where Vi = n2 − n1 values were calculated separately. Here we have the 5- and 14-qubit and Vi = n2 − n1 ), subject to different symmetries, as well devices, given in a 95% confidence interval due to sampling. The left as the uncertainty in measurement after each symmetry is ap- column denotes the symmetry or symmetries applied. plied, and show these in Table I. The maximum and minimum values for this metric would be 2 and 0, representing fully 5-qubit device 14-qubit device error-free and fully decohered states, respectively. In each

Symmetry Vi Vi Vi Vi case, application of multiple symmetries serves to increase the resulting “reach” of the state, without increasing variance with ± ± ± ± none 0.096 0.005 0.861 0.007 1.405 0.007 1.476 0.007 respect to decreased measurement counts. N ± ± ± ± 0.18 0.01 0.75 0.01 1.89 0.01 1.907 0.009 Computations with six orbitals are performed only on S 0.25 ± 0.01 1.06 ± 0.02 1.723 ± 0.009 1.736 ± 0.009 z the ibm-14 device since more than five qubits are required. N, S 0.33 ± 0.02 1.43 ± 0.02 1.93 ± 0.01 1.94 ± 0.01 z Using simplifications used by Nam et al. [39], we are able to construct a gate with eight CNOT gates which still requires occupations {ni} which causes an inversion in the expected only neighboring connections (see Appendix C). Due to the relationship between n1 and n2 among the i (α) occupations. longer depth of the circuit, the effects of noise are more Second, we find that symmetry verification is effective in pronounced and we find it difficult to reliably measure the increasing the differentiability of the two states (note, for a phase of the 2DM terms required in Eq. (8) and note that decohered system, that n1 and n2 would be identically 0.5), these are not always continuous. To show the overall effect yet it is not able to correct for the reversal in ordering seen on of errors on the six-qubit system on the local occupations, the qubits and somewhat reinforces this error for n2. we present a scan of possible symmetry verified 1RDMs On ibm-14, while there is still a contraction of the occu- over a range of the parametrized entangling gates in Fig. 3. 22 pation numbers across the range of t11 , the obtained curve Additional details regarding the computation are provided in is continuous and the two sets of occupations correspond to the Appendixes. While we do not show the occupations in expected values. With symmetry verification, we obtain nearly terms of the parameters, the effect of the aggregate errors the ideal occupations, which otherwise are far from spanning for this case is again to shrink the portion of the hyperplane the full spectrum of occupations. The effect of our further accessible to the quantum device. correction is to stretch the sinusoidal curves in Fig. 2 so that Expectedly, the obtained results differ greatly depending their maxima and minima are 1.0 and 0.0, respectively; hence on the qubits and available connectivity of the quantum de- it is not shown here. vice, though in general we still observe a degree of continuity

1.0 1.0 t33 =+0.00 t33 =−0.94 0.5 {ni} 22 22 0.8 0.8 {ni } 0.6 0.6

0.4 iσ iσ n 0.4 0.4 n

0.2 0.2 0.3 0.0 0.0 σ

2 −2 0 −2 0 n 1.0 1.0 33 33 0.2 t22 =−1.88 t22 =−2.83 0.8 0.8

0.6 0.6

0.1 iσ iσ n 0.4 0.4 n

0.2 0.2 0.0 0.0 0.0 0.40.60.81.0 −2 0 −2 0 22 22 n1σ t11 t11

FIG. 3. Shown on the left are the measured occupations of the six-qubit system following symmetry application of N and Sz, as well as the boundaries of the ideal polytope. Note that σ refers to the use of i or i. Because these occupations correspond with an N-representable system, the equality n1σ + n2σ + n3σ = 1 holds and so we show the orthographic projection along the n3σ axis. The device was sampled over the range 22 , 33 ∈ −π, π t11 t22 [ 0] in 10 intervals for the entangling parameters. The ratios of areas of the experimental and theoretical convex hulls of these obtained points are 0.48 and 0.68 for {ni} and {ni }, respectively. Shown on the right are unordered n1σ , n2σ ,andn3σ occupations with respect 22 33 to parameters t11 at different slices of t22 (given in each plot). Dashed lines indicate the ideal occupations for the unordered qubits (equivalent 1 1 1 ,  , , = , , for ni ni ). The set of occupations closer to (n1 n2 n3 ) ( 3 3 3 ) is well covered, though there is clear difficulty in reaching uncorrelated regions, where only one occupation is 1.

023048-4 EFFICIENT TWO-ELECTRON ANSATZ FOR … PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

factors of r2 and r4, respectively. Other methods based on the −0.95 propagation of the Hamiltonian could be implemented, but they also would have large costs and would not necessarily −1.00 lead to the same advantages that result from the structure of the 2DM. −1.05 From the results above it is clear one cannot rely solely on 4 −1.10 the energy or other external molecular properties to investigate the integrity of the quantum device, particularly in comparing 2 −1.15 the performance of the two-qubit devices on the four-qubit

Energy (hartree) 0 calculation. While averaged or localized metrics related to Error (mhartree) −1.20 12 qubit depolarization, dephasing, or bit-flip errors are often used as indicators of performance of the quantum device, −1.25 FCI RDM-QC, ibm-14 they may not translate directly to the fidelity of a simulated fermionic system, particularly with multiqubit or environmen- 0.51.01.52.02.53.03.5 tal effects. Looking at these metrics in conjunction with the H-Hcenter Separation (A)˚ physical properties of benchmark problems like the ground- + state energy or 2DM of two-electron atoms and molecules will FIG. 4. Dissociation curves for the ground state of H from the 3 yield greater insights into the fidelity of a quantum device and variational quantum algorithm on the quantum computer and the FCI method. The experiment was run on a 14-qubit framework. The inset its needs for error mitigation or correction. shows the difference in energy from the FCI results in millihartrees. The method of symmetry verification for error mitigation The increased error for the shortest distance relates to the difficulty in is useful in that its different forms are low cost and can easily reaching the Hartree-Fock state on a quantum computer when using correct flagrant faults in the output, such as particle count (or entangling gates. For more experimental details, see the Appendixes. more generally, parity) and the projected spin symmetries. Other forms of error mitigation related to the RDMs can be implemented as constraints on the tomography from N in the local 1RDM properties. By dealing with the phases representability, or in a form of postcorrection of the two- classically, we are able to calculate the dissociation curve for electron RDM, where the measured 2RDM is purified through + triangular H3 in Fig. 4. Again, we are able to obtain chemi- semidefinite programming, which can be applied to arbitrary cally accurate energies across the dissociation curve, although N-electron systems [40]. Additionally, the mapping we use there is difficulty in sampling the uncorrelated Hartree-Fock can have difficulties when errors begin to change the ordering state which is a vertex of the polytope. The error mitigation of occupations for larger and larger systems. techniques we use also extend the capabilities of noise-limited The electron pair itself plays a key role in such phenomena quantum computers, which otherwise do not span the ideal N as superconductivity and bonding and yet the exact energy representability of the state [40]. of a two-electron system itself cannot be solved exactly with known methods. Such a problem shows the essence of the IV. DISCUSSION AND CONCLUSION electron-electron interaction as well as some of the com- plexities of electron correlation and quantum . The In this work we present an ansatz for two-electron quantum theory in this work can also be seen as a subset of more com- systems which can be implemented on near-term and fu- plex geminal-based wave-function methods, which appear in ture quantum computers. Applying this on two public-access classical electronic structure theory where the electron pair quantum computers highlights the successes and differences is treated as the fundamental unit to improve the accuracy of two generations of quantum computers, as well as the beyond the mean-field approximation [9–16,41–43]. The ex- difficulties which must be overcome in approaching more ploitation of the structure of the 2DM in the natural-orbital complicated systems. We also show that, using error mitiga- basis set can be extended to more general pairing 2RDMs + tion strategies, we are able to simulate both H2 and H3 to for efficient implementations of pairing (geminal) theories or high accuracy. The proposed ansatz can be readily applied natural-orbital functional theories on quantum computers. to two-electron atoms and molecules in larger basis sets with Here we show that the properties of the two-electron similar types of error mitigation. The gate sequence proposed system lead to an ansatz which is well suited for use in a here can be applied as a generic ansatz, removing the need for hybrid quantum-classical approach, where degrees of free- long expansions of the required exponential operators. dom that would increase exponentially with N are treated The ansatz is efficient mainly in regard to its scalability on the quantum computer, while nonexponentially increasing with respect to other methods of state preparation. A unitary degrees of freedom are treated on the classical computer. The coupled cluster ansatz, which for a two-electron system only treatment of the orbital rotations on the classical computer needs to be expressed with single and double excitations and can be generalized to N-electron molecular systems in which which additionally has only one occupied orbital for the α and the orbital rotations can be used to implement active-space β excitations, still would have O(r2 ) terms in the ansatz. Fur- methods where orbital rotations are used to optimize the thermore, quantum tomography would additionally require correlation in a modest subset of total orbitals known as the measurement of the αβ block of the 2DM, which naively the active orbitals. Generally, such orbital-rotation algorithms has O(r4) terms, and hence the method would scale as O(r6) including active-space self-consistent-field algorithms [44,45] where the depth d and the number of measurements contribute could assist in achieving quantum supremacy by further

023048-5 SCOTT E. SMART AND DAVID A. MAZZIOTTI PHYSICAL REVIEW RESEARCH 2, 023048 (2020) lowering resource requirements on the quantum computer as TABLE II. Calibration data for the ibm-5 and ibm-14 devices well as tomography and measurement costs. The two-electron during benchmarking. Here U2 and U3 represent the errors for single- system also is useful in its own right as a benchmark for qubit unitaries containing one and two Xπ/2 pulses and two and molecular simulation on a quantum computer, where it serves three frame changes, respectively; RO represents the readout error; as a simple yet effective way to assess the performance of we have the standard T1 depolarization and T2 dephasing times; [ j] an arbitrary quantum device. The present work is clearly specifies the target qubit with control qubit i and we report the error. applicable for the current state of noisy quantum computers, Qubit U U RO T T [ j] CX j but will continue to be relevant as improving generations of 2 3 1 2 i −3 −3 −2 μ μ −2 quantum computers are developed. The two-electron ansatz, i (10 )(10 )(10 )(s) ( s) (10 ) albeit polynomially scaling even on a classical computer, can ibm-5 serve as a powerful benchmark for quantum computers due 0 2.7 5.5 5 46 53 [1] 5.1 [2] 4.2 to the availability of accurate results from classical computers 1 2.9 5.8 25 62 53 [2] 6.8 and the requirements shared by its solution and the solution of 2 6.4 12.9 1 85 74 exponentially scaling many-electron problems. 3 3.8 7.6 17 61 28 [2] 7.9 [4] 4.0 4 2.8 5.7 36 68 62 [2] 4.2 Data are available from the corresponding author upon ibm-14 reasonable request. 0 2.3 4.7 3 62 22 1 5.1 10.1 10 54 101 [0] 3.7 [2] 6.4 2 3.9 7.8 5 75 168 [3] 6.7 ACKNOWLEDGMENTS 3 1.5 3.0 27 63 51 The views expressed herein are of the authors and do not 4 2.4 4.8 6 56 34 [3] 5.6 [10] 5.4 reflect the official policy or position of IBM or the IBM 5 2.3 4.6 4 24 46 [4] 6.1 [6] 7.5 [9] 5.9 Q team. D.A.M. gratefully acknowledges the Department of 6 2.3 4.6 4 77 53 [8] 2.9 Energy, Office of Basic Energy Sciences, Grant No. DE- 7 1.3 2.7 16 50 82 [8] 2.3 SC0019215, the U.S. National Science Foundation Grant No. 8 1.5 3.0 4 125 183 9 2.8 5.6 4 44 65 [8] 7.0 [10] 4.0 CHE-1565638, and the U.S. Army Research Office Grant 10 2.5 5.0 4 51 55 No. W911NF-16-1-0152. We also are thankful to the two 11 181 362 34 63 102 [3] 14 [10] 10 [12] 11 reviewers who gave invaluable feedback. D.A.M. conceived 12 3.7 7.3 9 89 177 [2] 7.3 of the research project. S.E.S. and D.A.M. developed the 13 5.1 10.3 4 26 59 [1] 13 [12] 3.9 theory. S.E.S. performed the calculations. S.E.S. and D.A.M. discussed the data and wrote the manuscript.

APPENDIX B: ERROR MITIGATION WITH N 2 APPENDIX A: COMPUTATIONAL DETAILS REPRESENTABILITY OF ∧ Hn The electronic structure package PYSCF [46] was used to The error correction is similar to previous work where obtain the one- and two-electron integrals and to perform re- we look for a transformation A to map the experimental stricted Hartree-Fock and full configuration-interaction (FCI) polytope S to the correct polytope S [40]. The structure of calculations. For the quantum computation we used the IBM the N-representability conditions is such that the ordering Quantum Experience devices Yorktown (Sparrow, 5 qubits) inequalities applied to each of the half sets ({ni} and {ni }) and Melbourne (Albatross, 14 qubits), available online. The describe a hyperplane. The vertices V r can be described as r former has triangular-type coupling between qubits and the a set with elements v j (r spatial orbitals), latter has square-type coupling between qubits. These cloud  accessible quantum devices are fixed-frequency H( j − 1) H( j − 2) H( j − r) vr = , ,..., , (B1) qubits with coplaner waveguide resonators [47,48]. The quan- j j j j tum information software development kit QISKIT was used to   interface with the device [49]. We include the calibration data where 1 j r and H(x) is the Heaviside step function. The ∧2H 2 = , 2 = 1 , 1 in Table II. vertices for 4 are given as v1 (1 0) and v2 ( 2 2 ). 11 ∧2H 3 = , , 3 = 1 , 1 , For the six-qubit case, 2 measurements were obtained The vertices for 6 are then v1 (1 0 0), v2 ( 2 2 0), 3 = 1 , 1 , 1 − and we used a simple Nelder-Mead simplex method with the and v3 ( 3 3 3 ). These form an (r 1)-dimensional hy- Han initial simplex [50] for the six-qubit case on the quantum perplane in the r-dimensional subspace for the two half sets, computer. Classically orbital rotations were performed with respectively. The practical effect of symmetry verification Givens rotations, with the Broyden-Fletcher-Goldfarb-Shanno here (mostly from the Sz application) is to project noisy points algorithm being utilized. Convergence criteria were more onto the plane. The effect of the N-representability application strict for the four-qubit case, with convergence between the then is to map the measured points to the extreme points of  2D and 2K steps being 1 mH. In the four- and six-qubit cases, V n . This can be visualized in Fig. 3 by mapping the accessible we chose the best of two runs as the optimal results. While this triangular plane to the black outlined plane. did not make a difference for most points, in the cases that it For points close to the edges, one can imagine that with did, the difference in energies for the two runs was usually significant noncoherent error the projected points might lie significant, indicating that noise had led the optimization into outside of the space. We account for this by reprojecting some local minima. these points into the polytope according to the closest edge.

023048-6 EFFICIENT TWO-ELECTRON ANSATZ FOR … PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

† † |q0 Y • • Y H • • H |q0 Y • H ⊕ • H

|q1 H ⊕ • • ⊕ H H ⊕ • • ⊕ H |q1 H ⊕ ⊕ Rz(θ) H • Z • H Rz(θ) ⊕ ⊕ H

|q † ⊕ • • ⊕ ⊕ • • ⊕ † 2 Y Y H H |q2 Y ⊕ • ⊕ H • ⊕ Y

|q Y † ⊕ R (θ) ⊕ Y Y † ⊕ R (θ) ⊕ Y † 3 z z |q3 Y • • H

FIG. 5. Exponential operator including two Pauli terms, here FIG. 6. Exponential operator as shown in Fig. 5, but in a simpli- representing the exponent of Y0X1Y2Y3 followed by X0X1X2Y3.For fied form. Note that the target qubit for the rotation here is not q3 but optimal connectivity (i.e., no intermediate CNOT gates for intermedi- q1. Importantly, the circuit require only eight CNOT operations and ate orbitals), there are 12 CNOT operations, generally the most error still has the same connectivity requirements. The gate H  is defined prone step. as S†HS (applied left to right).

A simple semidefinite program would also suffice, though we take a more geometric approach. For mild errors we find that terms we need to measure and the fact that every other excita- this method is satisfactory. tion in the linear sequence will be completely commuting, we can prepare one circuit with only Xi terms and another with APPENDIX C: SECOND-QUANTIZATION TREATMENT alternating X and Y pairs which give sign terms of either (C3) OF ENTANGLING GATES AND PHASE or (C5), yielding only two circuit preparations and an O(1) complexity. Note that obtaining all of the proper terms also The exponential operator in (9) has a readily recognizable scales as O(1), taking no more than eight additional circuits. form in second quantization. Utilizing creation and annihila- This method, however, did not yield significant increases in tion operators in the natural-orbital basis, the operator the accuracy in our computations, and so for our optimizations i ii † † we used the approximate circuit. Tˆ = t  aˆ aˆ  aˆ  aˆ , (C1) j jj i i j j One issue with a direct measurement of the sign is that ii while the diagonal elements we measure can be symmetry where t jj is a scalar, antisymmetric with respect to swapping lower or upper indices, can be used to construct a two-body verified, the N and Sz operators do not necessarily commute unitary operator U: with the Pauli terms (despite commuting with the operator as a whole). In addition, [Nˆ , X1X2Y3Y4] = 0. To partially address = ˆ i − ˆ i† . U exp(Tj Tj ) (C2) this, we attempted to use in-line symmetry measurements Only one exponential Pauli term is needed to excite the initial [20], where we cast the Pauli measurement onto an ancilla double excitation. After that, a simplification was performed qubit, allowed by propagating through the circuit to the corre- akin to that of Nam et al. [39]. For a system of two electrons, sponding entangling gate. This requires explicit connectivity because do not consider number or spin changing operations, requirements and attention to the layout, as a change in Pauli using the inverse Jordan-Wigner mapping, we can simplify the basis between the applied entangler and the required Pauli total number of Pauli terms needed in the exponential to 2 (see term. One issue we found was that while the sign infor- mation obtained in this manner was coherent and exhibited Figs. 5 and 6). 22 To measure the phase of the terms in Eq. (8), we are the proper behavior and change in sign with respect to t11 , interested in tomography of the 2DM elements. Using the there was a phase difference on the ancilla which resulted Jordan-Wigner transformation, we can approximate the total in the sign information being shifted from the magnitude of operator as the occupations. A direct measurement of the Pauli terms, while not allowing for symmetry verification, still contained  = † † + † †  Mij aˆi aˆi aˆ j aˆ j aˆ j aˆ j aˆi aˆi (C3) the correct qualitative information and so was utilized for 1 1 the four-qubit case. For the six-qubit case, obtaining reliable ≈ X X X  X  + X X Y Y   4 i j i j 4 i j i j (C4) information throughout the longer optimization requirements 1 1 ≈ XiXjXi Xj + YiYjXi Xj , (C5) was more difficult, and so to ease the demands on the quantum 4 4 computer, we mapped the sign of the elements to the sign where we utilize the fact that any non-number conserving of the ideal function generated by our entanglers (a simple elements will contribute 0. Due to the limited amount of sign product of sine and cosine functions).

[1] D. S. Abrams and S. Lloyd, Phys. Rev. Lett. 83, 5162 (1999). [4] S. McArdle, S. Endo, A. Aspuru-Guzik, S. Benjamin, and [2] R. Santagati, J. Wang, A. A. Gentile, S. Paesani, N. Wiebe, X. Yuan, Rev. Mod. Phys. 92, 015003 (2020). J. R. McClean, S. Morley-Short, P. J. Shadbolt, D. Bonneau, [5] I. Kassal, J. D. Whitfield, A. Perdomo-Ortiz, M.-H. Yung, and J. W. Silverstone, D. P. Tew, X. Zhou, J. L. O’Brien, and M. G. A. Aspuru-Guzik, Annu. Rev. Phys. Chem. 62, 185 (2011). Thompson, Sci. Adv. 4, eaap9646 (2018). [6] A. Kandala, A. Mezzacapo, K. Temme, M. Takita, M. Brink, [3] R. Babbush, P. J. Love, and A. Aspuru-Guzik, Sci. Rep. 4, 6603 J. M. Chow, and J. M. Gambetta, Nature (London) 549, 242 (2015). (2017).

023048-7 SCOTT E. SMART AND DAVID A. MAZZIOTTI PHYSICAL REVIEW RESEARCH 2, 023048 (2020)

[7] A. Kandala, K. Temme, A. D. Córcoles, A. Mezzacapo, J. M. [31] H. R. Grimsley, S. E. Economou, E. Barnes, and N. J. Mayhall, Chow, and J. M. Gambetta, Nature (London) 567, 491 (2019). Nat. Commun. 10, 3007 (2019). [8] N. Moll, P. Barkoutsos, L. S. Bishop, J. M. Chow, A. Cross, [32] J. Romero, R. Babbush, J. R. McClean, C. Hempel, P. J. D. J. Egger, S. Filipp, A. Fuhrer, J. M. Gambetta, M. Ganzhorn, Love, and A. Aspuru-Guzik, Quantum Sci. Technol. 4, 014008 A. Kandala, A. Mezzacapo, P. Müller, W. Riess, G. Salis, J. (2018). Smolin, I. Tavernelli, and K. Temme, Quantum Sci. Technol. 3, [33] D. A. Mazziotti, Phys.Rev.A75, 022505 (2007). 030503 (2018). [34] M. A. Nielsen and I. L. Chuang, Quantum Computation [9] M. Piris, in Reduced-Density-Matrix Mechanics: With Applica- and (Cambridge University Press, Cam- tion to ManyElectron Atoms and Molecules, edited by S.A. Rice bridge, 2010), p. 702. and D.A. Mazziotti (John Wiley & Sons, Ltd, 2007), Chap. 14, [35] M. Altunbulak and A. Klyachko, Commun. Math. Phys. 282, pp. 385–427. 287 (2008). [10] M. Piris, Phys.Rev.Lett.119, 063002 (2017). [36] D. A. Mazziotti, Phys.Rev.A94, 032516 (2016). [11] A. Coleman and V. Yukalov, Reduced Density Matrices: Coul- [37] D. A. Mazziotti, Phys.Rev.Lett.108, 263002 (2012). son’s Challenge (Springer, Berlin, 2000). [38] P. Jordan and E. Wigner, Z. Phys. 47, 631 (1928). [12] D. A. Mazziotti, J. Chem. Phys. 112, 10125 (2000). [39] Y. Nam, J.-S. Chen, N. C. Pisenti, K. Wright, C. Delaney, D. [13] D. A. Mazziotti, Chem. Phys. Lett. 338, 323 (2001). Maslov, K. R. Brown, S. Allen, J. M. Amini, J. Apisdorf et al., [14] E. Neuscamman, Phys. Rev. Lett. 109, 203001 (2012). npj Quan. Inf. 6, 340 (2020). [15] P. A. Johnson, P. W. Ayers, P. A. Limacher, S. D. Baerdemacker, [40] S. E. Smart and D. A. Mazziotti, Phys. Rev. A 100, 022517 D. V. Neck, and P. Bultinck, Comput. Theor. Chem. 1003, 101 (2019). (2013). [41] K. Boguslawski, P. Tecmer, P. W. Ayers, P. Bultinck, S. D. [16] P. Tecmer, K. Boguslawski, P. A. Johnson, P. A. Limacher, M. Baerdemacker, and D. Van Neck, Phys. Rev. B 89, 201106(R) Chan, T. Verstraelen, and P. W. Ayers, J. Phys. Chem. A 118, (2014). 9058 (2014). [42] T. Stein, T. M. Henderson, and G. E. Scuseria, J. Chem. Phys. [17] M. Walter, D. Gross, and J. Eisert, arXiv:1612.02437. 140, 214113 (2014). [18] J. R. McClean, M. E. Kimchi-Schwartz, J. Carter, and W. A. de [43] K. Head-Marsden and D. A. Mazziotti, J. Chem. Phys. 147, Jong, Phys.Rev.A95, 042308 (2017). 084101 (2017). [19] K. Temme, S. Bravyi, and J. M. Gambetta, Phys. Rev. Lett. 119, [44] B. O. Roos, P. R. Taylor, and P. E. Sigbahn, Chem. Phys. 48, 180509 (2017). 157 (1980). [20] X. Bonet-Monroig, R. Sagastizabal, M. Singh, and T. E. [45] A. W. Schlimgen, C. W. Heaps, and D. A. Mazziotti, J. Phys. O’Brien, Phys. Rev. A 98, 062339 (2018). Chem. Lett. 7, 627 (2016). [21] R. Sagastizabal, X. Bonet-Monroig, M. Singh, M. A. Rol, [46] Q. Sun, T. C. Berkelbach, N. S. Blunt, G. H. Booth, S. Guo, C. C. Bultink, X. Fu, C. H. Price, V. P. Ostroukh, N. Z.Li,J.Liu,J.McClain,E.R.Sayfutyarova,S.Sharma,S. Muthusubramanian, A. Bruno, M. Beekman, N. Haider, T. E. Wouters, and G. K.-L. Chan, WIREs Comput. Mol. Sci. 8, O’Brien, and L. DiCarlo, Phys.Rev.A100, 010302(R) (2019). e1340 (2018). [22] J. Preskill, Quantum 2, 79 (2018). [47] J. Koch, T. M. Yu, J. Gambetta, A. A. Houck, D. I. Schuster, [23] D. Wecker, M. B. Hastings, and M. Troyer, Phys. Rev. A 92, J. Majer, A. Blais, M. H. Devoret, S. M. Girvin, and R. J. 042303 (2015). Schoelkopf, Phys. Rev. A 76, 042319 (2007). [24] P.-O. Löwdin and H. Shull, Phys. Rev. 101, 1730 (1956). [48] J. M. Chow, A. D. Córcoles, J. M. Gambetta, C. Rigetti, [25] P.-O. Löwdin, Rev. Mod. Phys. 32, 328 (1960). B. R. Johnson, J. A. Smolin, J. R. Rozen, G. A. Keefe, M. B. [26] B. Zumino, J. Math. Phys. 3, 1055 (1962). Rothwell, M. B. Ketchen, and M. Steffen, Phys. Rev. Lett. 107, [27] E. Schmidt, Math. Ann. 63, 433 (1907). 080502 (2011). [28] B. C. Carlson and J. M. Keller, Phys. Rev. 121, 659 (1961). [49] G. Aleksandrowicz, T. Alexander, P. Barkoutsos, L. Bello, Y. [29] A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou, Ben-Haim, D. Bucher, F. J. Cabrera-Hernádez, J. Carballo- P. J. Love, A. Aspuru-Guzik, and J. L. O’Brien, Nat. Commun. Franquis, A. Chen, and C.-F. Chen et al., QISKIT: An open- 5, 4213 (2014). source framework for quantum computing (unpublished). [30] J. R. McClean, J. Romero, R. Babbush, and A. Aspuru-Guzik, [50] F. Gao and L. Han, Comput. Optim. Appl. 51, 259 New J. Phys. 18, 023023 (2016). (2012).

023048-8