Skip to content

qr#

Includes our qr bindings.

Functions:

  • qr

    Computes the QR decomposition of a batch of matrices.

qr #

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, default: 'numpy' ) –

    The location where to compute the QR decomposition. Can be either "numpy" or "cupy".

  • output_module (str, default: None ) –

    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, default: True ) –

    Whether to use pinnend memory if cupy is used. Default is True.

Returns:

  • NDArray

    Unitary matrix Q in the QR decomposition.

  • NDArray

    Upper triangular matrix R in the QR decomposition.