Introduction

Noisy intermediate scale quantum (NISQ) computers have recently become workhorse platforms for the study of codesign and the design of near-term quantum algorithms1. Thus far, the variational quantum eigensolver has proved to be one of the most useful applications for these devices. Variational methods have been used to solve problems in chemistry, nuclear physics, quantum field theory, high-energy physics, and others2,3,4,5,6,7,8. While these small-scale applications show promise for using NISQ devices to sample from distributions and calculate expectation values, short coherence times make calculations involving time evolution exceedingly difficult on NISQ devices. Time evolution calculations hold promise for calculating scattering amplitudes9 and, excited10,11, and non-equilibrium states12. One approach to the problem of short coherence times is quantum imaginary time evolution (QITE)13, in which non-unitary evolution can be calculated variationally. Combining QITE with the Lanczos optimization method (referred to as QLanczos in the context of quantum computing), one can obtain time-evolved phenomena of various many-body systems1.

Here, we demonstrate the practical application of QITE and QLanczos on current cloud-based NISQ hardware in order to calculate ground and excited states in different fields of study. We use the method to obtain the ground state of the deuteron nucleus in one instance, and we calculate both the ground and excited states of the H2 molecule in another. The quantum computations were done on several cloud-accessible IBM Q Experience devices, i.e. 20-qubit Johannesburg, 20-qubit Poughkeepsie, 53-qubit Rochester, and 5-qubit Yorktown hardware. The results obtained from the quantum computations were compared with the classical calculations obtained from exact diagonalization. Despite the fact that we used a simplified version of the deuteron Hamiltonian, we were able to obtain the ground state energy of deuteron without the need for any non-linear optimization or ancillae. We also obtained the energy spectrum of H2 molecule very close and even within chemical accuracy (1.6 × 10−3 Hartree). These demonstrations show great promise for scaling up time evolution as a solution method on near-term quantum hardware, and they illustrate that the approaches have practical, near-term applicability to an array of fields from high energy physics to chemistry.

Quantum imaginary time evolution addresses the problem of exponentially increasing resource requirements for computation as a function of the number of interacting particles. It replaces the real time in the time-dependent Schrödinger equation with imaginary time (t → −). The solution to this equation involves an imaginary-time evolution operator, \({\mathcal{U}}={\mathrm e}^{-\beta H}\). This operator leads to the decay of all states except for the ground state provided that the initial state has non-zero overlap with the ground state, \(\left|\Omega \right\rangle\), (i.e., 〈Ψ(0)∣Ω〉 ≠ 0). Therefore, the normalized imaginary-time evolution of a state can be expressed as

$$\left|\Psi (\beta )\right\rangle =\frac{{\mathrm e}^{-\beta H}\left|\Psi (0)\right\rangle }{| | {\mathrm e}^{-\beta H}\left|\Psi (0)\right\rangle | | }\,,$$
(1)

where β is the imaginary time14, \(\left|\Psi (0)\right\rangle\) is the initial state, and \(| | \cdot | | \equiv \sqrt{\langle \cdot | \cdot \rangle }\) is the state norm.

Quantum computation of the ground state energy of many-body systems using the imaginary-time evolution can be thought of as a natural alternative as quantum computers provide exponential speed ups. The basic idea behind QITE13 is to approximate the non-unitary imaginary-time evolution in small steps with unitary updates on a set of qubits, including data qubits and ancilla qubits. The non-unitary evolution is provided by variationally changing the parameters of the Ansatz circuit, which allows us to approximate imaginary time evolution and calculate the decay to the ground state via (1). However, the algorithm of Motta et al.1 eliminates ancillae as a requirement by using a special type of Ansatz, eiA[sτ, considerably simplifying the algorithm. On a quantum computer, the unitary evolution utilizes Trotterization. Current quantum computers are incapable of simulating long time evolution, or a large number of Trotter steps, due to short coherence times and excessive gate noise that further reduces coherence time. However, since QITE seeks to approximate non-unitary evolution with a unitary operator, we can reduce the number of Trotter steps by calculating a specific unitary that corresponds to the largest possible steps in imaginary time that yield a given desired accuracy. This amounts to solving a linear system of equations that provide coefficients of expansion, in terms of Pauli operators, for the unitary evolution operators. In the case of the deuteron, we found that solving this system of equations for the largest timesteps provided a unitary evolution operator that corresponded to the familiar unitary coupled cluster (UCC) Ansatz15.

While this was a large simplification of the QITE algorithm, a key advantage over variational methods is the ability to use the method in a QLanczos algorithm to calculate excited states. The basic idea behind the QLanczos algorithm is to fill the Krylov space with vectors in powers of e−2ΔτH, which is done using QITE, and then these vectors are used to calculate Hamiltonian matrix elements, which leads to a generalized eigenvalue equation, yielding a computation of ground and excited states. Using the single-step method in QITE, we reduced the depth of the quantum circuit, which makes these algorithms more compatible with NISQ16 devices. This method also economizes QITE calculations that might be useful beyond the NISQ regime.

Results

Here, we present the experimental results from IBM Q hardware for QITE and QLanczos algorithms. Information on the experiments and the hardware used can be found in Table 5 of the “Methods” section.

QITE results

Using the QITE algorithm we were able to calculate the ground state energy of deuteron for both N = 2 and N = 3 cases. Figure 1 depicts the convergence to the ground state energy for N = 2 and N = 3 deuteron Hamiltonian.

Fig. 1: Energy expectation values of deuteron as a function of imaginary time.
figure 1

a The hardware simulations for N = 2 with \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\) were run on IBM Q 20-qubit Johannesburg on qubit layouts \(\left[{q}_{0},{q}_{1}\right]=[0,1]\) (points β = 0, 0.05, 0.20, 0.30) and \(\left[{q}_{0},{q}_{1}\right]=[0,5]\) (points β = 0.10, 0.15, 0.25). b The hardware simulations for N = 3 with \(\left|{\Psi }_{0}\right\rangle =\left|100\right\rangle\) were run on IBM Q 20-qubit Johannesburg. The error bars represent ±σ (σ = standard deviation).

