dq.wigner
wigner(
state: QArrayLike,
xmax: float = 6.0,
ymax: float = 6.0,
npixels: int = 201,
xvec: ArrayLike | None = None,
yvec: ArrayLike | None = None,
g: float = 2.0,
) -> tuple[Array, Array, Array]
Compute the Wigner distribution of a ket or density matrix.
The Wigner distribution is computed on a grid of coordinates \((x, y)\).
Parameters:
-
state(qarray-like of shape (..., n, 1) or (..., n, n)) –Ket or density matrix.
-
xmax–Maximum absolute value of the \(x\) coordinate.
-
ymax–Maximum absolute value of the \(y\) coordinate.
-
npixels–Number of pixels in each direction.
-
xvec(array-like of shape (nxvec,)) –\(x\) coordinates. If
None, defaults toxvec = jnp.linspace(-xmax, xmax, npixels). -
yvec(array-like of shape (nyvec,)) –\(y\) coordinates. If
None, defaults toyvec = jnp.linspace(-ymax, ymax, npixels). -
g–Scaling factor of Wigner quadratures, such that \(a = g(x + iy)/2\).
Returns:
-
xvec(array of shape (npixels,) or (nxvec,)) –\(x\) coordinates, or
xvecif specified. -
yvec(array of shape (npixels,) or (nyvec,)) –\(y\) coordinates, or
yvecif specified. -
w(array of shape (..., npixels, npixels) or (..., nyvec, nxvec)) –Wigner distribution.
See also
dq.plot.wigner(): plot the Wigner function of a state.dq.plot.wigner_data(): plot a pre-computed Wigner function.