Implementing kernel
C++ engine symbols that back this Python API.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 input and
is its scalar factor. This is the standard way to materialise the
factor from a packed QR (geqrf) result.
Parameters
inputTensorPacked reflector matrix of shape
(*, m, k) — columns
contain the Householder vectors (typically the output of an
unpacked geqrf).tauTensorScalar factors of shape
(*, r) with r <= n. Fewer than
n reflectors multiply only the leading columns of the
identity — none at all gives its first n columns.Returns
TensorOrthogonal matrix of shape (*, m, k).
Notes
Raises DtypeMismatch if tau's dtype differs from input's,
ValueError if input is wide (m < n) or tau is longer
than n, and NotImplementedError if both are bool or integer
tensors, whatever their shapes, as the reference does.
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)