Cost-Function and Measurement Estimation in Variational Algorithms

A variational quantum algorithm asks the processor to do one arithmetic task over and over: prepare a trial state and report a single number, the energy E(θ)=⟨ψ(θ)∣H∣ψ(θ)⟩E(\boldsymbol\theta)=\langle\psi(\boldsymbol\theta)|H|\psi(\boldsymbol\theta)\rangle. But a quantum computer cannot read that number off a dial. It can only collapse a state and hand back a bitstring. Everything that stands between "prepare ∣ψ(θ)⟩|\psi(\boldsymbol\theta)\rangle" and "here is its energy to chemical accuracy" is the subject of this article — the theory and engineering of converting projective measurements into an accurate estimate of a cost function and its gradient with the fewest possible circuit executions. This deep-tier article owns the measurement layer its siblings borrow. It takes the parameterized-circuit machinery from aq-qci-parameterized-quantum-circuits-ansatze, supplies the cost-and-shot apparatus that aq-qci-variational-quantum-eigensolver and aq-qci-quantum-approximate-optimization-algorithm call upon, and feeds the gradient estimators of aq-qci-parameter-shift-rules-gradients. Three ideas organize everything. First, the Pauli decomposition H=∑kckPkH=\sum_k c_k P_k turns "measure an energy" into "average many ±1\pm1 readings," so the currency is not gate depth but the number of shots. Second, because the outcomes are bounded random variables, their variance — not the term count — sets the budget, and reaching precision ϵ\epsilon costs of order 1/ϵ21/\epsilon^2 measurements. Third, the two levers that fight that cost are operator grouping (measuring commuting Paulis together) and optimal shot allocation (spending where coefficient-times-uncertainty is largest). Master them and the estimator variance falls toward an irreducible floor; ignore them and even a two-qubit molecule demands a million shots per energy.

Key takeaways
  • A variational cost is the expectation value of a Pauli-decomposed observable, E=∑kck⟨Pk⟩E=\sum_k c_k\langle P_k\rangle; each ⟨Pk⟩\langle P_k\rangle must be estimated from finitely many ±1\pm1 measurement shots.
  • One ±1\pm1 reading has variance 1−⟨Pk⟩2≤11-\langle P_k\rangle^2\le1, so the sample mean's error falls only as 1/M1/\sqrt{M}, and hitting additive precision ϵ\epsilon needs M=O(σ2/ϵ2)M=\mathcal{O}(\sigma^2/\epsilon^2) shots.
  • Under a fixed budget the variance-minimizing split is Mk⋆∝∣ck∣σkM_k^\star\propto|c_k|\sigma_k, giving an irreducible floor Var[E^]=(∑k∣ck∣σk)2/M\mathrm{Var}[\hat E]=(\sum_k|c_k|\sigma_k)^2/M — the weighted ℓ1\ell_1 norm squared over the budget.
  • Commuting Paulis share an eigenbasis and are measured together: qubit-wise commuting groups need only single-qubit rotations, while general commuting groups need a Clifford diagonalization.
  • The right figure of merit for a shared measurement is the quantum variance of the group's partial Hamiltonian ⟨HG2⟩−⟨HG⟩2\langle H_G^2\rangle-\langle H_G\rangle^2, not the naive sum of term variances.
  • The same estimator feeds parameter-shift gradients; when the landscape is a barren plateau the gradient shrinks like 2−n2^{-n} and the shot cost explodes as 2n2^{n}, a wall no grouping trick can breach.
  • Key idea: the wall-clock cost of a variational algorithm is governed not by circuit depth but by the variance of the shot estimator, Var[E^]=1M(∑k∣ck∣σk)2\mathrm{Var}[\hat E]=\tfrac1M(\sum_k|c_k|\sigma_k)^2 at best; grouping commuting Paulis and allocating shots optimally squeezes this variance toward its floor.
The core insight

The wall-clock cost of a variational algorithm is governed not by circuit depth but by the variance of the shot estimator: at best Var[E^]=1M(∑k∣ck∣1−⟨Pk⟩2)2\mathrm{Var}[\hat E]=\tfrac1M(\sum_k|c_k|\sqrt{1-\langle P_k\rangle^2})^2. Grouping commuting Paulis and allocating shots by ∣ck∣σk|c_k|\sigma_k pushes this variance toward an irreducible floor.

Where this lives today

Measurement estimation is the live bottleneck of the noisy intermediate-scale quantum (NISQ) era, the frontier where variational algorithms are made or broken. Every major software stack — Qiskit Nature, PennyLane, OpenFermion — ships the grouping machinery of this article as a primitive: qubit-wise cliques found by graph coloring, general commuting cliques diagonalized by Clifford circuits, and weighted shot allocation. On top of these sit newer estimators: classical shadows and their derandomized variants predict many observables from randomized measurements with logarithmic sample complexity, now standard for energies, fidelities, and entropies; low-rank and double-factorization decompositions reorganize the O(N4)\mathcal{O}(N^4) molecular terms into a handful of measurable fragments, cutting the shot-budget constant by orders of magnitude. These were essential to real experiments — Google's 2020 Hartree–Fock demonstration on twelve Sycamore qubits and IBM's hardware-efficient VQE runs on LiH and BeH₂ leaned on grouping and heavy error mitigation to survive. The open problem is quantitative: chemical accuracy beyond classical reach still implies shot counts current devices cannot deliver in reasonable wall-clock time, which is why measurement-estimation research is as central to quantum advantage as the qubits themselves.

The physical picture

