jax.lax.linalg.qr

jax.lax.linalg.qr(x, full_matrices=True)[source]

QR decomposition.

Computes the QR decomposition

\[A = Q . R\]

of matrices \(A\), such that \(Q\) is a unitary (orthogonal) matrix, and \(R\) is an upper-triangular matrix.

Parameters
  • x – A batch of matrices with shape [..., m, n].

  • full_matrices (bool) – Determines if full or reduced matrices are returned; see below.

Returns

A pair of arrays (q, r).

Array q is a unitary (orthogonal) matrix, with shape [..., m, m] if full_matrices=True, or [..., m, min(m, n)] if full_matrices=False.

Array r is an upper-triangular matrix with shape [..., m, n] if full_matrices=True, or [..., min(m, n), n] if full_matrices=False.