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]>
5 lines
930 B
Markdown
5 lines
930 B
Markdown
Measuring a data qubit to see whether it flipped would destroy the superposition the code protects. Error correction instead measures *parities*: whether two qubits agree, which is the same for |000⟩ and |111⟩ and so says nothing about the encoded value.
|
|
|
|
A parity check is computed into an *ancilla*, a fresh qubit in |0⟩: a controlled-NOT from each qubit the check compares adds its value to the ancilla, mod 2, and the ancilla is measured. The pair of results, the *syndrome*, names the flipped qubit: for the bit-flip code, 00 is no error, and each single flip gives its own nonzero pattern.
|
|
|
|
This is how larger codes work too. The surface code places data qubits on a grid and measures parity checks between neighbours, over and over, and a *decoder* reads the history of syndromes to find the most likely errors. The engine's research tools hold such decoders: `wai-quantum lab help` lists the error-correction tools.
|