Source-linked AI summary
Measuring Analytic Gradients of General Quantum Evolution with the Stochastic Parameter Shift Rule
Leonardo Banchi, Gavin E. Crooks
TL;DR
Hybrid quantum-classical optimization uses measurement feedback to tune quantum states, but near-term devices are noisy and have limited circuit depth. This paper develops a stochastic gradient-estimation rule for general multi-qubit evolutions, reports variance comparable to the standard parameter-shift rule, and describes approximate use with noisy gates.
Problem
Method
A stochastic generalization of the parameter-shift rule estimates cost derivatives for multi-qubit evolutions without ancillary qubits or Hamiltonian simulation techniques.
Source: §1 · p. 1, §5 · pp. 8–9Results
The estimator’s variance is numerically comparable to the standard parameter-shift rule, and it applies approximately to noisy gates and complex parameter dependence.
Source: §1 · pp. 1–2, §5 · p. 9Takeaways & Limitations
The formulas extend parameter-shift gradient estimation to multi-qubit evolutions without restricting the operator spectrum.
Source: §5 · pp. 8–9For noisy gates, the algorithm may require approximating a highly tuned system-environment gate that the authors believe is generally unavailable for reasonable environment models.
Source: §4.2 · p. 8
Abstract
from arXiv · showhide
Hybrid quantum-classical optimization algorithms represent one of the most promising application for near-term quantum computers. In these algorithms the goal is to optimize an observable quantity with respect to some classical parameters, using feedback from measurements performed on the quantum device. Here we study the problem of estimating the gradient of the function to be optimized directly from quantum measurements, generalizing and simplifying some approaches present in the literature, such as the so-called parameter-shift rule. We derive a mathematically exact formula that provides a stochastic algorithm for estimating the gradient of any multi-qubit parametric quantum evolution, without the introduction of ancillary qubits or the use of Hamiltonian simulation techniques. The gradient measurement is possible when the underlying device can realize all Pauli rotations in the expansion of the Hamiltonian whose coefficients depend on the parameter. Our algorithm continues to work, although with some approximations, even when all the available quantum gates are noisy, for instance due to the coupling between the quantum device and an unknown environment.
1 Introduction
Near-term quantum devices motivate hybrid optimization, but estimating gradients is difficult for general parametric gates. The paper extends parameter-shift methods to general multi-qubit evolution and reports applicability to noisy, complex parameter-dependent gates.
1 Introduction
- Near-term devices are expected to be too noisy and circuit depth too limited for conventional algorithms requiring full quantum error correction.Source: §1 · p. 1
- Existing gradient methods apply only to restricted parametric gates, while the general case otherwise requires more-complex Hamiltonian simulation techniques.Source: §1 · p. 1
- The stochastic generalization estimates gradients for any multi-qubit evolution without ancillas or Hamiltonian simulation, exactly in the limit of many measurements.Its estimation variance is numerically comparable to that of the standard parameter-shift rule.Source: §1 · p. 1
- The procedure remains applicable, with approximations, when gates are noisy because the system couples to an unknown environment and gate dependence on parameters is complex.Source: §1 · p. 2
2 Background and notation
The section formulates observable optimization over parametrically prepared quantum states and places general gate evolution in context. It contrasts common gate forms and existing gradient methods with the paper’s target of general, potentially noncommuting evolution.
2 Background and notation
- The optimization task is to maximize or minimize an observable’s expected value for a state prepared by a parameterized unitary acting on a fixed reference state.Source: §2 · p. 2
- The framework covers variational ground-state approximation, quantum simulation, state synthesis, machine-learning classifiers, and quantum control.Gate simulation with a time-independent Hamiltonian can also be expressed in this optimization form.Source: §2 · p. 2
- A unitary may be represented as a matrix exponential and as a composition of simpler gates, while products of Pauli matrices provide a basis for multi-qubit Hermitian operators.Source: §2 · p. 2
- Common parametrizations use a single Pauli term or a parameter-independent Hamiltonian, but these forms do not model the most general physical evolution.Source: §2 · p. 2
- The standard parameter-shift rule requires a generator with two distinct eigenvalues, while the Hadamard test is more general but requires controlled operations and ancillas.The general gradient problem for potentially many-body gates remained open.Source: §2 · pp. 2–3
- The paper targets general evolutions such as e^{i(X+θV)} with noncommuting terms, and uses operator derivatives with Monte Carlo strategies to estimate gradients.The Leibniz rule separates derivatives across gates and parameters.Source: §2 · p. 3
3 Stochastic Parameter Shift Rule
The section extends parameter-shift gradient estimation to general quantum evolutions through a stochastic rule whose expected measurement outcome gives the gradient. It also develops a lower-operation optimization estimator and an approximate rule for devices with unavoidable gate drift.
3 Stochastic Parameter Shift Rule
- For H = 0, the standard parameter-shift rule gives the derivative from evaluations at x ± π/4 for Pauli-product gates.The standard rule also applies when the generator has only two distinct eigenvalues ±u.Source: §3 · p. 3, Figure 1 · p. 4
- The Stochastic Parameter Shift Rule generalizes gradient estimation to any operator H by combining operator differentiation with Monte Carlo sampling.Its measurement outcomes average to the exact gradient in the limit of many repetitions.Source: §3 · p. 4
- The stochastic rule has the same worst-case variance bound as the standard parameter-shift rule, and numerical estimates are reported as comparable in variance.The number of repetitions needed for a target precision depends on outcome variance.Source: §3 · pp. 4–5
3.1 Stochastic optimization
- A doubly stochastic estimator samples parameter and gate terms to obtain an unbiased gradient sample with significantly fewer operations.The paper also describes an unbiased sampling algorithm that uses a single device initialization.Source: §3.1 · p. 5
- Gradient estimates from the quantum device can feed classical stochastic gradient descent or ascent updates of the parameters.The paper describes this as a hybrid quantum-classical optimization approach.Source: §3.1 · p. 5
3.2 Quantum gates with unavoidable drift
- When the required gate is unavailable, an imperfect drifted gate gives an approximate rule whose bias is O(ε) if b can be set to O(ε^-1).For the cross-resonance example, exact- and approximate-gate estimates are nearly indistinguishable and close to finite-difference values; finite differences on hardware can have variance ≈ ε^-2 for small ε.Source: §3.2 · p. 6, Figure 4 · p. 6
4 Applications
The applications extend stochastic gradient estimation to pulse-controlled systems and noisy parametric gates, then use it to estimate the metric for quantum natural-gradient optimization. The noisy-gate procedure is conditional on stated approximations and has a practical boundary when it requires tuning a system–environment gate.
4.1 Quantum control with drift
- Pulse design discretizes control time into steps and optimizes pulse values; a Fourier-basis pulse instead permits gradients with respect to its amplitudes and phases.The discretization error is approximately NT ΔT^2.Source: §4.1 · p. 7
4.2 Parametric circuits with noisy quantum gates
- For reasonable environment models, the method’s required highly tuned gate coupling the register and environment is generally not possible.The limitation arises when applying Algorithm 3 to the Pauli-expanded register–environment coupling Hamiltonian.Source: §4.2 · pp. 7–8
- Under the stated approximations, derivatives with respect to θ can use the machine’s available operations, while τ is reserved for rescaling rather than optimization.The assumptions include no initial register–environment correlations, an environment state independent of θ and τ, and the ability to tune τ and, to some extent, θ.Source: §4.2 · pp. 7–8
4.3 Quantum Natural Gradient
- The quantum natural-gradient metric for noisy states is approximated for high-purity states and can be measured using the Stochastic Parameter Shift Rule with SWAP tests.The approximation is stated to be valid when the state has high purity.Source: §4.3 · p. 8
5 Conclusions
The paper derives exact gradient formulas for general multi-qubit evolutions and uses them to construct exact and approximate measurement algorithms. The approximate approach also applies to noisy gates with residual interactions.
5 Conclusions
- The formulas generalize the parameter-shift rule to general multi-qubit evolutions without spectrum restrictions, ancillary qubits, or Hamiltonian simulation.The paper identifies quantum optimization and machine-learning problems as main applications.Source: §5 · pp. 8–9
- Exact and approximate gradient-estimation algorithms use carefully designed quantum circuits; the approximate version addresses spurious interactions that cannot be completely removed.It can be applied with approximations when device gates are noisy.Source: §5 · p. 9
A Hadamard test
The appendix formulates the Hadamard test for general gates, but its efficient use depends on the Pauli expansion of an operator being tractable. For generic many-body operators, that condition may fail.
A Hadamard test
- The Hadamard test can be formally extended to general gates by expressing the relevant Hermitian operator in the Pauli basis.The expression uses an integral involving the evolved operator and the parameter-dependent operator.Source: A Hadamard test · p. 9
- Efficient estimation requires computable Pauli-expansion coefficients and sufficiently few nonzero terms.This condition holds when the operators act nontrivially on only a few qubits.Source: A Hadamard test · p. 9
- For generic many-body operators, obtaining the formal solution or a comparable method may be too difficult, and the nonzero Pauli terms are expected to grow exponentially with qubit count.Source: A Hadamard test · p. 9
B Explicit algorithms
The appendix gives explicit stochastic procedures whose samples are unbiased gradient estimators. It also describes a single-initialization variant and notes that shot allocation or variance reduction can reduce measurement needs.
B Explicit algorithms
- Algorithm 4 samples a uniform s, loops over relevant gate terms and both signs, measures the observable, and accumulates gradient contributions.The resulting sample gp has expectation ∂C/∂θp.Source: B Explicit algorithms · p. 9
- Repeating Algorithm 4 yields an estimate of the derivative because its samples are unbiased; the operations for one estimate scale as O(2TNp).Np is the number of nonzero derivatives ∂θpxt,ν(θ).Source: B Explicit algorithms · pp. 9–10
- The doubly stochastic rule samples s and a gate term before measuring plus and minus circuits to form an unbiased gradient sample.Algorithm 5 still resets the quantum computer twice for one estimate.Source: B Explicit algorithms · p. 10
- A further algorithm initializes the computer only once, while optimal shot allocation or variance-reduction techniques may reduce measurement counts.Source: B Explicit algorithms · p. 10
C Variance of gradient estimators
The section compares gradient-estimator variance, since the stochastic rule adds randomness and finite-sample error depends on estimator variance. Across the studied settings, the stochastic estimators have variance comparable to the standard parameter-shift rule, with little growth in qubit count for the chosen Hamiltonians.
C Variance of gradient estimators
- Both rules have outcomes with the gradient as their mean, but their variances can differ and therefore affect expected error at finite sample counts.The stochastic rule adds randomness by sampling over the classical parameter.Source: C Variance of gradient estimators · pp. 10–11
- The standard rule can estimate ∂tC when c = 0, but not ∂bC, so the comparison is limited to the t derivative.In this setting the operator in the exponential has two possible eigenvalues, allowing the standard parameter-shift rule for ∂tC.Source: C Variance of gradient estimators · p. 11
- Despite extra sampling steps, Algorithms 2 and 3 have standard deviations comparable to Algorithm 1 in the c = 0 comparison.Figure 6 reports empirical standard deviations for different b values; each point uses 10^4 samples.Source: C Variance of gradient estimators · p. 11, Figure 6 · p. 11
- The N-scaling comparison uses distinct related models because the standard rule cannot be applied to the nonzero-Hamiltonian model used for Algorithm 2.The standard-rule comparison instead uses a related model with H = 0; larger N values beyond 4 are not shown because they are similar to N = 4.Source: Figure 7 · p. 11, C Variance of gradient estimators · p. 12
- For the chosen Hamiltonians, both estimators’ standard deviations are of the same order and do not grow much with N.The stochastic estimator shows a slight non-monotonic increase, while the standard-rule results are basically independent of N; the authors attribute the difference mostly to the models not being identical.Source: Figure 7 · p. 11, C Variance of gradient estimators · p. 12