Think of the Hamiltonian as a shopping list of Pauli observables, each with a price ckc_k. You can only buy an estimate one coin-flip at a time — every measurement returns ±1\pm1 — and pinning one item's expectation to accuracy ϵ\epsilon takes about 1/ϵ21/\epsilon^2 flips. Measurement estimation is the discipline of bundling items you can buy together (commuting Paulis, which share an eigenbasis) and spending your finite shot budget where the price-times-uncertainty ∣ck∣σk|c_k|\sigma_k is highest. The first figure follows one energy through that pipeline: decompose, group, sample, sum.

Figure
The measurement pipeline: a Hamiltonian H = Σ cₖ Pₖ is split into commuting Pauli groups that share one measurement setting, each shot returns ±1 eigenvalues whose average estimates ⟨Pₖ⟩, and the weighted sum gives the energy with a standard error fixed by the ℓ₁-weighted spread of the coefficients over √M
From Hamiltonian to energy: decompose → group → sample ±1 → weighted sum Pauli decomposition H = Σₖ cₖ Pₖ c₁ Z₀Z₁ c₂ Z₀ c₃ X₀X₁ c₄ Y₀Y₁ a weighted list of ±1 observables Commuting groups group 1 · Z basis Z₀Z₁ , Z₀ group 2 · Bell basis X₀X₁ , Y₀Y₁ commuting Paulis → one measurement setting shared across the group Sample ±1, average 00 → +1 11 → +1 01 → −1 10 → −1 ⟨Pₖ⟩ = (1/M) Σₛ λₛ Var = (1 − ⟨Pₖ⟩²)/M each bit-parity over the support is one ±1 eigenvalue E = Σₖ cₖ ⟨Pₖ⟩ standard error ≈ (Σₖ |cₖ| σₖ) / √M — shots, not depth, set the cost

Commutation is the geometry behind the bundling. Two observables commute if and only if they share an eigenbasis, so one measurement reveals both eigenvalues at once. Qubit-wise commuting strings such as Z0Z1Z_0Z_1 and Z0Z_0 share a product basis — you only relabel single-qubit axes, essentially free. Generally commuting strings such as X0X1X_0X_1 and Y0Y1Y_0Y_1 share an entangled basis (here the Bell basis), so a Clifford circuit runs before measuring: you pay in two-qubit gates but harvest several terms from one setting. Yet grouping is only half the story — the variance, not the number of settings, is the true cost. A diagonal QAOA Hamiltonian needs a single basis yet still demands many shots because its cost-function variance can be large; a chemistry Hamiltonian with millions of terms may have modest variance if its coefficients are small. The second figure shows the quantity that decides feasibility: how the error shrinks with shot count, and exactly how many measurements chemical accuracy costs for a real molecule.

Figure
Shot-noise convergence for the two-qubit H₂ Hamiltonian: with weighted ℓ₁ norm ≈ 1.53 Ha, the standard error falls only as 1.53/√M, so reaching chemical accuracy ε = 1.6 mHa needs about M ≈ 9.2×10⁵ shots for a single energy — the straight log–log line has slope −1/2
The punchline: error ε = 1.53/√M — chemical accuracy costs ≈ 9.2×10⁵ shots 10⁻¹ 10⁻² 10⁻³ 10⁻⁴ 10² 10³ 10⁴ 10⁵ 10⁶ 10⁷ number of shots M standard error ε (Ha) chemical accuracy ε = 1.6 mHa M ≈ 9.2×10⁵ shots slope −1/2 (shot noise) halve ε ⇒ 4× the shots

The core equations

The cost is linear in HH, and HH expands in the Pauli basis — the natural operator alphabet of qubits. So the energy is a weighted sum of Pauli averages, each readable directly on hardware. This one line is where the labor splits: the device supplies each ⟨Pk⟩\langle P_k\rangle, the classical computer supplies the coefficients and the sum.

E(θ)=⟨ψ(θ)∣H∣ψ(θ)⟩=∑kck ⟨ψ(θ)∣Pk∣ψ(θ)⟩(1)E(\boldsymbol\theta)=\langle\psi(\boldsymbol\theta)|H|\psi(\boldsymbol\theta)\rangle=\sum_{k}c_k\,\langle\psi(\boldsymbol\theta)|P_k|\psi(\boldsymbol\theta)\rangle \qquad (1)

where: E(θ)E(\boldsymbol\theta) — the variational cost to be minimized; ∣ψ(θ)⟩|\psi(\boldsymbol\theta)\rangle — ansatz state from a parameterized circuit; H=∑kckPkH=\sum_k c_k P_k — Hamiltonian as a real-weighted sum of Pauli strings; ck∈Rc_k\in\mathbb{R} — coefficient (real because H=H†H=H^\dagger); PkP_k — tensor product of {I,X,Y,Z}\{I,X,Y,Z\}, a Hermitian unitary with Pk2=IP_k^2=I. Read it as a division of labor: measure the parts, combine them classically. Each ⟨Pk⟩\langle P_k\rangle is estimated the only way hardware allows — rotate into the Pauli's eigenbasis, sample, and average the ±1\pm1 eigenvalues. Because Pk2=IP_k^2=I the eigenvalues are exactly ±1\pm1, which fixes both unbiasedness and variance at once.

e^k=1Mk∑s=1Mkλs(k),λs(k)∈{+1,−1},Var(λs(k))=1−⟨Pk⟩2(2)\hat{e}_k=\frac{1}{M_k}\sum_{s=1}^{M_k}\lambda_s^{(k)},\quad \lambda_s^{(k)}\in\{+1,-1\},\qquad \mathrm{Var}\big(\lambda_s^{(k)}\big)=1-\langle P_k\rangle^2 \qquad (2)

