Cholesky

Shipping
matrix_cholesky

Cholesky factor L of a symmetric positive-definite matrix (A = L·Lᵀ)

Signature

Inputs

  • aSignal|ArrayrequiredA symmetric positive-definite 2-D matrix.

Outputs

  • lMatrixThe lower-triangular Cholesky factor $L$ with $A = L L^\top$.

Description

Cholesky factorizes a symmetric positive-definite matrix as , returning the lower-triangular factor via the MKL LAPACK backend. It is roughly twice as efficient as a general LU factorization and is the standard tool for sampling correlated Gaussians, solving SPD systems, and whitening data.

The input must be genuinely positive-definite; a non-SPD matrix (indefinite or merely positive-semidefinite) produces a graceful backend error rather than a panic — which itself doubles as a positive-definiteness test. The output is a dimensionless lower-triangular matrix.

Mathematics

Examples

Correlating white noise

Given a target covariance , wire it into a to obtain with . Multiplying by a vector of independent unit-variance samples (via tensor_matmul) produces samples with exactly the covariance .

Applications

  • Sampling correlated multivariate Gaussian noise ($x = L z$).
  • Efficiently solving SPD linear systems and normal equations.
  • Testing positive-definiteness of a covariance or Gram matrix.
  • Whitening / decorrelating data via $L^{-1}$.

Neat

Cholesky failure is a feature: a backend error on a non-SPD input is a cheap, exact positive-definiteness check.

At ~2× the speed of LU on SPD matrices, it is the preferred factorization wherever positive-definiteness is guaranteed.

Known issues

Indefinite or only semidefinite matrices error out — for those use matrix_eigh or matrix_svd instead.

Only the (assumed symmetric) triangle is used; a non-symmetric input is not a meaningful Cholesky target.

See also

choleskyspddecompositionlinear-algebralapackmklstateless