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]>
44 lines
1.3 KiB
JSON
44 lines
1.3 KiB
JSON
{
|
|
"schema": "wai.quantum.exercise/1",
|
|
"id": "superposition",
|
|
"translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" },
|
|
"title": { "en": "Superposition", "zh-CN": "叠加" },
|
|
"task": {
|
|
"en": "One qubit. Make its measurement give 0 and 1 each with probability exactly one half.",
|
|
"zh-CN": "一个量子比特。让它的测量以恰好二分之一的概率分别给出 0 和 1。"
|
|
},
|
|
"starter": [
|
|
"OPENQASM 3.0;",
|
|
"include \"stdgates.inc\";",
|
|
"qubit[1] q;",
|
|
"bit[1] c;",
|
|
"// your gate here",
|
|
"c = measure q;"
|
|
],
|
|
"intent": { "distribution": { "0": 0.5, "1": 0.5 } },
|
|
"hints": {
|
|
"en": [
|
|
"You need a state whose two amplitudes have the same size.",
|
|
"The Hadamard gate takes |0⟩ to an equal mix of |0⟩ and |1⟩."
|
|
],
|
|
"zh-CN": [
|
|
"你需要一个两个振幅大小相同的状态。",
|
|
"Hadamard 门把 |0⟩ 变成 |0⟩ 与 |1⟩ 的等量组合。"
|
|
]
|
|
},
|
|
"reference": [
|
|
"OPENQASM 3.0;",
|
|
"include \"stdgates.inc\";",
|
|
"qubit[1] q;",
|
|
"bit[1] c;",
|
|
"h q[0];",
|
|
"c = measure q;"
|
|
],
|
|
"wrong": [
|
|
{
|
|
"fails": "intent",
|
|
"note": "a flip is certain, not a superposition",
|
|
"qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[1] q;", "bit[1] c;", "x q[0];", "c = measure q;"]
|
|
}
|
|
]
|
|
}
|