Skip to content
fn

eigvals

→Tensor
eigvals(input: Tensor)

Compute only the eigenvalues of a general square matrix.

Returns the roots λ1,…,λn\lambda_1, \ldots, \lambda_n of the characteristic polynomial det⁡(A−λI)=0\det(A - \lambda I) = 0 without computing the eigenvectors. Equivalent to eig(A)[0] but skips the eigenvector assembly.

Parameters

inputTensor
Square matrix of shape (*, n, n).

Returns

Tensor

Eigenvalues of shape (*, n).

Notes

Cost is O(n3)O(n^3) and dominated by the Hessenberg reduction. No autograd support — use eigvalsh for symmetric / Hermitian matrices when gradients are required.

Examples

>>> import lucid
>>> from lucid.linalg import eigvals
>>> eigvals(lucid.tensor([[2.0, 0.0], [0.0, 3.0]]))
tensor([(2.+0.j), (3.+0.j)], dtype=lucid.complex64)