Python wrappers
Public Python APIs implemented by this engine symbol.Compute eigenvalues and eigenvectors of a real symmetric square matrix.
Math
with and .
Shape
- Input
a:(..., n, n), symmetric - Output
w:(..., n), real, ascending - Output
V:(..., n, n), orthonormal columns
See Also
[[eig_op]] : General non-symmetric eigendecomposition (use only when the symmetric structure cannot be exploited).
Parameters
aconst TensorImplPtr&Square float tensor of shape
(..., n, n), interpreted as symmetric. Only the lower triangle is read; the strict upper triangle is ignored. Leading dimensions are independent batch axes. Must be at least 2-D and floating-point.Returns
std::vector<TensorImplPtr>Two-element vector {w, V} where: - w has shape (..., n) — real eigenvalues in ascending order. - V has shape (..., n, n) — columns are the orthonormal eigenvectors corresponding to w.
Raises
LinAlgErrorWhen
a is not at least 2-D, not square, or not float-typed. Also when LAPACK *syevd / *heevd fails to converge (reported via info > 0).Notes
Outputs are leaf nodes — autograd is not wired. See header-level Notes for the closed-form backward and its caveats around sign ambiguity / spectral degeneracy.
Examples
In Python (via [[lucid.linalg.eigh]]):
>>> A = lucid.tensor([[2.0, 1.0], [1.0, 2.0]])
>>> w, V = lucid.linalg.eigh(A)
>>> w
Tensor([1., 3.])