Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Cholesky Decomposition






The Square Root of a Symmetric Positive Definite Matrix

The Cholesky decomposition factors a symmetric positive definite matrix as A = LLᵀ, where L is lower triangular with positive diagonal entries. It exploits symmetry to achieve half the cost of LU, requires no pivoting, and doubles as a positive definiteness test. It is the fastest direct solver for the class of matrices that appears most often in optimization, statistics, and simulation.



What Cholesky Decomposition Is

The Cholesky decomposition writes a symmetric positive definite matrix AA as

Cholesky Decomposition
A=LLTA = LL^T

where LL is lower triangular with strictly positive diagonal entries. The matrix LL is the Cholesky factor — the matrix "square root" of AA in the sense that AA is reconstructed by multiplying LL by its own transpose.

THEOREM
The factorization is unique: for a given symmetric positive definite AA, there is exactly one lower triangular LL with positive diagonal satisfying A=LLTA = LL^T.

The convention can also be written A=RTRA = R^TR with R=LTR = L^T upper triangular — the choice between lower and upper is a matter of convention.
A3×3422253236=L3×3200120112·Lᵀ3×3211021002
A = LLᵀ, complete

The finished Cholesky factor L, lower triangular with positive diagonal entries, and its mirror image LT. One triangle is enough to rebuild the whole symmetric matrix: L times its own transpose gives A back. That is why Cholesky costs half of LU — half of the factorization comes free by symmetry. Follow the column-by-column computation on the Cholesky decomposition visualizer.

A symmetric positive definite matrix is exactly one that can be written this way.

Cholesky Notation

Notation

Cholesky Notation

