Use this file to discover all available pages before exploring further.
View on GitHub
Open this notebook in GitHub to run it yourself
The prepare_exponential_state function
creates a state with exponentially decreasing amplitudes. Namely,
the probability for a state representing an integer n isP(n)=Z1e−λnwhere λ is the rate, and Z is a normalization factor.
If q in the number of qubits, thenZ=n=0∑n=2q−1e−λn=1−e−λ1−e−λ2qFunction: prepare_exponential_stateArguments:
rate: CReal
q: QArray[QBit]
Notice that the function acts inplace on the qubits.