{ "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;"] } ] }