microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.3.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

katas/content/oracles/kth_bit_oracle/solution.md

7lines · modepreview

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 phase of the qubit if it is in the $|1\rangle$ state and leave it unchanged otherwise - this is exactly the effect of the $Z$ gate.

@[solution]({
    "id": "oracles__kth_bit_oracle_solution",
    "codePath": "Solution.qs"
})