microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
katas/content/marking_oracles/kth_bit/solution.md
6lines · modecode
| 1 | Since the effect of this oracle depends only on the value of the $k$-th qubit, we can ignore the rest of the qubits and focus on just `x[k]`. We need to flip the state of the target qubit if the input qubit `x[k]` is in the $\ket{1}$ state and leave it unchanged otherwise - this is exactly the effect of the $CNOT$ gate with the qubit `x[k]` used as control and the qubit `y` used as target. |
| 2 | |
| 3 | @[solution]({ |
| 4 | "id": "marking_oracles__kth_bit_solution", |
| 5 | "codePath": "./Solution.qs" |
| 6 | }) |
| 7 | |