dq.isdm
isdm(x: QArrayLike) -> bool
Returns True if the qarray is in the format of a density matrix.
Parameters
-
x
(qarray-like of shape (...))
–
Qarray-like.
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