dq.plot.hinton
hinton(
x: ArrayLike,
*,
ax: Axes | None = None,
cmap: str | None = None,
vmin: float | None = None,
vmax: float | None = None,
colorbar: bool = True,
allticks: bool = False,
tickslabel: list[str] | None = None,
ecolor: str = "white",
ewidth: float = 0.5,
clear: bool = False
)
Plot a Hinton diagram.
Warning
Documentation redaction in progress.
Examples
>>> rho = dq.coherent_dm(16, 2.0)
>>> dq.plot.hinton(jnp.abs(rho))
>>> a = dq.destroy(16)
>>> H = dq.dag(a) @ a + 2.0 * (a + dq.dag(a))
>>> dq.plot.hinton(jnp.abs(H))
>>> cnot = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]
>>> dq.plot.hinton(cnot, tickslabel=['00', '01', '10', '11'])
>>> key = jax.random.PRNGKey(42)
>>> x = dq.random.complex(key, (16, 16))
>>> dq.plot.hinton(x)
>>> _, axs = dq.plot.grid(2)
>>> psi = dq.unit(dq.fock(4, 0) - dq.fock(4, 2))
>>> dq.plot.hinton(dq.todm(psi), ax=next(axs))
>>> rho = dq.unit(dq.fock_dm(4, 0) + dq.fock_dm(4, 2))
>>> dq.plot.hinton(rho, ax=next(axs))
>>> _, axs = dq.plot.grid(2)
>>> x = np.random.uniform(-1.0, 1.0, (10, 10))
>>> dq.plot.hinton(x, ax=next(axs), vmin=-1.0, vmax=1.0)
>>> dq.plot.hinton(jnp.abs(x), ax=next(axs), cmap='Greys', vmax=1.0, ecolor='black')
>>> x = np.random.uniform(-1.0, 1.0, (100, 100))
>>> dq.plot.hinton(x, vmin=-1.0, vmax=1.0, ewidth=0, clear=True, w=20)