One letter does the work of two, a word that sounds like a claim about entries is a claim about something else entirely, and a set of quotation marks marks the one place the wording is loose.
The habit of naming a factorisation by its factors is described at the singular value decomposition, and the unit diagonal, the multiplier entries and the one-sided permutation PA=LUPA = LU at LU. Transpose notation itself belongs to matrix operations.
A=LLTA = LL^{T}
A equals L times L transpose
Every other factorisation on this site names its factors with separate letters. Here there is one factor, written twice, and the second appearance is fully determined by the first. That is the notation carrying a fact: LLTLL^{T} comes out symmetric no matter what LL is, so the shape of the equation already restricts which matrices can appear on the left.
CasesOnly the lower triangle of LL is ever stored. The transposed copy is the same array of numbers read in the other direction, which is where the halved storage comes from.
Also writtenThe upper-first spelling A=RTRA = R^{T}R with R=LTR = L^{T} is the identical factorisation, and both are called the Cholesky decomposition. Which one a library returns is a convention, not a result.
Do not confuseReading the second factor as an independent unknown to be found. There is nothing to solve for beyond LL — the algorithm produces one triangular matrix and the equation supplies the rest.
Same glyph elsewhereLL is also the lower factor at LU, where it is unit lower triangular and its partner UU is independent. The two LL matrices of one symmetric AA are different matrices.
xTAx>0for all x≠0\mathbf{x}^{T}A\mathbf{x} > 0 \quad \text{for all } \mathbf{x} \neq \mathbf{0}
x transpose A x is greater than zero for every nonzero vector x
The sandwich collapses to a single number: a row times a matrix times a column leaves a scalar, not a matrix. Positive in the name positive definite describes those numbers and nothing else. Definite carries the strictness — every nonzero x\mathbf{x}, with no exceptions allowed.
CasesSemi-definite weakens >> to ≥\geq, admitting vectors the form sends to zero. Indefinite means both signs occur. Each weakening changes exactly one symbol and changes which factorisation exists.
Also writtenCompressed to A≻0A \succ 0, with the curved comparison sign chosen precisely so it cannot be read entrywise; A⪰0A \succeq 0 is the semi-definite case. Plain A>0A > 0 appears too and is ambiguous for that reason.
Do not confuseTaking positive to describe the entries of AA. The worked example on this page is positive definite and contains −2-2 and −1-1; a matrix whose entries are all positive need not be positive definite. The two properties are unrelated.
LLT=A,LL≠ALL^{T} = A, \qquad LL \neq A
L times L transpose is A, but L times L is not
LL is described as a matrix square root, and the quotation marks around that phrase are doing real work. A square root normally multiplies by itself; this one multiplies by its transpose. LLLL is again lower triangular and cannot equal a full symmetric AA.
CasesA genuine matrix square root exists: the unique symmetric positive definite SS with SS=ASS = A, built from the eigenvalues. It is a different matrix from LL — SS is symmetric, LL is triangular — and it costs far more to compute.
Also writtenThe true root is written A1/2A^{1/2}. The Cholesky factor is written LL and should not inherit that exponent.
Do not confuseWriting A1/2A^{1/2} for the Cholesky factor. Both reproduce AA through a product, and they are not the same matrix; substituting one for the other silently changes any result that depends on symmetry.
PAPT=LLTPAP^{T} = LL^{T}
P A P transpose equals L L transpose
PP stands on both sides because one side alone would break the symmetry the method depends on. Multiplying on the left reorders the rows; multiplying by PTP^{T} on the right applies the same reordering to the columns, so an entry and its mirror image move together and the result is still symmetric.
CasesSince PP is a permutation, PT=P−1P^{T} = P^{-1}, so PAPTPAP^{T} is similar to AA: the eigenvalues are untouched, and with them positive definiteness. Reordering is safe here in a way that is not obvious from the symbols.
Also writtenWritten PTAPP^{T}AP when the permutation is defined in the opposite direction, which describes the same reordering with PP replaced by its inverse.
Do not confuseThe one-sided PA=LUPA = LU at LU. There the swaps act on rows only, because nothing about LULU requires symmetry; copying that form here would produce a matrix with no Cholesky factorisation at all.
A=LDLT,LChol=LUD1/2A = LDL^{T}, \qquad L_{\text{Chol}} = L_UD^{1/2}
A equals L D L transpose, and the Cholesky factor is the unit lower triangular L times the square root of D
The two factorisations differ only in whether the diagonal is carried separately. In LDLTLDL^{T} the triangular factor has ones on its diagonal and DD holds the positive numbers; the Cholesky factor absorbs D\sqrt{D} and gives up the ones.
CasesD1/2D^{1/2} means the diagonal matrix of square roots of the entries. For a diagonal matrix that happens to agree with the genuine matrix square root, which is why the exponent passes here without comment and would not for a general matrix.
Also writtenLDLTLDL^{T} is the square-root-free variant, computing DD and the unit factor separately. It survives some semi-definite matrices that break the standard algorithm.
Do not confuseThe two lower triangular factors of one AA. They differ by a diagonal scaling and sources write LL for both, so a factor taken from one formula and used in the other is wrong by exactly D1/2D^{1/2}.
Same glyph elsewhereDD holds eigenvalues at diagonalization and pivots here. Both are diagonal matrices of positive numbers for a positive definite AA, and they are not the same numbers.

Existence: Symmetric Positive Definite Matrices

THEOREM
The Cholesky factorization exists if and only if AA is symmetric and positive definite.

Symmetry means A=ATA = A^T. Positive definiteness means xTAx>0\mathbf{x}^TA\mathbf{x} > 0 for every nonzero vector x\mathbf{x}.

Pitfall: Skipping the symmetry check
Testing only positivity passes B=(4025)B = \begin{pmatrix} 4 & 0 \\ 2 & 5 \end{pmatrix}: its eigenvalues 4,54, 5 and leading minors 4,204, 20 are all positive. But B≠BTB \neq B^T, so no LL exists; the formulas still return an LL, with LLT=(4225)≠BLL^T = \begin{pmatrix} 4 & 2 \\ 2 & 5 \end{pmatrix} \neq B.

Several equivalent conditions characterize positive definiteness: all eigenvalues of AA are strictly positive; all leading principal minors (the determinants of the upper-left k×kk \times k submatrices) are positive; all pivots in Gaussian elimination (without pivoting) are positive.

