1 Introduction

Response functions describe the linear response of a many-body system after an excitation and contain the same information as an inclusive reaction cross section. They can be expressed in terms of the spectral density operator \(\delta ({\hat{H}}-\omega )\) of the Hamiltonian \({\hat{H}}\) describing the many-body system. First principle calculations of response function is in general extremely challenging for strongly correlated systems. A very powerful approach to study dynamical properties of many-body systems is to employ integral transform techniques which map the local spectral density into more manageable ground state expectation value which can be used to infer properties of the response function. This is the approach used in the Lorentz Integral Transform (LIT) method [1, 2] and the more recent Gaussian Integral Transform (GIT) method [3, 4]. Thanks to the ability to efficiently simulate the real time dynamics of many-body systems, simulations employing quantum computers offer the possibility to tackle the calculation of scattering cross sections from first principles (see e.g. [5] for a recent review). Interestingly, in order to describe inclusive scattering in the linear response regime using the response function, integral transform techniques are also useful in the design of efficient quantum algorithms [3, 6]. It is therefore important and timely to extend the available techniques in order to reduce as much as possible the computational resources required to calculate the nuclear response function on a quantum device.

Given an Hamiltonian \({\hat{H}}\), an initial state \(\vert \varPsi _0\rangle \) and a Hermitian excitation operator \({\hat{O}}\), our goal is to evaluate the frequency dependent response function defined as

$$\begin{aligned} \begin{aligned} S(\omega )&= \langle \varPsi _0|{\hat{O}}^\dagger \delta \left( \omega -{\hat{H}}\right) {\hat{O}}|\varPsi _0\rangle \\&= \sum _m \left| \langle \varPsi _0|{\hat{O}}|m\rangle \right| ^2 \delta \left( \omega -E_m\right) \\ \end{aligned} \end{aligned}$$
(1)

where in the last line we used the expansion on the eigenbasis \(\{\vert m\rangle \}\) of \({\hat{H}}\). In general, it is difficult to directly use this definition as it requires a complete knowledge of the full energy eigenspectrum. The main idea is, similarly to the LIT and the GIT methods, to consider instead an integral transform with kernel K given by

$$\begin{aligned} \begin{aligned} \varPhi (\nu )&= \int d\omega K(\nu ,\omega ) S(\omega )\\&= \langle \varPsi _0|{\hat{O}}^\dagger K\left( \nu ,{\hat{H}}\right) {\hat{O}}|\varPsi _0\rangle \\&=\sum _{m} \left| \langle \varPsi _0|{\hat{O}}|m\rangle \right| ^2 K\left( \nu ,E_{m}\right) . \end{aligned} \end{aligned}$$
(2)

Note that both the original transform and it’s integral transform have units of inverse energy. Furthermore, in this work we will focus on translationally invariant kernel functions for which \(K(\nu ,\omega )=K(\nu -\omega )\), but extensions to the more general case are straightforward.

Once \(\varPhi (\nu )\) has been obtained, one usually attempts an inversion of the integral transform in order to obtain \(S(\omega )\) back, however this procedure can introduce uncontrollable errors whenever the kernel function has compact support [7, 8]. A variety of approximate inversion techniques that introduce, more or less explicitly, additional smoothing to reduce these artifacts have been proposed in the past [9,10,11,12,13]. However, if the kernel function is chosen appropriately this last step might not be necessary [3, 4]. In particular, it is convenient to consider kernels such that

$$\begin{aligned} \int \nolimits _{-\varDelta }^{\varDelta } d\nu K(\nu )\ge 1-\varSigma , \end{aligned}$$
(3)

A kernel satisfying Eq. (3) is called \(\varSigma \)-approximate with resolution \(\varDelta \) [3]. The reason for this definition is that, in the commonly encountered situation where one is interested in observables of the form

$$\begin{aligned} Q(S,f) = \int d\omega S(\omega )f(\omega ), \end{aligned}$$
(4)

for some bounded function f, one can use directly the integral transform \(\varPhi \) to approximate Q(Sf) with \(Q(\varPhi ,f)\) with controllable error [3]. More intuitively, we can think of \(\varPhi \) as a finite width approximation of the original response function with an energy resolution given by \(\varDelta \) and additional tails controlled by the parameter \(\varSigma \). The original response is then recovered in the limit \(\varDelta ,\varSigma \rightarrow 0\).

This approach was recently used in Ref. [4] to provide a controllable approximation of the spectral density using histograms derived from the integral response (see also [14] for a recent application for computing spectral functions in light nuclei using the Coupled Cluster method).

A direct procedure to construct integral kernels satisfying Eq. (3) is to use a polynomial expansion such as

$$\begin{aligned} K(\nu -\omega ) = \sum _n^\infty c_n(\nu ) \phi _n(\omega ), \end{aligned}$$
(5)

with \(\{\phi _n\}\) an orthonormal basis of polynomials. This leads directly to an alternative expression for the integral transform in this basis

$$\begin{aligned} \varPhi (\nu ) = \sum _n^\infty c_n(\nu )\langle \varPsi _0|{\hat{O}}^\dagger \phi _n\left( {\hat{H}}\right) {\hat{O}}|\varPsi _0\rangle = \sum _n^\infty c_n(\nu )m_n,\nonumber \\ \end{aligned}$$
(6)

where \(m_n\) denotes the nth frequency moment of the response function over these polynomials

$$\begin{aligned} m_n = \int d\omega \phi _n(\omega ) S(\omega ). \end{aligned}$$
(7)