where: e^k\hat e_k — empirical estimate of ⟨Pk⟩\langle P_k\rangle; MkM_k — shots allocated to term kk; λs(k)\lambda_s^{(k)} — the ±1\pm1 eigenvalue measured on shot ss; 1−⟨Pk⟩21-\langle P_k\rangle^2 — the single-shot variance, maximal (=1=1) when ⟨Pk⟩=0\langle P_k\rangle=0 and zero when the state is a ±1\pm1 eigenstate. The per-shot variance is bounded by unity because the outcomes are. Averaging MkM_k independent shots divides the single-shot variance by MkM_k, and summing coefficient-weighted term estimates adds their variances. This is the master cost formula: the total variance is a coefficient-weighted sum of per-term variances, each inversely proportional to the shots spent on it.

Var(E^)=∑kck2 (1−⟨Pk⟩2)Mk=∑kck2σk2Mk(3)\mathrm{Var}(\hat E)=\sum_{k}\frac{c_k^2\,\big(1-\langle P_k\rangle^2\big)}{M_k}=\sum_k\frac{c_k^2\sigma_k^2}{M_k} \qquad (3)

where: E^=∑kcke^k\hat E=\sum_k c_k\hat e_k — the full cost estimator; σk=1−⟨Pk⟩2\sigma_k=\sqrt{1-\langle P_k\rangle^2} — standard deviation of term kk; MkM_k — shots per term, summing to the total budget M=∑kMkM=\sum_k M_k. The formula assumes the terms are measured in independent shot pools; sharing shots within a commuting group replaces the term-by-term sum with a group variance (equation 5). Given a fixed budget, how should the shots be split? Minimizing equation (3) under ∑kMk=M\sum_k M_k=M by a Lagrange multiplier gives a clean weighted rule, and substituting it back yields the smallest variance any allocation can reach — the irreducible floor set by the weighted ℓ1\ell_1 norm of the coefficients.

Mk⋆=M ∣ck∣ σk∑j∣cj∣ σj,Var(E^)min⁡=(∑k∣ck∣σk)2M(4)M_k^{\star}=M\,\frac{|c_k|\,\sigma_k}{\sum_j |c_j|\,\sigma_j},\qquad \mathrm{Var}(\hat E)_{\min}=\frac{\big(\sum_k|c_k|\sigma_k\big)^2}{M} \qquad (4)

where: Mk⋆M_k^\star — variance-minimizing shots for term (or group) kk; ∑k∣ck∣σk\sum_k|c_k|\sigma_k — the weighted ℓ1\ell_1 norm, the single quantity that controls the shot budget. Uniform allocation is strictly worse; the optimum funds the terms with large coefficient and large uncertainty. The lever that beats term-by-term measurement is commutation. Two Pauli strings can be read from the same measurement record exactly when they commute, and the variance of that shared estimator is not the sum of the pieces but the full quantum variance of the group's partial Hamiltonian in the trial state.

[Pj,Pk]=0 ⟺ jointly measurable,Var(∑ℓ∈Gcℓe^(ℓ))=⟨HG2⟩−⟨HG⟩2MG,  HG=∑ℓ∈GcℓPℓ(5)[P_j,P_k]=0\ \Longleftrightarrow\ \text{jointly measurable},\qquad \mathrm{Var}\Big(\textstyle\sum_{\ell\in G}c_\ell\hat e^{(\ell)}\Big)=\frac{\langle H_G^2\rangle-\langle H_G\rangle^2}{M_G},\ \ H_G=\sum_{\ell\in G}c_\ell P_\ell \qquad (5)

where: GG — a group of mutually commuting Paulis; HGH_G — the partial Hamiltonian of that group; MGM_G — shots spent on the group's single measurement setting. Two strings commute iff they differ in an even number of anticommuting single-qubit factors; the covariances that sharing shots induces are already inside ⟨HG2⟩\langle H_G^2\rangle. For a worst-case guarantee independent of the state, treat each shot as a bounded draw of HH in [−Λ,Λ][-\Lambda,\Lambda] with Λ=∑k∣ck∣\Lambda=\sum_k|c_k| and apply Hoeffding's inequality — a distribution-free confidence bound with the same Λ2/ϵ2\Lambda^2/\epsilon^2 scaling.

M ≥ 2Λ2ϵ2 ln⁡ ⁣2δ,Λ=∑k∣ck∣(6)M\ \ge\ \frac{2\Lambda^2}{\epsilon^2}\,\ln\!\frac{2}{\delta},\qquad \Lambda=\sum_k|c_k| \qquad (6)

where: ϵ\epsilon — target additive error on EE; δ\delta — failure probability, Pr(∣E^−E∣>ϵ)≤δ\mathrm{Pr}(|\hat E-E|>\epsilon)\le\delta; Λ\Lambda — the (unweighted) ℓ1\ell_1 norm bounding the range of HH. Because σk≤1\sigma_k\le1, the variance floor (∑k∣ck∣σk)2(\sum_k|c_k|\sigma_k)^2 is never larger than Λ2\Lambda^2, so equation (6) is the conservative sibling of equation (4). Finally, the same estimator supplies gradients. The parameter-shift rule (owned by aq-qci-parameter-shift-rules-gradients, recalled here) writes each partial derivative as a difference of two energies, so gradient descent is built entirely from cost evaluations already analyzed.

∂E∂θj=12[E(θ+π2ej)−E(θ−π2ej)](7)\frac{\partial E}{\partial\theta_j}=\frac{1}{2}\Big[E\big(\boldsymbol\theta+\tfrac{\pi}{2}\mathbf{e}_j\big)-E\big(\boldsymbol\theta-\tfrac{\pi}{2}\mathbf{e}_j\big)\Big] \qquad (7)

