Source-linked AI summary

General parameter-shift rules for quantum gradients

David Wierichs, Josh Izaac, Cody Wang, Cedric Yen-Yu Lin

arXiv:2107.12390v3quant-ph

TL;DR

Existing parameter-shift rules are limited for gates with more than particular eigenvalue structures, so this paper derives general rules from finite-Fourier cost functions and finds fewer evaluations for higher-order derivatives and QAOA circuits with repeated parameters.

  • Problem

    Existing parameter-shift rules are restricted to gates with two or particular numbers of distinct eigenvalues, limiting their generality for quantum-gradient evaluation.

  • Method

    The paper reconstructs single-parameter cost functions as finite Fourier series, analytically differentiates them, and extends the resulting rules to arbitrary spectra and multi-parameter gates.

  • Results

    The generalized rules require fewer evaluations for second-order derivatives and reduce circuit evaluations for QAOA ansätze with repeated parameters.

  • Takeaways & Limitations

    The approach broadens parameter-shift differentiation beyond fixed eigenvalue structures while supporting cheaper higher-order and multivariate derivative calculations.

  • Takeaways & Limitations

    The practicality of the new rules remains uncertain because resource scaling can be similar to decomposition-based rules for first derivatives and second-derivative shot budgets.

Abstract

from arXiv · show

Variational quantum algorithms are ubiquitous in applications of noisy intermediate-scale quantum computers. Due to the structure of conventional parametrized quantum gates, the evaluated functions typically are finite Fourier series of the input parameters. In this work, we use this fact to derive new, general parameter-shift rules for single-parameter gates, and provide closed-form expressions to apply them. These rules are then extended to multi-parameter quantum gates by combining them with the stochastic parameter-shift rule. We perform a systematic analysis of quantum resource requirements for each rule, and show that a reduction in resources is possible for higher-order derivatives. Using the example of the quantum approximate optimization algorithm, we show that the generalized parameter-shift rule can reduce the number of circuit evaluations significantly when computing derivatives with respect to parameters that feed into many gates. Our approach additionally reproduces reconstructions of the evaluated function up to a chosen order, leading to known generalizations of the Rotosolve optimizer and new extensions of the quantum analytic descent optimization algorithm.

1 Introduction

Variational quantum algorithms optimize expectation-value cost functions, but conventional parameter-shift rules are limited to gates with two distinct eigenvalues. This work derives general parameter-shift rules for arbitrary gates from finite-Fourier reconstruction and analyzes their resource and optimization benefits.

  • Motivation: Variational quantum algorithms execute parametrized circuits, measure expectation values, and use classical optimization to minimize the resulting cost function.
  • Limitation: The conventional two-term parameter-shift rule gives unbiased gradients without additional hardware but is restricted to gates with two distinct eigenvalues.
  • Generalized rules: Finite-Fourier structure allows restricted cost functions to be reconstructed from shifted circuit evaluations, yielding closed-form parameter-shift rules for arbitrary quantum gates and arbitrary-order univariate derivatives.
  • Resource analysis: The resource analysis distinguishes conclusions based on unique executed circuits from those based on total measurements and finds fewer evaluations for second-order derivatives than naïvely iterating the two-term rule.
  • Applications: For QAOA, the generalized parameter-shift rule can reduce gradient circuit evaluations, including for parameters that feed into many gates.
  • Optimization methods: Function reconstruction reproduces generalized Rotosolve methods and extends quantum analytic descent to broader variational cost functions, while the QAOA gradient cost reduction also applies to Rotosolve.

2 Background

