schur

Contents

schur#

class saiunit.lax.schur(x, compute_schur_vectors=True, sort_eig_vals=False, select_callable=None)#

Schur decomposition.

Compute the Schur decomposition \(A = Q \cdot T \cdot Q^H\) where \(T\) is upper-triangular (quasi-triangular for real matrices) and \(Q\) is unitary.

Parameters:
  • x (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – A batch of square matrices with shape [..., n, n].

  • compute_schur_vectors (bool) – If True, compute the Schur vectors Q. Default is True.

  • sort_eig_vals (bool) – If True, sort eigenvalues. Default is False.

  • select_callable (Callable[..., Any] | None) – A function used to select eigenvalues for reordering. Default is None.

Return type:

tuple[Array, saiunit.Quantity | Array]

Returns:

  • t (jax.Array) – The Schur form (unitless).

  • q (jax.Array or Quantity) – The Schur vectors. If x has a unit, q preserves that unit.

Examples

>>> import jax.numpy as jnp
>>> import saiunit as u
>>> import saiunit.lax as sulax
>>> A = jnp.array([[1.0, 2.0], [3.0, 4.0]]) * u.second
>>> t, q = sulax.schur(A)
>>> u.get_unit(q) == u.second
True