Ground-state energy estimation of the water molecule on a trapped-ion quantum computer

Quantum computing leverages the quantum resources of superposition and entanglement to efficiently solve computational problems considered intractable for classical computers. Examples include calculating molecular and nuclear structure, simulating strongly interacting electron systems, and modeling aspects of material function. While substantial theoretical advances have been made in mapping these problems to quantum algorithms, there remains a large gap between the resource requirements for solving such problems and the capabilities of currently available quantum hardware. Bridging this gap will require a co-design approach, where the expression of algorithms is developed in conjunction with the hardware itself to optimize execution. Here we describe an extensible co-design framework for solving chemistry problems on a trapped-ion quantum computer and apply it to estimating the ground-state energy of the water molecule using the variational quantum eigensolver (VQE) method. The controllability of the trapped-ion quantum computer enables robust energy estimates using the prepared VQE ansatz states. The systematic and statistical errors are comparable to the chemical accuracy, which is the target threshold necessary for predicting the rates of chemical reaction dynamics, without resorting to any error mitigation techniques based on Richardson extrapolation.


INTRODUCTION
Quantum computation has attracted much attention for its potential to solve certain computational problems that are difficult to tackle with classical computers. For example, integer factorization 1 , unsorted database search 2 , and the simulation of quantum systems 3 admit quantum algorithms that outperform the bestknown classical algorithms given a sufficiently large problem size. However, these algorithms require substantial quantum resources to achieve a practical advantage over classical techniques, limiting their near-term utility on noisy intermediate-scale quantum (NISQ) devices 4 that are severely limited in the number of gates they can perform before errors dominate the output. Any useful quantum computation on a NISQ device will require further advances in hardware performance, as well as advances in algorithmic design.
Quantum chemistry is a promising application where quantum computing might overcome the limitations of known classical algorithms, hampered by an exponential scaling of computational resource requirements. One of the most challenging tasks in quantum chemistry is to determine molecular energies to within chemical accuracy, defined to be the target accuracy necessary to estimate chemical reaction rates at room temperature and generally taken to be %4 kJ/mol = 1:6 10 À3 Hartree (Ha) 5 . Achieving chemical accuracy would allow computational methods to replace costly experimental procedures in chemical and materials engineering, augmenting these fields to accelerate the pace of discovery.
Early quantum computational techniques to simulate manybody Fermi systems 6 or calculate molecular energies 7 have dramatically improved over the past decade [8][9][10] , but the resource requirements for useful chemical simulations still remain out of reach 11 . Hybrid approaches might relax these requirements, where a short quantum computation serves as a subroutine to calculate classically difficult quantities. The variational quantum eigensolver (VQE) method is one example, which estimates the ground state of a system by positing an ansatz state defined by a set of variational parameters and minimizing its energy. The quantum subroutine determines the energy for a particular set of ansatz parameters, and a classical optimization algorithm iteratively updates the ansatz to reduce the energy until it converges. Early demonstrations of the VQE method have been performed on different quantum architectures [12][13][14][15] , some of which relied on native interactions to create an ansatz state. Generalizing the hardware-efficient method into a systematic framework applicable to large systems may prove problematic. Furthermore, systematic errors in the experimental results compared to the exact, ideal circuit execution have at times far exceeded the order magnitude of chemical accuracy.
Here we provide a highly optimized, systematic VQE approach that has a potential to scale to much larger molecular systems and use it to minimize the quantum resources required to estimate the ground-state energy of the water molecule (H 2 O). We embrace codesign principles to fully optimize the quantum circuits for a trapped-ion quantum computer (QC) and experimentally compute the first three correction terms beyond the mean-field (Hartree-Fock (HF)) approximation. We achieve computational errors approaching 1:6 mHa (equivalent to the bound of chemical accuracy), without using any error mitigation techniques. These results establish a path for future computations on more complex 1 systems as trapped-ion QCs continue to improve, eventually reaching beyond the capability of classical methods.
Readers are strongly encouraged to read "Methods" section before "Results" section. In "Methods" section, we describe the details of the QC hardware used to simulate the water molecule and the specifics of the molecular models used to generate the quantum simulation circuits. We heavily use the notations defined in "Methods" section throughout "Results" section.

