Day 6 — Estimator & Error Mitigation
Math Prep
Solve this BEFORE lesson.md. EstimatorV2 returns one number per (circuit, observable): . This prep makes that number concrete, then gives the minimal noise math behind "error mitigation."
Requires: Day 3 math prep (Paulis, expectation values) + Day 4 §4–5. Video back-up: Watrous Lesson 09 Density Matrices, Lesson 10 Quantum Channels; notes in resource-artifactory/notes/video-notes/.
1. Observables = Hermitian operators = weighted Pauli sums
Any measurable quantity is a Hermitian operator ; any -qubit Hermitian operator expands uniquely in the Pauli basis:
That's precisely what SparsePauliOp([...], coeffs) encodes. Examples:
- — "probability of 1" as an observable.
- .
- Ising-type Hamiltonian: .
Linearity does the work: — the Estimator measures each Pauli term (grouping commuting ones into shared measurement bases) and sums with coefficients. always, so identity terms shift the answer by their coefficient with zero variance.
2. Values and bounds
lies between and . For a single Pauli: . Reference values (compute these until instant):
| State | |||
|---|---|---|---|
| 0 | 0 | ||
| 0 | 0 | ||
| 0 | 0 | ||
| 0 | 0 | ||
| 0 | 0 | ||
| 0 |
Bell : , , all single-qubit Paulis .
Variance of a Pauli estimate: outcomes are ±1, so , and the shot-noise on is . Estimator's precision parameter is exactly this target standard error.
3. How noise moves expectation values
Model noise as a channel (Day 3's density matrices earn their keep). The two canonical ones:
Depolarizing noise — with probability , replace the state by :
Noise shrinks expectation values toward 0 (for traceless observables). Under noisy layers: — exponential signal decay with depth.
Readout (measurement) error — classical bit-flip on the recorded outcome with probabilities . Effect on a single-qubit with symmetric : — again a shrink factor.
4. Why mitigation methods work (one line of math each)
- TREX / readout twirling: measure with random X-flips folded into readout; converts asymmetric readout error into a known symmetric shrink factor, then divide it out.
- ZNE (zero-noise extrapolation): deliberately amplify noise by factor (e.g. gate folding ), measure at , fit, extrapolate to . Works because signal is smooth in λ. Costs extra circuits; extrapolation can overshoot (estimate, not guarantee).
- Pauli twirling: conjugate each 2q gate by random Paulis that leave the ideal gate invariant; averages coherent errors into stochastic (depolarizing-like) ones, which ZNE/PEC model better.
- PEC (probabilistic error cancellation): write the ideal gate as a quasi-probability combination of noisy implementable ones and sample it — unbiased but with sampling overhead , exponential in depth.
- DD (dynamical decoupling): insert X–X (or XY4) pulse pairs into idle windows; the pair is identity () but refocuses slow dephasing — a spin echo.
You don't need implementation depth for the exam — you need: what each acronym targets (readout vs gate noise vs idling), whether it's biased, and its cost.
5. Estimator vs Sampler in one probability statement
- Sampler: returns samples from — you post-process.
- Estimator: returns std, having internally chosen measurement bases (X/Y terms need basis rotations — Day 4 §5), grouped commuting terms, and applied mitigation.
If the observable is diagonal (all I/Z), you could get the same number from Sampler counts: . For X/Y terms you cannot, without adding basis-change gates yourself.
PROBLEMS
P1. Expand (2 qubits) in the Pauli basis. (Hint: per qubit; tensor and multiply out.)
P2. For , compute and , then .
P3. For the Bell state, compute with . Must an expectation value be an eigenvalue of ?
P4. Global depolarizing noise with acts on the Bell state. Give . Now two such layers. Generalize to layers.
P5. Symmetric readout error on ONE qubit of a Bell pair (other qubit read perfectly): what's the measured ?
P6. ZNE gives at noise factor 1 and at factor 3; assume exponential decay . Extrapolate to .
P7. An estimator must resolve to precision 0.01. Using , how many effective shots does the term need?
P8. True/false with reason: "Increasing shots reduces the bias caused by depolarizing noise."
ANSWERS
A1. .
A2. ; . Linearity: .
A3. . Here 1 happens to be an eigenvalue ( is an eigenvector), but in general no — is a weighted average of eigenvalues (e.g. , which is not ±1).
A4. One layer: . Two: . : — exponential signal decay with depth, the fundamental depth-limit of noisy hardware.
A5. The recorded parity flips exactly when the noisy bit flips: probability . .
A6. ⇒ . . Extrapolated ideal value ≈ 0.775 — larger than any measured value; mitigation "un-shrinks" the signal.
A7. Var ≈ 1, need std 0.01: effective shots for that term.
A8. False. Shots shrink the statistical error bar around the noisy mean ; the bias (gap to the ideal value) is untouched. Removing bias is mitigation's job (ZNE/PEC/TREX), not the shot budget's.
Self-check: you can Pauli-decompose small projectors, compute ⟨Pauli sums⟩ by linearity, predict the shrink, and say in one sentence each what DD, TREX, ZNE, PEC target.