qit.ho.position_state¶
- qit.ho.position_state(q, n=30)¶
Position eigenstates of a harmonic oscillator.
- Parameters
q (float) – dimensionless position coordinate
n (int) – truncation dimension
- Returns
approximate position eigenstate
- Return type
array[complex]
Returns the n-dimensional approximation of the eigenstate \(\ket{q}\) of the dimensionless position operator Q in the number basis.
Difference equation:
\[\begin{split}r_1 &= \sqrt{2} \: q \: r_0,\\ \sqrt{k+1} \: r_{k+1} &= \sqrt{2} \: q \: r_k -\sqrt{k} \: r_{k-1}, \qquad \text{when} \quad k >= 1.\end{split}\]