fn
householder_product
→Tensorhouseholder_product(H: Tensor, tau: Tensor)Reconstruct an orthogonal matrix from Householder reflectors.
Computes the implicit product
where each is a Householder vector stored in the
-th column of the packed input H and
is its scalar factor. This is the standard way to materialise the
factor from a packed QR (geqrf) result.
Parameters
HTensorPacked reflector matrix of shape
(*, m, k) — columns
contain the Householder vectors (typically the output of an
unpacked geqrf).tauTensorScalar factors of shape
(*, k).Returns
TensorOrthogonal matrix of shape (*, m, k).
Notes
Backed by LAPACK orgqr. Cost is . Useful
when a routine returns the packed Householder form (cheaper to
store) but the explicit is needed downstream.
Examples
>>> import lucid
>>> from lucid.linalg import qr, householder_product
>>> A = lucid.randn(4, 3)
>>> Q, R = qr(A, mode="reduced")
>>> # The same Q can be reconstructed from packed Householder reflectors
>>> # returned by lower-level geqrf-style factorisations.
>>> Q.shape
(4, 3)