Mitigating algorithmic errors in Hamiltonian simulation

Quantum computers can efficiently simulate many-body systems. As a widely used Hamiltonian simulation tool, the Trotter-Suzuki scheme splits the evolution into the number of Trotter steps $N$ and approximates the evolution of each step by a product of exponentials of each individual term of the total Hamiltonian. The algorithmic error due to the approximation can be reduced by increasing $N$, which however requires a longer circuit and hence inevitably introduces more physical errors. In this work, we first study such a trade-off and numerically find the optimal number of Trotter steps $N_{\textrm{opt}}$ given a physical error model in a near-term quantum hardware. Practically, physical errors can be suppressed using recently proposed error mitigation methods. We then extend physical error mitigation methods to suppress the algorithmic error in Hamiltonian simulation. By exploiting the simulation results with different numbers of Trotter steps $N\le N_{\textrm{opt}}$, we can infer the exact simulation result within a higher accuracy and hence mitigate algorithmic errors. We numerically test our scheme with a five qubit system and show significant improvements in the simulation accuracy by applying both physical and algorithmic error mitigations.


I. INTRODUCTION
It is hard to simulate quantum systems using a classical computers, as the computational cost increases exponentially with the system size.Such a problem can be resolved by quantum simulation, as proposed by Feynman in 1982 [1], saying "let the computer itself be built of quantum mechanical elements which obey quantum mechanical laws".Quantum simulation of many-body systems has become one of the most promising applications of quantum computing.Given the Hamiltonian H of a system, a vital step is to realise the time evolution operator U (t) = e −iHt , which can be used for studying both its dynamic [2] and static [3] properties.
Several methods have been proposed to efficiently approximate the time evolution operator U (t) [4][5][6][7][8].Although the latest methods [6][7][8] have been significantly improved, the simulation accuracy is still limited by finite resources, such as short circuit depth, finite system runtime, and large physical errors in the system.To study such a limitation, we focus on the the Trotterization method [9], introduced for quantum simulation by Lloyd [2].Suppose the system Hamiltonian H can be decomposed into a sum of Hamiltonians, H k , that only involve few-body interactions, i.e.H = k H k .Then, the Trotterization method approximates the time evolution unitary operator U (t) = e −i k H k t by decomposing it into a product form, Here, N is the number of Trotter steps and O(t 2 /N ) is the algorithmic error due to a finite value of N .As H k * xiao.yuan.ph@gmail.comonly has local interactions, each term e −iH k t/N can be efficiently realised on a quantum computer.However, as H k generally does not commute with each other, Trotterization only approximates the time evolution operator U (t).By increasing the number of Trotter steps N , the algorithmic error O(t 2 /N ) can be arbitrarily suppressed.However, the circuit depth increases linearly with the number of Trotter steps.A deep circuit introduces more physical errors, which corrupt quantum simulations in noisy intermediate-scale devices [10].Consequently, we can only use a small number of Trotter steps for systems without quantum error correction [11].
Recently, several error mitigation methods have been introduced to suppress physical errors in shallow circuits [12][13][14][15][16][17].One of the methods relies on extrapolation [12][13][14], which works by deliberately increasing the error rate of the quantum hardware, and using the expectation values of several points with higher error rates to infer the error-free value.Although the error extrapolation method can suppress physical errors in shallow circuits, it fails to work when the circuit length is too long, such that several errors are expected in the circuit.As such, even with error mitigation, we cannot choose too large a number of Trotter steps.As a result, even if physical errors can be mitigated, the accuracy of the simulations will still be limited by algorithmic errors.
In our work, we study algorithmic and physical errors resulting from implementing Trotterization on near-term devices.Following Ref. [11], we first find the optimal number of Trotter steps N opt for error prone quantum simulations in Sec.II.In Sec.III, we review recently proposed error mitigation methods, and show how physical errors can be suppressed.We then extend the physical error extrapolation method to suppress the algorithmic error in Trotterization in Sec.IV.We use expectation values obtained from different number of Trotter steps N 1 and N 2 (N opt ≥ N 1 , N 2 ) and extrapolate the results to estimate a more accurate expectation value than using only the optimal number of Trotter steps N opt .In Sec.V, we numerically test our result by considering a five qubit Hamiltonian.We numerically show the optimal number of Trotter steps N opt under an inhomogeneous Pauli error model, and apply both physical and algorithmic error mitigations to significantly increase the simulation accuracy.In Sec.VI, we conclude our work and discuss its possible extension in general quantum information processing.