If the series in Eq. (6) converges rapidly, one can then estimate the integral transform \(\varPhi (\nu )\) with a small error by keeping only the first N terms in the expansion. Since the response function, and thus its integral transform, have units of inverse energy we will quantify the error in its approximation as \(\varepsilon /\varOmega \) with \(\varepsilon >0\) and \(\varOmega \) a suitable energy constant. As shown in [3], we can approximate a response function with a \(\varSigma \)-accurate kernel with resolution \(\varDelta \) using a basis of Chebyshev polynomials and a number of terms given by

$$\begin{aligned} N\approx \widetilde{{\mathcal {O}}}\left( \frac{\Vert {\hat{H}}\Vert }{\varDelta }\sqrt{\log \left( \frac{1}{\varSigma }\right) \log \left( \frac{\varOmega }{\varDelta \varepsilon }\right) }\right) , \end{aligned}$$
(8)

with \(\Vert {\hat{H}}\Vert \) as the spectral norm of the Hamiltonian. The notation used here neglects subleading logarithmic factors, in particular we define \(\widetilde{{\mathcal {O}}}(f(x))={\mathcal {O}}(f(x)\log (f(x)))\) in line with previously reported estimates [3].

This results applies to any possible response function and is helpful whenever the Chebyshev moments of the Hamiltonian can be computed efficiently. This can be done efficiently and exactly with quantum computers [15,16,17,18,19] or in approximate way with classical methods, such as the Coupled Cluster approach [4, 14]. In many applications the spectral function has a number of distinctive features like being dominated by low energy contributions or displaying a distinct peak structure like e.g. in the quasi-elastic regime. Many of these features are captured by energy moments of the form [20]

$$\begin{aligned} \mu _n = \int d\omega \omega ^n S(\omega ). \end{aligned}$$
(9)

For instance, the qualitative shape of a quasi-elastic peak can be characterized with a good accuracy from the first few moments alone [21]. The advantage of using moments \(\mu _n\) to characterize the spectral density is that in many situations they can be calculated explicitly using ground-state many-body methods (e.g. with Monte Carlo [22,23,24]).

In this work we employ a Fourier basis for the polynomial expansion of the integral transform Eq. (6) in order to incorporate this information into the calculation of the full spectral density and reduce the overall computational cost of the simulation. Thanks to their ability to efficiently simulate the real-time evolution of many-body systems, quantum computers are expected to be able to give us access to expectation values of the form

$$\begin{aligned} g_\psi (t) = \langle \psi |e^{it{\hat{H}}}|\psi \rangle , \end{aligned}$$
(10)

for states \(\psi \) which can be efficiently prepared. The function \(g_{\psi }(t)\) contains important information about the many body system, and several authors have proposed techniques to use this to get access to a variety of observables like excitation energies, the local spectral density and even thermodynamic expectation values [25,26,27,28,29].

Under general considerations, we can expect two main time scales to play a role: first, in order to obtain a frequency resolution of order \(\varDelta \), the maximum time required will need to scale as \(T={\mathcal {O}}(1/\varDelta )\); second, since the full energy spectrum is contained in a frequency interval of size \(\Vert {\hat{H}}\Vert \), a time step \(\delta t={\mathcal {O}}(1/\Vert {\hat{H}}\Vert )\) will guarantee a perfect reconstruction without aliasing thanks to the Shannon–Nyquist theorem. The combination of these two time scales predicts a scaling of the number of time-steps required as \(T/\delta t={\mathcal {O}}(\Vert {\hat{H}}\Vert /\varDelta )\). However, as shown recently in Ref. [27], in situations where the spectral function has an energy variance \(\sigma ^2\ll \Vert {\hat{H}}\Vert ^2\), a good Fourier approximation can be obtained with a scaling \(T/\delta t={\mathcal {O}}(\sigma /\varDelta )\) instead. The goal of this work is to formalize this intuition and provide rigorous error bounds allowing use of prior information about the energy moments of the spectral function in order to reduce the number of expectation values required.

In Sect. 2 we present the general framework employing Fourier moments to approximate the response function and specialize the treatment to the Gaussian Integral Transform in Sect. 2.1. Section 3 details two example response functions that are reconstructed with this method and the improved efficiency afforded by employing energy moments. In Sect. 4 we conclude by discussing applications of this method to typical scattering properties in nuclear physics, and the estimated improvement in number of Fourier moments required.

2 Fourier based reconstruction

In order to use directly a discrete Fourier transform to perform the expansion of the integral kernel in Eq. (5) it’s convenient to define a periodic extension of the kernel function as follows [26]

$$\begin{aligned} K^\chi (\nu ,\omega ) = \sum _{n=-\infty }^\infty K\left( \nu ,\omega +n\chi \Vert {\hat{H}}\Vert \right) , \end{aligned}$$
(11)

where the period \(P=\chi \Vert {\hat{H}}\Vert \) is expressed here as a function of the spectral norm. This convention allows us to truncate the sum at the first term if we take \(\chi \gg 1\): since the spectrum is bounded, only the term with \(n=0\) has a finite contribution. As \(\chi \) is reduced, more terms will start to contribute to the sum and the extended integral kernel \(K^\chi \) will start to deviate from the original. The main advantage of this construction is that we can express directly the periodically-extended kernel as a Fourier series

$$\begin{aligned} K^\chi (\nu ,\omega ) = \frac{1}{\chi \Vert {\hat{H}}\Vert } \sum _{n=-\infty }^\infty k^\chi _n\left( \nu \right) \exp \left( -i\frac{2\pi n}{\chi \Vert {\hat{H}}\Vert }\omega \right) , \end{aligned}$$
(12)

