Skip to content

dq.isket

isket(x: ArrayLike) -> bool

Returns True if the array is in the format of a ket.

Parameters

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

    Array.

Returns

True if the last dimension of x is 1, False otherwise.

Examples

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