Goal

After this module you can state the shadow tomography problem, explain why gentle measurements let a protocol reuse copies, prove the regret bound of matrix multiplicative weights and the mistake bound it implies for online learning of quantum states, and assemble these pieces into a protocol that answers arbitrary two-outcome measurements on qubits from a number of copies polynomial in and .

Suppose we are handed copies of an unknown -qubit state and a long list of two-outcome measurements , and we must estimate every acceptance probability to accuracy . Measuring each on its own copies costs order copies (Module 1). Learning the whole state first costs order even with entangled measurements (Module 5), with . Module 7 showed that random single-copy measurements, classical shadows, need only order copies, where denotes the traceless part of ; but for a generic two-outcome measurement the shadow norm grows with . Is there a protocol whose copy count is small in and in at the same time, for every list of measurements?

Aaronson (1) answered yes and called the problem shadow tomography. The answer rests on two ideas that this module develops in turn. The first is physical: a measurement whose outcome is almost certain barely disturbs the state, so the same copies can be measured many times as long as each test is likely to pass. The second comes from learning theory: a learner that keeps a hypothesis state and is corrected only when its prediction is off by more than needs at most order corrections in total, however many measurements it is shown (2). The protocol therefore spends copies only on finding a measurement where the current hypothesis is wrong, and there are few such rounds.

The price is in the access model of Definition 1.17. The protocol measures many copies jointly, and the measurements depend on the hypothesis, so it needs a large quantum memory. It is also computationally expensive: the hypothesis is a matrix. Shadow tomography is a statement about what the copies contain, not about what is cheap to compute. Our presentation of the online learner and of threshold search follows Lectures 10 and 11 of Chen and Cotler (3).

The shadow tomography problem

What exactly must the protocol output, and what are the baselines it has to beat?

Definition 8.1 (Shadow tomography).

Let be known two-outcome measurements on , given as POVM elements , and let for an unknown state . A shadow tomography protocol receives copies of , may apply any measurement to (entangled and adaptive), and outputs numbers such that, with probability at least ,

The sample complexity is the smallest that works for every and every list of measurements.

Every observable with is an affine function of a two-outcome measurement, with , so nothing is lost by restricting to two-outcome measurements.

Three baselines frame the problem.

  • One measurement at a time. Measure on fresh copies and average. Hoeffding’s inequality with a union bound (Corollary 1.15) gives for each , so copies in total: linear in .
  • Full tomography. If then for every (Theorem 1.10), so one estimate answers all measurements, even infinitely many. It costs copies with entangled measurements (Theorem 5.19) and with single-copy measurements (Theorem 5.21): exponential in .
  • Classical shadows. Random Clifford measurements on single copies need

copies (Theorem 7.8), and for Clifford shadows , with the traceless part as above (4). For a projector of rank , , and is the largest value of over all . The guarantee is excellent for low-rank projectors such as fidelities with pure states, but grows linearly in for generic two-outcome measurements.

The question is whether one can be logarithmic in and polynomial in simultaneously.

Gentle measurement and the quantum union bound

When can a copy be measured and still be used again? When the outcome was predictable.

Lemma 8.2 (Gentle measurement).

Let and let be a state with for some . The state after observing the outcome , , satisfies .

This is due to Winter (7), with a weaker constant; the fidelity argument above gives the sharp form. The special case of a projector is Problem 1.3. The lemma is about one measurement. A protocol that reuses copies performs many measurements in a row, each on the state left by the previous ones, and the damage could accumulate. The next snippet shows that adding up the step-by-step disturbances is not a valid accounting: projective tests, each very likely to pass on the state it is applied to, drag all the way to the orthogonal state .

import numpy as np
 
k = 50                                   # tests onto slowly rotating directions
theta = np.pi / 2 / k
state, succ, local = np.array([1.0, 0.0]), 1.0, 0.0
for j in range(1, k + 1):
    phi = np.array([np.cos(j * theta), np.sin(j * theta)])
    amp = phi @ state                    # overlap with the current state
    succ *= amp**2                       # probability that every test passes
    local += 1 - amp**2                  # rejection probability, current state
    state = phi                          # post-measurement state
