hessenberg

Contents

hessenberg#

class brainunit.lax.hessenberg(x)#

Reduce a square matrix to upper Hessenberg form.

Currently implemented on CPU only.

Parameters:

x (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – A floating-point or complex square matrix (or batch of matrices) with shape [..., n, n].

Return type:

tuple[saiunit.Quantity | Array, Array]

Returns:

  • h (jax.Array or Quantity) – The upper Hessenberg form. The upper triangle and first sub-diagonal contain the Hessenberg matrix; elements below the first sub-diagonal hold the Householder reflectors. If x has a unit, h preserves that unit.

  • taus (jax.Array) – Scalar factors of the elementary Householder reflectors (unitless).

See also

saiunit.lax.householder_product

Reconstruct Q from reflectors.

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
>>> h, taus = sulax.hessenberg(A)
>>> u.get_unit(h) == u.second
True