Problem Statement
Given an integer , implement an -qubit oracle on a quantum circuit .
The oracle acts on basis states , where , as follows:
Here, denotes the unique integer such that and is divisible by .
Constraints
- The circuit depth must not exceed .
- 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
def solve(n: int) -> QuantumCircuit:
qc = QuantumCircuit(n)
# Write your code here:
return qc
Hints
Open
- Related problem: QCoder Programming Contest 004 - A5