loss = sum(np.sin(j * theta)**2 for j in range(1, k + 1))   # on the original
print(round(succ, 4), round(local, 4), round(loss, 2))      # 0.9518 0.0493 25.5

All tests pass with probability , the step-by-step rejection probabilities sum to only , and yet the final state is orthogonal to the initial one. This is the quantum Zeno effect used as a tractor beam. The correct accounting measures every test against the original state: there the rejection probabilities sum to , and no bound is violated. The quantum union bound says that this accounting always works, with a loss of only a constant factor compared with the classical union bound.

Theorem 8.3 (Quantum union bound).

Let be projectors, a state, , and . Measure for in this order, each on the post-measurement state of the previous one. Let be the probability that some outcome is , and the state conditioned on all outcomes being . Then

A quick check on random tests: five projectors with random , applied to a random pure state in dimension .

rng = np.random.default_rng(3)
d, k = 64, 5
psi = rng.normal(size=d) + 1j * rng.normal(size=d)
psi /= np.linalg.norm(psi)
out, loss = psi.copy(), 0.0
for _ in range(k):
    v = rng.normal(size=d) + 1j * rng.normal(size=d)
    v /= np.linalg.norm(v)
    loss += abs(np.vdot(v, psi))**2           # tr((1 - Pi_j) rho), original state
    out = out - v * np.vdot(v, out)           # apply Pi_j = 1 - |v_j><v_j|
fail = 1 - np.vdot(out, out).real
print(round(fail, 4), round(loss, 4), round(4 * loss, 4))   # 0.0344 0.0375 0.1501

Online learning of quantum states

Now the learning side. Forget copies for a moment: how many times must a learner be corrected before it predicts every measurement correctly?

Definition 8.4 (Online learning of a quantum state).

An unknown state on is fixed. In rounds :

  1. an adversary chooses a two-outcome measurement , possibly depending on everything that happened so far, including the learner’s current hypothesis;
  2. the learner predicts ;
  3. if the round is a mistake, and the learner is told so and told the sign of ; otherwise it may or may not be told anything.

A mistake bound is an upper bound on the number of mistakes that holds for every , every adversary, and every number of rounds.

This is the realizable setting: the answers come from one true state. Aaronson, Chen, Hazan, Kale and Nayak (2) proved a mistake bound of order , independent of how many rounds are played. Figure 8.1 shows the loop.

learner Gibbs state omega_t adversary shows E_t prediction tr(E_t omega_t) teacher, knows rho mistake? sign s_t on a mistake only: H <- H + s_t E_t omega_(t+1) = exp(-eta H) / tr exp(-eta H) adaptive: may see omega_t
Figure 8.1. The online learning loop. The learner predicts with its current hypothesis state and changes the hypothesis only after a mistake; the adversary may choose each measurement after seeing the hypothesis.

Matrix multiplicative weights. The learner we analyze keeps a Hermitian matrix , the sum of the “losses” seen so far, and predicts with the Gibbs state at inverse temperature :

This is the matrix multiplicative weights (MMW) algorithm of Tsuda, Rätsch and Warmuth (11) and of Arora and Kale (12). For diagonal losses it reduces to the classical multiplicative weights (Hedge) algorithm on experts (13). The Gibbs state is not an arbitrary choice: it is the “follow the leader” choice regularized by the von Neumann entropy .

Proposition 8.5 (The Gibbs state as regularized follow the leader).

For Hermitian and , the function on density operators has the unique minimizer , , with and , where is the relative entropy.

So minimizes the total past loss plus a penalty for being far from maximally mixed. Without the penalty () the learner jumps to the eigenvector of the smallest eigenvalue of and can be fooled every round; with too much penalty () it never learns. The regret bound quantifies the trade-off.

Theorem 8.6 (Regret of matrix multiplicative weights).

Let be Hermitian with , where may depend on . Let and let be given by . Then for every density operator ,

With (for ) the regret is at most .

Theorem 8.7 (Mistake bound for online learning of quantum states).

