and the > arithmetic is stark: **the submission overhead is 57× the compute.** A team that batches correctly > and a team that does not are running the same experiment at two orders of magnitude apart in price, > and neither invoice line is labelled "loop." > > The per-minute model hides it differen → Quantum Programming
$185,542
the largest number in this book — for thirty-one seconds of device time. → Quantum Programming
$2n + 1$
two shifted evaluations per parameter (at $+\pi/2$ and $-\pi/2$), plus one forward pass for the function value itself. Verified: 16 parameters → 33 executions. → Quantum Programming
$\Lambda$ is constant down each column
exponential suppression for linear qubit cost. That is the entire case for fault tolerance. → Quantum Programming
$\Phi$ versus $\Psi$ is visible in the counts
same outcomes or opposite outcomes. **The $\pm$ is not.** $|\Phi^+\rangle$ and $|\Phi^-\rangle$ give identical computational-basis statistics and are orthogonal states, exactly as $|+\rangle$ and $|-\rangle$ were in Chapter 3. → Quantum Programming
$a^{r/2} \equiv -1$
the reduction collapses, as at $a = 14$. Pick a different $a$. → Quantum Programming
$N > 10^{18}$
a quintillion. Such problems exist (a 128-bit key space is $2^{128}$), which is why Grover's practical significance is cryptographic. → Quantum Programming
$n^2$ entry count
so **concentration and the shot budget multiply**, exactly as barren plateaus and the shot budget did in Chapter 32 §32.5. → Quantum Programming
$P = 0.0000$
$(2k+1)\theta = 0.9978\pi$, rotating almost exactly onto the unmarked axis. **The symptom is no successes at all**, distinct from a broken oracle's wrong-but-consistent answer. **Check by running $k=1$ and $k=2$.** And at $M/N = 1/2$ Grover cannot help at all. → Quantum Programming
`qc.inverse()` inverts *your* circuit, so the inverse carries the same wrong angle and cancels it exactly. It is the most-cited property in quantum testing and it can never catch a wrong gate parameter. → Quantum Programming
a pulse schedule is meaningless on another backend and absurd on trapped ions, while Qiskit's other abstractions survive a hardware change. **(b) The user base was tiny and largely internal to vendors**, who had better device-specific tools. **(c) The hardware moved past it** — fractional gates, par → Quantum Programming
(a) The oracle is not free
thousands of T gates per call, and T gates are the dominant fault-tolerant cost. **(b) The oracle must exist** as a reversible circuit: early exits, lookup tables, and short-circuit evaluation do not survive reversibility, and for "database search" the data must be in the circuit rather than in a da → Quantum Programming
+0.0202 ± 0.0170
not significant. And kNN beat the quantum model by → Part 06
,
x=3
1.000**. Uniform input -> `[+0.354, +0.354, +0.354, -0.354]`. Scratch left UNENTANGLED. Bit oracle with scratch in |0> gives `[0.5,0.5,0.5,0,0,0,0,0.5]` — marked term moved into the SCRATCH register = **useless**, because information in a separate register does not INTERFERE. → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
0.0 ns
a $Z$ rotation is implemented as a > *frame change*, a bookkeeping update to the phase reference of every subsequent pulse on that qubit. > No microwave is emitted. Nothing decoheres that would not have decohered anyway. > > So `rz` gates are simultaneously **free to execute and free to move**, and → Quantum Programming
0.0000 at every $p$, including 0.6
where correction is impossible. Conjugating the error back through the decoder: → Quantum Programming
0.0005%
WRONG, corrected to 0.08% throughout chapter + example (and "99.9995%" -> "99.92%"). Ch.22's AQFT saves 82% of that 0.08% = 0.07%. **AQFT still matters for FEASIBILITY (rotations below hardware resolution), not count.** => "the interesting part and the expensive part are frequently not the same part → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
0.001406
a plausible number produced by comparing two circuits on mismatched wires. → Quantum Programming
0.0029 (k=2) → 0.0048 (k=3) → 0.0068 (k=4)
reuse degrades cumulatively. - **Cost** on FakeSherbrooke opt 1: static GHZ ISA depth **9**, teleportation **14**, teleportation + stage barriers **20**; all with 2q = 2. Noisy teleport P(0) = **0.8350** vs ideal 0.8824 (−0.0474). - **Project negative result:** VQE ansatz static vs dynamic (4 qubits → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
0.00750 or 0.07205
a factor of 9.6 — depending on choices that are rarely published. And the standard benchmark for gate quality, randomized benchmarking, is → Quantum Programming
0.00750 or 0.07205 — a factor of 9.6
depending only on whether the dead links are excluded from the mean. A uniform `p` is an average over a distribution whose spread is larger than itself. → Quantum Programming
0.00750 to
0.07205
a factor of 9.6. *Measurement:* the error rates of the links actually used. - **Routing.** The transpiled circuit has more two-qubit gates than the 20 written. *Measurement:* count them after transpilation. Ch. 39 measured a 49-to-112 spread. - **Readout error**, not included in the gate-error produ → Answer Keys for All Exams
0.00750 to 0.07205
a factor of > **9.6** across a single backend — and Chapter 39 found `cz` error from **1.79e-03 to 1.00** on dead > links. A tolerance sized for Monday's calibration is either flaky or blind by Thursday. > > **The workable pattern is a differential one:** compare today's distribution against *yester → Quantum Programming
0.0110
consistent on every axis. One basis proves almost nothing; three bases is single-qubit tomography and is the honest standard. Alice's four outcomes each occurred about a quarter of the time, which is the cleanest demonstration that her result carries no information about the state. → Quantum Programming
negligible. **The AQFT is not pointless**: it removes rotations smaller than any hardware can reliably apply, so it is about **feasibility** rather than gate count. But to make Shor cheaper, **every hour belongs in reversible modular arithmetic**. → Quantum Programming
0.10
nearly twice as loose as they had to be. Here is what the tighter tolerance would have bought at the same shot count: → Quantum Programming
0.100%
two expected red builds per 2,000 runs, essentially the rate they started with and called intolerable — the $\varepsilon = 0.20$ bug goes from 52% detection to → Quantum Programming
0.1346
Repetition codes at $d = 1,3,5,7,9$ **fan downward below $p = 0.5$ and upward above it**, crossing at - With noisy syndrome extraction at $p_{\text{data}} = 0.01$, breakeven is a gate error of about - Under a depolarizing channel rather than a single Pauli, the verdict is unchanged: at $\lambda=0.10 → Harvested measurements
0.150%
but 1.0% is a *plausible* number. Nothing about it demands investigation. Catching it took ten times the sample. - §25.3's phase-flip code came out as **0.0000 at $p = 0.6$**. That is not a plausible number. It is arithmetically impossible, and catching it took one row. → Quantum Programming
0.150% and 0.100%
off by a factor of about 6.7. Two events is not a rate. This is the first of seven such errors in the book. → Part 05
0.150%, 95% interval 0.051% to 0.440%
an interval spanning almost an order of magnitude, which is precisely why that section's earlier $2/200$ estimate of 1.0% needed correcting rather than quoting. → Quantum Programming
0.1706 ± 0.0110
a - ★ **A 100× CLOPS improvement changes wall clock by 0.0023%** at Chapter 39's five-minute-queue → Harvested measurements
0.1818
**and that gap is what a quantum model would have to close to mean anything.** → Quantum Programming
0.2222 ns
every duration on the device is an integer multiple of it. - Gate durations: **`sx`/`x` 56.9 ns**, **`ecr` 341.3–881.8 ns (median 533.3)**, **`measure` 1,216 ns** - ★ **`rz` takes 0.0 ns.** It is a virtual Z: absorbed into the phase of subsequent pulses, exact and - **T1 median 278.4 μs, T2 median 1 → Harvested measurements
0.2398
matching $\tfrac12\times\tfrac12$ | | Abort threshold, $r = 1-2h_2(Q) = 0$ | **QBER = 0.110028** | | Test bits to catch a 45% tapper | **62,761** | | Below $f = 0.30$ | **no sample size detects her** | | Finite-key loss at $10^3$ bits | **13%**, and the simple model understates it | | Secret key rat → Harvested measurements
a factor of **795** - **$p=1$ scores 0.751, below GW's 0.87856 guarantee.** A proof from 1994 beats QAOA's first layer - **The $p=4$ regression was not real** — 7 of 8 seeds went the other way; the one-seed table was a draw from a distribution, the book's fourth instance of that error - **Landscape → Quantum Programming
$(1 + 0)/2$. The one summary statistic every device page quotes conceals precisely the failure it most needs to reveal. → Quantum Programming
0.5755 to
0.7911
a 2.03× spread in error — with two-qubit gate counts from 49 to 112. **The same test on 4 qubits produced exactly zero variation.** → Quantum Programming
0.5755 to 0.7911
a 2.03× spread in error, with two-qubit gate counts running from 49 to 112. No shot count touches that, because it is not sampling noise: it is 24 different circuits. The fix is repetitions across seeds and a reported distribution, not a bigger $N$. And the trap is in the control: **the same test on → Quantum Programming
0.5755 to 0.7911 — 2.03× the
error
driven by a 49-to-112 spread in two-qubit gate count. That is routing overhead: the transpiler inserts swaps to satisfy connectivity, and how many depends on where it started. → Quantum Programming
0.6364 to 0.8500
**a larger swing than quantum-versus-classical anywhere in Part VI**. A comparison that varies the feature map while claiming to compare methods is measuring hyperparameters. → Part 06
a swing larger than any difference this chapter will measure between methods. → Quantum Programming
0.7720
+0.1397. **Choosing the right qubits beat three levels of transpiler effort on the wrong ones.** → Part 05
0.8086
**below** the guarantee. $p=2$: 0.9636 — above. $p=3$: 0.9979 — above. Goemans–Williamson guarantees **0.87856** for any graph, in polynomial time, since 1995. → Quantum Programming
0.8785
below a polynomial-time classical guarantee from 1994. Chapter 37 runs the full comparison and finds QAOA winning 0 of 10 instances. → Part 04
0.9116
Chapter 39 ran the same 14-qubit layout problem across 24 seeds and got fidelities from **0.5755 to → Harvested measurements
0.9764
the entire difference coming from data that a Cirq device object does not contain. Chapter 30 §30.3 measured why it matters: **one chip's two-qubit error ranged 0.00750 to 0.07205, a factor of 9.6**, on the same day. → Quantum Programming
1 moment under `EARLIEST` and 3 under `NEW`
same gates, same result, three times the depth, set by a constructor argument rather than negotiated with a scheduler. → Quantum Programming
readout is by far the slowest operation, which surprises most people and dominates the circuit's total duration. → Quantum Programming
1,861
terms
one constant, 36 one-body, 1,824 two-body — which Jordan–Wigner collapses onto **631 distinct Pauli strings**. That is a 2.95× collection, achieved for free by the mapping, and it happens before any commuting-group optimization is applied. → Quantum Programming
chemical accuracy, about 1 kcal/mol — of the exact value for H₂ in a minimal STO-3G basis at its equilibrium bond length of 0.735 Å, which is approximately **−1.137 Hartree**. → Quantum Programming
1.8×
*Derived from the measured spread, not separately measured:* resolving $+0.0028$ at $2\sigma$ needs → Harvested measurements
10 parameters
verified against Qiskit's `QAOAAnsatz`, which reports `num_parameters == 2 * reps` regardless of the graph. A hardware-efficient ansatz of the kind Part VI used, one $R_y$ per qubit per layer, would need $12 \times 5 = 60$; with $R_y$ and $R_z$, 120. → Quantum Programming
under a quarter — and diameter is close to the right cost model for routing, because moving a state from one end of the chip to the other costs a SWAP chain proportional to distance. Chapter 29 §29.1 made the same argument for IBM's heavy-hex lattice: *the chip is not a complete graph*, and how far → Quantum Programming
114,930, 177,990, and 278,010 physical
qubits
and stopped short of $n = 20$. This is the missing row, and it is the one the chapter's argument actually needs. → Quantum Programming
not monotonic, not proportional to width, and not predictable from the ansatz's name. At four wires the range-3 ring happens to split into pairs that leave two wires disconnected a full layer earlier; at ten wires thirteen parameters die somewhere in the middle. **There is no formula. There is a mea → Quantum Programming
132 delay
instructions
clear evidence it had analyzed the schedule and found idle time. It added four `X` gates. The circuit got two layers deeper. A reasonable person checking "did DD run?" would have answered yes and moved on. → Quantum Programming
14 of 40 circuit-seed pairs
a difference invisible to any suite that fixes one seed. Chapter 30 will choose a benchmark statistic and pay §27.6.2's price for it. → Quantum Programming
the estimate landed between the two regimes rather than in either. Its conclusion survives either way: 16 $\sqrt{X}$ pulses at Chapter 39's measured `sx` durations of 32–64 ns is 0.5–1.0 µs, still an order of magnitude under Chapter 39's QFT-8 at 10.55 µs. → Quantum Programming
17% of the time
so the "cannot reject" row is the *expected* outcome, not bad luck. At 1,000 shots it rejects 89% of the time, and the observed $p = 0.037$ is a marginal rejection, which is exactly what 89% power looks like from the inside. → Quantum Programming
18
a factor of nearly sixteen. Against Chapter 1's few-hundred budget, `full` at ten qubits is already out of reach and `linear` has room for a great deal more depth. → Quantum Programming
2,882 at one
is set by code distance and magic-state distillation, and both are engineering targets with known improvement paths. The 2023–24 below-threshold demonstrations moved the actual number. **Nothing about the problem's shape says it cannot be solved**; it is expensive, and expense responds to work. → Quantum Programming
the role people imagine when they hear "quantum job," and the smallest by headcount. The largest categories are classical engineering roles where quantum literacy is the differentiator. → Quantum Programming
which is more than two orders of magnitude larger than the effect being measured > here. Six transpiler seeds would have produced an error bar that swallowed the result whole. > > And here is why the conclusion nonetheless holds: **the comparison is paired.** Because all three > arms share one trans → Quantum Programming
2.03× the error
with two-qubit counts from 49 to 112. The same test on a **4-qubit** circuit produced **exactly zero** variation, and Chapter 39 concludes that layout variance is a large-circuit phenomenon. → Quantum Programming
2.31 × 10⁻⁵
43,340× wall clock | | Book's experiments | 614,400 to **18,456,984** shots | | 18.5M shots of device time | **31.2 seconds** | | Same run, per-minute | **$50** | | Same run, per-shot superconducting | **$7,432** (149×) | | Same run, per-shot trapped ion | **$185,542** (3,718×) | | 2-qubit error spr → Harvested measurements
and that comparison silently gave direct estimation **17× the total budget**. At equal total budget: → Quantum Programming
22–74 ms
the local simulator's wall clock is the same order of magnitude as the quantum device's execution time. Nothing about *execution* is the bottleneck. Everything that makes hardware feel slow happens around it. → Quantum Programming
24 samples and the wrong system
a 4-qubit test circuit that fits the coupling map without routing, so zero variance was a true measurement of a false general claim. A measurement can be too small in more than one dimension. → Final A — Whole Book
240.4 km
and it dies because dark counts *do not decay* while signal does. Trusted-node networks extend range by **putting the key in the clear at every relay**, which is the kind of assumption QKD was sold as eliminating. → Quantum Programming
the interesting property is a property of the *builder*, and a builder verified exactly at $n = 3, 4, 5, 6$ against a reference, plus an assertion that its gate count follows the predicted formula at $n = 40$, is stronger evidence than one heroic simulation at $n = 20$. → Quantum Programming
27 tasks per iteration, exactly
one per Hamiltonian term in a small active space, which is what term-by-term looks like when you can still afford it. **The structure of the bill is the structure of the Hamiltonian**, and grouping is the only lever that changes it without changing the chemistry. → Quantum Programming
27.8 QPU
hours
a factor of roughly **ninety thousand**, for a model that is measurably less accurate. → Quantum Programming
28.57× for all-to-all connectivity
and that premium is recoverable only through fidelity. Since precision scales as $1/\sqrt{N}$, the ion machine has to be $\sqrt{28.57} = \mathbf{5.35\times}$ better, and at $n=12$ even a **perfect** ion machine is $1/(0.9925)^{35} = 1.30\times$ better. **A superconducting circuit needs 223 two-qubit → Quantum Programming
mostly does not apply, and Chapter 10's transpiler has little to undo. → Quantum Programming
300× larger than the largest device that exists
Case Study 1 puts today's ceiling at about 1,000 physical qubits with no error correction at scale — against a fraction of a second on one core. → Quantum Programming
31% of them are within 2× of the best
good layouts are not rare, they are just not the ones > you get by accident. > > **4. Measure your own preflight refusal rate.** Count how many enumerated paths the check rejects, > then compare against the naive $(\text{usable}/\text{total})^n$. A measured rate *above* the naive > one means the bad → Quantum Programming
the same, within the synthesiser's run-to-run variation. Synthesis cost is set by the *target precision*, not by how small the rotation is. A near-identity rotation is not a cheap rotation. → Quantum Programming
38.6 QPU-days
for the Gram matrix alone, before any training, on 201 samples, for a kernel whose off-diagonal entries carry almost no information. → Quantum Programming
a 6.4× cliff from a single non-Clifford gate. This is the clearest single number in the book for why fault tolerance is the real problem. → Quantum Programming
4. Only now suspect logic
and go back to the simulator with a noise model built from that backend (Chapter 11 §11.7), where you can look again. → Quantum Programming
4.4×
a 5.9× range in predicted infidelity between the best and worst *acceptable* layout. **Refusing broken hardware is the large, free half; choosing among the working hardware is the smaller, cheap half.** Report them separately. → Quantum Programming
50%
a factor of **171**. - Two-qubit gate error ranges from 0.35% to **100%** — a factor of **288**, and nine gate pairs are simply dead. - $T_2$ ranges from 2.6 μs to 489 μs — a factor of **185**. → Quantum Programming
50.2 s on an exact
simulator
**~20,000× slower** than logistic regression, with no shots and no noise. - Amplitude-encoding gate counts follow **exactly** $N - \log_2 N - 1$: 1, 4, 11, 26, 57, 120. - ★★ Training on hardware: $(2n+1) \times \text{samples} \times \text{steps} \times \text{shots} = 49 \times 70 \times 60 \times 10 → Quantum Programming
50.2 seconds
and on cost. **A tie on a problem the baseline already saturates is not evidence of anything**, and the honest reading is that the dataset was the wrong choice. → Final B — Whole Book, alternate form
50.2 seconds on an exact simulator
roughly 20,000× slower, with no shots and no noise — and would take **2.38 QPU-days** on hardware. → Quantum Programming
500
because $d$ drops from 7 to 5 and, at that requirement, no distillation is needed at all. **A one-in-a-hundred failure rate is perfectly acceptable for an algorithm you can verify classically**, and factoring is exactly such an algorithm: multiply the factors back together. That is not a rounding er → Quantum Programming
54 gates for 18 logical
one unnecessary ring-closing edge cost 36 gates. - ★★★ **Hardware-aware at level 1 (0.9116) beats naive at level 3 (0.7720) by $+0.1397$.** Isolating the variables: **shape at a fixed level is worth $+0.1658$, optimization level at a fixed shape $+0.0262$ — a factor of six.** - ★ A hand-chosen **con → Quantum Programming
54 hardware gates instead of 15
the ring-closing edge is not on the chip. **One edge you did not need cost more than the fifteen you did.** → Quantum Programming
55 hours of QPU time per daily
route
against a four-minute end-to-end classical solve that handles the whole problem at once, including the interactions between clusters that the decomposition throws away. → Quantum Programming
a 1.5% discrepancy between two unrelated experiments. > > Take 595,000 shots/min and Chapter 39's measured **\$50 per QPU-minute**. Two hundred tests at > 1,000 shots is 200,000 shots, **\$16.9 per commit**. At 10,000 shots it is **\$169 per commit**, > before queueing. Chapter 39 measured utilizati → Quantum Programming
6 gives 0.0204
**★ The cost is the thing.** A 20-bit search: **229,944 T gates** across 804 iterations, each → Harvested measurements
one $\gamma$ and one $\beta$ per layer. Far fewer than any Part VI ansatz, which is the design's real virtue. → Quantum Programming
6.33 observables
the "four to eight" crossover, derived. - ★ **Median of means made the estimate 30% worse**, not better — 0.0773 → 0.1009 mean absolute error at $K = 9$, and the 99th percentile degraded too. The predicted penalty for a bounded estimator is $\sqrt{\pi/2} = 1.253$; measured **1.304**. The $\log M$ in → Quantum Programming
631 distinct Pauli strings
a 2.95× reduction obtained for nothing, because distinct fermionic terms that map to the same Pauli operator simply add their coefficients. Chapter 36 §36.3 also measured that Bravyi–Kitaev gives the *same* 631 terms while cutting the mean Pauli weight from 6.16 to 5.62 and the maximum from 12 to 10 → Quantum Programming
so > optimization level is *not* doing nothing, and this chapter is not claiming it does. It is doing > something real, reproducible, and roughly one-sixth the size of the shape effect. Chapter 28 §28.3 > found level 2 versus level 3 *not* significant at $+0.0028 \pm 0.0065$; **level 1 versus level → Quantum Programming
79 of the 434 connected 6-chains (18.2%)
★ **A noiseless device scores 0.9793, not 1.0000**, on this experiment — 20,000 shots over 64 - The §29.4 chain search examined **127 greedy candidates, not all 434.** Exhaustive enumeration finds → Harvested measurements
and for Shor at cryptographic sizes it is what makes the circuit expressible at all. → Quantum Programming
9 of 144 two-qubit edges are dead.
RB implemented from scratch recovers a known error: injected 0.002 depolarizing, **fitted error per Clifford 0.00228**. - ★★ **The same chip supports quoted two-qubit errors from 0.00750 to 0.07205** — a factor of 9.6 — across defensible choices of statistic. Implied 100-gate survival: **0.4710 to 0 → Quantum Programming
and Chapter 39's $50-per-minute > tier: > > ```text > the 8-seed study 320,000 shots 32.0 s 0.53 min $26.69 > the 173-seed study 6,920,000 shots 692.6 s 11.54 min $577.13 > ``` > > **$27 to bound the effect. $577 to resolve it.** Neither is expensive, and that is the point: the > reason nobody runs → Quantum Programming
9. (d) seven times
Chapters 27, 28, 33, 34, 37, 38, and 39. Each was corrected in print, and the list is in §40.4. → Quantum Programming
9.6
depending on whether you quote the best link, the median, or the mean, and whether you include dead links. `quoted_fidelity(dist, statistic, include_dead)` takes both arguments with no defaults for exactly this reason. → Part 05
92% of the 1.69 μs shot
the two gates are a rounding error against it. Case Study 2 finds the same shape on a different chip: readout 1,216 ns against 533 ns for the entangling gate. The slowest operation on a quantum computer is looking at the answer. → Quantum Programming
:: > per task and per shot
unlike IBM's open tier (Chapter 2), Braket hardware is a paid service. - **LocalSimulator** :: ** `LocalSimulator` requires **no AWS account** and runs locally. - **trapped ion** :: AWS Braket (trapped ion) per-task + per-shot ~$0. - **neutral atom** :: (NO USE FOUND — read the chapter) - **all-to-a → Glossary seed (context, not definitions)
[audit]
apply the eight questions. **[harvest]** — derive the answer from the book's files rather than from memory. **[career]** — the answer is about you, and there is no key. → Quantum Programming
[Chapter 16](../chapter-16-pennylane/index.md)
PennyLane, whose parameter handling makes Cirq's sympy symbols look conservative, and which differentiates through circuits. - **[Chapter 18](../chapter-18-framework-comparison-interoperability/index.md)** — the full comparison, including the translation table this chapter only sketched. - **[Append → Quantum Programming
[measure]
run something and report a number. **[refuse]** — identify a claim that should not be made. **[reseed]** — the exercise is specifically about not trusting one draw. → Quantum Programming
specific state-vector entries by bitstring, without materializing $2^n$. → Quantum Programming
`CircuitInstruction`
operation + qubits + clbits. **Bits are objects**, not indices; `qc.find_bit(q).index` converts. Composite gates carry their own definitions and expand during *transpilation*, not construction. → Quantum Programming
`claims.py`
the eight questions, applicable to any quantitative claim in any field. - **`platform.py`** — cost modelling for any shot-based workload. - **`testing.py`** — the shot-noise floor and the two-error-rates framing. - **`benchmarking.py`** — refusing to quote a number without its statistic. → Appendix I: The `vqelab` Package
`code_helps` has no `state` parameter
verify with `inspect.signature`. 10. The Shor code corrects all 54 single-qubit injections. 11. **Shor's breakeven (1/27) is worse than the three-qubit code's (1/2)** despite three times the qubits. 12. Shor's protection is asymmetric: $X$ breakeven is exactly 3× the $Z$ breakeven. 13. Every stabili → Quantum Programming
`CommutativeCancellation` alone does the whole job
it knows an `RZ` commutes through a `CX` control, where the non-obvious cancellations live. **`RemoveIdentityEquivalent` did nothing** (the `RZ`s sum to zero only *collectively*) — a pass that does nothing on your circuit is not broken. → Quantum Programming
`cryptography` ≥ 46
ships **ML-KEM natively** (`asymmetric.mlkem`). Chapter 38 measured ML-KEM-768 at 201.7 µs against X25519's 76.6 µs. - **liboqs / Open Quantum Safe** — the broader post-quantum toolkit. → Appendix H: The Quantum Software Ecosystem
`cvxpy` with SCS or Clarabel
Ch. 37 - **Cai et al., "Quantum Error Mitigation" (2023), *Reviews of Modern Physics*.** — Ch. 13 - **Calderbank and Shor (1996) and Steane (1996) on CSS codes.** — Ch. 25 - **Cerezo et al. on cost-function-dependent barren plateaus (2021).** — Ch. 32 - **Cerezo et al., "Variational Quantum Algorith → Bibliography
`depth()` on 10 appended blocks = 10, meaningless.
🗝️ **The circuit library became FUNCTIONS in Qiskit 2.1**; classes deprecated, removed in 3.0: `EfficientSU2`→`efficient_su2()`, `RealAmplitudes`→`real_amplitudes()`, `TwoLocal`→`n_local()`, `ZZFeatureMap`→`zz_feature_map()`, `QFT`→`QFTGate`/`synth_qft_full()`. Functions return **plain `QuantumCircu → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
there is no single "the error." 2. **Nine two-qubit edges are dead**, and 135 are live. 3. The mean exceeds the median for gates and for readout (2.1× for readout). 4. `statistic` rejects an unknown name; `error_distribution` rejects an unknown instruction. 5. **The same chip supports a factor of 9 → Quantum Programming
`gcd(a, N) > 1`
you picked an $a$ sharing a factor with $N$, and Euclid hands you the answer with no quantum computer at all. Rare for large $N$, and always checked first. → Quantum Programming
`git bisect`'s documentation
Ch. 26 - **Gidney, "Halving the cost of quantum addition" (2018), *Quantum* 2, 74.** — Ch. 19 - **Giovannetti, Lloyd, and Maccone on QRAM (2008).** — Ch. 32 - **Gisin, Ribordy, Tittel, and Zbinden, "Quantum cryptography" (2002), *RMP* 74, 145.** — Ch. 38 - **Giurgica-Tiron et al., "Digital Zero Nois → Bibliography
`how_many_samples`
one molecule at one geometry (LiH at 3.0140 Bohr, STO-3G). Probably robust because truncation error exceeding optimizer error follows from the optimizer converging on an exactly-solvable 4-qubit problem while the truncation discards real correlation energy; the *direction* is not fragile. **"Probabl → Answer Keys for All Exams
`job.job_id()`
save it. Jobs are asynchronous and persistent. You can close your laptop and retrieve the result tomorrow: → Quantum Programming
graph construction and instance families. - **Gurobi / CPLEX / HiGHS** — **the incumbents.** Case Study 37.1 turns on a solver log line printing a 0.046% optimality gap that nobody had read. - **Qiskit Optimization** — QUBO/Ising converters. → Appendix H: The Quantum Software Ecosystem
a three-parameter gate that covers all of $SU(2)$, playing the role Qiskit's `rz`/`sx` decomposition plays. → Quantum Programming
`PriceBook.as_of` is REQUIRED
an undated price rots silently; **`layout_variance_is_measurable` returns False below 8 qubits** so the toy-circuit conclusion cannot be drawn by accident; **`ExecutionRecord.is_reproducible` is False until all four PROVIDER-side fields are captured** — not "the code is committed". → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
`QiskitRuntimeService()`
your authenticated connection, reading the credentials you saved in §2.3. → Quantum Programming
`rz` is virtual on superconducting hardware
zero duration, zero error. Seven of the transpiled Bell circuit's fourteen operations are free. - **Readout is the slowest operation**: ~1,200 ns against ~530 ns for the entangling gate. → Quantum Programming
`Sampler(mode=backend)`
the **primitive**. - **SamplerV2** :: - "Select a real quantum backend, transpile a circuit for it with a preset pass manager, submit it with the SamplerV2 primitive, and retrieve the result. - **shots** :: > is exactly zero, and no number of shots is needed to know that. - **counts** :: - Run it on → Glossary seed (context, not definitions)
`scikit-learn`'s documentation on model selection.
Ch. 32 - **Sarah Kaiser and Christopher Granade, *Learn Quantum Computing with Python and Q#* (Manning).** — Ch. 1 - **Scarani and Renner on finite-key bounds for practical implementations.** — Ch. 38 - **Schuld and Petruccione, *Machine Learning with Quantum Computers* (2nd ed., 2021).** — Ch. 32 - → Bibliography
`simulate()` needs no measurement
it returns the full state vector, amplitudes and phases included. **`run()` requires one:** → Quantum Programming
`utilization()` and `batching_speedup()`
the ratios that decide workflow design, neither of them a quantum quantity. - **`layout_variance_is_measurable()` returns False below 8 qubits**, so the toy-circuit conclusion cannot be drawn accidentally. - **`ExecutionRecord.is_reproducible` is False** until all four provider-side fields are captu → Quantum Programming
`ValueError`
not an `AssertionError` — when the tolerance is below the shot-noise floor, with the shot count you would need: → Quantum Programming
`vqelab/algorithms.py`
`deutsch_jozsa()` (**with the PROMISE VIOLATED branch** and a `distinct_outcomes` count), `bernstein_vazirani()`, `simon()` (**collects to rank, reports `redundant_shots`**), `solve_f2()`, and `check_promise()` (brute-force, exponential — what a *harness* can afford and the algorithm cannot). **14 t → Quantum Programming
`vqelab/backends.py` v0
`get_backend("sim" | "hardware")`, nine lines, so no other module ever knows whether it is on a simulator or a QPU. By Chapter 17 the same call hides five platforms and no caller has changed. Plus `check_credentials()`, which fails early with a useful message instead of late with a stack trace. → Quantum Programming
`vqelab/backends.py` v1
`get_estimator`, `get_sampler`, `prepare`, `reference_value`, `check_against_reference`, and a frozen `Prepared` dataclass. → Quantum Programming
`vqelab/backends.py` v2
`prepare_best()` (transpile with N seeds, keep the best by two-qubit count then depth), `seed_sweep()`, `two_qubit_count()`, and a frozen `Compilation` record carrying seed, optimization level, layout, gate count, and depth. → Quantum Programming
`vqelab/backends.py` v3
`device_health()`, `best_layout()`, `preflight()` / `require_preflight()`, `readout_directions()`, and `RunRecord` extended with job id, layout, score, and date. **8 tests, all passing**, including one asserting that `best_layout()` always passes its own preflight. → Quantum Programming
`vqelab/benchmarking.py`
`ErrorDistribution` with **no `.error` attribute**, reporting min/p25/median/mean/p95/max plus `dead_count`; **`quoted_fidelity` requiring both the statistic and the dead-element decision as explicit arguments** (no defaults, because both defaults are wrong for somebody); **`predict_survival` carryi → Quantum Programming
`vqelab/circuits.py` v0
`single_qubit_ansatz()` using $R_y$ (real matrix, smooth sweep, differentiable), plus `state_of()`: amplitudes, probabilities, and Bloch vector in one call, with a clear error when parameters are unbound. Your microscope for the rest of the book. → Quantum Programming
`vqelab/circuits.py` v1
`two_qubit_ansatz()` (rotation layer → **entangling layer** → rotation layer), plus `entanglement_entropy()`, `is_entangled()`, and `reachable_entanglement()`. → Quantum Programming
**`compare_models` returning `INSUFFICIENT_REPLICATES`** for fewer than five independent splits, quoting what replication showed; `margin_profile` and → Quantum Programming
`vqelab/debugging.py`
`prefix`; **`bisect` returning `DIVERGED`/`AGREE`/`BLIND`** with an operator cross-check before ever reporting agreement; **`equality_verdict(a, b, will_be_controlled)` with no default** for the flag, because both defaults are wrong half the time; `ancilla_report`; `count_ops_diff`; `is_bit_order_on → Quantum Programming
`vqelab/errorcorrection.py`
`logical_error_rate` returning a `CodeResult` with a **`blind`** flag; **`worst_case_logical_error`** sweeping both basis states × X/Y/Z; **`code_helps`, which has no `state` parameter at all** because that is the question you must not ask; `shor_single_error_sweep` (54 injections); `suppression_fac → Quantum Programming
`vqelab/grover.py`
`phase_oracle`, `diffuser`, `grover_circuit`, `success_probability` (the analytic reference), `optimal_iterations`, `can_succeed` (detects the $M/N = 1/2$ failure), → Quantum Programming
`vqelab/hardware.py`
`undirected_neighbours` (fixing the directed-adjacency gotcha), `edge_error` returning **1.0 for unusable pairs** so a survival product is truthfully zero, → Quantum Programming
`vqelab/hybrid.py`
**`encoding_cost_saved`, which reports the saving AND whether it is checkable**; **`quantum_data_verdict`, which returns `CLASSICALLY_CHECKABLE` rather than an advantage claim below ~32 qubits**, naming the state's size in real numbers; **`shadow_advantage`, which requires the TOTAL budget** and exp → Quantum Programming
`vqelab/interop.py`
`reverse_bits` / `reverse_state_vector` / `needs_reversal`, `to_qasm` and `from_qasm` (raising a **clear** error for Cirq's missing `ply` rather than letting `ModuleNotFoundError` surface from deep in a pipeline), **`TranslationReport`** which is *returned* rather than logged and names the *conseque → Quantum Programming
`vqelab/kernels.py`
`batched_gram`; **`validate_gram` checking unit diagonal, symmetry and positive semi-definiteness**; **`concentration_verdict`, which requires `n_features` with no default** and returns different verdicts for the same matrix under `REDUNDANT`, `INDEPENDENT` and `OVERLOADED` regimes; **`gram_shot_bud → Quantum Programming
`measure_with_reset()` and `why_not_mid_circuit()`, plus **a recorded negative result**: VQE should use *static* circuits, measured at 1.21× depth for no saving. → Quantum Programming
`vqelab/mitigation.py`
`AssignmentMatrix` (caches; exposes `.condition_number`, `.rank`, `.dead_qubits()`; **refuses when singular**), `fold()` (guards odd factors and ISA input), `extrapolate()` (three methods + **spread**), `MitigationRecord`. **10 tests pass**, including `test_zne_is_more_effective_after_readout_mitiga → Quantum Programming
`marked_states()`, `bit_oracle()`, `phase_oracle()`, `phase_signs()`, `scratch_is_clean()`, `input_register_entropy()`, `oracle_cost()` (**defaults to Clifford+T and flags any rotation-basis measurement as `UNTRUSTWORTHY`**), and `compare_ancilla_strategies()`. → Quantum Programming
`qft_circuit(n, cutoff)` in the **correct convention** (with the three wrong ones recorded in the docstring), `verify_against_dft`, `aqft_fidelity`, `phase_estimation_circuit`, `estimate_phase` returning a **`PhaseEstimate` that knows whether the phase was dyadic**, `counting_qubits_for`, and `qft_c → Quantum Programming
`vqelab/qml.py`
**`EncodingCost` carrying qubits AND gates together**, with no way to request only the flattering half; `state_preparations_per_run`; **`training_shot_budget` computing the number that decides feasibility**; `shots_to_resolve` for the $1/g^2$ coupling; and **`compare_to_baseline`, which returns `UNI → Quantum Programming
`vqelab/resources.py`
`logical_counts()` (transpiles to Clifford+T first, so Toffolis reveal their 7 T gates), `estimate_resources()`, `estimate_circuit()`, `t_count_sweep()`, and a `ResourceEstimate` with `factory_fraction`. Prices **any framework's** circuit via `qdk.estimator.LogicalCounts` — **no Q# source required** → Quantum Programming
`vqelab/shor.py`
`classical_reduction` (**returns the reason**, which drives the retry), `brute_force_order`, `usable_base_fraction`, `period_candidates` (**several, in convergent order**), `order_finding_circuit` (**raises for $N\neq15$** rather than pretending to generalize), `shor()` with both randomization level → Quantum Programming
`noiseless_energy()` (the reference every hardware result is measured against), `noisy_energy()`, `noise_signature()` (the two-axis classifier), and five tests across the three tiers, all passing. → Quantum Programming
`vqelab/timing.py`
`REMOVED_IN_QISKIT_2` and `pulse_api_replacement` turning a removal into a pointer; `gate_durations` (documenting `rz` = 0); **`coherence_budget` reporting which constraint binds**; `schedule_with_dd` and `circuit_timing` for the busy/idle split; and → Quantum Programming
`vqelab/topology.py`
`interaction_graph()`, `interaction_degree()`, `connectivity_overhead()` (transpiles against the target *and* all-to-all), `breakeven_error_rate()`, and `recommend_modality()` which **must cite a number**. **13 tests pass**, including `test_nearest_neighbour_circuit_is_free_on_a_line`, `test_star_ci → Quantum Programming
`vqelab/translate.py`
`reverse_bits()` (the *only* function permitted to touch bit order), histogram/state-vector converters, `qiskit_to_cirq()` (**raises** on unsupported gates rather than approximating), `assert_same_state()`. **12 tests pass**, including `test_x_on_qubit_zero_lands_at_different_indices` and — delibera → Quantum Programming
`vqelab/variational.py`
`gradient_cost()` and `measure_gradient_cost()` ($2n+1$, verified against the device tracker), `classify_zero_gradient()` (the three-way discriminator), `measure_gradient_variance()` (**reports exclusions rather than hiding them**), and `optimize()` returning a `VariationalResult` whose **`converged → Quantum Programming
`vqelab/variational_algorithms.py`
`shots_for_precision`, **`shot_budget`** (the arithmetic *before* you run anything), `vqe()` returning a `VQEResult` with `error`, `chemical_accuracy`, → Quantum Programming
`w=0:1` is the identity
nuclear repulsion plus the frozen-core > energy, a constant added to every evaluation. It is one of 631 terms and it costs **zero** shots, > which is the only free term in the entire budget of §36.7. > > **And Jordan–Wigner's missing odd bins are the derivation above, visible.** A hop has weight > $ → Quantum Programming
§35.4's dilemma is untouched
a knitted result above the boundary is exactly as unverifiable as an unknitted one. → Quantum Programming
×0.5086 per qubit added
halving roughly every 1.03 qubits, and a **224×** drop from 2 to 10 qubits. Within 2% of exactly one half, matching the textbook $\mathcal{O}(2^{-n})$ result. → Quantum Programming
−1.414214, error 6.7e−16
machine precision, and *better* than the 8- and 18-parameter alternatives. **Change the optimizer and the step count first**; adding parameters to fix an optimizer problem makes both the gradient bill and the landscape worse. → Quantum Programming
`Fraction(s/2**t).limit_denominator(N).denominator`. Measured at $N=15$, $r=4$, $t=8$: $s = 64 \to 1/4 \to r=4$; $s=192 \to 3/4 \to r=4$; $s=128 \to 1/2 \to r=2$ (**a divisor, and often good enough**); $s=0 \to$ useless. **Verify with `pow(a, r, N) == 1`** — one line, and it turns a Monte Carlo algo → Quantum Programming
★ Other findings:
**The threshold means "no key survives," NOT "Eve detected."** Below it privacy amplification is sized to remove exactly what an adversary at that QBER could know; she costs key LENGTH, not security. - **The same theorem that provides the security imposes the range limit** — no-cloning forbids ampli → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
set the extra angles to 0 and you recover it exactly, so a regression is structurally impossible at the optimum. **The THEORY said which measurement deserved a second look** — a far better detector than suspicion, because it is specific. Became §37.4 + CS 37.2. → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
`EfficientSU2(6, reps=3)`, only `entanglement` differs: ``` entanglement logical 2q L1 ecr L3 ecr overhead full (all-to-all) 45 147 116 3.3x circular 18 69 54 3.8x linear (matches a chain) 15 15 15 1.0x <-- ZERO ROUTING ``` → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
★★★ THE CAPSTONE WAS HARVESTED, NOT RECALLED
the series' hardest-won lesson, applied. New script **`scripts/harvest_scorecard.py`** (companion to the existing `harvest.py`, which does terms/headings/sources for the appendices — do NOT overwrite it). It walks every chapter, extracts lines carrying real measured numbers, and writes `_scratch/har → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
⚙️ Under the Transpiler
the property set is why a pass manager is not just a list of functions. - **layout** :: layout is applied in exactly one place, by code that has the layout in hand. - **apply_layout** :: > **It does not establish** that the Estimator is badly designed, or that `apply_layout` is a wart. - **session** → Glossary seed (context, not definitions)
⚛️ The diffuser is itself a phase oracle
marking $|0\dots0\rangle$, conjugated into the > Hadamard basis. **A product of two reflections is a rotation**, which explains the iteration count, > the over-rotation, and every failure below. It also means **the diffuser costs what the oracle > costs**. → Quantum Programming
⚛️ The Physics Underneath
What the qubits are doing here. > > A classical bit is 0 or 1. A qubit's state is a pair of complex numbers $(\alpha, \beta)$ — > called amplitudes — subject to $|\alpha|^2 + |\beta|^2 = 1$. We write the state as > $\alpha|0\rangle + \beta|1\rangle$. It is *not* "0 and 1 at the same time," a phrase → Quantum Programming
⚠️ Common Pitfall
Simulators let you cheat, and you should — carefully. > > A simulator *will* let you read the full statevector at any point. This is the single most useful > debugging tool you have, and Chapter 26 leans on it hard. > > The trap is forgetting that it is a simulator privilege. Code that inspects the → Quantum Programming
⚠️ You cannot reason your way to a safe test input
choosing a good one requires already > knowing where the bug is. $|1{+}0\rangle$ was written into the checkpoint as one that "obviously" > catches it. It does not. > > **Use `Operator` while the circuit is small enough (~12–14 qubits). Past that, `random_statevector`, > and more than one.** → Quantum Programming
🐛 Debug This
"the ansatz is not expressive enough" is usually wrong. - **barren plateau** :: - "Measure the barren plateau and explain what it means for scaling. - **gradient variance** :: "Gradient variance decays exponentially" is the finding; "×0. - **template** :: produced not by a buggy ansatz but by the st → Glossary seed (context, not definitions)
💰 Cost and Queue
What that time costs in dollars, today. > > Chapter 39 §39.5 prices a single VQE run — the LiH (2e,2o) job from Chapter 36, 18,456,984 shots, > **31.2 seconds** of actual processor time — against three real commercial billing structures: > > ```text > per-minute, superconducting $50 > per-shot, supe → Quantum Programming
📉 Noise Report
Where those hundred impossible results came from. > > Four physical mechanisms, in rough order of contribution for this circuit: > > **Readout error.** Measuring a qubit is a physical process with a nonzero misclassification rate — > typically around 1–3% per qubit on current superconducting devices → Quantum Programming
📊 What the Numbers Say
`num_parameters` after a compose is a check, not a formality. - **append** :: - "Choose between compose and append, and state what each does to circuit structure and depth. - **custom gate** :: (NO USE FOUND — read the chapter) - **circuit library** :: - "Use the modern function-based circuit librar → Glossary seed (context, not definitions)
📐 Math Aside
★ One number produces all three: the concurrence $C = 2|ad - bc|$. - **GHZ state** :: > `000` and `111` and nothing else, therefore I made a GHZ state" is not valid. - **W state** :: ** Lose one qubit of a W state and the remaining two are still entangled, just less so. - **Toffoli gate** :: (NO USE → Glossary seed (context, not definitions)
the same gate, three different phase conventions. > > Every framework has both conventions and names them differently. The pairs that differ by a global > phase, in the sense of §3.7: > > ```text > Qiskit qc.p(lam, 0) qc.rz(lam, 0) > Cirq cirq.Z ** (lam/pi) cirq.rz(lam) > PennyLane qml.PhaseShift(la → Quantum Programming
🔬 Honest Assessment
Which framework should you actually learn? > > **Learn Qiskit first.** It has the largest community, the best free hardware access, and the most > complete tooling, so you will find answers when you get stuck. That is worth more than any design > elegance when you are learning. > > Then learn a seco → Quantum Programming
🔰 Beginner
read §1.1, §1.4, and §1.5 carefully; skim §1.2 and return to it after > Chapter 13, when the framework differences will mean more. > - **🔬 Researcher** — §1.3 (the stack) and §1.5 (capabilities) are the ones that will shape your > experimental design. §1.2 matters when you choose where to publish re → Quantum Programming
🗝️ Version Note
The two API removals you will trip over immediately. > > Pre-1.0 tutorials contain this pattern constantly: > > ```python > from qiskit import execute, Aer # both broken in Qiskit 1.0+ > backend = Aer.get_backend("qasm_simulator") > result = execute(qc, backend, shots=1024).result() > ``` > > `execu → Quantum Programming
🤖 For the Quantum ML path
this is where the parameter-shift rule comes from. > > $P(0) = \cos^2(\theta/2)$ is *differentiable*, and its derivative is > $-\tfrac12\sin\theta$. That means a measurement outcome is a smooth function of a circuit > parameter, which means you can do gradient descent on quantum circuits. > > You ca → Quantum Programming
🧪 Run It
Watch the ratio converge. > > Change `shots` to 10, then 100, then 10,000, and remove the seed. Run each several times. > > At 10 shots you will see things like `{'00': 7, '11': 3}` — nowhere near 50/50. At 10,000 you will > see splits within a percent of even. > > **The distribution was always 50/5 → Quantum Programming
🧱 Project Checkpoint
Chapter 1: write down the claim. > > Your first checkpoint involves no quantum code at all. Create the project directory and a > `README.md` that states, in your own words: > > 1. **The goal.** "Compute the ground-state energy of H₂ using VQE on quantum hardware." > 2. **The success criterion.** "Wi → Quantum Programming
A
A Bell histogram is invariant under bit reversal
assert the *weakness* explicitly. 5. An asymmetric histogram is *not* invariant. 6. A translated 3-qubit circuit with `x`, `h`, `rz`, and `cx` matches via `assert_same_state`. 7. The translator raises on `ccx`. 8. Barriers are dropped rather than rejected. → Quantum Programming
A circuit is a list of `CircuitInstruction`s
operation plus bits — where bits are objects rather than indices. Composite gates carry their own definitions and expand during transpilation. The transpiler converts to a **DAG**, which is why it can reorder commuting operations and why → Quantum Programming
A distribution that should be uniform
compare against $2^{-n}$ within tolerance. - **Bisection localizes a bug in $\lceil \log_2 n\rceil$ comparisons: 13 for Chapter 23's 3,368-gate - Diagnostics that work: `reverse_bits` equality for bit order; **purity 1.0000 → 0.6250** for a dirty - Verifying a transpiled circuit **ignoring the layou → Harvested measurements
a divisor of the true period
often still good enough. $s=192 \to 3/4$, $r = 4$, **correct**. → Quantum Programming
A fixed seed is not a fixed layout
the layout pass scores against current error rates, so the seed is deterministic while the function it seeds is not stationary. → Quantum Programming
A guarantee is only as broad as its statement
§15.5's release check secures the qubit pool, not your algorithm; and this book's fourth instance of that lesson. → Quantum Programming
A logical gate count cannot rank patterns.
Layout methods (5-qubit all-to-all, L1): trivial 34/depth 103, dense 34/92, **sabre 28/80**. - Routing methods: **basic 58**/148, lookahead 31/77, **sabre 28**/78 → basic is **2.1×** worse. - Optimization levels on a **topology-matched** circuit (`efficient_su2(12, reps=3)`): 2q is **33 at every lev → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
A mixed state does not interfere
it is Chapter 4's classical impostor, arriving from bookkeeping rather than noise — which destroys the mechanism every quantum algorithm depends on. → Quantum Programming
A QEC test must
store both logical basis states.
Each three-qubit code is **worse than no encoding** for arbitrary states: worst case **0.1346** against an unencoded 0.0500 at $p = 0.05$, because three qubits give three chances at the error type the code does not correct. - The Shor code corrects **54 of 54** single-qubit Pauli injections exactly. → Quantum Programming
A register that should be unentangled
`purity(partial_trace(...)) == 1`. - **A distribution that should be uniform** — compare against $2^{-n}$ within tolerance. - **A state that should be real** — many algorithms produce real amplitudes at specific points; a stray $i$ means a rotation went the wrong way. - **Norm preservation** — cheap → Quantum Programming
A reset costs between 8.7 and 27.2 two-qubit gates
$1{,}600/184 = 8.7$ if you are lucky on both ends, $1{,}848/68 = 27.2$ if you are not. Against a single-qubit gate it is worse: the measurement alone is $1{,}560/32 = 49$ `sx` gates. → Quantum Programming
a single dominant reference determinant
that Hartree–Fock is qualitatively right and correlation is a correction to it. When that holds it is superb, and $\mathcal{O}(n^7)$ is affordable to about 100 orbitals. When it fails it fails without warning in the energy, which is why the field uses diagnostics: a $T_1$ amplitude norm above roughl → Quantum Programming
a certificate, a bound, an error estimate — not just how it scored. → Quantum Programming
A tie on a saturated problem is not evidence.
**Cost.** The VQC took **50.2 s** on an exact simulator against milliseconds classically; inference cost is absent entirely. - **Samples.** No replication across splits. → Answer Keys for All Exams
entangling layers exist to keep every qubit correlated. Measured anyway: → Quantum Programming
A VQE ansatz never passes question 1
that is what entangling layers are for. 4. **A trend across three points at one seed is not a trend.** This case study published 0.0029 → 0.0048 → 0.0068 as evidence that reuse degrades cumulatively. Two hundred repeats per row give 0.00657 → 0.00642 → 0.00558, falling to 0.00214 by eight flips — th → Quantum Programming
Aaronson's writing on Grover and QRAM.
Ch. 21 - **Aaronson, "Quantum Computing Since Democritus"** — Ch. 19 - **Aaronson, "Read the fine print" (2015), *Nature Physics* 11, 291.** — Ch. 22, 32, 40 - **Aaronson, "Read the fine print" (2015).** — Ch. 35 - **Aer's save instructions** — Ch. 26 - **Aharonov and Ben-Or, "Fault-tolerant quantum → Bibliography
about 2.5× worse
0.0542 against 0.0202 at 1,000 shots, stable across three shot counts and twelve repetitions each. → Quantum Programming
About 229,944 T gates
804 iterations, each containing an oracle (143 T) and a diffuser (143 T). **It assumes the oracle marks a single state** — the cheapest possible predicate — and uses Chapter 19's *favourable* ancilla-based accounting. A real constraint checker is substantially larger. → Quantum Programming
Above $p = 0.5$ they fan upward
more distance, *higher* error. At $p = 0.5$ all distances give 0.5 and the curves cross. The crossing point is **the threshold**. → Quantum Programming
absorbed into the phase of every subsequent pulse
the > control software simply redefines what "the $X$ axis" means from that moment on. This is the > *virtual Z gate*, and it is exact, instantaneous, and error-free. > > It is why Chapter 28's transpiled circuits are full of `rz` and nobody minds: **83 `rz` gates in the > Chapter 29 ansatz cost lit → Quantum Programming
the role people imagine when they hear "quantum job." → Part 07
All five
Qiskit (QASM 2 and 3, natively), Cirq (QASM 2), Braket (QASM 3), PennyLane (`to_openqasm` / `from_qasm`), and Q#/QDK (`qdk.openqasm`) — in both directions. That is the strongest evidence OpenQASM is a real standard rather than one vendor's format. → Quantum Programming
All three extrapolators agree to within 0.001
reassuring, since disagreement among extrapolators is the standard warning sign that you are extrapolating past what the data supports. → Quantum Programming
all with the middle bit set
that bit reads stuck qubit 84. - Run C: two clean peaks, `000` and **`011`** — not `111`. `111` appeared **5 times in 4096**. → Quantum Programming
almost exactly $\pi$
landing on the unmarked axis. The amplitude on every solution is essentially zero, and you measure a non-solution with certainty. → Quantum Programming
Amazon Braket
along with **OpenQASM**, and articulate the design bet each one makes. - Trace the **quantum software stack** from application down through circuit, transpiler, and pulse layers to hardware, and map each layer onto its classical analogue. - Explain the four structural differences: probabilistic outp → Quantum Programming
Amplitudes interfere; register contents do not
which is why quantum algorithms are about phases, and why this is the same mechanism as phase estimation (Chapter 22). → Quantum Programming
An 88× collapse across eight qubits
Chapter 16's barren plateau in the QML setting. - **gradient variance** :: - "Measure gradient variance against qubit count and observe barren plateaus. - **encoding cost** :: (NO USE FOUND — read the chapter) → Glossary seed (context, not definitions)
And a Bell state cannot reveal the difference
it is symmetric under bit reversal, as are GHZ states and uniform superpositions, which is to say every circuit anyone uses to check a fresh install. → Quantum Programming
And check the problem is actually unstructured
a B-tree gives $\mathcal{O}(\log N) \ll \mathcal{O}(\sqrt N)$. **Grover is optimal for unstructured search, and almost nothing real is unstructured.** → Quantum Programming
And it decayed for a real reason
just not the advertised one. As qubit count grows, the parameter-shift evaluations involve larger state vectors, so the floating-point cancellation noise in computing an identically-zero derivative drifts downward. **The artifact had its own physics**, and that physics happened to be monotonic in $n → Quantum Programming
many distinct fermionic terms map onto the same Pauli operator and add their coefficients. → Quantum Programming
And phase damping is invisible to both axes
error 0.0000 and imbalance 0.0007 at any strength, because it destroys coherence without moving population and the computational basis is blind to phase. A Bell state with its coherence gone still reads 50/50; it has merely become the *classical* mixture that was Chapter 4's impostor. **To see $T_2$ → Quantum Programming
and the algorithm for
when $M$ is unknown
which is Case Study 1's fix, published two years after Grover. *Tier 1.* - **Bennett, Bernstein, Brassard, and Vazirani, "Strengths and Weaknesses of Quantum Computing" (1997), *SIAM Journal on Computing* 26, 1510.** The **BBBV lower bound**: no quantum algorithm does unstructured search in $o(\sqrt → Quantum Programming
And the input problem may be decisive
if loading $N$ numbers costs $\mathcal{O}(N)$, no exponential speedup on classical data survives it. → Quantum Programming
the Hypothesis documentation (Python) or Claessen and Hughes, "QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs" (2000). **§27.4's entire conclusion is QuickCheck's thesis**: random inputs beat chosen inputs, because chosen inputs carry the same blind spots as the code. Chapter → Quantum Programming
area law along a
chosen ordering of the orbitals
that the system is, in the relevant sense, one-dimensional. Its cost $\mathcal{O}(n^3M^3)$ is polynomial *in the bond dimension $M$ you choose*, and the accuracy is whatever that $M$ bought. It is outstanding on chains and conjugated systems and degrades on three-dimensionally connected strong corre → Quantum Programming
the optimum appears in 99.5% of sampled shots. The result is real and the implementation is correct. → Quantum Programming
At 1e-4 the accuracy does not move at all
to four decimal places. At 1e-2, a hundred times worse > than a real device's single-qubit error, it loses 0.0051. > > Chapter 39 measured a median `sx` error of **2.44e-04** on a real 133-qubit device. This model would > lose **well under 0.001 of accuracy** to single-qubit gate noise. > > That is → Quantum Programming
At a 5-minute queue, utilization is 2.31 × 10⁻⁵
43,340× wall clock over device time - ★★★ **The same VQE run costs $50 per-minute, $7,432 per-shot (149×), or $185,542 on trapped ions - ★ **Transpiler seed alone changed 14-qubit fidelity from 0.5755 to 0.7911 — 2.03× the error** — driven → Harvested measurements
At least half
the standard theorem for $N$ with ≥2 distinct odd prime factors. → Quantum Programming
> exactly what you want. **This is Simon's algorithm over $\mathbb{Z}_N$**, with continued fractions in > place of Gaussian elimination. → Quantum Programming
AWS Braket developer guide
cited in Ch. 39 - **Aaronson and Ambainis, "The need for structure in quantum speedups" (2014).** — cited in Ch. 20 - **Aaronson's writing on Grover and QRAM.** — cited in Ch. 21 - **Aaronson, "Quantum Computing Since Democritus"** — cited in Ch. 19 - **Aaronson, "Read the fine print" (2015), *Natur → Harvested sources (source of truth for appendices/bibliography.md)
B
barren plateaus
why gradients vanish exponentially with circuit width, how to detect it in your own model, and the mitigations (local cost functions, shallow circuits, smart initialization, data re-uploading) that partially address it. → Quantum Programming
Batching is linear in the batch size
100 circuits is very nearly 100× — which is why the measured figure at $n = 100$ is 99.8× and not something more interesting. For large $n$ the denominator becomes $n t_d$ and → Quantum Programming
BBBV
Bennett, Bernstein, Brassard and Vazirani, 1997 — and its shape is worth following, because the assumption it needs is the same assumption §21.7 will attack. → Quantum Programming
more qubits, lower logical error, and the gap widens as you add distance. **Above $p = 0.5$ they fan upward** — more qubits, *higher* logical error, and the gap widens the other way. At $p = 0.5$ every distance gives 0.5 and the curves cross. → Quantum Programming
below the $0.0625$ you started with
six iterations is worse than not running the algorithm at all. → Quantum Programming
below the floor
it will fail on correct code about half the time, and tightening it further makes it worse rather than stricter. Chapter 27 builds on this. → Part 01
best case for all-to-all
deliberately, because the point is to measure the gap rather than to be fair. → Quantum Programming
big-endian
qubit 0 is the most significant bit, appearing leftmost in the order you listed the qubits. Qiskit is → Quantum Programming
0.6199 in all three — because discarding a measured register is the same channel as tracing it out. Uncomputation works because it is unitary and **no record was ever made**; the corollary is that ancillas must be released in reverse allocation order. → Quantum Programming
bitstring
the marked item, the period, the factor | **Sampler** | Grover, Shor, Bernstein–Vazirani, Simon | | A **number** — an energy, a cost, a loss, a gradient | **Estimator** | VQE, QAOA, all of quantum machine learning | | The **distribution itself** | **Sampler** | sampling problems, tomography, benchma → Quantum Programming
blind by
construction
no error that `inverse()` can reproduce will ever violate it, which is every error in the gate parameters. → Quantum Programming
Blindness depends on the CODE, not just the state
the phase-flip code is blind exactly where > the bit-flip code sees. The first version of the project module's rule omitted the code argument and > was wrong for half the table; a test comparing the rule against the simulator in all twelve cells > caught it. → Quantum Programming
lazily rebuilt objects that were not plain `QuantumCircuit`s and behaved subtly differently in composition, serialization, and equality. The functions return plain circuits. → Quantum Programming
Born rule
and it is worth writing in the form that matters for programming rather than the form that matters for physics: → Quantum Programming
Both CNOTs vanish in both cases
and nothing in the wire structure suggested they could. All three operations touch the shared qubit, so the dependency graph is a chain of length 3, and a pass that cancels only *adjacent* inverses finds nothing to do. The two CNOTs survive an optimizer that does not know the identity. → Quantum Programming
Both qubits are biased toward reading 1
the *opposite* of the usual "excited state decays during readout" story. Chapter 2 Case Study 2 reports this contradiction explicitly and draws the methodological lesson (*measure the asymmetry, do not inherit it*). **Do not later assert the textbook direction anywhere in this book.** → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
But $\Lambda \approx 2$, not
> 28
that is close to threshold, where useful logical error rates need very large $d$. Below > threshold is necessary, not sufficient. Check the current state of the art; this is the > fastest-moving number in the field. → Quantum Programming
C
calibrated error rates
every gate error, every readout error, every $T_1$ and $T_2$ — from the backend's published data. → Quantum Programming
can express a linear boundary
never in doubt, and a perceptron has done it since 1958. > > **A demonstration on a dataset the baseline solves perfectly cannot distinguish the two methods. It > can only fail to.** → Quantum Programming
can express a linear decision
> boundary
which was never in doubt, and which a single perceptron has done since 1958. > > **A demonstration on a dataset the baseline solves perfectly cannot distinguish the two methods. It > can only fail to.** → Quantum Programming
cannot be compared at all
> and 99.25% against 99.20% is well inside the range those choices span. → Quantum Programming
certification
the entire point of running it was to answer "is this correct?", and it answered "yes." → Quantum Programming
a QEC test storing an eigenstate of its own failure mode. **Ch. 26** — a bisection whose default input could not see the bug. **Ch. 27** — three of four oracle-free properties passing a broken circuit. **Ch. 29** — a layout chosen by connectivity alone, routing through dead edges. → Quantum Programming
Ch. 30
a benchmark robust to readout error, silent when readout error broke everything. → Quantum Programming
Ch. 31
a simulator with no correlated noise, judging correlated-noise cancellation. **In every case the blindness was a documented, deliberate property of the method.** → Quantum Programming
Ch.9's "reuse degrades cumulatively"
0.0029 → 0.0048 → 0.0068 was one seed on a *noiseless* simulator. 200 repeats give 0.00657 → 0.00642 → 0.00558, falling to 0.00214 by eight flips. The direction was backwards and the proposed mechanism was impossible. Corrected in 3 files + the code. - Ch.16 case-study `excluded` column (600/1200/18 → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Chapter 12
a 288× spread in two-qubit gate error across one chip, median around 0.0078. Surviving 1,000 two-qubit gates at that error rate is $(1-0.0078)^{1000} \approx 4 \times 10^{-4}$. → Quantum Programming
Chapter 12's layout scoring
they select the best qubit pair by calibration data rather than accepting the default. Genuine improvement. → Quantum Programming
and worth reading precisely because the default is not "none." *Tier 1.* - **Documentation on measurement-basis grouping in the Estimator.** Chapter 24 §24.3's optimization is a platform feature, and whether it is applied is a configuration value you should know. *Tier 1.* - **Literature on Pauli tw → Quantum Programming
Chapter 16
the gradient costs $2n+1$ evaluations per iteration, and $p=3$ on a large graph means more parameters and a flatter landscape. → Quantum Programming
Chapter 17
up to **3.18×** routing overhead when the interaction graph is not local, and a logistics graph is emphatically not a line. → Quantum Programming
Chapter 19
an oracle "worked" because it was only ever tested in the computational basis, where a phase oracle is indistinguishable from doing nothing. - **Chapter 24** — a VQE result reproduced perfectly on an exact simulator, which hides shot noise entirely. - **Chapter 25** — a QEC test reported *zero* logi → Quantum Programming
Chapter 21 §21.7
benchmarking against the method nobody uses. - **Chapter 36 Case Study 36.1** — a correct number that answers a question nobody asked. - **§37.6** — a good mean and a bad answer, which is what "we found a route" conceals. → Quantum Programming
Chapter 27
a tolerance below the shot-noise floor ($\approx 3/\sqrt{N}$) makes a test *blind*, not strict. Students and practitioners both tighten tolerances to make tests stricter, which is backwards. - **Chapter 28** — an optimization is not "better" until the difference exceeds the seed-to-seed spread. Leve → Quantum Programming
Chapter 27 §27.4
a test suite that passes because its tolerance is below the shot-noise floor. - **Chapter 29 §29.3** — a layout optimized against calibration data that is a day old. - **Chapter 30 §30.5** — a fidelity quoted from a distribution's best statistic. - **Chapter 33 §33.6** — an accuracy from one train/t → Quantum Programming
Chapter 33
two gaps in the *same experiment*: $+0.0202 \pm 0.0170$ (not significant) and - **Chapter 38** — 37 test bits to exclude a fully compromised channel, 62,761 for a partial tapper. Both - **Chapter 39** — a 2.03× layout spread that is invisible at 4 qubits and decisive at 14. | 27 | 200 runs | a false → Harvested measurements
charges per task and per shot
unlike IBM's open tier. Two local backends: `braket_sv` (state vector) and `braket_dm` (density matrix, **required for noise**). → Quantum Programming
check for newer results; this number moves.
**Literature on minimum-weight perfect matching and neural-network decoders.** The decoder is a real engineering problem: it must run in real time, inside the coherence window, forever. §25.7's feedforward requirement made concrete. *Tier 2* — active. → Quantum Programming
Check the pipeline before the physics.
**Next:** [Chapter 13](../chapter-13-error-mitigation/index.md) — fighting back. Readout mitigation first, because Chapter 11 measured it as the highest-return technique; then dynamical decoupling, zero-noise extrapolation, probabilistic error cancellation, and an honest accounting of what each one → Quantum Programming
the threshold at which a computed energy is useful for predicting reaction rates. VQE beats it by thirteen orders of magnitude on an exact simulator. → Quantum Programming
Choose `ry` when the answer has real amplitudes
which is the case for a molecular ground state in a real basis, and is why the project uses it. The saving is not in the circuit; it is in the search. → Quantum Programming
Choosing a decomposition
Ch. 19's plain `MCXGate` with spare qubits beat a hand-specified `v-chain`. *Leaving the transpiler room is a hand optimization.* - **Knowing your ancillas are free** — a qubits-for-depth trade only you can make. - **Exploiting problem structure** — Ch. 22's AQFT cutoff is a numerical argument, not → Quantum Programming
circuit shape dominates optimization level
a hardware-aware circuit at the *lowest* useful optimization level beat a naive one at the highest, by **+0.1397**. No optimization level rescues the wrong shape. → Quantum Programming
circuits
one body for the true branch, optionally a second for the false branch — not a gate with a flag attached. → Quantum Programming
Cirq is an excellent endpoint and a lossy waypoint
it lives in `cirq.contrib`, requires `pip install ply`, and fails with `ModuleNotFoundError` until you install it. And **Braket's native IR *is* OpenQASM 3** — there is no translation step, which makes Braket an unusually good translation hub. → Quantum Programming
classical
it acts after the state is gone — so it is an ordinary stochastic matrix. Build from $2^n$ gate-free calibration circuits. → Quantum Programming
Clifford
entangled but *structured*. Genuinely hard needs **high entanglement AND non-Clifford gates**. → Quantum Programming
Clifford circuits
built only from $H$, $S$, CNOT, and the Paulis — are **efficiently simulable classically**. Not approximately: exactly, in polynomial time, at any size. This is the → Quantum Programming
Clifford circuits are simulable at any size
a 1000-qubit GHZ state included. High-fidelity preparation is still an achievement; it is a *characterization*, not a computation. 4. **Shallow variational circuits are frequently MPS-simulable**, which matters a great deal for QML claims. 5. **Hardness needs both high entanglement and non-Clifford → Quantum Programming
Clifford gates can be applied transversally
directly on the encoded logical qubits, with no extra machinery. **`T` gates cannot**, and require magic state distillation, which means building at least one factory. The first `T` gate pays the entire cost of standing up that infrastructure. → Quantum Programming
the whole chain oscillates together, which is a **global** degree of freedom. The Mølmer–Sørensen gate couples two ions *through that shared mode*, and since the mode belongs to the entire chain, any ion can be coupled to any other directly. **The connectivity graph is complete because the coupling → Quantum Programming
collision
two inputs with the same output — and the birthday bound puts that at the square root of the domain size. → Quantum Programming
Commuting is not sufficient
this is what decides how many circuits a Hamiltonian actually costs, and why Chapter 36's lighter Bravyi–Kitaev mapping (average Pauli weight 5.62 against Jordan–Wigner's 6.16) groups better. → Glossary
Compared to what
"the classical baseline" is unnamed. Fails. 2. **How many samples** — no instance count, no seeds. Fails. 3. **Denominator** — 0.92 of the edges or of the optimum? Fails. 4. **Which statistic** — mean, best, median? Fails. 5. **Total vs method error** — not applicable / insufficient information. 6. → Answer Keys for All Exams
compose rather than exclude
PennyLane layers over Qiskit, Q#'s estimator consumes any framework's logical counts, Braket's OpenQASM 3 IR makes it a translation hub. Case Study 18.2's team framed five mutually exclusive options, at least three of which excluded nothing, and spent three weeks on a decision that deserved an after → Glossary
deployment adds manual pre-shared-key management, often replacing automated certificate rotation. - Range dies at **240.4 km**; beyond it, trusted nodes hold the key **in the clear**. - ML-KEM costs **2.6×** the CPU of the algorithm it replaces, covers every segment, and works between parties who ha → Answer Keys for All Exams
Control it and the phase becomes observable
which means the standalone test could never fail and the controlled test could never pass. Chapter 14's lesson in a new setting: *a test whose expected output is invariant under the bug you fear is not a test for that bug.* → Quantum Programming
Convert results at exactly
one boundary
one function, since bit reversal is its own inverse and scattered conversions cancel. (3) **Verify with an asymmetric state.** → Quantum Programming
convex rather than concave
it curves > upward, and the maximizer runs to the boundary of the box. Three things follow: > > 1. **The optimum is no longer unique.** There can be several local maxima on the feasible polytope, > and which one you get depends on the solver's path. The determinism in §34.3's table is gone. > 2. **` → Quantum Programming
QED-C benchmarks, Metriq, and vendor application-level reporting. **The direction the field is moving**, and closer to §30.8's advice than QV is. *Tier 2* — check what is current. → Quantum Programming
CZ is symmetric
there is no distinction between control and target, which CNOT does not share. That symmetry makes it the natural native gate on some hardware, and it is why you will meet devices whose basis contains `cz` rather than `cx` or `ecr`. → Quantum Programming
D
Data re-uploading is real and elegant
one qubit, six parameters, a non-linear boundary, proven universality. **Circuit width is not what limits expressibility.** - **It is significantly cheaper** than the multi-qubit alternative: a quarter of everything, indistinguishable accuracy. **On current hardware that is the trade you want.** - * → Quantum Programming
Decide it EMPIRICALLY on a
simulator, noiselessly
for Ch.24's H2 a 4-param problem-informed ansatz hit 8.88e-16, so expressibility was never the constraint (the shot budget was). **A more expressive circuit you cannot execute is not more expressive.** Ch.16 §16.6 (problem-informed ansatz defends against barren plateaus) + Ch.24 §24.4 (QAOA gets one → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
default does NOTHING
skip_reset_qubits=True + ALAP (schedules LATE) put the idle period at the START on still-in-reset qubits; DD skipped it. Pass ran, no error, 132 delays inserted. CHECK: count inserted X gates; expect HUNDREDS. FAILURE 2: when engaged it made things WORSE — and that is CORRECT. DD fights **correlated → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
deliberate
fewer neighbours means less crosstalk, and crosstalk is harder to fix than routing. **Every two-qubit gate between non-adjacent qubits must be routed**, as SWAPs costing three two-qubit gates each. → Quantum Programming
it helps most when errors are large and structured, less when they are small or when routing has already spread the circuit across better hardware. → Quantum Programming
depth and two-qubit count
the pre-fault-tolerant metrics. $T$ count matters **after error correction**: Chapter 25 §25.10 showed the surface code supports Clifford gates natively and $T$ gates only through magic state distillation, which is why Chapter 15's resource estimates were $T$-dominated. **Optimizing one does not opt → Quantum Programming
Depth governs decoherence
the circuit must finish inside $T_1$ and $T_2$. **Two-qubit count governs gate error** — Chapter 12 measured a median `ecr` error around $8\times10^{-3}$ with a 288× spread. Both are real; here they point in opposite directions. → Quantum Programming
which is worth discovering before spending effort optimizing it. → Quantum Programming
Design around it rather than against it:
Ask for *measurements on a variant* — a different molecule, graph, seed, or noise model. The book's numbers will not match, and reproducing the *method* is the point. - Ask for the reasoning behind a refusal, not the code implementing it. - Ask them to audit a claim you supply. `vqelab.claims` gives → Assessment: What to Grade When the Output Is Probabilistic
Ch. 38 - **Documentation for Gurobi, CPLEX, or HiGHS on optimality gaps.** — Ch. 37 - **Documentation on measurement-basis grouping in the Estimator.** — Ch. 39 → Bibliography
device-specific and it has shifted historically
early superconducting devices were > decoherence-limited, trapped ions still have long coherence and slow gates. **Check which regime you > are in before optimizing for the wrong one.** → Quantum Programming
DFT has neither
there is no knob you can turn that provably converges a functional to the exact > answer, so a DFT error cannot be bounded from within DFT. > > This matters more than it first appears, because **systematic improvability is precisely what a > quantum method claims as its advantage.** "Exact in princi → Quantum Programming
88× across 2 to 10 qubits, against this chapter's 224×. Two chapters, the same > phenomenon, the same qubit range, a 2.5× disagreement. It would be easy to treat one as noise. > > It is not noise. It is **depth**: > > ```text > ansatz Var(2q) Var(10q) collapse per qubit > Ch.32, StronglyEntangling x → Quantum Programming
different units
a classical *operation* (one microsecond of real CPU) against a quantum *query* (thousands of fault-tolerant T gates). The meaningful ratio is $\frac{10^6 \times \text{cost per classical check}}{10^3 \times \text{cost per oracle call}}$. → Quantum Programming
directed
treating it as undirected made 29 qubits appear isolated. → Glossary
discarded
announcing them makes them worthless as key. So detection is bought out of key material, and the natural instinct is to buy as little as possible. → Quantum Programming
distribution
a per-qubit or per-qubit-pair error and duration for every instruction. Not a number. Two-qubit gates alone have 144 entries spanning 34× between best and worst live edge. → Quantum Programming
`a / b` is a legal angle expression — and so is a parameter in the exponent, `2 ** a`. The algebra is not restricted to the affine forms that show up in tutorials. → Quantum Programming
Do Exercise 6.15
seeing the answer invert is worth more than reading it | | 15, 16, 17 | Parameter mangling | §6.6 | Normalize; do not reproduce the mangling rule | | 18, 19 | QASM vs. QPY, interchange | §6.6, §6.8 | Save both. Storage is free; an unreconstructable circuit is not | → Quantum Programming
Do not close rings you do not need.
**Reorder your problem to match the chip.** For QAOA (Ch. 24 §24.4) the interaction graph *is* the problem — but which problem vertex sits on which qubit is yours to choose. - **Use native gates** — `ecr` here, `cz` elsewhere, `MS`/`GPi` on ions (Ch. 17). - **Consider mid-circuit measurement and qub → Quantum Programming
Do not reproduce the exporter's mangling rule
it is an implementation detail. **Normalize > both sides** by stripping non-alphanumerics: `theta[0]` and `_theta_0_` both → `theta0`. → Quantum Programming
and a QRAM robust enough to use would itself need error correction, at which point Chapter 25's overhead dominates. → Quantum Programming
Does not reduce the term count
631 for LiH either way. It reduces Pauli *weight*: mean 6.16 → 5.62, max 12 → 10. → Glossary
Does not transfer, and is worth knowing:
Deep circuit-identity manipulation. Useful and narrow. - Any specific SDK's API. Chapter 31 opened with `qiskit.pulse` being **removed in Qiskit 2.0**, taking `add_calibration`, `backend.defaults`, and `instruction_schedule_map` with it. **The API you learn will be deprecated; the reasoning will not → Quantum Programming
does not violate no-cloning
the original is destroyed. It **does not beat light** — the two classical bits carry the information and travel classically; before they arrive Bob's qubit is maximally mixed. **Nothing physical is transported.** The exact exchange rate: *one entangled pair + two classical bits → one transmitted qub → Quantum Programming
exactly representable in 3 bits ($010$) — so phase estimation returns it with **zero error and probability 1**. $1/3$ is not dyadic, so the register holds the best 3-bit approximation ($011 = 0.375$), and the residual is the representation error. → Quantum Programming
E
Each edge contributes one $ZZ$ rotation per layer
that is what "the cost layer is built from the graph" means literally. And each $ZZ$ rotation compiles to **two** two-qubit gates: → Quantum Programming
eigenvector
applying an operator to its own eigenvector > multiplies by the eigenvalue and leaves the state alone, so the eigenvalue is *kicked back* onto the > control register. **This is phase estimation with one bit of precision** (Ch. 22), and the > resemblance is exact. → Quantum Programming
Either the queue really is that deep
in which case the platform is heavily oversubscribed and the device is close to fully utilized, from the provider's side, at the same moment it is 0.002% utilized from yours. Both statements are true. **Utilization is not a property of the device; it is a property of whose clock you are reading.** → Quantum Programming
Empirically, on a simulator, noiselessly
run the optimization with both ansätze and see whether the cheaper one reaches the answer at all. If it does, expressibility is not the binding constraint and fidelity decides. For Chapter 24's H₂ a four-parameter problem-informed ansatz reached the exact ground state to $8.88\times10^{-16}$; the sh → Quantum Programming
encoded in the circuit
which means you have already touched all $N$ items to build it, at cost $\mathcal{O}(N)$, before the search begins. → Quantum Programming
encoded into the circuit
the oracle must contain, in some form, the information that record 4,829,110 is the one matching the query. → Quantum Programming
entangled with something that was not uncomputed
Chapter 19's dirty ancilla. It definitively does **not** mean noise: there is no noise on a noiseless simulator, and the number is exact rather than statistical. On hardware the same symptom would be indistinguishable from decoherence. → Quantum Programming
Entanglement alone is not enough
a 1000-qubit GHZ state is maximally entangled and trivially simulable. **Non-Cliffordness alone is not enough** — a shallow circuit of arbitrary single-qubit rotations is MPS-simulable at any width. → Quantum Programming
entanglement witness
a single number with a threshold that no unentangled state can cross. → Quantum Programming
entropy 0.8113
entangled, mixed, and unable to interfere. Uncomputing returns it to **0.0000**. → Quantum Programming
EstimatorV2 precision is NOT reliably seedable
consecutive runs at precision 0.05 gave 2.0161 then 2.0137. Returned `stds` matches the request exactly. Use `StatevectorEstimator` when bit-reproducibility is needed. - ⚠️ **THE LAYOUT TRAP.** Circuit transpiled at opt level 3 for FakeSherbrooke (seed 42) lands on physical qubits **[60, 61]**. With → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
ETSI's QKD standardization work.
Ch. 38 - **Ezzell et al., "Dynamical decoupling for superconducting qubits: a performance survey" (2023).** — Ch. 13 → Bibliography
Every
part was correct and the composition was not
which is the fifth time this book has landed there (Chapter 8's parameter sort, Chapter 10's optimization level, Chapter 11's diagonal-gate removal, Chapter 13's DD placement, Chapter 14's insertion strategy). → Quantum Programming
which is the measured row 0.4997 / 0.5046 / > 0.5038 / 0.5018 / 0.5019, to within shot noise at 40,000 shots. > > And the mechanism is worth naming, because it is what a threshold *is*. At $p = 1/2$ the error > pattern is a uniformly random bit string, and **a majority vote over uniformly random bit → Quantum Programming
Every one of them recovers $1/3$ exactly
including $t = 3$, where the raw estimate was $0.375$ and the error a fat $0.0417$. The criterion explains why: → Quantum Programming
Every one of those channels is Markovian
memoryless, with each instant's noise independent of every other instant's. → Quantum Programming
every optimizer iteration
a 100-parameter, 200-iteration, 4096-shot run is $1.6\times10^8$ shots. PennyLane skips parameters that cannot affect the observable (64 params across 4 wires → 33 executions, 16 nonzero gradients), which is also a useful **ansatz bug detector**. → Quantum Programming
★ **Feature-map tuning moved accuracy from 0.6364 to 0.8500** — a larger swing than any method-to-method difference in this chapter. - ★★ **Across ten splits: quantum kernel $0.8313 \pm 0.0381$; SVC(rbf) beats it by $+0.0576 \pm 0.0083$ (significant), kNN by $+0.0657 \pm 0.0137$**, and it ties with → Quantum Programming
Everything else is ergonomics
real, worth having preferences about, and not worth a rewrite. → Quantum Programming
Everything from Parts II and III arrives at once
layout choice (100×), mitigation ordering (−79%), barren plateaus, the $2n+1$ gradient bill, connectivity overhead, ancilla hygiene — and they → Quantum Programming
Exact and free
unlike Chapter 36's active space, no approximation stands between problem and Hamiltonian. → Glossary
exact for dyadic phases
pick $\phi = 3/8$ and the output is deterministic, so a statistical algorithm acquires an exact test. Chapter 21's Grover at $N=16$ hits **0.9613 at 3 iterations**, and Chapter 23's factoring of 15 gives **four outcomes near 25% each**. These are known-answer tests inside algorithms that are suppose → Quantum Programming
Exact, not approximate
measured as 1.000 and 0.000 at $n = 3, 4, 5$. A single shot suffices and the answer is certain. → Quantum Programming
exactly
no shots, no sampling, no noise. It costs $2^n$ complex amplitudes of memory: 16 GB at 30 qubits, 16 TB at 40. → Quantum Programming
Exactly $2n + 1$
two shifted evaluations per parameter, plus one forward pass for the value itself. → Quantum Programming
exactly 0.0000
but that is a seeding artefact and 0.0093 is the honest figure, so 0.0093 is the one quoted. → Quantum Programming
**All its terms commute**, because $Z_uZ_v$ and $Z_aZ_b$ are both diagonal. So $e^{-i\gamma H_C}$ factorizes *exactly* into a product of two-qubit rotations — one per edge, in any order. **There is no Trotter error inside a cost layer.** - **It does not commute with the mixer.** $[Z_uZ_v, X_u] \neq → Quantum Programming
exactly as written
no gate translation, no routing, no optimization. Needed for (a) **benchmarking**, where you must measure the circuit you specified rather than the compiler's improvement of it (Chapter 30), and (b) **error-correction circuits**, whose structure carries meaning an optimizer would happily destroy. → Quantum Programming
exactly at every level
process fidelity `1.000000000000`, verified with `Operator.from_circuit`. - **Level 0 → 1 is the big win**: surviving signal goes from **6.5% to 12.9%** of noiseless. Everything above level 1 is refinement. - ★ On a Grover-like circuit, **level 2 is 15% deeper than level 1 with 9% fewer two-qubit ga → Quantum Programming
the values $s = k\cdot2^t/r$. Sharp because $k/4$ is **dyadic** (Ch. 22 §22.4). → Quantum Programming
Exactly four outcomes, each near 25%
the values $s = k\cdot 2^t/r$ for $k = 0,1,2,3$ with $r = 4$. Phase estimation is exact here because $k/4$ is dyadic (Chapter 22 §22.4), so the distribution is four sharp peaks rather than a spread. → Quantum Programming
Exactly one of them can add a two-qubit gate.
**Basis translation** rewrites each gate into the device's alphabet. It is a fixed substitution: one `cx` becomes one `ecr` plus single-qubit corrections, and any single-qubit gate becomes two pulses regardless of what it was (§10.2). It changes the *names* and the pulse count. It cannot change how → Quantum Programming
exactly zero
ALAP scheduling plus `skip_reset_qubits=True` placed DD where no idle time existed. **Count the inserted pulses**; expect hundreds, and be suspicious of a handful. And **DD cannot be evaluated on a fake backend at all**: `from_backend` noise is Markovian, DD works against correlated noise, so there → Quantum Programming
exactly zero variation
the transpiler found the same good layout every time. A team that measures seed sensitivity on a toy circuit concludes the seed does not matter, which is §28.4's error in another costume. → Quantum Programming
it turns a short shared secret into a long one - (c) an authentication protocol - (d) a replacement for TLS → Quantum Programming
explicitly
`x q[0];` means qubit 0, unambiguously — so the *program* moves correctly. But each framework then decides for itself where qubit 0 sits in its own state vector, and that decision is not something QASM has an opinion about. → Quantum Programming
exploit problem
structure
Chapter 22's AQFT cutoff is a numerical argument about phase precision, not a circuit identity, and no peephole optimizer will find it; **restructure the algorithm** at all. → Quantum Programming
exponential in the number of decompositions
$\gamma^{2d}$ in depth for PEC, and the same shape in the number of cuts for knitting. → Quantum Programming
Chapter 16 §16.6 made the same point from the trainability side and Chapter 29 §29.6 from the hardware side. → Quantum Programming
F
fabrication variability
a 288× spread in gate error, twelve unusable qubits, one stuck at a constant output, all consequences of etching circuits on a chip. **Every ion of a given species is identical by the laws of physics**, so there is no fabrication lottery and no "dead qubit 84" to route around. → Quantum Programming
a prediction Chapter 34 got wrong and corrected. → Glossary
finite-key effects
the > statistical uncertainty in the QBER estimate must be subtracted from the extractable key. Modelling > only that uncertainty, a $10^3$-bit block at $Q = 0.02$ loses **13%** of its key against the > asymptotic rate. > > **And that model understates the effect.** A proper finite-key analysis corr → Quantum Programming
**The physics.** A Bell state is a Bell state. - **The noise signatures.** Chapter 11 §11.7's two-axis table reproduced identically in **Aer, Cirq, and Braket**. Phase damping invisible in all three — **a fact about measurement, not software.** - **The diagnostic procedures.** Chapter 12 §12.7's noi → Quantum Programming
free
virtual, zero duration, zero error | | `sx`, `x` | one pulse each | | **any** single-qubit gate | 3 `rz` + 2 `sx` = **2 pulses, regardless of complexity** | | `ecr` | one two-qubit operation, ~100× the error of a single-qubit gate | → Quantum Programming
front layer
the gates whose predecessors have all executed but which are not yet executable, because their two qubits are not adjacent on the coupling map. 2. Enumerate every SWAP touching a qubit in that front layer. That is a small set: on a degree-3 lattice with a five-gate front layer it is a couple of doze → Quantum Programming
full state vector
amplitudes and phases — and needs no measurement. `run()` returns **samples** and requires one. Calling `run` on an unmeasured circuit raises `ValueError: Circuit has no measurements to sample.` The method names encode Chapter 5's distinction between a state and samples drawn from it. → Quantum Programming
G
GATE-FREE circuit = +0.96228
> readout floor **0.03772**. total error 0.08228 = gate 0.04456 + readout 0.03772. Folding multiplies GATES not MEASUREMENTS. error(λ) = λ·ε_gate + ε_readout. **Tight extrapolator AGREEMENT was the clue** (a wrong answer reached reliably => right answer to the wrong question). → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Gidney & Ekerå (2021)
20M qubits, 8 hours. **Same order on both axes**, from an independent analysis. The agreement validates the **method**. → Quantum Programming
girth
the length of the shortest cycle anywhere in the coupling graph: → Quantum Programming
girth 12
its shortest cycle is twelve qubits long. So any five physical qubits you pick induce a subgraph containing no cycle at all, which makes it a forest: **at most four edges among the five chosen qubits.** → Quantum Programming
give the circuit spare qubits
HighLevelSynthesis finds the cheap synthesis by itself: ``` n=6 MCXGate in a 7-qubit circuit (no room) -> 12,002 T n=6 MCXGate in a 12-qubit circuit (5 spare) -> 39 T (identical to synth_mcx_n_clean_m15) ``` => **PRACTICAL RULE: "leave the transpiler room", not "call the v-chain API".** Explicit ent → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Grover requires no promise
any predicate, any input — where Chapter 20's algorithms all needed special structure (constant-or-balanced, linear, two-to-one). **In exchange the speedup is only quadratic** rather than exponential. → Quantum Programming
GW produces one and
QAOA does not
a difference in what the algorithms produce, and it does not close with better hardware. → Glossary
the unitary is the identity but the *timing* was the point. **The fix is a barrier**, which prevents cancellation across it. → Quantum Programming
how many there are
and the answer is larger, more structured, and less predictable than the single-gate story suggests. → Quantum Programming
hybrid
a post-quantum exchange running alongside a classical one, so an attacker must break both — which costs a second handshake and removes the strongest practical reason to wait. → Quantum Programming
I
IBM Quantum Learning (the free course platform).
Ch. 2 - **IBM Quantum Platform documentation** — Ch. 39 - **IBM Quantum's backend calibration pages** — Ch. 29 - **IBM Quantum's calibration pages for a live device.** — Ch. 30 - **IBM Quantum's documentation on dynamic circuit support.** — Ch. 9 - **IBM Quantum's processor documentation and system → Bibliography
and the fidelity falls by a factor of **3.87**. Once the entangling ladder bottoms out the parameter starts discarding the *local* factors as well, and no structural metric can see it happen. A gate-count monitor watching this sweep would report that nothing changed after 0.9. → Quantum Programming
identity overall
`XX`, or the four-pulse `XY4`. The **mechanism is refocusing**: flip the qubit halfway through the window so the phase accumulated in the second half cancels the phase accumulated in the first. → Quantum Programming
implicit
a space of candidates that is never enumerated, recognized by a circuit that is small compared to the space. → Quantum Programming
In each case the "database" is implicit
$2^n$ candidates that are never enumerated, recognized by a circuit that is small compared to $N$. That is a real and useful capability, and it is not database search. → Quantum Programming
independent of qubit
count
against exponential cost for a full distribution. **If your answer is a number, use the Estimator.** → Quantum Programming
insertion only
new `###` subsections and `>` callouts placed between existing sections, never rewriting prose that carried a measured number. Chapters 17–40 were expanded in-session; chapters 1–16 by one subagent each, all working from a single self-contained brief at `_scratch/EXPANSION-BRIEF.md`. → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Interleave and repeat
drift and layout change between runs, and one run of each cannot separate them from the effect. - Include the **do-nothing baseline**. - Report **cost alongside benefit**. - Say **how many configurations you tried** (8 comparisons → 34% chance of a spurious 2σ result). - State where the conclusion s → Quantum Programming
invariant under the bug
reversing the bits of the histogram gives back the same histogram, so the test passes whether or not the convention is right. **Bell states** (`00`/`11`) and **GHZ states** (`000`/`111`) are both palindromic; uniform superpositions are also invariant. → Quantum Programming
inversion about the mean
that is the right way to *see* it, because it can be done with a pocket calculator and it reproduces the simulator's numbers exactly. → Quantum Programming
"Instruction Set Architecture," meaning a circuit expressed entirely in operations the target device can execute, on physical qubits it actually has. → Quantum Programming
It
> won by $+0.0194$
the right sign, and 4.7× too large. > > The reason is a category error that is easy to make and worth naming: **the product of survival > probabilities is $P(\text{nothing went wrong})$, and the score is $1 - \text{TVD}$.** They are not > the same quantity. A circuit that suffers one bit-flip does n → Quantum Programming
it asks for less
the shortest, shallowest, most local extraction circuit anyone has found that still admits a growing distance. → Quantum Programming
It benchmarks a random circuit
the most favourable case for a quantum device and the least for a classical simulator. Same objection as Ch. 21 §21.7 (Grover vs a strawman) and Ch. 24 §24.5 (QAOA vs Goemans–Williamson). → Quantum Programming
It does not
noise produces a mixed state $\rho$, and > $\mathrm{Tr}(\rho H) \ge E_0$ holds for any valid density matrix. A noisy VQE energy is still an upper > bound. > > **Zero-noise extrapolation is what breaks it.** An extrapolated expectation value is not the > expectation of any state, so it carries no var → Quantum Programming
It does not rest on Qiskit being better designed
Chapter 14's `ParamResolver` binds by name and makes Chapter 8's worst bug structurally impossible, which is a design point against Qiskit that this book measured and did not let the recommendation override. → Quantum Programming
It does not search a database
it queries an oracle you must already be able to build. → Glossary
It fails with the noise removed
and the noiseless run is the same two peaks, now perfectly clean. That is as unambiguous as diagnosis gets: the wrong answer is not merely surviving the removal of noise, it is *sharpening*. → Quantum Programming
It halves with each additional counting qubit
error $\sim 2^{-t}$. Measured for $\varphi = 1/3$: **0.041667** at $t=3$, **0.010417** at $t=5$, **0.001302** at $t=8$. → Quantum Programming
it is a real contribution
demonstrating that a circuit trains at all, on hardware-realistic assumptions, is worth publishing. → Quantum Programming
It is a sampler
keep the best sample and verify classically; at $p=3$ the optimum appeared in **99.5%** of shots. → Quantum Programming
It is also a property that evaporates immediately
the standard deviation is 0.008 > at $p=2$ and 0.021 at $p=4$. An identical result is evidence of a bug until you have found the > mechanism that makes it not one, and "I checked and the mechanism is a convex-looking two-parameter > landscape" is a finding you can write down. Chapter 26 is nine sect → Quantum Programming
It is flat
genuinely, nearly > everywhere — with the structure confined to an exponentially small region the optimizer has no way to > find. → Quantum Programming
It is rigorous
the lower bounds are proved, not conjectured. **And it measures one thing while people hear another.** Three gaps: → Quantum Programming
one submission, one queue wait. - **Batch** — many circuits, one queue wait. **The single biggest lever in §39.3's arithmetic.** - **Session** — reserved access for a sequence of dependent jobs. What a variational loop needs, because otherwise every iteration re-queues. → Quantum Programming
K
kernel methods only ever need inner products
the same reason a classical RBF kernel works in an infinite-dimensional space on a laptop. → Quantum Programming
Kitaev's original toric code paper (1997/2003).
Ch. 25 - **Knill, Laflamme, and Zurek on the accuracy threshold (1998), and Kitaev's contemporaneous work.** — Ch. 25 - **Kübler, Buchholz, and Schölkopf, "The inductive bias of quantum kernels" (2021), NeurIPS.** — Ch. 34 → Bibliography
kNN wins, decisively
nine standard errors, on a dataset chosen specifically to leave room. → Quantum Programming
$N \approx 0.96/\epsilon^2$: ±0.1→97, ±0.05→385, ±0.01→9,604, ±0.005→38,416, ±0.001→960,400, ±0.0001→96,040,000 shots. - Complementarity table at 4096 shots: each of $|0\rangle,|+\rangle,|{+}i\rangle$ gives $+1.0000$ in its own basis and $-0.0015$ in the other two (standard error 0.008 → consistent → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Level 0 does not optimize
it only makes the circuit runnable. **Level 1 is where the win is**, and it costs milliseconds. → Quantum Programming
level 2 can produce a deeper circuit than level 1
measured. Level 0 for exact control, level 1 for iteration, **level 2 as the working default**, level 3 when measurement says it wins. → Quantum Programming
Levels 2 and 3 are not always identical
demonstrate on a large enough circuit. 11. **QFT(5) cannot distinguish them at any seed.** 12. **Barriers do NOT protect an `id` gate**, though the barriers themselves survive. 13. A barrier *does* stop `H H` cancelling. 14. `count_ops_delta` names the deleted instruction. 15. **`approximation_degre → Quantum Programming
Levels 2 and 3 run the same number of passes
56 each — and differ in the mix, not the length: level 3 trades three analysis passes for three more transformations. That the pipeline stops growing after level 2 is consistent with Chapter 28's headline result: **levels 2 and 3 differ in only 14 of 40 circuit-seed pairs.** → Quantum Programming
lexicographically
so `theta10` comes before `theta2`, and fifteen of sixteen angles land in the wrong gate. → Quantum Programming
Limits, both from "square":
**It measures width and depth in a fixed ratio.** Ch. 28's Grover circuit: 5 qubits, 257 gates. Ch. 29's ansatz: 6 qubits, 15 gates. **Neither is square.** - **Random pairs sample the whole graph**, including the parts a hardware-aware programmer avoids. **A device with a few excellent qubits and ma → Quantum Programming
Limits: (a) width and depth in a FIXED RATIO
Ch.28's Grover is 5q/257 gates, Ch.29's ansatz 6q/15 gates, NEITHER IS SQUARE; **(b) random pairs sample the WHOLE graph**, including the parts a hardware-aware programmer avoids; **(c) quantized in powers of 2.** → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
linear chain
nearest-neighbor CNOTs only, which is what those entanglement patterns produce: → Quantum Programming
Linear in $\lambda$
which is why the linear extrapolator works, and why it stops working when $Gp$ is no longer small. → Quantum Programming
which is why 100 circuits is 99.8× and not something more interesting. The ceiling is $S(\infty) = 1 + t_q/t_d$, the same 43,340× as the wall-clock multiple, and linearity holds until $n \approx t_q/t_d \approx 43{,}300$ circuits. **For any batch a working scientist will ever submit, batching return → Quantum Programming
Literature on architecture-aware algorithm design.
Ch. 17 - **Literature on automated active-space selection** — Ch. 36 - **Literature on benchmark gaming and Goodhart's law.** — Ch. 30 - **Literature on circuit knitting and distributed quantum computing.** — Ch. 35 - **Literature on classifying phases of matter with machine learning** — Ch. 35 - ** → Bibliography
Literature on quantum circuit benchmark suites
QASMBench, MQT Bench, and similar. Standard circuit families to optimize against, which is better than inventing your own and accidentally choosing the ones that cannot distinguish your configurations (§28.4's correction). *Tier 2.* - **Anything on the pitfalls of proxy metrics in performance engine → Quantum Programming
Literature on qubit mapping and routing algorithms
SABRE (which Qiskit uses), and the token-swapping formulation. **Worth reading once so you know what the transpiler is doing when it spends 102 gates on your behalf.** *Tier 2.* → Quantum Programming
Literature on real-time decoding
union-find, sliding-window, and neural decoders, under microsecond latency budgets. **The highest-demand engineering skill in §40.1's table.** *Tier 2* — moving fast. → Quantum Programming
little-endian
in the bitstring `q2 q1 q0`, qubit 0 is on the **right**. Say this every time a bitstring is read for the first ten chapters. It is the book's running bug. - Gates in prose: **H**, **X**, **Z**, **CNOT** (not CX in prose; `cx` in code), **CZ**, **SWAP**, **Toffoli**. Rotation gates: $R_x(\theta)$. - → Style Bible — Quantum Programming (INTERNAL, do not publish)
Loading it costs exactly what Chapter 32 measured
$N - \log_2 N - 1$ gates for amplitude encoding. Calling it "quantum data" is a category error, and it is the most common one. → Quantum Programming
Local simulation of the same jobs took 22–74 ms
the same order of magnitude as hardware execution - ★ **At a 5-minute queue, utilization is 2.31 × 10⁻⁵** — 43,340× wall clock over device time - **The book's own experiments run 614,400 to 18,456,984 shots** — and 18.5M shots is **31.2 seconds** of device time - ★★★ **The same VQE run costs $50 per → Quantum Programming
is exactly the minimum depth, and assigning > each operation its level is exactly what "slide left into the earliest moment with room" does. > `EARLIEST` computes a critical path. > > **Verified on an eight-operation circuit** with a deliberately non-obvious dependency structure — > four `H` gates o → Quantum Programming
loss landscape
the *gradient* of a cost with respect to *parameters* vanishes. Kernel concentration is a statement about a **fixed function** — there are no parameters and no gradients, and nothing is being optimized. The consequences differ accordingly: → Quantum Programming
M
machine epsilon
the scale at which a float64 stops being able to represent a difference at all. `np.finfo(float).eps` is about $2.2\times10^{-16}$. → Quantum Programming
Machine learning has no such anchor
a model is judged by test accuracy against alternatives, and the alternatives are very good. → Quantum Programming
Magesan et al. on interleaved RB (2012).
Ch. 30 - **Makarov and collaborators' broader body of QKD hacking work.** — Ch. 38 - **Maximilian Schlosshauer, *Decoherence and the Quantum-to-Classical Transition*.** — Ch. 5 - **McKay et al., "Efficient Z-Gates for Quantum Computing" (2017), *Physical Review A* 96, 022330.** — Ch. 3, 8 - **Mosca' → Bibliography
magic
> state distillation
a factory consuming many noisy states to make one clean $|T\rangle$. → Quantum Programming
magnitudes only, no phases
because that is what people actually try first, and it loses anyway. → Quantum Programming
including that it does not commute, which turns out to matter a great deal. - **Complex numbers** — addition, multiplication, magnitude, and the fact that $e^{i\theta}$ traces the unit circle. Quantum amplitudes are complex, and the complexity is the point. - **The inner product** $\langle\psi|\phi\ → Prerequisites
medical records
a lifetime, and beyond it for genetic information - **government and diplomatic communications** — routinely classified for decades - **legal and financial records** — statutory retention often exceeds twenty years - **industrial and pharmaceutical R&D** — patent horizons plus development timelines → Quantum Programming
memorize the training set and
generalize at chance
every point its own island, every training point a support vector. → Quantum Programming
metamorphic properties
relations that must hold, requiring no reference implementation: → Quantum Programming
Metamorphic testing
the key idea, since there is usually no oracle: assert RELATIONS between outputs (input symmetry, parameter scaling, adjoint round-trip U U† = I, known-answer subcases). Statistical tests on distributions (chi-square / TVD) and **how many shots a test needs** (ties to Ch.24's shot budget). Seeding a → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
min 0.00347, median 0.00750, max 0.11736
the numbers Chapter 28 §28.3 uses to predict circuit fidelity and Chapter 29 uses to pick qubits. → Quantum Programming
mitigation costs shots
readout mitigation needs calibration circuits and ZNE needs 3–5× the circuits (Chapter 13 §13.9). At a **fixed total budget**, spending shots on mitigation reduces the shots available per evaluation, which **increases the shot noise**. If shot noise already dominates the error, the trade is negative → Quantum Programming
Moments
time slices in which several operations happen simultaneously — rather than a flat list of gates. Timing is first-class. → Quantum Programming
monotone
compute it at every prefix and confirm that once it becomes true it stays true. Why does bisection require this? → Quantum Programming
puts all three quantities together: if $x$ is how long your data must stay secret, $y$ is how long your migration takes, and $z$ is how long until a cryptographically relevant quantum computer exists, then you have a problem whenever → Quantum Programming
Mosca's theorem on migration timelines
comparing how long data must stay secret, how long migration takes, and how long until a cryptographically relevant quantum computer. The framework behind harvest-now-decrypt-later. *Tier 1.* → Quantum Programming
Most likely cause: the noise is not in the circuit
0.6246 vs 0.7171, a 13% loss. Rewrote to report the 13% AND to state that the simple model (QBER-CI only) UNDERSTATES the real effect, which corrects smooth min-entropy and carries an explicit failure probability. The module ships this admission as a `caveat` FIELD in the return value, not a docstri → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
N
Nam et al. (2018)
not primarily for the optimizer but for the benchmark methodology. It reports what its optimizations do to real algorithm circuits, with the baselines stated, which is the standard §28.3 argues most optimization reports fail to meet. → Quantum Programming
Never cancel and resubmit
you lose your position. - `least_busy()` for **iteration**; a *chosen* backend for **results**. - Record backend, layout, score, job id, **and date** — calibration drifts. → Quantum Programming
Never invent one
a non-canonical directory creates a second chapter folder that `SUMMARY.md` and the validator both ignore. - Every chapter: exactly one 🧱 **Project Checkpoint**, ≥6 callouts, ≥4 distinct kinds. - Chapter checkpoints are **cumulative** — Ch. N's `project-checkpoint.py` extends the file Ch. N−1 wrote. → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Nine
6% of the connectivity. "Dead" means error exactly **1.0**: uncalibrated or failed in that snapshot. Chapter 29 §29.4 pinned a layout across two of them and the circuit returned 0.6790 against an expected 0.9116. → Quantum Programming
Nine of 144 two-qubit edges are dead
error exactly 1.0, uncalibrated or failed. That is 6% of the chip's connectivity, and Chapter 29 §29.4 found what happens when your layout crosses two of them. → Quantum Programming
no
bind before exporting | | Pulse calibrations | **no** — and `qiskit.pulse` was removed in Qiskit 2.0 | | Transpiler layout | **no** — a QASM file is logical, not physical | → Appendix F: OpenQASM Reference
No circuit object
the function body *is* the circuit. So parameters are plain Python arguments, and **Chapter 8's ordering bug cannot occur here either** (third distinct reason, after Cirq's dicts and Q#'s signatures). → Quantum Programming
no gates at all
a four-qubit register in $|0000\rangle$, where $\langle ZZZZ\rangle$ is exactly $+1$: → Quantum Programming
no guarantee at all
no theorem gives ratio $f(p)$ for arbitrary graphs, and known instance families defeat low-depth QAOA. **A proven worst-case bound and a good average-case result are different kinds of claim.** → Quantum Programming
no quantum advantage
anything simulable that easily can just be simulated, which is why **T-count** is the currency of fault-tolerant resource estimation. And "MPS was fast" proves your circuit is easy, while "MPS was slow" proves nothing about hardness — an asymmetry that keeps narrowing advantage claims. → Quantum Programming
no size of code helps
you are on the wrong side of a phase transition. > > **And $\Lambda$ collapses near threshold:** 28× at $p=0.01$, **1.7× at $p=0.20$**. Being *barely* > below is nearly as bad as being above. Chapter 15's millions of physical qubits are the price of > operating close to threshold. → Quantum Programming
it is exponential and dies around 20 orbitals. The real competition: → Quantum Programming
Noise requires the density-matrix simulator
and Chapter 11 §11.2's cost applies: density matrix is $4^n$, so half the width. → Quantum Programming
Noise slots
Chapter 25's `id` markers. - **Timing markers** — a `delay` or a `barrier` you inserted to control when something happens (Chapter 31). - **Benchmark gate counts** — a randomised-benchmarking sequence whose whole point is that it contains exactly $m$ Cliffords composing to the identity. An optimizer → Quantum Programming
non-monotonic
120 rotations reporting fewer qubits than 90 — because it silently switches space–time tradeoff points. A QFT's rotations are sequential, so `rotationDepth ≈ rotationCount` is the honest input. → Quantum Programming
none at all
the entangling > structure synthesized away, leaving 46% overlap with what you asked for. > > **Never set it without measuring the fidelity you traded.** And on a 127-qubit backend that > measurement is impossible — so do the study small, then apply the setting. → Quantum Programming
Not 1
$k$ must be an integer, so you get a high probability and repeat if unlucky. → Quantum Programming
Not a bug
little-endian ordering interacting with which bit drives the $X$ gate. **Testing only `00` and `11` (both palindromes) would have hidden it.** → Quantum Programming
not a constant tax
it depends entirely on the mismatch. The same experiment on a **linear chain** gave **4 physical gates for 4 logical CNOTs, at every optimization level and every width**: a ratio of exactly 1.0, while all-to-all ran 1.8–2.2× and widening. Chapter 8's `linear` and `pairwise` entanglement patterns are → Quantum Programming
not a criticism of data re-uploading
the construction is still elegant and the universality result still holds. And the classical evaluation is **not free**: at 3.11 s it is 1.6× slower than `kNN.predict`, so it does not win on speed either. → Quantum Programming
not calibration data
no per-qubit readout errors, gate errors, or $T_1$/$T_2$, which is exactly what Chapter 12's layout scoring and preflight checks were built on. → Quantum Programming
not coupled
123 sits between them. One SWAP goes in, and Chapter 4 §4.6 priced a SWAP at three two-qubit gates. Four logical plus three for the SWAP is seven. → Quantum Programming
Not free
it costs qubits, time, and its own errors. → Glossary
not injective
it discards information — while quantum operations must be unitary and therefore reversible. The construction keeps the input and XORs the answer into a scratch register: $U_f|x\rangle|y\rangle = |x\rangle|y \oplus f(x)\rangle$. It is reversible because XOR is its own inverse, so $U_f^2 = I$. → Quantum Programming
Not native anywhere
decomposes into 6 CNOTs and 7 T gates, which is why Chapter 19's oracle costs are dominated by multi-controlled logic. → Appendix B: Gate Reference
not one gate
which is what an information-theoretic count should look like under a > peephole optimizer. Chapter 28 measured that same optimizer reducing a circuit to **zero two-qubit > gates** at `approximation_degree=0.9`; here it removes nothing, because every gate is carrying a > parameter of the state and t → Quantum Programming
not primitives
each must be **synthesized** into a Clifford+T sequence whose length depends on the precision demanded. Chapter 15's estimator takes `rotationCount` as a separate input from `tCount` for exactly this reason, and a QFT contains no explicit T gates at all. → Quantum Programming
Not probability 1
$k$ is an integer, so $(2k+1)\theta$ lands *near* $\pi/2$. At $N{=}16,M{=}1$: $k{=}3$, $P = 0.9613$. High probability, and repeat if unlucky. → Quantum Programming
Not required:
Quantum mechanics. The book builds what it needs. - Physics background of any kind. - Access to quantum hardware. Everything runs on a simulator; Chapter 39 measured local simulation at the same order of magnitude as hardware *execution* time. → Overview: Teaching from This Book
Note that the parameter count does not change
16 in every case. The entangling layer has no parameters; only the cost and the connectivity change. → Quantum Programming
Note the counts exceed $n-1$ in both cases
one redundant shot each, which is the phenomenon the fixed-count version cannot survive. → Quantum Programming
`Operator(ctrl-p) == Operator(ctrl-q)` is `False`. - **Bisection localizes a bug in $\lceil \log_2 n\rceil$ comparisons: 13 for Chapter 23's 3,368-gate Shor circuit, 26 for a 20-million-gate one.** - ★ **Bisecting on states from $|000\rangle$ found nothing** — and neither did $|{+}{+}{+}\rangle$. Bo → Quantum Programming
but the arithmetic is close, it depends entirely on the circuit and the device, and on a deeper circuit with worse gates it would flip. → Quantum Programming
once
and $a^{2^j}\bmod N$ is a classical constant, obtained by $j$ modular squarings on the laptop driving the experiment. → Quantum Programming
One enormous coherent computation
$2^{64}$ iterations with AES inside each. - Chasing the second peak for 0.03 more probability at 3× cost. → Harvested measurements
ten qubits reading ten independent numbers. That genuinely spreads the state across Hilbert space, and concentration is severe: a several-hundred-fold collapse. → Quantum Programming
the same index each time, so the sizes are comparable — across many random initializations. → Quantum Programming
Only 0.2%
because 533 ns against a 120 μs coherence time is a very short exposure. This is Chapter 2's Case Study 2 result arriving from the other direction: for a *shallow* circuit, decoherence is a minor term and readout dominates. It becomes the dominant term for deep circuits, which is what Chapter 29 is → Quantum Programming
open access
token, run today. That is the basis of Chapter 2 and every hardware result in this book. **Google's service has historically run through research partnerships**; check current terms. **Learn and simulate in Cirq; expect to touch hardware through Qiskit.** A statement about access policy, not quality → Quantum Programming
OpenFermion
the chemistry library built on Cirq. If your interest is [Chapter 36](../../part-07-applications-and-career/chapter-36-quantum-chemistry-vqe/index.md)'s territory, this is the strongest reason to use Cirq specifically. *Tier 1.* - **Qsim**, Google's high-performance simulator. Substantially faster t → Quantum Programming
operation
a gate bound to qubits — which is a first-class value you can store in a list, pass around, and reuse. Qiskit's `qc.h(0)` **mutates** the circuit and returns an instruction-set reference. The difference is why Cirq circuits feel like data and Qiskit circuits feel like builders. → Quantum Programming
optimal parameters
the exact answer, already found — and simply *evaluate* the energy with a finite shot budget: → Quantum Programming
Optimization has the best claim to being valuable
routing, scheduling, portfolio selection, and circuit layout are the problems companies actually pay to solve, and the Quantum Approximate Optimization Algorithm is the near-term proposal for solving them. → Quantum Programming
optimum
same cut, two ratios | | GW guarantee | **0.87856 of the optimum**, proven, polynomial time, every graph | | QAOA mean ratio, $p=1 \to 5$ | 0.751 → 0.812 → 0.852 → 0.873 → **0.907** | | Landscape variance, $p=1 \to 4$ | std **0.000 → 0.021** | | $P(\text{optimal})$, $p=1 \to 5$ | 0.020 → **0.388**, → Harvested measurements
Other findings:
**The state is not the answer.** QAOA mean E[cut]/OPT = 0.891 (ABOVE the guarantee) while single samples returned 9 and 11 against OPT=13. Ch.30 §30.5's refusal with a graph attached. - **Say the denominator.** 0.5 of edges = 0.577 of optimum, same assignment. "QAOA achieves 0.9" is meaningless alon → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Other verified results:
**BK does NOT reduce the term count** — 631 for both mappings on LiH. It reduces **Pauli weight**: JW mean 6.16 / max 12 (tail of 28 full-width strings), BK mean 5.62 / max 10. **Modest at 12 qubits** — the O(n) vs O(log n) separation needs more qubits to show. - **The baseline is CCSD(T)** (O(n^7), → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Overfitting
36 parameters on 28 training samples. **Both numbers should be reported**; quoting only the 1.0000 would be the failure Chapter 33 §33.3 and Chapter 34 §34.6 both catalogued. → Quantum Programming
own geometry
`is_adjacent(GridQubit(3, 5))` returns `True` without consulting any device object. A Qiskit qubit index knows nothing; adjacency lives in a separate coupling map. `cirq_google.Sycamore` carries **topology** (54 qubits, 88 coupling pairs) but → Quantum Programming
which PennyLane 0.45.1 also accepts, as `mapping="parity"` — is the other endpoint: qubit $j$ holds the cumulative parity up to $j$, so parity is free and occupation becomes the $\mathcal{O}(n)$ quantity. Neither endpoint helps, because a Hamiltonian term needs both. → Quantum Programming
Part V is not optional
it is what distinguishes this course from every other quantum computing course, and cutting it produces students who can build circuits and cannot evaluate them. → Syllabus: One-Semester Quantum Programming Course
Passes too
and by now the reason should be familiar. Every control is in $|0\rangle$, so the wrong angle never fires. This is Chapter 26 §26.4's blind spot appearing as a *test* rather than as a debugging session. → Quantum Programming
Pauli weight
mean 6.16 → 5.62, max 12 → 10 — which sets measurement-circuit depth per term. The improvement is modest at 12 qubits because the $\mathcal{O}(n)$ versus $\mathcal{O}(\log n)$ separation needs more qubits to show. → Part 07
PEC
learn the noise channel, express its inverse as a signed combination, sample and reweight. → Quantum Programming
PennyLane
the framework Part VI is written in. - **scikit-learn** — the baselines. `LogisticRegression`, `SVC`, `kNN`, `RandomForest`. **Chapter 32–35 measured quantum models tying or losing to these on every dataset.** - **TensorFlow Quantum** — Cirq-based; less active than it was. → Appendix H: The Quantum Software Ecosystem
PennyLane's `qml.qaoa` module
what this chapter's examples use. *Tier 1.* - **`cvxpy` with SCS or Clarabel** — the SDP solver behind §37.5. Note that `cvxpy` is an extra install for this chapter. *Tier 1.* - **`networkx`** — graph construction and the instance families. *Tier 1.* - **Qiskit Optimization** — IBM's QUBO/Ising stac → Quantum Programming
PennyLane's `qml.qchem` module
what this chapter's examples use. *Tier 1.* - **PySCF** — the classical quantum-chemistry package most quantum workflows call for integrals, and the tool you would use for the CCSD(T) baseline. *Tier 1.* - **OpenFermion** — Google's library for fermionic mappings and Hamiltonian manipulation. *Tier → Quantum Programming
perfect syndrome extraction
that the CNOTs and Toffolis measuring the syndrome are themselves noiseless. They are not. Those gates are made of the same hardware as everything else. → Quantum Programming
physical qubit
a specific location on the chip, not a logical wire. The register is gone because the mapping has been made. This is the transpiler's layout decision, written down, and it is exactly the information Chapter 4's Case Study 1 said you must record with every result. → Quantum Programming
placing the key in the clear at every hop
★ **The wall does not move with the source rate at all** — 240.3514 km at $10^9$, $2\times10^9$ and $10^{12}$ pulses/s, because per-gate dark counts scale with the signal. **Each decade off the dark-count rate buys exactly 50 km**; halving the optical error buys **1.1 km** - **92.8% of the errors at → Quantum Programming
polynomial time,
at any size
track $n$ Pauli generators ($O(n^2)$ bits), never write down the state. → Quantum Programming
Predicted at five. Measured at five
T=4 is `trivial 1-to-1` at 180 qubits, T=5 is `15-to-1 space efficient` at 1,962. The same calculation at $10^{-3}$ gives $0.0005/10^{-3} = 0.5$, so distillation is required from the *first* `T` gate, which is precisely the cliff §15.8 opened with. → Quantum Programming
`SamplerV2` and `EstimatorV2` — which are the modern interface for asking a quantum computer a question. [Chapter 7](../../part-02-qiskit-in-depth/chapter-07-qiskit-architecture/index.md) covers it properly. → Quantum Programming
Prioritize by data lifetime.
**Next:** [Chapter 24](../chapter-24-variational-algorithms/index.md) — variational algorithms, and a deliberate change of register. Shor needs a fault-tolerant machine nobody has. VQE and QAOA are designed for the hardware that exists, which means Chapter 16's barren plateaus, Chapter 13's mitigati → Quantum Programming
the function is guaranteed constant or balanced. → Part 04
Proven separations exist, on constructed problems
learning tasks a quantum learner solves efficiently and a classical one cannot, under standard assumptions. Real theorems, and without exception about problems built to exhibit the separation. → Quantum Programming
the classical workhorse. Integrals, Hartree–Fock, and the CCSD(T) baseline you must beat. - **PennyLane `qml.qchem`** — what Chapter 36 used; builds qubit Hamiltonians in one call. - **OpenFermion** — Google's fermionic mappings and Hamiltonian manipulation. - **Qiskit Nature** — IBM's chemistry sta → Appendix H: The Quantum Software Ecosystem
Q
Q# is a language
with a type system, a compiler, and opinions. That difference produces two things nothing else in this book has. → Quantum Programming
q0 has the better $T_1$ and the worse $T_2$
these are independent quantities, and assuming one tracks the other is a common and costly error. → Quantum Programming
QASM ALSO DROPS (both re-confirming Ch.6):
global phase **1.047198 -> 0.000000** (LOST). NOT cosmetic: becomes a RELATIVE phase when controlled. - parameter names `['theta[0]','theta[1]']` -> **`['_theta_0_','_theta_1_']`** (note LEADING underscore) → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Qiskit
integer indices into a register. - **Cirq** — `LineQubit`, `GridQubit`, `NamedQubit`; qubits are *objects with device-relevant identity*, which is why Cirq circuits carry topology naturally. - **PennyLane** — `wires`, which may be integers or strings. - **Q#** — allocated in a `use` block, released → Appendix E: Framework Translation Dictionary
Qiskit 2.5.1
nothing in core. Searching the top-level namespace for anything gradient-related > returns an empty list. You get `Parameter`, `assign_parameters`, and the `Estimator` primitives, and > then you write the parameter-shift bookkeeping yourself or install the separate `qiskit-algorithms` > package for → Quantum Programming
rightmost character is qubit 0 — and with multiple registers the last-declared appears leftmost. Mismatched `measure` lists are legal and silently bit-reverse your results. **Test with asymmetric states**; symmetric ones cannot detect ordering bugs. → Quantum Programming
Qiskit's dynamic circuits documentation
mid-circuit measurement, `reset`, and `if_test`. Chapter 9's material, applied here as a width-for-depth trade. *Tier 1.* - **Work on qubit-reuse compilation** (circuit-knitting and measurement-based reuse). Automated versions of Exercise 29.26. **Genuinely useful when qubit count rather than depth → Quantum Programming
a quantum circuit wrapped so that it behaves like an ordinary differentiable Python function. You can take its gradient. You can pass it to a PyTorch optimizer. You can put it inside a `torch.nn.Module` as a layer. The gradients are exact, computed by the **parameter-shift rule** rather than by back → Quantum Programming
QRAM
a hypothetical device loading a classical vector in $\mathcal{O}(\log N)$ time. It would resolve this completely. **It does not exist**, no credible proposal exists for building one at scale, and several analyses argue that a QRAM robust enough to be useful would itself require error correction, at → Quantum Programming
Quadratic, not exponential
and Chapter 20 §20.5 hinted at why that is not an accident. Aaronson and Ambainis proved that exponential speedups *require* promise structure; for a total function like unstructured search, the gap can be at most polynomial. **Grover is optimal**: no quantum algorithm does unstructured search in fe → Quantum Programming
Qualifications:
**Parallelizes poorly** — $p$ machines give $\sqrt p$, where classical brute force gives $p$. - **One enormous coherent computation** — $2^{64}$ iterations with AES inside each. - **It does not break AES the way Shor breaks RSA** (Ch. 15 CS1: ~25M qubits, and RSA falls outright). → Quantum Programming
Quantum data saves every encoding gate
57 per sample at 6 qubits, against zero. 2. The saving grows exponentially with qubit count. 3. Nonsense arguments are rejected. 4. **The saving reports whether it is checkable**: 128 real numbers at 6 qubits, unwritable at 50. 5. **`quantum_data_verdict` returns `CLASSICALLY_CHECKABLE` below the bo → Quantum Programming
qubit 72, whose readout is 9.72% wrong
a 3.87% relative loss on the readout term. The extended model predicts the transpiler's layout ahead by $+0.0172$. → Quantum Programming
they are stated as structural facts with representative values, > and labelled where they appear. Circuit durations, calibration spreads, and layout fidelities *are* > measured, from real backend calibration data. Prices are published list rates that change; what is > durable is the **structure**, w → Quantum Programming
queue times are NOT measured
stated as structural facts with representative values, labelled where they appear. Circuit durations, calibration spreads and layout fidelities ARE measured from real backend calibration data. Prices are published list rates carried with an `as_of` date. → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
R
Randomized benchmarking and cycle benchmarking.
Ch. 26 - **Recent work on classical simulability of circuits that avoid barren plateaus.** — Ch. 16 - **Recent work on quantum low-density parity-check codes** — Ch. 25 - **Regina Nuzzo, "Scientific Method: Statistical Errors" (2014), *Nature* 506, 150.** — Ch. 5 - **Renner, "Security of Quantum Key → Bibliography
rank 2 where it should have rank 4
exactly one qubit's worth of information missing, which is precisely correct, since one of the two qubits reports nothing. → Quantum Programming
rates
logical qubits per physical qubit — because that is the number that multiplies into every resource estimate in Chapter 15: → Quantum Programming
Ratio 1.12
for a one-line estimate ignoring readout, decoherence, crosstalk and single-qubit error. → Quantum Programming
ratio of 0.44
far outside anything device noise can explain on a two-qubit circuit. Chapter 2's Case Study 2 established that a shallow two-qubit circuit loses a few percent to noise; losing 56% means something structural is wrong. → Quantum Programming
Read Bravyi–Kitaev for
what it actually claims
the $\mathcal{O}(\log n)$ locality — and notice that it is a claim about *weight*, not about term count. The chapter measured them giving identical 631-term Hamiltonians. *Tier 1.* - **Seeley, Richard, and Love, "The Bravyi-Kitaev transformation for quantum computation of electronic structure" (2012 → Quantum Programming
Read how they test the transpiler in particular
it is the hardest thing in the codebase to test and the techniques are transferable. *Tier 1.* - **`qiskit.quantum_info.random_statevector` and `random_unitary`**, and the Haar measure they sample from. Exercise 27.18 asks whether Haar-random is the best choice for bug-finding; it is worth knowing w → Quantum Programming
Read it against Part VI's scorecard
it is the most thoughtful response to exactly the results these four chapters measured. *Tier 1.* - **Aaronson, "Read the fine print" (2015).** Chapter 32's recommendation, and it holds up completely. *Tier 1.* - **Bowles, Ahmed, and Schuld on benchmarking QML models (2024).** The systematic version → Quantum Programming
Read it as the third pricing
structure
it is the one that most explicitly acknowledges that a shot is not a unit of work. *Tier 1.* → Quantum Programming
Read it for how carefully it hedges
the caution that got stripped out downstream is all present in the original. *Tier 1.* - **Aaronson, "Read the fine print" (2015), *Nature Physics* 11, 291.** Two pages, and it anticipates most of Part VI. *Tier 1.* - **Schuld and Killoran, "Is quantum advantage the right goal for quantum machine le → Quantum Programming
Read it for how modest the claim
is
the authors are explicit about needing an authenticated classical channel, which is the point §38.5 says gets lost downstream. *Tier 1.* - **Ekert, "Quantum cryptography based on Bell's theorem" (1991), *PRL* 67, 661.** The entanglement-based alternative (E91), where security follows from a Bell ine → Quantum Programming
Read it for the
rounding analysis
the geometry of the random hyperplane argument is genuinely beautiful, and understanding it is what makes §37.7's certificate obvious rather than surprising. *Tier 1.* - **Khot, Kindler, Mossel, and O'Donnell on the optimality of the GW bound under the Unique Games Conjecture.** If UGC holds, **0.87 → Quantum Programming
Read it for the concatenation idea
§25.5's structure is right there. *Tier 1.* - **Steane, "Error correcting codes in quantum theory" (1996), *Physical Review Letters* 77, 793.** The $[[7,1,3]]$ code — same distance, two fewer qubits. *Tier 1.* - **Calderbank and Shor (1996) and Steane (1996) on CSS codes.** The construction that tur → Quantum Programming
Read it for the method of
argument
it is a lesson in what "speedup" means when the input model differs. *Tier 1.* - **The dequantization follow-ups** — Chia, Gilyén, Li, Lin, Tang, Wang and others, extending the technique to principal component analysis, supervised clustering, and low-rank linear algebra generally. **The common struc → Quantum Programming
Read it for the motivation
the algorithm was designed specifically to fit devices that cannot run phase estimation, which is the constraint §36.8 says still binds. *Tier 1.* - **Aspuru-Guzik, Dutoi, Love, and Head-Gordon, "Simulated quantum computation of molecular energies" (2005), *Science* 309, 1704.** The phase-estimation → Quantum Programming
Read it for what "gold standard"
means
it is a specific empirical claim about chemical accuracy on main-group chemistry, not a general one, and knowing where it fails is knowing where the quantum case lives. *Tier 1.* - **Chan and Sharma, "The density matrix renormalization group in quantum chemistry" (2011), *Annual Review of Physical C → Quantum Programming
Read the assumption about the noise spectrum
it is exactly what §31.5 found missing from a Markovian model, stated by the original authors. *Tier 1.* - **Literature on the filter-function formalism for decoupling sequences.** Makes the point quantitatively: a DD sequence is a **high-pass filter on the noise spectrum**, so its benefit depends e → Quantum Programming
Read the twirl derivation specifically
it is where "robust" and "blind" turn out to be the same property. *Tier 1.* - **Magesan et al. on interleaved RB (2012).** How to isolate a *specific* gate's error rather than an average over Cliffords. Exercise 30.17's subject, and the version you actually want when comparing two implementations o → Quantum Programming
Read the two together
the improvement between them is large, real, and made of exactly the constant factors §36.7's mitigation table is built from. *Tier 1.* - **Gonthier, Radin, Buda, Doskocil, Abuan, and Romero, "Measurements as a roadblock to near-term practical quantum advantage in chemistry" (2022), *Physical Review → Quantum Programming
Read this before designing any feature map
and read it against §34.6's correction, because it is careful about exactly the regime distinction I got wrong. *Tier 1.* - **Kübler, Buchholz, and Schölkopf, "The inductive bias of quantum kernels" (2021), NeurIPS.** Argues that expressive quantum kernels need exponentially much data to generalize, → Quantum Programming
Read what a benchmark is insensitive to
it is always stated, usually as a selling point. "SPAM robust" and "cannot see your readout error" are the same sentence. → Quantum Programming
Readable at the right level
low enough to show what runs, high enough to read. Pulse schedules are neither. → Quantum Programming
Readout error dominates shallow circuits
80% of the budget here, three times any other term. It is also the cheapest error to mitigate. 3. **The published per-qubit readout error is an average of two directions**, and the asymmetry it hides is often larger than the number itself. 4. **Do not assume the direction of readout asymmetry. Measu → Quantum Programming
Readout is the largest error channel here
median 0.0198 against 0.0075 for two-qubit gates — with the widest spread (171×), and the standard gate benchmark is designed not to notice it. → Quantum Programming
Readout, by roughly 2.6×
median 0.0198 against 0.0075 for two-qubit gates. It is the largest error channel on this device, has the widest spread, and the standard gate benchmark is designed not to see it. → Quantum Programming
real
the physics works, the engineering is impressive, the open problems are genuine and well-defined — and **oversold**, by a margin this book measured repeatedly and in detail. Both facts are true at once, and most available positions require ignoring one of them. → Quantum Programming
real amplitudes
molecular ground states | | `n_local(...)` | configurable | custom rotation/entangling blocks | | `zz_feature_map(4)` | 4 | **data encoding** — parameters are the data, not free variables | → Quantum Programming
Real cost = 4 sx + 1 ecr = 5 of 12 instructions.
QASM 3 supports free parameters (`input float[64] theta;`); **QASM 2 raises** `QASM2ExportError: 'Cannot represent circuits with unbound parameters in OpenQASM 2.'` - QASM 3 supports `if (c[0]) { x q[1]; }`; **QASM 2 raises** `QASM2ExportError: 'OpenQASM 2 only supports register-equality conditions' → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
real hardware
or on a fake backend built from a real device snapshot — you got the same two peaks plus a few percent of shots in `01` and `10`, states whose amplitude is exactly zero. On a well-chosen qubit pair that residue runs around 2–5%; on a poor pair it can exceed 10%. It is → Quantum Programming
relationship between different inputs
exactly where a wrong controlled-phase > angle lives. > > **Write down the failure mode first, then the property that would break under it.** The other order > produces properties that are true, cheap, elegant, and worthless. → Quantum Programming
relaxation
a superset of the feasible solutions — and a maximum over a superset is an upper bound. §24.5's comparison is that difference of direction, and no amount of hardware improvement changes it. → Quantum Programming
Removed
deprecated across the Qiskit 1.x series and deleted in 2.0. The entire subsystem, the circuit-level attachment points, the backend accessors that supplied the calibration data, and the channel abstractions the schedules were written against. → Quantum Programming
Comfortable Python. Not expert — comfortable. Functions, classes, NumPy arrays, `pip install`. - Linear algebra: matrix multiplication, eigenvalues, complex numbers. Appendix D is the refresher. - **Basic statistics.** This is the one students and instructors both underestimate. Standard error, conf → Overview: Teaching from This Book
restriction
the set of states a parameterized circuit can actually reach. A restriction bounds from the same side that any feasible solution bounds from, and never from the other side. Chapter 37 §37.7.1 states the identical fact for QAOA with the inequality flipped: QAOA maximizes, so its objective is a *lower → Quantum Programming
the chapter's own most flattering statistic, in favour of the side the chapter was already arguing for. That is the only place the rule is ever inconvenient, and therefore the only place it is worth anything. → Quantum Programming
right-skewed
a few very bad elements pull the average up while the median resists them. For readout the mean is **2.1× the median** (0.0415 against 0.0198). → Quantum Programming
rotation by $2\theta$
with **no $k$ in it**, which is why the algorithm cannot slow down near the target. In amplitude terms the same thing reads as inversion about the mean, and the hand arithmetic reproduces every measured probability exactly: **the unmarked amplitude goes negative at $k=3$, the mean goes negative at $ → Quantum Programming
Roughly 20,000×
and that was on an **exact simulator**, with no shots, no sampling, and no noise, the most favourable possible condition. It also reached *lower* training accuracy (0.9714 against 1.0000). → Quantum Programming
roughly 20,000× slower
on a simulator, in the most favourable possible conditions. (The exact ratio moves between runs because the denominator is a two-millisecond measurement; repeated runs gave 20,391× and 22,642×. The order of magnitude is the point.) → Quantum Programming
roughly 40% of them are dropped at every
> size
those are parameters that are structurally unable to affect a $\langle Z_0 \rangle$ > measurement, mostly final-layer rotations on other qubits. > > Chapter 16's version of this mistake produced a beautiful exponential fit to an artifact, 18 orders > of magnitude off, because a systematically-zero g → Quantum Programming
roughly the same in both halves of the
idle window
that is, **the noise must be correlated over the timescale of the sequence**. Real devices have exactly that ($1/f$ flux noise, slow frequency drift, static spectator coupling). A → Quantum Programming
Routing overhead scales with connectivity mismatch
exactly 1.0× for a chain, 1.75× to 3.16× and growing for all-to-all. 4. **A logical gate count cannot rank patterns.** `circular` looks cheap logically (12 vs 30) and has the *worst* routing ratio of all four (3.33×). 5. **Raise the optimization level first.** Level 0 → 2 removed 30% here. Free, nev → Quantum Programming
runnable
basis translation, layout, routing — and it does **not optimize**. Its optimization stage contains zero passes. → Quantum Programming
Running themes advanced:
"summary statistic is a lossy compression" — 3rd instance (Ch2 asymmetry, Ch11 phase damping, now) - "check the pipeline before the physics" — 5th instance - "measure the asymmetry, don't inherit it" — Ch2 CS2 confirmed at 513-qubit scale → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
runs cleanly
`Counter({'Zero': 251, 'One': 249})` — because the > qubit *is* reset before the block ends. > > **A guarantee is only as broad as its statement.** (4th instance: Ch. 11 optimized-away test, > Ch. 12 averaged statistic, Ch. 13 inert DD.) → Quantum Programming
Runs exactly as written
no translation, no routing, no optimization. **The escape hatch Part II lacked** (Ch. 10's unasked-for choices; Ch. 13 CS2's silently-inert pass). Essential for benchmarking (Ch. 30) and QEC circuits that must not be "optimized." → Quantum Programming
S
SABRE
SWAP-based bidirectional heuristic search. It does not > solve the routing problem; the problem is NP-hard, and 147 against a no-reuse bound of 225 is what a > good heuristic looks like. > > The loop, roughly: take the front layer of gates that are not yet executable, score every SWAP > adjacent to → Quantum Programming
SABRE wins here
28 gates against 34, and a depth of 80 against 103. It wins by co-designing the layout with the routing rather than choosing the layout first. → Quantum Programming
Sample the optimized state and keep the best
> `p=3: mean 3.9918, BEST sampled cut 4, optimum in 99.5% of shots` — then **verify classically**. > A Las Vegas procedure, like Ch. 23's Shor: the quantum part proposes, verification disposes. → Quantum Programming
Sampled tests cost 250–3,000× exact ones.
Unitary equality is $\mathcal{O}(4^n)$ and takes **16.5 s at 12 qubits**; twenty random statevectors take **74.8 ms** at the same size. Crossover around 9 qubits. - ★ **Three of four oracle-free properties pass a definitely-broken QFT**: $UU^\dagger = I$, unitarity, and $\text{QFT}|000\rangle$ unifo → Quantum Programming
Sampler
returns measurement outcomes. What you want for QAOA sampling, BB84 simulation, or anything where the bitstrings are the answer. - **Estimator** — returns expectation values of observables. What you want for VQE, where Chapter 36's 1,086 Hamiltonian terms are the natural unit rather than shots. → Quantum Programming
sampling noise
you took 4,096 samples from a fair coin, and 2074/2022 is an entirely ordinary result. Not a defect; the expected fluctuation in each count is on the order of $\sqrt{4096}/2 = 32$, and each count sits 26 away from 2048. Chapter 5 §5.4 makes this precise. → Quantum Programming
scratch register
the marked term moved to a basis state with the scratch at 1 (index 7). It is useless because measuring the scratch collapses the superposition and yields one random $x$ with its $f(x)$, which is no better than evaluating $f$ classically on a random input. → Quantum Programming
the docs are the only way to know what you are turning on. *Tier 1.* - **The Qiskit `transpiler.passes` documentation for `PadDynamicalDecoupling` and the scheduling analysis passes.** Read `skip_reset_qubits` and the ALAP/ASAP distinction carefully; Case Study 2 exists because their interaction sil → Quantum Programming
Set an alert on the negative-results authors
the people who published barren plateaus, kernel concentration, and dequantization. They are the ones whose next paper will change what you believe. *Tier 1.* → Quantum Programming
Set up a standard hardware-efficient ansatz
`StronglyEntanglingLayers`, six layers — on increasing numbers of qubits. Initialize the parameters **randomly**, as you would with no better idea, and measure the *variance* of the gradient across many random initializations. → Quantum Programming
Seven files per chapter
the chapter, exercises, a quiz, two case studies, a one-page reference, and tiered further reading — plus a `code/` directory with everything runnable. → Quantum Programming
**Next:** [Chapter 25](../chapter-25-quantum-error-correction-in-code/index.md) — Part IV closes with the thing that changes all of this. Chapter 15 priced fault tolerance and Chapter 23 needed it; this chapter builds it: the three-qubit codes, the surface code, syndrome extraction, and a measuremen → Quantum Programming
shot budget, barren plateaus, hardware noise
all bind long before the classical methods run > out, and the first one binds by a factor of $10^8$. → Quantum Programming
Shot count must be
justified
full credit requires the student to say why they chose it, referencing the size of the difference they hoped to resolve. → Answer Keys for All Exams
Shot noise is not "noise" in that sense
it survives > the removal of all hardware noise and disappears only when you remove *sampling*, which the default > simulator does silently. > > **The corrected check has three levels, not two:** > > ```text > exact simulator -> tests the ALGORITHM > noiseless + finite shots -> tests the SHOT BUDGET → Quantum Programming
Signature: symmetric, and roughly $2p$
because either of the two qubits can be misread, and a single misread is enough. Compare Chapter 2's Case Study 2, which derived exactly this. → Quantum Programming
significantly worse
$-0.0053 \pm 0.0012$, 4.4 standard errors — which is a real, reproducible negative result, and it is only measurable because the pulses reached the device. A compiler that applies $X \cdot X = I$ deletes the experiment and the finding with it. → Quantum Programming
silently discards the global phase
harmless *except* when the circuit is later used as a controlled operation, where an unobservable global phase becomes an observable relative phase (phase kickback). Measured, that inverted the answer: `{'1': 1757}` became `{'0': 1758}`. → Quantum Programming
Simon's algorithm goes further
it is the first *exponential* separation, and it is the direct ancestor of Shor's (Chapter 23). → Quantum Programming
Simon's does
survive
its $\Theta(2^{n/2})$ classical bound holds for randomized algorithms too — which is the second reason it, and not Deutsch–Jozsa, is Shor's ancestor. → Quantum Programming
simultaneously
non-commuting observables cannot have simultaneous eigenvalues, so there would be no well-defined syndrome, and measuring one would disturb the other. → Quantum Programming
singular
mitigation is not merely ineffective but mathematically impossible. - Dynamical decoupling in its default configuration did **nothing at all**, and when forced to engage made the result **worse** by 6 percentage points. → Quantum Programming
singular — rank 2 of 4
and mitigation is impossible, not merely ineffective: **you cannot invert information that was destroyed.** And it costs $2^n$ calibration circuits, which is a million at 20 qubits — use tensored mitigation or M3. → Quantum Programming
So level 2 contributes nothing to the retry count
provided the loop actually reads more than one outcome. The chapter's implementation does: → Quantum Programming
note the runtime nearly tripling as the qubit count drops, which is Chapter 15 §15.8's T-factory saturation in a new guise. **The fix:** a QFT's rotations are largely sequential, so set `rotationDepth ≈ rotationCount`, and the cost becomes monotonic in both columns. → Quantum Programming
Speed
ion gates take microseconds against superconducting nanoseconds, roughly **100× slower**. It matters most for **variational workloads**, which run thousands of circuits (Chapter 16 §16.4: $2n+1$ executions per gradient, on every iteration), so wall-clock time dominates regardless of connectivity adv → Quantum Programming
spread
at $n=4$, all sixteen outcomes, 76% on all-zeros plus a long thin tail. The standard rule misses it because it collapses the histogram to one scalar and then applies a → Quantum Programming
and it is the honest standard for a teleportation experiment. Chapter 26 §26.8 does tomography properly, including why it costs exponentially many measurement settings for many qubits. → Quantum Programming
$0.8313 \pm 0.0381$ against Chapter 33's $0.8343 \pm 0.0407$. It implies that **the convexity advantage is real and did not produce a better classifier**: it removed the optimization problem, and the optimization was not what limited the result. → Quantum Programming
Steane does it with 7 qubits instead of 9
better. Finding codes like that systematically is what the stabilizer formalism is for. → Quantum Programming
step 1
preflight | bad layout | | **C** | 0.4897 | **step 2** — noiseless sim | **BUG** | - Thresholding on the **averaged** readout error (passes a stuck qubit at 0.5). - Readout error ranges from 0.29% to **50%** — a factor of **171**. - Two-qubit gate error ranges from 0.35% to **100%** — a factor of ** → Harvested measurements
step 1 had already fired
preflight caught the stuck qubit and two dead ECR pairs before any modeling was done. The procedure is ordered so that cheap, unambiguous checks come first and the subtler, interpretation-dependent ones are never load-bearing. The general rule: **when an early step gives a clean answer, stop**; do n → Quantum Programming
Step 3 is Chapter 4 §4.5's Bell measurement
`cx` then `h`, the entangling circuit run backward, which maps the four Bell states onto the four computational basis states so that a measurement can distinguish them. → Quantum Programming
Step 3 is the one people skip
Bell and GHZ states are symmetric under bit reversal and prove nothing (Ch. 14 CS1). → Quantum Programming
Step 3 is the step with no classical analogue
evaluating $f$ on a superposition is easy and useless; making the answers interfere is the mechanism. → Quantum Programming
stepping debugger
the state after any number of operations — and it is what bisection searches over. → Quantum Programming
Stilck França–García-Patrón
noise limits on variational optimization | 37 | | 2021 | **Von Burg et al.** — a much improved catalysis estimate | 36 | | 2022 | **Huang et al.** — proven advantage in *learning from experiments* | 35, 40 | | 2022 | **Gonthier et al.** — measurement as the roadblock in chemistry | 36 | | 2022 | **S → Appendix J: A Timeline
Stim
Clifford simulation for QEC, extremely fast. The standard tool. - **PyMatching** — minimum-weight perfect matching decoder. - **Union-find and neural decoders** — the real-time decoding frontier, and Chapter 40 §40.1's highest-demand skill. → Appendix H: The Quantum Software Ecosystem
stop
do not keep walking down the list collecting evidence > that needs interpreting. → Quantum Programming
structural argument
$p=4$ contains $p=3$ | | 38 | Working the arithmetic on a claim rather than quoting it | | 39 | Testing on a real-size circuit after a toy one | → Quantum Programming
structure of $f$
which is why each algorithm assumes a different structure and reads off a different thing. → Quantum Programming
pure routing overhead, moving quantum information to positions where the lattice permits interaction. They contribute **error and duration and nothing else**; the algorithm never asked for them. → Quantum Programming
one random hyperplane per instance. Which is precisely the protocol §37.4 just spent a section warning about, applied to this chapter's own headline number. So it was re-measured: the same ten SDP solutions, 1,000 hyperplanes each. → Quantum Programming
depolarizing error would not tilt, and readout error would not grow with circuit duration at all. → Quantum Programming
that is
exactly the trade you want
a weaker claim than "one qubit beats four," fully supported, and more useful because it is about resources. → Quantum Programming
That is a real
improvement and it is still a wall
it shortens the trusted-node chain rather than removing it, and a 2,000 km link would still need five relays holding the key in the clear. Only item 1 removes the category. → Quantum Programming
That is a real and useful result
it is just not the result the single split > suggested. > > This is the third time in this book that a conclusion drawn from one or two samples did not survive > replication: Chapter 27's 2/200 estimating a 0.15% rate, Chapter 28's two circuits agreeing on > optimization levels, and now this. **The → Quantum Programming
That is itself a sampling
problem
the same one Chapters 27, 28, 33, 34, 37, 38, and 39 committed. Design a selection procedure that would not be vulnerable to it, then say honestly whether applying it would change the conclusion. → Quantum Programming
That is not pedantry
it is the difference between "our method works" and "our method wins," and Part VI's scorecard exists because the second claim was made in several places where only the first was supported. → Quantum Programming
the classical update runs next to the device so the loop closes without a round trip. *Tier 1.* - **Chapter 31's coherence budget and Chapter 33's inference bill.** Together they are the production cost model: circuit time is microseconds, queue latency is seconds, and shots are forever. *Tier 1.* - → Quantum Programming
The
circuit needs five qubits at once
three data, two ancillas — because the syndrome has to be written somewhere. Ancillas can be reset and reused between rounds, which is why the rate convention counts only data qubits; but at any given instant the hardware is holding five, and a machine sized from a rate table will be short. → Quantum Programming
**Reproduce it:** `code/example-03-five-frameworks.py` runs the same circuit in all five; `vqelab/topology.py` (Ch. 17) and `vqelab/variational.py` (Ch. 16) are the tools this team should have reached for first. → Quantum Programming
Ch. 3 - **The "parse, don't validate" essay and its descendants.** — Ch. 7 - **The "rule of three" for zero-event confidence bounds.** — Ch. 27 - **The 2022 Nobel Prize in Physics scientific background document (Aspect, Clauser, Zeilinger).** — Ch. 4 - **The `approximation_degree` documentation and → Bibliography
The $Y$ measurement is decisive
the impostor has no phase, so its $Y$ component is $+0.0007$, statistically indistinguishable from zero, while the real state's is $+0.62$. That is a discrepancy of **56 standard errors**. One extra basis and the two circuits separate beyond any doubt. → Quantum Programming
`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. *Ti → Quantum Programming
The `Target` API documentation
`target.dt`, `target[gate][qubits].duration`, and `qubit_properties[q].t1/.t2`. **This is where every number in §31.1 and §31.2 comes from**, and it is the supported replacement for what `backend.defaults()` used to provide. *Tier 1.* - **Qiskit's scheduling documentation** — `ASAPScheduleAnalysis`, → Quantum Programming
The advantage is in step 3
the Hadamard layer computes a *sum* over all $2^n$ inputs into a single amplitude, and "is that sum zero?" is a **global** property. The measurement returns **one bitstring**, not $2^n$ answers. → Quantum Programming
> which is exactly why §36.5's circuit is built from `SingleExcitation` and `DoubleExcitation` gates > rather than generic rotations, since those preserve particle number by construction. And §36.6's > exact diagonalization is diagonalizing the full $4{,}096\times4{,}096$ matrix when the answer live → Quantum Programming
The bracketed sum is everything
whether $\pm1$ terms add or cancel depends on the *structure* of $f$. **Step 3 has no classical analogue.** → Quantum Programming
The bug was in an input to the formula
a value that was correct for the test case and wrong for the real one, hard-coded because in the test case it was obviously 1. → Quantum Programming
The cheapest optimization is not needing one
matching your circuit's interaction graph to the chip's is worth more than any amount of transpiler effort applied afterwards. → Quantum Programming
The classical-simulation rebuttals
tensor-network approaches from the IBM, Alibaba, and Chinese Academy of Sciences groups, among others. **Read at least one alongside the original**; Exercise 30.30 asks exactly this, and the exercise of tracking what was claimed against what was later simulated is the most useful thing in this secti → Quantum Programming
The default did NOTHING
`skip_reset_qubits=True` + ALAP (schedules late) put the idle period at the *start*, on still-in-reset qubits. DD skipped all of it. → Quantum Programming
The exact boundary is $f = 0.440111$
the > largest fraction Eve can tap and stay invisible in principle — and rounding the threshold down moves > that boundary in the direction that flatters the defender. → Quantum Programming
The extra
qubits buy confidence, not precision
roughly 6 extra for 99%, and the overhead is a **constant independent of $m$**, which is why the scaling stays clean. → Quantum Programming
The final sentence
the "quantum-safe roadmap" — is a different move again. It gestures at post-quantum cryptography, which is a genuine and urgent concern, in a way that implies the company's *quantum computer* is relevant to solving it. It is not. Post-quantum cryptography is classical cryptography designed to resist → Quantum Programming
The final states are identical
verified with `np.allclose`. Same gates, same result, three times the depth. → Quantum Programming
The fluent API chains
`Circuit().h(0).cnot(0, 1)` — and result types attach to the circuit (`probability`, `state_vector`, `expectation`, `amplitude`), returning exact values at `shots=0`. → Quantum Programming
a definition cannot be derived mechanically — so nothing was checking it, and the expansion pass added `key_terms` to chapter front matter that it never defined. Twelve were genuinely missing: `Born rule`, `Clopper–Pearson interval`, `concurrence`, `confidence interval`, `framework selection`, `mult → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
The good failure mode is
an error
a non-native gate or unavailable qubit pair is rejected outright. **The bad case is a circuit that runs correctly and is slower or noisier than necessary**, which nothing reports. → Quantum Programming
The gradient bill grows
$2n+1$ executions per iteration, so 4→18 parameters is 9→37 executions. (b) **The landscape gets flatter** — larger ansätze are wider, moving toward the barren plateau. (c) **The answer gets slightly worse** — 6.66e-16 for 4 parameters against 6.32e-08 for 18, because more parameters means more dire → Quantum Programming
The hand-chosen layout lost by $-0.2326$
a catastrophic regression, from a change that looked like pure improvement and produced a *shallower* circuit. → Quantum Programming
The hardware-efficient ansatz
$R_y$ layers alternating with CNOT layers — is the structure the project carries to Chapter 36. Its logical depth understates its cost by roughly a factor of three, but most of that is free `rz` gates. **The number to watch is the two-qubit gate count**, which is $(n-1) \times \text{reps}$ for linea → Quantum Programming
The histogram
names the broken qubit
information that the scalar "correct fraction 0.2844" discards entirely. → Quantum Programming
The inference cost is 27.8 QPU hours every month
so the model spends more on inference in its second month than it ever spent on training, and continues to do so for its entire operational life. → Quantum Programming
The information is somewhere, but nowhere local
so a noise process that acts > locally, on one qubit at a time, cannot reach it. → Quantum Programming
The information was
never in the qubit Alice sent
it was in the correlation, and her one qubit is merely the half Bob was missing. → Quantum Programming
which are exactly the observables §35.5 spends its shot budget estimating. → Quantum Programming
The literature on qubit-wise commuting grouping
search "measurement reduction VQE" or "Pauli grouping." Case Study 2's observation that an Ising Hamiltonian needs exactly one basis is the trivial case; the general problem is a graph-colouring problem and an active area. *Tier 2* — read recent work. - **Any good introduction to Monte Carlo estimat → Quantum Programming
the marketing-number problem
a single "fidelity" figure vs Ch.12's 288x spread; calibration DRIFT (how much does a good qubit stay good?). Probe: pull the full calibration record from FakeSherbrooke — distributions, not medians; compare median/mean/worst; compute what a quoted "99.2% 2q fidelity" implies for a 100-gate circuit → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
Gidney & Ekerå's figure was >1 order of magnitude below earlier estimates, **entirely through better constructions**. → Quantum Programming
the order you listed the qubits
convenient > for diagrams. **Neither will change.** Convert at exactly one boundary. → Quantum Programming
the p95 qubit carries 0.37
bits
it has not degraded gracefully, it has lost nearly two-thirds of its capacity, and there are enough of those that a random 8-qubit layout has a fair chance of touching one. → Quantum Programming
The parameter-shift rule has no step size to tune
$\pi/2$ is a *large* shift, which is why it survives on noisy hardware. → Quantum Programming
The price is that the speedup is quadratic
$\mathcal{O}(\sqrt N)$ against $\mathcal{O}(N)$ — and that is provably **optimal**, not a weakness. Aaronson and Ambainis proved exponential speedups require promise structure. → Quantum Programming
The QFT is exactly the discrete Fourier transform
verified against the DFT matrix to $10^{-10}$ at $n = 2, 3, 4$ — built from $n$ Hadamards and $n(n-1)/2$ controlled phase rotations plus a swap layer. → Quantum Programming
the queue
time was never measured
this environment has no provider credentials, and the chapter says so in a callout at the top. → Quantum Programming
The queue is the product
at a five-minute queue, utilization is 2.31 × 10⁻⁵. → Glossary
The radius is 1 identically
not approximately, not for the examples we happened to pick. Every normalized single-qubit state lands exactly on the surface, which is why the numbers in the next subsection come out to `1.0000` every time without anyone arranging it. → Quantum Programming
The ratio is a stable ~3×
Chapter 3 §3.8's arithmetic applied uniformly. Most of the added depth is **free `rz`**. **The number to watch is the two-qubit count**: $(n-1)\times d$ for linear entanglement, and it is what consumes the error budget. → Quantum Programming
The remaining difficulty is entirely hardware
four to five orders of magnitude in physical qubit count — **not algorithms.** → Quantum Programming
The reproducibility literature in machine learning
seed variance, single-run reporting, and benchmark selection. **Case Study 39.2's failure is a solved problem there**, and quantum computing has not adopted the solution. *Tier 1.* - **Feynman's "Cargo Cult Science" (1974 Caltech commencement address).** Short, free, and the clearest statement of th → Quantum Programming
the router inserted SWAPs
three CNOTs each — because it needed to connect qubits that are not physically adjacent. This is Chapter 4 §4.6's hidden cost, made visible, and it is usually the single largest difference between a good layout and a bad one. → Quantum Programming
The scaling is the durable part
$4^n$ is arithmetic, not benchmarking, and the > measured ratios track it to within 20%. > > It also does not say the operator test is a bad idea. It says the opposite: at 10 qubits an > input-independent, never-blind equality check costs half a second, which is nothing at all for what > it buys. Th → Quantum Programming
`{'1': 4096}` for seeds 1234, 7, and 99 alike — which shows nothing is being sampled; it is deterministic. → Quantum Programming
the shot budget
$1/\epsilon^2$ times $2n+1$ times iterations, running to billions, with no known technique changing the exponent; (2) **barren plateaus** — gradient variance halving per qubit, roughly $10^{15}$ shots per gradient at 50 qubits; (3) **hardware noise** — a 288× gate-quality spread, mitigation overhead → Quantum Programming
variance really does grow with $p$ — which is precisely what made the wrong conclusion survive. → Quantum Programming
The syndrome measurement is deliberately blunt
sharp enough to name the error's coset, blunt > enough never to reach inside it. Pauli errors on $n$ qubits carry $2n$ bits of information; the > syndrome extracts $n-k$ of them and leaves the rest, which is where the logical information lives. > > **And the bluntness buys something the chapter has → Quantum Programming
The techniques are transferable
quantum kernels (Ch. 34) have a clean mathematical story. - **The negative results are load-bearing.** Barren plateaus, the input problem, dequantization are among the most useful things learned in the last decade, **by people trying to make QML work. A field that produces sharp impossibility result → Quantum Programming
The theorems are real
Deutsch–Jozsa's separation is exact and provable; Simon's exponential separation is foundational. → Quantum Programming
the three wrong conventions are detectably wrong
so the trap is documented in executable form rather than in a comment nobody reads. → Quantum Programming
the transpiler needs somewhere to put ancillas
rather than naming one specific synthesis. A 6-control gate in a 7-qubit circuit costs 12,002 T gates; in a 12-qubit circuit, 39. → Quantum Programming
the transpiler picks good qubits
`VF2Layout` scores embeddings against the full error record, so a transpiled circuit lands on the better part of the distribution. The median describes the qubits you *get*, not the qubits that *exist*. → Quantum Programming
The virtual Z gate
why `rz` takes zero time and is exactly error-free, and why the $\{$`rz`, `sx`, `x`$\}$ basis looks the way it does. **Short, and it explains the most surprising number in the chapter.** *Tier 1.* - **Any treatment of the cross-resonance interaction**, which is what `ecr` implements and why two-qubi → Quantum Programming
The wall does not move with the source rate at all
it inspects structure, prunes, and short-circuits. Constraint propagation on 20 bits is not a million blind checks; it is a search tree that a decent solver prunes to a tiny fraction. → Quantum Programming
they are dead
and T1 spans 15.2 to 483.0 µs. Which physical qubits you get is a first-order determinant of your result, and the platform assigns them at execution time. → Quantum Programming
They lose on qubit count
~30–50 against ~100–1000+ — which is a harder constraint than any of the above, because it is not a trade at all. → Quantum Programming
This book never runs CHSH
Case Study 2's two-correlator witness is a simpler relative of it, and Chapter 38 §38.6 notes the family resemblance while measuring something else. Read Bell's original once for the argument's shape, then run Case Study 2's witness for a number you can defend. *Tier 1.* - **Clauser, Horne, Shimony, → Quantum Programming
This chapter cannot tell you which
that would require measured queue data this environment has no credentials to obtain. But the two branches recommend opposite actions. If the queue is compute-bound, paying for reserved capacity buys you a real resource. If it is overhead-bound, reserved capacity buys you a device that will still sp → Quantum Programming
Liu, Arunachalam and Temme's proven advantage is a kernel result, and the fixed feature map is why the analysis is tractable. **Does not establish:** any practical advantage — it loses to a classical RBF kernel by seven standard errors on the same solver, ties with Chapter 33's variational model, an → Quantum Programming
This is why T
gates are the expensive resource
they are precisely what takes you outside the efficiently simulable set, and Chapter 15 measured the cost. → Part 02
This list is an index, not a recommendation
the recommendations live in the chapters. → Bibliography
This mapping is exact and free
no active space, no basis-set truncation, nothing like Chapter 36's $10^7$ approximation. One qubit per vertex, one two-qubit term per edge. Everything this chapter measures is a property of the *algorithm*, with no modelling error in the way. → Quantum Programming
a `Moment` is by construction a set of operations that happen together, so Cirq > circuits are implicitly ASAP-scheduled before anyone asks. > > **The abstraction that survived is the one that was about physics.** That is not a coincidence and it > is not luck; it is the criterion. → Quantum Programming
too few steps
the run was stopped mid-descent. The instinctive fix is to reduce the step size on the assumption of overshooting, but the problem was insufficient *distance travelled*, so a smaller step travels less: at 0.05 it is still 0.155 away after 200 steps, worse than 0.25 was. → Quantum Programming
too good
a logical error rate of zero. This one produced results that were **too bad**. Both are the same class of failure, and the second is arguably more expensive: nobody debugs a success, but a convincing false alarm consumes real engineering time and, in this case, generated an incorrect bug report agai → Quantum Programming
topology, not
calibration
no per-qubit readout error or $T_1$/$T_2$. **No Cirq equivalent of `NoiseModel.from_backend` or the fake-provider fleet.** → Quantum Programming
one optimum, found exactly, in about two milliseconds, independent of initialization. → Quantum Programming
Transfers immediately:
**Refusing to accept a number without its denominator, statistic, or sample size.** This was the book's most repeated lesson and it is a general research skill. - **Reading a cost model.** Chapter 39's 3,718× billing spread, Chapter 36's $10^{20}$ shots, Chapter 33's 27.8 QPU hours per million predi → Quantum Programming
Transfers with work:
Linear algebra fluency, which is the actual mathematical content of the subject. - Numerical statistics — variance, confidence intervals, hypothesis testing. Chapters 27, 28, 33, 34, 37, 38, and 39 each failed at this before succeeding. - Compiler and scheduling theory, if you want the highest-deman → Quantum Programming
Twirling
does not reduce error, **reshapes** it: coherent → stochastic Pauli noise. - **sampling overhead** :: - "Account honestly for the sampling overhead each technique costs. → Glossary seed (context, not definitions)
dead links, uncalibrated or failed. The chain was a valid path in the coupling map and its predicted survival was **exactly zero**. Every structural metric improved and the outcome collapsed. → Quantum Programming
Two of the five edges have error rate 1.0000
> dead links. The coupling map says which qubits *can* interact; the calibration record says which > pairs *work*. A graph search over the coupling map routes through broken hardware without complaint. → Quantum Programming
Two rows are identically zero
the outcomes `00` and `10` never occur, because qubit 84 always reports 1. And **the first two columns are nearly identical**: preparing $|00\rangle$ and preparing $|01\rangle$ produce indistinguishable output distributions, because the bit that differs between them is the stuck one. → Quantum Programming
and in Cirq's case the distinction is visible without running anything. → Quantum Programming
U
uncertainty
standard error or confidence interval | | 8 | Shot count stated, and the uncertainty is consistent with it | | 7 | Verification method named and appropriate (statevector, distribution + tolerance, or checkpoint) | → Rubric: Circuit Implementation
not "wrong," not "approximate," but outside the specification entirely. → Quantum Programming
understanding
for asking "what would happen if readout error doubled?" and for isolating one mechanism at a time. → Quantum Programming
uniformly-controlled rotation
one rotation on one qubit > whose angle depends on the classical bit pattern of its controls. Stage $k$ has $k$ controls and > therefore $2^k$ distinct angles to write. > > The standard Gray-code decomposition of a $k$-controlled uniform rotation is $2^k$ single-qubit > rotations interleaved with $2 → Quantum Programming
up to global phase
by design, and that design is correct almost everywhere else. Chapter 3 §3.7 recommended `equiv` over `==` precisely because comparing exactly makes correct code look broken when a transpiler introduces a phase. → Quantum Programming
an oracle, an ansatz layer, a QFT — because the diagram stays readable, the QASM stays structured, and you can control it. **Use `compose` when you want the flattened truth**, or when you are about to count gates. → Quantum Programming
Use AES-256
Grover's key-halving is answered by doubling, and is a separate question. → Quantum Programming
V
Values differ between runs
an Estimator value is a *sample*, not a constant. For bit-reproducibility use `StatevectorEstimator`, which is exact. → Quantum Programming
Verbatim boxes turn the compiler off
run exactly these native gates, no translation, no routing, no optimization. Essential for benchmarking and error correction; **and inside one, you are the compiler**, with no protection against writing something worse than the transpiler would have. → Quantum Programming
see §6. - ★ marks a headline finding. ★★ and ★★★ for the most important. - The book is candid about negative results and about its own errors. Match that. - British-ish spelling is used in places ("behaviour", "modelling") — match the surrounding file. → EXPANSION BRIEF — read this file completely before doing anything else
verify classically
Chapter 23's Shor checks its factors and Chapter 24's QAOA checks its cut. **A result you can verify is a result you can benchmark, at any size.** → Quantum Programming
verify it properly
that second part is where most treatments stop short and where the actual skill is. → Quantum Programming
verify round trips rather than assuming them
tool support for QASM 3 is good and uneven, and a specification-valid file can still be rejected by a tool that claims to support it. → Quantum Programming
verify with an asymmetric state
since Bell and GHZ states are symmetric under bit reversal and prove nothing (Ch. 14 CS1). → Quantum Programming
virtual
a phase-reference shift in the controller. **Zero duration, zero error** | | `sx` | a real pulse, ~57 ns, error ~$3\times10^{-4}$ | | `x` | a real pulse | → Quantum Programming
virtually
as a bookkeeping change to the phase of subsequent pulses, taking zero time and introducing no error. Seven of the transpiled circuit's twelve operations are therefore free. This is an important practical fact and Chapter 28 exploits it hard. → Quantum Programming
VQE achieves chemical accuracy on LiH
energy error $2.04\times10^{-9}$ Ha, more than five > orders of magnitude inside the $1.6\times10^{-3}$ Ha chemical accuracy threshold. → Quantum Programming
VQE WORKS
three parameters, the active space's exact answer to two parts in a billion. **And the approximation made to fit the device is TEN MILLION TIMES LARGER than the error of the method being demonstrated.** Reporting the VQE energy to nine decimals is arithmetically correct and physically meaningless: t → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
W
Wack et al. on CLOPS
Ch. 30 - **Work on $1/f$ flux noise in superconducting qubits.** — Ch. 31 - **Work on Grover-based approaches to constraint satisfaction and optimization.** — Ch. 21 - **Work on learning from quantum data** — Ch. 32 - **Work on machine-learning reproducibility** — Ch. 39 - **Work on metamorphic test → Bibliography
Wald interval
and a failure mode that is not a rounding issue. It is built on two approximations: that the binomial is close enough to a normal, and that $\hat p$ is close enough to $p$ to use inside $\sqrt{p(1-p)/N}$. Both hold beautifully at $p = 0.5$ and both collapse when $p$ is small or $N$ is small. → Quantum Programming
weight 12
full-width strings across every qubit. Bravyi–Kitaev's is concentrated in the middle and caps at 10. → Quantum Programming
what actually
survives below the gate
`dt`, instruction durations, $T_1$ and $T_2$, and the scheduling passes — and those turned out to hold the two most interesting numbers in the chapter: → Quantum Programming
and was the answer already known classically? 2. **What is the classical baseline** — the *best* one, not the customer's legacy system? 3. **How many qubits, error-corrected or physical?** Count without error rate is not a metric. 4. **Reproducible by anyone outside?** Paper, data, code, independent → Quantum Programming
it cannot establish a key between parties who have never met. → Glossary
What survived:
**Learning from quantum data processed coherently.** Proven separations, hardware demonstrations, and no known dequantization. - **Classical shadows.** The one technique in this book that attacks Chapter 24's shot budget from the estimates-per-shot side instead of fighting $1/\epsilon^2$ head-on. - → Quantum Programming
What was ruled out, and this is genuine progress:
**Amplitude encoding as a route to advantage.** Chapter 32's $N - \log_2 N - 1$ is not a bad implementation; it is the cost of writing $N$ numbers into a state. Any proposal whose speedup comes from "exponentially compact encoding" has to answer it, and most do not. - **Width as the path to expressi → Quantum Programming
which qubits disagree
the $n-k$ generator eigenvalues, which identify the error. It learns **nothing about $\alpha$ and $\beta$**, because every stabilizer generator acts trivially on the codespace. That is precisely why measuring a syndrome is safe and measuring a qubit is not. → Quantum Programming
whoever gets it next
a bug appearing in a different part of the program from its cause. → Quantum Programming
Width was
> never the binding constraint
Chapter 15's T-gate overhead, Chapter 24's shot budget, and Chapter > 39's queue all were, and none of them is measured in qubits. → Appendix J: A Timeline
Work on learning from quantum data
where the input is a physical state rather than a classical vector. **The strongest surviving case**, and Chapter 35's subject. *Tier 2* — active. → Quantum Programming
Worked examples of full credit:
`total_error` (Ch. 36) raises without a measured active-space error. Returning 0.0 would be silently wrong by seven orders of magnitude *in the flattering direction*. - `quoted_fidelity(dist, statistic, include_dead)` (Ch. 30) takes both explicitly, because one chip supported errors from 0.00750 to → Rubric: The `vqelab` Project
Works:
Running the chapter's `project-checkpoint.py`. These are deterministic — 503 tests across the book, all passing on correct code. - Structural checks: does the circuit have the right width, gate set, depth bound? - Statevector comparison on small circuits, up to global phase. - Distribution compariso → Assessment: What to Grade When the Output Is Probabilistic
it is the whole point | `==` if you mean it | | **Global** phase ($e^{i\phi}$ times everything) | **No** — by any measurement | `.equiv()` | → Quantum Programming
You cannot print an intermediate state
reading collapses it. A `print` is a measurement. - **You cannot step through execution** — no breakpoint pauses a superposition. - **You cannot read the output** — it is a sampled distribution, and a subtly wrong circuit differs from a correct one by about shot noise ($0.5/\sqrt N$, Ch. 24). - **Yo → Quantum Programming
you cannot reason your
> way to a safe one
41% of the structured inputs here are blind, and picking the good ones > requires already knowing where the bug is. > > **Use `Operator` when the circuit is small enough to build one** — it is input-independent and > cannot be blind. Past about 12–14 qubits, fall back to `random_statevector`, and us → Quantum Programming
YOU CANNOT REASON YOUR WAY TO A SAFE TEST INPUT
choosing a good one requires already knowing where the bug is. **4th instance of the series' blind-test failure** (Ch19 oracle in comp basis, Ch24 exact sim hides shot noise, Ch25 eigenstate of the failure mode, now the DEBUGGER itself). → Continuity Tracker — Quantum Programming (INTERNAL, do not publish)
you usually have no oracle
for most circuits worth writing there is no independent source of the correct answer, since if there were you would not need the quantum computer. → Quantum Programming
You will not run on the median qubit
> you will run on whatever §12.3's scorer picks, and that is deliberately not a random draw. > > Measured on `fake_sherbrooke`: the median `ecr` error across live links is **0.00750** (§12.2.3; > 0.0078 if the dead links are left in), while the two links in the best three-qubit chain are > **0.0049* → Quantum Programming
explain why, given that `CLIFFORD_T_BASIS` contains `rz`. Then price all three with `estimate_resources` and rank them by physical qubits. The cost ranking is the → Quantum Programming
the pass discarded the entanglement entirely. It is doing exactly what it says; "approximation" is not a synonym for "optimization," and the setting needs a fidelity check attached. → Part 05