II. THE OPTIMAL NUMBER OF TROTTER STEPS FOR NOISY QUANTUM SIMULATION
In this section, we first review the theoretical analysis [11] about the optimal number of Trotter steps in Hamiltonian simulation with physical noise.Denote the channel of the Trotter decomposition e −iH k t/N as V k and the physical noise as an extra channel E k , the noisy stroboscopic channel for the i th Trotter step is where L is the number of the local Hamiltonians.With the number of Trotter steps N , the entire noisy channel of the Trotter decomposition is The distance between two channels E 1 and E 2 is defined by the trace distance or distinguishability between the output states of the two channels [18], where the maximisation is over a properly chosen state set and M = Tr[ √ M † M ] for matrix M .The distance between the ideal channel U ideal for the evolution e −iHt and the noisy implementation E noisyTrotter is where the second line follows from the chaining property V nonoise is the channel of the noise free stroboscopic evolution k e −iH k t/N of each Trotter decomposition.Now, we define the algorithmic and physical errors ε alg and ε phys as where α = D( Here, for simplicity, we assume that the noise model is the same for each stroboscopic sequence, that is E strobo i is the same for different i.Note that ε alg ∝ 1/N is because the algorithmic error can be linearly suppressed with an increasing number of Trotters; while ε phys ∝ N is because errors accumulate with a larger number of Trotter steps and hence longer circuits.By optimising the distance we can get the optimised number of Trotter step as with the corresponding trace distance D = 2 √ αβ.Therefore, due to the existence of physical errors, we cannot choose an infinitely large number of Trotter steps to suppress the algorithmic error.Although it is not easy to analytically calculate α and β for a general physical Hamiltonian and noise models, we will numerically show the optimal number of Trotter steps in Sec.V.In the following, we will first show how to suppress the physical errors ε phys with the recently proposed physical error mitigation methods.Then, we extend the method to also suppress algorithmic error ε alg .

III. ERROR MITIGATION AND EXTRAPOLATION TECHNIQUE
Now, we show how to suppress physical errors with the recently proposed error mitigation methods [12][13][14][15][16][17].Especially, we focus on the linear and exponential extrapolation error mitigation methods [12][13][14].Due to the imperfections of the gate operations, such as decoherence, errors can accumulate in the quantum circuit, so that the noisy output state ρ noise becomes where the ideal operation can be expressed as Here, N k is the noise channel accompanying the k th ideal gate operation G k , N tot is the number of gates, and ρ init is the initial input state for the quantum circuit.The noisy output state can be corrected with fault tolerant error correction that utilises extra qubits to detect errors and correct the state.However, fault tolerant error correction is considerably costly and is hard to realise with current quantum hardwares.
For the noisy intermediate-scale quantum (NISQ) devices with restricted number of qubits, error mitigation methods require no extra qubit and can suppress errors with simple post-processing of different runs of the quantum circuits.
Here we focus on the quantum computation tasks of which the final goal is to calculate the expectation value of a certain observable Â. Suppose the error-free circuit output state ρ, the noiseless expectation value is Â = Tr( Âρ).For a noisy circuit with error strength ε, the noisy output state ρ ε deviates from the ideal noiseless state.For example, for stochastic errors we can set ε ∝ p, where I is the identity map, N k is a noise map, and p ∈ [0, 1] denotes the strength of the noise.The noisy expectation value Â (ε) can be regarded as a function of ε and it can be expanded according to different orders of ε, where A j is the j th derivative of Â (ε) in Taylor expansion and Â (0) is the noiseless expectation value.For a considerably small ε, we have Â (ε) ≈ Â (0).With several different noisy expectations Â (ε), error mitigation is to infer the noiseless expectation value Â (0) within a higher accuracy.

A. Linear extrapolation
Suppose the expectation value of the observable Â (ε) is measured for several rescaled noise rates a j ε with a 0 = 1 < a 1 < a 2 ... < a n .Then we can estimate Â (0) by the method introduced in Ref. [12,13], Here we choose γ i such that n i=0 γ i = 1, n i=0 γ i a j i = 0 for j = 0, 1, . . ., n.By extrapolating n points with different error strengths, we can accurately estimate Â (0) and suppress the error to O(ε n+1 ).The variance of the estimation Â est (0) is Suppose the variance Var( Â est (a i ε)) 2 are similar for different error strengths, the variance of the estimation Â est (0) is n i=1 γ 2 i times larger than the variance of each measurement Â(ε).Therefore, to achieve the same shot noise of each measurement Â(ε), we need to run the circuit n i=1 γ 2 i more times and we denote as the cost of physical error mitigation.Note that, Γ phys generally increases exponentially to n [19].We can thus only choose a small constant of n in practice in order to avoid such exponentially increasing cost.

B. Exponential extrapolation
The extrapolation method in the previous section is equivalent to using a polynomial function to fit the values with different error strengths and extrapolating the fitting function to estimate the value without error.The optimal fitting function is not necessarily a polynomial function.In Ref. [14], exponential extrapolation was introduced by fitting an exponential function and was shown to be able to suppress more errors than linear extrapolation.When two error rates, and r (r > 1) are used, the estimation value via exponential extrapolation is The intuitive reason that the exponential function is a suitable function for extrapolation is as follows.For simplicity, we assume that the noise model for each gate is the same and described by Eq. (10) where N k weakly depends on p.Here we can set ε = p and ignore the gate operations for concise explanation, as it does not have any significance on the argument.Now, the entire noise process of the quantum circuit can be written as where N tot is the number of the gate in the quantum circuit, and K m can be expressed as × the sum of terms where N appears for m times .
The binomial distribution Ntot m (1 − p) Ntot−m p m can be approximated by a Poisson distribution in the limit of N tot → ∞ and N tot p → const, so that As Ntot k=1 N k is proportional to e −Ntotp , it is suggested in Ref. [14] that the exponential function is a better function for extrapolation.
By assuming that Â ( ) ∝ e −Ntot , and Var( Â ( )) = Var( Â (r )), we can get the variance of the estimation where we use the formula for the propagation of the uncertainty.Thus the cost for the exponential extrapolation is approximately

IV. ERROR MITIGATION FOR ALGORITHMIC ERRORS
In this section, we discuss how the algorithmic error in Trotterization can be regarded as an analogy of the physical error and how to extend the extrapolation error mitigation method to suppress the algorithmic error.Given a Hamiltonian H that has decomposition the first order Trotter formula approximates the time evolution operator U (t) = e −i k H k t by decomposing it into a product form, where E(m) can be upper bounded by E(m) ≤ N Ht/N m /m, and • denotes the maximal eigenvalue of the matrix.Denote ε N = 1/N and U ε N (t) as then we can straightforwardly see how Suppose the time evolution operator U ε N (t) is applied to an initial state |ψ 0 , the output state is U ε N (t) |ψ 0 .When we measure observable A of the final output state, the average value is While the error-free expectation value for the observable is Â(t) (0) = ψ| 0 e iHt Âe −iHt (t) |ψ 0 .Regarding Â(t) (ε N ) as a function of ε N , we can expand Â(t) (ε N ) as a function of ε N by using the Taylor expansion where Â(t) (0) and Â(t) j are independent of ε N .Therefore, the extrapolation error mitigation method can be applied to suppress the algorithmic error.In the original error mitigation scheme, we need to boost the error rate ε to several different error rates a j ε, which can be realised by intensionally adding more noise to the circuit.Here, as the error rate ε N is 1/N , we can more straightforwardly increase the algorithmic error ε N with a smaller number of Trotter steps.For example, by taking N = N/2, we can effectively double the algorithmic error and N j = N 0 /a j , we can therefore suppress the algorithmic error by a linear combination of the results ) Here, γ i is chosen such that n i=0 γ i = 1, n i=0 γ i a j i = 0 for j = 0, 1, . . ., n.Therefore, we can suppress the algorithmic error to an order of O((ε Nopt ) n+1 ) = O((1/N opt ) n+1 ).The details of upper bound for algorithmic error are shown in Appendix A.
The variance of the estimation Â est (0) is Thus, by assuming that the variance is the same for different Â est (ε Ni ), the variance of the estimation Var Â est (0) is n i=0 γ 2 i times larger than the variance of Â est (ε Ni ).We denote the cost of the extrapolation for algorithmic error by Moreover, we can combine the extrapolation for physical errors with the extrapolation for algorithmic errors, and the total cost is Note that, the only requirement for this method is that U ε N (t) can be expressed as an explicit function of ε N , and lim ε→0 + U ε N (t) = U (t).Therefore, the same argument can be applied to the higher order Trotterisation [4].Furthermore, this method can still be applied even if the expectation value cannot be efficiently expanded as a function of 1/N .The method also works as long as Â can be expanded with ε which is a function f (N t ) of the tunable parameter N t .