where: θj\theta_j — a circuit parameter entering through a Pauli-rotation gate e−iθjG/2e^{-i\theta_j G/2} with G2=IG^2=I; ej\mathbf{e}_j — unit vector shifting only θj\theta_j. Each shifted energy carries the full measurement cost of equation (4), so a pp-parameter gradient multiplies the shot budget by roughly 2p2p.

Derivation AFrom shots to precision and the variance-optimal shot allocation

The goal is to turn the loose intuition that an expectation value costs about 1/ϵ21/\epsilon^2 measurements into a precise formula for the shot budget of a full Hamiltonian, and to discover how a fixed budget should be split among the Pauli terms so the energy's variance is as small as possible. We start from a single ±1\pm1 measurement, build the per-term and total estimator variances, minimize under the fixed-budget constraint by a Lagrange multiplier, and read off both the optimal allocation and the irreducible variance floor it achieves.

Step 1. A single measurement of PkP_k in its eigenbasis returns λ∈{+1,−1}\lambda\in\{+1,-1\} with E[λ]=⟨Pk⟩\mathbb{E}[\lambda]=\langle P_k\rangle by the Born rule, and since λ2=1\lambda^2=1 the per-shot variance is Var(λ)=E[λ2]−E[λ]2=1−⟨Pk⟩2≡σk2\mathrm{Var}(\lambda)=\mathbb{E}[\lambda^2]-\mathbb{E}[\lambda]^2=1-\langle P_k\rangle^2\equiv\sigma_k^2. Averaging MkM_k i.i.d. shots gives Var(e^k)=σk2/Mk\mathrm{Var}(\hat e_k)=\sigma_k^2/M_k. Why: the bounded ±1\pm1 range is exactly what makes the single-shot variance at most one, so the whole cost analysis rests on counting shots rather than tracking amplitudes.

Step 2. By linearity E^=∑kcke^k\hat E=\sum_k c_k\hat e_k, and independence of the separate shot pools makes the variances add, Var(E^)=∑kck2σk2/Mk\mathrm{Var}(\hat E)=\sum_k c_k^2\sigma_k^2/M_k. Demanding a single term reach precision ϵ\epsilon already forces Mk≥σk2/ϵ2M_k\ge\sigma_k^2/\epsilon^2 — the 1/ϵ21/\epsilon^2 law. Why: this exposes the fundamental scaling before any optimization, and shows the square-root standard error cannot be beaten by classical post-processing of projective data.

Step 3. To split a fixed budget optimally, minimize ∑kck2σk2/Mk\sum_k c_k^2\sigma_k^2/M_k subject to ∑kMk=M\sum_k M_k=M with the Lagrangian L=∑kck2σk2/Mk+μ(∑kMk−M)\mathcal{L}=\sum_k c_k^2\sigma_k^2/M_k+\mu(\sum_k M_k-M). Stationarity ∂L/∂Mk=−ck2σk2/Mk2+μ=0\partial\mathcal{L}/\partial M_k=-c_k^2\sigma_k^2/M_k^2+\mu=0 gives Mk∝∣ck∣σkM_k\propto|c_k|\sigma_k. Why: at the optimum, moving one shot from any term to any other cannot lower the variance, which is precisely this term-by-term balance condition.

Step 4. Fix the multiplier from the budget: ∑kMk=M\sum_k M_k=M gives Mk⋆=M ∣ck∣σk/∑j∣cj∣σjM_k^\star=M\,|c_k|\sigma_k/\sum_j|c_j|\sigma_j, and substituting back yields Var(E^)min⁡=(∑k∣ck∣σk)2/M\mathrm{Var}(\hat E)_{\min}=(\sum_k|c_k|\sigma_k)^2/M. Setting this equal to ϵ2\epsilon^2 gives the total budget M=(∑k∣ck∣σk)2/ϵ2M=(\sum_k|c_k|\sigma_k)^2/\epsilon^2. Why: the minimal variance is the square of the weighted ℓ1\ell_1 norm over the budget — the single compact statement of why many-term chemistry Hamiltonians are so expensive to measure. *Verified: reduces to the standard VQE shot estimate. Setting every ⟨Pk⟩=0\langle P_k\rangle=0 so σk=1\sigma_k=1 recovers the often-quoted worst case M=(∑k∣ck∣)2/ϵ2M=(\sum_k|c_k|)^2/\epsilon^2, consistent with Nielsen and Chuang §2.2. For H₂ with ∑k∣ck∣σk≈1.53\sum_k|c_k|\sigma_k\approx1.53 Ha and ϵ=1.6×10−3\epsilon=1.6\times10^{-3} Ha, M≈(1.53/1.6×10−3)2≈9.2×105M\approx(1.53/1.6\times10^{-3})^2\approx9.2\times10^5 shots.*

Go deeper · Derivation B · 2 minSimultaneous measurement of a commuting group and its true variance
Derivation BSimultaneous measurement of a commuting group and its true variance

The goal is to prove that commuting Pauli operators can be read from the very same measurement record, to distinguish the cheap qubit-wise case from the general case that needs a Clifford circuit, and — most importantly — to identify the correct figure of merit for a shared measurement, which is not the naive sum of term variances but the full quantum variance of the group's partial Hamiltonian in the trial state. We construct the joint estimator, expose the covariances that sharing shots induces, and collapse them into that single group variance.

