linalg_householder_product {torch}R Documentation

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

Description

Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, for a matrix V \in \mathbb{K}^{m \times n} with columns v_i \in \mathbb{K}^m with m \geq n and a vector \tau \in \mathbb{K}^k with k \leq n, this function computes the first n 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

Equation not displayed. Install 'katex' then re-install 'torch'.

where \mathrm{I}_m is the m-dimensional identity matrix and v^{H} is the conjugate transpose when v is complex, and the transpose when v 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(), 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.12.0 Index]