These problems practise Pauli-basis linear inversion and its error bars, the projection onto the state space, the optimality conditions of maximum likelihood, and the role of the rank in the trace-distance error.
Problem 1
Problem 4.1 (Single-qubit tomography by hand).
A qubit is measured times in each of the , and bases (). The outcome is seen , and times.
Compute the linear-inversion estimate of and its eigenvalues. Is it a state?
Run the threshold rule of Proposition 4.5 on the eigenvalues of . Show more generally that for a qubit with estimated Bloch vector , , projected least squares returns the pure state with Bloch vector , and that it changes nothing when .
Estimate the standard error of each Bloch component from Proposition 4.2, plugging in the estimates for the unknown .
Evaluate the bound and part 3 of Theorem 4.3 for these data with , and find how many shots per basis that theorem asks for to guarantee .
Solution
For one qubit every Pauli is measured in its own basis, so : and . As for any qubit operator , the eigenvalues are with , that is and . It is not a state: it assigns probability to the projector onto its second eigenvector.
The sorted eigenvalues are and , summing to one. For the threshold is ; for it is , and the test holds exactly when . So if nothing happens, and if the rule picks , , and the projected eigenvalues are : the state is the eigenvector of with eigenvalue , the pure state with Bloch vector . Here and has Bloch vector . This is the normalization fix of Problem 1.4, now derived as the Frobenius projection.
Each component averages outcomes , so , which is the case of the proposition (). Plugging in: for , for and for . The component is the most precise because outcomes of a nearly deterministic measurement fluctuate little.
. The bound is for every component, much larger than the standard errors of part 3: Hoeffding ignores the variance and the union bound pays for all three components. Part 3 of the theorem gives . For it asks for , so copies, that is shots per basis ( copies).
Problem 2
Problem 4.2 (Balanced settings beat random settings).
Instead of measuring each of the Pauli settings exactly times, draw a setting uniformly at random for each of the copies, and average the product snapshots of part 4 of Proposition 4.2.
Show that the eigenvalues of each snapshot are products of factors from , and that .
Show that is unbiased and .
Show that the balanced estimator of Definition 4.1 with the same is never worse:
with equality only for the maximally mixed state. Explain the difference coefficient by coefficient.
Evaluate both risks for the noisy Bell state of Example 4.13 with .
Solution
Each factor has eigenvalues and , since has eigenvalues . Eigenvalues of a tensor product are products, and .
Given the setting , the outcome has probability , and has probability ; so the outcome comes from the POVM , and is its canonical dual evaluated at the outcome (Proposition 4.2, part 4). A dual frame reproduces the state: . For one snapshot , and averaging independent snapshots divides the expected squared error by .
By the Pauli expansion, and , so the risk of part 2 is . The balanced risk is , using . Subtracting gives the formula. Every term is nonnegative, and it vanishes only if for all , that is . Coefficient by coefficient: the random design estimates by 𝟙, whose single-shot second moment is , so its variance is ; the balanced design gets . The excess is the price of a random number of covering shots: the random design divides by the expected number instead of the actual one, and the fluctuation of that number multiplies .
, so the random design has risk . The balanced risk is (Example 4.13), and the difference is , a factor in squared error.
Problem 3
Problem 4.3 (Maximum likelihood for a qubit).
Consider single-qubit Pauli-basis data with shots per basis, the POVM , and the notation of Definition 4.10.
Show that the linear-inversion estimate reproduces the data exactly: for all six outcomes.
Deduce that if then is a maximum-likelihood estimate, in two ways: from and Proposition 4.11, and from Gibbs’ inequality for probability vectors and .
Suppose . Show that every maximum-likelihood estimate is a pure state. (Hint: if is full rank, forces ; expand in the Pauli basis.)
For the data of Problem 4.1, argue that the maximum-likelihood estimate has Bloch vector , write down the function of it maximizes, and compare the maximizer with the projected least squares estimate.
Solution
Since , the estimate is with . Using also , , which is for and for .
By part 1, an outcome with also has , and every other outcome has weight in . So , and Proposition 4.11(2) applies because is a state. Directly: is a probability vector for every state , so by Gibbs’ inequality (nonnegativity of the relative entropy of and ).
If is a full-rank MLE, then with invertible gives . Write , so . requires for each . Since , the common value is , so for all outcomes and the Bloch vector of equals , impossible when . So every MLE has rank one.
The data are balanced, so is unchanged by . If with were optimal, so would be , and by concavity (Proposition 4.11(1)) so would their midpoint , which is mixed; this contradicts part 3. Hence , , and up to a constant
A one-dimensional search gives , Bloch vector , whereas projected least squares points along , at . The two pure states are at trace distance . Maximum likelihood tilts towards because the data are more informative (variance is smaller), whereas the Frobenius projection weights all components equally.
Problem 4
Problem 4.4 (When does projection help?).
The snippet runs Pauli-basis tomography on three qubits ( shots per setting, ) for one random state of each rank , and prints the mean trace distance of linear inversion and of projected least squares over 200 runs, and the smallest nonzero eigenvalue of the state.
import numpy as npfrom functools import reducefrom itertools import productrng, n, d, m = np.random.default_rng(5), 3, 8, 50 # 27 settings x 50 shotssig = [np.array([[0, 1], [1, 0]]), np.array([[0, -1j], [1j, 0]]), np.diag([1, -1])]keys = list(product(product(range(3), repeat=n), product([1, -1], repeat=n)))op = lambda b, s, c: reduce(np.kron, [(np.eye(2) + c * x * sig[y]) / 2 for y, x in zip(b, s)])proj, snap = [np.array([op(b, s, c) for b, s in keys]) for c in (1, 3)]def tomography(rho): # m shots per setting, linear inversion p = np.einsum("kij,ji->k", proj, rho).real.reshape(3**n, 2**n) counts = np.array([rng.multinomial(m, q) for q in p]).ravel() return np.einsum("k,kij->ij", counts, snap) / (3**n * m)def pls(Y): # nearest state in Frobenius norm w, V = np.linalg.eigh(Y) u = np.sort(w)[::-1]; css = np.cumsum(u) - 1 k = np.nonzero(u - css / np.arange(1, d + 1) > 0)[0][-1] return (V * np.maximum(w - css[k] / (k + 1), 0)) @ V.conj().Ttdist = lambda A, B: 0.5 * np.abs(np.linalg.eigvalsh(A - B)).sum()for r in [1, 2, 4, 8]: # a random state of rank r G = rng.normal(size=(d, r)) + 1j * rng.normal(size=(d, r)) rho = G @ G.conj().T / np.linalg.norm(G)**2 li, ps = np.mean([[tdist(Y, rho), tdist(pls(Y), rho)] for Y in [tomography(rho) for _ in range(200)]], axis=0) print(r, round(li, 3), round(ps, 3), round(np.linalg.eigvalsh(rho)[-r], 3))
The four printed lines are 1 0.343 0.14 1.0, 2 0.351 0.21 0.435, 4 0.357 0.257 0.037 and 8 0.366 0.306 0.001.
Explain why tomography returns the linear-inversion estimate without ever computing a Pauli coefficient.
Use and Jensen’s inequality to bound the expected trace distance of linear inversion, and use Theorem 4.6 to bound that of projected least squares for each . Compare with the printed values.
Why does the advantage of projection shrink as grows, and why is it not zero at ?
Predict, without running the code, how the four pairs of numbers change if is multiplied by .
Solution
snap holds the product snapshots , ordered like the outcomes of each setting, and the last line of tomography averages them with the observed counts. By part 4 of Proposition 4.2 this average equals the pooled estimator .
With , , so the root-mean-square Frobenius error is at most . Jensen and give , against the printed to . Theorem 4.6(2) gives , that is , , and for ; only improves on the linear-inversion bound ( ties), and the printed and are about half of them. The bounds capture the trend, not the constants.
The error is spread over all eigen-directions with size about per direction. Projection removes the noise in directions where has (nearly) zero weight, by shifting and clipping at the threshold, but cannot remove it where has weight well above the noise. A rank- state has exactly empty directions, so the gain falls with . The random rank- state still has several eigenvalues below the noise level (the smallest is ), which behave like empty directions, so projection still helps there.
Linear inversion is unbiased with error proportional to , so its four numbers drop by a factor , to about . For and the projected errors also drop by about (the rank argument scales the same way). For and the noise per direction falls to about ; the eigenvalue of the rank- state, and the eigenvalues near and above of the rank- state, become resolved, so the advantage of projection shrinks for these states. Directions with weight still below the noise (the two smallest eigenvalues of the rank- state) keep a small advantage.