Circuit optimization and co-design
We have implemented a number of circuit optimization techniques that take advantage of the unique features available in the IonQ trapped-ion QC but are generic in the sense that they are applicable to any target molecule to be simulated. The strategies described here are executed by a full-stack, modularized software toolchain, which automatically produces optimized circuits 16 for generating the ansatz state of a molecular system. Given a general unitary coupled-cluster (UCC) ansatz state, interaction terms take the form of a two-electron interaction θ pqrs c y p c y q c r c s . Since the indices p; q; r; s vary over the complete set of molecular states (which are represented by different qubits), implementing this interaction requires entangling gates between arbitrary pairs of qubits in the system. The all-to-all connectivity of trapped-ion QCs makes this a native operation, eliminating the overhead incurred by repeated SWAP gates to reorder qubits before an entangling operation can be applied between nearestneighbor qubits. Given that the infidelity of these SWAP operations can dominate the quality of complicated computations, eliminating them from the optimized circuit dramatically increases the accuracy of the VQE result. This circuit optimization is a direct result of co-design for a particular hardware advantage.
Another general optimization strategy is to represent the bosonic excitations, where two electrons remain paired, as a creation or annihilation operator on a single qubit. It is convenient to expand the spin orbital (SO) label for the operator c p to c kα , where k and α denote the molecular orbital (MO) and spin label, respectively. Then the bosonic operators are d y k ¼ c y kα c y kβ and d j ¼ c jα c jβ (α ≠ β), which can be directly translated to the Pauli raising/ lowering operators σ j ± on qubit j. The UCC operator corresponding to the bosonic excitation simplifies to exp½θ jk σ j þ σ k À À h:c:, and a pair of arbitrary-angle XX(θ) gates is sufficient to implement this interaction (see Fig. 1c). Thus ansatz states containing only bosonic excitations can be implemented very efficiently on our QC.
For all remaining terms, we must implement the two-electron interaction via the Jordan-Wigner (JW) transformation. Each of these terms looks likeV ¼ exp½θ pqrs σ p þ σ q þ σ r À σ s À k σ k z À h:c:, where the product k σ k z denotes the adequate JW string to reflect fermionic symmetries. A JW string with mσ z gates converts to m controlled NOT (CNOT) gates on either side of the subcircuit that would otherwise implementV. Properly ordering these terms in the entire circuit can eliminate most of the CNOT gates, so they represent a relatively low overhead as a function of terms in the UCC ansatz 8 . The main portion of the quantum circuit is an implementation of a linear combination of eight terms, each containing a product of four σ x and σ y operators (with odd number of σ x in each term). By optimizing the order of these eight operators and taking advantage of the all-to-all connectivity, we can implement this circuit with 13 CNOT gates (see Fig. 1d). When we concatenate several of these terms, some CNOT gates at the ends, including those that arise from a JW string, may cancel out.
Most ansatz states have both bosonic and non-bosonic excitation terms. For these situations, we start with the reduced representation where each qubit describes one MO and run the quantum circuit that corresponds to all bosonic excitation terms first. Then additional qubits (all prepared in the 0 j i state) are introduced, and each is entangled with a qubit representing an MO using a CNOT gate. Each entangled pair can now represent the two SOs corresponding to the MO (Supplementary Information (SI) Fig. S2e).
One last optimization takes advantage of the asymmetric state preparation and measurement (SPAM) error observed in our system. Normally, we encode a filled orbital (MO or SO) with 1 j i and an empty orbital with 0 j i, but in a molecule with mostly closed molecular shells like H 2 O, the filled orbitals in the HF ground state remain mostly filled in the full configurationinteraction (FCI) ground state as well. Since our SPAM error is more than a factor of two smaller for 0 j i compared to 1 j i, we encode the filled orbitals as 0 j i to reduce the systematic shift associated with readout from the 1 j i state. This encoding has the ancillary benefit of requiring fewer single-qubit gates to initialize the circuit, but the advantage diminishes as measurement errors are suppressed or become more symmetric.
Combining these strategies, we achieve the quantum circuits for preparing the ansatz state with total entangling gate counts shown in Fig. 1b. The methodology reported in this section and the resulting circuit efficiency is due to the culmination of different circuit optimization strategies applied in a carefully chosen sequence to maximize the opportunities to reduce a large number of quantum gates in an automated fashion. These methods represent a fully general, near-optimal framework that can be extended to generate UCC ansatz states for any physical system.
Experimental example Using our trapped-ion QC, we compute the first three bosonic excitation terms of the VQE ansatz for the H 2 O molecule (see SI Fig. S2). In order to ultimately estimate the minimum energy for each circuit within chemical accuracy (fractional uncertainty of 10 −5 ), all systematic errors in our QC must be carefully characterized and controlled. The intrinsic decoherence of a 171 Yb þ trapped-ion qubit is negligible over the timescale of our computation 17 , so the dominant errors arise in calibrating the angle of the XX(θ) gate and correcting for the systematic SPAM error of our ion chain. We accurately calibrate the angle θ using a circuit similar to that shown in Fig. 1c, where the parity varies as sin(2θ). Fitting the parity to this functional form (Fig. 2a) compensates for non-linearities in the acousto-optic modulator (AOM) and enables easy interpolation for arbitrary gate angles. Uncertainty in the SPAM correction can be made arbitrarily small given sufficient measurement statistics. Gate fidelity will begin to dominate as the computation length increases, but for the circuits experimentally demonstrated here we are not limited by this error and found no benefit to error mitigation techniques like Richardson extrapolation 18 .
To compute the energy corresponding to a prepared ansatz state, we make a set of projective measurements in bases corresponding to the terms in the Hamiltonian, as previously described. We use a statistical bootstrapping technique 19 that accounts for SPAM error to estimate uncertainties from the resulting histograms (Fig. 2b). Figures 2c, d show the experimentally determined energy surface for HF+1 and HF+2 as the ansatz parameters fθ i g are scanned about their optimum values, and the data for HF+3 (evaluated at a single point) is shown in SI Fig. S3.
The optimum values of the ansatz parameters were obtained from the in silico simulations of the VQE, detailed in "Methods" section and references to appropriate SI sections therein. The experimentally determined ground-state energies for each of these three ansatz states is À74:977ð1Þ, À74:979ð2Þ, and À74:985ð5Þ Ha, respectively, with parenthetical errors indicating 1σ uncertainty derived from the bootstrapped distribution. The dominant experimental uncertainty arises in the SPAM correction, which can be improved with upgrades to the hardware and new tomographic methods 20,21 . A direct comparison to the in silico VQE simulation can be found in Fig. 2e. The match to theory is very good-both the precision and absolute accuracy (relative to the ansatz circuit) are comparable to the chemical accuracy. Achieving low computational error in experimental implementations of quantum chemistry circuits is necessary for VQE-type optimization algorithms to provide useful results.

