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]>
952 B
A fault-tolerant computer encodes each logical qubit in many physical ones and corrects errors faster than they accumulate. On the codes in use, the Clifford gates (h, s, cx and their products) are cheap to apply to encoded qubits. Clifford gates alone are not enough: a Clifford circuit is easy to simulate classically (the engine's stabilizer tableau does it), so it cannot do anything a classical computer cannot.
Adding the T gate, a rotation by π/4 about Z, makes the set universal. But on a surface code a T gate cannot be applied directly. It consumes a magic state, made by distillation in a factory that takes many physical qubits and much time. So the cost of a fault-tolerant program is, to a first approximation, its T count.
The Toffoli gate is the workhorse of arithmetic. Written in Clifford+T it needs seven T gates; the critique counts them (wai-quantum critique), and the estimate in the last lesson prices them.