Abstract
We present a quantum chemistry benchmark for noisy intermediatescale quantum computers that leverages the variational quantum eigensolver, activespace reduction, a reduced unitary coupled cluster ansatz, and reduced density purification as error mitigation. We demonstrate this benchmark using 4 of the available qubits on the 20qubit IBM Tokyo and 16qubit Rigetti Aspen processors via the simulation of alkali metal hydrides (NaH, KH, RbH), with accuracy of the computed ground state energy serving as the primary benchmark metric. We further parameterize this benchmark suite on the trial circuit type, the level of symmetry reduction, and error mitigation strategies. Our results demonstrate the characteristically high noise level present in nearterm superconducting hardware, but provide a relevant baseline for future improvement of the underlying hardware, and a means for comparison across nearterm hardware types. We also demonstrate how to reduce the noise in post processing with specific error mitigation techniques. Particularly, the adaptation of McWeeny purification of noisy density matrices dramatically improves accuracy of quantum computations, which, along with adjustable active space, significantly extends the range of accessible molecular systems. We demonstrate that for specific benchmark settings and a selected range of problems, the accuracy metric can reach chemical accuracy when computing over the cloud on certain quantum computers.
Introduction
Noisy intermediatescale quantum (NISQ) devices have been used recently to demonstrate a variety of different smallscale quantum computations.^{1,2,3,4,5} These demonstrations underscore the progress in developing programmable quantum processing units (QPUs) as well as advances in how to use these devices for scientifically meaningful computations. However, evaluating the impact of these demonstrations is complicated by the interplay of unique features available from different quantum computing technologies (superconducting electronics, trapped ions, etc.) and the multitude of programming choices that influence observed performance. Several properties quantify the intrinsic utility of a QPU including the capacity of the quantum register, the fidelity of the available instructions, the connectivity between register elements, etc. While these hardwarespecific parameters characterize progress in quantum hardware development, they do not directly benchmark the performance of a quantum computer for a given computational task.
Benchmarks for applicationspecific metrics are needed to evaluate the efficiency and applicability of quantum computing for scientific applications. In particular, comparing the benchmark performance of quantum computation to alternative computational approaches should rely on definitions that are meaningful across computational paradigms. Applicationspecific performance metrics have been used recently to evaluate the utility of nearterm QPUs with respect to computational accuracy, including examples from machine learning^{6} and nuclear physics.^{4} However, the design and demonstration of an applicationspecific benchmark to evaluate QPU performance across scalable problem instances has been absent from the literature up to now.
We present a quantum chemistry simulation benchmark to evaluate the performance of quantum computing by defining a series of electronic structure calculation instances that can be realized on current hardware. We outline and investigate an array of parameter choices that influence quantum computational performance. Our approach uses multiple techniques including density matrix purification and activespace reduction via frozencore approximation and truncation of the virtual space to accommodate hardware limitations such as a limited number of noisy qubits (low circuit width) and a limited achievable circuit depth (the number of parallel gate executions), while staying within the wellknown hierarchy of quantum chemistry methods. For calculations on small molecular systems, such as alkali metal hydride molecules with multiple electrons presented here, the complexity of the quantum computation can be reduced to two valence electrons and the equivalent of a hydrogen molecule in minimal basis set. These approximations can be gradually lifted as the quality of quantum devices improves to provide a flexible benchmarking model.
The quantum algorithmic primitive at the center of this benchmark is the state preparation circuit—the unitary coupled cluster (UCC) ansatz^{7} or hardwareefficient (HWE) ansatz,^{3,8,9} for example—used in the variational quantum eigensolver (VQE),^{1,10} a noiseresilient algorithm which has been implemented on current noisy QPUs. This hybrid algorithm uses a classical search for the lowest eigenvalue of a given observable using the variational principle and the chosen ansatz, which is prepared and measured on the quantum computer. The utility of this algorithm has been demonstrated in a number of fields, including highenergy and nuclear physics^{4,11} in addition to quantum chemistry.^{8} Its success is primarily due to the reliance on finite classical computing resources in tandem with invocations of the quantum computer for exponentially scaling aspects of the problem. We use multiple variations of the statepreparation primitives noted above in order to illustrates its effect on performance and accuracy of quantum computations. The benchmark assesses accuracy of VQE for recovering the ground state energy for a series of molecules when using different parameterized trial circuits and error mitigation strategies. The alkali metal hydrides currently included in the benchmark are NaH, KH, and RbH. We implemented calculations of the ground state energies of each of these molecules using four qubits on the 20qubit IBM Tokyo and 16qubit Rigetti Aspen superconducting circuit devices.
The variational quantum eigensolver (VQE) has been used previously to calculate ground state energy,^{1,12} and it has become a leading example of quantumclassical computing. Several groups have demonstrated VQE applications using a variety of QPUs and trial circuits to target small molecular systems.^{1,4,5,8,9,13,14,15} VQE recovers the ground state energy of a Hamiltonian by searching for the quantum state that minimizes the observed energy expectation value. The complexity of this classical search through the parameter space depends strongly on the form of the underlying trial circuit. Optimization of the energy expectation value uses preparation and measurement of the parameterized quantum circuit to drive the classical search method executed on a conventional computer. Existing demonstrations of VQE have revealed that despite the algorithm’s noise resilience, error mitigation is required to overcome the extensive noise present in current platforms.^{16,17,18}
For chemistry applications, the main difference between HWE and UCC choices is that the latter provides a rigorous, electron numberconserving procedure for describing a trial wavefunction, but the corresponding circuit has a relatively large depth even for small systems. The HWE ansatz offers shorter circuit depth, but it supports a larger parameter space, and it prepares states with varying numbers of electrons that yield unphysical results.
In ref. ^{8}, the number of parameters, and hence the circuit depth, is reduced for the UCC ansatz by using prescreening of cluster amplitudes. This prescreening discards all the excitation operators for which the second order MøllerPlesset perturbation amplitudes are below a chosen threshold. The number of qubits required for the VQEUCC calculation, as well as the number of parameters required for preparation of the ansatz, are also reduced by using an active space approximation which divides the orbital space into a set of inactive and active orbitals with the occupation of the orbitals in the inactive space remaining unchanged. In the present work we use a frozen core, secondquantized Hamiltonian approximation to further enable mapping of benchmark problems to noisy quantum hardware in a computational framework such as OpenFermion.^{19}
Electronic structure calculations require a choice of basis set and simulation approach, which together have an impact on resource cost and accuracy of the simulation. The hierarchy of the theoretical methods and basis sets has been established over the years. The most popular methods in order of increasing accuracy (and computational cost) are HartreeFock (HF), density functional theory (DFT), perturbation theories (PT) and configuration interaction (CI), coupled cluster methods, full configuration interaction (FCI). Neither HF nor FCI is used in any practical calculations since the former one is too inaccurate while the latter one is too expensive. Similarly, basis sets of increasing flexibility and size have been developed. The two most popular classes of basis functions are Pople basis sets (for example, 321G or 631G) and Dunning basis sets (for example ccpVDZ, ccpVTZ). The smallest available basis set, also called the minimal basis set, is denoted as STO3G (Slater Type Orbital contracted with 3 Gaussians). Although the STO3G basis set is not used in practical classical calculations, it represents a good first model for development and benchmarking of new computational methods.
Mapping the quantum chemistry problem to quantum computers involves several steps: (1) molecule specification (structure, charge etc.); (2) generation of the integrals and HartreeFock calculations to set an initial reference state; (3) transformation of the Hamiltonian from second quantization formalism to a qubit representation using either the JordanWigner^{20} or the BravyiKitaev^{21} transformation; (4) generation of a quantum circuit that represents the trial wavefunction; and (5) mapping the quantum circuit to specific quantum computing hardware.
The electronic structure calculations in the benchmark seek the ground state energy configuration of the Hamiltonian described as a sum of a nuclear repulsion (0electrons) \({H}_{0}\) term, a oneelectron term (kinetic energy of electrons plus interaction with core ions) \({H}_{1}\), and a two electron Hamiltonian \({H}_{2}\)
where \(p\), \(q\), \(r\), \(s\) run over all molecular spin orbitals, \({\hat{p}}^{\dagger }\), \(\hat{q}\) etc. are corresponding electron creation and annihilation operators, and \({h}_{q}^{p}\) are matrix elements of the core Hamiltonian (kinetic energy of electrons plus interaction with core ions). The \({g}_{sr}^{pq}\) are twoelectron repulsion integrals \({g}_{sr}^{pq}=\langle p,q s,r\rangle\). The above expression for the Hamiltonian in the chemistry notation can be equivalently written in the so called physicists notation:
with \({\overline{g}}_{sr}^{pq}\) being an antisymmetrized repulsion integral
To reduce depth and enable execution on noisy nearterm quantum computers, we neglect the contribution to electronic correlation from the lowest energy core electrons. We treat only the interaction of correlated electrons with core electrons in an average meanfield fashion. Thus we generate the following reduced effective Hamiltonian:
with \({H}_{0}^{^{\prime} }\) given by
where \(a\) and \(b\) run over frozencore spin orbitals. Similarly, the onebody term is given by
and the twobody part is
Here we note that in the last three expressions, the indices \(p\), \(q\), \(r\), \(s\) run over activespin orbitals instead of all spin orbitals. Indices \(a\) and \(b\) run over frozencore orbitals which are not active. Finally, one can exclude the specific virtual orbitals from the active space. Figure 1 illustrates partitioning of orbital space onto frozen core, active space and inactive virtual space.
In order to calculate the ground state energy of Eq. (1) using VQE, one begins by mapping the fermionic representation to an equivalent spinbased Hamiltonian
via wellknown transformations.^{21,22} Here, Pauli tensor product \({\sigma }_{\alpha }^{i}\in \{{\sigma }_{x},{\sigma }_{y},{\sigma }_{z},I\}\) acts on the ith qubit. Next, the qubit register is initialized to an unentangled reference state \(\left{\psi }_{0}\right\rangle\), followed by the application of a parameterized unitary \(U({\boldsymbol{\theta }})\) producing the state \(\left\psi ({\boldsymbol{\theta }})\right\rangle =U({\boldsymbol{\theta }})\left{\psi }_{0}\right\rangle\). Measurements dictated by the Pauli tensor product terms in Eq. (8) are then performed on this state to compute the individual Pauli term expectation values, which are then contracted with term coefficients to produce the variational energy \(\overline{E}({\boldsymbol{\theta }})=\left\langle \psi ({\boldsymbol{\theta }})\right\hat{H}\left\psi ({\boldsymbol{\theta }})\right\rangle\). The parameters \({\boldsymbol{\theta }}\) are then updated as part of a userspecified classical optimization routine and the entire process is repeated until convergence to the minimum of \(E({\boldsymbol{\theta }})\).
Results
Our benchmark performs calculations of ground state energy for three different alkali metal hydrides— NaH, KH, and RbH. For each of these molecules, we restricted the active space by freezing innercore electrons, leaving four active orbitals with two fermionic degrees of freedom. All fermionic Hamiltonians were mapped to spin Hamiltonians via the JordanWigner transformation. We then executed the benchmarks on the 20qubit IBM Tokyo and the 16qubit Rigetti Aspen QPUs.
First, we considered a reduced, single parameter UCC ansatz (labeled ucc1; see Eq. (13) and Fig. 6 in the Methods section), with readouterror correction applied, and at an interatomic distance close to the equilibrium configuration of the molecule (R = 1:914388; 2:473066; 2:319238Å for NaH, RbH, and KH, respectively). Since this is a 1parameter problem, we swept this parameter from \([\pi ,\pi ]\) and used a cubic spline interpolation to compute the optimal angle. These parameter sweeps (from the IBM QPU) are shown in Fig. 2. Each energy point is the average of 8192 shots, and error bars are smaller than the markers (on the order of 0.001). We then computed the energy at the optimal parameter twice (to accumulate statistics over 16384 shots) and performed error mitigation with an increasing number of noisy CNOT identity pairs (r = 1 is the original circuit, r = 3 has each CNOT replaced with 3 CNOTs; see Methods section). With this data, we performed both linear and quadratic extrapolation to r = 0 (the theoretical zeronoise point) to get an estimate of the energy. For this extrapolation, we used the SciPy curve_fit function to perform a nonlinear least squares fit with knowledge of the uncertainty in the data. The linear and quadratic extrapolations are provided by the inset plots for each of the plots in Fig. 2. In addition, our results are provided in Table 1.
We next considered the hardwareefficient ansatz, labeled hwe in the table, with which we classically optimized a 20parameter search space (\(d=1\), nearest neighbor entanglement) using the Constrained Optimization BY Linear Approximation (COBYLA) method with 30 iterations.^{23} We initialized the optimization using a set of angles taken from the simulated optimal set in an effort to avoid local minima. For the hwe experiments, we also considered a reduction of the Hamiltonian via application of discrete \({Z}_{2}\) symmetries that reduced the qubits needed.^{24} The results for these computations are provided in Table 1.
We found that the hwe ansatz was unable to produce results comparable to energies calculated using a classical, full configuration interaction (FCI) method. Symmetry reductions of the total Hamiltonian improved the energy accuracy, but these results still did not get below the theoretical HartreeFock energy (an uncorrelated state). The single parameter UCC ansatz performed better than the hardwareefficient ansatz, despite three additional CNOT gates in the UCC ansatz with an otherwise similar depth circuit. With readouterror correction and quadratic Richardson extrapolation, our benchmark energy metric is comparable to classical FCI results within error bars for all of the reduced fourqubit Hamiltonians considered here.
To improve the accuracy of our results, we employed a new error mitigation technique called reduced density matrix (RDM) purification (see the Methods section) while running the benchmarks on both the IBM and Rigetti quantum computers. Figure 3 shows the results of RDM purification for NaH on Tokyo (top) and Aspen (bottom) using the ucc1 ansatz. Using this error mitigation approach we observe chemical accuracy at the optimal angle on the Rigetti QPU.
We also considered a more algorithmically correct 3parameter extension to the UCC ansatz (labeled ucc3; see Fig. 7 in the Methods section) for NaH. We classically optimized the parameters via the COBYLA method as shown for IBM (top) and Rigetti QPUs (bottom) in Fig. 4. These computations employed 1000 shots on Rigetti and 8192 shots on IBM. The inset plots demonstrate the difference between purified energy points and the FCI energy, with the solid line denoting chemical accuracy (0.0016 Ha). The Rigetti results obtain chemical accuracy for this three parameter optimization. This marks a key milestone in NISQ computing, where advanced error mitigation techniques have enabled chemical accuracy over remote cloud quantum computing resources on a true variational optimization calculation.
Finally, we applied RDM purification to the computation of the NaH energy surface. We chose four interatomic distance values, R, and computed \(E(R)\) with the oneparameter UCC ansatz. We repeated this five times for each value of R to gather statistics. Figure 5 shows the results of this computation, with errors on the order of 0.01 (smaller than the markers).
Discussion
Nearterm quantum computation is limited in the total number of operations that can be performed. It is limited in the number of twoqubit entangling gates that can be present in a program before systematic noise renders the results meaningless. Classical postprocessing of the raw experimental data is a requirement to produce usable, classically comparable results. At this nascent stage of quantum computing, a useful computational benchmark that enables crossplatform comparison of various scientific use cases must take these limitations into account.
Here we have proposed and demonstrated such a benchmark—a quantum chemistry benchmark that incorporates the robust VQE algorithm, an active space reduction of the electronic structure Hamiltonian, corresponding reduced and extended unitary coupled cluster ansatzes, and various error mitigation strategies. We have demonstrated this primitive benchmark on the IBM Tokyo and Rigetti Aspen machines for alkali metal hydrides like NaH, RbH, and KH. Using the computed ground state energy as a metric, we observe results that are comparable to classical simulation results. As new quantum hardware comes online, one can immediately apply this proposed benchmark as a litmus test for the usability of the hardware for quantum chemistry. As existing hardware improves, the active orbitals space and the ansatz complexity can be increased to continue to assess hardware performance. The extensibility and existing infrastructure provided by our benchmark suite leave us flexibility in increasing benchmark complexity as hardware implementations improve. We have shown that for certain configurations, the benchmark returns chemically accurate results when our error mitigation scheme is used. If desired, this metric may be used as a pass/fail criterion to describe a QPU’s utility for this very specific task. One conclusion to draw from this benchmark is contained in the error mitigation results: improving CNOT fidelity would improve performance. Alternatively, if one were to replace CNOTs and rotations with native controlled rotations directly (while crucially still maintaining the same trial wavefunctions), it would reduce circuit depth, resulting in improved accuracy. Such actions that improve performance without changing the ansatz are within the spirit of benchmarking; as long as the same ground state energy calculations are performed using the same VQE algorithm, the benchmark serves the purpose of providing a rigorous test of current and emerging NISQ hardware.
We note that RDM purification and the subspace extension to the ansatz were both able to produce improvements over the raw circuit execution. In the case of ansatz extension, this represents a correction to algorithmic error. Whether the computer can obtain the predicted improvement from algorithmic corrections is indirectly a measurement of systematic hardware error. The RDM purification is another indirect measurement of systematics. The extent to which RDM purification improves our answer tells us about the mixed state of the quantum register. Our work provides a relative baseline for improvements in both hardware and algorithmic approaches for quantum chemistry on quantum computers. In this context, we consider whether this benchmark can indicate if a machine will demonstrate a quantum advantage in the future. Sampling a quantum state and calculating an expectation value is classically hard under certain conditions.^{25} If a quantum computer performs well at this task as the size of the algorithm scales up, then it will be able to achieve a quantum advantage. However, error mitigation as it exists today is not yet scalable. This means that the more error mitigation required to reach a good accuracy, the less scalable the algorithm is on that machine. Not surprisingly, none of the publicly available hardware is capable of a quantum advantage, but this does not preclude future iterations of the same hardware from reaching this regime.
Further, the basic form of the ansaëtze used here apply to other fields—nuclear physics effective field theory computations and in quantum field theory, for example. This means that in addition to quantum chemistry, if a quantum computer performs well on this benchmark, once can expect that it will perform well in applications that use a similar ansatz.
Finally, we note that while we ran the benchmark on two different hardware platforms, we do not take the performance difference between the two to be indicative of longterm trends or to be definitive enough to declare a “winner”. Rather, we intend for the benchmark to provide a user with information on what to expect when running a given application on a particular machine, independent of other devices.
Methods
Benchmarking approach
The VQE algorithm introduces a number of critical input generation decisions that are of interest to benchmarking efforts for quantum chemistry on NISQ hardware. Aspects of this algorithm that one may vary are the overall complexity of the spin Hamiltonian (e.g., consider symmetryreduced versions of Eq. (8)), the parameterized trial circuit \(U({\boldsymbol{\theta }})\), and the error mitigation strategy. These choices dictate the complexity of the electronic structure problem that can be solved, and the accuracy, which is used as a benchmark metric.
Our approach first seeks to reduce the complexity of the Hamiltonian in an effort to minimize the width of our quantum circuits. In addition to the frozencore approximation, we also reduce the number of qubits necessary for simulation via the application of discrete \({{\mathbb{Z}}}_{2}\) symmetries.^{24} Next, we choose a particular trial unitary class. Finally, we consider our benchmarking results as a function of various error mitigation postprocessing techniques.
Trial circuits
The choice of ansatz dictates the depth of the program executed and therefore the level of noise present in the computation. The number of parameters in the circuit determines the difficulty of the classical optimization step and the number of individual QPU calls required.
In the UCC method the wavefunction is represented using the exponentiated operator^{1,8,26}
where \(\left{\psi }_{0}\right\rangle\) is a reference state; for example, the HartreeFock solution. The symbol \(T\) (\({T}^{\dagger }\)) is a particle excitation (deexcitation) operator, given by
where \(M\) is the number of electrons and the \(\theta\) parameters map directly to the parameters found in the circuit decomposition of this unitary operator. For UCC single doubles (UCCSD) the excitation operator is truncated to single and double excitations only, \(T={T}_{1}({\boldsymbol{\theta }})+{T}_{2}({\boldsymbol{\theta }})\). In general, the UCCSD ansatz is sufficient to map the exact FCI solution for 2electron systems, such as alkali hydrides within frozencore approximation. Note that for N spinorbitals and M electrons, the number of parameters for the UCCSD circuit scales as \(O({N}^{2}{M}^{2})\),^{8} and therefore the depth for even modest sized problems grows well past what is implementable on currently available quantum computers. For a fourqubit, 2electron problem, the depth of this circuit is on the order of 100, and the number of instructions is about 150. Thus, symmetry reduction is required to implement the ansatz on current hardware.
One such reduction uses the fact that the spin terms that make up the exponential argument of Eq. (9) for a hydrogenic problem (four orbitals, two fermions) consist of eight foursite terms that all act identically on the HartreeFock state. Therefore we can approximate the state with only one term. Here, we use \({Y}_{0}{X}_{1}{X}_{2}{X}_{3}\) so that our parameterized unitary becomes
The circuit for this unitary is shown in Fig. 6. This circuit structure is a computational primitive that recurs in larger systems. This CX ladder structure is therefore a prime example of an early benchmark for quantum chemistry on quantum computers—if the quantum device cannot adequately execute this circuit, it will perform poorly on all larger fermionic systems. On the other hand, one can map larger molecules onto this hydrogenic system via a frozencore approximation, and apply this circuit primitive to produce energy metrics for a crossplatform comparison.
We note that this ansatz cannot produce FCI energy for fourqubit, 2electron problems, but it provides a UCCD solution. That is the single parameter \(\theta\) controls the contribution from doubly excited determinant: \(\psi (\theta )=\frac{1}{N}\left(\left1010\right\rangle +c(\theta )\left0101\right\rangle \right)\), where \(\left1010\right\rangle\) is a reference ground state Slater determinant, \(\left0101\right\rangle\) is a doubly excited Slater determinant and \(N\) is normalization factor. To correct for this, we append circuits that address additional twoqubit subspaces in order to expand the total accessible Hilbert space represented by the quantum register (see Fig. 7). This extended UCC ansatz introduces an additional parameter that controls a single excitation for each twoqubit spin subspace, allowing for the electronic excitations to spread to fully cover all orbitals considered active in the Hamiltonian.
For completeness, we also consider an implementation of the hardwareefficient ansatz in ref. ^{3}. The circuit is composed of alternating layers of singlequbit rotations and twoqubit entangling operations (based on the connectivity structure of the hardware). The number of parameters in this circuit grows as \(N(3d+2)\), where N is the number of qubits and d is the number of rotation+entangling layers. This ansatz is more amenable to nearterm execution than a naive implementation of the UCC ansatz due to the controlled growth in its depth. However, the increase in the number of variational parameters leads to an increase in costly QPU executions (which are remote network calls for most available NISQ devices). Furthermore, this ansatz has been shown to introduce barren plateaus—regions where the probability that the gradient in a given direction is nonzero becomes exponentially small as the number of qubits increases.^{27}
Error mitigation strategies
Executing quantum circuits on current NISQ hardware will produce results that do not compare well with classical theoretical values. This is due to a number of factors, including intrinsic systematic noise present during execution and qubit measurement readout errors. Therefore, in order to produce valid results, some form of error mitigation must be employed. We consider the type of and quantity of required error mitigation strategies as a dimension of our nearterm, quantum benchmarking approach. We note that required strategies may vary from one QPU to another, and therefore dictate which QPU may be more wellsuited for the given application or task. It is therefore important to parameterize our benchmark with respect to these strategies. In this work, we examine three such mitigation strategies: readouterror mitigation, entangling gate error rate extrapolation, and reduced density matrix purification.
We used a local, spatially uncorrelated readouterror model that requires information about the probability of an unexpected bit flip during qubit measurement. For each qubit, we compute the probability that a \(\left1\right\rangle\) was observed when a \(\left0\right\rangle\) was expected, and the probability a \(\left0\right\rangle\) was observed when a \(\left1\right\rangle\) was expected, \({p}_{i}(1 0)\), \({p}_{i}(0 1)\), respectively. Then, our readouterror corrected expectation values are computed from the experimentally observed bit string counts as
where \(p(x)\) is the probability of seeing bit string \(x\) and \({p}_{i}^{\pm }={p}_{i}(0 1)\pm {p}_{i}(1 0)\). \(i\in {\rm{sites}}(Z\ldots Z)\) represents the qubit indices represented in the given measured Pauli term.
To mitigate against systematic twoqubit entangling gate noise, we implemented the zeronoise extrapolation technique put forth in ref. ^{18}. We assume a generic twoqubit white noise error channel \({\mathcal{N}}=(1\epsilon )\rho +\epsilon I/4\). We emulate increasing \(\epsilon\) by introducing pairs of CNOT gates, serving as a noisy identity. We introduce \(r\) pairs of these entangling operations, compute the energy produced by the circuit each time, and extrapolate back to \(r=0\) to produce the noiseless energy.
Finally, we adapted a McWeeny purification scheme of nonidempotent density matrices. We implemented a mixedstate purification approach that depends on the computation of the twobody reduced density matrix (RDM).^{28} Typically, VQE seeks the expectation value of an operator that can be expressed as a sum of individual, weighted Pauli tensor products. If we instead stay in the fermionic picture, we seek the minimum of the following energy expression
where \(\left\langle \psi ({\boldsymbol{\theta }})\right{a}_{p}^{\dagger }{a}_{q}^{\dagger }{a}_{s}{a}_{r}\left\psi ({\boldsymbol{\theta }})\right\rangle\) is the twobody RDM (2RDM), \({\rho }_{pqrs}\). From the study of nrepresentability theory, an appropriate trace of the 2RDM yields the onebody RDM. Therefore the 2RDM is sufficient for computing the overall energy of the system.^{29} We can compute these 2RDM elements by constructing all physicallyrelevant \({a}_{p}^{\dagger }{a}_{q}^{\dagger }{a}_{s}{a}_{r}\) operators, mapping to the spin representation, executing the chosen parameterized ansatz, and performing measurements dictated by these transformed spin terms. This computation, when done in the presence of systematic noise, produces a statisical mixture of many pure states. Recall that the variational principle ensures that \({E}_{g}\le E({\boldsymbol{\theta }})\) for some pure state with corresponding eigenvalue \({E}_{g}\). We therefore employ a strategy for purifying these RDM elements, following the wellknown McWeeny purification formula.^{30} To improve our estimate of \({\rho }_{pqrs}\) and therefore mitigate against inherent error on the hardware, we purify the 2RDM via the iterative approach \({\rho }_{pqrs}\leftarrow 3{({\rho }_{pqrs})}^{2}2{({\rho }_{pqrs})}^{3}\) until \({\rm{Tr}}({\rho }_{pqrs}^{2}{\rho }_{pqrs})\,<\,\epsilon\), for \(\epsilon \ll 1\). Note that here tensor multiplication is defined as the trace \({C}_{pquv}={A}_{pqrs}{B}_{rsuv}\) (Einstein summation implied). We note for clarity that this procedure is only appropriate for 2 electron systems, and will not provide guidance for error mitigation with more than 2 electron simulations. In order to purify a 2RDM encountered in systems with more than 2 electrons, one must utilize the semidefinite constraints provided by Nrepresentability, as in ref. ^{29}. For our current purposes, this was beyond the need and scope of this work. In the future, we plan to extend this benchmark with error mitigation beyond 2 electron systems, which will require an extension to the purification scheme.
In order to estimate the statistical error of the purified energies, we utilitized a long established process called bootstrapping.^{31} This consists of resampling each measured circuit according to probabilites estimated from the measurement results. We used the resampled circuit outcomes to produce a 2RDM, which then was used to derive raw and purified energies. This process was repeated to create 10,000 bootstrapped pairs of raw and purified energies for each experiment, which provided an estimate of the the mean and standard deviation. As a check, we verified that the bootstrapped error estimates were almost identical to those produced by the variance estimate for non purified energies also used in this work, which indicates it is likely a good measure of the error for the purification process as well.
Software implementation
Enabling a highlevel, applicationbased benchmarking capability for nearterm quantum computation requires an extensible and modular approach that abstracts away the underlying hardware and the benchmark application domain. The goal is to provide an executable that can be quickly and easily installed and an input deck that is expressive and enables one to tailor all available benchmark parameters.
Our approach provides a hardwareindependent benchmark that can be extended to new domains for applicationcentric and algorithmic primitive benchmarking. We have extended the Eclipse XACC quantumclassical programming framework^{32} and provided a Pythonic approach for designing and executing benchmarks across the major available QPUs. Our approach extends the Python API provided by XACC with support for runtimecontributed service interfaces for the various aspects of applicationcentric and primitive benchmarking. The benchmark takes an INI file as input. This file describes the benchmark to be run, including the algorithm to use (VQE), input pertinent to the algorithm (trial circuit, optimizer, etc.), molecular integral generation routine, error mitigation strategies to implement (XACC automates the error mitigation strategies described in the previous section), and the target QPU to benchmark. A typical input file is shown in Listing 1. Providing a crossplatform benchmark capability is therefore a matter of distributing these input files for execution on currently available QPUs. Further details on the software framework are given elsewhere.^{33}
Listing 1. A typical benchmark input file for NaH molecule with STO3G basis set. Notice that indexes 0–9 in the spin orbitals lists correspond spinup orbitals whereas 10–19 correspond to spindown orbitals.
[XACC]
accelerator: ibm:ibmq_20_tokyo
algorithm: vqe
[Error Mitigation]
readouterror: True
richardsonextrapolation: True
[VQE]
optimizer: cobyla
[Ansatz]
name: ucc3
[Molecule]
basis: sto3g
geometry: ’Na 0.0 0.0 0.0
H 0.0 0.0 1.914388’
frozenspinorbitals: [0,1,2,3,4,
10,11,12,13,14]
activespinorbitals: [5,9,15,19]
Data availability
The data that support the findings of this study are available from the authors upon request.
Code availability
The code used to generate the data in this paper is available as part of the open source XACC programming environment at https://github.com/eclipse/xacc.
References
O’Malley, P. J. J. et al. Scalable quantum simulation of molecular energies. Phys. Rev. X 6, 031007 (2016).
Linke, N. M. et al. Experimental comparison of two quantum computing architectures. Proc. Natl Acad. Sci. USA 114, 3305–3310 (2017).
Kandala, A. et al. Hardwareefficient variational quantum eigensolver for small molecules and quantum magnets. Nature 549, 242–246 (2017).
Dumitrescu, E. F. et al. Cloud quantum computing of an atomic nucleus. Phys. Rev. Lett. 120, 210501 (2018).
Klco, N. & Savage, M. Digitization of scalar fields for quantum computing. Phys. Rev. A 99, 052335 (2019).
Hamilton, K. E., Dumitrescu, E. F. & Pooser, R. C. Generative model benchmarks for superconducting qubits. Phys. Rev. A 99, 052335 (2019).
Shen, Y. et al. Quantum implementation of the unitary coupled cluster for simulating molecular electronic structure. Phys. Rev. A 95, 020501 (2017).
Romero, J. et al. Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz. Quant. Sci. Technol. 4, 014008 (2018).
Ryabinkin, I. G., Yen, T.C., Genin, S. N. & Iamaylov, A. F. Qubit coupled cluster method: a systematic approach to quantum chemistry on a quantum computer. J. Chem. Theory. Comput. 14, 6317–6326 (2018).
AspuruGuzik, A., Dutol, A. D., Love, P. J. & HeadGordon, M. Simulated quantum computation of molecular energies. Science 309, 1704–1707 (2005).
Klco, N. et al. Quantumclassical computation of Schwinger model dynamics using quantum computers. Phys. Rev. A 98, 032331 (2018).
Peruzzo, A. et al. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014).
Kandala, A. et al. Extending the computational reach of a noisy superconducting quantum processor. arXiv eprints arXiv:1805.04492 (2018).
Hempel, C. et al. Quantum chemistry calculations on a trappedion quantum simulator. Phys. Rev. X 8, 031022 (2018).
Shen, Y. et al. Quantum implementation of the unitary coupled cluster for simulating molecular electronic structure. Phys. Rev. A 95, 020501 (2017).
Temme, K., Bravyi, S. & Gambetta, J. M. Error mitigation for shortdepth quantum circuits. Phys. Rev. Lett. 119, 180509 (2017).
BonetMonroig, X., Sagastizabal, R., Singh, M. & O’Brien, T. E. Lowcost error mitigation by symmetry verification. Phys. Rev. A 98, 062339 (2018).
Li, Y. & Benjamin, S. C. Efficient variational quantum simulator incorporating active error minimization. Phys. Rev. X 7, 021050 (2017).
McClean, J. R. et al. OpenFermion: the electronic structure package for quantum computers. arXiv eprints arXiv:1710.07629 (2017).
Jordan, P. & Wigner, E. Über das Paulische Äquivalenzverbot. Zeitschrift für Physik 47, 631–651 (1928).
Bravyi, S. B. & Kitaev, A. Y. Fermionic quantum computation. Annal. Phys. 298, 210–226 (2002).
Seeley, J. T., Richard, M. J. & Love, P. J. The bravyikitaev transformation for quantum computation of electronic structure. J. Chem. Phys. 137, 224109 (2012).
Powell, M. J. D. Direct search algorithms for optimization calculations. Acta Numerica 7, 287 (1998).
Bravyi, S., Gambetta, J.M., Mezzacapo, A. & Temme, K. Tapering off qubits to simulate fermionic Hamiltonians. arXiv eprints arXiv:1701.08213 (2017).
Boixo, S. et al. Characterizing quantum supremacy in nearterm devices. Nat. Phys. 14, 595 (2018).
Taube, A. G. & Bartlett, R. J. New perspectives on unitary coupledcluster theory. Int. J. Quantum Chem. 106, 3393–3401 (2006).
McClean, J. R., Boixo, S., Smelyanskiy, V. N., Babbush, R. & Neven, H. Barren plateaus in quantum neural network training landscapes. Nat. Commun. 9, 4812 (2018).
Morris, T. Improved optimization for effective field theory simulations with a ucc ansatz (in preparation).
Rubin, N. C., Babbush, R. & McClean, J. Application of fermionic marginal constraints to hybrid quantum algorithms. New J. Phys. 20, 053020 (2018).
Truflandier, L. A., Dianzinga, R. M. & Bowler, D. R. Communication: generalized canonical purification for density matrix minimization. J. Chem. Phys. 144, 091102 (2016).
Efron, B. Bootstrap methods: another look at the jackknife. Annal. Statistics 7, 1 (1979).
McCaskey, A. et al. A language and hardware independent approach to quantumclassical computing. SoftwareX 7, 245–254 (2018).
McCaskey, A. & Parks, Z. A dynamic serviceoriented platform for benchmarking quantum computers (In preparation).
Acknowledgements
This manuscript has been authored by UTBattelle, LLC under Contract No. DEAC0500OR22725 with the U.S. Department of Energy. The authors acknowledge fruitful discussions with E. Dumitrescu. R.C.P. acknowledges helpful discussions with R.S. Bennink. The authors acknowledge DOE ASCR funding under the Quantum Computing Testbed Pathfinder program, FWP number ERKJ332. Z.P. was supported in part by an appointment to the Oak Ridge National Laboratory HERE Program, sponsored by the U.S. Department of Energy and administered by the Oak Ridge Institute for Science and Education. This research used quantum computing system resources supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research program office.
Author information
Authors and Affiliations
Contributions
R.C.P. conceived of the project, supervised the research, and interpreted results. A.J.M. and Z.P. conducted the experiments by developing the benchmarking software, programming the quantum computers, and taking data. S.V.M. contributed to design of the experiments and interpreted results. J.J. contributed quantum chemistry Hamiltonians and developed custom ansatz for optimization. T.D.M. implemented reduced density matrix purification and bootstrapping. T.S.H. interpreted results. All authors participated in writing the paper.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
McCaskey, A.J., Parks, Z.P., Jakowski, J. et al. Quantum chemistry as a benchmark for nearterm quantum computers. npj Quantum Inf 5, 99 (2019). https://doi.org/10.1038/s4153401902090
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s4153401902090
Further reading

VQE method: a short survey and recent developments
Materials Theory (2022)

Quantum embedding theories to simulate condensed systems on quantum computers
Nature Computational Science (2022)

Chemistry beyond the Hartree–Fock energy via quantum computed moments
Scientific Reports (2022)

Stabilizing multiple topological fermions on a quantum computer
npj Quantum Information (2022)

Variational quantum eigensolver techniques for simulating carbon monoxide oxidation
Communications Physics (2022)