Problem Statement
You are given an integer and an oracle . There exists an integer such that , and we know that is one of the powers of . The oracle satisfies
for any pair of integers satisfying and , where denotes the XOR operator.
Implement an operation on a quantum circuit with qubits that prepares a quantum state from the zero state, such that is observed with a probability of at least upon measurement.
More Precise Problem Statement
Define the state prepared by as
where denotes the probability amplitude of the computational basis state .
Implement satisfying following condition:
Constraints
- The circuit depth must not exceed .
- Oracle is given as a quantum circuit of depth .
- Integers must be encoded by little-endian.
- Global phase is ignored in judge.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit
"""
You can apply oracle as follows:
qc.compose(o, inplace=True)
"""
def solve(n: int, o: QuantumCircuit) -> QuantumCircuit:
qc = QuantumCircuit(n)
# Write your code here:
return qc