Data in Figs 1 and 2 were obtained after 10 runs each with 8192 shot on IBM Q Johannesburg hardware. Figure 2 shows the application of the Richardson extrapolation for N = 3 case at β = 0.30. In this figure, the expectation value of the ground state energy and the operators are plotted as a function of the number of CNOT gates corresponding to each CNOT gate in the original quantum circuit. As a result of our QITE computation the ground state energy for N = 2 (N = 3) case is calculated as E2 = −1.762 ± 0.2 (E3 = −2.033 ± 0.1) MeV which is off by 0.76% (0.64%) from its value obtained from exact diagonalization, i.e., E2,exact = −1.749 MeV (E3,exact = −2.046 MeV). To produce our energy estimates in Fig. 1a we sampled several collections of qubits on the chip and used results containing the least hardware noise from each set. For example, at points β = 0.10, 0.15, and 0.25 we used the data obtained from qubit layout [q0, q1] = [0, 5], where qi denotes qubit i on quantum hardware. The data obtained from qubit layout [q0, q1] = [0, 1] had greater standard deviation. Since each data set was obtained with the same number of samples, we attribute the extra noise in layout [0, 1] to quantum hardware errors. The comparison of the data collected for these two-qubit layouts can be found in Table 4 (see “Methods” section). Readout error mitigation (ROEM) suffices for β = 0 data points in both N = 2 and N = 3 cases, since they do not involve any CNOT gates. To obtain the energy measurements in Fig. 1a, only ROEM was conducted, except for β = 0.30, where both ROEM and extrapolation were used. Each experimental point in Fig. 1b is the result of post-processing with ROEM and Richardson extrapolation.

Fig. 2: Richardson extrapolation of the expectation values of the Pauli operators (on the right axis) and Hamiltonian operator (on the left axis) from their plots as a function of the CNOT gates corresponding to each CNOT gate.
figure 2

The quantum circuit used is in Fig. 5b (see “Methods” section) for N = 3 qubit Hamiltonian at β = 0.30. This simulation was run on IBM Q 20-qubit Johannesburg hardware using the qubit layout \(\left[{q}_{0},{q}_{1},{q}_{2}\right]=\left[8,7,9\right]\). The error bars represent ±σ.

Although in ref. 1 the QITE algorithm is used for calculating the ground-state energy of a system, we were able to calculate the ground- as well as excited-state energies by changing the initial state. A choice that is orthogonal to the ground state leads to the first-excited state. If, additionally, the initial state is chosen to be orthogonal to the (known) first-excited state, then the algorithm leads to the second excited state, etc.17,18. Orthogonality can often be ensured by the symmetry properties of the system Hamiltonian.

In our case, the molecular Hydrogen Hamiltonian (7) is invariant under exchange of the two qubits, owing to the symmetry of the molecule under interchange of the two nuclei (protons). Let X be the swap operator for the two qubits. Since \({X}^{2}={\Bbb{I}}\), its eigenvalues are ±1. The ground state has eigenvalue +1, whereas the first excited state has eigenvalue −1. To produce the ground state using QITE, we used the symmetric initial state \(\left|{\Psi }_{0}\right\rangle =\left|00\right\rangle\). We obtained the ground state \(\left|{\phi }_{0}\right\rangle =-0.993\left|00\right\rangle +0.115\left|11\right\rangle\). For the first excited state, there is a unique choice that has eigenvalue X = −1, namely the state \(\left|{\phi }_{1}\right\rangle =\frac{1}{\sqrt{2}}\left|10\right\rangle -\left|01\right\rangle\). In our quantum computations, for the first excited state we used the initial state \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\) which is orthogonal to the ground state \(\left|{\phi }_{0}\right\rangle\), and confirmed the result from the symmetry argument. Higher-level states were derived using the QLanczos algorithm with input provided by QITE.

In Fig. 3a we plotted the ground- and first-excited-state energies as functions of bond length, R, that we obtained by implementing QITE on quantum hardware, and compared with the values obtained from exact diagonalization. Because of the availability of devices, we used two separate processors for calculation of the ground-state (on IBM Q 5 Yorktown) and first-excited-state (on IBM Q Poughkeepsie) energies. In the case of chemical systems we would like to calculate energy values within chemical accuracy which is 1.6 × 10−3 Hartree. Here, the terminology “chemical accuracy” refers to the difference between the exact results and our heuristic calculations. Therefore, in the inset of Fig. 3a we show the relative error in energy (ΔE(R)) as a function of bond length compared with chemical accuracy. QITE was able to obtain chemical accuracy for one or two steps depending on the trial state.

Fig. 3: Energy expectation values of two-qubit molecular Hydrogen as a function of bond length, R.
figure 3

