qttools.kernels.linalg.qr#
source module qttools.kernels.linalg.qr
Functions
-
qr — Computes the QR decomposition of a batch of matrices.
source qr(A: NDArray, compute_module: str = 'numpy', output_module: str | None = None, use_pinned_memory: bool = True) → tuple[NDArray, NDArray]
Computes the QR decomposition of a batch of matrices.
If compute_module is "numpy", the computation is done with numpy and parallelized with numba. Only mode 'reduced' is supported due to numba limitations.
Parameters
-
A : NDArray — The matrices.
-
compute_module : str, optional — The location where to compute the QR decomposition. Can be either "numpy" or "cupy".
-
output_module : str, optional — The location where to store the QR decomposition. Can be either "numpy" or "cupy". If None, the output location is the same as the input location
-
use_pinned_memory : bool, optional — Whether to use pinnend memory if cupy is used. Default is
True
.
Returns
-
NDArray : NDArray — Unitary matrix Q in the QR decomposition.
-
NDArray : NDArray — Upper triangular matrix R in the QR decomposition.
Raises
-
ValueError