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: OpenQASM

Tagged Tier 1 (confident it exists and recommended) and Tier 2 (real and worth seeking, but verify the current version or URL).

Short list. This chapter is about a specification and two library modules, and the primary sources are unusually good.

The specification itself

  • The OpenQASM 3 specification, at openqasm.com. The language reference: grammar, types, gate definitions, timing, and the classical language. It is a real specification, written like one, and it is short enough to read in an afternoon. Reading a specification end to end is a skill worth practicing, and this is a good one to practice on. Tier 1.
  • Cross et al., "OpenQASM 3: A Broader and Deeper Quantum Assembly Language" (2022), ACM Transactions on Quantum Computing 3(3). The design paper. Explains why QASM 3 added a classical type system, control flow, and timing — the reasoning behind every difference in §6.7's comparison table. Read this if you want to understand the format rather than just use it. Tier 1.
  • Cross, Bishop, Smolin, and Gambetta, "Open Quantum Assembly Language" (2017), arXiv:1707.03429. The original QASM 2 paper. Worth reading for contrast — the scope difference between the two documents is the clearest illustration of how the field's ambitions changed in five years. Tier 1.

The Qiskit implementation

  • The qiskit.qasm3 and qiskit.qasm2 module documentation. The authoritative reference for dumps/loads/dump/load, including the export options and the exact list of what each exporter supports. Check the dump/load signatures here rather than assuming, given §6.3's asymmetry. Tier 1.
  • The qiskit.qpy documentation. The binary alternative, including its version-compatibility policy — which is the thing that actually decides when to use it. Note especially which Qiskit versions can read files written by which others. Tier 1.
  • The Qiskit release notes for 1.0. Where qc.qasm() was removed, alongside execute() and the rest. Reading a major release's removal list once is a good way to calibrate how fast this ecosystem moves. Tier 2 — find the version-specific page.

On intermediate representations generally

This chapter's central argument is a compiler-engineering one, and the classical literature makes it better than any quantum source.

  • Chris Lattner and Vikram Adve, "LLVM: A Compilation Framework for Lifelong Program Analysis and Transformation" (2004). The $N \times M \to N + M$ argument in its original form. Everything §6.1 says about why an IR exists is an application of this paper. Readable, and it will change how you think about the quantum stack. Tier 1.
  • The MLIR project documentation, on dialects. A more modern take: multiple IRs at multiple abstraction levels, coexisting. Relevant because several quantum compilation efforts are building on MLIR, and it is a plausible future for the layer QASM currently occupies. Tier 2.
  • QIR (Quantum Intermediate Representation), an LLVM-based specification from the QIR Alliance. A genuine alternative to QASM at a lower level, used by Microsoft's toolchain among others. Chapter 15 touches on it. Worth knowing exists; not worth learning unless you work below the circuit layer. Tier 2.

On serialization losing things

The failure in Case Study 1 is not a quantum problem, and the best writing about it is not quantum writing.

  • Anything on the "lossy round trip" problem in data engineering — the general phenomenon where A → B → A is not the identity, and the difference is invisible until a downstream consumer depends on it. Timezone-stripped timestamps, float-to-string precision, and Unicode normalization are the canonical classical examples, and the failure mode is identical. Tier 2 — no single canonical source; search on "round-trip fidelity" in whatever domain you know best.
  • Hyrum's Law ("with a sufficient number of users, every observable behavior of your system will be depended on by somebody"). The one-sentence version of Case Study 1's lesson, and a useful thing to be able to cite. Tier 2.

For the transpiler investigation (Case Study 2)

  • The Qiskit transpiler documentation on preset pass managers. What each optimization level actually runs, stage by stage. The reference that turns "level 3 did something" into a specific named pass. Tier 1.
  • The Qiskit documentation on writing a custom pass and on PassManager callbacks. How to instrument a transpilation and capture the circuit after each pass — the answer to Case Study 2's hardest question, and the foundation of Chapter 10 §10.8. Tier 1.
  • Appendix F in this book: the OpenQASM 3 syntax reference distilled to what this book uses, with the QASM 2 equivalents side by side. Tier 1.

Where to go next. If one thing: read the OpenQASM 3 specification's overview and grammar sections. An hour, and afterwards every transpiled circuit you look at reads as a document rather than as output.

Part I ends here. Turn to Chapter 7 and Part II.