where the Fourier transformed coefficients are given by

$$\begin{aligned} k^\chi _n\left( \nu \right) = \int \nolimits _{-\infty }^\infty d\omega \exp \left( i\frac{2\pi n}{\chi \Vert {\hat{H}}\Vert }\omega \right) K(\nu ,\omega ). \end{aligned}$$
(13)

The main advantage of working with \(K^\chi \) and this Fourier series representation is that we can now express a general integral transform of the response function as a linear combination of expectation values of the time-evolution operator. From the definition in Eq. (2) we can in fact express the new integral transform as follows

$$\begin{aligned} \varPhi ^\chi (\nu )= & {} \langle \varPsi _0|{\hat{O}}^\dagger K^\chi (\nu ,{\hat{H}}){\hat{O}}|\varPsi _0\rangle \nonumber \\= & {} \frac{1}{\chi \Vert {\hat{H}}\Vert } \sum _{n=-\infty }^\infty k^\chi _n(\nu ) \langle \varPsi _0|{\hat{O}}^\dagger e^{-in\delta t{\hat{H}}}{\hat{O}}|\varPsi _0\rangle \nonumber \\ \end{aligned}$$
(14)

with finite time-steps of size \(\delta t=2\pi /(\chi \Vert {\hat{H}}\Vert )\). Provided we choose a smooth integral kernel in the \(\omega \) variable, the series expansion converges quickly and we can therefore obtain an accurate approximation of the integral transform by taking a truncation to some finite order

$$\begin{aligned} \varPhi ^\chi _N(\nu ) = \frac{1}{\chi \Vert {\hat{H}}\Vert } \sum _{n=-N}^N k^\chi _n(\nu ) \langle \varPsi _0|{\hat{O}}^\dagger e^{-in\delta t{\hat{H}}}{\hat{O}}|\varPsi _0\rangle .\nonumber \\ \end{aligned}$$
(15)

For example, if we consider integral kernels in \(C^\infty \), the convergence will be in general super-polynomial in N and, importantly, rigorous bounds on the truncation error can be found with relatively straightforward calculations. It is important to note at this point that the use of a smoothing kernel with a finite energy resolution \(\varDelta \) is critical to ensure that the expansion is well-behaved: indeed a direct approximation of the response function \(S(\omega )\) using a finite Fourier sum would have encountered difficulties due to the discreteness of the energy spectrum for a finite system, which creates sharp peaks. The difference between the present approach and related ones (from Refs. [3, 4]) with more heuristic smoothing procedures like the Maximum Entropy Method [9, 11] or alternative polynomial expansion methods like the Kernel Polynomial Method [30] is that the energy window over which the smoothing is applied is fully under control and all errors can be accounted for. The price to pay to be able to use higher energy resolution is a corresponding increase in the number of terms in the expansion Eq. (15) which corresponds to a comparable increase in the maximum time \(T=N\delta t\) over which one needs to be able to simulate the many-body dynamics. We will discuss this in more detail for a specific choice of integral kernel in the next section.

2.1 Gaussian integral transform

As shown already in Ref. [3], the Gaussian Integral Transform (GIT) is particularly useful for the purpose of obtaining a \(\varSigma \)-accurate integral transform with resolution \(\varDelta \) with a fast converging polynomial expansion like Eq. (5). This result is rather intuitive since a Gaussian envelope is a perfect trade-off between good resolution in frequency and small widths in the time domain. The original construction from Ref. [3] used a Chebyshev expansion for the polynomial basis, however in this work we instead explore an expansion of the Gaussian kernel into Fourier modes.

The first step is to determine an appropriate value for the width \(\varLambda \) of the Gaussian kernel in order to satisfy the condition in Eq. (3). A direct calculation gives

$$\begin{aligned} \frac{1}{\sqrt{2\pi }\varLambda }\int \nolimits _{-\varDelta }^{\varDelta }d\nu \exp \left( -\frac{\nu ^2}{2\varLambda ^2}\right) =\text {erf}\left( \frac{\varDelta }{\sqrt{2}\varLambda }\right) \ge 1-\varSigma .\nonumber \\ \end{aligned}$$
(16)

Using the upper-bound on the complementary error function \(\text {erfc}(x)=1-\text {erf(x)}\) by a Gaussian

$$\begin{aligned} \text {erfc}(x) \le \exp (-x^2), \end{aligned}$$
(17)

we can find the following sufficient condition [3]

$$\begin{aligned} \varSigma \ge \exp \left( -\frac{\varDelta ^2}{2\varLambda ^2}\right) \quad \Rightarrow \quad \varLambda \le \frac{\varDelta }{\sqrt{2\log (1/\varSigma )}}. \end{aligned}$$
(18)

Following the notation from Eqs. (11) and (12), we can then express the periodically extended Gaussian kernel as

$$\begin{aligned} G^\chi (\nu ,\omega ) = \frac{1}{\chi \Vert {\hat{H}}\Vert } \sum _{n=-\infty }^\infty g^\chi _n(\nu ) \exp \left( -i\delta t n\omega \right) \; \end{aligned}$$
(19)

with the corresponding Fourier coefficients

$$\begin{aligned} g^\chi _n(\nu ) = \exp \left( -i\delta t n\nu \right) \exp \left( -\frac{\delta t^2\varLambda ^2}{2} n^2\right) . \end{aligned}$$
(20)

In the expressions above we used \(\delta t=2\pi /(\chi \Vert {\hat{H}}\Vert )\) for the time-step. We can now write the approximate integral transform obtained by truncating the series as

