matrix_props.is_pseudo_unitary

Checks if matrix is pseudo unitary.

Functions

is_pseudo_unitary(mat, p, q[, rtol, atol])

Check if a matrix is pseudo-unitary.

Module Contents

matrix_props.is_pseudo_unitary.is_pseudo_unitary(mat, p, q, rtol=1e-05, atol=1e-08)

Check if a matrix is pseudo-unitary.

A matrix A of size (p+q)x(p+q) is pseudo-unitary with respect to a given signature matrix J if it satisfies

\[A^* J A = J,\]
where:
  • :math:A^* is the conjugate transpose (Hermitian transpose) of :math:A,

  • :math:J is a diagonal matrix with first p diagonal matrix equal to 1 and next q diagonal entries equal to -1

Examples

Consider the following matrix:

\[\begin{split}A = \begin{pmatrix} cosh(1) & sinh(1) \\ sinh(1) & cosh(1) \end{pmatrix}\end{split}\]

with the signature matrix:

\[\begin{split}J = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\end{split}\]

Our function confirms that :math:A is pseudo-unitary:

>>> import numpy as np
>>> from toqito.matrix_props import is_pseudo_unitary
>>> A = np.array([[np.cosh(1), np.sinh(1)], [np.sinh(1), np.cosh(1)]])
>>> is_pseudo_unitary(A, p=1, q=1)
True

However, the following matrix :math:B

\[\begin{split}B = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}\end{split}\]

is not pseudo-unitary with respect to the same signature matrix:

>>> B = np.array([[1, 0], [1, 1]])
>>> is_pseudo_unitary(B, p=1, q=1)
False

References

Parameters:
  • mat (numpy.ndarray) – The matrix to check.

  • p (int) – Number of positive entries in the signature matrix.

  • q (int) – Number of negative entries in the signature matrix.

  • rtol (float) – The relative tolerance parameter (default 1e-05).

  • atol (float) – The absolute tolerance parameter (default 1e-08).

Raises:

ValueError – When p < 0 or q < 0.

Returns:

Return :code:True if the matrix is pseudo-unitary, and :code:False otherwise.

Return type:

bool