In the setting of Definition 8.4, let the learner predict with from , , and update only after a mistake, with loss , where is the sign of , and on rounds without a mistake. Then the number of mistakes is at most

for every adversary and every number of rounds. More generally, if the learner updates in this way on any set of rounds, each with , there are at most such rounds.

Remark 8.8 (Beyond the realizable setting).

If the answers are noisy or come from no single state, mistakes cannot be bounded, but regret can: Aaronson et al. (2) show that a learner using MMW, or more generally regularized follow the leader with the von Neumann entropy on the absolute loss, has regret against the best state in hindsight, and they give two further routes to mistake and regret bounds, through postselection and through the sequential fat-shattering dimension, with somewhat different parameters. The general framework of regularized follow the leader is treated in Hazan’s book (16).

Threshold search and the shadow tomography protocol

The online learner needs a teacher that, given the learner’s predictions for all measurements, either certifies that all of them are good or points to one that is wrong. Can a teacher be built from few copies of ?

Some correct output always exists, and in the gray zone where the largest error lies between and both kinds of output are acceptable. Classically, samples suffice: estimate every from the same samples and compare. Quantumly this is the hard step, and it is where gentle measurement enters.

Theorem 8.10 (Quantum threshold search).

Threshold search can be solved with

copies of , independently of the dimension .

Putting the learner and the teacher together gives the main theorem.

Theorem 8.11 (Shadow tomography with polylogarithmically many copies).

Shadow tomography (Definition 8.1) can be solved with

copies, where hides factors polynomial in , and .

Note where each resource goes. The learner is purely classical, a matrix updated at most times, and never touches a copy; its mistake bound contributes the factor . Copies are consumed only by threshold search, which contributes per round. The two factors of multiply because every round uses fresh copies.

Remark 8.12 (Other routes to shadow tomography).

Aaronson’s original protocol (1) combined a gentle search for a violated measurement, based on a “quantum OR” bound (19), with a learner built on postselection, and used copies. Aaronson and Rothblum (20) gave a protocol with copies at fixed , with a higher power of , that processes the measurements one at a time, in an online fashion, using only gentle measurements. The bound of Theorem 8.11 is the best known in each of , and simultaneously.

Remark 8.13 (Gentleness and differential privacy).

Aaronson and Rothblum (20) found that gentle measurement is the quantum counterpart of differential privacy. A randomized algorithm on a database of records is -differentially private if changing one record changes the probability of every output by at most a factor . For a product state the analogue of a record is one tensor factor. Call a measurement -gentle on a set of states if, for every state in the set and every outcome, the post-measurement state is within trace distance of the original. On products of states they show that any -gentle measurement, for small , is -differentially private, and that any -differentially private product measurement is -gentle. The standard way to make a count private, adding Laplace noise, is also a way to make “how many copies accept ” a gentle measurement. Their shadow tomography protocol is a quantum version of the private multiplicative weights mechanism of Hardt and Rothblum (21), which answers many statistical queries on a sensitive database by keeping a multiplicative-weights hypothesis and spending privacy only on queries where the hypothesis is wrong: the same structure as the protocol above, with privacy in place of gentleness.

How good is this? Lower bound and comparison

How many copies does every protocol need? A classical argument already gives .

Proposition 8.14 (A lower bound of order log M over epsilon squared).

Let , , and . Every shadow tomography protocol for measurements on , with arbitrary entangled and adaptive measurements, that succeeds with probability at least uses

copies. In particular for constant whenever .

The table collects what is known. All bounds are for two-outcome measurements, accuracy , and constant failure probability.

MethodMeasurementsCopiesNotes
each separatelysingle copy, fixedconstants in Corollary 1.15 (stated for outcomes)
classical shadows, random Cliffordsingle copy, fixed for two-outcome ; small for low rank
classical shadows, random Paulisingle copy, fixedonly for acting on qubits; if for a Pauli string
full tomographyentangled, rank : any number of ; tight up to logs
full tomographysingle copytight up to logs
Aaronsonentangled, adaptivefirst polylog bound
Aaronson–Rothblumentangled, online at fixed gentle and private
Bădescu–O’Donnellentangled, adaptivebest known in all parameters
lower boundanything for Proposition 8.14; classical instance

