linalg_householder_product {torch}R Documentation

Computes the first n columns of a product of Householder matrices.

Description

Letting K\mathbb{K} be R\mathbb{R} or C\mathbb{C}, for a matrix VKm×nV \in \mathbb{K}^{m \times n} with columns viKmv_i \in \mathbb{K}^m with mnm \geq n and a vector τKk\tau \in \mathbb{K}^k with knk \leq n, this function computes the first nn columns of the matrix

Usage

linalg_householder_product(A, tau)

Arguments

A

(Tensor): tensor of shape ⁠(*, m, n)⁠ where * is zero or more batch dimensions.

tau

(Tensor): tensor of shape ⁠(*, k)⁠ where * is zero or more batch dimensions.

Details

Math could not be displayed. Please visit the package website.

where Im\mathrm{I}_m is the m-dimensional identity matrix and vHv^{H} is the conjugate transpose when vv is complex, and the transpose when vv is real-valued. See Representation of Orthogonal or Unitary Matrices for further details.

Supports inputs of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if the inputs are batches of matrices then the output has the same batch dimensions.

Note

This function only uses the values strictly below the main diagonal of A. The other values are ignored.

See Also

Other linalg: linalg_cholesky_ex(), linalg_cholesky(), linalg_det(), linalg_eigh(), linalg_eigvalsh(), linalg_eigvals(), linalg_eig(), linalg_inv_ex(), linalg_inv(), linalg_lstsq(), linalg_matrix_norm(), linalg_matrix_power(), linalg_matrix_rank(), linalg_multi_dot(), linalg_norm(), linalg_pinv(), linalg_qr(), linalg_slogdet(), linalg_solve_triangular(), linalg_solve(), linalg_svdvals(), linalg_svd(), linalg_tensorinv(), linalg_tensorsolve(), linalg_vector_norm()

Examples

if (torch_is_installed()) {
A <- torch_randn(2, 2)
h_tau <- torch_geqrf(A)
Q <- linalg_householder_product(h_tau[[1]], h_tau[[2]])
torch_allclose(Q, linalg_qr(A)[[1]])
}

[Package torch version 0.13.0 Index]