Table Of Contents

Previous topic

Model Hamiltonians (qit.hamiltonian)

Next topic

Local invariants (qit.invariant)

This Page

Harmonic oscillators (qit.ho)

This module simulates harmonic oscillators by truncating the state space dimension to a finite value. Higher truncation limits give more accurate results. All the functions in this module operate in the truncated number basis \{|0\rangle, |1\rangle, ..., |n-1\rangle\} of the harmonic oscillator, where n is the truncation dimension.

The corresponding truncated annihilation operator can be obtained with qit.utils.boson_ladder.

Contents

coherent_state(alpha[, n]) Coherent states of a harmonic oscillator.
position_state(q[, n]) Position eigenstates of a harmonic oscillator.
momentum_state(p[, n]) Momentum eigenstates of a harmonic oscillator.
position([n]) Position operator.
momentum([n]) Momentum operator.
displace(alpha[, n]) Bosonic displacement operator.
squeeze(z[, n]) Bosonic squeezing operator.
husimi(s[, alpha, z, res, lim]) Husimi probability distribution.
wigner(s[, alpha, res, lim]) Wigner quasi-probability distribution.
qit.ho.coherent_state(alpha, n=30)

Coherent states of a harmonic oscillator.

Returns the n-dimensional approximation to the coherent state |\alpha\rangle,

|\alpha\rangle := D(\alpha) |0\rangle
= e^{-\frac{|\alpha|^2}{2}} \sum_{k=0}^\infty \frac{\alpha^k}{\sqrt{k!}} |k\rangle,

in the number basis. a|\alpha\rangle = \alpha |\alpha\rangle.

qit.ho.displace(alpha, n=30)

Bosonic displacement operator.

Returns the n-dimensional approximation for the bosonic displacement operator

D(\alpha) := \exp\left(\alpha a^\dagger - \alpha^* a\right)
= \exp\left( i \sqrt{2} \left(Q \mathrm{Im}(\alpha) -P \mathrm{Re}(\alpha)\right)\right)

in the number basis. This yields

D(\alpha) Q D^\dagger(\alpha) &= Q -\sqrt{2} \textrm{Re}(\alpha) \mathbb{I},\\
D(\alpha) P D^\dagger(\alpha) &= P -\sqrt{2} \textrm{Im}(\alpha) \mathbb{I},

and thus the displacement operator displaces the state of a harmonic oscillator in phase space.

qit.ho.squeeze(z, n=30)

Bosonic squeezing operator.

Returns the n-dimensional approximation for the bosonic squeezing operator

S(z) := \exp\left(\frac{1}{2} (z^* a^2 - z a^{\dagger 2})\right)
= \exp\left(\frac{i}{2} \left((QP+PQ)\mathrm{Re}(z) +(P^2-Q^2)\mathrm{Im}(z)\right)\right)

in the number basis.

qit.ho.position(n=30)

Position operator.

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

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}.

(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 (P^2 +Q^2)
  = \hbar \omega (a^\dagger a +\frac{1}{2}).

qit.ho.momentum(n=30)

Momentum operator.

Returns the n-dimensional approximation of the dimensionless momentum operator P in the number basis.

See position.

qit.ho.position_state(q, n=30)

Position eigenstates of a harmonic oscillator.

Returns the n-dimensional approximation of the eigenstate |q\rangle of the dimensionless position operator Q in the number basis.

See position, momentum.

Difference equation:

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.

qit.ho.momentum_state(p, n=30)

Momentum eigenstates of a harmonic oscillator.

Returns the n-dimensional approximation of the eigenstate |p\rangle of the dimensionless momentum operator P in the number basis.

See position, momentum.

Difference equation:

r_1 &= i \sqrt{2} p r_0,\\
\sqrt{k+1} r_{k+1} &= i \sqrt{2} p r_k +\sqrt{k} r_{k-1}, \qquad \text{when} \quad k >= 1.

qit.ho.husimi(s, alpha=None, z=0, res=(40, 40), lim=(-2, 2, -2, 2))

Husimi probability distribution.

H       = husimi(s, alpha[, z=])
H, a, b = husimi(s, res=xxx, lim=yyy[, z=])

Returns the Husimi probability distribution H(\mathrm{Im} \alpha, \mathrm{Re} \alpha) corresponding to the harmonic oscillator state s given in the number basis:

H(s, \alpha, z) = \frac{1}{\pi} \langle\alpha, z| \rho_s |\alpha, z\rangle

z is the optional squeezing parameter for the reference state: |\alpha, z\rangle := D(\alpha) S(z) |0\rangle. The integral of H is normalized to unity.

qit.ho.wigner(s, alpha=None, res=(20, 20), lim=(-2, 2, -2, 2))

Wigner quasi-probability distribution.

W       = wigner(s, alpha)
W, a, b = wigner(s, res=xxx, lim=yyy)

Returns the Wigner quasi-probability distribution W(\mathrm{Im} \alpha, \mathrm{Re} \alpha) corresponding to the harmonic oscillator state s given in the number basis.

For a normalized state, the integral of W is normalized to unity.

NOTE: The truncation of the number state space to a finite dimension results in spurious circular ripples in the Wigner function outside a given radius. To increase the accuracy, increase the state space dimension.