is_unitary

is_unitary(matrix, *, unp_inner=None)

Check if a given matrix is unitary.

Parameters:
  • matrix (ndarray | Array) – A square matrix to be checked for unitarity.

  • unp_inner – Array namespace (numpy or jax.numpy) that performs the computation.

Raises:

SimphonyError – If the provided matrix is not 2-dimensional or not square.

Return type:

bool | ndarray | Array