Skip to content

dq.isket

isket(x: QArrayLike) -> bool

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

Parameters

  • x (qarray-like of shape (...)) –

    Qarray-like.

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