V. NUMERICAL SIMULATION
In this section, we consider a five qubit system and numerically test our algorithmic error mitigation method for simulating real time evolution.As shown in shown in Fig. 1, the Hamiltonian only has local and near neighborhood interactions, where X i (Z i ) denotes the spin half Pauli x(z) operator acting on the ith qubit, J = 3, and B = 2.In our numerical simulation, we start with initial state |ψ 0 = |0, 0, 0, 0, 0 , evolve it with time t, and measure Â = X 1 .We consider both algorithmic error from the finite number of Trotter steps and physical error from gate noises.We consider inhomogeneous Pauli error for both single and two qubit gates, where p = p x + p y + p z .For single qubit gate, we set p x = p y = 2.0 × 10 −5 , p z = 6.0 × 10 −5 ; for two qubit gate, we take error channel E 2 = E ⊗ E and set p x = p y = 1.0 × 10 −4 , and p z = 3.0 × 10 −4 for each E. Note that such a noise rate corresponds to the current state-of-theart experiment system [20,21].
Without considering gate error and shot noise to the measurement, one should use the infinite large number of Trotter steps to increase the simulation accuracy.With gate errors, the optimal number of Trotter steps is limited as show in Fig. 2. Here, we fix the total evolution time t = 0.5 and numerically find the optimal number of Trotter steps to be 25.To suppress the algorithmic error, we use two or three different number of Trotter steps to infer the value corresponding to the infinite number of Trotter steps.For a given number of Trotter steps N , the runtime of the circuit is related to the circuit depth, which is proportional to N , and the circuit repetition time m, which is used to get an accurate estimation of the measurement.We denote the total runtime resource cost M as M = mN .To compare different simulation scenarios, we thus consider the same total cost M for a fair comparison.For three-and two-point extrapolation, we divide M equally to different number of Trotter steps.For example, for three Trotter step extrapolation, N 1 , N 2 , and N 3 , we have m i ) for i = 1, 2, 3; for two Trotter step extrapolation, N i ) for i = 1, 2; and for one number of Trotter steps N 1 .
In our simulation, we compare the three cases for suppressing algorithmic errors: no error mitigation, linear extrapolation, and three points extrapolation.In order to quantify the performance of our simulation method, we evaluate the error of the estimation value Â(t) (0) est by where Â(t) (0) is the error-free average value.Now, we show that physical and algorithmic errors can be suppressed with the error mitigation methods.To begin with, we check the continuity of the Â(t) as a function of ε N = 1/N , to show that Â(t) can be Taylor expanded by ε N .We consider the case with and without physical error mitigation.By boosting the error rate twice, and applying the linear and exponential extrapolation methods, we can suppress the physical errors.As shown in Fig. 2 (b), we can see that Â(t) is indeed a continuous function of ε N , which confirms the possibility of algorithmic error mitigation.Furthermore, the best accuracy achieved by linear and exponential extrapolation is δ 2 = 2 × 10 −4 and 2.79 × 10 −5 , with the number of Trotter steps N = 43 and 109, respectively.This clearly shows that we cannot increase the number of Trotter steps infinitely even when the extrapolation method is applied.
To show the effect of algorithmic error mitigation, we also consider three cases for physical errors: no error mitigation, linear extrapolation, and exponential extrapola-tion.First, we consider the case where no error mitigation is employed for the physical error.In such a case, physical errors still dominate and we find that algorithmic error extrapolation cannot improve the simulation accuracy, as shown in Fig. 3(a).This is because, although we suppress the algorithmic error by linear combining the results from different number of Trotter steps, the large deviation due to physical errors even make the estimation worse.As the total resource M increases, the shot noise is suppressed and the accuracy converges.The accuracy δ 2 at the converged point without algorithmic and physical errors mitigations is 2.67 × 10 −3 .
Next, we consider the cases where linear extrapolation is applied to suppress physical errors.Subsequently, we apply the algorithmic error extrapolation to suppress algorithmic errors due to Trotterization.As shown in Fig. 3(b), we find that the algorithmic linear extrapolation outperforms the no error mitigation and three point extrapolation cases for large M .The converged accuracy with sufficiently large M 10 8 is δ 2 = 3.72 × 10 −6 under linear extrapolation of algorithmic errors.The improvement of the accuracy is 717 times, compared with the case where no error mitigation is applied for both physical and algorithmic errors.
Finally, in Fig. 3(c), we plot the result for the case where exponential extrapolation is used for suppressing physical errors.It can be seen that the physical error is successfully reduced, and three point extrapolation works properly, surpassing the performance of linear extrapolation for large M 10 13 .The converged accuracy δ 2 for sufficiently large M is 6.95 × 10 −8 .This accuracy correspond to 3.8 × 10 4 times improvement, compared with the case where no error mitigation is applied for both physical and algorithmic errors.

