What Is the Cholesky Decomposition Calculator?
This calculator factorises a symmetric, positive-definite matrix A into the product \(A = L \cdot L^{\mathsf{T}}\), where L is a lower triangular matrix and \(L^{\mathsf{T}}\) is its transpose. The Cholesky decomposition is roughly twice as efficient as LU decomposition and is widely used in numerical linear algebra, Monte Carlo simulation, solving linear systems, and least-squares problems. The tool also returns the determinant of your matrix as a useful byproduct.
How to Use It
There is a single input field: Input Matrix. Enter your matrix using commas to separate values within a row and the pipe character | to start a new row.
- A 2×2 example:
4,12|12,37 - A 3×3 example:
4,12,-16|12,37,-43|-16,-43,98
The calculator first checks that your matrix is symmetric (each off-diagonal entry \(A_{ij}\) must equal \(A_{ji}\), within a tolerance of 1e-10). If it is symmetric and positive-definite, it computes and displays the lower triangular matrix L and the determinant. If the matrix is not symmetric or not positive-definite, the decomposition cannot be performed.
The Formula Explained
For each entry of L the algorithm computes:
- Diagonal: \(L_{jj} = \sqrt{A_{jj} - \sum L_{jk}^{2}}\) for \(k < j\)
- Below diagonal: \(L_{ij} = \dfrac{A_{ij} - \sum L_{ik} L_{jk}}{L_{jj}}\) for \(i > j\)
The determinant equals the product of the squared diagonal entries of L.
$$A = L\,L^{\mathsf{T}}, \qquad \det(A) = \prod_{i=1}^{n} L_{ii}^{2}$$
Worked Example
Take the 3×3 matrix 4,12,-16|12,37,-43|-16,-43,98. Working through the formula:
- \(L_{11} = \sqrt{4} = 2\)
- \(L_{21} = 12 / 2 = 6\), \(L_{22} = \sqrt{37 - 36} = 1\)
- \(L_{31} = -16 / 2 = -8\), \(L_{32} = (-43 - (-8)(6)) / 1 = 5\), \(L_{33} = \sqrt{98 - 64 - 25} = 3\)
So \(L = [[2,0,0],[6,1,0],[-8,5,3]]\), and the determinant \(= (2 \cdot 1 \cdot 3)^{2} = 36\).
Frequently Asked Questions
Why does my matrix return no result? The matrix must be symmetric (\(A_{ij} = A_{ji}\)) and positive-definite (all eigenvalues positive). If either condition fails, no Cholesky factor exists.
Does the matrix have to be square? Yes. Each row must have the same number of values as there are rows, and it must be symmetric.
How is the determinant calculated? It is the product of the squares of L's diagonal entries, which equals the determinant of the original matrix A.