We compared the values from exact diagonalization with the values obtained from hardware. The inset shows the relative errors of the quantum computed energy values compared to chemical accuracy. a The ground state energy (GSE) calculations (with \(\left|{\Psi }_{0}\right\rangle =\left|00\right\rangle\)) were done on IBM Q 5 Yorktown and the first excited state energy (1st ESE) calculations (with \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\)) were done on IBM Q Poughkeepsie hardware using the QITE algorithm. ROEM and Richardson extrapolation were applied. b The GSE and third excited-state energy (3rd ESE) calculations (with \(\left|{\Psi }_{0}\right\rangle =\left|00\right\rangle\)) were done on IBM Q Rochester and the first and second excited-state energy (2nd ESE) calculations (with \(\left|{\Psi }_{0}\right\rangle =\left|01\right\rangle\)) were done on IBM Q Poughkeepsie hardware using the QLanczos algorithm. The values with and without ROEM are presented. The error bars represent ±σ.

As explained above, it is a challenge to access the whole energy spectrum of the system using the QITE algorithm. The calculation of excited-state energies using a variational imaginary-time algorithm was first studied in ref. 19 where all energy levels could be calculated by first targeting the ground state with imaginary time evolution and then successive excited states could be reached by penalizing the ground state and other lower-level states with the use of the shallow swap test. In this work, to access higher-level states, we used the QITE algorithm as a subroutine that provided sufficient input to the QLanczos algorithm to produce the entire spectrum of the system Hamiltonian, as discussed below. Unlike the method in ref. 19, our QITE/QLanczos implementation does not make use of ancilla qubits and has no need of an additional variational optimization step.

QLanczos results

QLanczos algorithm can also be used for quantum computation of both the ground- and excited-state energies. The choice of the initial state, \(\left|{\Psi }_{0}\right\rangle\), is the one that determines which energies are being calculated. Here, we present our quantum computation of the ground (for deuteron and molecular Hydrogen) and excited-state energies (for molecular Hydrogen only—note that the deuteron does not have a bound excited state) using QLanczos.

Quantum computation of the ground- and excited-state energies using QLanczos might require stabilization of the algorithm as the generalized eigenvalue equation (see Eq. (22) in “Methods” section) might be numerically ill-conditioned. In our particular deuteron problem, due to the linear dependence of the vectors, \(\left|{\Phi }_{l}\right\rangle\), in Krylov subspace, we had to perform the stabilization process explained in the Supplementary Information of ref. 1.

We ran QLanczos on two different devices: IBM Q 20-qubit Poughkeepsie (for N = 2 deuteron and first and second excited-state energies of molecular Hydrogen) and IBM Q 53-qubit Rochester (for N = 3 deuteron and ground and third excited-state energies molecular Hydrogen). The statistical error is calculated for Nruns = 5 for deuteron and Nruns = 3 for molecular Hydrogen, each run having 8192 shots. Results of our quantum computation of the ground state energies for N = 2 and N = 3 deuteron Hamiltonian are summarized in Table 1.

Table 1 N = 2 and N = 3 ground state energies (in MeV) calculated using the QLanczos algorithm.

In Table 1 and Fig. 3b we present the results for QLanczos with and without readout error mitigation (indicated as ROEM) for the deuteron and molecular Hydrogen, repsectively. The results obtained using (24) (given in “Methods” section) are in good agreement with the values obtained from exact diagonalization, while energies obtained from the stabilized generalized eigenvalue equation do not agree well with the exact values due to stability issues in the case of molecular Hydrogen. Choosing a smaller regularization parameter would make these values closer to the exact values with a cost of adding more vectors to the Krylov subspace. In our example, a Krylov subspace with two vectors out of \(\{\left|{\Phi }_{0}\right\rangle ,\left|{\Phi }_{2}\right\rangle ,\left|{\Phi }_{4}\right\rangle \}\) subspace were sufficient to obtain the ground- and excited-state energies for the deuteron and molecular Hydrogen examples. For molecular Hydrogen, we used two different initial states (\(\left|{\Psi }_{0}\right\rangle =\left|00\right\rangle\) and \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\)) which helped us to calculate the energy spectrum as a function of the bond length, R.

We found that using (24) gives very close values to exact diagonalization with or without ROEM, meaning that QLanczos is potentially noise resilient. Combined with fast convergence the algorithm has a few advantages that make it useful for quantum computation of the ground and excited-state energies of many-body systems. Since our QLanczos results are in good agreement with the exact values from diagonalization, we did not perform Richardson extrapolation. This would require three more measurements at every QITE step to build the Krylov space.

Although the computational limits of the quantum computers require us to truncate the harmonic oscillator (HO) basis, different schemes were proposed for extrapolating the bound state energies to infinite basis. We will follow the scheme that is based on the Lüscher’s formula20 that was used in ref. 5. The extrapolation of the bound state energy values to the infinite basis is listed in Table 2. For more information on the extrapolation of the ground state energy to the infinite HO basis please see the “Methods” section.

Table 2 Lüscher’s extrapolation of the deuteron bound state energies (in MeV) to the infinite basis.

Discussion

