Skip to content

dq.isdm

isdm(x: ArrayLike) -> bool

Returns True if the array is in the format of a density matrix.

Parameters

  • x (array_like of shape (...)) –

    Array.

Returns

True if the last two dimensions of x are equal, False otherwise.

Examples

>>> dq.isdm(jnp.ones((3, 3)))
True
>>> dq.isdm(jnp.ones((5, 3, 3)))
True
>>> dq.isdm(jnp.ones((3, 1)))
False