VI. DISCUSSION
In this work, we propose an error mitigation method for suppressing algorithmic errors in Trotterization of Hamiltonian simulation.We first show that the optimal number of Trotter steps is finite due to physical errors.Then, we show how the recently proposed physical error mitigation methods can be extended to suppress algorithmic errors in Trotterization.We numerically test our algorithmic error mitigation method in a five qubit Hamiltonian and show how it can improve simulation accuracy by combining it with physical error mitigation.Although we only focus on the first-order Trotterization, it is worth noting that our scheme can also be extended to other Trotterization schemes, such as higher-order Trotterization [4] and randomisation Trotterization [5].This is because the expectation values obtained from these methods can also be written as a function of the number of Trotter steps.Although, in the presence of physical errors, higher-order Trotter decompositions may not reduce the overall error [12], we leave these extensions in future works.Moreover, the other recently proposed Hamiltonian simulation methods, e.g.Taylor series [6] and quantum signal processing [7], offer alternative ways for Hamiltonian simulation instead of Trotterization.These methods divide the simulation time t into N segments and simulate the evolution for each time t/N .Considering 1/N as an error, our extrapolation method can also be applied by modifying N and extrapolate the results with different N to improve the estimation accuracy.
The extrapolation method has broad applications in diverse fields, including error mitigation, computational chemistry, linear optics simulation, etc.In classical computational chemistry, extrapolation is widely used in solving molecular structure problem and Monto Carlo simulation of dynamics [22,23].In linear optics simulation, the extrapolation method is used to simulate single photons with imperfect photon sources such as coherent states from lasers [19].We can also apply this formalism for mitigating the algorithmic error to other schemes, such as variational quantum eigensolver (VQE) [24][25][26][27][28][29][30].The result obtained from VQE can be regarded as a function of the depth of the quantum circuit, and the extrapolation method can be applied.Similar argument can also be applied to other types of variational algorithms, for simulating real or imaginary time evolutions [12,31,32].