The entries hide , and factors, and the constants behind them are large. To estimate all Pauli expectation values (even in absolute value) without quantum memory, every single-copy protocol needs a number of copies exponential in (22,23), so the entangled measurements in the shadow tomography rows are essential there (Module 11).

Worked example: online learning a three-qubit state

We run the learner of Theorem 8.7 and compare its mistakes with the bound. Every number below is checked in code/tests/test_08_shadow_tomography.py.

Example 8.15 (Matrix multiplicative weights on three qubits).

Setup. The unknown state is a Haar-random pure state on qubits (, seed ), the accuracy is and the learning rate . For a pure state , so Theorem 8.7 allows fewer than mistakes, and the potential of starts at and must drop by at least per mistake.

Three streams of measurements.

  1. Small-step adversary. Each round it shows , where projects onto the positive part of and is chosen so that the error is exactly : every round is a mistake, and each one teaches as little as possible. It runs until , after which no measurement can cause an error above . The learner makes 392 mistakes. Each lowers the potential by between and , about twice the guaranteed , because is small; this is why the count is about half the bound.
  2. Greedy adversary. Each round it shows the projector onto the positive part of (the negative part would do equally well), so the error equals , the largest possible. The learner makes only 83 mistakes before : large errors give large corrections.
  3. Random projectors. Each round shows an independent Haar-random projector of rank . Over rounds the learner makes mistakes (mean and standard error over runs), almost all in the first rounds.

All three counts are below , as they must be. The small-step adversary comes within a factor of it.

The snippet reproduces the small-step adversary run.

def gibbs(H, eta):                         # exp(-eta H) / tr exp(-eta H)
    w, V = np.linalg.eigh(H)
    x = np.exp(-eta * (w - w.min()))
    return (V * (x / x.sum())) @ V.conj().T
 
def pos_proj(A):                           # projector onto the positive part of A
    w, V = np.linalg.eigh(A)
    return V[:, w > 0] @ V[:, w > 0].conj().T
 
d, eps = 8, 0.1
rng = np.random.default_rng(8)
v = rng.normal(size=d) + 1j * rng.normal(size=d)
rho = np.outer(v, v.conj()) / np.vdot(v, v).real          # unknown pure state
H, omega, mistakes = np.zeros((d, d)), np.eye(d) / d, 0
while True:
    P = pos_proj(omega - rho)
    T = np.trace(P @ (omega - rho)).real                  # = trace distance
    if T <= 1.01 * eps:
        break
    E = (1.01 * eps / T) * P              # error exactly 1.01 eps: a mistake
    H = H + E                             # sign +1: the prediction was too high
    omega, mistakes = gibbs(H, eps / 2), mistakes + 1
print(mistakes, round(4 * np.log(d) / eps**2, 1))         # 392 831.8

Figure 8.2 shows the cumulative mistakes of the three streams, and the total mistakes of both adversaries for one to four qubits and three accuracies. The small-step adversary needs between and times mistakes, close to half the bound, so the analysis of this learner is loose by at most a factor of about at these sizes.

Mistakes of the matrix multiplicative weights learner with learning rate one half of epsilon. Left: cumulative mistakes against the round for a random pure three-qubit state at accuracy 0.1, for the small-step adversary, the greedy adversary and random rank-4 projectors (mean of 50 runs with a 5 to 95 percent band); the dashed line is the bound of about 832. Right: total mistakes of the two adversaries for one to four qubits and accuracies 0.2, 0.1 and 0.05, against the logarithm of the dimension divided by the squared accuracy; the small-step adversary lies close to, and below, the line at half the bound.
Figure 8.2. Mistakes of the matrix multiplicative weights learner with learning rate one half of epsilon. Left: cumulative mistakes against the round for a random pure three-qubit state at accuracy 0.1, for the small-step adversary, the greedy adversary and random rank-4 projectors (mean of 50 runs with a 5 to 95 percent band); the dashed line is the bound of about 832. Right: total mistakes of the two adversaries for one to four qubits and accuracies 0.2, 0.1 and 0.05, against the logarithm of the dimension divided by the squared accuracy; the small-step adversary lies close to, and below, the line at half the bound.
Example 8.16 (Copy counts for a million measurements on twenty qubits).

