Shadow Tomography
Classical shadows use randomized measurements to estimate many properties of a quantum state from one reusable dataset. Each measurement produces a compact classical record. An inverse-probability calculation turns that record into an unbiased estimate of a chosen observable.
The gain depends on the observables and the measurement ensemble. Local Pauli measurements are effective for short Pauli strings, but their variance grows exponentially with string weight. A classical shadow need not be a positive density matrix or an accurate full-state reconstruction.
Required background. State tomography explains reconstruction and calibrated measurements; Pauli matrices supply the operator basis. Helpful background. Variance and covariance explains the sampling errors below.
One randomized measurement, several possible queries
Section titled “One randomized measurement, several possible queries”For one qubit, choose uniformly and measure its eigenvalue . Store the pair . The corresponding projector and snapshot are
For example, observing gives . This snapshot estimates by , while its estimates of and are zero.
Why is the factor three correct? Only one third of rounds measure . On those rounds the mean outcome is , so
The same argument works for and , hence . Individual snapshots have eigenvalues . Their negative eigenvalue is part of the unbiased estimator, not a claim about a physical state.
For qubits, choose each local basis independently. The snapshot is
Store the basis labels and outcome signs, rather than constructing this exponentially large matrix.
Pauli weight determines the sampling cost
Section titled “Pauli weight determines the sampling cost”Let be a Pauli string supported on qubits. Its single-shot estimator is zero unless all chosen bases match on that support. On a match it equals times the product of the measured signs:
Matching occurs with probability . Therefore
For independent snapshots, the sample mean has this variance divided by . The cost depends on the number of qubits touched by the observable, even if the register contains many more qubits.
| Pauli weight | Match probability | Single-shot second moment |
|---|---|---|
For a single known string, directly measuring its basis avoids this random-matching penalty. The attraction of shadows is reuse across a large collection of targets.
For a Hamiltonian , form on each snapshot. Then average the values. Because the terms share data, their covariances contribute to the energy uncertainty; adding only separate term variances is generally wrong.
Bell fidelity shows why snapshots must not be clipped
Section titled “Bell fidelity shows why snapshots must not be clipped”Use the squared-fidelity convention for the pure target
Its projector is , so
A local-Pauli snapshot gives the unbiased contribution
where estimate .
For an ideal Bell preparation, matched bases , , and each occur with probability and give the appropriate perfect correlation. All other basis pairs contribute zero to the three correlator estimates. Consequently,
Its mean is one and its variance is . Clipping each value to instead gives mean
An apparently reasonable “physicality correction” changes a perfect-fidelity estimate into a badly biased one.
Exact distributions for an ideal Bell state under independent local Pauli choices. The large raw contribution compensates for many unmatched rounds. Clipping it removes that compensation. Bars show probabilities, not a simulated histogram.
The covariance matters even here. The three signed correlator estimators cannot be nonzero on the same shot. Their negative covariances reduce the fidelity variance below the result obtained by treating them as independent (Exercise 3).
If Bell fidelity is the only target, choose one of uniformly, instead of choosing both local bases independently. Let be the outcome product, with an extra minus sign for . Then is unbiased for the same and equals one on every ideal-Bell shot. The better schedule answers a narrower question; it does not determine arbitrary two-qubit coherences.
The measurement map explains the inverse
Section titled “The measurement map explains the inverse”For a random unitary followed by computational-basis outcome , define
The ideal ensemble defines the linear map
Averaging the rotated-back projector gives . If is invertible, define ; linearity then proves .
For uniform one-qubit Pauli measurements,
which yields the factor three above. The inverse is a classical calculation and need not be a physical quantum operation.
For an incomplete ideal design, let be the span of its measured projectors. The map is self-adjoint and positive in the Hilbert–Schmidt inner product, with range and kernel . Its pseudoinverse reconstructs the orthogonal projection of onto . Only observables in that visible subspace are determined without further assumptions. An arbitrary chosen subspace is not automatically invariant under the measurement map.
Simultaneous accuracy and median of means
Section titled “Simultaneous accuracy and median of means”The expectation identity does not by itself bound the error of a finite dataset. For each Hermitian observable, subtract its known identity component:
A useful squared shadow norm is the worst-case second moment
Suppose this is at most for each of specified observables. Then suitable aggregation uses
independent snapshots to estimate all expectations within additive error , with joint failure probability at most (Huang, Kueng, and Preskill, 2020).
One simple construction is median of means. Divide the data into independent groups of snapshots. For each observable, calculate its mean within every group, then take the median of those means. Choosing makes each group’s failure probability at most by Chebyshev’s inequality. For odd , a concentration bound and union bound establish the simultaneous guarantee. Exercise 4 derives these conservative constants.
The median is not generally unbiased, even though each snapshot and group mean is unbiased. Its purpose is a reliable finite-sample error bound.
Targets may be chosen after acquisition without using the observed fluctuations. A guarantee for a fixed finite family also covers selecting a member of that family after looking at the data. Searching an unrestricted new family for the largest fluctuation requires additional analysis or independent held-out data. The cost of evaluating and returning answers also remains.
Choosing local, biased, or global measurements
Section titled “Choosing local, biased, or global measurements”For biased independent local basis choices, let be the probability of selecting basis on qubit . The Pauli-string match probability is
Use the product of outcomes divided by on matching rounds, and zero otherwise. Its second moment is . Giving important bases more probability can reduce the variance of a known Hamiltonian (Hadfield and colleagues, 2022). Zero coverage makes an incompatible direction unidentifiable.
A deterministic schedule needs an estimator appropriate to its actual match counts. Reusing a randomized inverse with unrelated nominal probabilities is not justified. Derandomized methods construct schedules around a specified target family (Huang, Kueng, and Preskill, 2021).
Global Clifford measurements instead use a uniformly random -qubit Clifford before readout. With ,
and the centered-observable bound is
For a rank-one projector, the right-hand side is , independent of exponential Hilbert-space size. For a nonidentity Pauli string it is , which is unfavorable compared with local measurements of a short string.
| Design | Useful when | Main limitation |
|---|---|---|
| Local Pauli | Many low-weight correlators matter | Match cost grows with weight |
| Targeted product bases | A known list dominates the task | Other directions may be absent |
| Global Clifford | Low-rank global observables matter | Entangling circuits and query cost |
A global snapshot can be stored as a stabilizer tableau, but an overlap with an arbitrary target state need not be efficiently computable. Compact storage and low copy complexity do not guarantee efficient classical queries.
Local marginals, nonlinear properties, and noise
Section titled “Local marginals, nonlinear properties, and noise”Estimating all Pauli strings of weight at most determines every -qubit reduced operator. A convenient upper bound on the number of coordinates is . For fixed , the simultaneous coordinate-wise copy bound grows logarithmically with .
Coordinate error is not trace-distance error. If every nonidentity coefficient of a -qubit marginal has error at most , Pauli orthogonality and a matrix-norm inequality give
This is a bound on the reconstructed Hermitian operator, which need not be positive. A subsequent physical projection is another estimator and needs its own analysis. Exercise 6 derives the bound.
Pure-target fidelity is linear in ; purity is not. For independent snapshots, an unbiased purity estimate is
Using distinct snapshots avoids self-pairing bias. The linear-observable theorem does not automatically give the variance of this estimator, nor guarantees for entropy, negativity, or mixed-state fidelity.
Noise changes what must be inverted. Let denote the mean of the recorded nominal projectors under the actual noisy experiment. Applying the ideal inverse yields
Calibration can correct an invertible noisy map under a specified noise model, but weak response directions amplify variance and calibration uncertainty. Robust-shadow protocols make these assumptions explicit (Chen and colleagues, 2021). Exercise 7 gives an exact readout example.
If the preparation drifts, randomized bases must remain independent of the current prepared state for a per-shot inverse to target that state in expectation. Correlated data need a different confidence analysis. Outcome-dependent rejection can also change the accepted ensemble differently for different bases. Keep basis choices, outcomes, and times so these effects can be tested.
Shadow tomography in its original sense
Section titled “Shadow tomography in its original sense”Aaronson’s original shadow-tomography problem asks for the probabilities of many known two-outcome measurements on an unknown state. His 2018 revised bound has polylogarithmic dependence on the number of targets and Hilbert-space dimension, but uses a different, demanding quantum-measurement model with collective operations.
Classical shadows instead use randomized measurements on individual copies and pay an observable-dependent variance cost. The two results should not be treated as the same algorithm. Full state tomography remains necessary when the goal is a uniformly accurate description of arbitrary state directions.
Exercises
Section titled “Exercises”1. A missing measurement direction
Section titled “1. A missing measurement direction”Only and are measured, each with probability one half. Determine the visible operator subspace and give two indistinguishable qubit states.
Solution
The measured projectors span . The measurement map preserves , scales by , and annihilates . The states therefore give identical probabilities. The pseudoinverse recovers their common visible component , but cannot recover their opposite expectations.
2. Exact Pauli variance and no matches
Section titled “2. Exact Pauli variance and no matches”For a weight-five Pauli query with expectation zero, find the variance of the mean of uniform local shadows. What is the probability that no round matches its basis?
Solution
The variance is , so the standard deviation is about . The match count is binomial with match probability , giving
On such a dataset the usual inverse-probability estimate is zero, even though zero matches do not demonstrate a zero expectation. An error statement must reflect the sampling design.
3. Bell fidelity and covariance
Section titled “3. Bell fidelity and covariance”For an ideal Bell state, compute the variance of . Compare with a calculation that incorrectly treats the three signed correlator estimates as independent.
Solution
Define , , and . Each has mean one and second moment nine. Different terms cannot be nonzero together, so . Their pairwise covariances are therefore .
Thus
Ignoring covariances would give . Directly using the two-point distribution in the figure gives the same correct variance.
4. Derive a median-of-means guarantee
Section titled “4. Derive a median-of-means guarantee”A single-shot estimator for each of observables has variance at most . Prove the stated group sizes suffice for joint failure probability at most .
Solution
A group mean of independent shots has variance at most . Chebyshev bounds its failure probability by .
For independent groups, the median can fail only if at least half the group means fail. Hoeffding’s inequality applied to their failure indicators gives
Choosing odd makes this at most . A union bound over targets gives total failure at most . Target estimates may share the same snapshots; independence is needed between groups, not between observables.
5. Biased bases
Section titled “5. Biased bases”A two-qubit target uses independent basis probabilities . Find its second moment and compare with uniform local Pauli shadows. What if a target requires on a site with ?
Solution
The match probability is , and the matching contribution has magnitude . Hence the second moment is , compared with nine for uniform sampling. A target with zero match probability is unidentifiable under that design; dividing by zero is not an estimator.
6. From coordinate errors to a matrix bound
Section titled “6. From coordinate errors to a matrix bound”Prove the stated trace-norm bound for a reconstructed -qubit marginal whose nonidentity Pauli errors obey .
Solution
Let and . Orthogonality gives
Using yields
For and , this upper bound is about . It is a sufficient worst-case bound, not a claim that all errors saturate it.
7. Readout correction changes variance
Section titled “7. Readout correction changes variance”Uniform local Pauli measurements have independent symmetric recorded-sign flips of known probability on every measured qubit. For a weight-two target of expectation , find the ideal estimator’s mean and the corrected estimator’s variance.
Solution
Two sign flips attenuate the mean by . The ideal inverse therefore has mean , while its second moment remains nine.
Dividing the contribution by restores mean . Its variance becomes
The noiseless variance was . The second moment is multiplied by , but the variance ratio is not generally that same factor because the mean is restored. Calibration uncertainty is additional.
8. Self-pairing biases purity
Section titled “8. Self-pairing biases purity”For one-qubit Pauli snapshots, show that . Find the bias of taking the purity of the ordinary snapshot mean.
Solution
The snapshot eigenvalues are , so the trace of the square is . For , independent distinct pairs have mean overlap . Therefore
Removing the self-pairs and dividing by gives the unbiased U-statistic. Its statistical variance still requires analysis.
9. Selecting a query from the data
Section titled “9. Selecting a query from the data”A simultaneous confidence statement covers a prespecified list of 100 Pauli strings. After inspecting all estimates, a reader reports the largest one. Does this selection invalidate the simultaneous guarantee? What changes if the reader searches additional strings outside the list?
Solution
On the simultaneous-success event every member of the list has a valid error bound, including whichever member was selected. Selection within that covered family preserves the guarantee. Searching outside it is a different statistical problem; the original failure probability does not cover the additional queries. An enlarged-family bound or independent confirmation data is needed.
References
Section titled “References”- Aaronson, S. “Shadow tomography of quantum states.” Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, 325–338 (2018). arXiv:1711.01053.
- Chen, S., W. Yu, P. Zeng, and S. T. Flammia. “Robust shadow estimation.” PRX Quantum 2, 030348 (2021). arXiv:2011.09636.
- Hadfield, C., S. Bravyi, R. Raymond, and A. Mezzacapo. “Measurements of quantum Hamiltonians with locally-biased classical shadows.” Communications in Mathematical Physics 391, 951–967 (2022). arXiv:2006.15788.
- Huang, H.-Y., R. Kueng, and J. Preskill. “Predicting many properties of a quantum system from very few measurements.” Nature Physics 16, 1050–1057 (2020). arXiv:2002.08953.
- Huang, H.-Y., R. Kueng, and J. Preskill. “Efficient estimation of Pauli observables by derandomization.” Physical Review Letters 127, 030503 (2021). arXiv:2103.07510.