In this study, we presented a practical alternative for calculation of the ground- and excited-state energies of the many-body systems by using single-step version of the QITE and QLanczos algorithms presented in ref. 1 using deuteron and molecular Hydrogen as specific examples. This approach may be a good low-depth circuit alternative to other contemporary methods. Depending on the parameters of the system, the convergence to the ground state or excited states may require too many steps for a small Δτ value. In this case, one may limit the algorithm to two-step, three-step, etc., processes which will still reduce the circuit depth but provide better imaginary-time evolution. As the system size increases, the required computational resources increase. In this case, the inexact QITE proposed in ref. 1 can be used. Although we were able to reduce the circuit depth for less error in hardware by employing a single-step process, the QITE algorithm still requires measurement and calculation of the next unitary operator at every time step.

We also demonstrated how QITE can be used to calculate the excited-state energy whose eigenvector is non-orthogonal to the initial state \(\left|{\Psi }_{0}\right\rangle\). We also presented examples of the applications of ROEM and Richardson extrapolation with these algorithms. On the other hand, QLanczos gave results that are good agreement with the exact diagonalization calculations; therefore, it did not require additional error mitigation procedures.

We obtained the bound state energy of the deuteron at the next-to-leading order with a 0.5% (0.9%) error for N = 2 (N = 3) using QITE and with a 2.2% (1.6%) error for N = 2 (N = 3) case using QLanczos, compared to its experimental value of −2.22 MeV. We also showed the ground- and excited-state energies of the two-qubit molecular Hydrogen can be calculated within chemical accuracy using the QLanczos algorithm for a few bond lengths.

In future work, we will extend our implementation of the QITE/QLanczos algorithm to study the scattering problem for heavier nuclei and molecules as well as the Ising model.

Methods

The model

We will apply QITE and QLanczos algorithms into two nontrivial systems, i.e., deuteron and Hydrogen molecule, respectively.

For deuteron system, we follow the refs 5,21, in which the pion-less effective field theory (EFT) is implemented through a discrete variable representation in the HO basis based on refs 22,23. Then the pion-less EFT Hamiltonian of the deuteron in the discrete variable representation using the HO basis can be expressed as

$${H}_{N}=\mathop{\sum }\limits_{n,n^{\prime} = 0}^{N-1}\left\langle n^{\prime} \right|(T+V)\left|n\right\rangle {a}_{n^{\prime} }^{\dagger }{a}_{n}\,,$$
(2)

where N is the maximum number of oscillator quanta included in the HO basis and an and \({a}_{n}^{\dagger }\) are, respectively, the annihilation and creation operators for n = 0, 1, …, N − 1 and they obey fermionic anti-commutation relations

$$\begin{array}{ll}&\{{a}_{n},{a}_{n^{\prime} }\}=\{{a}_{n}^{\dagger },{a}_{n^{\prime} }^{\dagger }\}=0,\\ &\{{a}_{n},{a}_{n^{\prime} }^{\dagger }\}={a}_{n}{a}_{n^{\prime} }^{\dagger }+{a}_{n^{\prime} }^{\dagger }{a}_{n}={\delta }_{n,n^{\prime} }\,.\end{array}$$
(3)

The kinetic and potential energy terms in this Hamiltonian can be written as

$$\begin{array}{l}\left\langle n^{\prime} \right|T\left|n\right\rangle =\frac{\hslash \omega }{2}\left[(2n+3/2){\delta }_{n}^{n^{\prime} }-\sqrt{n(n+1/2)}{\delta }_{n}^{n^{\prime} +1}\right.\\ \left.-\sqrt{(n+1)(n+3/2)}{\delta }_{n}^{n^{\prime} -1}\right]\,,\\ \left\langle n^{\prime} \right|V\left|n\right\rangle ={V}_{0}{\delta }_{n}^{0}{\delta }_{n}^{n^{\prime} }\,.\end{array}$$
(4)

We choose the HO energy spacing as ħω ≈ 7 MeV, the potential coefficient as V0 ≈ −5.686 MeV and the ultraviolet cutoff for the potential as Λ ≈ 152 MeV .

The simulation of the physical systems on quantum computers is made possible by mapping the creation and annihilation operators onto Pauli matrices. This process is done using the Jordan–Wigner transformation24 and for N = 2 and 3 we obtain

$$\begin{array}{l}{H}_{2}=5.907I+0.2183{Z}_{0} -6.125{Z}_{1}-2.143({X}_{0}{X}_{1}+{Y}_{0}{Y}_{1})\\ {H}_{3}={H}_{2}+9.625(I-{Z}_{2})-3.913({X}_{1}{X}_{2}+{Y}_{1}{Y}_{2}),\end{array}$$
(5)

with the Pauli matrices defined as

$${\sigma }_{j}=I\otimes \cdots \otimes \sigma \otimes \cdots \otimes I,$$
(6)

where σ ∈ {X, Y, Z} is in the jth position with j = 0, …, N − 1, ⊗ indicates tensor product and I is the identity matrix.

We will use the two-qubit molecular Hydrogen Hamiltonian2

$$\begin{array}{l}H(R)={h}_{0}(R)I+{h}_{1}(R){Z}_{0}+{h}_{2}(R){Z}_{1}+{h}_{3}(R){Z}_{0}{Z}_{1}\\ \quad\quad\quad+\,{h}_{4}(R){X}_{0}{X}_{1}+{h}_{5}(R){Y}_{0}{Y}_{1}\,,\end{array}$$
(7)

where coefficients hi(R) for i ∈ {0, 1, …, 5} are real-valued functions of the bond length, R, of the molecule. We have h1 = h2, so that the Hamiltonian is invariant under interchange of the two qubits (interchange of labels: 0 ↔ 1), which is due to the symmetry of the Hydrogen molecule. For calculation of the binding and excited state energies of the Hydrogen molecule we will use the coefficients calculated in STO-3G basis given in Table I of Supplementary Information of ref. 7.

