Problem Statement
You are given an integer .
For any integer satisfying , implement the following operation on a quantum circuit with qubits.
Note that we define .
Constraints
- The circuit depth must not exceed .
- Global phase is ignored in judge.
- Integers must be encoded by little-endian.
- 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
- You can utilize the inverse operation of .