Skip to content

dq.plot_fock

plot_fock(
    state: ArrayLike,
    *,
    ax: Axes | None = None,
    allxticks: bool = False,
    ymax: float | None = 1.0,
    color: str = colors["blue"],
    alpha: float = 1.0,
    label: str = ""
)

Plot the photon number population of a state.

Warning

Documentation redaction in progress.

Examples

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

plot_fock

>>> # the even cat state has only even photon number components
>>> psi = dq.unit(dq.coherent(32, 3.0) + dq.coherent(32, -3.0))
>>> dq.plot_fock(psi, allxticks=False, ymax=None)

plot_fock_even_cat

>>> dq.plot_fock(dq.coherent(16, 1.0), alpha=0.5)
>>> dq.plot_fock(dq.coherent(16, 2.0), ax=plt.gca(), alpha=0.5, color='red')

plot_fock_coherent