cholesky

cholesky(x: array, /, *, upper: bool = False) array

Returns the lower (upper) Cholesky decomposition of a complex Hermitian or real symmetric positive-definite matrix x.

If x is real-valued, let \(\mathbb{K}\) be the set of real numbers \(\mathbb{R}\), and, if x is complex-valued, let \(\mathbb{K}\) be the set of complex numbers \(\mathbb{C}\).

The lower Cholesky decomposition of a complex Hermitian or real symmetric positive-definite matrix \(x \in\ \mathbb{K}^{n \times n}\) is defined as

\[x = LL^{H} \qquad \text{L $\in\ \mathbb{K}^{n \times n}$}\]

where \(L\) is a lower triangular matrix and \(L^{H}\) is the conjugate transpose when \(L\) is complex-valued and the transpose when \(L\) is real-valued.

The upper Cholesky decomposition is defined similarly

\[x = U^{H}U \qquad \text{U $\in\ \mathbb{K}^{n \times n}$}\]

where \(U\) is an upper triangular matrix.

When x is a stack of matrices, the function must compute the Cholesky decomposition for each matrix in the stack.

Note

Whether an array library explicitly checks whether an input array is Hermitian or a symmetric positive-definite matrix (or a stack of matrices) is implementation-defined.

Parameters:
  • x (array) – input array having shape (..., M, M) and whose innermost two dimensions form square complex Hermitian or real symmetric positive-definite matrices. Should have a floating-point data type.

  • upper (bool) – If True, the result must be the upper-triangular Cholesky factor \(U\). If False, the result must be the lower-triangular Cholesky factor \(L\). Default: False.

Returns:

out (array) – an array containing the Cholesky factors for each square matrix. If upper is False, the returned array must contain lower-triangular matrices; otherwise, the returned array must contain upper-triangular matrices. The returned array must have a floating-point data type determined by Type Promotion Rules and must have the same shape as x.

Notes

Changed in version 2022.12: Added complex data type support.