jax.numpy.linalg.eigvalsh#
- jax.numpy.linalg.eigvalsh(a, UPLO='L')[source]#
Compute the eigenvalues of a Hermitian matrix.
JAX implementation of
numpy.linalg.eigvalsh().- Parameters:
a (ArrayLike) – array of shape
(..., M, M), containing the Hermitian (if complex) or symmetric (if real) matrix.UPLO (str | None) – specifies whether the calculation is done with the lower triangular part of
a('L', default) or the upper triangular part ('U').
- Returns:
An array of shape
(..., M)containing the eigenvalues, sorted in ascending order.- Return type:
See also
jax.numpy.linalg.eig(): general eigenvalue decomposition.jax.numpy.linalg.eigh(): computes eigenvalues and eigenvectors of a Hermitian matrix.
Examples
>>> a = jnp.array([[1, -2j], ... [2j, 1]]) >>> w = jnp.linalg.eigvalsh(a) >>> w Array([-1., 3.], dtype=float32)