Take (), arbitrary two-outcome measurements and . With all constants and factors set to one, the leading terms of the table give:

  • each measurement separately, ;
  • Clifford classical shadows with the worst-case shadow norm, ;
  • full tomography with entangled measurements, ;
  • shadow tomography, .

The lower bound of Proposition 8.14 with requires at least copies with its constant , and when the exact per-copy relative entropy replaces (as in Problem 8.3); here . Shadow tomography wins by a factor of about over the single-copy methods at this size, and the factor grows without bound with at fixed . The gap of more than five orders of magnitude to the lower bound comes from the extra factors and from constants.

n, M, eps = 20, 1e6, 0.1
d, L = 2.0**n, np.log(M)
counts = {"separate": M * L / eps**2,
          "Clifford shadows": 0.75 * d * L / eps**2,
          "full, entangled": d**2 / eps**2,
          "shadow tomography": L**2 * np.log(d) / eps**4}
for name, c in counts.items():
    print(f"{name:18s} {c:.1e}")      # 1.4e+09, 1.1e+09, 1.1e+14, 2.6e+07

Figure 8.3 plots these leading terms against and against . Only shadow tomography stays polynomial in both and ; for small or few qubits the simple methods are cheaper.

Leading-order copy counts with all constants set to one, at accuracy 0.1, for measuring each observable separately, Clifford classical shadows with the worst-case shadow norm, full tomography with entangled measurements, shadow tomography, and the information-theoretic lower bound. Left: against the number of measurements for twenty qubits. Right: against the number of qubits for a million measurements; the star marks the worked example. Only shadow tomography grows slowly in both directions.
Figure 8.3. Leading-order copy counts with all constants set to one, at accuracy 0.1, for measuring each observable separately, Clifford classical shadows with the worst-case shadow norm, full tomography with entangled measurements, shadow tomography, and the information-theoretic lower bound. Left: against the number of measurements for twenty qubits. Right: against the number of qubits for a million measurements; the star marks the worked example. Only shadow tomography grows slowly in both directions.

What breaks

  • Computation. The learner stores and exponentiates matrices, and threshold search applies measurements on copies of an -qubit state that depend on all observables. Both cost time exponential in in general. Shadow tomography bounds copies, not gates.
  • Quantum memory. The protocol must hold many copies coherently and measure them jointly and adaptively. Without quantum memory no protocol matches the shadow-tomography rows in general: for Pauli observables single-copy protocols need exponentially many copies (Module 11).
  • Accuracy. The dependence comes from multiplying the number of learning rounds by the copies per round. Single-copy methods have , so at high accuracy, or for observables with small shadow norm, classical shadows are cheaper (Module 7). Whether is achievable for shadow tomography is open.
  • Constants and logarithms. The polylogarithmic bounds hide large constants; at the sizes of current experiments the simple baselines usually win.
  • Noisy answers. The mistake bound assumes the teacher’s verdicts come from one state. With noisy or adversarial feedback only regret bounds survive (Remark 8.8).

Why it matters

Shadow tomography shows that the information needed to answer exponentially many questions about a state fits in polynomially many copies, and that the obstacle to extracting it is disturbance, which gentle measurement controls. The online learner is the template of every algorithm that refines a hypothesis state from feedback, including the multiplicative-weights solvers for semidefinite programs (12). Its hypothesis is a Gibbs state, the same object whose Hamiltonian is learned from copies in Module 10. The contrast with classical shadows (Module 7) is the first instance of the separations between learning with and without quantum memory proved in Module 11. And the quantum union bound is a standard tool far beyond learning, wherever measurements are applied in sequence to a state that must survive them.

