{ "schema": "wai.quantum.exercise/1", "id": "kickback", "translations": { "zh-CN": "machine-assisted: to be reviewed by a fluent reader before it is advertised" }, "title": { "en": "Phase kickback", "zh-CN": "相位反冲" }, "task": { "en": "q[1] starts in |−⟩, prepared for you. Make q[0] end in |1⟩ with q[1] still in |−⟩, using h and cx, and no x on q[0]. The check compares the whole state.", "zh-CN": "q[1] 从已为你制备好的 |−⟩ 开始。只用 h 和 cx(不要对 q[0] 作用 x),让 q[0] 最终处于 |1⟩,同时 q[1] 仍处于 |−⟩。检查比较的是整个状态。" }, "starter": [ "OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[1] c;", "// q[1] in |−⟩", "x q[1];", "h q[1];", "// your gates here", "c[0] = measure q[0];" ], "intent": { "prepares": "OPENQASM 3.0;\ninclude \"stdgates.inc\";\nqubit[2] q;\nbit[1] c;\nx q[0];\nx q[1];\nh q[1];\nc[0] = measure q[0];\n" }, "constraints": { "allow": ["h", "x", "cx"], "counts": { "x": { "max": 1 }, "cx": { "min": 1 } } }, "hints": { "en": [ "On a target in |−⟩, a controlled-NOT does not change the target: it puts a minus sign on the control's |1⟩ instead.", "A sign on |1⟩ is invisible until the control goes through a gate that mixes |0⟩ and |1⟩, before and after." ], "zh-CN": [ "当目标比特处于 |−⟩ 时,受控非门不会改变目标比特,而是在控制比特的 |1⟩ 上加一个负号。", "|1⟩ 上的符号是看不见的,除非控制比特在此前和此后都经过一个把 |0⟩ 和 |1⟩ 混合起来的门。" ] }, "reference": [ "OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[1] c;", "x q[1];", "h q[1];", "h q[0];", "cx q[0], q[1];", "h q[0];", "c[0] = measure q[0];" ], "wrong": [ { "fails": "intent", "note": "without the second Hadamard the kicked phase never becomes an outcome", "qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[1] c;", "x q[1];", "h q[1];", "h q[0];", "cx q[0], q[1];", "c[0] = measure q[0];"] }, { "fails": "constraint", "note": "flipping q[0] directly uses a second x", "qasm": ["OPENQASM 3.0;", "include \"stdgates.inc\";", "qubit[2] q;", "bit[1] c;", "x q[1];", "h q[1];", "x q[0];", "c[0] = measure q[0];"] } ] }