Problem Statement
You are given integers and , and two positive integers and that are coprime.
Implement an operation that prepares a superposition state from the zero state on a quantum circuit with qubits.
The superposition state is defined by
Constraints
- 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, QuantumRegister
def solve(n: int, m: int, a: int, L: int) -> QuantumCircuit:
x, y = QuantumRegister(n), QuantumRegister(2 * m + 1)
qc = QuantumCircuit(x, y)
# Write your code here:
return qc