Python wrappers
Public Python APIs implemented by this engine symbol.Compute the Cholesky factor of a symmetric positive-definite matrix.
Returns the lower-triangular (default) or upper-triangular such
that or respectively. Forward dispatches to
LAPACK *potrf (CPU) or mlx::core::linalg::cholesky (GPU). Batched
inputs are supported: every dimension except the trailing two is treated
as a batch axis and the factorisation is run independently on each
slice.
Math
The corresponding reverse-mode rule (Murray 2016) is
where copies the strict lower triangle into the strict upper. This formula is realised in the Python wrapper via two triangular solves, not in this engine op.
Shape
a:(..., N, N).- return:
(..., N, N).
See Also
solve_triangular_op— triangular back/forward substitution used in the Python-side Cholesky backward.ldl_factor_op— analogous factorisation for symmetric indefinite matrices.
Parameters
aTensorImplPtr(..., N, N), dtype F32 or F64.upperbool= Nonetrue return the upper factor ; otherwise (default) return the lower factor .Returns
TensorImplPtrTriangular Cholesky factor with the same shape and dtype as a. The opposite triangle is filled with zeros.
Raises
LucidErrora is not at least 2-D, not square, or has a non-float dtype.LucidErrorinfo > 0 — a non-positive pivot was encountered, i.e. a is not positive definite (within working precision).Notes
No autograd node is wired; the returned TensorImpl has
requires_grad = false. Gradient-aware Cholesky is provided one layer
up by lucid.linalg.cholesky.