matrix_props.is_pseudo_hermitian¶
Checks if matrix is pseudo hermitian with respect to given signature.
Functions¶
|
Check if a matrix is pseudo-Hermitian. |
Module Contents¶
- matrix_props.is_pseudo_hermitian.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.
Examples
Consider the following matrix:
\[\begin{split}H = \begin{pmatrix} 1 & 1+i \\ -1+i & -1 \end{pmatrix}\end{split}\]with the signature matrix:
\[\begin{split}\eta = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\end{split}\]Our function confirms that \(H\) is pseudo-Hermitian:
>>> 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]]) >>> is_pseudo_hermitian(H, eta) True
However, the following matrix \(A\)
\[\begin{split}A = \begin{pmatrix} 1 & i \\ -i & 1 \end{pmatrix}\end{split}\]is not pseudo-Hermitian with respect to the same signature matrix:
>>> A = np.array([[1, 1j], [-1j, 1]]) >>> is_pseudo_hermitian(A, eta) False
References
- Parameters:
mat (numpy.ndarray) – The matrix to check.
signature (numpy.ndarray) – The signature matrix \(\eta\), which must be Hermitian and invertible.
rtol (float) – The relative tolerance parameter (default 1e-05).
atol (float) – The absolute tolerance parameter (default 1e-08).
- Raises:
ValueError – If signature is not Hermitian or not invertible.
- Returns:
Return
True
if the matrix is pseudo-Hermitian, andFalse
otherwise.- Return type:
bool