Step 1. For a qubit-wise commuting group, every member carries the same non-identity Pauli or identity on each qubit, so one setting diagonalizes them all: apply HH (Hadamard) where the group's Pauli is XX, HS†HS^\dagger where it is YY, nothing where it is ZZ or II, then measure in the computational basis. Each bitstring bs\mathbf b_s yields every member's eigenvalue as a parity, λs(ℓ)=∏q∈supp(Pℓ)(−1)bs,q\lambda_s^{(\ell)}=\prod_{q\in\mathrm{supp}(P_\ell)}(-1)^{b_{s,q}}. Why: because the members agree qubit-by-qubit, a product of single-qubit rotations suffices — no entangling gate — which is why qubit-wise grouping is nearly free.

Step 2. For a group that commutes only in general (for example X0X1X_0X_1 and Y0Y1Y_0Y_1, which anticommute on each qubit yet commute as strings because two sign flips cancel), no product basis works; a Clifford circuit maps the whole group to diagonal form before measurement. The joint estimator has the same parity form but is read after that Clifford. Why: general commutation buys larger groups and fewer settings, paid for in two-qubit gate depth and its noise — the central grouping trade-off.

Step 3. Sharing one shot record correlates the term estimates: Cov(e^(ℓ),e^(ℓ′))=(⟨PℓPℓ′⟩−⟨Pℓ⟩⟨Pℓ′⟩)/MG\mathrm{Cov}(\hat e^{(\ell)},\hat e^{(\ell')})=(\langle P_\ell P_{\ell'}\rangle-\langle P_\ell\rangle\langle P_{\ell'}\rangle)/M_G, and the product PℓPℓ′P_\ell P_{\ell'} is itself a Pauli in the group's algebra. Why: this is exactly why you may not treat grouped estimates as independent — the covariances are real and can be sizeable.

Step 4. Assemble the group estimator E^G=∑ℓcℓe^(ℓ)\hat E_G=\sum_\ell c_\ell\hat e^{(\ell)} and collect all variances and covariances; they sum to Var(E^G)=1MG(⟨HG2⟩−⟨HG⟩2)\mathrm{Var}(\hat E_G)=\tfrac1{M_G}(\langle H_G^2\rangle-\langle H_G\rangle^2) with HG=∑ℓcℓPℓH_G=\sum_\ell c_\ell P_\ell. Why: the correct cost of a shared measurement is the genuine quantum variance of the partial Hamiltonian in ∣ψ⟩|\psi\rangle, not the naive ∑ℓcℓ2σℓ2\sum_\ell c_\ell^2\sigma_\ell^2 — a poor grouping can raise this and lose the amortization it seemed to buy. *Verified: consistent with the Pauli algebra in Nielsen and Chuang §4.2. Products of commuting strings stay in the shared eigenbasis, so the joint parity estimator is well-defined and unbiased; the covariance collapse reproduces the operator identity Var(HG)=⟨HG2⟩−⟨HG⟩2\mathrm{Var}(H_G)=\langle H_G^2\rangle-\langle H_G\rangle^2.*

Go deeper · Derivation C · 1 minWhy barren plateaus make the shot budget explode
Derivation CWhy barren plateaus make the shot budget explode

The goal is to show why the machinery of grouping and optimal allocation cannot rescue a variational algorithm once its landscape flattens into a barren plateau, by tracing how an exponentially small gradient collides with the unavoidable 1/M1/\sqrt{M} shot-noise floor. We estimate the parameter-shift gradient's variance, demand the true gradient rise above that noise to be detectable, and insert the plateau's exponential scaling to expose a measurement cost that grows exponentially in qubit number and that no partitioning trick can remove. Take a landscape with E[∂jE]=0\mathbb{E}[\partial_j E]=0 and Var[∂jE]∼2−n\mathrm{Var}[\partial_j E]\sim2^{-n} for nn qubits.

Step 1. The parameter-shift gradient is a difference of two sampled energies, so its estimator inherits an O(1/M)\mathcal{O}(1/M) variance, Var(∂jE^)=14(Var(E^+)+Var(E^−))∼1/M\mathrm{Var}(\widehat{\partial_j E})=\tfrac14(\mathrm{Var}(\hat E_+)+\mathrm{Var}(\hat E_-))\sim1/M. Why: gradients are built from the very cost estimators analyzed above, so they carry the same shot-noise floor and no better.

Step 2. To resolve the gradient's direction the true value must exceed the estimator's standard deviation, ∣∂jE∣/Var(∂jE^)≳1|\partial_j E|/\sqrt{\mathrm{Var}(\widehat{\partial_j E})}\gtrsim1, i.e. the signal must beat the shot noise. Why: below this signal-to-noise threshold the measured gradient is indistinguishable from a random walk and the optimizer sees no downhill direction.

Step 3. Insert the plateau scaling: a typical gradient magnitude is ∼2−n/2\sim2^{-n/2}, so 2−n/2≳1/M2^{-n/2}\gtrsim1/\sqrt{M} forces M≳2nM\gtrsim2^{n} (and resolving a relative error δ\delta pushes it to ∼22n/δ2\sim2^{2n}/\delta^2). Why: the exponentially small signal demands an exponentially large sample to lift it above the noise floor.

Step 4. Note what does not help: the floor comes from the physics of the landscape, not from how HH is partitioned, so grouping and optimal allocation — which only rescale the constant in front of 1/M1/\sqrt{M} — cannot touch the exponential. Why: this cleanly separates the measurement problem this article solves from the trainability problem owned by aq-qci-barren-plateaus, which must be attacked upstream by ansatz design. *Verified: reproduces the standard barren-plateau trainability obstruction. Exponential shot scaling M≳2nM\gtrsim2^n follows directly from Var[∂jE]∼2−n\mathrm{Var}[\partial_j E]\sim2^{-n} combined with the central-limit 1/M1/\sqrt{M} noise floor (McClean et al., 2018).*

Limiting cases

The shot cost changes character sharply across regimes; the table names the four that dominate practice.

CaseResultMeaning
Single Pauli, idealM=1−⟨Pk⟩2ϵ2≤1ϵ2M=\dfrac{1-\langle P_k\rangle^2}{\epsilon^2}\le\dfrac{1}{\epsilon^2}one ±1\pm1 observable; worst case ⟨Pk⟩=0\langle P_k\rangle=0 needs 1/ϵ21/\epsilon^2 shots, an eigenstate needs none
Full Hamiltonian, weightedM=(∑k∣ck∣σk)2ϵ2M=\dfrac{\big(\sum_k|c_k|\sigma_k\big)^2}{\epsilon^2}optimal allocation; the weighted ℓ1\ell_1 norm squared sets the budget, bounded above by (∑k∣ck∣)2/ϵ2(\sum_k|c_k|)^2/\epsilon^2
Chemistry scaling#{Pk}=O(N4), #groups=O(N3)\#\{P_k\}=\mathcal{O}(N^4),\ \#\text{groups}=\mathcal{O}(N^3)for an NN-spin-orbital electronic Hamiltonian; commuting-clique grouping removes one factor of NN in settings
Barren plateauM∼O(22n/δ2)M\sim\mathcal{O}\big(2^{2n}/\delta^2\big)gradient variance decaying as 2−n2^{-n} needs exponentially many shots; no grouping trick repairs it

Worked examples

1 · A single Pauli expectation, fully worked

A trial state has ⟨P⟩=0.6\langle P\rangle=0.6 for some Pauli string PP. How many shots estimate ⟨P⟩\langle P\rangle to a standard error ϵ=0.01\epsilon=0.01, and how does this change in the worst case ⟨P⟩=0\langle P\rangle=0?

Step 1. Compute the single-shot variance from the ±1\pm1 statistics. Since P2=IP^2=I, the eigenvalues are ±1\pm1 and Var(λ)=1−⟨P⟩2=1−0.62=0.64\mathrm{Var}(\lambda)=1-\langle P\rangle^2=1-0.6^2=\mathbf{0.64}, so the single-shot standard deviation is σ=0.64=0.8\sigma=\sqrt{0.64}=\mathbf{0.8}.

Step 2. The sample mean of MM i.i.d. shots has variance σ2/M\sigma^2/M, so demanding σ2/M≤ϵ\sqrt{\sigma^2/M}\le\epsilon gives M≥σ2/ϵ2=0.64/(0.01)2=6400 shotsM\ge\sigma^2/\epsilon^2=0.64/(0.01)^2=\mathbf{6400\ \text{shots}}. Doubling the precision to ϵ=0.005\epsilon=0.005 would quadruple this to 25 60025\,600 — the hallmark 1/ϵ21/\epsilon^2 scaling.

Step 3. In the worst case ⟨P⟩=0\langle P\rangle=0 the single-shot variance saturates at σ2=1\sigma^2=1, so M=1/ϵ2=1/(0.01)2=10 000 shotsM=1/\epsilon^2=1/(0.01)^2=\mathbf{10\,000\ \text{shots}}. Conversely, if the state were a ±1\pm1 eigenstate of PP then σ=0\sigma=0 and a single shot suffices — the estimate is deterministic. The cost scales entirely with how uncertain the observable is in the state, not with the circuit that prepared it.

2 · Grouping and the shot budget of the hydrogen molecule

The two-qubit H₂ Hamiltonian (STO-3G, symmetry-tapered near equilibrium) is H=g0I+g1Z0+g2Z1+g3Z0Z1+g4X0X1+g5Y0Y1H=g_0 I+g_1 Z_0+g_2 Z_1+g_3 Z_0Z_1+g_4 X_0X_1+g_5 Y_0Y_1 with g1=0.3435g_1=0.3435, g2=−0.4347g_2=-0.4347, g3=0.5716g_3=0.5716, g4=g5=0.0910g_4=g_5=0.0910 Ha. Find the naive shot budget for chemical accuracy, then group the terms and count measurement settings.

Step 1. Sum the magnitudes of the non-identity terms — the weighted ℓ1\ell_1 norm that controls the budget (conservatively taking σk≤1\sigma_k\le1): ∑k∣gk∣=0.3435+0.4347+0.5716+0.0910+0.0910=1.5318 Ha\sum_k|g_k|=0.3435+0.4347+0.5716+0.0910+0.0910=\mathbf{1.5318\ \text{Ha}}. The identity term g0g_0 only shifts the energy and carries no variance, so it needs no shots.

Step 2. Invert the variance floor at a standard error equal to chemical accuracy, ϵ=1.6×10−3\epsilon=1.6\times10^{-3} Ha: M=(∑k∣gk∣/ϵ)2=(1.5318/1.6×10−3)2=(957)2≈9.2×105 shotsM=(\sum_k|g_k|/\epsilon)^2=(1.5318/1.6\times10^{-3})^2=(957)^2\approx\mathbf{9.2\times10^{5}\ \text{shots}} for a single energy on this two-qubit problem. Fold in an optimization of ∼100\sim100 iterations with parameter-shift gradients and the total climbs toward 10810^{8}–10910^{9} shots — the measurement, not the qubit count, is the bottleneck.

Step 3. Now group by qubit-wise commutation. The three diagonal strings {Z0,Z1,Z0Z1}\{Z_0,Z_1,Z_0Z_1\} share the computational (ZZ) basis — one setting; X0X1X_0X_1 needs its own XX-basis setting; Y0Y1Y_0Y_1 its own YY-basis setting. So five terms collapse to three measurement settings, each amortizing its shots across the terms it contains.

Step 4. Push to general commutation. Check that X0X1X_0X_1 and Y0Y1Y_0Y_1 commute: X0X1 Y0Y1=(iZ0)(iZ1)=−Z0Z1=(−iZ0)(−iZ1)=Y0Y1 X0X1X_0X_1\,Y_0Y_1=(iZ_0)(iZ_1)=-Z_0Z_1=(-iZ_0)(-iZ_1)=Y_0Y_1\,X_0X_1, and Z0Z1Z_0Z_1 commutes with both. These three form a Bell-basis (stabilizer) group measurable with one Clifford setting, while {Z0,Z1}\{Z_0,Z_1\} stay diagonal (one setting), since Z0Z_0 anticommutes with X0X1X_0X_1 and cannot join the Bell group. Result: 5 terms → 3 qubit-wise settings → 2 general-commuting settings, each grouping trading circuit count against Clifford depth and correlated variance.

Physics of the portrait

Measurement estimation is where a mid-century concentration bound and a twenty-first-century idea about learning quantum systems meet — and its most modern face belongs to the researcher who showed you can predict a great many properties of a state from astonishingly few measurements.

Origins · 1 minHsin-Yuan Huang and how this was discovered
HH
Hsin-Yuan Huang
classical shadows, 2020 · measurement estimation and learning quantum systems from few samples

Hsin-Yuan (Robert) Huang is a theorist of quantum information and learning, trained at Caltech and working across Caltech and Google Quantum AI, whose work reshaped how the field reads information out of a quantum computer. By the late 2010s the measurement problem this article formalizes — that a chemical-accuracy energy can cost of order a million shots — was recognized as the practical wall in front of variational algorithms. In 2020, with Richard Kueng and John Preskill, Huang introduced classical shadows: rather than measure each observable in its own basis, one measures the state in randomly chosen bases, stores a compact classical "shadow," and from it predicts MM arbitrary observables using only O(log⁡M)\mathcal{O}(\log M) measurements, with rigorous variance guarantees. The construction descends from the statistical lineage this article uses — Wassily Hoeffding's 1963 concentration inequality for bounded variables, and Scott Aaronson's 2018 shadow tomography, which first asked how few copies of a state suffice to predict many properties. Huang's contribution was to make that promise practical and scalable, turning an information-theoretic possibility into an algorithm near-term hardware runs today, alongside the qubit-wise and general-commutation grouping systematized for chemistry in the same period.

History
1963
— Hoeffding proves his concentration inequality for sums of bounded random variables
2014
— Peruzzo and co-workers make Hamiltonian expectation estimation the core task of VQE
2018
— Aaronson formulates shadow tomography: predicting many observables from few copies
2020
— Huang, Kueng, and Preskill introduce classical shadows for scalable measurement estimation
2020
— qubit-wise and general-commutation Pauli grouping is systematized for chemistry Hamiltonians

Going further

Texts and reviews. Nielsen and Chuang, Quantum Computation and Quantum Information, §2.2 (measurement statistics) and §4.2 (Pauli operators) · Preskill, Lecture Notes on Quantum Computation, Ch. 3 · Watrous, The Theory of Quantum Information, Ch. 2 (measurements as POVMs) · Kitaev, Shen, and Vyalyi, Classical and Quantum Computation, §13 (Hamiltonian expectation) · McClean, Romero, Babbush, and Aspuru-Guzik, "The theory of variational hybrid quantum-classical algorithms," New J. Phys. 18, 023023 (2016) · Huang, Kueng, and Preskill, "Predicting many properties of a quantum system from very few measurements," Nature Physics 16, 1050 (2020) · Verteletskyi, Yen, and Izmaylov, "Measurement optimization in VQE by a minimum clique cover," J. Chem. Phys. 152, 124114 (2020) · Cerezo et al., "Variational Quantum Algorithms," Nature Reviews Physics 3, 625 (2021).

Provenance. The single-shot variance 1−⟨P⟩21-\langle P\rangle^2 follows from λ2=1\lambda^2=1 and the Born rule (Nielsen and Chuang §2.2). The optimal allocation Mk⋆∝∣ck∣σkM_k^\star\propto|c_k|\sigma_k and floor (∑k∣ck∣σk)2/M(\sum_k|c_k|\sigma_k)^2/M are a standard Lagrange-multiplier (equivalently Cauchy–Schwarz) result — re-derive by stationarity of ∑kck2σk2/Mk\sum_k c_k^2\sigma_k^2/M_k. The Hoeffding bound uses range 2Λ=2∑k∣ck∣2\Lambda=2\sum_k|c_k|, and the group variance is the operator identity ⟨HG2⟩−⟨HG⟩2\langle H_G^2\rangle-\langle H_G\rangle^2. The H₂ coefficients are representative STO-3G values (O'Malley et al., 2016) with weighted ℓ1\ell_1 norm ∑∣gk∣=1.5318\sum|g_k|=1.5318 Ha, giving M≈9.2×105M\approx9.2\times10^5 shots at ϵ=1.6×10−3\epsilon=1.6\times10^{-3} Ha; the 5→3→25\to3\to2 grouping uses X0X1Y0Y1=−Z0Z1=Y0Y1X0X1X_0X_1Y_0Y_1=-Z_0Z_1=Y_0Y_1X_0X_1. Chemical accuracy 1.6×10−31.6\times10^{-3} Ha ≈1\approx1 kcal/mol (11 Ha =627.5=627.5 kcal/mol). The O(N4)\mathcal{O}(N^4) Pauli scaling and barren-plateau 2−n2^{-n} gradient variance are textbook (McClean et al., 2018).

Prerequisites. Variational Quantum Eigensolver · Parameterized Quantum Circuits and Ansatz Design · Quantum Approximate Optimization Algorithm. Leads to. Parameter-Shift Rules and Quantum Gradients · Barren Plateaus in Variational Landscapes · Classical Optimizers for Variational Quantum Algorithms.

Ask the tutor: Ask me to work a full shot budget from a Hamiltonian's Pauli coefficients, to group a set of Pauli strings into qubit-wise and general commuting cliques, or to contrast term-by-term measurement with classical shadows on the same observable.

Why is the shot count, not the circuit depth, the true cost of a variational algorithm?

Because a variational circuit is deliberately shallow — the whole point of NISQ design — but it must be re-run an enormous number of times. Each run returns one bitstring yielding ±1\pm1 eigenvalues; the energy is their average, and the standard error of MM samples falls only as 1/M1/\sqrt{M}, so halving the error quadruples the shots. For a molecular Hamiltonian the coefficients add up (the weighted ℓ1\ell_1 norm), so chemical accuracy can demand of order 10610^6 shots for a single energy, and an optimization multiplies that further. One circuit's depth is fixed and small; the count of executions runs into the millions, so the currency of the field is shots.

What exactly does it mean for two Pauli strings to be "simultaneously measurable"?

It means they share a common eigenbasis, so one measurement reveals both eigenvalues from the same record — which happens exactly when they commute. There are two grades. Qubit-wise commuting strings agree qubit-by-qubit, so the shared basis is a product basis reached by single-qubit rotations — essentially free. Generally commuting strings like X0X1X_0X_1 and Y0Y1Y_0Y_1 disagree on individual qubits yet commute as whole strings because an even number of anticommutations cancel; their shared eigenbasis is entangled, so a Clifford circuit must rotate into it before measuring. Both harvest several terms from one setting, but the general case pays in two-qubit gates and their noise.

Why is uniform shot allocation across terms a bad idea?

Because it spends measurements where they do the least good. The variance-optimal rule is Mk⋆∝∣ck∣σkM_k^\star\propto|c_k|\sigma_k: concentrate shots on terms that are both heavily weighted (large ∣ck∣|c_k|) and genuinely uncertain in the state (large σk=1−⟨Pk⟩2\sigma_k=\sqrt{1-\langle P_k\rangle^2}). Uniform allocation wastes shots on tiny-coefficient terms and near-deterministic ones where σk≈0\sigma_k\approx0 — an eigenstate term needs almost none — while starving the dominant, noisy terms that drive the error. The optimum's minimal variance is (∑k∣ck∣σk)2/M(\sum_k|c_k|\sigma_k)^2/M, the square of the weighted ℓ1\ell_1 norm over the budget, and any other allocation strictly exceeds it.

If commuting Paulis can be measured together, why not just group everything into as few settings as possible?

Because settings are not the cost — variance is, and aggressive grouping can raise it. Within a group the term estimates are correlated, and the group's variance is the full quantum variance ⟨HG2⟩−⟨HG⟩2\langle H_G^2\rangle-\langle H_G\rangle^2 of its partial Hamiltonian, which can exceed the sum of the individual term variances. General grouping also requires a Clifford diagonalization whose entangling gates inject noise, biasing the estimate. So there is a genuine trade-off: fewer settings amortize shots but can inflate variance and add circuit noise. Good grouping minimizes total variance under the budget while respecting device noise, not the raw circuit count — which is why minimum-clique-cover heuristics are tuned, not maximized blindly.

How does measurement estimation connect to parameter-shift gradients?

Directly — a gradient is just two more energy estimates. The parameter-shift rule writes ∂E/∂θj=12[E(θ+π2ej)−E(θ−π2ej)]\partial E/\partial\theta_j=\tfrac12[E(\boldsymbol\theta+\tfrac\pi2\mathbf e_j)-E(\boldsymbol\theta-\tfrac\pi2\mathbf e_j)], so each gradient component costs two full cost evaluations, each carrying the shot budget analyzed here; a pp-parameter circuit multiplies the per-step cost by roughly 2p2p. The gradient estimator inherits the same 1/M1/\sqrt{M} shot-noise floor as the energy, which is precisely why barren plateaus are so damaging: when the true gradient shrinks like 2−n/22^{-n/2}, it disappears beneath that floor unless the shot count grows like 2n2^n. Shot-frugal optimizers such as SPSA exploit this by estimating gradients from few, randomized evaluations rather than exhaustively.

What are classical shadows, and how do they change the picture?

Classical shadows are a randomized alternative to term-by-term measurement. Instead of choosing a basis for each observable, you measure the state in randomly chosen bases (random Pauli or Clifford) and store a compact classical "shadow" of each outcome. From a modest collection of shadows you predict many observables in post-processing, with rigorous bounds: MM targets need only O(log⁡M)\mathcal{O}(\log M) measurements when they have bounded locality or Hilbert–Schmidt norm. This inverts the usual cost structure, which grows with the number of terms, and is especially powerful when you want many properties of one state. Shadows do not repeal the 1/ϵ21/\epsilon^2 law, but they sharply cut the constant and the dependence on observable count — which is why they are now a staple of measurement estimation.

Before this

Where this leads