Fully quantum training of parametric circuits with Quantum Hamiltonian Descent
Marco Burato, Leonardo Banchi
Marco Burato 1 and Leonardo Banchi 1,2
1Department of Physics and Astronomy, University of Florence, via G. Sansone 1, I-50019 Sesto Fiorentino (FI), Italy
2 INFN Sezione di Firenze, via G. Sansone 1, I-50019, Sesto Fiorentino (FI), Italy
Parametric quantum circuits are usually trained by classical, local optimizers, which use the quantum computer only to evaluate the cost function, or its gradient, one point at a time. Quantum Hamiltonian Descent (QHD) takes a different route: in this quantum algorithm for continuous optimization, the parameters become the position of a quantum particle, with the cost function as its potential, and two time schedules control kinetic and potential energy so that the wavefunction explores the whole landscape and tunnels towards the global minimum. QHD, however, assumes a classically computable cost function, and its digital implementation is poorly understood: standard error bounds grow exponentially with the number of qubits per parameter, and the schedules are borrowed from classical optimization. Here we propose to train parametric circuits with QHD entirely on the quantum computer, through an online step in which the qubits encoding the parameters coherently control the circuit on a second register. We prove that, for cost functions with a smooth periodic extension, including those of parametric circuits, the simulation error admits a bound independent of the grid resolution, and that for circuits the bound grows at most linearly with the number of parameters. We also show that the ideal dynamics depends on the two schedules only through a single curve, which controls the adiabaticity of the search, and that the remaining freedom can be used to minimize the gate count. Simulations on benchmark functions and parametric circuits show that, at equal cost, schedules designed in this way markedly increase the probability of finding the global minimum.
1 Introduction
Training a parametric quantum circuit is a non-convex optimization problem. In variational quantum algorithms and quantum machine learning models [1, 2, 3], a cost function f(x), typically the expectation value of an observable on a state prepared by a circuit with rotation angles x, is minimized by a classical optimizer, with gradients estimated from measurements through the parameter-shift rule [4, 5, 6, 7]. The resulting landscapes are rugged, with many local minima [8] and narrow gorges [9], and in large circuits they may flatten into barren plateaus [10]. Therefore, the success of gradient-based optimizers is
Leonardo Banchi: leonardo.banchi@unifi.it often limited. Moreover, the quantum computer is only used to evaluate f and its gradient at one point at a time, while the optimization itself is entirely classical. Gradient descent is the de facto standard in training deep neural networks thanks to the backpropagation algorithm, but getting backpropagation-like scaling in the quantum setting is challenged by the destructive nature of quantum measurements [11]. Several proposals have explored alternative hybrid quantum-classical training schemes [12, 13], or the use of quantum resources in the optimization itself, for instance through quantum algorithms for gradient-based methods [14, 15].
Quantum Hamiltonian Descent (QHD) [16] takes a different route. Building on the variational formulation of accelerated gradient methods in terms of a Bregman Lagrangian [17], QHD quantizes the corresponding classical dynamics: the optimization variables become the position of a quantum particle, whose wavefunction evolves under a Hamiltonian H^(t)=a(t)p^2/2+b(t)f(x^), in which the kinetic term is gradually switched off and the cost function is switched on as a potential. Starting from a uniform superposition over the domain, the state explores the whole landscape at once, can tunnel through barriers between valleys, and, if the evolution is slow enough, ends up concentrated around the global minimum, as in adiabatic quantum computation [18]. QHD has been reported to compare favorably with classical solvers on a variety of non-convex benchmarks [16], and has been extended to non-smooth problems [19].
Two questions are central to implementing QHD on a digital quantum computer. The first one concerns the cost and the accuracy of the simulation, and arises regardless of whether we are optimizing “classical functions” or parametric quantum circuits. The parameters are discretized on a grid of 2q points per dimension, encoded in q qubits, and the evolution is simulated with spectral methods [20] and product formulas. The error of a product formula is controlled by the commutator between the kinetic and potential terms, which contains the momentum operator: its norm grows with the grid resolution, so that standard bounds, based on operator norms, would predict an error growing exponentially with q. Moreover, QHD depends on two time schedules, a(t) and b(t), which have so far been borrowed directly from classical optimization algorithms [16], rather than designed on the basis of the cost of the simulation or of the structure of the landscape. The second question concerns the cost function. In the original formulation f is assumed to be known and efficiently computable on a classical computer, so that the potential step can be implemented by reversible arithmetic. When f is defined by a parametric quantum circuit, instead, it is only accessible through measurements, and estimating it on the whole grid would require a number of circuit evaluations exponential in the total number of qubits.
In this work we propose to use QHD to train parametric quantum circuits, running the whole optimization on the quantum computer, and we address both questions. We simulate QHD in the interaction picture of the kinetic term [21], which is integrated exactly with quantum Fourier transforms, and Trotterize the rotated potential. We prove that, for cost functions whose periodic extension is sufficiently smooth, the resulting error bound does not grow with q. The reason is that the error depends on the momentum of the actual state, not on the largest momentum of the grid, and the kinetic energy of the state stays bounded independently of the grid, as long as the ratio r=b/a of the schedules is non-decreasing. Generalizing a change of variables of Ref. [19], we then observe that, in terms of the kinetic time τ(t)=∫0ta(t′)dt′, the ideal dynamics depends on the schedules only through the curve r(τ), and that the remaining freedom, a gauge, can be used to minimize the number of Trotter steps at fixed error bound. This separates the design of the schedules into two independent problems: the choice of the curve, which determines the outcome of the algorithm and should spend kinetic time in the search window where tunneling between the valleys decides the success probability, and the choice of the gauge, which determines the gate count.
For cost functions defined by parametric circuits, which we call “quantum functions”, we introduce an online implementation of the potential step. The register on which QHD is simulated, which encodes the parameters, controls the parametric rotations of the circuit, which acts on a second register that is reset after each step; in this way, the phases e−iφf(x^) of the potential step are applied without ever estimating f. The error of this step amounts to a loss of coherence in the position basis, with a bound that depends neither on q nor on the number of parameters d. Since quantum functions built from Pauli rotations are trigonometric polynomials, the Trotter error bound also becomes explicit, and grows at most linearly with d. The idea of replacing the parameters of a quantum circuit with a quantum register goes back at least to Ref. [22], where a program state is optimized so that the circuit simulates a target quantum channel [23]. There, however, the optimization over the program state was carried out classically, whereas here the parameter register itself evolves under the QHD dynamics.
The paper is organized as follows. In section 2, after reviewing QHD and its convergence properties, we describe its digital simulation, the error bound, the reparametrization of time and the choice of the schedules. In section 3 we test the method on standard benchmark functions for global optimization, and in section 4 we introduce the online procedure for quantum functions, whose numerical results are presented in section 4.2. We conclude in section 5. Proofs and technical details are collected in the appendices.
2 Quantum Hamiltonian Descent
QHD arises from the “quantization” of the Bregman Lagrangian formalism, which is a classical method for finding the minimum x∗ of a function f(x); in fact, several classical algorithms for the minimization of functions can be interpreted as time-discrete versions of dynamical systems governed by a suitable Bregman Lagrangian [16, 17].
Let χ⊆Rd be the domain of the function f whose minimum we want to find, and let h:χ→R be a convex and differentiable function through which we define the Bregman divergence:
Dh(x,y):=h(x)−h(y)−∇h(y)⋅(x−y).(1)
After choosing the functions α(t), β(t), γ(t) so that they satisfy the ideal scaling conditions [17]β˙≤eα(t) and γ˙=eα(t), we can define the Bregman Lagrangian:
One can prove that the dynamics of the system associated with this Lagrangian converges to the solution x∗ if the function f is convex; in this case, denoting by x(t) the trajectory identified by the Euler–Lagrange equations, we have:
f(x(t))−f(x∗)≤O(e−β(t)).(3)
Choosing the simplest convex function h(x)=21∣x∣2=21∑i=1dxi2, we obtain the following Bregman Lagrangian:
This choice of h(x) leads us back to a typical physical system, simplifies the derivation of the Hamiltonian, and will make its implementation through quantum gates easier. By performing the Legendre transform of this Bregman Lagrangian, we obtain the corresponding Hamiltonian:
H(x,p,t)=eα(t)−γ(t)2∣p∣2+eα(t)+β(t)+γ(t)f(x).(5)
The QHD Hamiltonian directly follows by applying canonical quantization or, alternatively, Feynman’s path integral method [16, App. A.2]:
H^(t)=a(t)2p^2+b(t)f(x^),(6)
where we use the “hat” symbol to denote operators and we have defined the time schedules
a(t):=eα(t)−γ(t),b(t):=eα(t)+β(t)+γ(t),(7)
which govern the relative importance of the kinetic and potential terms. On top of the convergence for convex problems, the following result has been proved for optimizing general functions through QHD [16].
Theorem 1 (Global convergence). Assume that the following conditions hold:
Conditions on the function. Let f be continuous, with f∈C2 in a neighborhood of the unique global minimizer x∗, and assume that f(x)→+∞ for ∣x∣→∞. We denote by
fq(x)=f(x∗)+21(x−x∗)⋅∂x∂x∂2f⋅(x−x∗)(8)
the quadratic approximation of f in a neighborhood of the global minimum.
Conditions on the Hamiltonian.
• The QHD Hamiltonian varies “slowly” in time (see appendix A and eq. (54), and appendix D.2 and eq. (132)).
• There are no energy-level crossings for t > 0.
• The time schedules are such that
t→∞limb(t)a(t)=0.
For sufficiently long times, when a(t)≪b(t), the first N eigenstates of the QHD Hamiltonian can be approximated by the first N eigenstates of the quadratic Hamiltonian
H^q(t)=a(t)T^0+b(t)fq(x^),
with T^0:=p^2/2 the kinetic operator.
Conditions on the state. The initial state must belong to the subspace spanned by the first N eigenstates of the QHD Hamiltonian. The evolution of the state is governed by the QHD Hamiltonian.
Then,
t→∞lim⟨ψ(t)∣f(x^)∣ψ(t)⟩=f(x∗).
The general idea of the proof is rather simple: one applies the adiabatic approximation to show that the state always remains in the subspace spanned by the first N instantaneous eigenstates of the Hamiltonian. Since, for sufficiently long times, the QHD Hamiltonian is approximated by H^q(t), which describes a system confined in an increasingly tight potential well localized around x∗, the probability of measuring the system at that position tends to 1. In particular, for a d-dimensional domain, one proves that
∣⟨ψ(t)∣f(x^)∣ψ(t)⟩−f(x∗)∣≤4dN3ωb(t)a(t)→0,(9)
where ω=maxi∣ωi∣ and ωi2 denote the eigenvalues of the Hessian matrix of f evaluated at the global minimizer. In appendix A we extend the one-dimensional proof of [16, App. B.2] to d dimensions.
2.1 Simulation of QHD on digital quantum computers
In order to make use of the QHD method for optimizing real problems with digital quantum computers, we need to transform it into the QHD algorithm via space and time discretizations. For the space discretization, we restrict the domain of f to a hypercube x0+[0,L)d of side L, which should contain the global minimum, and we sample each coordinate on a uniform grid of 2q points with spacing L/2q, encoded in q qubits. We thus use a total of dq qubits and a grid of 2dq points xr, and we assign each point to a state ∣xr⟩ of the computational basis. Then, through the Fourier spectral method [20], we approximate the QHD Hamiltonian in the continuous space with the following Hamiltonian on the Hilbert space of the qubits:
The approximation error typically decreases exponentially with the number of points along each dimension, so it is often negligible.
Having space-discretized the QHD Hamiltonian, we now decompose the evolution operator into a sequence of quantum gates. We consider the simplest product formula, with a single potential step per time step. To this end, we describe the evolution in the interaction picture with respect to the kinetic term [21], so that the kinetic part of the Hamiltonian is integrated exactly. Denoting by T^0:=2p^2=F^sL^F^s† the discretized kinetic operator and by A(t)=∫0ta(s)ds the kinetic time, the exact evolution operator factorizes as
(15) so that only the interaction-picture Hamiltonian H^I(t), i.e. the potential rotated by the free evolution, has to be time-discretized. We Trotterize this evolution by splitting [0,T] into R intervals Ij of length Δt=T/R and replacing H^I(t) in each of them with its value at a sampling point tj∈Ij. We write this first-order approximation as
for j=1,…,R, with t0:=0 and tR+1:=T. The algorithm is thus specified by the kinetic angles αj=A(tj+1)−A(tj) and the potential angles φj=b(tj)Δt. The first kinetic step T^(t0) acts trivially on the usual initial state, i.e. the uniform superposition of all computational-basis states, which is the zero-momentum eigenvector, so the algorithm starts with the potential step V^(t1).
In appendix B we bound the error of this decomposition on the actual trajectory, up to an irrelevant global phase. The following bound is first-order in Δt and holds for every time-sampling scheme, even though with midpoint sampling this is a second-order method [24]. We find, see eqs. (122), (124) and (125),
where a=a(t) and b=b(t) in the integral, and osc(f):=maxf−minf is the oscillation of the cost function over the domain. The coefficients c1 and c2 depend only on the cost function and on the grid, not on the schedules. For a generic f, they are proportional to Fourier sums of the discretized cost function, whose dependence on q is set by the regularity of the periodic extension F of f from the domain, and which can grow even exponentially with q if F is discontinuous, see eq. (123) and table 3 in appendix B. If, instead, F is sufficiently smooth, c1 and c2 are bounded independently of q and, for large q, they reduce to
c1≃212osc(f)max∣∇F∣,c2≃41max∣ΔF∣,(19)
i.e. to the maxima of the gradient and of the Laplacian that appear in eq. (20) below, see eq. (124). That, for sufficiently smooth cost functions, the error does not grow with q is not obvious: the error of a first-order product formula is controlled by the commutator between the two terms of the Hamiltonian, which, in the continuum, reads
[2p^2,f(x^)]=−i∇f(x^)⋅p^−21Δf(x^).(20)
The first term contains the momentum operator, which is unbounded in the continuum and, on the grid, has eigenvalues up to π2q/L: a standard bound based on the operator norm of this commutator would give an error growing exponentially with the number of qubits q. The analysis of appendix B avoids this problem in three steps: (i) we move to the interaction picture with respect to the kinetic term, which is integrated exactly, so that only the rotated potential H^I(t) of eq. (15) is Trotterized; (ii) by a telescoping sum the error of each step is written as H^I(s)−H^I(tj) acting on the exact state at time s, so we never need the operator norm of the commutator, but only its action on the exact state ∣ψ(s)⟩. By eq. (20), this is controlled by the momentum spread ∥p^∣ψ(s)⟩∥ of the actual state, rather than by the largest momentum of the grid. Finally, (iii) we show that, if the initial state has zero momentum and r=b/a is non-decreasing, then ⟨ψ(t)T^0ψ(t)⟩≤osc(f)r(t) at all times, for every q. Intuitively, in kinetic time the energy of the system, with the potential shifted to r(f−minf)≥0, changes only through the time dependence of r, at the rate dτdr⟨f−minf⟩≤dτdrosc(f) if r is non-decreasing. The energy supplied up to τ cannot exceed r(τ)osc(f). The momentum scale 2q of the grid is thus replaced by the intrinsic scale osc(f)r.
To obtain this result, the main hypotheses are therefore that ∣ψ(0)⟩ is the uniform superposition, that b and r=b/a are non-decreasing, and that the cost function f extends to a sufficiently smooth periodic function on the domain, so that the gradient and the Laplacian in eq. (20) are bounded also on the grid. 1 In eq. (18), the schedules enter only through b(T)−b(0) and through the integrals of ab and ab3. The dependence on d, instead, is contained in osc(f), c1 and c2, i.e. it is set by the features of the cost function, such as its oscillation and the maxima of its gradient and Laplacian: for a generic f, our bound gives no explicit information on the dependence on d.
For the quantum functions of section 4, the dependence on the gradient and the Laplacian of f can be removed, and our bound becomes linear in d. These functions are trigonometric polynomials of period 2π and degree at most ν in each variable [25], ν being the maximum number of rotation gates that depend on the same parameter. Hence, multiplication by f shifts the momentum of the state by at most ν along each direction, with amplitudes bounded by osc(f)/2 (proposition 3): f itself cannot generate high-momentum components, and the commutator eq. (20) is controlled by osc(f), ν and the momentum spread of the state only. The coefficients of eq. (18) are then (see eq. (125))
for every q>log2ν+1, and osc(f) is at most twice the norm of the observable that defines the quantum function (see section 4). Thus the Trotter error for quantum cost functions is
ETrotter≤O(dRΔt2).(22)
This bound only relies on the trigonometric structure of quantum functions, and requires the domain to be a full period, [0,2π)d, as in the encoding eq. (42), and integer frequencies, as for Pauli rotations; otherwise, the periodic extension of f is discontinuous and the error bound acquires a dependence on q, which can even be exponential (see appendix B.4). When the potential step of a quantum function is implemented with the online procedure that we propose in section 4.1, an additional error, the online procedure error, is introduced.
Recent methods based on quantum signal processing and quantum singular value transformation [26, 27] can be used to significantly reduce the error in Hamiltonian simulation. However, their extension to time-dependent Hamiltonians [21, 28, 29, 30, 31, 32] is less
1The assumption on the initial state is not strictly necessary: the result still holds, with an additional term, for every initial state whose kinetic energy does not grow with the number of qubits q (see eq. (81)). Instead, discontinuities in the cost function or in its derivatives can make the error bound grow with q, even exponentially, because they can inject high-momentum components into the state. Nonetheless, if the wavefunction is sufficiently small where these discontinuities occur, in the actual error there is no observable dependence on q.
understood. Therefore, in this paper we focus on Suzuki–Trotter decompositions and leave the exploration of alternative methods to future work.
In appendix C we show that the kinetic step T^(tj) can be efficiently simulated with O(dq2) elementary gates. For classical functions, the potential step can be implemented efficiently with polynomial overhead when f(x) admits an efficient classical representation, e.g. using software packages like Bennett.jl [33]. Moreover, in section 4 we will show that the potential step can also be efficiently simulated, up to a controlled error, when dealing with quantum functions.
2.2 Time reparametrization and choice of the schedules
The two schedules are not independent parameters of the algorithm. Writing the Hamiltonian eq. (6) as H^(t)=a(t)[p^2/2+r(t)f(x^)] with r:=b/a, and using the kinetic time τ:=A(t)=∫0ta(s)ds, the Schrödinger equation becomes exactly [19, Sec. 4.1]
idτd∣ψ⟩=[2p^2+r(τ)f(x^)]∣ψ⟩,(23)
where, with the usual abuse of notation, r(τ):=r(t(τ))=b(t(τ))/a(t(τ)) is the ratio expressed as a function of kinetic time. The ideal dynamics depends on the schedules only through the curve r(τ), and the gauge a(t) only sets the speed at which the curve is run through in physical time; this freedom does not affect the result of the ideal algorithm, and we can use it to minimize the number of gates. We stress that the freedom in the gauge is a feature of the digital simulation: if QHD were run as an analog, continuous-time evolution, a(t) would be physical, since the energy scale of the hardware is bounded, and the gauge could not be chosen freely.
As for the gauge, we choose it in order to minimize the number of Trotter steps sufficient to guarantee, according to the bound eq. (18), an error ≤ε∗. With g(r):=c1r3/2+c2r, in appendix D.1 we show that the minimum
Rmin≃ε∗1(∫0τfg(r(τ))dτ)2(24)
is achieved if and only if ag(r) is constant along the curve. Thus, the optimal gauge is
a(t(τ))=g(r(τ))λ,(25)
where λ can be fixed arbitrarily due to the symmetry of the Trotterized evolution: under (a,b,t)→(λa,λb,t/λ) at fixed R, the angles αj=∫tjtj+1a(t)dt and φj=b(tj)Δt, and hence the error bound eq. (18), are unchanged (see eq. (139)).
As for the curve, we consider
r(τ)=r0ekτ.(26)
We discuss this choice and other details about the curve r(τ) in appendix D.2. In appendix D.3 we explain how to calculate the kinetic and potential angles needed for the Hamiltonian simulation eq. (16), given R and the set of parameters in r(τ).
The decoupling between curve and gauge is what makes the choice of the schedules a tractable problem. The curve is chosen on physical grounds, to keep the evolution adiabatic where the minima are searched for (appendix D.2), and different curves can be compared on the ideal dynamics alone. The gauge is then chosen to minimize the error of the simulation, without changing the result of the ideal algorithm. Which gauge is optimal depends on which error dominates: the gauge above minimizes the bound on the Trotter error, which is the relevant one when the potential steps are exact, as for classical functions, while for quantum functions the online procedure error of section 4.1 dominates and leads to a different gauge.
3 Optimization of Classical Functions
Before studying the optimization of “quantum functions”, namely functions estimated through measurements on quantum hardware, we start our analysis with the simpler problem of optimizing “classical functions” f:χ⊆Rd→R, by which we mean functions with an explicit analytical form that may arise in both classical and quantum contexts. The adjective “classical” is used here solely to distinguish them from those requiring quantum hardware for their evaluation. The functions under consideration are selected from a set of benchmark functions, available in the literature [34, 35, 36], featuring narrow valleys, broad plateaus, many nearly degenerate minima, etc., which make the search for the global minimum extremely challenging for many classical algorithms.
In order to benchmark the performance of QHD we define two quantities that allow us to assess the outcome of the simulations:
• success probability
Psuc(t):=x∈B∑p(x,t),(27)
where B is the “basin of attraction” of the global minimum, namely the set of points x in the domain for which following the steepest descent leads to the global-minimum point. We denote by p(x,t) the probability distribution of the state evaluated at time t and at the point x of the sampling grid 2:
p(x,t):=∣⟨x∣ψ(t)⟩∣2.(28)
In the simulations, after a phase in which the minima are searched for, the wavefunction evolves in an almost classical manner, that is, “tunneling” between the potential wells ceases and the success probability stabilizes around a definite value. If the global-search phase has already ended by time T, then Psuc(T) is an estimate of the probability with which the algorithm would return the global-minimum point if the measurement were performed at t→∞.
• coefficient E
E(t):=fˉ−f(x∗)⟨ψ(t)∣f(x^)∣ψ(t)⟩−f(x∗),(29)
where fˉ:=2−dq∑xf(x) is the average value of the function over the grid. The coefficient E is a normalized version of the expectation value bounded in eq. (9). In the exactly adiabatic case, this expectation value tends to f(x∗), i.e. E→0. The normalization is chosen so that E=1 for the uniform superposition, i.e. for the initial state, for which a measurement returns a point uniformly distributed over the whole domain, and hence a very poor estimate of the minimum point: values E≃1 indicate that the algorithm has made little progress. Conversely, when E≪1, the wavefunction is concentrated where the function f(x) takes its lowest values; this
2Although, for brevity, the notation may suggest a probability density, we emphasize that p(x,t) is a discrete distribution and ∣x⟩ is a computational-basis state of the qubit register.
is another measure of the success of the simulation, because collapse around local minima may also be a desirable outcome when such minima are nearly degenerate with the global minimum: in other words, identifying x′=x∗ is not necessarily a failure, provided that f(x′)≃f(x∗) and f(x′)≪fˉ.
Table 1: Final success probability Psuc and final coefficient E for the benchmark functions in d=1 and d=2, obtained with the same protocol for all functions and dimensions, in the native units of each function: q=8 qubits per dimension, curve r(τ)=r0ekτ of eq. (26) with rate k=0.1, from r0=10−4 to rf=102, i.e. τf≃138, run through in the optimal gauge a∝g(r)−1/2 of section 2.2, with c1 and c2 given by eq. (19) with the maxima of ∣∇f∣ and ∣Δf∣ over the domain, and R=215 Trotter steps. Each case is repeated with 2R steps as a check. Symbols: “/”, the function is defined only for d=2; †, non-negligible Trotterization error; ‡, incomplete convergence: Psuc and E are still changing at the end of the curve. Unmarked values are converged both in R and in r, so that Psuc<1 is due to the lack of adiabaticity of the evolution at the rate k.
d=1
d=2
Landscape
Function
Psuc
E
Psuc
E
Valley shaped
csendes†
1.00
0.029
1.00
0.029
alpine1
1.00
0.039
1.00
0.039
hosaki
/
/
1.00
0.047
camel13†
/
/
0.98
0.010
styblinski tang
0.89
0.049
0.79
0.049
Many minima
rastrigin†
1.00
0.053
1.00
0.053
ackley
1.00
0.086
1.00
0.11
alpine2
0.99
0.021
0.92
0.063
levy
0.97
0.011
0.91
0.018
levy13†‡
/
/
0.77
0.092
holder table†
/
/
0.75
0.24
bohachevsky2‡
/
/
0.74
0.074
shubert†
/
/
0.25
0.84
griewank
0.36
0.029
0.084
0.060
Narrow gorge
michalewicz
1.00
0.20
1.00
0.23
dropwave†
/
/
0.013
0.41
Barren plateau
easom
/
/
1.00
0.10
xin she yang3
0.30
0.46
0.055
0.65
In table 1 we report a summary of the final success probability and final coefficient E over all the functions considered. In fig. 1 we show the evolution of the state along the curve r(τ) for four functions in d=1: three successful cases (ackley, levy, rastrigin) and a failure (xin she yang3). In all cases the state is initially close to the uniform distribution, and nothing happens as long as rosc(f) is small compared with the kinetic excitation energy. In the search window, around r∼10−1−1, the probability flows through tunneling between the valleys of f and Psuc is decided: for ackley and rastrigin the whole state ends up in the valley of the global minimum, whereas for levy Psuc oscillates as the population is exchanged among several valleys, before freezing at 0.97. Beyond the search window, Psuc is frozen and QHD only refines the position within each valley: E decreases as E∞+cr−1/2, as expected from eq. (9), with E∞≃0 when the whole state is in the global basin. For xin she yang3, instead, the global minimum is a narrow well on a broad plateau, and only 30% of the probability enters it; the rest remains spread over the plateau and over the valleys at the boundaries of the domain, so that E saturates at E∞≃0.43. Since the results of table 1 without symbols are converged in the number of Trotter steps
Psuc
E
⋯⋯E∞+cr−1/2
Figure 1: Evolution of QHD along the curve r(τ) for four benchmark functions in d=1, with the protocol of table 1 ( R=215). In each panel, left: cost function f(x), with the basin of the global minimum shaded; top: probability distribution p(x) of the state as a function of log10r (power-law color scale, common to all panels); bottom: success probability Psuc (left axis) and coefficient E (right axis, logarithmic scale), with the least-squares fit E∞+cr−1/2 over 10≤r≤rf (dashed line).
and in r, a success probability Psuc<1 is due to the lack of adiabaticity of the evolution, i.e. to diabatic transitions between instantaneous eigenstates in the search window. From this perspective, improving QHD performance amounts to controlling diabatic transitions between eigenstates: this can be done by slowing down the curve r(τ) in the search window, at the cost of a larger number of Trotter steps.
The choice of the curve r(τ) discussed in section 2.2 and appendix D.2 is a direct way to control diabatic transitions at a given cost. In fig. 2 we compare our protocol with the schedules a(t)=2/(t3+10−3), b(t)=2t3, which follow from the choice α(t)=ln(2/t), β(t)=γ(t)=2lnt of [16, App. B.3], i.e. from the Bregman Lagrangian of the continuous-time limit of Nesterov's accelerated gradient method [17], with a regularized at t=0. Using alpine2 in d=1 as an example, the two simulations have the same cost, R=215 Trotter steps on q=8 qubits, and span the same range of r: we run the schedules of [16] up to T≃2.15, where r(T)=102=rf. Both are converged in the number of Trotter steps: with 2R steps, Psuc and E change by less than 3%. Therefore, the difference between the two panels is entirely due to the ideal dynamics eq. (23), i.e. to the curve r(τ), because by the decoupling of section 2.2 the gauge does not affect the result. With the schedules of [16], out of a total kinetic time τf=A(T)≃242, about 220 are spent at r<10−4, where nothing happens, and only Δτ≃3.6 in the interval 10−2≤r≤1, where Psuc is
Figure 2: Evolution of QHD for alpine2 in d=1 with two choices of the schedules, at the same number of qubits q=8 and Trotter steps R=215, and over the same range of r: (a) schedules a(t)=2/(t3+10−3), b(t)=2t3 of [16], with Trotter steps uniform in t, up to T≃2.15, where r=b/a reaches rf=102; (b) protocol of table 1, i.e. curve r(τ)=r0ekτ in the optimal gauge of section 2.2. Left: cost function f(x), with the basin of the global minimum shaded; top: probability distribution p(x) of the state as a function of log10r (power-law color scale, common to both panels); bottom: success probability Psuc (left axis) and coefficient E (right axis, logarithmic scale), with the least-squares fit E∞+cr−1/2 over 10≤r≤rf (dashed line).
decided; along the curve r(τ)=r0ekτ, the same interval takes Δτ=ln(102)/k≃46. As a consequence, in panel (a) the search window is crossed almost suddenly: the state is still close to the uniform distribution when tunneling between the valleys is suppressed, and Psuc=0.62 remains close to the weight 0.61 of the global basin in the uniform distribution, with E=0.23. In panel (b), instead, the probability flows into the valley of the global minimum, so that Psuc=0.99, E=0.021.
With schedules borrowed from classical optimization, the local minima retain a large fraction of the probability, and the remedy is to spend more kinetic time in the search window. For classical functions, this remedy has a moderate cost since the potential steps are exact and, with midpoint sampling, the Trotter error is of second order in Δt (appendix B): the same number of steps, R=215, is sufficient for both panels of fig. 2 and for the unmarked results of table 1, although the curve of panel (b) is much slower in the search window. The choice of the curve can thus be driven by the ideal dynamics alone. As we will see in section 4.1, this is no longer the case for quantum functions, whose potential steps are implemented approximately.
4 Optimization of Quantum Functions
We use the term “quantum function” to denote a function defined as
f(x):=⟨ψ(x)O^ψ(x)⟩,(30)
where the state ∣ψ(x)⟩=W^(x)∣0⟩⊗m is prepared by a parametric unitary W^(x) acting on m qubits initialized in ∣0⟩, and O^ is a Hermitian observable. Many problems involving parametric quantum circuits can be expressed in terms of the optimization of such functions [2].
To optimize a quantum function with QHD, we use two registers with distinct roles. The simulation register S is the one on which QHD is simulated, as in section 2.1, and whose measurement at the end of the algorithm gives an estimate of the minimizer x∗. It is made up of d sub-registers Sℓ of q qubits each, where d is the number of components of x=(x1,…,xd), and the computational basis of Sℓ encodes the possible values of xℓ with q bits of precision; the computational basis of the whole register, with dq qubits, is thus {∣xr⟩}r=02dq−1. The measure register M consists of the m qubits on which the circuit W^(x) acts, and on which O^ would be measured to estimate f in a standard variational algorithm. The quantum function is defined on this register, and, denoting by the subscript M its states and operators, we write
f(x)=⟨0MW^M†(x)O^MW^M(x)0M⟩.(31)
We assume that f(x) cannot be computed efficiently with classical hardware or by analytical techniques, due to the complexity of the preparation W^(x), the number of parameters and the nature of the observable O^. Moreover, estimating f through measurements at every point of the grid would require a number of circuit evaluations exponential in dq. Therefore, the potential step of section 2.1 cannot be implemented with reversible arithmetic, as for classical functions.
4.1 Online procedure
The idea behind the online procedure is to skip the phase of getting a classical description of the quantum function, i.e. its values on the grid or its analytical expression, and to directly apply the phases e−iφjf(x^) of the potential step during the quantum simulation. This is done by coupling the simulation register to the measure register, which acts as an ancilla, such that the reduced evolution on S is approximately equivalent to the ideal potential step. First, we note that
e−iH^ΔtρeiH^Δt=ρ−iΔt(H^ρ−ρH^)+O(Δt2).(32)
If the state of S+M is described by ρ=ρS⊗∣0M⟩⟨0M∣ and its evolution is guided by the Hamiltonian H^, then the first-order approximation of the state of S after a time step Δt is:
ρS′≃e−iH^SeffΔtρSeiH^SeffΔt,(33)
where we have defined the effective Hamiltonian on S as
H^Seff:=⟨0MH^SM0M⟩.(34)
In order for the evolution in eq. (33) to be the same as that in the ideal potential step, we require that H^Seff=b(t)f(x^). This is achieved by the following Hamiltonian on S+M:
H^SM(t)=b(t)W^SM†(I^S⊗O^M)W^SM,(35)
with
W^SM:=r∑∣xr⟩⟨xr∣S⊗W^M(xr).(36)
All in all, the online procedure implements (a first-order approximation in Δt of) the potential step as
e−iφjf(x^)≃⟨0MV^SM(tj)0M⟩,(37)
with φj=b(tj)Δt the potential angle of the step and
In order for this approximation to be valid, the state of the whole system before each potential step must be in the form
ρ=ρS⊗∣0M⟩⟨0M∣,(39)
and since the evolution will not generally leave the measure register in ∣0M⟩, this register must be reset to ∣0M⟩ between each potential step and the next.
The QHD algorithm implemented via the online procedure can be represented by circuit (40), where P^S is the preparation of the simulation register — typically a Hadamard gate on each qubit, to prepare the state in the uniform superposition of all computational-basis states — T^(tj) is the kinetic step, whose implementation is described in appendix C, and V^SM is the online potential step.
(40)
The potential block, defined in eq. (38), can be decomposed as in circuit (41). There, the operator W^SM of eq. (36) and its inverse are represented as gates on M controlled by S, since they apply W^M(xr) conditionally on the computational-basis state ∣xr⟩ of the simulation register, while the rotation e−iΔtb(t)O^M acts on the measure register only.
If W^(x) consists of a polynomial number of gates and O^ is, e.g., a Pauli string, so that e−iΔtb(t)O^M is a single multi-qubit Pauli rotation, the online potential step is implemented with a number of gates polynomial in m, d and q, as we now show.
Assume that W^(x) is constructed by composing a polynomial number of fixed (x-independent) entangling gates and single-qubit rotations R^n(x) about an axis n, where x∈[0,2π) is a component of x. Then W^SM from eq. (36) can be decomposed as a combination of fixed operations acting on M only and controlled rotations. As in section 2.1, x is discretized on a grid, here over the full period [0,2π), and encoded in the simulation register via computational basis states
Therefore, the j-th qubit of the simulation register controls the rotation by the angle 2q−j2π. Having explicitly characterized its action on a generic computational-basis state, by linearity circuit (44) shows how to implement the controlled rotations that appear in the controlled operator W^SM of circuit (41):
(44)
This circuit is readily generalizable to problems in arbitrary dimension d, where each rotation that depends on xℓ is controlled by the sub-register Sℓ: every parametric rotation of W^(x) is thus replaced by q controlled rotations, and W^SM requires O(q) times as many elementary gates as W^(x).
The approximation error in eq. (33) has a simple structure. The Kraus operators of the online step with potential angle φ, derived in eq. (141) of appendix E, are diagonal in the computational basis,
where ∣m⟩ runs over the computational basis of the measure register. Hence, the online step, i.e. the channel Φon(ρ)=∑mK^mρK^m†, acts on the matrix elements of the state ρ of the simulation register as
Since ∑m∣Km(xr)∣2=1 by unitarity, the factor in eq. (46) equals 1 for r=s and, by the Cauchy–Schwarz inequality, has modulus at most 1 for r=s: each online step leaves the populations of the grid points exactly unchanged and damps the coherences between them. The online procedure thus causes a loss of coherence, which the subsequent kinetic steps turn into an error on the populations, and hence on Psuc and E.
The error in eq. (33) is O(Δt2) per step, i.e. O(RΔt2) in total. More precisely, defining the online procedure error ϵonline as the trace distance between the final states of the online and of the unitary Trotterized evolutions, in appendix E we derive the following upper bound for the online procedure,
ϵonline≲j=1∑Rφj2=j=1∑R[b(tj)Δt]2,(47)
which does not show any dependence on d and q. The bound relies on an expansion to second order in the potential angles, so it requires φj≪1, and replaces the variance of O^ on the states ∣ψ(xr)⟩ by its upper bound O^2, which equals 1 for the Pauli strings considered here. For quantum functions, the error analysis of section 2.1 has therefore one additional ingredient, the online procedure error ϵonline of eq. (47). Combining, via the triangle inequality, the Trotter error eq. (18) and the online procedure error eq. (47), at first order in Δt, the QHD error via the online procedure, i.e. the trace distance between the final state of the online evolution and the exact (untrotterized) final state, is
(48) with c1 and c2 as in eq. (21). Equation (48) contains no dependence on q and an at most linear dependence on d. The two contributions have a different structure: the Trotter error depends on the cost function through the coefficients eq. (21), i.e. only through its trigonometric structure, and on both schedules, through the integrals of ab and ab3; instead, the online procedure error depends on the cost function only through O^, and on the schedules only through the potential angles φj=b(tj)Δt, i.e. it does not depend on the kinetic schedule a.
The gauge analysis of section 2.2 applies unchanged with g(r)↦g(r)+r2, where the last term comes from the online procedure error. This is always the leading contribution in our simulations, because with midpoint time sampling the Trotter error is second order in Δt (see appendix B), while the online procedure error is first order, ∑jφj2≃Δt∫0Tb2dt (eq. (144)). Hence, by the argument of appendix D.1 with g(r)=r2, the gauge that minimizes eq. (47) at fixed curve is a∝1/r, i.e. b is constant. In this gauge the cost length s(τ) of the curve eq. (26), defined in eq. (136) and proportional to the physical time t (see eq. (137)), is s(τ)=∫0τr(τ′)dτ′=[r(τ)−r0]/k. Thus the ratio r grows linearly in physical time, and the Trotter steps of appendix D.3 are uniform in r, with angles
All the potential angles are equal, and the bound eq. (47) becomes
ϵonline≲k2R(rf−r0)2.(50)
The (dominant) online procedure error decreases as 1/R, but it grows as 1/k2 and as rf2: improving the success probability with a slower curve requires a quadratically larger number of steps. Therefore, if QHD with the online procedure were used to refine the solution up to the large ratio rf fixed by the target accuracy δf through eq. (9), the cost would be dominated by the online simulation of the potential, since rf∝δf−2 and hence R∝δf−4: this supports the hybrid strategy of appendix D.2, in which QHD stops at a moderate rf (in section 4.2 we stop the curve at rf=10) and the solution is refined classically.
This is why the error analysis, together with the decoupling between curve and gauge, is essential for quantum functions. For classical functions, the potential steps are exact, and the schedules can be chosen by looking at the ideal dynamics alone (section 3). With the online procedure, instead, the ideal dynamics and the cost of the simulation compete: a slower curve (which increases Psuc) and a larger rf (which decreases E) both make the simulation more expensive. The error analysis turns this trade-off into a design rule: the curve, i.e. k and rf, is chosen on the basis of the ideal dynamics, which does not depend on the gauge and can be studied with exact potential steps, e.g. in classical simulations of small instances; the gauge, constant b, minimizes the dominant error without affecting the ideal dynamics. Finally, eq. (50) gives the number of steps R≃(rf−r0)2/(k2ε∗) sufficient for a target online procedure error ε∗, before the algorithm is run on quantum hardware.
4.2 Results
We test QHD with the online procedure of section 4.1 on five quantum functions. Their circuits, observables and analytic expressions are given in appendix F; the analytic expressions are only used to analyze the results, since the algorithm accesses f through the
Table 2: Final success probability Psuc and final coefficient E for the quantum functions of appendix F, obtained with the same protocol for all instances: curve r(τ)=r0ekτ of eq. (26) with k=0.1, from r0=10−4 to rf=10, run through in the gauge with constant b of section 4.1, and R=215 Trotter steps. Columns: d, number of parameters; q, qubits per parameter; m, qubits of the measure register; minima, number of local minima of f in [0,2π)d, with the global ones in parentheses. The Trotterized evolution with exact potential steps (exact phases) is compared with the online procedure. The results with exact phases are checked with 2R steps: Psuc and E change by less than 1%, so that the Trotter error is negligible. Symbols: ‡, Psuc is still changing at rf and reaches 1.00 at r=102.
Instance
exact phases
online
d
q
m
minima
Psuc
E
Psuc
E
Example 1
1
8
3
2 (1)
0.98
0.25
0.94
0.31
Example 2
1
8
3
3 (1)
0.99
0.28
0.94
0.33
Example 3
2
5
2
4 (2)
0.92
0.28
0.86
0.34
Example 4
2
5
3
9 (1)
0.83
0.32
0.74
0.39
Example 5‡
2
5
3
8 (4)
0.96
0.56
0.86
0.63
circuits. The online procedure is simulated exactly, by applying the channel eq. (46) to the density matrix of the simulation register.
In fig. 3 we report the evolution of the state along the curve and in table 2 the final success probability and coefficient E. With R=215, while the Trotter error is negligible, the online procedure error is not: the state evolved with the online procedure achieves lower success probabilities than the one evolved with exact phases, and E is correspondingly larger; according to eq. (50), the bound on this difference decreases as 1/R. As for classical functions, Psuc<1 is due to the lack of adiabaticity of the evolution at the rate k: the lowest value is found for Example 4, which has nine minima and the smallest basin of the global minimum; with a slower curve, k=0.03, the success probability with exact phases reaches at least 0.99 for Examples 1–4 (not shown). For Example 5, instead, the search is not over at rf: Psuc is still increasing at the end of the curve and reaches 1.00 at r=102 (not shown), while the probability is shared among the four degenerate global minima (fig. 3e). On the other hand, slower curves and longer evolutions heavily increase the online procedure error: by eq. (50), the curve with k=0.03 would require (0.1/0.03)2≃11 times more steps for the same bound, and continuing up to r=102 about 100 times more. This is why the values of E with exact phases, between 0.25 and 0.56, are generally larger than for classical functions of table 1: the curve has to stop at a moderate ratio (section 4.1), where the ground state is still wide within each valley.
4.3 Cost functions defined by datasets
In supervised quantum machine learning, the cost function is often an empirical average over a training set Z,
f(x)=∣Z∣1z∈Z∑ℓ(x,z),(51)
where each data point z, for instance an input together with its label, enters the circuit W^(x,z) through fixed gates that are known classically, and ℓ(x,z) is the corresponding loss. We have not studied this case, and here we only discuss how it fits into our framework.
The online procedure of section 4.1 applies to losses that are expectation values, ℓ(x,z)=⟨0∣W^†(x,z)O^zW^(x,z)∣0⟩, possibly with an observable O^z that depends on the label. Losses that are powers of expectation values, such as the squared loss, can be
(c) Example 3
(d) Example 4
(e) Example 5
Psuc
online
E
---- exact phases
global minima
local minima
boundary of the global basin
Figure 3: QHD with the online procedure on the quantum functions of table 2, with the same protocol. (a), (b) Examples 1 and 2 (d = 1), as in fig. 1: cost function f(x), with the basin of the global minimum shaded (left), and probability distribution of the state as a function of log10r (power-law color scale). (c)-(e) Examples 3–5 (d = 2): probability distribution of the final state, at r=rf, on the simulation grid (height), colored according to the value of f; stars and circles mark the global and local minima, and the black line the boundary of the basin of the global minimum. Bottom of each panel: success probability Psuc (left axis) and coefficient E (right axis, logarithmic scale) along the curve, with the online procedure (solid lines) and with exact phases (dashed lines).
brought to this form on several copies of the measure register, all controlled by the same simulation register, since ⟨O^⟩2=⟨O^⊗O^⟩ on two copies of the state.
The product-formula structure of our simulation makes the sum over the dataset natural. All the terms ℓ(x^,z) are diagonal in the computational basis of the simulation register and commute with each other, so that the potential step factorizes exactly,
e−iφjf(x^)=z∈Z∏e−iφjℓ(x^,z)/∣Z∣,(52)
and each factor can be implemented by an online step with the circuit W^(x,z), without additional Trotter error and without coherent access to the dataset. Processing the whole dataset in a single potential step multiplies by ∣Z∣ the number of online steps per potential step. However, since the online procedure error is quadratic in the angles, the bound eq. (47) decreases by the same factor, so that R can be reduced by ∣Z∣ at equal error, as long as the Trotter error does not become dominant. Alternatively, one can apply at each Trotter step the online step of a single data point zj with the full angle φj, as in stochastic gradient descent and in randomized Hamiltonian simulation [37]. If zj is drawn independently, at each step and in each run, from the distribution p(z)=1/∣Z∣, the statistics of the final measurement are determined by the channel averaged over zj, so that proposition 4 from appendix E applies with ∥∥δr⟩∥2 replaced by
Ez∥∣δz,r⟩∥2+Varzℓ(xr,z)≤zmaxO^z2,(53)
where ∣δz,r⟩ is the vector ∣δr⟩ of appendix E for the data point z. Hence, for Pauli strings, the bound eq. (47) holds unchanged, and the number of steps does not depend on ∣Z∣. This bound holds for the average over runs, each with a new sequence: in a single run, the R sampled data points reproduce p(z) only up to fluctuations of order R−1/2. The term Varzℓ describes a dephasing in the computational basis, of the same kind as that of the online procedure. An intermediate strategy uses at each Trotter step a minibatch of nb data points, each with angle φj/nb. The effects of the dephasing due to sampling on the dynamics, such as heating or an implicit regularization as in stochastic gradient descent, are left to future work, together with the study of optimal schedules.
5 Conclusions
We have studied the implementation of Quantum Hamiltonian Descent on digital quantum computers, and its application to the training of parametric quantum circuits, also called “quantum functions” here. On the simulation side, we have shown that the Trotterized evolution in the interaction picture of the kinetic term admits an error bound that, for cost functions with a sufficiently smooth periodic extension, does not grow with the number q of qubits per parameter, even though the norm of the momentum operator, and hence of the commutator that controls product formulas, grows exponentially with q. The key ingredient is a bound on the kinetic energy of the exact state, which holds for every cost function and every grid as long as the ratio r=b/a of the schedules is non-decreasing. For generic cost functions, the dependence of the error bound on q is set by the regularity of the periodic extension of f, while for quantum functions, which are trigonometric polynomials, the bound holds for every q and grows at most linearly with the number of parameters d. On the algorithmic side, the reparametrization of time in terms of kinetic time shows that QHD is determined by a single curve r(τ), and that the remaining gauge freedom can be fixed to minimize the number of Trotter steps. With a curve that spends kinetic time in the search window, rather than in the regions where nothing happens, the success probability improves substantially at equal cost, as we have shown for a standard benchmark function. For quantum functions, the online potential step makes QHD run entirely on the quantum computer: the cost function is never estimated classically, and the bound on the error of the step depends neither on q nor on d. Since this error is of first order in the time step, whereas the Trotter error is of second order with midpoint sampling, the online error dominates the gate count; this favors a hybrid strategy, in which QHD is used for the global search and the solution is then refined by a local optimizer.
Several directions remain open. Our bounds are first order in the time step and rely on a worst-case estimate of the kinetic energy, so that they are pessimistic; a second-order analysis, based on the same energy bound, should give tighter estimates. The online step can be replaced by a coherent implementation of e−iφf(x^): when O^ is a Pauli string, the operator W^SM†(I^S⊗O^M)W^SM, introduced with the online procedure, is a block encoding of f(x^), and quantum signal processing [26, 27] could implement the potential step without loss of coherence. Combined with the exact integration of the kinetic term in the interaction picture, which avoids any dependence of the cost on the norm of the momentum operator, this would retain the grid-independent error analysis presented here. Finally, the hardness of QHD resides in the search window, where the gaps of the Hamiltonian depend on the landscape: understanding how these gaps behave for the landscapes of parametric circuits, including those affected by barren plateaus, and comparing QHD with classical optimizers at equal number of circuit evaluations, are natural next steps.
Note added. After completing this work, we became aware of Ref. [38], which appeared on arXiv on 3 September 2026 and independently proposes to train parametric quantum circuits through a QHD-like Hamiltonian evolution of a quantum register encoding the parameters, with the loss function accessed through a coherent evaluation of the circuit over the parameter grid. The main ideas of the present work, in particular the coherent evaluation of quantum cost functions within QHD, were developed in the Master's thesis of one of us [39], defended on 23 April 2026. The two works are complementary: Ref. [38] constructs the loss Hamiltonian through block encodings and simulates the evolution by qubitization with an extra clock dimension, with applications to batched learning and parameter estimation, while a complete complexity analysis is left for future work. Here, on the other hand, we focus on error bounds for the Trotterized simulation that are independent of the grid resolution and at most linear in the number of parameters, on the design of the schedules, and on an online potential step that does not require block-encoding techniques, while the application to machine learning problems is left to future work.
A Proof of the Global Convergence Theorem
In this appendix we prove theorem 1, extending to d dimensions and to an anisotropic Hessian the one-dimensional proof of [16, App. B.2]. First, without loss of generality, we set f(x∗)=0. Since f is continuous and f(x)→+∞ for ∣x∣→∞, H^(t) has a compact resolvent, and hence a purely discrete spectrum, at any time. Let En(t) denote its eigenvalues and ∣nt⟩ its eigenvectors. We choose to represent the state of the system in the basis of the Hamiltonian eigenvectors:
By the assumptions of theorem 1 on the Hamiltonian, i.e. slow variation and no level crossings, we can invoke the adiabatic approximation and neglect the second term, which is responsible for the mixing between orthogonal eigenstates induced by the time dependence of the Hamiltonian. We observe that
In this way, we have shown that the amplitudes of the expansion coefficients of ∣ψ(t)⟩ in the instantaneous eigenbasis of the Hamiltonian do not change. Hence, the state remains constrained to the subspace generated by the first N eigenstates.
We now consider the expectation value of f(x^) on the state at sufficiently long times, for which the eigenstates of the QHD Hamiltonian, denoted by ∣nt⟩, can be approximated by those of H^q(t), denoted by ∣en(t)⟩. The approximation we use consists in replacing f(x^) by fq(x^)=b(t)V^q(t), where V^q(t)=b(t)fq(x^) is the potential in H^q(t); this approximation is valid because these operators are evaluated on harmonic-oscillator eigenstates, which are localized in a neighborhood of x∗ where f≃fq.
We denote by εm(t) the eigenvalues of the d-dimensional anisotropic harmonic oscillator of mass 1/a(t):
εm(t)=i=1∑da(t)b(t)ωi2(mi+21),(55)
where, as in section 2, ωi2 are the eigenvalues of the Hessian matrix of f evaluated at the global minimizer, and {m1,…,md} is the set of quantum numbers identifying the m-th energy level. Moreover, choosing m=0 as the index of the ground state, we have m≥max{mi}, and therefore, with ω=maxi∣ωi∣,
εm(t)≤dωa(t)b(t)(m+21).
We begin by upper-bounding the expectation value of interest, using the virial theorem ⟨em(t)V^qem(t)⟩=εm/2 and the triangle inequality:
We now use the consequences of the adiabaticity assumption: we can truncate the sums by considering only the eigenspace of the first N eigenstates. Within this eigenspace, we can upper-bound the expression by setting ∣cn(t)∣=1∀n<N, obtaining
In this appendix we prove the bounds on the Trotterization error stated in section 2.1. We first move to the interaction picture with respect to the kinetic term and, by a telescoping sum, write the error as a sum of single-step errors acting on the exact state: this reduces the problem to bounding the operator norm of f(x^) and the norm of the commutator [T^0,f(x^)] applied to the exact trajectory (appendix B.1). We then bound this commutator in three cases: generic cost functions (appendix B.2), cost functions with a smooth periodic extension (appendix B.3) and trigonometric polynomials, which include the quantum functions of section 4 (appendix B.4). In all cases, the key ingredient is a bound on the kinetic energy of the exact state (lemma 3), which replaces the largest momentum of the grid with the momentum spread of the actual state. Finally, we combine these results into the bound eq. (18) and give the explicit coefficients c1 and c2 (appendix B.5).
We make the following minimal hypotheses on the time schedules and on the initial state:
(H1) a(t) and b(t) are continuously differentiable on [0,T], with a(t)>0 and b(t)≥0;
(H2) b(t) is non-decreasing, i.e. b˙(t)≥0;
(H3) b(t)/a(t) is non-decreasing;
(H4) the initial state ∣ψ(0)⟩ is the uniform superposition of all computational-basis states, i.e. the zero-momentum eigenvector, so that T^0∣ψ(0)⟩=0.
These hypotheses are generally satisfied by sensible choices of the QHD schedules, such as those used in this work, for which a(t) decreases and b(t) does not decrease with time, and by the usual initial state of QHD. Hypotheses (H1) and (H2) enter the error decomposition, while (H1), (H3) and (H4) are used in lemma 3 to bound the kinetic energy of the exact state. For the refined bounds of propositions 2 and 3, we will also make assumptions on the regularity of the cost function, eq. (98), and on its Fourier spectrum, respectively.
B.1 Error decomposition
Let ∣ψ(t)⟩ be the exact trajectory generated by the space-discretized Hamiltonian eq. (10), which we write as H^(t)=a(t)T^0+b(t)f(x^), with T^0=p^2/2 the discretized kinetic operator of section 2.1:
We split the time interval [0,T] into R=T/Δt intervals Ij:=[(j−1)Δt,jΔt] and in each of them we approximate H^I(s) with its value at a sampling time tj∈Ij (e.g. the midpoint tj=(j−21)Δt). We denote by ∣ψ~(T)⟩ the final state of this Trotterized evolution:
where ∥⋅∥ is the norm induced by the scalar product, and the inequality follows from the choice θ=0 and from the unitarity of U^0(T). To evaluate the right-hand side, we also decompose U^I(T,0) into the product of R partial evolutions:
where we used the triangle inequality and the unitarity of the operators W^j, and we identified U^j−1⋯U^1∣ψ(0)⟩ with the exact state ∣ψI((j−1)Δt)⟩. With this ordering of the telescoping sum, each single-step error U^j−W^j acts on the exact state at the beginning of the step.
To compute εj, we use the following lemma.
Lemma 1. Let U^1(s) and U^2(s) be evolution operators defined by
where we used hypotheses (H1) and (H2), and A^:=sup∥χ∥=1A^∣χ⟩ denotes the operator norm. To complete the bound, we have to estimate two norms.
The first norm is the operator norm of f(x^), which is diagonal in the position basis, so that ∥f(x^)∥=maxr∣f(xr)∣. Shifting the cost function by a constant, f→f−c, multiplies both ∣ψ(T)⟩ and ∣ψ~(T)⟩ by global phases, which are absorbed by the minimization over θ in eq. (61), and does not change the commutator [T^0,f(x^)]. Therefore, ETrotter does not change either, and we can choose c=(maxf+minf)/2, so that
∥f(x^)∥=2maxf−minf=21osc(f),
(69) where maxf and minf are taken over the grid points and osc(f):=maxf−minf is the oscillation of the cost function. In general, this term depends only on the cost function, and not on the parameters d and q.
It remains to bound the norm [T^0,f(x^)]eiσT^0∣ψ(s)⟩, which depends on the class of the cost function. We bound it for generic cost functions in appendix B.2, for cost functions with a smooth periodic extension in appendix B.3, and for quantum functions in appendix B.4; the resulting error bounds are collected in appendix B.5.
B.2 Bounds for generic cost functions
We first bound the commutator acting on a generic vector (lemma 2) and the kinetic energy along the exact trajectory (lemma 3), and we then combine the two results.
We expand the cost function in a discrete Fourier series. Let N:=2q be the number of grid points along each dimension, and let us label the grid points by the multi-index r=(r1,…,rd)∈{0,…,N−1}d; then
such that S^k∣m⟩=∣m⊕k⟩, where ⊕ denotes the component-by-component sum modulo N, with values in KN. With these definitions, eq. (70) reads f(x^)=∑kf~kS^k.
Lemma 2. For every function g on the grid and every vector ∣χ⟩
where we used the triangle inequality on the sum over k and, in the last step, the fact that for fixed k the map m↦m⊕k is a bijection of KNd, so that the vectors ∣m⊕k⟩ are orthonormal. One easily verifies that
∣m⊕k∣2−∣m∣2≤ℓ=1∑d(2∣kℓ∣∣mℓ∣+∣kℓ∣2).(77)
We now observe that, given a vector v with components vm, m∈KNd, the quantity ∑m∣χm∣2vm2 is a (weighted ℓ2) norm, and therefore it satisfies the triangle inequality. Inserting eq. (77) into eq. (76), we thus obtain
where we used ∑m∣χm∣2=∥∣χ⟩∥ and, from eq. (72),
∥p^ℓ∣χ⟩∥2=(L2π)2m∑∣χm∣2∣mℓ∣2.(79)
We conclude by applying the Cauchy–Schwarz inequality to the d-component vectors with components ∣kℓ∣ and ∥p^ℓ∣χ⟩∥, which gives ∑ℓ∣kℓ∣∥p^ℓ∣χ⟩∥≤∣k∣∥p^∣χ⟩∥.
To control the norms of p^ appearing in eq. (74), we bound the kinetic energy along the exact trajectory. To this end, we define
where in the last step we used ∣w(0)⟩=T^0∣ψ(0)⟩+a(0)b(0)G^∣ψ(0)⟩. Multiplying by a(t) we obtain eq. (81). If T^0∣ψ(0)⟩=0, as guaranteed by hypothesis (H4), eq. (82) follows from G^≥0 and G^∣ψ⟩≤osc(f):
We now consider the vector ∣ϕ⟩:=eiσT^0∣ψ(s)⟩ appearing in eq. (68). Since eiσT^0 is diagonal in the momentum basis, ∣ϕ⟩ has the same momentum distribution as ∣ψ(s)⟩, and the first bound in eq. (82) gives, independently of σ,
Since the sums eq. (88) can be difficult to evaluate, we consider a continuum-space version of the error bound. This is useful since, in the continuum, the commutator is given by eq. (20),
[2p^2,f(x^)]=−i∇f(x^)⋅p^−21Δf(x^)
which, for well-behaved functions, can be bounded in terms of max∣∇f∣ and max∣Δf∣, without summing over the Fourier modes. On the grid, eq. (20) holds exactly as long as the momentum of the state plus the frequency of the cost function does not leave KNd, i.e. as long as m⊕k=m+k. We exploit this by splitting the low- and high-frequency components of f with a cutoff K. Let the grid points be xr=x0+rL/N, let ∥v∥∞:=maxℓ∣vℓ∣ denote the maximum norm of a vector v and, for an integer 0≤K<N/2, let
fK(x):=∥k∥∞≤K∑f~keiL2πk⋅(x−x0)(90)
be the trigonometric interpolant of f restricted to the frequencies ∥k∥∞≤K. Correspondingly, we denote by P^K the projector onto the low-momentum subspace, i.e. onto the momentum eigenvectors ∣m⟩ with ∥m∥∞≤N/2−K−1. We also define the complementary projector Q^K:=I^−P^K. We split Γi(q)=Γi(q),≤K+Γi(q),>K, where Γi(q),≤K and Γi(q),>K contain the terms of eq. (88) with ∥k∥∞≤K and ∥k∥∞>K, respectively, and we denote by max∣h∣ the maximum of ∣h(x)∣ over the domain.
Proposition 1. For every cost function f, every q, every integer 0≤K<N/2 and every normalized ∣ϕ⟩,
The same matrix elements are obtained from the right-hand side of eq. (20) with fK in place of f, using ∂ℓfK(x^)=∑kL2πikℓf~kS^k, ΔfK(x^)=−∑kL24π2∣k∣2f~kS^k and eq. (72). Hence, on the support of P^K, eq. (20) holds for fK:
The other two terms in eq. (92) are bounded by lemma 2, with g=f−fK and ∣χ⟩=∣ϕ⟩ for the third one, and with g=fK and ∣χ⟩=Q^K∣ϕ⟩ for the second one. We get eq. (91) by applying the triangle inequality to the norm of eq. (92).
For K=0, f0=f~0 is a constant, so that ∇f0=Δf0=0 and Γi(q),≤0=0, while Γi(q),>0=Γi(q). Equation (91) then reduces to lemma 2 with g=f, and hence to the generic bound eq. (89).
To specialize proposition 1 to cost functions with a smooth periodic extension, we compare f with the periodic extension F of f from the box x0+[0,L)d, whose Fourier series is
F(x)=κ∈Zd∑F~(κ)eiL2πκ⋅(x−x0).(96)
In analogy with eq. (88), we define
Γi(∞):=κ∈Zd∑F~(κ)∣κ∣i,i=1,2,(97)
and we denote by Γi(∞),>K the same sums restricted to ∥κ∥∞>K.
We will now bound the high-momentum components in eq. (91). We assume that
Γ2(∞)<∞,(98)
which is satisfied by every Cs periodic function F, with s>2d+2. Under this assumption, the series eq. (96) and its first and second derivatives converge absolutely and uniformly, and Γ1(∞)≤Γ2(∞)<∞, since ∣κ∣≤∣κ∣2 for κ∈Zd.
Aliasing. On the grid we have f(xr)=F(xr), and eiL2πκ⋅(xr−x0)=eiN2πκ⋅r depends only on the class of κ modulo N. Inserting eq. (96) into eq. (70), we therefore get the aliasing formula
f~k=n∈Zd∑F~(k+Nn),k∈KNd.(99)
Lemma 4. Under the assumption eq. (98), for i=1,2 and every integer 0≤K<N/2,
Γi(q)≤Γi(∞),Γi(q),>K≤Γi(∞),>K.(100)
Proof. Since kℓ∈KN is the representative of minimum modulus of its class modulo N, we have ∣kℓ∣≤∣kℓ+Nnℓ∣ for every nℓ∈Z, and hence ∣k∣≤∣k+Nn∣. By eq. (99), for every subset S⊆KNd we thus have
The map (k,n)↦κ=k+Nn is a bijection of KNd×Zd onto Zd, and ∥k+Nn∥∞≥∥k∥∞. Therefore, for S=KNd the left-hand side of eq. (101) is Γi(q) and the right-hand side is Γi(∞). For S={k∈KNd∣∥k∥∞>K}, instead, the left-hand side is Γi(q),>K, and the right-hand side is a sum over a subset of {κ∈Zd∣∥κ∥∞>K}, which is bounded by Γi(∞),>K. This proves eq. (100).
Lemma 4 means that every discrete Γ-like sum is upper bounded by its continuum counterpart, which is a finite number independent of q.
Lemma 5. Under the assumption eq. (98), for every integer 0≤K<N/2,
which is eq. (102). Taking the maximum over x of both sides gives the bounds on the maxima.
Lastly, we have to consider p^Q^K∣ϕ⟩ and Q^K∣ϕ⟩ in eq. (91), with ∣ϕ⟩=eiσT^0∣ψ(s)⟩.
Lemma 6. Under hypotheses (H1), (H3) and (H4), let ∣ψ(s)⟩ be the exact trajectory of eq. (56), and let ∣ϕ⟩=eiσT^0∣ψ(s)⟩ with σ∈R. Then, for every integer 0≤K<N/2,
Proof. We apply proposition 1 to ∣ϕ⟩=eiσT^0∣ψ(s)⟩, which is normalized. We insert eqs. (87), (100), (102) and (108) into eq. (91), also using Γi(q),≤K≤Γi(q)≤Γi(∞), and we group its terms in pairs:
Summing the three lines we get eq. (113), since the right-hand side does not depend on σ.
The first term of δq is the high-frequency tail of the cost function, and the second one comes from the high-momentum tail of the state. Choosing K=N/4, so that pK=2LπN, the second term becomes N16osc(f)ab[Γ1(∞)+N2Γ2(∞)]=O(2−q). The first term contains Γi(∞),>N/4, i.e. the tails beyond N/4 of the series Γi(∞), which converge for every F satisfying eq. (98): therefore it vanishes for q→∞ for all these cost functions. Equation (113) has the same form as the continuum bound obtained from eq. (20): compared to eq. (89), L2πΓ1(q) and L22π2Γ2(q) are replaced by max∣∇F∣ and 21max∣ΔF∣, up to corrections that vanish for large q.
B.4 Bounds for quantum functions
For the quantum functions of section 4, the dependence on d of the error bound is at most linear. If the parameter xℓ (with ℓ∈{1,…,d}) appears in νℓ rotations of the state preparation W^(x), generated by operators with eigenvalues ±1/2, as for the Pauli rotations e−ixσ^/2, then f is a trigonometric polynomial of period 2π and degree at most νℓ in each variable xℓ [25]. More generally, f is a trigonometric polynomial of period 2π whenever the generators have integer eigenvalue differences, and the bounds below hold with νℓ replaced by its degree in xℓ. We also assume that the domain is a full period, [0,2π)d, i.e. L=2π, as in the encoding eq. (42). Both assumptions are essential to avoid a dependence on q: if the domain covers only a fraction of the period, or if the frequencies are not integers, the periodic extension F is in general discontinuous at the boundary of the domain and, according to table 3, Γi(q) can grow exponentially in q. Under these assumptions, instead, the periodic extension F=f is smooth, and, on the grid with L=2π and νℓ<N/2, which holds for q>log2νℓ+1, there is no aliasing: f~k=0 unless ∣kℓ∣≤νℓ for every ℓ.
For these functions we bound the commutator by expanding f along one direction at a time, instead of in the full Fourier series of lemma 2.
Proposition 3. Let F~(κ)=0 unless ∣κℓ∣≤νℓ for every ℓ, with νℓ<N/2. Then, for every vector ∣χ⟩,
The first equality is the definition of gℓ,j given by the expansion above, evaluated at the grid point xr, and in the second one we inserted the discrete Fourier transform eq. (70), with summation index s∈{0,…,N−1}d. In the sixth equality we subtracted the constant c, which does not change the result since ∑sℓ=0N−1e−iN2πjsℓ=0 for 0<∣j∣<N.
The operator gℓ,j(x^) is diagonal in the position basis; therefore, for every vector ∣ξ⟩, by eq. (118),
Equation (115) then follows from eq. (116), the triangle inequality, eqs. (117) and (119), and the sums ∑0<∣j∣≤ν∣j∣=ν(ν+1), ∑0<∣j∣≤νj2=ν(ν+1)(2ν+1)/3.
We now set L=2π and apply proposition 3 to the normalized vector ∣χ⟩=eiσT^0∣ψ(s)⟩. We bound ∑ℓ∥p^ℓ∣χ⟩∥≤d∥p^∣χ⟩∥ by the Cauchy–Schwarz inequality and ∥p^∣χ⟩∥ by eq. (87). Then, with ν:=maxℓνℓ, from eq. (115) we have
This result holds for every q>log2ν+1 and contains no correction depending on q.
B.5 Final error bounds
Under hypotheses (H1)–(H4), we now insert eq. (69) and the bounds on the commutator into eq. (68).
For generic cost functions we insert eq. (89), and we bound b(s)/a(s)≤supIjb/a for s∈Ij, so that the term in square brackets no longer depends on s. The remaining integral is ∫Ij∣s−tj∣ds=Θ2Δt2, where Θ∈[21,1] is a numerical coefficient that depends on the choice of tj∈Ij (Θ=21 for the midpoint, and Θ=1 if tj is an endpoint of Ij). We thus obtain
By hypothesis (H1), b˙, ab and b/a are continuous, and hence uniformly continuous, on [0,T]: each supremum differs from the value of the corresponding function at any point of Ij by a quantity that vanishes uniformly for Δt→0. The sum over j is therefore a Riemann sum, which converges to the corresponding integral. At first order in Δt we get
Since Θ≤1 for every choice of the sampling times, eq. (122) implies eq. (18), for every sampling scheme, with
c1=Lπ2osc(f)Γ1(q),c2=L2π2Γ2(q).(123)
In eq. (122), all the dependence on d and q is contained in Γ1(q) and Γ2(q), eq. (88). Their dependence on q is set by the regularity of the cost function at the boundary of the domain. Through the aliasing formula eq. (99), the behavior of Γi(q) for large q is dictated by the decay of the Fourier coefficients F~(κ) of the periodic extension of f (see table 3).
Table 3: Behavior of Γ1(q) and Γ2(q) as functions of q, for a fixed cost function f, according to the regularity of its periodic extension F. The constants depend on f, and no explicit factor of d appears. In the last two rows, factors polynomial in q can be added by the singularities at the edges and corners of the domain.
periodic extension F
F~(κ) decay
Γ1(q)
Γ2(q)
smooth
faster than any power
O(1)
O(1)
continuous, with discontinuous derivative
∼∣κ∣−2
O(q)
O(2q)
discontinuous
∼∣κ∣−1
O(2q)
O(4q)
For cost functions with a smooth periodic extension, lemma 4 already shows that the coefficients eq. (123) are bounded independently of q, since Γi(q)≤Γi(∞). Sharper coefficients are obtained by inserting eqs. (69) and (113) into eq. (68), and proceeding as for eq. (122):
Since δq vanishes for q→∞ and Θ≤1, for large q this bound implies eq. (18), for every sampling scheme, with c1 and c2 given by eq. (19). In both cases the bound is O(RΔt2) for schedules bounded on [0,T], and it does not depend explicitly on d: the dimension enters only through osc(f), max∣∇F∣ and max∣ΔF∣, or Γi(∞) (which also appears in δq), which are properties of the given cost function.
Finally we consider quantum functions and, in general, trigonometric polynomials. Under the assumptions of proposition 3, with ν:=maxℓνℓ and L=2π, we insert eq. (120) into eq. (68), and proceed as for eq. (122). At first order in Δt, we obtain
Since Θ≤1, eq. (125) implies eq. (18), for every sampling scheme, with the coefficients c1 and c2 of eq. (21). This bound is O(dRΔt2), with a constant that depends only on the schedules, on osc(f)≤2O^ and on ν. Unlike eq. (124), it contains no correction vanishing for large q: it holds for every q>log2ν+1, and it grows at most linearly in d.
We stress that eqs. (122), (124) and (125) are of first order in Δt for every choice of the sampling times, whereas the actual error is of first order only if tj is not the midpoint of Ij. For midpoint sampling, the first term of the Magnus expansion of U^j, −i∫IjH^I(s)ds, differs from −iΔtH^I(tj) only at order Δt3, since ∫Ij(s−tj)ds=0, and the second term, which contains the commutators [H^I(s),H^I(s′)] with s,s′∈Ij, is also of order Δt3: the single-step error is O(Δt3), and the total error is O(RΔt3). In our derivation, this cancellation is lost in eq. (66), where the norm is taken inside the integral over each step, so that H^I(s)−H^I(tj) is bounded by a quantity proportional to ∣s−tj∣, whose integral over Ij does not vanish. For midpoint sampling, the bounds of this appendix are therefore worst-case estimates of first order for a second-order method, and they become increasingly pessimistic as Δt→0.
Finally, we remark that the bound ⟨ψ(t)T^0ψ(t)⟩≤osc(f)b/a of lemma 3, which enters all the bounds above through eq. (87), is a worst-case estimate: for a state localized in the harmonic well around the global minimum one has instead ⟨ψ(t)T^0ψ(t)⟩∼ωb/a, with ω=maxi∣ωi∣ as in eq. (9). In this regime, the term ab3=abb/a in eq. (125) is effectively replaced by ab(b/a)1/4.
C Efficient implementation of the kinetic step
Here we show that the kinetic step T^(tj) defined in eq. (17) can be efficiently implemented. For a given step, we denote by
α:=A(tj+1)−A(tj)=∫tjtj+1a(t)dt
the integrated kinetic schedule between two consecutive sampling times, i.e. the kinetic angle αj of section 2.1, which is computed classically (see appendix D.3), so that the kinetic step reads
T^(tj)=e−iα2p^2=F^se−iαL^F^s†.
First, we observe that, since the terms of L^ in eq. (12) commute, one has
Since F^s is also a tensor product over the d sub-registers Sℓ of q qubits that encode the coordinates xℓ (see eq. (11)), the whole kinetic block can be decomposed into blocks of operators acting on separate registers. We therefore study how to implement
F^se−iαL^F^s†.
As for the shifted QFT F^s, it can be implemented by exploiting
F^s=s^F^,(126)
where F^:=∑r,s=0N−1NeiN2πrs∣xs⟩⟨xr∣ is the quantum Fourier transform (QFT) and
The operator s^ applies I^ to all computational-basis states with even r, namely those for which the least significant qubit c0 is in the state ∣0⟩, and applies −I^ to all computational-basis states with odd r, namely those for which the least significant qubit c0 is in the state ∣1⟩. In other words, on our qubit register, s^ acts equivalently to σ^z on the qubit c0:
s^=I^q−1⊗⋯⊗I^1⊗σ^z.
The implementation of the QFT operator is standard and is already available in libraries such as Qiskit and PennyLane.
As for the operator e−iαL^, it can be implemented efficiently because it is diagonal in the computational basis and the phases it applies are structured, rather than generic. In fact, one needs to implement the operator
with N=2q and ∣xr⟩=∣rbase2⟩=∣cq−1…c0⟩, writing r=∑j=0q−12jcj with cj∈{0,1}. We first consider the expression of (r−N/2)2 in terms of the bits {cj}3
Since the QFT on q qubits also requires O(q2) gates, the whole kinetic step is implemented with O(dq2) elementary gates.
3We discard any constant term, i.e. any term independent of the cj, since it represents a global phase: indeed, being independent of cj∀j, it is the same for every bit string cq−1…c0, namely for every state ∣xr⟩.
D Choice of schedules and simulation angles
In this appendix we derive the optimal gauge (appendix D.1), discuss the choice of the curve r(τ) (appendix D.2), and compute the resulting kinetic and potential angles of the Trotterized evolution (appendix D.3).
D.1 Optimal gauge
Let ε∗ be the target error, and let us impose that the bound eq. (18), neglecting the boundary term 4osc(f)[b(T)−b(0)], equals it,
ε∗=Δt∫0T[c1a(t)b(t)3+c2a(t)b(t)]dt,(130)
with c1 and c2 numbers dependent on the cost function's features. We substitute τ=∫0ta(s)ds and r(τ)=a(t(τ))b(t(τ)) in the integral, with dt=a(t)dτ,t(0)=0 and t(τf)=T:
by the Cauchy–Schwarz inequality, with equality if and only if ag(r) is constant along the curve, i.e. for the optimal gauge a=λg−1/2, with λ>0.
In this gauge, we compare the boundary term 4osc(f)[b(T)−b(0)] with the integral term ∫0τfa(t(τ))g(r(τ))dτ in eq. (18). Using b(0)≥0, b=ar and g(r)≥c2r, we have
If the periodic extension F of f is smooth, c2≃41max∣ΔF∣ by eq. (19), and for rf≫r0 the ratio is ≲kℓ2/2, with ℓ2:=osc(f)/max∣ΔF∣ the squared length scale over which f varies by its oscillation. The boundary term is therefore negligible for kℓ2≪1, i.e. if the kinetic time spent per e-fold of r is much longer than ℓ2. For quantum functions, c2=24osc(f)ν(ν+1)(2ν+1)d≥4osc(f)d by eq. (21), and the condition becomes universal: the ratio is at most k/[2d(1−r0/rf)], i.e. ≃0.05/d with k=0.1, r0=10−4 and rf≥10, as in our simulations. In the gauge with constant b that we use for quantum functions (section 4.1), the boundary term vanishes identically. Thus eq. (24) describes the minimum number of Trotter steps sufficient to guarantee error ≤ε∗.
D.2 Choice of the curve
While the gauge only determines how the curve r(τ) is cut into Trotter steps, the curve determines the ideal dynamics eq. (23), and hence the result of the algorithm. It must keep the evolution adiabatic where this matters, and three regimes can be distinguished.
(i) For rosc(f)≪21(2π/L)2, the lowest kinetic excitation energy, the potential is a small perturbation and the uniform state remains close to the instantaneous ground state ∣0r⟩ of eq. (23): nothing happens, and the evolution can start directly from a small r0>0. We can choose its value a priori,
r0=ηosc(f)L22π2,η≪1.(131)
At first order in perturbation theory, the uniform state has overlap ∣⟨0r0∣ψ(0)⟩∣2≳1−η2/4 with the instantaneous ground state at r=r0, 4 so that η≲0.2 is already sufficient. Smaller values are harmless, since the initial part of the curve requires few Trotter steps (see eq. (134) and below).
(ii) In the search window r0≲r≲rs, the potential competes with the kinetic energy, the wavefunction redistributes among the valleys of f through tunneling, and the populations of their basins, hence the success probability (eq. (27)), are decided. The search window ends at the ratio rs at which the instantaneous ground state ∣0r⟩ becomes the ground state of the harmonic approximation of the valley of the global minimum. Since rs depends on the whole landscape, it is not easily estimated a priori, and we read it off a posteriori from the stabilization of Psuc in simulations of small instances. This criterion can be misleading: Psuc may appear stable while the instantaneous ground state has not yet reached this final regime, as in the case discussed below.
The gaps depend on the landscape, and the optimal curve follows the local adiabatic principle [40],
dτdr≲δad∣⟨1r∣f(x^)∣0r⟩∣Δ(r)2,(132)
where Δ(r) is the gap between the two lowest eigenstates ∣0r⟩, ∣1r⟩ of eq. (23) and δad≪1: kinetic time should be spent where the gap is small. Since Δ(r) is generally unknown, a sub-optimal but robust choice is to distribute the kinetic time uniformly
4To lowest order in r, 1−∣⟨0r∣ψ(0)⟩∣2≃r2∑k=0∣⟨k∣f(x^)∣0⟩∣2/Ek2, where ∣k⟩ are the eigenvectors of p^, with ∣0⟩=∣ψ(0)⟩, and Ek≥2π2/L2 are the kinetic energies of those with k=0. The sum ∑k=0∣⟨k∣f(x^)∣0⟩∣2 is the variance of f over the grid, which is at most osc(f)2/4.
in lnr, as in the curve r(τ)=r0ekτ of eq. (26), where 1/k is the kinetic time spent per e-fold of r, so that the search window takes the kinetic time ln(rs/r0)/k. The rate k is the main free parameter of the algorithm, to be decreased until Psuc no longer improves. Slowing down the search, however, does not always increase Psuc. If the global minimum lies in a valley narrower than that of a nearly degenerate local minimum, the larger zero-point energy of the narrow valley makes the instantaneous ground state localize first in the wider one, and move to the global valley only through an avoided crossing with an exponentially small gap. If this crossing occurs at a large r, where Psuc already appears stable, a slower curve follows the wrong valley more faithfully, so that Psuc decreases as k is reduced until the evolution becomes adiabatic also with respect to this gap, which may require an impractically long time.
(iii) For r≳rs, the wavefunction is localized in the valleys and tunneling between them is exponentially suppressed, so that the success probability is frozen and QHD only refines the position within each valley, with the error eq. (9) decreasing as r−1/2. For classical functions (section 3), the ratio rf at the end of the simulation is fixed by the target accuracy δf on the cost function through eq. (9) with N=1, which holds when the state is in the ground state of the valley of the global minimum,
rf≃(4δfdω)2.(133)
Instead, in the case of quantum functions (section 4), it is more efficient to stop at a moderate rf≳rs (see section 4.1); at that point the state is localized within the basin of the global minimum, so we can measure and refine the solution with a classical optimizer, e.g. gradient descent with the parameter-shift rule.
We run the curve eq. (26) up to r(τf)=rf, i.e. τf=ln(rf/r0)/k. Along this curve dτ=dr/(kr), so that, in the optimal gauge of section 2.2, the number of Trotter steps eq. (24) sufficient to guarantee error ≤ε∗ according to the bound eq. (18) becomes
Rmin≃ε∗1(k1∫r0rfrg(r)dr)2.(134)
The integrand behaves as c2/r for small r, so that the integral converges for r0→0: at a fixed rate k, the initial part of the curve, where nothing happens, takes a vanishing fraction of the Trotter steps, and r0 can be chosen conservatively. Since the bound eq. (18) is of first order in Δt, while for midpoint sampling the actual error is of second order (see the end of appendix B.5), eq. (134) is a sufficient but pessimistic number of steps.
D.3 Kinetic and potential angles
Here we compute the angles αj and φj of eq. (16), for midpoint sampling times, along a curve r(τ) run through in a gauge of the form
a(t(τ))=g(r(τ))λ,(135)
where λ>0 and g is a positive function of r. Let
s(τ):=∫0τg(r(τ′))dτ′
(136) be the cost length of the curve. From the definition of the kinetic time τ=∫0ta(t′)dt′ and eq. (135), we have dtdτ=a(t)=g(r(τ))λ, hence
dt=λg(r(τ))dτ=λds,(137)
with λ=s(τf)/T: choosing λ is equivalent to choosing the total time T, and the physical time t is proportional to the cost length s. Since s(τ) is strictly increasing, it can be inverted, and we denote its inverse by τ(s); since s=λt, the kinetic time is ∫0ta(t′)dt′=τ(λt). We define
sj:=(j−21)Δs,Δs:=Rs(τf),(138)
for j=1,…,R, with s0:=0 and sR+1:=s(τf), so that sj=λtj corresponds to the sampling time tj, and τ(sj)=∫0tja(t)dt. Then, using b=ar and λΔt=Δs, the angles are
They depend only on the curve, on g and on R, and not on λ, in agreement with the symmetry (a,b,t)→(λa,λb,t/λ) discussed in section 2.2. For a generic g, s(τ) and τ(s) are obtained by numerical quadrature and inversion, at a negligible classical cost.
In kinetic time, a Trotter step lasts αj≃Δs/g(r(τ(sj))): if g is increasing, the steps are long where r is small, and short where r is large. Each step covers the same interval Δs of cost length, and therefore contributes equally to any error bound of the form
Δt∫Ija2g(r)dt=Δt∫ag(r)dτ=λΔt∫g(r)dτ=Δs2,(140)
where the integrals in τ run over the j-th step, so that the bound equals RΔs2=s(τf)2/R, as in eq. (24).
E Online procedure error bound
In this appendix we bound the error introduced by the online procedure with respect to the unitary Trotterized evolution eq. (16), in terms of the potential angles φj=Δtb(tj), with tj=(j−21)Δt and j=1,…,R. We denote by Tj(ρ):=T^(tj−1)ρT^†(tj−1) the j-th kinetic step and by Vj(ρ):=V^(tj)ρV^†(tj) the exact j-th potential step, with T^ and V^ defined in eq. (17), so that the unitary Trotterized evolution is VR∘TR∘⋯∘V1∘T1, up to the last kinetic step T^(tR), which is unitary and does not change the trace distances below. The online procedure replaces Vj with the channel
where V^SM is defined in eq. (38), m indexes the basis of the measure register and K^j,m:=⟨mV^SM(tj)0M⟩ are Kraus operators. Since W^SM acts on M conditionally on the computational basis of S (eq. (36)), the Kraus operators are diagonal in that basis. Indeed, inserting eqs. (36) and (38) with Δtb(tj)=φj, and using the orthogonality of the projectors ∣xr⟩⟨xr∣, we get
so that Φ(ρ)−V(ρ)=φ2D(ρ)+O(φ3), with the dissipator
D(ρ):=m=0∑A^mρA^m†−21{G^,ρ}.
The first term of D(ρ) is a positive operator, whose trace norm equals its trace, Tr(G^ρ)≤G^∞. By Hölder's inequality, G^ρ1≤G^∞∥ρ∥1=G^∞, and similarly for ρG^. By the triangle inequality, 21∥D(ρ)∥1≤G^∞=maxr∥δr∥2.
Proposition 5 (Online procedure error). Let ρon(T) be the final state of the simulation register with the online procedure, and ∣ψ~(T)⟩=U^Trotter(T,0)∣ψ(0)⟩ the final state of the unitary Trotterized evolution. Then
Proof. Let ∣ψj⟩ be the state of the unitary Trotterized evolution just before the j-th potential step, i.e. ∣ψj⟩⟨ψj∣=Tj∘Vj−1∘⋯∘V1∘T1(∣ψ(0)⟩⟨ψ(0)∣). The telescoping identity
Hence, defining the QHD error via the online procedure, with respect to the exact final state ∣ψ(T)⟩, as
Eonline:=21∥ρon(T)−∣ψ(T)⟩⟨ψ(T)∣∥1,
the triangle inequality gives Eonline≤ETrotter+ϵonline, and eq. (48) follows from eq. (125) with Θ=1 and eq. (144).
F Quantum function instances
The quantum functions of section 4.2 are defined as
f(x)=⟨0W^†(x)O^W^(x)0⟩,x∈[0,2π)d,(145)
where the preparation circuit W^(x) acts on m qubits initialized in ∣0⟩⊗m and the observable O^ is a single Pauli string. We denote by X^, Y^, Z^ the Pauli matrices, by R^σ(x):=e−ixσ^/2, with σ∈{X,Y,Z}, the rotations, and by R^ZZ(x):=e−ixZ^⊗Z^/2 the two-qubit ZZ rotation; qubit 0 is the top line of the circuits and the leftmost factor of the Pauli strings.
Examples 1 and 2 share the one-parameter ring circuit of circuit (146), in which the parameter x is re-uploaded on all the qubits, between entangling gates and fixed rotations; they differ only in the observable, O^=I^⊗Y^⊗Z^ for Example 1 and O^=X^⊗X^⊗X^ for Example 2.
(146)
Example 3 is a hardware-efficient ansatz with two qubits and two layers, in which each parameter is re-uploaded on the same qubit, with observable O^=X^⊗I^:
(147)
Example 4 is a hardware-efficient ansatz with three qubits and two layers, with the parameter x1 on all the qubits of the first layer and x2 on those of the second one, and observable O^=Z^⊗X^⊗I^:
(148)
Example 5 is a QAOA-like circuit, with a layer of ZZ and Z rotations that depend on x1 and a layer of X rotations that depend on x2, and observable O^=X^⊗Z^⊗Z^:
(149)
The corresponding functions, obtained from the exact Fourier coefficients of the circuits and checked against their simulation, are
They are trigonometric polynomials of degree at most 3 in each variable, as expected from the number of rotations that depend on each parameter (appendix B.4): ν=2 for Example 3 and ν=3 for the other examples, so that the condition q>log2ν+1 of eq. (21) is satisfied by the values of q in table 2. The numbers of their local minima in [0,2π)d, reported in table 2, are obtained from these expressions.
References
[1] Marco Cerezo, Andrew Arrasmith, Ryan Babbush, Simon C. Benjamin, Suguru Endo, Keisuke Fujii, Jarrod R. McClean, Kosuke Mitarai, Xiao Yuan, Lukasz Cincio, et al. "Variational quantum algorithms". Nature Reviews Physics 3, 625–644 (2021).
[2] Kishor Bharti, Alba Cervera-Lierta, Thi Ha Kyaw, Tobias Haug, Sumner Alperin-Lea, Abhinav Anand, Matthias Degroote, Hermanni Heimonen, Jakob S Kottmann, Tim Menke, et al. “Noisy intermediate-scale quantum algorithms”. Reviews of Modern Physics 94, 015004 (2022).
[3] Marco Cerezo, Guillaume Verdon, Hsin-Yuan Huang, Lukasz Cincio, and Patrick J. Coles. "Challenges and opportunities in quantum machine learning". Nature Computational Science 2, 567–576 (2022).
[4] Kosuke Mitarai, Makoto Negoro, Masahiro Kitagawa, and Keisuke Fujii. "Quantum circuit learning". Physical Review A 98, 032309 (2018).
[5] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. “Evaluating analytic gradients on quantum hardware”. Physical Review A 99, 032331 (2019).
[6] Leonardo Banchi and Gavin E. Crooks. “Measuring Analytic Gradients of General Quantum Evolution with the Stochastic Parameter Shift Rule”. Quantum 5, 386 (2021).
[7] Leonardo Banchi, Dominic Branford, and Chetan Waghela. “Overshifted parameter-shift rules: optimizing complex quantum systems with few measurements”. Quantum Science and Technology 11, 035031 (2026).
[8] Eric R Anschuetz and Bobak T Kiani. “Quantum variational algorithms are swamped with traps”. Nature Communications 13, 7760 (2022).
[9] Andrew Arrasmith, Zoë Holmes, M. Cerezo, and Patrick J. Coles. “Equivalence of quantum barren plateaus to cost concentration and narrow gorges”. Quantum Science and Technology 7, 045015 (2022). arXiv:2104.05868.
[10] Jarrod R. McClean, Sergio Boixo, Vadim N. Smelyanskiy, Ryan Babbush, and Hartmut Neven. “Barren plateaus in quantum neural network training landscapes”. Nature Communications 9, 4812 (2018).
[11] Amira Abbas, Robbie King, Hsin-Yuan Huang, William J Huggins, Ramis Movassagh, Dar Gilboa, and Jarrod McClean. “On quantum backpropagation, information reuse, and cheating measurement collapse”. Advances in Neural Information Processing Systems 36, 44792–44819 (2023).
[12] Mateusz Ostaszewski, Edward Grant, and Marcello Benedetti. “Structure optimization for parameterized quantum circuits”. Quantum 5, 391 (2021).
[13] Paolo Alessandro Xavier Tognini, Leonardo Banchi, and Giacomo De Palma. “Solving MNIST with a globally trained mixture of quantum experts” (2025). arXiv:2505.14789.
[14] Patrick Rebentrost, Maria Schuld, Leonard Wossnig, Francesco Petruccione, and Seth Lloyd. “Quantum gradient descent and Newton’s method for constrained polynomial optimization”. New Journal of Physics 21, 073023 (2019).
[15] Keren Li, Yuanfeng Wang, Pan Gao, and Shenggen Zheng. “Learning parameterized quantum circuits with quantum gradient”. npj Quantum Information 12, 59 (2026).
[16] Jiaqi Leng, Ethan Hickman, Joseph Li, and Xiaodi Wu. “Quantum Hamiltonian Descent” (2023). arXiv:2303.01471.
[17] Andre Wibisono, Ashia C. Wilson, and Michael I. Jordan. “A variational perspective on accelerated methods in optimization”. Proceedings of the National Academy of Sciences 113, E7351–E7358 (2016).
[18] Tameem Albash and Daniel A. Lidar. “Adiabatic quantum computation”. Reviews of Modern Physics 90, 015002 (2018).
[19] Jiaqi Leng, Yufan Zheng, Zhiyuan Jia, Lei Fan, Chaoyue Zhao, Yuxiang Peng, and Xiaodi Wu. “Quantum Hamiltonian Descent for non-smooth optimization” (2025). arXiv:2503.15878.
[20] Andrew M. Childs, Jiaqi Leng, Tongyang Li, Jin-Peng Liu, and Chenyi Zhang. “Quantum simulation of real-space dynamics”. Quantum 6, 860 (2022).
[21] Guang Hao Low and Nathan Wiebe. “Hamiltonian simulation in the interaction picture” (2018). arXiv:1805.00675.
[22] Leonardo Banchi, Jason Pereira, Seth Lloyd, and Stefano Pirandola. “Convex optimization of programmable quantum computers”. npj Quantum Information 6, 42 (2020).
[23] Stefano Pirandola, Riccardo Laurenza, Carlo Ottaviani, and Leonardo Banchi. “Fundamental limits of repeaterless quantum communications”. Nature communications 8, 15043 (2017).
[24] Sergio Blanes, Fernando Casas, José A. Oteo, and José Ros. “The Magnus expansion and some of its applications”. Physics Reports 470, 151–238 (2009). arXiv:0810.5488.
[25] Maria Schuld, Ryan Sweke, and Johannes Jakob Meyer. “Effect of data encoding on the expressive power of variational quantum-machine-learning models”. Physical Review A 103, 032430 (2021).
[26] Guang Hao Low and Isaac L. Chuang. “Hamiltonian Simulation by Qubitization”. Quantum 3, 163 (2019).
[27] András Gilyén, Yuan Su, Guang Hao Low, and Nathan Wiebe. “Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics”. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing. Pages 193–204. (2019).
[28] David Poulin, Angie Qarry, Rolando Somma, and Frank Verstraete. “Quantum simulation of time-dependent Hamiltonians and the convenient illusion of Hilbert space”. Physical Review Letters 106, 170501 (2011).
[29] Dominic W Berry, Andrew M Childs, Yuan Su, Xin Wang, and Nathan Wiebe. “Time-dependent Hamiltonian simulation with L1-norm scaling”. Quantum 4, 254 (2020).
[30] Yi-Hsiang Chen, Amir Kalev, and Itay Hen. “Quantum algorithm for time-dependent Hamiltonian simulation by permutation expansion”. PRX Quantum 2, 030342 (2021).
[31] Dong An, Di Fang, and Lin Lin. “Time-dependent Hamiltonian simulation of highly oscillatory dynamics and superconvergence for Schrödinger equation”. Quantum 6, 690 (2022).
[32] Mária Kieferová, Artur Scherer, and Dominic W Berry. “Simulating the dynamics of time-dependent Hamiltonians with a truncated Dyson series”. Physical Review A 99, 042314 (2019).
[35] Momin Jamil and Xin-She Yang. “A literature survey of benchmark functions for global optimisation problems”. International Journal of Mathematical Modelling and Numerical Optimisation 4, 150–194 (2013).
[36] Sonja Surjanovic and Derek Bingham. “Virtual library of simulation experiments: Test functions and datasets”. https://www.sfu.ca/~ssurjano/ (2013). Consulted on 21st November 2025.
[37] Earl Campbell. “Random compiler for fast Hamiltonian simulation”. Physical Review Letters 123, 070503 (2019).
[38] Ignacio B. Acedo, Javier Gonzalez-Conde, Pablo Rodriguez-Grasa, Barry C. Sanders, and Lirandë Pira. “Quantum Hamiltonian evolution for coherent quantum learning” (2026). arXiv:2609.03640.