open-standards/wai/wai-quantum/course/lessons/bell/exercise.json
Transaction Science fb230d8a62 wai-quantum: the circuits course as data, each exercise checked by the engine, and wai-quantum learn in English and Chinese
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]>
2026-10-28 08:42:54 -04:00

45 lines
1.6 KiB
JSON

{
"schema": "wai.quantum.exercise/1",
"id": "bell",
"translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" },
"title": { "en": "Two qubits, one answer", "zh-CN": "两个量子比特,一个答案" },
"task": {
"en": "Two qubits. Make the outcomes 00 and 11 each come up with probability one half, and never 01 or 10.",
"zh-CN": "两个量子比特。让结果 00 和 11 各以二分之一的概率出现,而 01 和 10 永远不出现。"
},
"starter": [
"OPENQASM 3.0;",
"include \"stdgates.inc\";",
"qubit[2] q;",
"bit[2] c;",
"// your gates here",
"c = measure q;"
],
"intent": { "distribution": { "00": 0.5, "11": 0.5 } },
"hints": {
"en": [
"Superposition on both qubits separately gives all four outcomes. The second qubit has to follow the first.",
"A controlled-NOT flips its target when its control is |1⟩, and leaves it when the control is |0⟩."
],
"zh-CN": [
"分别让两个量子比特处于叠加会得到全部四个结果。第二个量子比特必须跟随第一个。",
"受控非门在控制比特为 |1⟩ 时翻转目标比特,在控制比特为 |0⟩ 时保持不变。"
]
},
"reference": [
"OPENQASM 3.0;",
"include \"stdgates.inc\";",
"qubit[2] q;",
"bit[2] c;",
"h q[0];",
"cx q[0], q[1];",
"c = measure q;"
],
"wrong": [
{
"fails": "intent",
"note": "independent superpositions give all four outcomes",
"qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[2] c;", "h q[0];", "h q[1];", "c = measure q;"]
}
]
}