Skip to content

Phase space

Phase space representations of 1d wavefunctions.

The Wigner function

\[W(x, p) = \frac{1}{\pi}\int \psi^*(x + y)\,\psi(x - y)\,e^{2ipy}\,\mathrm{d}y\]

is real, its marginals are the position and momentum densities, and for quadratic Hamiltonians it moves exactly like a classical phase space density. Interference shows up as negative values. The Husimi function

\[Q(x, p) = \frac{1}{2\pi}\,\vert\langle x, p\vert\psi\rangle\vert^2\]

is the overlap with coherent states \(\langle x'|x, p\rangle \propto e^{-(x' - x)^2/(2\sigma^2) + ipx'}\). It is the Wigner function smoothed by a Gaussian (widths \(\sigma/\sqrt{2}\) in \(x\) and \(1/(\sqrt{2}\sigma)\) in \(p\)), which makes it non-negative but blurs the interference fringes. Both are normalized to \(\int\!\!\int W\,\mathrm{d}x\,\mathrm{d}p = 1\) for \(\Vert\psi\Vert = 1\).

Both functions take a Grid1d and return x, p, W with W[i, j] at (x[i], p[j]). so.analyzers.Wigner and so.analyzers.Husimi record them during a propagation, and so.plotting.plot_phase_space() shows them.

wigner(grid, psi=None, x_lim=None, p_lim=None)

Wigner function \(W(x, p)\) of a wavefunction on a 1d grid.

\(\psi\) is taken to vanish outside the grid, i.e. the integral runs only over \(y\) for which \(x \pm y\) lie on the grid; on a periodic grid the copies of \(\psi\) would otherwise add "ghost" images. To reach the full momentum range \(|p| < \pi/\Delta x\) of the grid, \(\psi\) is first interpolated to twice the resolution (exact for band-limited \(\psi\)). The momenta are spaced by \(\pi/L\), half the momentum spacing of the grid.

Parameters:

Name Type Description Default
grid Grid1d
required
psi array

Wavefunction; defaults to grid.psi.

None
x_lim tuple of float

Only return the part with x_lim[0] <= x <= x_lim[1] (and the same for p); restricting x also saves time.

None
p_lim tuple of float

Only return the part with x_lim[0] <= x <= x_lim[1] (and the same for p); restricting x also saves time.

None

Returns:

Name Type Description
x array

Positions, a subset of grid.x_vals.

p array

Momenta, ascending.

W array

W[i, j] \(= W(x_i, p_j)\), real.

husimi(grid, psi=None, sigma=1.0, x_lim=None, p_lim=None)

Husimi function \(Q(x, p)\) of a wavefunction on a 1d grid.

The coherent states have the position width \(\sigma\) (that of so.Gaussian1d(x, sigma, p); for an oscillator of frequency \(\omega\), \(\sigma = 1/\sqrt{\omega}\) makes them its coherent states). The momenta are those of the grid, grid.k_vals, sorted.

Parameters:

Name Type Description Default
grid Grid1d
required
psi array

Wavefunction; defaults to grid.psi.

None
sigma float

Position width of the coherent states.

1.0
x_lim tuple of float

Only return the part with x_lim[0] <= x <= x_lim[1] (and the same for p); restricting x also saves time.

None
p_lim tuple of float

Only return the part with x_lim[0] <= x <= x_lim[1] (and the same for p); restricting x also saves time.

None

Returns:

Name Type Description
x array

Positions, a subset of grid.x_vals.

p array

Momenta, ascending.

Q array

Q[i, j] \(= Q(x_i, p_j)\), non-negative.