Problem Statement
You are given integers and . Implement the operation of preparing the state on a quantum circuit with qubits such that the states are observed with equal probabilities, and the sum of these probabilities exceeds .
More Precise Problem Statement
Define the state prepared by as
where denotes the probability amplitude of the computational basis state .
Implement satisfying following conditions:
Constraints
- Integers must be encoded by little-endian.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit
def solve(n: int, L: int) -> QuantumCircuit:
qc = QuantumCircuit(n)
# Write your code here:
return qc
Sample Input
- : Implemented circuit should perform the following transformation.