If either symmetry or positive definiteness fails, there is no Cholesky factor. A non-symmetric matrix has no LLTLL^T form. A symmetric matrix that is positive semi-definite (some eigenvalue is zero) produces a zero on the diagonal of LL. An indefinite matrix (eigenvalues of both signs) produces a negative number under the square root, halting the algorithm.

These equivalent characterizations differ in computational cost and in when each is the practical tool of choice.
Decompositions · positive definiteness

Four criteria, four prices

All four decide the same question and any of them could serve as the definition. What separates them is cost — from not computable at all to cheaper than anything else on the page.

4criteria
TypeConditionconditioncostuse it when
Not a computation
The definition§ 2the statement itselfxTAx>0\mathbf{x}^{\mathsf{T}}A\mathbf{x} > 0 for every x≠0\mathbf{x} \neq \mathbf{0}not directly testableproofs and derivations
Computable, expensive
Eigenvalue signs§ 2all λi>0\lambda_i > 0every eigenvalue strictly positiveO(n3)O(n^3), iterativethe eigenvalues are wanted anyway
Leading principal minors§ 2every upper-left k×kk \times k determinant >0> 0det⁡Ak>0\det A_k > 0 for k=1,…,nk = 1, \ldots, nnn determinantssmall or symbolic matrices
Computable, cheapest
Cholesky attempt§ 7the algorithm runs to completionno negative under a square root13n3\tfrac{1}{3}n^3, terminatingwhenever the answer is needed
They are equivalent, so the choice is purely practical: the definition for proving, the eigenvalues when they are wanted anyway, the minors for small symbolic matrices, and Cholesky whenever the answer is actually needed. That the cheapest test also produces a useful factorization is what makes it the standard one.
Four criteria, four prices·/linear-algebra/decompositions/choleskyLearn Math Class
Reading down the cost column is the argument for the last row. The definition cannot be evaluated at all, being quantified over infinitely many vectors; the eigenvalue test converges rather than terminating and returns numbers that must then be compared against zero; the minors need nn determinants. Cholesky settles the question in 13n3\tfrac{1}{3}n^3 operations, terminates, and hands back the factorization when the answer is yes — so the test is free whenever the answer was the one you wanted.

The Algorithm

The Cholesky factor LL is computed column by column, from left to right.

For column jj, the diagonal entry is

Cholesky Diagonal Formula
ljj=ajj−∑k=1j−1ljk2l_{jj} = \sqrt{a_{jj} - \sum_{k=1}^{j-1} l_{jk}^2}

and the sub-diagonal entries (for i>ji > j) are

Cholesky Off-Diagonal Formula
lij=1ljj(aij−∑k=1j−1likljk)l_{ij} = \frac{1}{l_{jj}}\left(a_{ij} - \sum_{k=1}^{j-1} l_{ik}l_{jk}\right)

The square root in the diagonal formula is always real and positive because positive definiteness guarantees that the expression under the root is strictly positive at every step.

Worked Example


For A=(42−2251−216)A = \begin{pmatrix} 4 & 2 & -2 \\ 2 & 5 & 1 \\ -2 & 1 & 6 \end{pmatrix}:

l11=4=2l_{11} = \sqrt{4} = 2. l21=2/2=1l_{21} = 2/2 = 1. l31=−2/2=−1l_{31} = -2/2 = -1.

l22=5−12=4=2l_{22} = \sqrt{5 - 1^2} = \sqrt{4} = 2. l32=(1−(−1)(1))/2=2/2=1l_{32} = (1 - (-1)(1))/2 = 2/2 = 1.

l33=6−(−1)2−12=4=2l_{33} = \sqrt{6 - (-1)^2 - 1^2} = \sqrt{4} = 2.

The Algorithm
L=(200120−112)L = \begin{pmatrix} 2 & 0 & 0 \\ 1 & 2 & 0 \\ -1 & 1 & 2 \end{pmatrix}

Verification: LLT=(42−2251−216)=ALL^T = \begin{pmatrix} 4 & 2 & -2 \\ 2 & 5 & 1 \\ -2 & 1 & 6 \end{pmatrix} = A.

