Measurement Cost & Ansatz Design
Shot budgets, Pauli grouping and hardware-efficient ansätze.
A VQE energy is a sum of up to thousands of Pauli expectation values, each estimated from shots. The bill for one energy evaluation, let alone a full optimization, can dwarf the cost of the circuit itself. This lesson derives the shot cost and the optimal allocation, shows how commuting groups and classical shadows cut it, and how the choice of ansatz feeds back into it.
What you’ll learn
- Derive the variance of the term-by-term energy estimator and the optimal allocation , giving .
- Prove the commutation criterion for Pauli strings, and explain qubit-wise and general commuting groups and their costs.
- Derive the classical-shadow estimator for random Pauli measurements and its variance for weight- observables.
- Compare hardware-efficient, chemically motivated and adaptive ansätze in expressibility, symmetry, depth and measurement cost.
The shot budget
Write . The simplest strategy measures each term separately with shots and adds the sample means: .
Independent estimates add variances. With single-shot variances :
Minimize subject to . By Cauchy–Schwarz, , with equality iff :
With , a target standard error needs at most
shots, independent of the number of terms (Wecker, Hastings & Troyer, 2015). Uniform allocation gives instead, worse by up to a factor of when a few coefficients dominate.
An alternative with the same bound that needs no knowledge of the : on each shot, pick term with probability , measure , and record for the outcome . Each record is an unbiased estimate of with second moment exactly .
Suppose a molecular Hamiltonian has hartree and you want chemical accuracy, hartree. Using , what is for a single energy evaluation?
Show the answer
7.6
shots, so . An optimization needs hundreds to thousands of energy evaluations, and parameter-shift gradients multiply the cost by : measurement, not circuit depth, becomes the bottleneck.
Measuring many terms at once
Commuting terms can share shots. For Pauli strings, commutation is a counting criterion:
This gives two levels of grouping:
- Qubit-wise commuting (QWC) groups: on every qubit, all members act with the same Pauli or with . One layer of single-qubit rotations measures the whole group; e.g. , , and share the basis.
- General commuting groups: any set of pairwise commuting Pauli strings can be mapped by a Clifford circuit to -type strings, so one measurement setting suffices, at the cost of an entangling basis change with gates in general. For example , and commute pairwise (two anticommuting positions each) but are not QWC; a Bell-basis measurement reads all three.
Choosing groups to minimize the number of settings is a minimum clique cover problem (equivalently, coloring the graph whose edges join non-commuting terms), NP-hard in general; greedy heuristics work well in practice (Verteletskyi, Yen & Izmaylov, 2020). Grouped terms share shots, so covariances enter: , which can help or hurt.
Classical shadows
Huang, Kueng & Preskill (2020) proposed measuring first and choosing the observables later. On each shot, measure every qubit in a uniformly random Pauli basis (, or ) and store the outcomes: a classical shadow of the state.
Per qubit, average the post-measurement projector over the random basis and the outcome . For :
This is a depolarizing channel, inverted by . Applied to the observed projectors it gives a single-shot snapshot, an unbiased estimator of :
For a Pauli string of weight , , since each qubit outside the support contributes . It equals when all random bases match (probability ) and otherwise, so
With random-Pauli shadows, what fraction of snapshots carry information about one particular weight-3 Pauli string? Answer in percent.
Show the answer
3.7 %
All three relevant qubits must have been measured in the matching basis: . Each informative snapshot contributes and the rest contribute , hence the variance . Shadows shine when you need many low-weight observables at once (the ); for a single Hamiltonian, good groupings, derandomized shadows or locally biased shadows usually do better.
Ansatz design and its measurement bill
| Aspect | Hardware-efficient | Chemically motivated (UCCSD, Givens) | Adaptive (ADAPT-VQE) |
|---|---|---|---|
| Building blocks | Native rotations and fixed native entanglers | Fermionic excitations on a Hartree–Fock reference | Operators added one at a time, chosen by energy gradient from a pool |
| Symmetries | Generally broken (particle number, spin) | Preserved by construction | Preserved if the pool preserves them |
| Depth | Minimal per layer | Deep after Jordan–Wigner compilation | Compact, problem-tailored |
| Parameters | for layers | double excitations | Grow as needed |
| Trainability | Barren plateaus when deep and random | Better near a good reference, not guaranteed | Good in practice |
| Measurement bill | energy evaluations per gradient | Same, with more parameters | Plus gradients of the whole pool at each growth step |
Symmetry preservation is a concrete design principle. A gate conserves the number of excitations (the Hamming weight) iff . The generator satisfies this: it annihilates and and acts within , so is a real Givens rotation there. Networks of Givens rotations implement any single-particle basis change (preparing Slater determinants) without ever leaving the right particle-number sector.
Key takeaways
- Term-by-term estimation with optimal allocation costs at most shots per energy, independent of the number of terms.
- Pauli strings commute iff they differ non-trivially on an even number of qubits; QWC groups need only local rotations, general commuting groups a Clifford basis change, and optimal grouping is NP-hard.
- Random-Pauli classical shadows estimate weight- observables from snapshots.
- The ansatz sets the measurement bill (parameters × 2 evaluations × shots per energy); symmetry-preserving and adaptive ansätze trade depth for structure.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
For with and a fixed total budget, what fraction of the shots should optimal allocation give to the term?
Show the answer
B.
, so the term gets . Allocating in proportion to (giving ) over-invests in the large term.
Which pair of Pauli strings commutes?
- and
- and
- and
- and
Show the answer
C. and
Count positions holding different non-identity Paulis: at position 1 and at position 3 (position 2 has ). Two is even, so they commute. They are not qubit-wise commuting, though, so measuring both on the same shots needs an entangling basis change.
For random-Pauli classical shadows, the single-snapshot variance for a weight- Pauli observable is at most…
Show the answer
C.
A snapshot contributes with probability (all bases match) and otherwise, so the second moment is .
Which is a disadvantage of hardware-efficient ansätze compared with chemically motivated ones?
- They require deep circuits after compilation
- They generally break physical symmetries such as particle number, and deep random instances suffer barren plateaus
- They cannot run on superconducting hardware
- They have no tunable parameters
Show the answer
B. They generally break physical symmetries such as particle number, and deep random instances suffer barren plateaus
Built from native gates, they are shallow, but nothing ties them to the physics: they wander out of the right symmetry sector and, when deep and randomly initialized, approach 2-designs.
Further reading
- D. Wecker, M. B. Hastings & M. Troyer, "Progress towards practical quantum variational algorithms", Phys. Rev. A 92, 042303 (2015).
- H.-Y. Huang, R. Kueng & J. Preskill, "Predicting many properties of a quantum system from very few measurements", Nature Physics 16, 1050 (2020).
- V. Verteletskyi, T.-C. Yen & A. F. Izmaylov, "Measurement optimization in the variational quantum eigensolver using a minimum clique cover", J. Chem. Phys. 152, 124114 (2020).
- A. Kandala et al., "Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets", Nature 549, 242 (2017).
- H. R. Grimsley, S. E. Economou, E. Barnes & N. J. Mayhall, "An adaptive variational algorithm for exact molecular simulations on a quantum computer", Nature Communications 10, 3007 (2019).