cholesky(a, upper=False)

Cholesky decomposition.


upper param is requested by API standardization in instead of parameter in official NumPy operator.

Return the Cholesky decomposition, L * L.T, of the square matrix a, where L is lower-triangular and .T is the transpose operator. a must be symmetric and positive-definite. Only L is actually returned. Complex-valued input is currently not supported.

  • a ((.., M, M) ndarray) – Symmetric, positive-definite input matrix.

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


L – Lower-triangular Cholesky factor of a.

Return type

(.., M, M) ndarray


MXNetError – If the decomposition fails, for example, if a is not positive-definite.


Broadcasting rules apply.

The Cholesky decomposition is often used as a fast way of solving

\[A \mathbf{x} = \mathbf{b}\]

(when A is both symmetric and positive-definite).

First, we solve for \(\mathbf{y}\) in

\[L \mathbf{y} = \mathbf{b},\]

and then for \(\mathbf{x}\) in

\[L.T \mathbf{x} = \mathbf{y}.\]


>>> A = np.array([[16, 4], [4, 10]])
>>> A
array([[16.,  4.],
       [ 4., 10.]])
>>> L = np.linalg.cholesky(A)
>>> L
array([[4., 0.],
       [1., 3.]])
>>>, L.T)
array([[16.,  4.],
       [ 4., 10.]])