A single-parameter quantum-gate expectation value is a finite Fourier series whose coefficients can be reconstructed from finitely many evaluations, enabling arbitrary-order derivatives. The background reviews existing parameter-shift rules and compares them using distinct-circuit and shot-count resources.

  • Single-parameter expectation values: For U(x)=exp(ixG), the expectation value has frequencies given by positive differences between generator eigenvalues, which need not be equidistant.With r unique generator eigenvalues, there are at most R≤r(r−1)/2 unique differences; many gates instead have R≤r equidistant differences.
  • Single-parameter expectation values: Because the expectation value is a finite-term Fourier series, discrete Fourier reconstruction from finitely many evaluations yields its full functional form and arbitrary-order derivatives.The Fourier coefficients can be obtained through a discrete Fourier transform.
  • Existing parameter-shift rules: Known parameter-shift rules cover single-frequency gates, two-frequency gates, auxiliary-gate constructions, stochastic shifts for more complex gates, and higher-order derivatives.For two-frequency gates, one reviewed rule requires four evaluations, while another can use two distinct circuits for real-valued circuits and Hamiltonians when suitable auxiliary gates are available.
  • Existing parameter-shift rules: The reviewed higher-order extension can compute a second-order derivative with two function evaluations for single-frequency gates.Other prior work explored combinations of derivatives using few evaluations.
  • Resource measures: The analysis measures resource demands by Neval, the number of distinct circuits, and N, the total number of measurement shots.Neval often determines cloud-hardware financial and time costs, whereas N is relevant when runtime primarily scales with requested samples; the work mostly uses Neval and additionally compares N for equidistant frequencies and shifts.

3 Univariate cost functions

This section characterizes how a quantum cost function varies with one parameter by exploiting its finite Fourier form. Under equidistant-frequency assumptions, the function and its odd or even components can be reconstructed efficiently, yielding generalized parameter-shift rules for derivatives.

  • Setup: The analysis fixes all parameters except x and represents the cost as an observable expectation for a state prepared by U(x) = exp(ixG).The single-parameter dependence is isolated while other operations are absorbed into the prepared state and observable.
  • Setup: Equidistant frequencies, rescaled to integer values without loss of generality, enable closed-form parameter-shift rules and efficient circuit requirements.The paper notes that many conventional gates and gate layers produce such regular spectra, while arbitrary frequencies are treated separately.
  • Function reconstruction: 2R + 1 evaluations at distinct points determine the 2R + 1 Fourier coefficients and reconstruct the full function through trigonometric interpolation.Uniformly spaced points yield the usual discrete Fourier transform.
  • Function reconstruction: 2R evaluations suffice to determine either the odd or even part under integer frequencies, while the full function requires 2R + 1 evaluations.For the even part, if E(0) is already known, only 2R − 1 new evaluations are needed; the odd-part saving is usually not practically significant.
  • Parameter-shift rules: Higher-order derivatives use the same evaluations for all odd or even orders, recovering known two-term and four-term rules at R = 1 and R = 2.The result also includes the second-order derivative rule for R = 1.
  • Resource comparison: 2P unique circuit evaluations arise from decomposing a parameter across P gates, making the generalized rule cheaper when R < P.For E′′(0), decomposition requires 2P^2−P+1 evaluations including E(0), versus 2R evaluations for the general rule.

4 Second-order derivatives

The Hessian of a multivariate Fourier-series function can be computed with general and diagonal parameter-shift rules that reuse evaluations and often reduce unique circuit costs. For off-diagonal entries, simultaneous parameter shifts reduce the problem to a univariate second derivative, while shot efficiency can favor repeated general shifts.

  • Diagonal entries: The diagonal shift rule computes the full Hessian diagonal using 2∥R∥1 − n + 1 evaluations by reusing E(x0) across entries.When the Hessian diagonal is computed alongside the gradient, the 2∥R∥1 gradient evaluations are reusable, requiring only E(x0) additionally.
  • Off-diagonal entries: For an off-diagonal entry Hkm, simultaneous shifts produce a univariate Fourier series with Rkm = Rk + Rm frequencies, requiring 2(Rk + Rm) − 1 evaluations when the diagonal is known.The resulting univariate second derivative is combined with already computed diagonal entries to obtain Hkm.
  • Resource comparison: The diagonal shift rule for Hkm uses fewer unique circuit evaluations than repeated general shifts, which require strictly more evaluations.For equidistant frequencies, decomposition into Pk and Pm elementary gates instead requires 4PkPm evaluations.
  • Resource comparison: The optimal unique-circuit strategy depends on Rk,m and Pk,m, but the diagonal shift rule is often significantly cheaper than unitary decomposition when P and R are linearly related.The comparison concerns distinct circuit evaluations rather than total measurement shots.
  • Shot requirements: Shot efficiency reverses the circuit-count recommendation: the diagonal Hessian shift rule is generally less efficient than repeated general shifts when the number of shots is the limiting resource.The diagonal rule reuses Hessian entries, correlating shot allocations and statistical errors across the full Hessian.