Algorithms

Here, we present a brief review of the QITE and QLanczos algorithms that were proposed in ref. 1.

To be able to simulate the dynamics of many-body systems we need to break down the Hamiltonian of these systems into local components such that \(H=\mathop{\sum }\nolimits_{m}^{M}{h}_{m}\) where hm are non-commuting local terms of the system25. For many-body systems, the number of terms in the Hamiltonian scales polynomially with the number of particles in the system. For example, the N = 2 deuteron Hamiltonian in (5) can be decomposed into

$$\begin{array}{ll}&{h}_{1}=5.906709I+0.218291{Z}_{0}-6.125{Z}_{1}\,,\\ &{h}_{2}=-2.143304({X}_{0}{X}_{1}+{Y}_{0}{Y}_{1})\,.\end{array}$$
(8)

Because of the non-commuting terms in the Hamiltonian the decomposition of the evolution into small time steps and decomposing these steps into local gates can be done using the first order Lie–Trotter–Suzuki decomposition formula26 which gives

$${\mathcal{U}}={\left(\mathop{\prod }\limits_{m = 1}^{M}{\mathrm e}^{-\Delta \tau {h}_{m}}\right)}^{n}+{\mathcal{O}}(\Delta \tau ),$$
(9)

where \(n=\frac{\beta }{\Delta \tau }\) is the number of steps in the evolution.

For two non-commuting operators the matrix exponential can be written as

$${\mathrm e}^{-A\Delta \tau }{\mathrm e}^{-B\Delta \tau }={\mathrm e}^{-\left(A+B\right)\Delta \tau -\frac{1}{2}\left[A,B\right]{(\Delta \tau )}^{2}+\ldots }\,,$$
(10)

following the Baker–Campbell–Hausdorff lemma.

This formula is given for two operators only, but it can be generalized to n operators. In our calculations assuming that Δτ is small we can approximate the imaginary-time evolution up to an order of \({\mathcal{O}}(\Delta \tau )\) as follows:

$$\left|\Psi (\beta )\right\rangle \approx {c}_{n}{({\mathrm e}^{-({h}_{1}+{h}_{2}+\cdots +{h}_{M})\Delta \tau })}^{n}\left|\Psi (0)\right\rangle,$$
(11)

where

$${c}_{n}=\frac{1}{\sqrt{\left\langle \Psi (0)\right|{({\mathrm e}^{-({h}_{1}+{h}_{2}+\cdots +{h}_{M})\Delta \tau })}^{2n}\left|\Psi (0)\right\rangle }}$$
(12)

is the normalization constant.

The sth step of the imaginary-time evolution can be written as

$$\left|{\Psi }_{s}\right\rangle ={c}_{s}{\mathrm e}^{-({h}_{1}+{h}_{2}+\cdots +{h}_{M})\Delta \tau }\left|{\Psi }_{s-1}\right\rangle,$$
(13)

where s = 1, 2, …, n. The purpose of the QITE algorithm is to approximate (13) with unitary updates such that

$$\left|{\Psi }_{s}\right\rangle \approx {\mathrm e}^{-i\Delta \tau {A}_{s}}\left|{\Psi }_{s-1}\right\rangle.$$
(14)

where As can be written in terms of Pauli operators (defined in (6)) up to D + 1 qubits and can be expressed as

$${A}_{s}={\sum \limits_{{i}_{0}{i}_{1}\ldots {i}_{D}}}a{[s]}_{{i}_{0}{i}_{1}\ldots {i}_{D}}{\sigma }_{{i}_{0}}{\sigma }_{{i}_{1}}\ldots {\sigma }_{{i}_{D}}.$$
(15)

For our two (three)-qubit systems we used D = 1 (D = 2). To be able to approximate the imaginary-time evolution with these unitary updates we need to calculate the coefficients a[s]. For small Δτ, up to an order of \({\mathcal{O}}(\Delta \tau )\), the coefficients are found by solving a linear system of equations \({\mathcal{S}}a[s]={\bf{b}}\) at every step of the imaginary-time evolution, where

$${{\mathcal{S}}}_{{\mathcal{I}},{\mathcal{I}}^{\prime} }[s]=\left\langle {\Psi }_{s}\right|{\sigma }_{{i}_{0}}^{\dagger }{\sigma }_{{i}_{1}}^{\dagger }\ldots {\sigma }_{{i}_{D}}^{\dagger }{\sigma }_{{i}_{0}^{\prime}}{\sigma }_{{i}_{1}^{\prime}}\ldots {\sigma }_{{i}_{D}^{\prime}}\left|{\Psi }_{s}\right\rangle,$$
(16)
$${b}_{{\mathcal{I}}}[s]=-i{c}_{s}^{-1/2}\left\langle {\Psi }_{s}\right|{\sigma }_{{i}_{0}}^{\dagger }{\sigma }_{{i}_{1}}^{\dagger }\ldots {\sigma }_{{i}_{D}}^{\dagger }{h}_{m}\left|{\Psi }_{s}\right\rangle$$
(17)

