eigvals#
- class saiunit.linalg.eigvals(a, **kwargs)#
Compute the eigenvalues of a general matrix.
SaiUnit implementation of
numpy.linalg.eigvals().- Parameters:
a (
Union[saiunit.Quantity,Array,ndarray,number,bool]) – Square input of shape(..., M, M).- Returns:
out – Eigenvalues of shape
(..., M). Same unit as a.- Return type:
Union[Array, saiunit.Quantity]
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> a = jnp.array([[1., 2.], ... [2., 1.]]) * u.meter >>> w = u.linalg.eigvals(a) >>> w # eigenvalues carry the unit ArrayImpl([ 3.+0.j, -1.+0.j], dtype=complex64) * meter