open-standards/wai/wai-quantum/course/lessons/bit-order/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

44 lines
1.4 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"schema": "wai.quantum.exercise/1",
"id": "bit-order",
"translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" },
"title": { "en": "Reading the bits", "zh-CN": "读懂比特的顺序" },
"task": {
"en": "Two qubits, measured into c. Make the outcome 10 every time: c[1] is 1 and c[0] is 0.",
"zh-CN": "两个量子比特,测量到 c 中。让结果每次都是 10:c[1] 为 1,c[0] 为 0。"
},
"starter": [
"OPENQASM 3.0;",
"include \"stdgates.inc\";",
"qubit[2] q;",
"bit[2] c;",
"// your gates here",
"c = measure q;"
],
"intent": { "distribution": { "10": 1.0 } },
"hints": {
"en": [
"An outcome is written with the highest bit first: in 10, the 1 is c[1].",
"c = measure q writes q[0] into c[0] and q[1] into c[1]. Which qubit must end in |1⟩?"
],
"zh-CN": [
"结果按最高位在前的顺序书写:在 10 中,1 是 c[1]。",
"c = measure q 把 q[0] 写入 c[0],把 q[1] 写入 c[1]。哪个量子比特最后必须处于 |1⟩?"
]
},
"reference": [
"OPENQASM 3.0;",
"include \"stdgates.inc\";",
"qubit[2] q;",
"bit[2] c;",
"x q[1];",
"c = measure q;"
],
"wrong": [
{
"fails": "intent",
"note": "the flip on q[0] gives 01, the lowest bit",
"qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[2] c;", "x q[0];", "c = measure q;"]
}
]
}