$$\begin{aligned} \varPhi ^\chi _N(\nu ) = \frac{1}{\chi \Vert {\hat{H}}\Vert } \sum _{n=-N}^N g^\chi _n(\nu ) \left\langle \varPsi _0|{\hat{O}}^\dagger e^{-in\delta t{\hat{H}}}{\hat{O}}|\varPsi _0\right\rangle . \end{aligned}$$
(21)

The ideal integral transform \(\varPhi (\nu )\) would be obtained in principle by choosing \(\varLambda \) in order to satisfy Eq. (18), taking \(\chi =2\) and letting \(N\rightarrow \infty \). The error in the approximation \(\varPhi ^\chi _N\) is caused only by taking a finite number of terms N and (possibly) reducing the value of \(\chi \) which parametrizes the frequency interval used in the periodic extension. For a fixed value of the frequency \(\nu \) we can then bound the error with

$$\begin{aligned} |\varPhi ^\chi _N(\nu )-\varPhi (\nu )|\le |\varPhi ^\chi (\nu )-\varPhi (\nu )|+|\varPhi ^\chi _N(\nu )-\varPhi ^\chi (\nu )|,\nonumber \\ \end{aligned}$$
(22)

where we simply used the triangle inequality. The advantage is that the two error contributions on the right hand side can be bounded individually in a simpler way. We will denote the first error on the right hand side as \(\epsilon _P\) and the second as \(\epsilon _N\). In addition to these two sources of error, we need also to account for the fact we will estimate the Fourier moment

$$\begin{aligned} m^\chi _n = \langle \varPsi _0|{\hat{O}}^\dagger e^{-in\delta t{\hat{H}}}{\hat{O}}|\varPsi _0\rangle \end{aligned}$$
(23)

by computing the expectation value with a finite statistical sample leading to an additional error

$$\begin{aligned} \epsilon _S = \left|\varPhi ^\chi _N(\nu )-{\overline{\varPhi }}_N^\chi (\nu )\right|, \end{aligned}$$
(24)

where we have denoted by \({\overline{\varPhi }}_N^\chi (\nu )\) the finite sample estimate of \(\varPhi _N^\chi (\nu )\). The total error will be given then by the sum of all contributions \(\epsilon =\epsilon _P+\epsilon _N+\epsilon _S\).

Before presenting our results for the complexity of estimating an accurate approximation of the integral transform \(\varPhi (\nu )\), it is convenient to specify several of the conventions we use, note however that the results provided in Appendix A are completely general and do not depend on these conventions. First of all, since the response function (and thus it’s integral transform) have dimensions of inverse energy, we will consider a dimensionless error parameter \(\varepsilon >0\) obtained using a suitable energy scale \(\varOmega \). That is, we want to find values \(\chi \) and N for which

$$\begin{aligned} |{\overline{\varPhi }}_N^\chi (\nu )-\varPhi (\nu )|\le \frac{\varepsilon }{\varOmega }. \end{aligned}$$
(25)

Second, we consider the situation where we are interested in approximating the response function on a finite energy window \(\omega \in [\omega _{\min },\omega _{\max }]\). For many applications in nuclear physics is also customary to shift the Hamiltonian by the ground state energy so that all frequencies become positive. Since both of these considerations apply directly to the integral transform, we will consider the situation where \({\hat{H}}\) has been shifted so that the ground state is at \(\omega _{\min }=-\Vert {\hat{H}}\Vert \) and consider a range \([-\Vert {\hat{H}}\Vert ,-\Vert {\hat{H}}\Vert +\delta \nu ]\) for the energies we want the value of \(\varPhi (\nu )\). Finally, since we are interested in computing the Fourier moments \(m^\chi _n\) on a quantum computer, we will consider the situation where the excitation operator has been appropriately rescaled so that the state \({\hat{O}}|\varPsi _0\rangle \) is normalized to one. This directly implies that the zeroth moment \(\mu _0\) will also be equal to one. A rescaling of this form has been employed already in past works on quantum algorithms for the response function [3, 4, 6, 31, 32] and is natural when using efficient methods for preparing the excited state (see [33]).

The only error term that depends directly on the energy variance \(\sigma ^2=\mu _2-\mu _1^2\) is the first one, while the other ones will only depend parametrically on the chosen period \(P=\chi \Vert {\hat{H}}\Vert \). We start with the truncation error which can be bounded easily using standard techniques resulting in the following requirement for the number of terms

$$\begin{aligned} N\ge \frac{\chi \Vert {\hat{H}}\Vert }{\sqrt{2\pi }\varLambda }\sqrt{\log \left( 0.4\frac{\varOmega }{\varepsilon _N\varLambda }\right) }. \end{aligned}$$
(26)

A full derivation of this result can be found in Appendix A.3. The dependence on the error is typical for Gaussian kernels (cf. [3, 4]). The statistical contribution of the error can be controlled, with confidence level \(1-\delta \), by requiring in the worst case a number of experiments given by

$$\begin{aligned} S= & {} N\frac{\varOmega ^2}{\varepsilon _S^2\varLambda ^2}\log \left( \frac{2}{\delta }\right) \nonumber \\= & {} \frac{\chi \Vert {\hat{H}}\Vert \varOmega ^2}{\sqrt{2}\pi \varepsilon _S^2\varLambda ^3}\sqrt{\log \left( 0.4\frac{\varOmega }{\varepsilon _N\varLambda }\right) }\log \left( \frac{2}{\delta }\right) , \end{aligned}$$
(27)

