---
title: Second-Order Parameter-Shift Rules
url: https://www.emergentmind.com/topics/second-order-parameter-shift-rules
type: topic
---

# Second-Order Parameter-Shift Rules

A second-order parameter-shift rule is an analytic scheme for computing exact second derivatives (Hessian elements) of expectation values in parameterized quantum circuits, using only a finite set of circuit evaluations at specific parameter shifts. Such rules are essential for implementing curvature-aware quantum optimization algorithms, including Newton’s method or natural gradient approaches, within the variational quantum algorithm (VQA) framework. The derivations leverage the spectrum of gate generators being limited to two distinct eigenvalues, and the resulting rules generalize and formalize connections between parameter-shift rules and central finite-difference methods, with explicit formulas and minimality results on circuit evaluation requirements [2106.01388], [2008.06517].

## 1. Mathematical Foundation of Parameter-Shift Rules

The general objective is to obtain analytic expressions for derivatives of cost functions $f(\theta) = \langle\psi| U(\theta)^\dagger A U(\theta) |\psi\rangle$ with respect to parameters of gates $U(\theta) = e^{-i\theta G}$ where the Hermitian generator $G$ has two distinct eigenvalues $\pm r$ (i.e., $G^2 = r^2 I$) [2106.01388], [2008.06517]. 

A central construct is the “generalized parameter-shift rule” (gPSR):

\[
\mathrm{gPSR}(\theta; y_1, y_2) = r [f(\theta + y_1) - f(\theta + y_2)]
\]

which decomposes as follows (Theorem 1 in [2106.01388]):

\[
\mathrm{gPSR}(\theta; y_1, y_2) = \left[ \frac{\sin(2r y_1) + \sin(2r y_2)}{\cos(2r y_1) - \cos(2r y_2)} \right] f'(\theta)
- 2r \left[ \frac{1}{\cos(2r y_1) - \cos(2r y_2)} \right] f''(\theta)
\]

By suitable choices of $y_1, y_2$, one isolates either $f'(\theta)$ or $f''(\theta)$, yielding exact analytic formulas for first and second derivatives, respectively.

## 2. Explicit Second-Order Parameter-Shift Formulas

Closed-form shift rules allow the computation of Hessian elements directly from shifted circuit evaluations, without numerical finite-difference approximations.

**Pure second derivative ($\partial^2 f/\partial \theta^2$):**
Take $y_1 = +\pi/(2r)$, $y_2 = -\pi/(2r)$ (so $\sin(2r y_1) = 1$, $\sin(2r y_2) = -1$, $\cos(2r y_1) = 0$):

\[
\frac{\partial^2 f}{\partial \theta^2}(\theta) = r^2 \left[ f\left(\theta + \frac{\pi}{2r}\right) + f\left(\theta - \frac{\pi}{2r}\right) - 2 f(\theta) \right]
\]

This formula requires three circuit evaluations at $\theta$, $\theta \pm \frac{\pi}{2r}$ [2106.01388].

**Mixed second derivative ($\partial^2 f/\partial\theta_i \partial\theta_j$):**
If both generators have two eigenvalues and (optionally) commute,

Let $s = \pi/(4r)$. Then:

\[
\frac{\partial^2 f}{\partial \theta_i \partial \theta_j}(\theta_i, \theta_j) = \frac{r^2}{4} \left[
    f(\theta_i + s, \theta_j + s)
  - f(\theta_i + s, \theta_j - s)
  - f(\theta_i - s, \theta_j + s)
  + f(\theta_i - s, \theta_j - s)
\right]
\]

This requires circuit calls at all $(\theta_i \pm s, \theta_j \pm s)$ [2106.01388], [2008.06517].

## 3. Relationship to First-Order Rules and Finite Differences

The gPSR framework notes that standard parameter-shift and central finite-difference rules are special or limiting cases:

- **First-order PSR**: For $y_1 = s$, $y_2 = -s$, $f'(\theta) = [\mathrm{gPSR}(\theta; s, -s)] / [\sin(2rs)]$. 
- **Standard case ($s = \pi/(4r)$):**
  \[
  f'(\theta) = r [f(\theta + \pi/(4r)) - f(\theta - \pi/(4r))]
  \]
