eig#
- class saiunit.linalg.eig(a, **kwargs)#
Compute the eigenvalues and eigenvectors of a square matrix.
SaiUnit implementation of
numpy.linalg.eig().The eigenvalues carry the same unit as a; the eigenvectors are dimensionless.
- Parameters:
a (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – Square input of shape(..., M, M).- Return type:
tuple[Array| saiunit.Quantity,Array| saiunit.Quantity]- Returns:
eigenvalues (ndarray or Quantity) – Shape
(..., M). Carries the same unit as a.eigenvectors (ndarray) – Shape
(..., M, M). Columnv[:, i]corresponds toeigenvalues[i].
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> a = jnp.array([[1., 2.], ... [2., 1.]]) * u.meter >>> w, v = u.linalg.eig(a) >>> w # eigenvalues carry the unit ArrayImpl([ 3.+0.j, -1.+0.j], dtype=complex64) * meter