Further reading

  • Aaronson (1): the problem, the first polylogarithmic protocol, and lower bounds.
  • Aaronson, Chen, Hazan, Kale and Nayak (2): online learning of quantum states, three approaches to mistake and regret bounds.
  • Bădescu and O’Donnell (17): threshold search and the best known bounds for shadow tomography and hypothesis selection.
  • Aaronson and Rothblum (20): gentle measurement and differential privacy.
  • Chen and Cotler (3), Lectures 10 and 11: the presentation followed here.
  • Arora, Hazan and Kale (13) and Hazan (16): multiplicative weights and online convex optimization.

Homework

The problems for this module are in Homework 8.

1.
Aaronson S. Shadow Tomography of Quantum States. arXiv preprint arXiv:171101053. 2017;
2.
Aaronson S, Chen X, Hazan E, Kale S, Nayak A. Online Learning of Quantum States. arXiv preprint arXiv:180209025. 2018;
3.
Chen S, Cotler J. Quantum Learning Theory (Physics 272 / CS 2233), lecture notes [Internet]. Harvard University, Fall 2025; 2025. Available from: https://harvard-quantum-learning.github.io
4.
Huang H-Y, Kueng R, Preskill J. Predicting Many Properties of a Quantum System from Very Few Measurements. Nature Physics 16, 1050–1057 (2020). 2020;
5.
Aaronson S. The Learnability of Quantum States. arXiv preprint arXiv:quant-ph/0608142. 2006;
6.
Nielsen MA, Chuang IL. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press; 2010.
7.
Winter A. Coding Theorem and Strong Converse for Quantum Channels. IEEE Trans Inf Theory 45, 2481-2485 (1999). 1999;
8.
Gao J. Quantum union bounds for sequential projective measurements. Physical Review A, 2015, 92(5): 052331. 2014;
9.
O’Donnell R, Venkateswaran R. The Quantum Union Bound made easy. Symposium on Simplicity in Algorithms, SOSA, 314-320 (2022). 2022;
10.
Sen P. Achieving the Han-Kobayashi inner bound for the quantum interference channel by sequential decoding. arXiv preprint arXiv:11090802. 2011;
11.
Tsuda K, Rätsch G, Warmuth MK. Matrix Exponentiated Gradient Updates for On-line Learning and Bregman Projection. Journal of Machine Learning Research. 2005;6:995–1018.
12.
Arora S, Kale S. A Combinatorial, Primal-Dual Approach to Semidefinite Programs. Journal of the ACM. 2016;63(2):12:1-12:35.
13.
Arora S, Hazan E, Kale S. The Multiplicative Weights Update Method: a Meta-Algorithm and Applications. Theory of Computing. 2012;8(6):121–64.
14.
Golden S. Lower Bounds for the Helmholtz Function. Physical Review. 1965;137(4B):B1127–8.
15.
Thompson CJ. Inequality with Applications in Statistical Mechanics. Journal of Mathematical Physics. 1965;6(11):1812–3.
16.
Hazan E. Introduction to Online Convex Optimization. Found Trends Optim 2, 157-325 (2016). 2016;
17.
Bădescu C, O’Donnell R. Improved quantum data analysis. TheoretiCS, Volume 3 (March 18, 2024) theoretics:10924. 2020;
18.
Bene Watts A, Bostanci J. Quantum Event Learning and Gentle Random Measurements. 15th Innovations in Theoretical Computer Science Conference, ITCS (2024). 2024;
19.
Harrow AW, Lin CY-Y, Montanaro A. Sequential measurements, disturbance and property testing. Proc SODA 2017, pp 1598-1611. 2016;
20.
Aaronson S, Rothblum GN. Gentle Measurement of Quantum States and Differential Privacy. arXiv preprint arXiv:190408747. 2019;
21.
Hardt M, Rothblum GN. A Multiplicative Weights Mechanism for Privacy-Preserving Data Analysis. In: 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS). 2010. p. 61–70.
22.
Huang H-Y, Kueng R, Preskill J. Information-theoretic bounds on quantum advantage in machine learning. Phys Rev Lett 126, 190505 (2021). 2021;
23.
Chen S, Cotler J, Huang H-Y, Li J. Exponential separations between learning with and without quantum memory. arXiv preprint arXiv:211105881. 2021;