- **Central finite difference**: For $y_1 = y_2 = h$ with $h \ll 1/r$, the rule approximates the first derivative with bias $O(h^2)$.

The unifying gPSR shows that all higher-order derivatives $f^{(n)}(\theta)$ may in principle be constructed from combinations of first and second derivatives utilizing these shift data [2106.01388].

## 4. Circuit Evaluation Counts and Minimality

Circuit call requirements are fundamental for hardware execution cost:

| Derivative              | Exact evaluations | Minimal achievable | Finite-difference (approx) |
|-------------------------|------------------|--------------------|----------------------------|
| First-order             | 2                | 2                  | 2 (with bias)              |
| Second order (pure)     | 3                | 3                  | 3 (with bias)              |
| Second order (cross)    | 4                | 4                  | 4 (with bias)              |

No analytic rule for exact $f'(\theta)$ using only one shifted and one reference evaluation exists for general two-eigenvalue generators (Theorem 2, [2106.01388]); the same lower bound extends to second order derivatives. There is a strict separation between the number of evaluations required for exact results and for bias-prone finite-difference estimators.

## 5. Statistical Properties and Practical Implementation

Analytic shift rules are unbiased at the level of true expectation values, but in physical realizations the estimators suffer from finite-shot noise:

- The variance of gradient and Hessian estimators is explicitly computable. For example, off-diagonal Hessian via $s = \pi/2$ has $\Delta[g_{ij}] = \sigma_0^2/(4N)$ with $N$ shots per term [2008.06517].
- Analytic shift rules (s = $\pi/2$) asymptotically achieve mean squared error $\sim N^{-1}$, while finite-difference estimators display increased bias and variance scaling as $O(N^{-2/3})$ at best.
- Experiments (IBM Q) confirmed measurement of a $5 \times 5$ Hessian with relative errors $\lesssim 10^{-3}$ and validated that analytic shift rules outperform finite differences for $N \geq 50$ shots. These results demonstrate the practicality of employing such estimators directly on near-term hardware [2008.06517].

## 6. Generalizations, Limitations, and Applications

**Gate generator assumption:** All outlined shift rules require gate generators with spectra exactly $\{+r, -r\}$. For gates with more eigenvalues, decomposition into two-eigenvalue gates or extension via randomized-shift or higher-order rules is required [2106.01388].

**Cost function broadness:** The rules apply to any expectation value of the type $f(\theta) = \langle\psi|U^\dagger(\theta)AU(\theta)|\psi\rangle$.

**Geometric tensor and quantum optimization:** The same analytic 4-shift formula computes the quantum geometric tensor (Fubini-Study metric tensor) up to a prefactor, supporting the implementation of quantum natural-gradient optimizers [2008.06517].

**Hardware-depth trade-offs:** The three or four circuit evaluations required for exact Hessian estimation increase the quantum-classical loop cost, and practical optimization must balance this against the acceleration—e.g., in convergence—afforded by second-order methods.

**Potential extensions:** The generalized PSR points to systematic ways of deriving higher-order, possibly more hardware-efficient, estimators for derivatives, as well as to bias-variance trade-offs for approximate rules using tunable shifts or scaling factors [2106.01388], [2008.06517].

## 7. Summary of Key Results and Research Impact

Second-order parameter-shift rules, as formalized by Hubregtsen et al. [2106.01388] and evaluated in hardware by Wierichs et al. [2008.06517], provide a complete framework for analytic, unbiased, and shot-efficient measurement of gradients and Hessians in variational quantum algorithms with gates of two-level generators. The minimality of circuit evaluation count is proven, and all standard parameter-shift and central finite-difference formulas emerge as limiting or special cases within this theory. These results underpin the practical implementation of second-order optimization (Newton, diagonal Newton, natural gradient) and metric tensor measurement on near-term quantum hardware. Future work aims to extend shift-rule techniques to more general or efficient estimators, including for non-binary gate spectra and for Hessian–vector products relevant for large-scale optimization.

Source: https://www.emergentmind.com/topics/second-order-parameter-shift-rules