hessenberg

Contents

hessenberg#

class saiunit.lax.hessenberg(x)#

Reduce a square matrix to upper Hessenberg form.

Currently implemented on CPU only.

Parameters:

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

Return type:

tuple[Union[saiunit.Quantity, Array], Array]

Returns:

  • h (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 (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