fn
eigvalsh
→Tensoreigvalsh(x: Tensor, UPLO: str = 'L')Eigenvalues of a Hermitian / symmetric matrix.
Returns only the real eigenvalues of a symmetric (real) or Hermitian (complex) matrix
without forming the eigenvectors. Equivalent to eigh(A)[0]
but skips eigenvector assembly when no gradients are requested.
Parameters
xTensorSymmetric / Hermitian matrix of shape
(*, n, n).UPLOstr= 'L'"L" reads the lower triangle (default), "U" the upper.Returns
TensorEigenvalues in ascending order, shape (*, n).
Notes
When x.requires_grad is true the call routes through
eigh so that backward via the Loewner formula remains
available. Otherwise the engine kernel is invoked directly.
Examples
>>> import lucid
>>> from lucid.linalg import eigvalsh
>>> eigvalsh(lucid.tensor([[2.0, 1.0], [1.0, 3.0]]))
Tensor([1.3820, 3.6180])