Pitfall: Dropping the subtracted sum
Computing l32=a32/l22=12l_{32} = a_{32}/l_{22} = \frac{1}{2} leaves out l31l21=−1l_{31}l_{21} = -1. Entry (3,2)(3, 2) of LLTLL^T then comes out (−1)(1)+12⋅2=0(-1)(1) + \frac{1}{2} \cdot 2 = 0, not a32=1a_{32} = 1. With the sum, l32=(1−(−1)(1))/2=1l_{32} = (1 - (-1)(1))/2 = 1.

Each entry of LL is built from the matching entry of AA and from entries of LL already found to its left. The first column uses only AA and l11l_{11}, while every later entry first subtracts the products collected so far: l32l_{32} draws on l31l_{31} and l21l_{21}, and l33l_{33} on the whole third row before it. This is why the columns have to be computed in order, from left to right.
A3×3422253236=L3×32001201??·Lᵀ3×321102?00?
A diagonal entry taken as a square root

Each diagonal entry of the factor is the square root of what is left after the entries already computed in that row have been subtracted off. The whole algorithm alternates between these roots and simple divisions, and it touches only half the matrix because symmetry makes the other half redundant. Run it entry by entry on the Cholesky decomposition visualizer.

Working on half the matrix is what makes this roughly twice as fast as the LU factorisation it specialises.

Solving Systems with Cholesky

Given A=LLTA = LL^T, the system Ax=bA\mathbf{x} = \mathbf{b} is solved in two steps:

Forward substitution: solve Ly=bL\mathbf{y} = \mathbf{b} for y\mathbf{y}. Cost: O(n2)O(n^2).

Back substitution: solve LTx=yL^T\mathbf{x} = \mathbf{y} for x\mathbf{x}. Cost: O(n2)O(n^2).

Pitfall: Using L in both solves
Solving Lx=yL\mathbf{x} = \mathbf{y} in the second step solves L2x=bL^2\mathbf{x} = \mathbf{b}. For the worked example with b=(0,6,7)T\mathbf{b} = (0, 6, 7)^T, so y=(0,3,2)T\mathbf{y} = (0, 3, 2)^T, it gives x=(0,32,14)T\mathbf{x} = (0, \frac{3}{2}, \frac{1}{4})^T. Back substitution on LTL^T gives x=(0,1,1)T\mathbf{x} = (0, 1, 1)^T.

The structure is identical to LU, but only one triangular factor needs to be stored. The other is its transpose, which costs nothing extra — the same array of numbers is read in reverse order.

Computational Cost

The Cholesky factorization requires roughly 13n3\frac{1}{3}n^3 arithmetic operations — exactly half the cost of LU factorization (23n3\frac{2}{3}n^3). The saving comes from symmetry: the lower triangle of AA determines the upper triangle (aij=ajia_{ij} = a_{ji}), so only half the entries need processing.

Each triangular solve costs O(n2)O(n^2). For a single system, the total is 13n3+O(n2)\frac{1}{3}n^3 + O(n^2). For kk systems sharing the same coefficient matrix, the cost is 13n3+2kn2\frac{1}{3}n^3 + 2kn^2.

For large symmetric positive definite systems, Cholesky is the fastest direct solver available. It is roughly twice as fast as LU and requires roughly half the storage (only the lower triangle of LL).

No Pivoting Needed

THEOREM
Unlike LU, the Cholesky algorithm never requires row swaps. Positive definiteness guarantees that the quantity under the square root is strictly positive at every step — no zero or negative pivots can occur.

Fact: The diagonal of AA caps every entry of LL
The diagonal of LLT=ALL^T = A reads aii=li12+li22+⋯+lii2a_{ii} = l_{i1}^2 + l_{i2}^2 + \cdots + l_{ii}^2, a sum of squares, so no entry in row ii of LL can exceed aii\sqrt{a_{ii}} in size. The numbers cannot grow out of control, which is why skipping row swaps costs no accuracy.

This makes the algorithm simpler (no permutation matrix to track), more stable (no near-zero pivots to amplify errors), and more predictable (the algorithm either runs to completion or breaks down, with no ambiguity).