with \({\mathcal{I}}={i}_{0},{i}_{1},\ldots ,{i}_{D}\). The solution to this equation minimizes the operator norm \(| | {c}_{s}^{-1/2}\left|{\Psi }_{s}\right\rangle -(1-i\Delta \tau {A}_{s})\left|{\Psi }_{s-1}\right\rangle | |\). More detailed discussion on the calculation of the coefficients a[m] can be found in the Supplementary Information of ref. 1.

The calculation of the unitary updates for our deuteron and molecular Hydrogen examples gave us interesting results. For N = 2 case the unitary updates have the form of \({A}_{s}=a[s]\left({X}_{0}{Y}_{1}-{X}_{1}{Y}_{0}\right)\) and N = 3 the unitary updates have the form of As = a1[s](X0Y1 − X1Y0) + a2[s](X0Z1Y2 − X2Z1Y0) which are in the same form as UCC (unitary coupled cluster) Ansätze that were proposed for molecular Hydrogen in ref. 2 and for deuteron in ref. 5. This means that the unitary updates recover the UCC Ansatz.

Using QITE it is possible to obtain the excited state energies since the system does not necessarily converge to the ground state, but rather depends on the initial state, \(\left|{\Psi }_{0}\right\rangle\), choice. In general, the system converges to the eigenvalue of the Hamiltonian whose eigenvector is non-orthogonal to the initial state, \(\left|{\Psi }_{0}\right\rangle\).

The QLanczos algorithm is based on the QITE algorithm, but provides the advantage of faster convergence, and it can be used to calculate excited state energies. The basic idea behind the QLanczos algorithm is to fill in the Krylov subspace with vectors in powers of e−2ΔτH at each Lanczos iteration such that \({\mathcal{K}}:\{\left|\Phi \right\rangle ,{\mathrm e}^{-2\Delta \tau H}\left|\Phi \right\rangle ,{\mathrm e}^{-4\Delta \tau H}\left|\Phi \right\rangle ,\ldots \ \}\). The vectors in the Krylov subspace are obtained using the QITE algorithm as

$$\left|{\Phi }_{l}\right\rangle ={c}_{l}{\mathrm e}^{-l\Delta \tau H}\left|{\Psi }_{t}\right\rangle$$
(18)

for \(0\le l \, < \, {L}_{\max }\) assuming l is an even number. Here, \(\left|{\Psi }_{t}\right\rangle ={c}_{t}\left(\mathop{\prod }\nolimits_{s = 1}^{t}{\mathrm e}^{-i\Delta \tau {A}_{s}}\right)\left|{\Psi }_{0}\right\rangle =\left|{\Phi }_{0}\right\rangle\) is the initial QLanczos state which is obtained from QITE subroutine. After building the Krylov subspace we need to calculate the overlap matrix elements \(({{\mathcal{T}}}_{l,l^{\prime} })\) and Hamiltonian matrix elements \(({{\mathcal{H}}}_{l,l^{\prime} })\) in terms of the expectation values since they are the only experimentally accessible values. The calculations give overlap and Hamiltonian matrix elements as

$${{\mathcal{T}}}_{l,l^{\prime} }=\langle {\Phi }_{l}| {\Phi }_{l^{\prime} }\rangle =\frac{{c}_{l}{c}_{l^{\prime} }}{{c}_{r}^{2}}\,,$$
(19)
$${{\mathcal{H}}}_{l,l^{\prime} }=\left\langle {\Phi }_{l}\right|H\left|{\Phi }_{l^{\prime} }\right\rangle ={{\mathcal{T}}}_{l,l^{\prime} }\left\langle {\Phi }_{r}\right|H\left|{\Phi }_{r}\right\rangle \,,$$
(20)

where \(r=\frac{l\,+\,l^{\prime} }{2}\). The normalization constants can be recursively calculated in terms of expectation values using

$$\frac{1}{{c}_{r+1}^{2}}=\frac{\left\langle {\Phi }_{r}\right|{\mathrm e}^{-2\Delta \tau H}\left|{\Phi }_{r}\right\rangle }{{c}_{r}^{2}}\,.$$
(21)

The next step of the QLanczos algorithm is to utilize the calculated overlap and Hamiltonian matrix elements and solve the generalized eigenvalue equation

$${\mathcal{H}}x=E{\mathcal{T}}x\,.$$
(22)

The ground and excited states can then be found from the eigenvectors of the generalized eigenvalue equation. For example, the normalized ground (g) (excited (e)) state approximation is

$$\left|{\Phi }_{\text{g (e)}}\right\rangle =\frac{\mathop{\sum }\nolimits_{l = 0,2,\ldots }^{{L}_{\max }}{{x}_{l}}_{\text{g(e)}}\left|{\Phi }_{l}\right\rangle }{| | \mathop{\sum }\nolimits_{l = 0,2,\ldots }^{{L}_{\max }}{{x}_{l}}_{\text{g(e)}}\left|{\Phi }_{l}\right\rangle | | }\,,$$
(23)

where the coefficients \({x}_{{l}_{\text{g(e)}}}\) are obtained from the eigenvector that corresponds to the ground (excited) state energy such that \({({{x}_{0}}_{\text{g(e)}}{{x}_{2}}_{\text{g(e)}}\ldots {{x}_{L}}_{\text{max}\text{g(e)}})}^{\mathrm T}\). Then the energy expectation values are calculated from

$${E}_{\text{g (e)}}=\left\langle {\Phi }_{\text{g (e)}}\right|H\left|{\Phi }_{\text{g (e)}}\right\rangle,$$
(24)