where in the second line we used the estimate from Eq. (26). We present a full derivation of this result in Appendix A.4. As we can see, the sample complexity of the scheme is directly proportional to the factor \(\chi \) controlling the period.

The remaining error \(\epsilon _P\), controlled by the choice of \(\chi \), can be found under two separate situations: the general case where we do not use information from known energy moments \(\mu _n\) and the typical case where we have information at least on the energy variance. As mentioned in the text following Eq. (11), in the first situation we want to take \(\chi \gg 1\) in order to minimize the error. In particular, as shown explicitly in Appendix A.1, we find that for \(\epsilon _P\le \varepsilon _P/\varOmega \) the following choice would be sufficient

$$\begin{aligned} \chi =2+\frac{\sqrt{2}\varLambda }{\Vert {\hat{H}}\Vert }\sqrt{\log \left( \frac{2\varOmega }{\varepsilon _P\varLambda }\right) }. \end{aligned}$$
(28)

In the limit \(\varLambda \rightarrow 0\) we recover the Shannon–Nyquist theorem which gives \(\chi =2\) for a perfect reconstruction. At this point we can look for the asymptotic scaling of both N and S while guaranteeing a total error \(\varepsilon _P+\varepsilon _N+\varepsilon _S\le \varepsilon \). If we take \(\varepsilon _P=\varepsilon _N=\varepsilon _S=\varepsilon /3\) we find immediately

$$\begin{aligned} \begin{aligned} N&=\widetilde{{\mathcal {O}}}\left( \frac{\Vert {\hat{H}}\Vert }{\varDelta }\sqrt{\log \left( \frac{1}{\varSigma }\right) \log \left( \frac{\varOmega }{\varepsilon \varDelta }\right) }\right. \\&\quad \left. +\log \left( \frac{\varOmega }{\varepsilon \varDelta }\sqrt{\log \left( \frac{1}{\varSigma }\right) }\right) \right) , \end{aligned} \end{aligned}$$
(29)

which, apart from a logarithmic correction, is the same result found for the Chebyshev version of the GIT protocol. In turn we find that the required number of samples will scale in general as

$$\begin{aligned} S=\widetilde{{\mathcal {O}}}\left( \frac{\Vert {\hat{H}}\Vert \varOmega ^2}{\varepsilon ^2\varDelta ^3}\log ^{3/2}\left( \frac{1}{\varSigma }\right) \log \left( \frac{1}{\delta }\right) \right) \end{aligned}$$
(30)

again similar to the Chebyshev version (cf. Appendix A.4 and the orginal work Ref. [3]). The main difference is that the Chebyshev implementation avoids the (necessary) approximation of the time-evolution operator. If simulations schemes with optimal asymptotic scaling with the error are used, like the one based on Refs. [16, 17], the Chebyshev GIT will have an advantage in terms of number of operations over its Fourier version described here.

We now turn to the main result of this work where instead we use information about first two energy moments to design a scheme with better scaling. The main result we use is the Chebyshev inequality which, in terms of response functions, states that (assuming \(\mu _0=1\))

$$\begin{aligned} \begin{aligned} 1-\int \nolimits _{\mu _1-\varGamma }^{\mu _1+\varGamma }d\omega S(\omega )&=Prob\left[ \left| \omega -\mu _1\right| \ge \varGamma \right] \le \frac{\sigma ^2}{\varGamma ^2}, \end{aligned}\nonumber \\ \end{aligned}$$
(31)

for any positive constant energy \(\varGamma \). The idea is to use Eq. (31) to constrain the integrated strength of the spectrum away from the mean. The interested reader can find the full derivation in Appendix A.2, the final result is

$$\begin{aligned} \chi = \frac{2.7}{\varepsilon _P^{1/3}} \frac{\varOmega ^{1/3}\sigma ^{2/3}}{\Vert {\hat{H}}\Vert }+\frac{\delta \nu }{\Vert {\hat{H}}\Vert }, \end{aligned}$$
(32)

which is valid for \(\varLambda \le 2\sigma \) (see Appendix A.2 for an estimate valid also in a lower resolution regime). This immediately gives an estimate for the required number of moments

$$\begin{aligned} \begin{aligned} N=&{\mathcal {O}}\left( \frac{1}{\varDelta }\left( \frac{\varOmega ^{1/3}\sigma ^{2/3}}{\varepsilon ^{1/3}} +\delta \nu \right) \sqrt{\log \left( \frac{1}{\varSigma }\right) \log \left( \frac{\varOmega }{\varepsilon \varDelta }\right) }\right) \end{aligned}\nonumber \\ \end{aligned}$$
(33)

Several comments are in order at this point. First of all, the scaling of N with the target error \(\varepsilon \) is exponentially worse than the original result Eq. (29) which didn’t use energy moments. For situations that require very small errors \(\varepsilon \lesssim \varOmega \sigma ^2/\Vert {\hat{H}}\Vert ^3\) then the general scheme with \(\chi \) from Eq. (28) should be used instead. This drawback can be mitigated if more information is available. For instance if we know the value of the n central moment \(\widetilde{\mu _n}\) then we can bring the cost down to

$$\begin{aligned} N= & {} {\mathcal {O}}\left( \frac{\varOmega ^{1/(n+1)}\widetilde{\mu _n}^{1/(n+1)}}{\varDelta \varepsilon ^{1/(n+1)}}\sqrt{\log \left( \frac{1}{\varSigma }\right) \log \left( \frac{\varOmega }{\varepsilon \varDelta }\right) }\right. \nonumber \\{} & {} \left. +\frac{\delta \nu }{\varDelta }\sqrt{\log \left( \frac{1}{\varSigma }\right) \log \left( \frac{\varOmega }{\varepsilon \varDelta }\right) }\right) . \end{aligned}$$
(34)

