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]>
46 lines
1.6 KiB
JSON
46 lines
1.6 KiB
JSON
{
|
||
"schema": "wai.quantum.exercise/1",
|
||
"id": "uniform",
|
||
"translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" },
|
||
"title": { "en": "Every outcome at once", "zh-CN": "所有结果同时出现" },
|
||
"task": {
|
||
"en": "Three qubits. Make all eight outcomes, 000 to 111, equally likely.",
|
||
"zh-CN": "三个量子比特。让 000 到 111 这八个结果出现的可能性完全相同。"
|
||
},
|
||
"starter": [
|
||
"OPENQASM 3.0;",
|
||
"include \"stdgates.inc\";",
|
||
"qubit[3] q;",
|
||
"bit[3] c;",
|
||
"// your gates here",
|
||
"c = measure q;"
|
||
],
|
||
"intent": {
|
||
"distribution": { "000": 0.125, "001": 0.125, "010": 0.125, "011": 0.125, "100": 0.125, "101": 0.125, "110": 0.125, "111": 0.125 }
|
||
},
|
||
"hints": {
|
||
"en": [
|
||
"Each qubit on its own must give 0 and 1 equally often, and the qubits must not depend on one another.",
|
||
"A gate applied to a register name, as in `x q;`, acts on every qubit of the register."
|
||
],
|
||
"zh-CN": [
|
||
"每个量子比特单独来看必须等可能地给出 0 和 1,而且各量子比特之间互不依赖。",
|
||
"作用在寄存器名上的门,例如 `x q;`,会作用于寄存器中的每个量子比特。"
|
||
]
|
||
},
|
||
"reference": [
|
||
"OPENQASM 3.0;",
|
||
"include \"stdgates.inc\";",
|
||
"qubit[3] q;",
|
||
"bit[3] c;",
|
||
"h q;",
|
||
"c = measure q;"
|
||
],
|
||
"wrong": [
|
||
{
|
||
"fails": "intent",
|
||
"note": "two of three qubits in superposition give four outcomes, not eight",
|
||
"qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[3] q;", "bit[3] c;", "h q[0];", "h q[1];", "c = measure q;"]
|
||
}
|
||
]
|
||
}
|