numpy.linalg.eigvalsh()

numpy.linalg.eigvalsh

numpy.linalg.eigvalsh(a, UPLO='L') [source]

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

A complex- or real-valued matrix whose eigenvalues are to be computed.

UPLO : {‘L’, ‘U’}, optional

Same as lower, with ‘L’ for lower and ‘U’ for upper triangular. Deprecated.

Returns:

w : (..., M,) ndarray

The eigenvalues in ascending order, each repeated according to its multiplicity.

Raises:

LinAlgError

If the eigenvalue computation does not converge.

See also

eigh
eigenvalues and eigenvectors of symmetric/Hermitian arrays.
eigvals
eigenvalues of general real or complex arrays.
eig
eigenvalues and right eigenvectors of general real or complex arrays.

Notes

New in version 1.8.0.

Broadcasting rules apply, see the numpy.linalg documentation for details.

The eigenvalues are computed using LAPACK routines _syevd, _heevd

Examples

>>> from numpy import linalg as LA
>>> a = np.array([[1, -2j], [2j, 5]])
>>> LA.eigvalsh(a)
array([ 0.17157288,  5.82842712])

© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.linalg.eigvalsh.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部