If the algorithm encounters a non-positive value under the square root, the matrix is not positive definite. The breakdown happens at the first index jj where the leading j×jj \times j principal submatrix fails to be positive definite. This makes Cholesky an efficient positive definiteness test: attempt the factorization and check whether it succeeds.

Positive definiteness does the job that pivoting does in LU: every pivot is positive, so no row ever has to move.

Cholesky as a Positive Definiteness Test

The Cholesky algorithm tests positive definiteness as a side effect of factoring.

THEOREM
If A=LLTA = LL^T completes with all diagonal entries of LL strictly positive, AA is positive definite. If the algorithm breaks down at any step, AA is not positive definite.

This is often more practical than computing all eigenvalues (also O(n3)O(n^3) but with a larger constant) or checking all leading principal minors (which requires nn determinant computations).

The test is binary: the factorization either succeeds or fails. When it succeeds, LL is available for immediate use in system solving. When it fails, the index at which it breaks indicates which leading submatrix is the first to lose positive definiteness.
A2×21221=L2×2102?·Lᵀ2×2120?
A negative value under the square root

The quantity about to be square-rooted has come out negative, and the algorithm stops. That failure is not a numerical accident: it happens precisely when the matrix is not positive definite, which makes attempting the decomposition the standard test for the property. Feed in a matrix that fails on the Cholesky decomposition visualizer.

Testing by attempting the factorisation is cheaper than computing eigenvalues and gives a definite answer either way.

Where Cholesky Appears

Symmetric positive definite matrices appear throughout applied mathematics, and Cholesky is the default solver for all of them.

Fact: Invented for surveyors' least squares
André-Louis Cholesky, a French artillery officer and surveyor, devised the method by 1910 to solve the normal equations of least-squares adjustments in map-making. He was killed in the First World War in 1918, and a fellow officer published the method in 1924.

The normal equations ATAx^=ATbA^TA\hat{\mathbf{x}} = A^T\mathbf{b} produce a symmetric positive definite matrix ATAA^TA (when AA has full column rank). Cholesky on ATAA^TA solves least squares, though QR is preferred for numerical stability.

Covariance matrices in statistics are symmetric positive semi-definite (positive definite when no variable is a linear combination of the others). Cholesky is used to sample from multivariate normal distributions: if Σ=LLT\Sigma = LL^T, then LzL\mathbf{z} (with z\mathbf{z} standard normal) has distribution N(0,Σ)\mathcal{N}(\mathbf{0}, \Sigma).

Stiffness matrices in finite element analysis are symmetric positive definite. Newton's method in optimization solves Hd=−∇fH\mathbf{d} = -\nabla f where HH (the Hessian) is positive definite near a minimum that the second-derivative test confirms. In both cases, Cholesky is the standard solver.

Cholesky and LU: The Relationship

THEOREM
For a symmetric positive definite matrix, LU factorization without pivoting always succeeds and produces A=LUDLUTA = L_U D L_U^T, where LUL_U is unit lower triangular and DD is diagonal with positive entries.

This is the LDLTLDL^T decomposition.

The Cholesky factor is LChol=LUD1/2L_{\text{Chol}} = L_U D^{1/2} — the unit lower triangular factor with D\sqrt{D} absorbed into it. Equivalently, A=(LUD1/2)(LUD1/2)T=LLTA = (L_U D^{1/2})(L_U D^{1/2})^T = LL^T.

Cholesky is the symmetric-positive-definite specialization of LU. It exploits A=ATA = A^T to halve the work and the storage, and it exploits positive definiteness to eliminate the need for pivoting. The LDLTLDL^T variant avoids square roots entirely (computing DD and LUL_U separately) and is sometimes preferred when the square roots are expensive or when the matrix is only positive semi-definite.
DownloadPNG2×PDF
Before you read
Each form specializes the one below
For a symmetric positive definite matrix, LU without pivoting always succeeds. Absorbing structure step by step leads from LU to Cholesky.
most specializedspecializationmost general
CholeskyA=LLTA = LL^T
LDLTLDL^Tsymmetric positive definite, no pivoting
LUgeneral square matrices
Takeaway
Why specialize
Cholesky exploits A=ATA = A^T to halve the work and storage, and positive definiteness to remove pivoting. The LDLTLDL^T form avoids square roots entirely.
From LU to Cholesky·/linear-algebra/decompositions/choleskyLearn Math Class
Cholesky is LU for a symmetric positive definite matrix: half the work, no pivoting, and D\sqrt{D} folded into LL.

