engine::course reads the course from wai-quantum/course/: 21 lessons from a first circuit through superposition, entanglement, interference, the standard algorithms, noise and mitigation, error correction and fault tolerance to resource estimates, each a Markdown text in English and Simplified Chinese and an exercise.json with a schema. A check runs each case of an exercise (a generator's inputs) with its intent and the verdict, measures its constraints (the gates allowed, counts, the T count, the critique's smells, the resource estimate's counts), and says what went wrong from the diagnostics, the verdict and the critique, never from the solution. The tests hold every solution to pass by proof, every known wrong answer to fail for its stated reason, and every locale to every text and message. wai-quantum learn shows, starts, checks, hints and explains a lesson, keeps progress only on this machine, and speaks the language --lang or LANG names; the command summaries and docs topics have Chinese translations held to the English they came from. The verdict gains of_diagnostic for a generator's refusal. llms.txt names the course. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1.4 KiB
A resource estimate says what a fault-tolerant machine would need to run a program: how many physical qubits, for how long, with how many magic-state factories. It starts from the program's logical counts (its qubits, its T gates, its Toffolis, its rotations at the T count of their synthesised words) and adds the physical model: a code (here the surface code, its distance chosen so that the whole run fails with probability below an error budget) on a physical qubit with a stated error rate and speed.
The engine estimates from the program itself, and every number in the estimate comes from a stated model with its assumptions listed. Every estimate is sealed, and verify re-runs it:
cat > carry.qasm <<'QASM'
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
ccx q[0], q[1], q[2];
QASM
wai-quantum estimate carry.qasm
wai-quantum estimate carry.qasm --json > carry-estimate.json
wai-quantum verify carry-estimate.json
The Studio's Estimate pane shows the same counts, the estimate on a chosen qubit and the frontier between qubits and time.
Uncomputing work is often necessary (it returns ancillas to |0⟩ so they can be reused), and it costs. This exercise's check runs the estimate on your program, and the result shows the physical figures it gives.
This is the end of the course. The companion course, Quantum, reconsidered, takes the same engine into interference-based learning and the limits of quantum advantage.