eigvals

eigvals(x: array, /) array

Returns the eigenvalues of a real or complex matrix (or a stack of matrices) x.

If x is real-valued, let \(\mathbb{K}\) be the union of the set of real numbers \(\mathbb{R}\) and the set of complex numbers, \(\mathbb{C}\); if x is complex-valued, let \(\mathbb{K}\) be the set of complex numbers \(\mathbb{C}\).

The eigenvalues of a real or complex matrix \(x \in\ \mathbb{K}^{n \times n}\) are defined as the roots (counted with multiplicity) of the polynomial \(p\) of degree \(n\) given by

\[p(\lambda) = \operatorname{det}(x - \lambda I_n)\]

where \(\lambda \in \mathbb{K}\) and where \(I_n\) is the n-dimensional identity matrix.

Note

The eigenvalues of a non-symmetric real matrix are in general complex: for :math:x in mathbb{R}^{n times n}`, the eigenvalues \(\lambda \in \mathbb{C}\), may or may not reside on the real axis of the complex plane.

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 complex floating-point array data type having the same precision as that of x (e.g., if x has a float32 data type, the array must have the complex64 data type; if x has a float64 data type, the array has the complex128 data type).

Notes

  • Eigenvalue sort order is left unspecified and is thus implementation-dependent.

New in version 2025.12.