Problem Statement
Let be a positive integer. For an integer with , define as the following state:
where
Given integers and , implement an -qubit oracle on a quantum circuit .
The oracle must satisfy
where is an integer satisfying
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, k_const: int) -> QuantumCircuit:
qc = QuantumCircuit(n)
# Write your code here:
return qc
Sample Input
- : Implemented circuit should perform the following transformation.
Hints
Open
- Thinking of as a binary expansion may make it easier to solve.
- Related problem: QCoder Programming Contest 002 - B5