jax.scipy.linalg.qr#

jax.scipy.linalg.qr(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], overwrite_a: bool = False, lwork: Any = None, mode: Literal['full', 'economic'] = 'full', pivoting: bool = False, check_finite: bool = True) Tuple[jax.Array, jax.Array][source]#
jax.scipy.linalg.qr(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], overwrite_a: bool, lwork: Any, mode: Literal['r'], pivoting: bool = False, check_finite: bool = True) Tuple[jax.Array]
jax.scipy.linalg.qr(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], overwrite_a: bool = False, lwork: Any = None, *, mode: Literal['r'], pivoting: bool = 'False', check_finite: bool = 'True') Tuple[jax.Array]
jax.scipy.linalg.qr(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], overwrite_a: bool = False, lwork: Any = None, mode: str = 'full', pivoting: bool = False, check_finite: bool = True) Union[Tuple[jax.Array], Tuple[jax.Array, jax.Array]]

Compute QR decomposition of a matrix.

LAX-backend implementation of scipy.linalg._decomp_qr.qr().

Does not support the Scipy argument check_finite=True, because compiled JAX code cannot perform checks of array values at runtime.

Does not support the Scipy argument overwrite_*=True.

Original docstring below.

Calculate the decomposition A = Q R where Q is unitary/orthogonal and R upper triangular.

Parameters
  • a ((M, N) array_like) – Matrix to be decomposed

  • mode ({'full', 'r', 'economic', 'raw'}, optional) – Determines what information is to be returned: either both Q and R (β€˜full’, default), only R (β€˜r’) or both Q and R but computed in economy-size (β€˜economic’, see Notes). The final option β€˜raw’ (added in SciPy 0.11) makes the function return two matrices (Q, TAU) in the internal format used by LAPACK.

  • pivoting (bool, optional) – Whether or not factorization should include pivoting for rank-revealing qr decomposition. If pivoting, compute the decomposition A P = Q R as above, but where P is chosen such that the diagonal of R is non-increasing.

  • overwrite_a (bool) –

  • lwork (Optional[Any]) –

  • check_finite (bool) –

Return type

Union[Tuple[Array], Tuple[Array, Array]]

Returns

  • Q (float or complex ndarray) – Of shape (M, M), or (M, K) for mode='economic'. Not returned if mode='r'.

  • R (float or complex ndarray) – Of shape (M, N), or (K, N) for mode='economic'. K = min(M, N).

  • P (int ndarray) – Of shape (N,) for pivoting=True. Not returned if pivoting=False.