dpnp.linalg.eigvalsh

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

Compute the eigenvalues of a complex Hermitian or real symmetric matrix.

Main difference from dpnp.linalg.eigh: the eigenvectors are not computed.

For full documentation refer to numpy.linalg.eigvalsh.

Parameters:
  • a ((..., M, M) {dpnp.ndarray, usm_ndarray}) -- A complex- or real-valued array whose eigenvalues are to be computed.

  • UPLO ({"L", "U"}, optional) -- Specifies the calculation uses either the lower ("L") or upper ("U") triangular part of the matrix. Regardless of this choice, only the real parts of the diagonal are considered to preserve the Hermite matrix property. It therefore follows that the imaginary part of the diagonal will always be treated as zero. Default: "L".

Returns:

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

Return type:

(..., M) dpnp.ndarray

See also

dpnp.linalg.eigh

Return the eigenvalues and eigenvectors of a complex Hermitian (conjugate symmetric) or a real symmetric matrix.

dpnp.linalg.eigvals

Compute the eigenvalues of a general matrix.

dpnp.linalg.eig

Compute the eigenvalues and right eigenvectors of a general matrix.

Examples

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