The Semi-Definite and Rank-Deficient Case

A symmetric positive semi-definite matrix (xTAx≥0\mathbf{x}^TA\mathbf{x} \geq 0 with equality for some nonzero x\mathbf{x}) has at least one zero eigenvalue. The standard Cholesky factorization breaks down when it encounters the corresponding zero diagonal entry.

Pivoted Cholesky handles this case: PAPT=LLTPAP^T = LL^T with a permutation matrix PP and LL possibly having some zero diagonal entries. The permutation reorders the rows and columns to push the rank deficiency to the end.

In practice, numerical near-singularity — eigenvalues very close to zero but not exactly zero — is more common than exact singularity. A condition-number-based threshold determines which eigenvalues are treated as zero. Adding a small regularization ϵI\epsilon I to AA (making it A+ϵIA + \epsilon I, which is positive definite for any ϵ>0\epsilon > 0) is a common remedy that restores the standard Cholesky factorization at the cost of a controlled perturbation.

Zero eigenvalues stop the plain algorithm and near-zero ones spoil it; pivoting or a small shift ϵI\epsilon I is the repair.

Summary: Matrix Property and Cholesky Outcome

The behavior of the Cholesky algorithm depends entirely on what kind of matrix it is asked to factor — positive definite, positive semi-definite, indefinite, non-symmetric, or merely near-singular. The table below collects each scenario, what the algorithm does in each case, and the standard remedy when the straightforward A=LLTA = LL^T form does not apply. The "positive semi-definite" row links back to the pivoted-Cholesky treatment above.
Read the table below as a diagnostic rather than a list of caveats. Cholesky is unusual among algorithms in that its failure modes are informative: it does not merely stop, it stops in a way that identifies what is wrong with the matrix. The split is between the cases that run to completion and the cases where the halt itself is the answer.
Decompositions · Cholesky

What the algorithm does with each matrix

The algorithm is also a test. Feed it a matrix and how it terminates classifies the matrix — completion means positive definite, and each way of failing identifies a different reason.

5cases
The algorithm completes2
1
all λi>0\lambda_i > 0
A=LLTA = LL^{\mathsf{T}}, all ℓii>0\ell_{ii} > 0
The intended case. Every square root is taken of a strictly positive number, the diagonal of LL comes out positive, and the factorization is unique. Half the cost of LU because symmetry means only one triangle is computed.
2
smallest λ\lambda near zero
runs; ℓii\ell_{ii} very small
Completes without complaint while the accuracy quietly degrades — small pivots amplify rounding into LL. The failure is silent, so the smallest diagonal entry is worth monitoring; adding εI\varepsilon I regularizes at the cost of solving a slightly different problem.
The algorithm halts — and the halt is the answer3
3
some λi=0\lambda_i = 0
zero appears on the diagonal of LL
Rank-deficient rather than wrong. Pivoted Cholesky, PTAP=LLTP^{\mathsf{T}}AP = LL^{\mathsf{T}}, handles it by reordering so the zeros arrive last — the factorization exists but is no longer unique.
4
some λi<0\lambda_i < 0
negative under the square root
No real LL exists, and the algorithm discovers this the moment it tries. Use LDLTLDL^{\mathsf{T}}, which permits negative entries in DD and so handles any symmetric matrix — at the price of no longer testing definiteness.
5
fails before it starts
A=LLTA = LL^{\mathsf{T}} is impossible
Any product LLTLL^{\mathsf{T}} is symmetric by construction, so a non-symmetric AA has no such factorization whatever its eigenvalues are. This is a precondition rather than an outcome — check symmetry first and use LU if it fails.
This is why Cholesky is the standard positive-definiteness test. Computing eigenvalues to check they are all positive costs O(n3)O(n^3) with an iterative method and gives approximate answers; running Cholesky costs 13n3\tfrac{1}{3}n^3, terminates in finitely many steps, and answers exactly — with the factorization in hand as a byproduct when the answer is yes.
What the algorithm does with each matrix·/linear-algebra/decompositions/choleskyLearn Math Class
That property is what makes it the standard definiteness test. The alternative is computing every eigenvalue and checking the signs, which costs more, converges iteratively rather than terminating, and returns approximations that then have to be judged against zero. Cholesky answers in 13n3\tfrac{1}{3}n^3 operations, finishes in a fixed number of steps, and hands back the factorization as well when the answer is yes.
One case deserves separate attention because it does not announce itself. A matrix that is positive definite but nearly singular runs to completion — no error, no halt — while the small pivots quietly amplify rounding error through LL. The result looks like a successful factorization and is not a reliable one, which is why the smallest diagonal entry of LL is worth reading rather than assuming.

