Skip to content

dq.plot_wigner

plot_wigner(
    state: ArrayLike,
    *,
    ax: Axes | None = None,
    xmax: float = 5.0,
    ymax: float | None = None,
    vmax: float = 2 / jnp.pi,
    npixels: int = 101,
    cmap: str = "dq",
    interpolation: str = "bilinear",
    colorbar: bool = True,
    cross: bool = False,
    clear: bool = False
)

Plot the Wigner function of a state.

Warning

Documentation redaction in progress.

Note

Choose a diverging colormap cmap for better results.

Warning

The axis scaling is chosen so that a coherent state \(\ket{\alpha}\) lies at the coordinates \((x,y)=(\mathrm{Re}(\alpha),\mathrm{Im}(\alpha))\), which is different from the default behaviour of qutip.plot_wigner().

Examples

>>> psi = dq.coherent(16, 2.0)
>>> dq.plot_wigner(psi)

plot_wigner_coh

>>> psi = dq.unit(dq.coherent(16, 2) + dq.coherent(16, -2))
>>> dq.plot_wigner(psi, xmax=4.0, ymax=2.0, colorbar=False)

plot_wigner_cat

>>> psi = dq.unit(dq.fock(2, 0) + dq.fock(2, 1))
>>> dq.plot_wigner(psi, xmax=2.0, cross=True)

plot_wigner_01

>>> psi = dq.unit(sum(dq.coherent(32, 3 * a) for a in [1, 1j, -1, -1j]))
>>> dq.plot_wigner(psi, npixels=201, clear=True)

plot_wigner_4legged