See Appendix A.2 for additional details and a proof.

The second important comment we can make about the result Eq. (33), which also applies to its generalization Eq. (34), is that if we want to reconstruct the energy spectrum over a large frequency range scaling as \({\mathcal {O}}(\Vert {\hat{H}}\Vert )\) then the second contribution proportional to \(\delta \nu \) will dominate and we recover again the general result obtained without moments. This somewhat counter-intuitive behavior can be understood by noticing that our error metric in Eq. (25) measures the error in a pointwise fashion: a very narrow but tall peak in the energy spectrum will contribute to the error even if its spectral weight is small. For specific applications, like the calculation of energy histograms presented in Ref. [4], better bounds could be obtained. We leave this development for future work.

Finally we note that all the results presented in this work depend on an arbitrary energy scale \(\varOmega \) which controls the energy dimension of the final error. An appropriate choice for this parameter depends on the specific physical application desired. For example, in applications where one is interested in obtaining histograms of the spectrum like in Ref. [4], the choice \(\varOmega =\varDelta \) seems appropriate.

3 Numerical examples

In this section we present some numerical experiments that show in practice the savings afforded by the method presented here. In order to show the general trend, we will employ two simple model response functions \(S_A(\omega )\) and \(S_B(\omega )\). In both cases we produce a peak at low frequencies according to a skewed Gaussian distribution

$$\begin{aligned} S_{peak}(\omega ) = \frac{1}{\beta \sqrt{2\pi }}\exp {\frac{-(\omega -\xi )^2}{2\beta ^2}}\left( 1+\text {erf}\left( \frac{\alpha (\omega - \xi )}{\sqrt{2}\beta }\right) \right) ,\nonumber \\ \end{aligned}$$
(35)

where \( \xi \) is the location of the peak, \( \beta \) is the scale of the distribution and \( \alpha \) the skewedness. In order to explore the impact of a tail at high energies we also use