which then leads to calculation of the ground and excited state energies using QLanczos algorithm. In the exact calculations the energy values obtained from the eigenvalues of the generalized eigenvalue equation (22) match with the values obtained from (24). Our quantum computation shows that using (24) is numerically more stable and gives much better results than using the eigenvalues of (22) as seen in Table 1.

The QLanczos method converges much faster than the QITE algorithm but one needs to do measurements at each imaginary-time projection of the Krylov subspace vectors to obtain the corresponding overlap and Hamiltonian matrix elements from the expectation values. The more vectors in the Krylov subspace the more QITE measurements with an increasing quantum circuit depth are required. At this point, the single-step method we proposed that is explained in next section plays an important role in terms of reducing the circuit depth and possible noise that will arise due to the gates in the circuit.

Quantum program

As mentioned earlier, the imaginary-time evolution in QITE algorithm is provided by unitary updates of the form \({{\mathcal{U}}}_{s}={\mathrm e}^{-i\Delta \tau a[s]\left({X}_{0}{Y}_{1}-{X}_{1}{Y}_{0}\right)}\) for our two-qubit examples. One way to obtain the ground state energy using QITE is to start with an initial product state, say \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\) and apply the unitary updates while calculating the coefficients a[s] that give the state \(\left|{\Psi }_{s}\right\rangle\) at every step of the imaginary-time evolution. At the end of the nth step of the imaginary-time evolution one expects to reach the ground state energy. This version of QITE would require a quantum circuit as seen in Fig. 4, which only shows the first two steps of the imaginary-time evolution; the depth of the quantum circuit increases as the number of steps increases. At every step of the imaginary-time evolution, the quantum circuit in the shaded area is repeated such that θs = 2Δτa[s]. Naturally, large depth circuits are very noisy, and not necessarily amenable to error mitigation techniques.

Fig. 4: Two-qubit QITE quantum circuit with initial state \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\).
figure 4

The quantum circuit in the box is repeated at each QITE step after the second step of the algorithm for convergence.

To reduce the circuit depth we reduce the number of time steps. In the single-step version, instead of building the quantum circuit that combines each unitary update which gives \(\left|{\Psi }_{s}\right\rangle \approx {\mathrm e}^{-i\Delta \tau A[s]}\left|{\Psi }_{s-1}\right\rangle\) we build the quantum circuit based on the calculated coefficient \(A^{\prime}\) that gives \(\left|{\Psi }_{s}\right\rangle \approx {\mathrm e}^{-i\Delta \tau sA^{\prime} }\left|{\Psi }_{0}\right\rangle\). In this case, the quantum circuit is given in Fig. 5a which only includes one CNOT gate for a specific initial state of \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\). The rotation angle is now defined as \({\theta }_{s^{\prime} }=2s\Delta \tau a^{\prime} [s]\) such that \(\beta ^{\prime} =s\Delta \tau\) is the imaginary-time corresponding to a specific expectation value, and at β = nΔτ the energy converges to the ground (or excited) state energy. We run the same quantum circuit with different calculated \(a^{\prime} [s]\) coefficients until the energy expectation value converges to the ground (or excited) state energy.

Fig. 5: Two- and three-qubit single-step QITE quantum circuit.
figure 5

The initial state is a \(\left|{\Psi }_{0}\right\rangle =\left|10\right\rangle\) and b \(\left|{\Psi }_{0}\right\rangle =\left|100\right\rangle\), respectively. The angle parameters are calculated for the same circuit until the convergence is reached.

Applying the same strategy to our three-qubit deuteron example with an initial state of \(\left|{\Psi }_{0}\right\rangle =\left|100\right\rangle\) gives the unitary updates of the form

$${{\mathcal{U}}}_{s^{\prime} }\approx {\mathrm e}^{-i\Delta \tau s{a^{\prime}_{1}} [s]({X}_{0}{Y}_{1}\, - \, {X}_{1}{Y}_{0})}{\mathrm e}^{-i\Delta \tau s{a^{\prime}_{2}} [s]({X}_{0}{Z}_{1}{Y}_{2}\, - \, {X}_{2}{Z}_{1}{Y}_{0})}\,.$$
(25)

with \({\theta }_{s^{\prime} }=2s\Delta \tau a^{\prime} [s]\) for i = 1, 2 which can be approximated with the quantum circuit in Fig. 5b.

In addition to our single-step QITE approach we also applied the error mitigation strategies to improve results. In our quantum computations, we applied these error mitigation strategies to obtain the energy expectation values.

Error mitigation

The noise due to the nature of the quantum simulators requires the application of the error mitigation strategies. Although there are various error mitigation strategies proposed in the literature, for our purposes, we used ROEM and Richardson extrapolation techniques to reduce the noise involved in our calculations.

Out of the different sources of errors in a quantum circuit the readout errors are the errors associated with the final measurements in the quantum circuit. Therefore, we start by mitigating these errors in our quantum computation. To this end, we use the ROEM scheme proposed in ref. 27. In that scheme, the expectation values of the operators in the Hamiltonian are calculated using the following formula:

$$\begin{array}{l}\langle {\sigma }_{i}\ldots {\sigma }_{j}\rangle=\mathop {\sum}\limits_{x\in \text{possible outcomes}}p(x) \times \frac{{(-1)}^{{x}_{i}}\,-\,{p}_{i}^{-}}{{1}\,-\,{p}_{i}^{+}} \times \cdots \times \frac{{(-1)}^{{x}_{j}}\,-\,{p}_{j}^{-}}{{1}\,-\,{p}_{j}^{+}}\,,\end{array}$$
(26)