Common Pitfalls

Three mistakes account for many wrong results with the Cholesky decomposition. Each is marked with a box where it happens in the sections above. Here each is worked through in full, with the wrong and the right working side by side.

Skipping the symmetry check

Before factoring, the eigenvalues or the leading principal minors are checked, and when they are positive the matrix is taken to be positive definite. The matrix is never compared with its transpose, although those tests describe positive definiteness only for symmetric matrices.

Wrong working: B=(4025)B = \begin{pmatrix} 4 & 0 \\ 2 & 5 \end{pmatrix} is triangular, so its eigenvalues are 44 and 55, and its leading minors are 44 and 4⋅5−0⋅2=204 \cdot 5 - 0 \cdot 2 = 20. All are positive, so B=LLTB = LL^T is expected. The formulas read only b11b_{11}, b21b_{21} and b22b_{22}:
l11=4=2,l21=2/2=1,l22=5−12=2,L=(2012)l_{11} = \sqrt{4} = 2, \quad l_{21} = 2/2 = 1, \quad l_{22} = \sqrt{5 - 1^2} = 2, \qquad L = \begin{pmatrix} 2 & 0 \\ 1 & 2 \end{pmatrix}


Right working: compare BB with BTB^T first.
BT=(4205)≠BB^T = \begin{pmatrix} 4 & 2 \\ 0 & 5 \end{pmatrix} \neq B

Since LLTLL^T is symmetric for every LL, no Cholesky factor exists. The LL found above gives LLT=(4225)LL^T = \begin{pmatrix} 4 & 2 \\ 2 & 5 \end{pmatrix}, which differs from BB in the entry above the diagonal.

Why it happens: the list of equivalent conditions is quoted without its standing assumption that AA is symmetric. The formulas use only the entries on and below the diagonal, so they run without any warning.

How to check: compare aija_{ij} with ajia_{ji} before anything else. After factoring, multiply out LLTLL^T and compare every entry with AA, including those above the diagonal.

Dropping the subtracted sum

In the off-diagonal formula, the sum ∑k=1j−1likljk\sum_{k=1}^{j-1} l_{ik}l_{jk} is left out once j>1j > 1, and the entry is computed as aij/ljja_{ij}/l_{jj}, the way the first column is.

Wrong working: in the worked example,
l32=a32l22=12l_{32} = \frac{a_{32}}{l_{22}} = \frac{1}{2}

Entry (3,2)(3, 2) of LLTLL^T is row 33 of LL times row 22 of LL:
l31l21+l32l22=(−1)(1)+12⋅2=0≠a32=1l_{31}l_{21} + l_{32}l_{22} = (-1)(1) + \frac{1}{2} \cdot 2 = 0 \neq a_{32} = 1

The error spreads: l33=6−(−1)2−(12)2=192≈2.18l_{33} = \sqrt{6 - (-1)^2 - (\frac{1}{2})^2} = \frac{\sqrt{19}}{2} \approx 2.18 instead of 22.