FIG. 2 .
FIG. 2. The optimal number of Trotter steps N and the continuity of the measurement as a function of the inverse of the number of Trotter steps εN = 1/N .(a) The trace distance between the the ideal state and the simulated state in the presence of noise.The blue curve denotes the trace distance without physical error, which goes to zero with an infinite large number of Trotter steps.The black curve denotes the trace distance with inhomogeneous Pauli error after each gate and the optimal number of Trotter steps is 25.(b) The expectation value of the observable versus εN = 1/N .Here N is the number of Trotter steps.The horizontal axis corresponds to the number of Trotter step 10 − 200.From the simulation result, we can confirm the continuity of the function.

FIG. 3 .
FIG.3.The error δ 2 against the total runtime resource M for different cases with no algorithmic error mitigation, linear extrapolation for algorithmic errors and three point extrapolation for algorithmic errors.We consider physical errors to the circuit and set the total evolution time t = 0.5.The number of Trotter steps N = 25, 20, 15, N = 25, 15, N = 25 are used for the three point, linear extrapolation and no error mitigation case, respectively.Blue line denotes no error mitigation case, black line denotes linear extrapolation for algorithmic errors, red line denotes three point extrapolation for algorithmic error.(a) No physical error mitigation method is applied.Algorithmic error mitigation cannot improve the simulation accuracy.(b) Linear extrapolation is applied to suppress physical errors.(c) Exponential extrapolation is applied to suppress physical errors.

( a 2 +
H 3 t 3 e H t/n /3 n 2 Â + λ n ) (A10) Based on the two point extrapolation technique, we use the simulation results with Trotter steps N 1 N 2 , which both are O(N ) to reduce the error from O( 1 N ) to O( 1 N 2 ).Similar to the above analysis, by applying extrapolation with m different points, we can suppress the Trotter error to the order of O(1/N m ).