Affiliate disclosure
Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.
Further Reading: Debugging Quantum Programs
Tagged Tier 1 (confident it exists and recommended) and Tier 2 (real and worth seeking, but verify the current version or URL).
This is a thinner literature than any other chapter in this book, and that is the most useful thing to know about it. Quantum debugging is not a solved area with a canonical textbook; it is a set of practices assembled from tool documentation, a young research literature, and hard experience.
The tools you will actually use
- The
qiskit.quantum_infoAPI documentation —Statevector,Operator,DensityMatrix,partial_trace,purity,process_fidelity,state_fidelity,random_statevector,Clifford. Every diagnostic in this chapter is one call from this module. Read the whole page once; it is short, and knowing what is in it is most of the skill. Tier 1. Operator.from_circuitspecifically. It applies the initial layout and the routing permutation, and Case Study 2 is a week lost to not knowing it exists. Tier 1.- Qiskit's transpiler documentation on
TranspileLayout—initial_index_layout(),final_index_layout(), and what each one means. The information Case Study 2's team needed was printable in one line. Tier 1. - Aer's save instructions —
save_statevector,save_density_matrix,save_probabilities,save_expectation_value. Mid-circuit inspection for circuits that must run through Aer anyway. Tier 1.
On assertions and runtime checks
- Huang and Martonosi, "Statistical assertions for validating patterns and finding bugs in quantum programs" (2019), ISCA. The foundational paper on quantum assertions: classical, superposition, and entanglement assertions, checked statistically. The best single paper on §26.6, and it takes the hardware case seriously rather than assuming a simulator. Tier 1.
- Huang and Martonosi, "QDB: From Quantum Algorithms Towards Correct Quantum Programs" (2018). A taxonomy of real bugs found in real quantum programs. Read it to calibrate how common each of §26.5's failure modes actually is. Tier 1.
- Work on projection-based and non-destructive assertions. The obvious objection to statistical assertions is that they cost shots and disturb the state; this line of work reduces both. Tier 2 — active.
On testing and formal methods
Chapter 27 is the proper home for this, but the boundary is soft.
- Literature on metamorphic testing for quantum programs. When you have no oracle for the correct output — the usual situation — you can still assert relations between outputs: this input should give the same distribution as that one, doubling this parameter should halve that probability. The most practical idea in quantum testing, and it survives on hardware where §26.4's operator comparison does not. Tier 2.
- Quantum program verification and equivalence checking, including decision-diagram approaches
(the MQT tooling from TU Munich). Automated equivalence checking of circuits far larger than
Operatorcan handle — the scalable version of §26.4. Tier 2, and worth checking for current releases. - Any treatment of the Gottesman–Knill theorem in a testing context. Clifford circuits are efficiently simulable, so a Clifford fragment of your program can be verified at scales where the full program cannot. Chapter 11's subject, applied here. Tier 1.
On what you cannot do on hardware
- Standard treatments of quantum state and process tomography — in Nielsen and Chuang, or any graduate quantum information text. Read for the $3^n$ and $12^n$ scaling and the reconstruction problem, not as a technique you will use. Tier 1.
- Chapter 25's further reading on Stim. For debugging error-correction circuits specifically, Stim's sampling and detector-error-model tooling is in a different class from anything general purpose. Tier 1.
- Randomized benchmarking and cycle benchmarking. These characterize noise, not correctness — which is exactly the distinction §26.1's fourth point turns on. Chapter 30's subject. Tier 1.
The classical literature that transfers
- Zeller, "Why Programs Fail: A Guide to Systematic Debugging." Delta debugging and systematic narrowing. §26.4's bisection is this book's idea, applied to circuits, and the discipline of turning debugging into search rather than inspiration is entirely portable. Tier 1.
git bisect's documentation, for the same reason and in one page. The monotonicity requirement is stated more clearly there than in most academic treatments. Tier 1.- Anything on property-based testing (Hypothesis, QuickCheck). Random inputs beat chosen inputs is §26.4's whole conclusion, arrived at independently and measured: 41% of structured inputs blind, 0 of 100 random ones. The classical community reached it decades ago. Tier 1.
Backward references
- Chapter 10 — what transpilation does, and why the circuit you wrote is not the circuit that runs.
- Chapter 11 — the simulation methods that determine how far these techniques scale.
- Chapter 19 — ancilla hygiene, and the bug §26.5's purity check exists to find.
Forward references
- Chapter 27 — testing, where "a test that cannot fail is not evidence" becomes a discipline rather than an anecdote.
- Chapter 30 — characterizing noise, which is the other half of telling a bug from a device.
Where to go next. If one thing: Huang and Martonosi's assertions paper. It is the closest thing this area has to a foundational text, and it addresses the hard case — assertions on hardware, where §26.2's tools are unavailable.
If two: add Zeller's Why Programs Fail, which is not about quantum computing at all. §26.4's bisection is a direct transplant, and the framing — debugging as systematic search rather than inspiration — is the single most useful idea to bring across.
Then Chapter 27, where the lesson this chapter learned the hard way three separate times becomes a policy.