where p(x) is the probability of each qubit outcome and it takes 2N values. For example, for N = 2, x ∈ {00, 01, 10, 11}. The symmetric and anti-symmetric combinations of the probability of ith qubit flipping from 0 to 1 (pi(0∣1)) or from 1 to 0 (pi(1∣0)) is defined as

$${p}_{i}^{\pm }={p}_{i}(0| 1)\pm {p}_{i}(1| 0)\,.$$
(27)

Although pi(0∣1) and pi(1∣0) values are provided by IBM’s Qiskit library, to get the most up-to-date values we obtained the readout error probabilities by preparing each qubit in computational basis 0 and 1 and then performing a measurement on each qubit in each case which gives us

$$p(1| 0)=\frac{\#\,\,{\mathrm{of}}\, {\mathrm{states}}\,{\mathrm{prepared}}\, {\mathrm{in}}\,\ \left|1\right\rangle \,{\mathrm{measured}}\, {\mathrm{in}}\, \left|0\right\rangle }{\#\,{\mathrm{of}}\, {\mathrm{shots}}}$$
(28)

or vice versa for p(0∣1). We ran the simulations using 8192 number of shots. To propagate the error due to the statistical error in the readout errors for N = 2 deuteron case we did the readout error measurements 10 times and propagated the statistical error in measurements and statistical error in readout measurements in our results. As a result of our experimental measurements the statistical error in measurements is not different than the statistical error in readout error measurements therefore, we calculated the statistical error only for our N = 3 deuteron and molecular Hydrogen calculations.

Although we were able to reduce the depth of the quantum circuit using the single-step method, the decoherence effects became apparent in the expectation value measurements. Therefore, in addition to the ROEM we also used the Richardson extrapolation15,28 technique for the short-depth quantum circuits29 to mitigate the errors associated with the noise produced by the gates used in the quantum circuit. The basic idea in this technique is to increase the error rate deliberately by a constant factor of r which is followed by an extrapolation to obtain the noise free expectation value. In this particular study, we increase the error rate by adding pairs of CNOT gates. The process of adding CNOT pairs is not expected to change the result of measurements since it corresponds to an identity matrix but it will contribute to the noise produced by CNOT gates. Our results showed that for two-qubit systems the expectation values of the observables scale linearly as

$$\langle {\mathcal{O}}(r)\rangle =Ar+\langle {\mathcal{O}}(0)\rangle$$
(29)

and for N = 3 deuteron system they scale quadratically as

$$\langle {\mathcal{O}}(r)\rangle =A{r}^{2}+Br+\langle {\mathcal{O}}(0)\rangle,$$
(30)

where the coefficients A, B, and the extrapolated noiseless expectation value \(\langle {\mathcal{O}}(0)\rangle\) are found from the linear and quadratic fit to the data points of the expectation values of the operators for each case. We did not apply Richardson extrapolation technique to the QLanczos measurements since the results obtained using the QLanczos algorithm were in good agreement with the exact diagonalization results.

Extrapolation to the infinite HO basis

The finite-size corrections to the infinite size HO basis based on the Lüscher’s method can be stated as

$${E}_{N}-{E}_{\infty }={\mathcal{A}}{\mathrm e}^{-2{k}_{\infty }L}+{\mathcal{B}}{k}_{\infty }L{\mathrm e}^{-4{k}_{\infty }L}+{\mathcal{C}}{\mathrm e}^{-4{k}_{\infty }L}\,,$$
(31)

where

$$\begin{array}{ll}&{\mathcal{A}}=\frac{{\hslash }^{2}{k}_{\infty }{\gamma }^{2}}{m}\,,\,\,\,{\mathcal{B}}=\frac{2{\hslash }^{2}{\gamma }^{4}}{m}\,,\\ &{\mathcal{C}}=\frac{{\hslash }^{2}{k}_{\infty }{\gamma }^{2}}{\mu }\left(1-\frac{{\gamma }^{2}}{{k}_{\infty }}-\frac{{\gamma }^{4}}{4{k}_{\infty }^{2}}+2{w}_{2}{k}_{\infty }{\gamma }^{4}\right)\,.\end{array}$$
(32)

The values and definitions of the variables in (31) are given in Table 3. The terms in right-hand side of (31) refer to leading order (LO), next-to-leading order (NLO), and N2LO, respectively. Curve fitting the LO and NLO terms gives the binding momentum, k and the asymptotic normalization coefficient, γ, for each order by using E1 and E2. Fitting to N2LO term adding E3 data helps calculating an effective range parameter, w2.

Table 3 The values and definitions of the variables in (31).

Information on experimental runs on IBM Q hardware

In Table 4 exact and ROEM energy expectation values are given for the β = 0.10, 0.15, 0.25 points in Fig. 1a for qubit layouts [q0, q1] = [0, 1] and [q0, q1] = [0, 5] on IBM Q Johannesburg hardware.

Table 4 The exact and ROEM energy expectation values calculated using qubit layouts [q0, q1] = [0, 1] and [q0, q1] = [0, 5] on IBM Q Johannesburg hardware are compared.

Table 5 demonstrates the hardware used, the number of runs, and the number of shots in each run to obtain each figure and table in this study.

Table 5 Information about the experimental runs on hardware.