Compute the eigenvalues of a Hermitian or real symmetric matrix.
Main difference from eigh: the eigenvectors are not computed.
Parameters: | a : (..., M, M) array_like
UPLO : {‘L’, ‘U’}, optional
|
---|---|
Returns: | w : (..., M,) ndarray
|
Raises: | LinAlgError :
|
See also
Notes
Broadcasting rules apply, see the numpy.linalg documentation for details.
The eigenvalues are computed using LAPACK routines _ssyevd, _heevd
Examples
>>> from numpy import linalg as LA
>>> a = np.array([[1, -2j], [2j, 5]])
>>> LA.eigvalsh(a)
array([ 0.17157288+0.j, 5.82842712+0.j])