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 equals .
The error in the sum of probabilities can be up to .
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
- The circuit depth must not exceed .
- Integers must be encoded by little-endian notation, i.e., .
- The submitted code must follow the specified format:
Sample Input
- : Implemented circuit should perform the following transformation.
Hints
Open
- You can solve the problem using the solution from problem B4.
- You can define additional functions other than the
solve
function.