You are given an integer n and an oracleO.
There exists an integer L such that 0≤L<2n, and we know that L is one of the powers of 2(20,21,...2n−1).
The oracle O satisfies
∣x⟩n∣y⟩1O{∣x⟩n∣y⊕1⟩1∣x⟩n∣y⟩1(x=L)(x=L)
for any pair of integers (x,y) satisfying 0≤x<2n and 0≤y<2, where ⊕ denotes the XOR operator.
Implement an operation on a quantum circuit qc with n qubits that prepares a quantum state ∣ψ⟩ from the zero state, such that ∣L⟩ is observed with a probability of at least 0.9 upon measurement.
More Precise Problem Statement
Define the state ∣ψ⟩ prepared by qc as
∣ψ⟩=i=0∑2n−1ai∣i⟩,
where ai denotes the probability amplitude of the computational basis state ∣i⟩.