Skip to content

qttools.kernels.linalg.svd#

source module qttools.kernels.linalg.svd

Functions

  • svd Computes the singular value decomposition of a matrix on a given location.

source svd(A: NDArray, full_matrices: bool = True, compute_module: str = 'numpy', output_module: str | None = None, use_pinned_memory: bool = True)tuple[NDArray, NDArray, NDArray]

Computes the singular value decomposition of a matrix on a given location.

The kwargs compute_uv and hermitian are not supported. They are implicitly set to True and False, respectively.

Parameters

  • A : NDArray The matrix.

  • full_matrices : bool, optional Whether to compute the full matrices u and vh (see numpy.linalg.svd).

  • compute_module : str, optional The location where to compute the singular value decomposition. Can be either "numpy" or "cupy".

  • output_module : str, optional The location where to store the singular value 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 The left singular vectors.

  • NDArray : NDArray The singular values.

  • NDArray : NDArray The right singular vectors.

Raises

  • ValueError