toqito.matrix_props.is_pseudo_hermitian ======================================= .. py:module:: toqito.matrix_props.is_pseudo_hermitian .. autoapi-nested-parse:: Checks if matrix is pseudo hermitian with respect to given signature. Module Contents --------------- .. py:function:: is_pseudo_hermitian(mat, signature, rtol = 1e-05, atol = 1e-08) Check if a matrix is pseudo-Hermitian. A matrix \(H\) is pseudo-Hermitian with respect to a given signature matrix \(\eta\) if it satisfies: \[ \eta H \eta^{-1} = H^{\dagger}, \] where: - \(H^{\dagger}\) is the conjugate transpose (Hermitian transpose) of \(H\), - \(\eta\) is a Hermitian, invertible matrix. .. rubric:: Examples Consider the following matrix: \[ H = \begin{pmatrix} 1 & 1+i \\ -1+i & -1 \end{pmatrix} \] with the signature matrix: \[ \eta = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \] Our function confirms that \(H\) is pseudo-Hermitian: ```python exec="1" source="above" import numpy as np from toqito.matrix_props import is_pseudo_hermitian H = np.array([[1, 1+1j], [-1+1j, -1]]) eta = np.array([[1, 0], [0, -1]]) print(is_pseudo_hermitian(H, eta)) ``` However, the following matrix \(A\) \[ A = \begin{pmatrix} 1 & i \\ -i & 1 \end{pmatrix} \] is not pseudo-Hermitian with respect to the same signature matrix. ```python exec="1" source="above" import numpy as np from toqito.matrix_props import is_pseudo_hermitian eta = np.array([[1, 0], [0, -1]]) A = np.array([[1, 1j], [-1j, 1]]) print(is_pseudo_hermitian(A, eta)) ``` :raises ValueError: If `signature` is not Hermitian or not invertible. :param mat: The matrix to check. :param signature: The signature matrix \(\eta\), which must be Hermitian and invertible. :param rtol: The relative tolerance parameter (default 1e-05). :param atol: The absolute tolerance parameter (default 1e-08). :returns: Return `True` if the matrix is pseudo-Hermitian, and `False` otherwise.