$$\begin{aligned} S_{tail}(\omega ) = \left\{ \begin{array}{ll} 0&{}\text {for}\;\;\omega <\omega _{thr}\\ \lambda \rho \left( \left| \omega -\omega _{thr}\right| ^\gamma +\rho \right) ^{-1}&{}\text {for}\;\;\omega \ge \omega _{thr} \end{array}\right. \end{aligned}$$
(36)

Here \(\lambda \) is an overall normalization, \(\rho \) sets the scale and \(\gamma \) the exponent of a power-law decaying tail.

In the numerical tests shown here we took \(\Vert {\hat{H}}\Vert =1\) and 512 eigenvalues \(\{\omega _k\}\) distributed over the whole spectrum. The two model response functions we consider are

$$\begin{aligned} S_A(\omega )= & {} \sum _{k} \frac{S_{peak}(\omega _k)}{\sum _k S_{peak}(\omega _k)}\delta (\omega -\omega _k)\nonumber \\ S_B(\omega )= & {} \sum _{k} \frac{S_{peak}(\omega _k)+S_{tail}(\omega _k)}{\sum _k\left( S_{peak}(\omega _k)+S_{tail}(\omega _k)\right) }\delta (\omega -\omega _k)\nonumber \\ \end{aligned}$$
(37)

where the normalization in the denominators is chosen in order to guarantee that \(\mu _0=1\) for both response functions. The parameters for the response functions are

$$\begin{aligned} \xi =\omega _{thr}=-0.95\;\;\alpha =5\;\;\beta =0.05\;\;\lambda =1\;\;\rho =0.002.\nonumber \\ \end{aligned}$$
(38)

We show the two model response function in Fig. 1. The main panel shows \(S_A(\omega )\) and \(S_B(\omega )\) over the entire frequency range, the presence of the tail in \(S_B(\omega )\) is easily seen. In the inset we show instead the two response function in linear scale for the energy range of interest \([-1,-0.8]\), corresponding to the choice \(\delta \nu =0.2\). In this range the two responses appear almost identical. In the figure we also report the obtained values for the mean \(\mu \equiv \mu _1\) and the square root of the variance \(\sigma \) for the two models

$$\begin{aligned} \mu ^A= & {} -0.911\quad \quad \sigma ^A=0.031\nonumber \\ \mu ^B= & {} -0.907\quad \quad \sigma ^B=0.067 \end{aligned}$$
(39)

The presence of the high-frequency tail does not modify appreciably the mean value while the variance is increased by more then a factor of two.

Fig. 1
figure 1

The two model response functions shown as a function of frequency: black dots are for \(S_A(\omega )\) while red squares for \(S_B(\omega )\). The inset shows the same responses but on a narrower range and with linear scale. Also indicated are the mean \(\mu \) and the square root of the variance \(\sigma \) for both distributions

Due to the presence of delta function peaks, which are generated by the discreteness of the spectrum of a finite matrix, in general we cannot directly compare the integral transform \(\varPhi \) with the originating response function \(S(\omega )\) since the normalization conventions are different. For the discrete response function we have

$$\begin{aligned} \int \nolimits _{-1}^1d\omega S(\omega ) = \sum _{k}S(\omega _k)=1, \end{aligned}$$
(40)

while for the continuous integral transform instead

$$\begin{aligned} \int \nolimits _{-1}^1d\omega \varPhi (\omega ) = 1. \end{aligned}$$
(41)

In order to directly compare the two, we approximate the integral over frequencies with the finite difference

$$\begin{aligned} \int \nolimits _{-1}^1d\omega \varPhi (\omega ) \approx \delta \omega \sum _{n=0}^{2/\delta \omega }\varPhi \left( n\delta \omega -1\right) , \end{aligned}$$
(42)

and choose \(\delta \omega =2/512\) in order to match the average spacing between the eigenvalues. In the following we will then consider the dimensionless quantity \(\delta \omega \varPhi \) which implies the choice \(\varOmega =\delta \omega \) for the energy scale of the error. We further choose the parameters of the integral kernel as

$$\begin{aligned} \varDelta = 0.02\quad \quad \varSigma =0.01. \end{aligned}$$
(43)
Fig. 2
figure 2

Comparison between the model response function \(S_A(\omega )\) and \(S_B(\omega )\) (black dots and red squares respectively) with their rescaled integral transforms \(\delta \omega \varPhi _A(\omega )\) and \(\delta \omega \varPhi _B(\omega )\) (green solid line and turquoise dotted line respectively). The inset shows the same curves but over the full energy range

Figure 2 shows a comparison between \(S_A(\omega )\) and \(S_B(\omega )\) with their rescaled integral transforms \(\delta \omega \varPhi _A(\omega )\) (shown as a solid green curve) and \(\delta \omega \varPhi _B(\omega )\) (shown as a dotted turquoise curve). We can clearly see that the rescaling described above allows us to compare them directly.

Since the truncation error \(\epsilon _N\) and the sampling error \(\epsilon _S\) are more standard and the bounds described in this work are not novel, we concentrate in the following in the analysis of the systematic error \(\epsilon _P\) coming from the need to perform a periodic extension of the integral kernel.

Fig. 3
figure 3

Comparison between the ideal (scaled) integral transforms \(\delta \omega \varPhi _B(\omega )\) (turquoise solid lines) and different periodic extensions. The bottom panel shows the approximation obtained using P for a generic response denoted as \(\delta \omega \varPhi ^\chi _B(\omega )\) (blue dotted line) while the top panel shows the approximation obtained with a smaller P found using the known energy variance \(\sigma ^2\) and denoted as \([\sigma ]\;\delta \omega \varPhi ^\chi _B(\omega )\) (brown solid line). The shaded grey areas are energies outside the interval \([\nu _{\min },\nu _{\max }]\)

We present in Fig. 3 a direct comparison between the ideal (scaled) integral transform \(\delta \omega \varPhi _B(\omega )\) for model B (turquoise solid lines) with the approximations obtained by applying a periodic extension to the integral kernel with different choices of periods P (cf. Eq. (11) above). In all cases we set \(\varepsilon _P=0.01\) for the target error. The approximation in the bottom panel, denoted \(\delta \omega \varPhi _B(\omega )\) (blue dotted line), is obtained using the conservative choice from Eq. (28) which is valid in general. We see clearly that the effect is to push the replicas outside the whole range of the Hamiltonian, which in our case is \([-1,1]\), and therefore no appreciable change affects the transform in the required energy range \([\nu _{\min },\nu _{\max }]=[-1,0.8]\): the maximum observed deviation is \(\approx 10^{-8}\). To highlight the location of this energy range, we have shaded in grey the region of energies outside of it. Also, for ease of visualization, we have presented results in a larger range of energies in order to be able to see where the replicas are located. The top panel shows instead the periodic extensions obtained using the improved bound on P obtained in this work which uses directly prior information about the first and second energy moment. It is apparent that now the integral transform outside the energy window of interest is severely distorted due to the presence of the periodic replicas. However, inside the required region, the maximum deviations are well below the value \(\epsilon _P=0.01\) chosen as target: we observe in fact an error \(\approx 10^{-4}\). Very similar results have been observed for the approximations of the integral transform of model A. Before analyzing the relationship between target error and the empirically observed deviation, we want to point out the the reduction in the value of the period are

$$\begin{aligned} \frac{P^\sigma _A}{P^{gen}}\approx 0.111\quad \quad \frac{P^\sigma _B}{P^{gen}}\approx 0.14, \end{aligned}$$
(44)

for the two model responses respectively. Here we denoted by \(P^{gen}\) the value obtained without information about the energy moments and with \(P^\sigma \) the value obtained using the knowledge of the energy variance. In terms of the required number of moments to guarantee a total approximation error less than \(\varepsilon _P+\varepsilon _N=0.02\) we find using Eq. (26)

$$\begin{aligned} N^{gen} = 218\quad \quad N_A^{\sigma } = 25\quad \quad N_B^{\sigma } = 31. \end{aligned}$$
(45)
Fig. 4
figure 4

The top panel shows, as a function of the target error, the fractional reduction in the period from the genera case value \(P=P^{gen}\) obtained using information about the energy variance: the green line shows \(P^{\sigma }_A/P\) for model A while the turquoise is \(P^{\sigma }_B/P\) for model B. The bottom panel shows the observed approximation error for the two models as a function of the target error: the green line for model A and the turquoise line for model B. The solid black line represents the best error bound we derived for this approximation (see Appendix A.2)

In order to better understand the above observation that the measured error seems to be much smaller than the target one, which employs a possibly not tight bound on the error, we present in Fig. 4 an analysis of the scaling of the empirical error with the one set as target. The bottom panel shows how the approximation error in the scaled integral transform changes as a function of the target error for the cases where we use the improved estimate for the period \(P^\sigma \) which uses the energy variance. The solid black line shows the upper-bound employed to control the error while the solid green line and solid turquoise line show the observed maximum errors for both models respectively. We can see that, as expected, the real error is always below the bound we use but that the two models show a very different scaling for small target errors: the integral transform of model A has an error which decreases super-polynomially with target error while for model B the bound is saturated for small enough values of target error. We can understand this behavior in terms of the high-energy tail of the original response functions: as can be seen from the inset of Fig. 2 the response function for model B is dominated by the slowly decaying tail for energies outside the range of interest \([\nu _{\min },\nu _{\max }]=[-1,-0.8]\) while the strength of model A decays much faster. Once the target error becomes comparable to the strength in the tail of model B then one is forced to consider \(P^\sigma = P^{gen}\) as for a general response. On the other hand, for model A as soon as the value of \(P^\sigma \) exceeds the range of frequencies of interest than the error decays quickly following the strength of the response. These results show very clearly the important effect produced by slowly decaying tails in the response function and how their presence is automatically captured by the tail bounds employed in this work. The observation that the error bound is essentially saturated for small errors in model B suggests that it is unlikely to be possible to considerably improve our estimate for the optimal period \(P^\sigma \) in general. Finally, for not too small values of the target error \(\gtrapprox 10^{-3}\) our error bound overestimated the real error by more than an order of magnitude. In this regime it is possible that improved estimates using higher central moments [cf. Eqs. (34) and (93)] would be able to increase the savings in computational cost even further.

We have also performed numerical tests on more complex spectral densities, with multiple peaks of varying widths and heights, and obtained comparable results. This is to be expected since the relevant properties of the response function are its energy moments which, together with the required energy resolution, control the efficiency of the approach presented in this work.

4 Conclusions

In this work we have extended the Gaussian Integral Transform method [3] by employing a Fourier basis for the polynomial expansion of the integral transform of the spectral density. This replaces the need to estimate Chebyshev moments of the Hamiltonian with analogous Fourier moments that can be evaluated as expectation values of the real-time evolution operator \(\exp (-it{\hat{H}})\) (cf. Eq. (15)). Importantly, evaluation of both of these moments can be achieved efficiently using existing quantum algorithms. The main advantage of employing a Fourier basis is the possibility of using prior information about the spectral density, in the form of its first few energy moments, to reduce the number of observables needed for an accurate reconstruction of the spectrum. Most of our derivation and numerical examples are focused on the reasonable assumption that only the mean and variance of the energy spectrum are available to the user but we also provide improved bounds in case more moments are available.

The technique presented here can allow for orders of magnitude speed-ups in the evaluation of the spectral density. In order to give some concrete examples in nuclear physics, we take the Hamiltonian derived from Lattice EFT and used in previous cost estimates for quantum computations of the response function (see [31]) to model a medium mass nucleus with \(A=40\). As a first example we consider a calculation of the dipole response of \(^{40}Ca\) for excitation energies up to 100 MeV, with resolution \(\varDelta =1\) MeV, small tail contributions \(\varSigma =0.01\) and approximation error \(\varepsilon =0.01\) (we take \(\varOmega =\varDelta \) as scale). Using the experimental values from Ref. [34] (see also [35]) we estimate \(\mu ^{GT}_1\approx 20\) MeV and \(\sigma ^{GT}\approx 22\) MeV. With these values we find more than two orders of magnitude reduction in the number of moments required

$$\begin{aligned} N_{GT}^{gen}=42372\quad \quad N^\sigma _{GT}=339. \end{aligned}$$
(46)

As a second example we consider instead the simulation of longitudinal response in quasi-elastic electron-nucleus scattering at momentum transfer q. Typical values of the moments are \(\mu ^{QE}_1=q^2/2M\), with M the nucleon mass, and \(\sigma ^{QE}\approx k_F\approx 250\) MeV, with \(k_F\) the Fermi momentum [36, 37]. For a momentum transfer \(q=400\) MeV and a maximum excitation energy \(\delta \nu =400\) MeV we find

$$\begin{aligned} N_{QE}^{gen} = 42372\quad \quad N^\sigma _{QE}=838. \end{aligned}$$
(47)

An expected saving by a factor \(\approx 50\).

It is likely that for calculations in this regime the simple low-energy model used in Ref. [31] might not be suitable. Due to the expected increase in the Hamiltonian norm, we would expect a larger relative saving in number of moments in cases where higher resolution Hamiltonians with a larger momentum cut-off are employed.

Lastly, we want to comment on the fact that the total computational cost controlled by the maximum evolution time \(T=N\delta _t\) still scales as \({\mathcal {O}}(1/\varDelta )\) and we therefore have no violation of the no-fast-forwarding theorem [38]. Interestingly for Hamiltonians that can be fast-forwarded [38, 39] the computational cost is no longer bounded by T but by N instead. For applications like the reconstruction of the spectral function or the calculation of thermodynamic observables like in Ref. [27] this will be completely given by classical cost. One can also employ the construction presented here to prepare states in a given energy window by performing the summation in Eq. (12) (or more correctly it’s finite N approximation) coherently on a quantum device using the Linear Combination of Unitaries strategy [40]. This is similar to the energy filter proposed in Ref. [41] or the original GIT [3] (if used coherently) and the explicit appearance of the energy variance in our cost estimates can prove useful in reducing the cost for some situations. A similar procedure could be employed as a subroutine to the Verified Phase Estimation [42] in order to estimate general expectation values. We leave a more thorough exploration of these possibilities to future work on spectral filters.