{ "schema": "wai.quantum.exercise/1", "id": "phase", "translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" }, "title": { "en": "A phase you cannot see, until you interfere", "zh-CN": "看不见的相位,直到干涉发生" }, "task": { "en": "One qubit. Using only h and z, make its measurement give 1 every time.", "zh-CN": "一个量子比特。只用 h 和 z,让它的测量每次都给出 1。" }, "starter": [ "OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[1] q;", "bit[1] c;", "h q[0];", "c = measure q;" ], "intent": { "distribution": { "1": 1.0 } }, "constraints": { "allow": ["h", "z"] }, "hints": { "en": [ "z leaves |0⟩ alone and flips the sign of |1⟩. On (|0⟩ + |1⟩)/√2 it changes nothing a measurement can see.", "A second Hadamard turns a sign between |0⟩ and |1⟩ into a difference in outcomes." ], "zh-CN": [ "z 不改变 |0⟩,而把 |1⟩ 的符号取反。作用在 (|0⟩ + |1⟩)/√2 上时,它不改变任何测量能看到的东西。", "第二个 Hadamard 门会把 |0⟩ 与 |1⟩ 之间的符号差别变成结果上的差别。" ] }, "reference": [ "OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[1] q;", "bit[1] c;", "h q[0];", "z q[0];", "h q[0];", "c = measure q;" ], "wrong": [ { "fails": "intent", "note": "the sign is there, but nothing interferes it into an outcome", "qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[1] q;", "bit[1] c;", "h q[0];", "z q[0];", "c = measure q;"] }, { "fails": "constraint", "note": "x gives 1, but the exercise allows only h and z", "qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[1] q;", "bit[1] c;", "x q[0];", "c = measure q;"] } ] }