C1: Generate Uniform Amplitude Superposition State I
Time Limit: 3 seconds
Memory Limit: 512 MiB
Score: 300 points
Problem Statement
You are given integers n and L.
Implement the operation of preparing the state ∣ψ⟩ on a quantum circuit qc with n qubits such that the states ∣0⟩,∣1⟩,...∣L−1⟩ are observed with equal probabilities, and the sum of these probabilities exceeds 0.5.
More Precise Problem Statement
Define the state ∣ψ⟩ prepared by qc as
∣ψ⟩=i=0∑2n−1ai∣i⟩,
where ai denotes the probability amplitude of the computational basis state ∣i⟩.