The Quantum Engineer

70. Project 5 — Quantum Compiler

Build: parser, intermediate representation, gate decomposition, qubit mapping, routing, optimization, scheduling. (Chapter 46's project spec is the full version.)

Specification. A package qcc (see Ch. 46's deliverables list): text/OpenQASM-lite parser with parameters; DAG IR with node/edge operations and topological iteration; passes — inverse-pair cancellation, rotation merging, commutation-aware sliding, SWAP-based routing (SABRE-style heuristic) on a 7-qubit heavy-hex coupling map, direction fixing, Euler resynthesis of 1-qubit strings; a scheduler producing per-qubit timelines with gate durations; a cost module (gate counts, depth, Σ per-gate error from a calibration file); a benchmark harness running your corpus with seeds.

Milestones. M1: parser + DAG + Operator-equivalence harness — the correctness foundation, built first. M2: cancellation + merging; ≥10% gate reduction on QFT-5. M3: routing with correct output-permutation tracking (measurements included — Ch. 46.2's named bug, tested by name). M4: full pipeline vs. Qiskit O0–O3 on a 4-circuit corpus (QFT-5, Grover-3, 4-bit adder, GHZ-7), ≥20 seeds, medians and IQR. M5 (research-grade): one novel or adapted pass — noise-adaptive layout from a calibration snapshot, or Pauli-commutation reordering — with its own benchmarked win on a workload class.

Acceptance criteria. Pipeline output unitary-equivalent to input on all tests; benchmark report with honest error bars (Ch. 46.8's protocol, followed literally); README documents each pass with its complexity and one before/after circuit diagram; the M5 pass's improvement is real, isolated (ablation shown), and honestly scoped ("wins on X, loses on Y").

What it proves. Part XII plus the systems-engineering maturity to build a tool stack, verified at every layer. This project plus Project 4 is a complete entry-level portfolio for Ch. 60.4 and 60.5 roles. Effort: 4–6 weekends.