eigvalsh¶
- eigvalsh(x: array, /) array ¶
Returns the eigenvalues of a complex Hermitian or real symmetric matrix (or a stack of matrices)
x
.If
x
is real-valued, let be the set of real numbers , and, ifx
is complex-valued, let be the set of complex numbers .The eigenvalues of a complex Hermitian or real symmetric matrix
are defined as the roots (counted with multiplicity) of the polynomial of degree given bywhere
and where is the n-dimensional identity matrix.Note
Whether an array library explicitly checks whether an input array is Hermitian or a symmetric matrix (or a stack of matrices) is implementation-defined.
Note
The function
eigvals
will be added in a future version of the specification.- Parameters:
x (array) – input array having shape
(..., M, M)
and whose innermost two dimensions form square matrices. Should have a floating-point data type.- Returns:
out (array) – an array containing the computed eigenvalues. The returned array must have shape
(..., M)
and have a real-valued floating-point data type whose precision matches the precision ofx
(e.g., ifx
iscomplex128
, then must have afloat64
data type).
Notes
Note
Eigenvalue sort order is left unspecified and is thus implementation-dependent.
Changed in version 2022.12: Added complex data type support.