Skip to content

dq.plot.fock

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