eigvals

Contents

eigvals#

class saiunit.linalg.eigvals(a, **kwargs)#

Compute the eigenvalues of a general matrix.

SaiUnit implementation of numpy.linalg.eigvals().

Parameters:

a (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Square input of shape (..., M, M).

Returns:

out – Eigenvalues of shape (..., M). Same unit as a.

Return type:

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