On this page
If a matrix is symmetric and positive definite, you can split it into a lower triangular matrix times its own transpose. That split, A = LLᵀ, is the Cholesky decomposition: a special form of LU decomposition in which the upper factor is the transpose of the lower one.
What is the Cholesky decomposition?
For a symmetric positive-definite matrix A, the Cholesky factorization always exists, and requiring the diagonal of the triangular factor to be positive makes it unique, as Nick Higham explains in What is a Cholesky factorization?. He calls it a generalisation of the fact that a positive number has a unique positive square root. It is named after André-Louis Cholesky (1875–1918), a French military officer who developed it for least-squares problems in geodesy and surveying.
The method was published posthumously in 1924, according to the Wikipedia article on the Cholesky decomposition. The same article gives its cost as about n³/3 floating-point operations against 2n³/3 for LU, so it is roughly twice as efficient for solving linear systems.
How do you compute L entry by entry?
Work column by column, top to bottom. For each column j:
Diagonal entry: L(j,j) = √( A(j,j) − sum of L(j,k)² for k < j ).
Entries below it, for i > j: L(i,j) = ( A(i,j) − sum of L(i,k)·L(j,k) for k < j ) / L(j,j).
These are the formulas in the Wikipedia article, taking the positive root.
A worked 3×3 example
Take A with rows (4, 2, −2), (2, 10, 2), (−2, 2, 6). It is symmetric.
L(1,1) = √4 = 2.
L(2,1) = 2/2 = 1 and L(3,1) = −2/2 = −1.
L(2,2) = √(10 − 1²) = √9 = 3.
L(3,2) = (2 − (−1)(1))/3 = 3/3 = 1.
L(3,3) = √(6 − (−1)² − 1²) = √4 = 2.
So L has rows (2, 0, 0), (1, 3, 0), (−1, 1, 2). Multiply out LLᵀ and you get A back.
Now use it. To solve Ax = b with b = (4, 14, 6), solve two triangular systems instead of one full one:
Forward: Ly = b gives y1 = 2, then 2 + 3y2 = 14 so y2 = 4, then −2 + 4 + 2y3 = 6 so y3 = 2.
Back: Lᵀx = y gives x3 = 1, then 3x2 + 1 = 4 so x2 = 1, then 2x1 + 1 − 1 = 2 so x1 = 1.
So x = (1, 1, 1). If you want more matrices to practise on, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For the older cousin of this method, see our guide to LU decomposition with a worked 3×3 example.
Why does Cholesky fail when A is not positive definite?
The number under each square root is not arbitrary. At step k it equals the ratio of two leading principal minors: det of the top-left k×k block divided by det of the top-left (k−1)×(k−1) block. In our example the minors are 4, 36 and 144, and the ratios 4, 9 and 4 are exactly the squares of the diagonal 2, 3 and 2.
Sylvester's criterion says a symmetric matrix is positive definite if and only if all its leading principal minors are positive (Sylvester's criterion). So every square root has a positive number under it precisely when A is positive definite. If A is not, the algorithm meets a negative number or a zero, and stops; Higham's explainer describes this failure step.
Try it: change the last entry of A from 6 to 1. Step 5 becomes √(1 − 1 − 1) = √(−1), and the method halts. That halt is a useful test in itself, one of the ideas in our post on three ways to tell if a matrix is positive definite. Software uses the same halt: the numpy.linalg.cholesky function raises LinAlgError if the decomposition fails, for example when the matrix is not positive definite.
How is Cholesky used to simulate correlated random variables?
The Cholesky decomposition is commonly used in Monte Carlo simulation of systems with several correlated variables (Wikipedia). Factor the covariance matrix as LLᵀ, draw independent standard normal numbers z, and set x = Lz. Then x has the covariance you asked for.
For two variables with unit variance and correlation ρ, L has rows (1, 0) and (ρ, √(1 − ρ²)). Say you want ρ = 0.6, as a made-up model of a student's physics and maths scores. Then x1 = z1 and x2 = 0.6z1 + 0.8z2. Check: the variance of x2 is 0.36 + 0.64 = 1, and its covariance with x1 is 0.6. The rules behind that check are in our post on the variance of a sum of random variables.
If positive definiteness or minors still feel shaky, start from the idea itself in the Fermi Concept Library, then come back and redo the 3×3 example by hand.