DISCUSSION
Dramatic improvements must be made to both QC hardware and techniques to efficiently use the available quantum resources in order to perform meaningful quantum computations on a NISQ device. The work presented here is a framework for end-to-end optimization that maps useful problems in quantum chemistry to a trapped-ion QC, fully leveraging the hardware-specific advantages. This framework yields near-optimal quantum circuits for a UCC-based approach, and we compute the post-HF ground-state energy of H 2 O on a trapped-ion QC to verify the performance of both the hardware and the optimization procedure. Without any error mitigation, the experimental results for the first three correction terms are in excellent agreement with the theoretical predictions. This demonstrates the degree of controllability offered by trapped-ion QCs, which we expect to improve with additional engineering efforts. Our UCC-based, systematic framework can thus serve as a litmus test for the quantum simulation capabilities and limitations of existing and future NISQ hardware.
While these results are specific to a particular quantum chemistry problem and the trapped-ion QC hardware, the computational methodology we develop is completely general to simulating quantum systems. We anticipate that similar advances can be applied to other optimization problems that work on variational methods, such as the quantum approximate optimization algorithm 22 and various quantum machine learning applications 23,24 . Increased attention to co-design principles like those demonstrated here will be necessary to push the boundary of possibility in near-term quantum computation.

Trapped-ion QC
The trapped-ion system used in this study is a scalable, general-purpose programmable QC constructed at IonQ, Inc. (https://ionq.com (accessed 29 Oct 2018)) and illustrated schematically in Fig. 3a; see Supplementary Information for additional experimental details. The computer consists of a linear chain of 171 Yb þ ions on a surface trap operating at room temperature, where the qubit is implemented between the 0 ihyperfine levels of the 2 S 1=2 ground state of each ion, split by 12.6 GHz 17 .
The qubit register is initialized to the 0 j i state using optical pumping and measured at the end of the computation by state-dependent fluorescence on the dipole-allowed cycling transition between 1 j i and the 2 P 1=2 excited state 20 . Scattered photons from the ions during detection are collected through a high numerical aperture lens (NA % 0:6) and passed through a dichroic mirror to an array of photon detectors for simultaneous readout of the entire qubit register. SPAM errors are routinely characterized during computation, with typical data for a three-ion chain shown in Fig. 3b. Our system exhibits a small asymmetry in the SPAM error for 0 j i versus 1 j i (0.6% and 1.3%, respectively), which is well understood from an atomic model of the detection process 25 . We observe no evidence of measurement crosstalk where the state of one qubit affects the readout of neighboring qubits, which allows SPAM correction to be performed with low overhead. SPAM errors can be readily improved by increasing the collection efficiency of the detection optics 20,25,26 .
Quantum gates are implemented via two-photon Raman transitions driven by two laser beams from a mode-locked pulsed laser at 355 nm, where the two laser beams generate a beat note close to the qubit frequency 27 . One of the beams is a "global" beam, with a wide profile that uniformly illuminates all qubits in the chain. The other is an array of tightly focused beams, generated from a diffractive optical element and a multichannel AOM, that address the ions individually. By controlling the phase, frequency, and amplitude of these beams, we can manipulate individual qubits to implement arbitrary quantum logic gates 28 . The AOM in our system has 32 independent channels, allowing us to scale the number of individually addressable and fully connected qubits to this number. Further scaling is possible with alternative optical set-ups or by sacrificing full connectivity and using ion-shuttling protocols 29 .
We drive high-fidelity single-qubit operations with a resonant Raman transition between 0 j i and 1 j i using a composite pulse sequence 30,31 . Twoqubit operations are mediated by the shared motional modes of the entire chain via an effective XX-Ising interaction using the Mølmer-Sørensen protocol 32,33 and can be written in terms of Pauli X matrices on ions i and j as XX Since the motional modes involve every ion in the chain, we can apply the XX gate between arbitrary pairs of ions with comparable speed and fidelity 28,[34][35][36] . This native all-to-all connectivity of two-qubit gates in the trapped-ion QC provides complete flexibility to choose qubit mappings and gate configurations that maximize circuit performance on the hardware. Under typical operating conditions for this QC, the single-qubit gate fidelity can be maintained \99:9%, and the state fidelity of a maximally entangling XX(π=2) gate is \96%. We estimate the fidelity of small-angle XX gates by concatenating XX(π=2n) gates n times to approximate a full XX(π=2) gate. The state fidelity F is measured, and we estimate the per-gate error to be ϵtð1 À FÞ=n. We show an example in Fig. 3c for n ¼ 50, and calculate ϵ t 4 10 À3 for the XX(π=100) gate. In general, small-angle XX gates have higher fidelities in a trapped-ion QC than maximally entangling XX gates. Therefore, if quantum circuits admit using small-angle XX-gates in place of a collection of maximally entangling gates, they may be used to improve the quality of a quantum computation.

Molecular modeling
We choose H 2 O as a testbed for quantum co-design principles. The structure of H 2 O is sufficiently complex to develop and test universal techniques for scalable quantum circuit synthesis, while simple enough to be accessible by currently available trapped-ion QCs. Simulations using classical hardware provide fully verified solutions to assess the performance of the quantum hardware and build intuition about successful codesign strategies. What follows is a brief summary of the VQE co-design methodology, with further details supplied in Supplementary Information.
We first write down a Hamiltonian under the Born-Oppenheimer approximation, where the atomic nuclei are fixed to their known equilibrium geometry. The Hamiltonian is represented in the second-a Fig. 3 Apparatus and performance. a Schematic representation of the trapped-ion QC. The qubit register is implemented in a linear chain of 171 Yb þ ions residing inside an ultra-high vacuum chamber (not shown), and high-NA imaging optics enable individual addressing and readout of the ion qubits. The Raman beams (shown in red and purple) are generated from a pulsed laser at 355 nm and drive a two-photon transition between 0 j i and 1 j i. Full control of the amplitude, frequency, and phase of the individual addressing beams enables implementations of arbitrary single-and two-qubit operators. b SPAM characterization on a three-ion chain. From top to bottom, we show the SPAM error of each three-qubit state, the per-qubit SPAM error for 0 j i and 1 j i, and a bar plot of the full SPAM matrix where the color is log-scaled for visibility. We see no indication of measurement crosstalk between qubits. c Characterization of the small-angle XX(θ) gate performance. The state fidelity after 50 consecutive small-angle XX gates is % 78%, and we estimate the per-gate error to be ϵt 4 10 À3 .
where c y p (c p ) are the creation (annihilation) operators for a molecular SO p. The SOs are spin-labeled MOs obtained as a linear combination of atomic orbitals from the minimal STO-3G chemical basis 37 using the HF method 38 . The resulting 7 MOs (14 SOs) are shown schematically in Fig. 1a, and the terms h pq and h pqrs from Eq. (1) are computed classically using a standard open-source tool based on ab initio methods 39 . The c p and c y p operators can be represented as Pauli operators acting on individual qubits using the JW transformation 40 , and we use the UCC method to generate an ansatz state [41][42][43] with the first-order Trotter formula and one Trotter step. The expectation value of the Hamiltonian is computed by measuring projections of the prepared ansatz state in the combination of Pauli bases that correspond to each term in the JW-transformed Hamiltonian. To achieve meaningful accuracy, the circuit must be sufficiently sampled in each basis to reduce statistical errors 14 , and systematic errors must be controlled.
For a small molecule like H 2 O in the minimal basis set, it is possible to diagonalize the Hamiltonian in Eq. (1) to compute the FCI ground-state energy (À75:0116 Ha); see SI Section S2i for larger systems where FCI calculations may not necessarily be available. This energy is lower than the mean-field HF result (À74:9624 Ha) by~49.2 mHa. From the FCI diagonalization, we generate a list of two-electron interaction terms (c y p c y q c r c s ) that contribute to modifications in the energy during the diagonalization process, with the degree of contribution characterized by the determinant. Some of these terms correspond to a pair of spin-up and spin-down electrons from the same filled MO being simultaneously excited to an empty MO (called the bosonic excitation terms hereafter), and the rest correspond to excitations of two electrons that are not paired in this way (see examples in Fig. 1a). Each term can be included in the preparation of the UCC ansatz in the form of exp½θ pqrs c y p c y q c r c s À c:c: in the Trotter product formula, where θ pqrs becomes the optimization parameter, h:c: denotes the Hermitian conjugate operator, and p, q and r, s respectively denote unoccupied and occupied orbitals. We perform a numerical simulation of the VQE process as more terms are added to the UCC ansatz and estimate the lowest energy for each ansatz state as the parameters are optimized (see SI Section S2j for detail). This in silico result serves as a reference to benchmark the computational outcome from the QC. Figure 1b shows the quantum resource requirements for each UCC ansatz circuit optimized for the trapped-ion QC. Relevant resource metrics include the number of qubits and the number of entangling gates. We also tabulate the ground-state energy from our in silico VQE simulation, as up to 21 terms are added to the ansatz beyond the HF calculations (see SI Fig. S1). We see that the estimate of the ground-state energy approaches the FCI value as more terms are added, reaching the FCI value within chemical accuracy once ≥17 terms are included in the ansatz. Inspecting the 21 most significant determinants in the FCI energy calculation, we observe that (1) the innermost MO 1a 1 is always filled and therefore can be ignored for the purpose of excitation, and (2) the 1b 2 MO participates only once as a bosonic excitation. Ignoring 1a 1 and 1b 2 in the ansatz state preparation can reduce the qubit requirement without sacrificing much in absolute accuracy: the reduced Hamiltonian reaches within 2.1 mHa of the FCI ground state at HF+16 terms using 10 qubits and 140 entangling gates. Chemical accuracy for the full Hamiltonian is achieved at HF+17 terms with 11 qubits and 143 entangling gates, of which 89 are CNOT gates and 54 are small-angle XX(θ) gates that feature higher fidelity. These resource requirements are realistically within the near-term performance targets of an NISQ computer based on trapped ions.