Phase space
Phase space representations of 1d wavefunctions.
The Wigner function
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
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 |
None
|
x_lim
|
tuple of float
|
Only return the part with |
None
|
p_lim
|
tuple of float
|
Only return the part with |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
x |
array
|
Positions, a subset of |
p |
array
|
Momenta, ascending. |
W |
array
|
|
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 |
None
|
sigma
|
float
|
Position width of the coherent states. |
1.0
|
x_lim
|
tuple of float
|
Only return the part with |
None
|
p_lim
|
tuple of float
|
Only return the part with |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
x |
array
|
Positions, a subset of |
p |
array
|
Momenta, ascending. |
Q |
array
|
|