qit.ho.position

qit.ho.position(n=30)

Position operator.

Parameters

n (int) – truncation dimension

Returns

position operator

Return type

array[complex]

Returns the n-dimensional truncation of the dimensionless position operator Q in the number basis.

\[\begin{split}Q &= \sqrt{\frac{m \omega}{\hbar}} q = (a+a^\dagger) / \sqrt{2},\\ P &= \sqrt{\frac{1}{m \hbar \omega}} p = -i (a-a^\dagger) / \sqrt{2}.\end{split}\]

(Equivalently, \(a = (Q + iP) / \sqrt{2}\)). These operators fulfill \([q, p] = i \hbar, \quad [Q, P] = i\). The Hamiltonian of the harmonic oscillator is

\[H = \frac{p^2}{2m} +\frac{1}{2} m \omega^2 q^2 = \frac{1}{2} \hbar \omega \left(P^2 +Q^2\right) = \hbar \omega \left(a^\dagger a +\frac{1}{2}\right).\]