Right working: subtract the products already available.
l32=a32−l31l21l22=1−(−1)(1)2=1,l31l21+l32l22=−1+2=1=a32l_{32} = \frac{a_{32} - l_{31}l_{21}}{l_{22}} = \frac{1 - (-1)(1)}{2} = 1, \qquad l_{31}l_{21} + l_{32}l_{22} = -1 + 2 = 1 = a_{32}


Why it happens: in the first column the sum is empty, so the first entries are plain divisions, and that pattern is carried over to the later columns.

How to check: rebuild one entry at a time. Entry (i,j)(i, j) of LLTLL^T is row ii of LL times row jj of LL, and it must equal aija_{ij}.

Using L in both solves

After forward substitution, the second triangular solve is done with LL again instead of LTL^T. Only LL is stored, and the array is read in the same order twice.

Wrong working: with the worked example and b=(0,6,7)T\mathbf{b} = (0, 6, 7)^T, forward substitution gives y\mathbf{y}:
y1=02=0,y2=6−1⋅02=3,y3=7−(−1)⋅0−1⋅32=2y_1 = \frac{0}{2} = 0, \quad y_2 = \frac{6 - 1 \cdot 0}{2} = 3, \quad y_3 = \frac{7 - (-1) \cdot 0 - 1 \cdot 3}{2} = 2

Then Lx=yL\mathbf{x} = \mathbf{y} is solved from the top:
x1=0,x2=3−02=32,x3=2+0−322=14x_1 = 0, \quad x_2 = \frac{3 - 0}{2} = \frac{3}{2}, \quad x_3 = \frac{2 + 0 - \frac{3}{2}}{2} = \frac{1}{4}

and A(0,32,14)T=(52,314,3)T≠bA(0, \frac{3}{2}, \frac{1}{4})^T = (\frac{5}{2}, \frac{31}{4}, 3)^T \neq \mathbf{b}. This x\mathbf{x} solves L2x=bL^2\mathbf{x} = \mathbf{b}.

Right working: solve LTx=yL^T\mathbf{x} = \mathbf{y} from the bottom, with LT=(21−1021002)L^T = \begin{pmatrix} 2 & 1 & -1 \\ 0 & 2 & 1 \\ 0 & 0 & 2 \end{pmatrix}.
x3=22=1,x2=3−12=1,x1=0−1+12=0x_3 = \frac{2}{2} = 1, \quad x_2 = \frac{3 - 1}{2} = 1, \quad x_1 = \frac{0 - 1 + 1}{2} = 0

and A(0,1,1)T=(0,6,7)T=bA(0, 1, 1)^T = (0, 6, 7)^T = \mathbf{b}.

Why it happens: the second factor is not stored as a separate matrix, so it is easy to run the same routine on the same array twice.

How to check: forward substitution starts at the top with y1y_1, back substitution at the bottom with xnx_n. If both solves start at the top, LL was used twice. Multiplying AxA\mathbf{x} and comparing with b\mathbf{b} settles it.

Cholesky Decomposition FAQ

Does positive definite mean all the entries are positive?

+
No, the two properties are unrelated. Positive definiteness is a statement about the quadratic form xTAx\mathbf{x}^{T}A\mathbf{x} being positive for every nonzero x\mathbf{x}, not about the numbers in the array. A positive definite matrix can contain negative entries, and a matrix of entirely positive entries need not be positive definite.Read more →

Is the Cholesky factor the same as the matrix square root?

+
No, though both reproduce AA through a product. A genuine square root exists as the unique symmetric positive definite SS with SS=ASS = A, built from the eigenvalues, whereas the Cholesky factor LL is triangular. Writing A1/2A^{1/2} for LL silently changes any result that depends on symmetry, and SS costs far more to compute.Read more →

Why is the pivoting written PAPTPAP^{T} here rather than PAPA?

+
Because symmetry has to survive. The one-sided form used for LU swaps rows only, which destroys the symmetry Cholesky depends on and can leave a matrix with no factorisation at all. Applying the permutation on both sides reorders rows and columns together, and since PT=P−1P^{T} = P^{-1} the result is similar to AA, preserving eigenvalues and definiteness.Read more →