5 Applications

The applications demonstrate that generalized parameter-shift rules reduce QAOA derivative costs and enable function-reconstruction extensions of Rotosolve and quantum analytic descent (QAD) to broader gate classes.

  • QAOA: QAOA frequency counts may be bounded without knowing the MaxCut solution, using analytic or SDP-derived upper bounds on the largest relevant frequency.For 2k-regular graphs, an upper bound ϕ implies R ≤ ϕ/2 because all frequencies are even.
  • QAOA: The generalized parameter-shift rule provides a constant-factor gradient improvement and at least O(N) improvement for jointly computing QAOA gradients and Hessians.The advantage can arise from spectral structure and tight analytic bounds or from SDP-based bounds, depending on the graph type.
  • Rotosolve: The Rotosolve cost reduction follows from cheaper function reconstruction, extending the method beyond Pauli rotations to arbitrary single-parameter gates with non-equidistant frequencies.The reconstruction uses the function value together with evaluations from the generalized parameter-shift rule.
  • Quantum analytic descent: For Pauli rotations, the reduced-resource QAD modification lowers evaluations from 2n^2 + n + 1 to (3n^2 + n)/2 + 1.The reduction exploits cheaper gradient and Hessian evaluation because QAD coefficients consist of those derivatives.
  • Quantum analytic descent: An extended QAD model uses combined shift angles to obtain additional higher-order terms and correctly reconstructs bivariate restrictions on every coordinate plane.Whether this extension improves optimization remains application-dependent and may depend on pairwise local approximations of the landscape.
  • Quantum analytic descent: A further QAD modification generalizes the extended model to arbitrary single-parameter gates through full second-order trigonometric interpolation.The method exactly reconstructs the energy function on any coordinate plane, with a stated evaluation cost beginning 2(∥R∥2.

6 Discussion

The work derives exact trigonometric interpolation and generalized parameter-shift rules for quantum functions, including arbitrary-order and multivariate derivatives. Its practicality remains partly unresolved, especially for non-equidistant frequencies, while the framework extends model-based optimizers and motivates further Fourier-analysis research.

  • Method: The method exactly represents E(x) from shifted evaluations because parametrized-gate expectation values are trigonometric polynomials with frequencies determined by eigenvalue differences.The interpolation uses R distinct frequencies associated with the generator G.
  • Contributions: The framework provides arbitrary-order derivative parameter-shift rules, cheaper recipes for multivariate derivatives, and stochastic differentiation for gates U_F(x) = exp(i(xG + F)).It also supports full reconstruction of E(x).
  • Practicality: For R equidistant frequencies, generalized rules have resource scaling similar to decomposing U(x) for first derivatives and the second-derivative shot budget.The discussion notes that practicality remains unknown despite this scaling result.
  • Open questions: For generators with non-equidistant frequencies, R may scale quadratically with U, potentially making naive generalized rules worse than decomposing G.The discussion raises approximate or stochastic rules as possible ways to improve scaling.
  • Open questions: The rules might be truncated to smaller frequencies, analogous to low-pass filtering, but the usefulness of this approach remains an open question.This could potentially smooth rapid signal changes.
  • Optimization: Function reconstruction extends QAD to equidistant-frequency gates and Rotosolve to arbitrary-frequency gates, prompting questions about problem classes and optimization cost.The discussion also asks whether Fourier analysis can improve optimization under noise.

A Technical derivations · A.1 Derivation of explicit parameter-shift rules · A.1.1 Full reconstruction

The technical derivations obtain trigonometric interpolation through Dirichlet kernels, exactly reconstructing E(x) from 2R+1 sampled values. Derivatives then follow directly from this full reconstruction.

  • A.1 Derivation of explicit parameter-shift rules: The derivation uses Dirichlet kernels to construct the trigonometric interpolation.
  • A.1.1 Full reconstruction: E(x) is exactly determined from values sampled at x_µ = 2µπ/(2R+1), with µ ranging from −R to R.
  • A.1.1 Full reconstruction: The Dirichlet kernel provides the interpolation basis for the full reconstruction.
  • A.1.1 Full reconstruction: The shifted kernels are linear combinations of sine and cosine basis functions and satisfy D(x_µ′ − x_µ) = δ_µµ′.
  • A.1.1 Full reconstruction: For R = 1, an explicit reconstruction formula applies, including the case where the generator satisfies G^2 = 1.
  • A.1.1 Full reconstruction: Derivatives of E(x) can be extracted directly from the full reconstruction.

A.1.2 Odd kernels · A.1.3 Even kernels

The paper reconstructs odd and even components of a parameter-dependent function using specially constructed interpolation kernels. This yields parameter-shift rules for first and second derivatives, with analogous extensions to higher odd and even orders.

  • A.1.2 Odd kernels: For odd kernels, the construction starts from E_odd evaluated at R evenly spaced points.The points are x_µ = (2µ−1)π/(2R).
  • A.1.2 Odd kernels: The modified Dirichlet kernel D*(x) is unsuitable for odd reconstruction because it is an even cosine combination rather than an odd sine combination.The method therefore replaces it with appropriate linear combinations.
  • A.1.2 Odd kernels: The odd interpolation kernels satisfy ˜D_µ(x_µ′) = δ_µµ′ and are linear combinations of sin(ℓx), enabling reconstruction of E_odd from R evaluations.These two properties provide the interpolation basis for the odd component.
  • A.1.2 Odd kernels: The odd-kernel construction produces a closed-form parameter-shift rule for the derivative at x = 0.Higher odd-order derivatives follow by analytically differentiating the interpolation kernels.
  • A.1.3 Even kernels: For even kernels, the method samples E_even at R + 1 points x_µ = µπ/R for µ ∈ [R]_0.The even reconstruction uses the same spacing as the odd-kernel points.
  • A.1.3 Even kernels: Because D*(x − x_µ) is not even in x, the method uses even combinations of shifted kernels.For 0 < µ < R, the combination is D*(x − x_µ) + D*(x + x_µ).
  • A.1.3 Even kernels: The resulting kernels ˆD_µ are even and satisfy ˆD_µ(x_µ′) = δ_µµ′, supporting reconstruction of the even component.Their interpolation structure follows from the chosen sample points and kernel symmetrization.
  • A.1.3 Even kernels: The even-kernel construction yields an explicit parameter-shift rule for the second derivative, with higher even orders obtainable similarly.The second derivative is obtained from the analytically computed second derivative of D* and its x → 0 limit.

A.2 Hessian parameter-shift rule

The Hessian parameter-shift rule characterizes the relevant Fourier frequencies from generator spectra. Integer-valued frequencies yield fewer positive frequencies, while arbitrary frequencies can produce many distinct combinations.

  • Frequency spectrum: The Fourier-series frequencies arise from unique positive differences between eigenvalues of the two gate generators, with paired positive and negative frequencies.The real-valued representation retains only the positive values because each frequency occurs with its negative counterpart.
  • Frequency spectrum: R_km = R_k + R_m positive frequencies occur for integer-valued frequencies, corresponding to all integers in [R_k + R_m].This count relies on rescaling the smallest frequency so the frequencies become integer-valued.
  • Frequency spectrum: For arbitrary frequencies, the rule may require up to R_km = 2R_kR_m + R_k + R_m distinct positive frequencies.When all frequency differences are unique, this upper bound applies; rescaling can always achieve R_km = 2R_kR_m + R_k + R_m − 2.

A.3 Hadamard tests for the metric tensor · A.4 Coefficient norms for univariate derivatives via equidistant shifts · A.4.1 Norm for general parameter-shift rule

The appendix describes circuit constructions for metric-tensor evaluations and Hadamard tests, then develops coefficient-norm calculations for univariate parameter-shift rules. For equidistant shifts, it derives these norms using paired evaluations and polynomial-root identities.

  • A.3 Hadamard tests for the metric tensor: Metric-tensor Hessian evaluations use shifted overlap circuits composed of V(x0) and V†(x), with cancellable operations omitted after the later parametrized gate.The maximal circuit depth is almost twice that of V.
  • A.3 Hadamard tests for the metric tensor: A Hadamard test can directly measure real or imaginary derivative-overlap components by measuring an auxiliary qubit in the Z or Y basis.The construction was originally described for Pauli-word generators but also applies to the real or imaginary parts needed here.
  • A.3 Hadamard tests for the metric tensor: The Hadamard-test circuit count follows the parameter-shift rule rather than generator Pauli-word decompositions, while measuring both real and imaginary parts doubles the circuits.The original proposal instead uses one circuit per combination of Pauli words from the relevant generators.
  • A.4 Coefficient norms for univariate derivatives via equidistant shifts: The ℓ1-norm of parameter-shift coefficients determines the shot budget needed to achieve a target precision.The appendix computes this norm for general and decomposition-based rules for first- and second-order univariate derivatives.
  • A.4.1 Norm for general parameter-shift rule: For equidistant shift angles, the coefficient vector y(1,2) is evaluated explicitly to estimate the required shot budget for the resulting derivative.The first-order evaluations of E occur in pairs whose coefficients differ only by a relative sign.
  • A.4.1 Norm for general parameter-shift rule: The first-order norm derivation uses sin^-2(xµ) = cot^2(xµ) + 1 together with a cited trigonometric-sum formula.This identity is used to simplify the equidistant-shift coefficient expression.
  • A.4.1 Norm for general parameter-shift rule: The appendix derives the relevant coefficient norm by identifying cot^2(xµ) as polynomial roots and applying Vieta’s formulas to the known roots and Taylor coefficients.The derivation invokes the binomial theorem, extracts the real part, and divides by (i sin(xµ))^2R.
  • A.4.1 Norm for general parameter-shift rule: The second-order coefficient-norm calculation repeats the preceding polynomial computation with small modifications.It arrives at a related polynomial expression g(χ) = PR−1 …

A.4.2 Norm for decomposition … B Generalization to arbitrary spectra

The paper analyzes coefficient norms and shot allocations for decomposition-based first- and second-order derivatives, compares three Hessian-evaluation methods, and introduces the extension from equidistant to arbitrary frequencies.

  • A.4.2 Norm for decomposition: For a decomposition with P parametrized elementary gates, the first-order derivative sums separate two-term parameter-shift derivatives for each gate.The shifted decomposition uses 2P terms; choosing x1 = π/2 gives every coefficient magnitude 1/2.
  • A.4.2 Norm for decomposition: The optimal first-order shot allocation assigns N/(2P) shots to every decomposition term because all coefficients are equal.For the second-order derivative, the full Hessian is obtained by summing decomposition-based Hessian elements, without using the cheaper Hessian evaluation from Sec. 4.1.
  • A.4.2 Norm for decomposition: With π/2 shifts, off-diagonal second-order decomposition terms have 2P(P −1) coefficients of magnitude 1/2, while diagonal and unshifted terms have separately specified magnitudes.The optimal allocation uses N/(2P2) shots for shifted terms and N/(2P) shots for E(0).
  • A.5 Coefficient norms for the Hessian: For equidistant frequencies, the Hessian comparison considers the diagonal shift rule, repeated general parameter-shift rule, and decomposed repeated original rule.The diagonal approach reuses shifted evaluations from diagonal entries when computing off-diagonal entries.
  • A.5.1 Hessian shift rule: The diagonal Hessian shift rule uses the relation Rkm = Rk + Rm for equidistant frequencies and optimally allocates Ndiag shots across estimates.The resulting shot requirement targets Hessian precision ε, with single-shot variance denoted by σ2.
  • A.5.2 Repeated general parameter-shift rule: Repeatedly applying the univariate general parameter-shift rule produces 4RkRm terms for each Hessian element, with multiplicative first-order coefficients.Optimal allocation across Hessian entries yields a shot budget for precision ε.
  • A.5.3 Decomposition and repeated original shift rule: The decomposition-based repeated original shift rule produces 4PkPm coefficients of magnitude 1/4, and its precision-ε shot calculation replaces R by P.This method estimates all unique Hessian entries independently.
  • B Generalization to arbitrary spectra: The arbitrary-spectrum generalization addresses cost functions whose frequencies {Ωℓ} are not necessarily equidistant, unlike the predominantly integer-frequency setting studied earlier.The section focuses on how the changed frequency structure affects the cost.

B.1 Univariate functions … D.1 Extended QAD model for Pauli rotations

The appendices generalize parameter-shift methods to arbitrary spectra and stochastic multi-parameter gates, while extending QAD to match model parameters with evaluations for Pauli rotations. These generalizations alter evaluation costs substantially, especially for Hessians and metric-tensor entries.

  • B.1 Univariate functions: For arbitrary frequencies, nonuniform DFT reconstruction remains applicable, but equidistant shifts lose uniformity and closed-form parameter-shift rules are generally unavailable.The explicit rules for E′(0) and E′′(0) therefore do not generally apply.
  • B.1 Univariate functions: 2R evaluations suffice for odd-order derivatives, whereas nonperiodic even parts can require 2R + 1 evaluations overall.If all frequencies are commensurable with period T, evaluating E_even(T/2) removes the additional evaluation.
  • B.1 Univariate functions: For a rescaled elementary-gate decomposition, R = P^2 frequencies can make the decomposition-based rule beneficial; second-order requirements are similar when R = P.The comparison gives 2R + 1 evaluations for the generalized rule versus 2P^2 − P + 1 for the decomposition.
  • B.2 Multivariate functions: General spectra increase off-diagonal Hessian costs to 4R_kR_m + 2R_k + 2R_m − 3 evaluations, while the corresponding metric-tensor entry requires one fewer.The metric-tensor cost is 4R_kR_m + 2R_k + 2R_m − 4.
  • C General stochastic shift rule: The stochastic generalization combines the single-parameter rule with the stochastic parameter-shift result for unitaries U_F(x) = exp(i(xG + F)).It is implemented by sampling splitting times, combining shifted energies with coefficients y_μ, and averaging.
  • D Details on QAD: The QAD modifications discussed in this part comprise two of the three algorithmic modifications introduced earlier.This appendix section provides details on those two modifications.
  • D.1 Extended QAD model for Pauli rotations: The original QAD requires 2n^2 + n + 1 evaluations for n^2/2 + 3n/2 + 1 parameters, while the extended model uses 2n^2 + 1 evaluations and parameters.The extended model exactly reproduces the cost function on coordinate axes and every coordinate plane, and is restricted to Pauli rotations.

D.2 Trigonometric interpolation for QAD

The section generalizes QAD beyond Pauli rotations by proposing a full trigonometric interpolation model based on uni- and bivariate Fourier coefficients. The construction reconstructs coordinate restrictions through shifted evaluations and recovers the extended QAD model at unit frequencies.

  • Motivation: QAD’s Pauli-rotation-only assumption is relaxed by treating uni- and bivariate Fourier coefficients of E as model parameters.For multiple frequencies, the original correspondence between gradient/Hessian quantities and E(B), E(C,D) is not uniquely preserved.
  • First generalization: A first generalization combines generalized parameter-shift rules with the original single-frequency QAD model to preserve the correct second-order expansion locally.This approach exploits the evaluation savings of the generalized shift rules while using the model near x0.
  • Full trigonometric interpolation: The second generalization reconstructs E through full trigonometric interpolation up to second order, using shifted Dirichlet kernels for univariate coordinate restrictions.The univariate reconstruction matches E(x0 + xv_k) − E(x0) at 2R_k + 1 points and retains the same R_k integer frequencies.
  • Full trigonometric interpolation: Product kernels similarly reconstruct bivariate restrictions from doubly shifted evaluations after subtracting E(x0) and the univariate contributions.The terms are constructed without lower-order components, allowing their combination into a full interpolation model.
  • Resource count: The interpolation uses as many model parameters as function evaluations: 2(∥R∥2 1−∥R∥2 2+∥R∥1)+1.For R_k = 1 for every k, this becomes 2n2 + 1 evaluations and parameters; non-equidistant points require the same count.
Loading 2107.12390v3…