Skip to content

dq.plot.wigner_gif

wigner_gif(
    states: ArrayLike,
    *,
    gif_duration: float = 5.0,
    fps: int = 10,
    w: float = 5.0,
    xmax: float = 5.0,
    ymax: float | None = None,
    vmax: float = 2 / jnp.pi,
    npixels: int = 101,
    cmap: str = "dq",
    interpolation: str = "bilinear",
    cross: bool = False,
    clear: bool = False
) -> Image

Plot a GIF of the Wigner function of multiple states.

Warning

Documentation redaction in progress.

See dq.plot.wigner() and dq.plot.gifit() for more details.

Examples

>>> n = 16
>>> a = dq.destroy(n)
>>> H = dq.zero(n)
>>> jump_ops = [a @ a - 4.0 * dq.eye(n)]  # cat state inflation
>>> psi0 = dq.coherent(n, 0)
>>> tsave = jnp.linspace(0, 1.0, 1001)
>>> result = dq.mesolve(H, jump_ops, psi0, tsave)
>>> gif = dq.plot.wigner_gif(result.states, fps=25, xmax=4.0, ymax=2.0)

plot_wigner_gif_cat

>>> n = 16
>>> a = dq.destroy(n)
>>> H = dq.dag(a) @ dq.dag(a) @ a @ a  # Kerr Hamiltonian
>>> psi0 = dq.coherent(n, 2)
>>> tsave = jnp.linspace(0, jnp.pi, 1001)
>>> result = dq.sesolve(H, psi0, tsave)
>>> gif = dq.plot.wigner_gif(
...     result.states, gif_duration=10.0, fps=25, xmax=4.0, clear=True
... )

plot_wigner_gif_kerr