mlx.core.linalg.cholesky_inv

Contents

mlx.core.linalg.cholesky_inv#

cholesky_inv(L: array, upper: bool = False, *, stream: None | Stream | Device = None) array#

Compute the inverse of a real symmetric positive semi-definite matrix using it’s Cholesky decomposition.

Let \(\mathbf{A}\) be a real symmetric positive semi-definite matrix and \(\mathbf{L}\) its Cholesky decomposition such that:

\[\begin{aligned} \mathbf{A} = \mathbf{L}\mathbf{L}^T \end{aligned}\]

This function computes \(\mathbf{A}^{-1}\).

This function supports arrays with at least 2 dimensions. When the input has more than two dimensions, the Cholesky inverse is computed for each matrix in the last two dimensions of \(\mathbf{L}\).

If the input matrix is not a triangular matrix behaviour is undefined.

Parameters:
  • L (array) – Input array.

  • upper (bool, optional) – If True, return the upper triangular Cholesky factor. If False, return the lower triangular Cholesky factor. Default: False.

  • stream (Stream, optional) – Stream or device. Defaults to None in which case the default stream of the default device is used.

Returns:

\(\mathbf{A^{-1}}\) where \(\mathbf{A} = \mathbf{L}\mathbf{L}^T\).

Return type:

array