Exercises: Simulation and Noise Models
Exercise 11.10 — the noise signature table — is the one that turns a shrug into a diagnosis. Do that one even if you skip the rest.
Difficulty: ⭐ warm-up · ⭐⭐ standard · ⭐⭐⭐ deeper.
Solutions: worked answers to the daggered (†) and odd-numbered problems are in
appendices/answers-to-selected.md; runnable code in
code/exercise-solutions.py.
Part A — Warm-ups ⭐
11.1 † Name the four main simulation methods and give each one's memory cost in terms of $n$.
11.2 Why does the density-matrix method hit the wall roughly twice as early as statevector?
11.3 † State the Gottesman–Knill theorem. What immediately follows about quantum advantage from Clifford circuits, and what does not follow?
11.4 What determines whether matrix-product-state simulation is efficient? Is it the qubit count?
11.5 † Write the one line that builds a simulator carrying a real device's basis gates, coupling map, and calibrated error rates.
Part B — Methods and Limits ⭐⭐
11.6 † Time all four methods on a GHZ chain at $n = 5, 10, 15, 20, 25$. Which fails first, and at what size? Which are flat? Explain each shape.
11.7 Use the density-matrix method to compute purity and fidelity for a Bell state under depolarizing noise at $p = 0, 0.02, 0.05, 0.10, 0.20, 0.50$. Plot or tabulate both. At what $p$ does purity reach its floor, and what is that floor for two qubits?
11.8 † The Clifford boundary, and the testing trap. Take a GHZ chain, append $T$ gates before the measurements, and run it on the stabilizer method. Does it fail? Print the transpiled circuit and explain what happened. Then construct a circuit where $T$ genuinely matters and rerun. Report which methods succeed, which fail, and which is merely approximate.
11.9 Build a noise model from FakeSherbrooke. Report which instructions carry noise and how many
qubits. Run a Bell state through it and compare the error fraction to Chapter 2's Runtime-sampler
measurement of 0.0439.
Part C — Noise Signatures ⭐⭐⭐
11.10 † The signature table. For each of: no noise, depolarizing at $p = 0.01$ and $0.05$, readout at $p = 0.01$ and $0.05$, amplitude damping at $\gamma = 0.05, 0.15, 0.30$, and phase damping at $\gamma = 0.10$ and $0.30$ — run a Bell state and report the error fraction and the peak imbalance $(n_{00}-n_{11})/(n_{00}+n_{11})$. Build the table, then write the two-line rule that lets you read a histogram.
11.11 Which channel in 11.10 is invisible to both axes? Explain why, and design the measurement that would reveal it. Verify that your measurement does reveal it.
11.12 † Thermal relaxation: sweep $T_1$, $T_2$, and gate duration. At what gate duration does decoherence become comparable to a 2% readout error? At what coherence time?
11.13 Compare statevector and MPS on a low-entanglement and a high-entanglement circuit at $n = 10, 16, 20, 24$. Report the speedups. Then state the caveat that stops the second comparison from proving what it looks like it proves.
Part D — Deeper ⭐⭐⭐
11.14 † Write classify_noise(counts) that returns a diagnosis from a two-qubit histogram using
the two axes. Test it against all the channels from 11.10 and report its accuracy. Which case does it
get wrong, and is that a bug in the classifier or a limitation of the data?
11.15 Build a noise model by hand that reproduces FakeSherbrooke's Bell-state error fraction to
within 20%, using only depolarizing, readout, and thermal-relaxation channels with the device's
published parameters. How close can you get, and which term did you have to guess?
11.16 † The extended_stabilizer method is approximate. Measure how its error grows with $T$
count: run H T H and then circuits with 2, 4, and 8 $T$ gates, comparing against statevector. Does
the runtime grow exponentially in $T$ count as the theory says?
11.17 Construct a circuit that is genuinely hard for MPS — high entanglement and non-Clifford. Measure the crossover: at what qubit count does MPS become slower than statevector?
11.18 † AerSimulator.from_backend() treats errors as independent and Markovian. Name three real
error mechanisms it therefore cannot capture, and for each say how you would detect its presence
experimentally.
11.19 Design a simulator-based test that would have caught Chapter 10's Case Study 1 failure — an ansatz whose routing cost tripled. What does it assert, and what tolerance would you set?
Part E — Project ⭐⭐
11.20 † Implement the Chapter 11 🧱 Project Checkpoint: vqelab/tests/test_sim.py with
noiseless_energy(), noisy_energy(), noise_signature(), and the three tiers of test.
11.21 Run the checkpoint's noise-signature classifier against all four channel types and confirm it diagnoses each correctly. Then add phase damping to the test set — what does the classifier say, and is it wrong?
11.22 ⭐⭐⭐ test_noise_model_matches_reference uses a 30% tolerance, chosen by hand. Replace it
with a tolerance derived from the circuit: given the transpiled two-qubit gate count and the
backend's median error rates, predict the expected degradation and set the tolerance from that.
Compare your prediction to the measurement, in the manner of Chapter 2's Case Study 2. Does your
predicted tolerance hold across ansatz depths from 1 to 5?