Python wrappers
Public Python APIs implemented by this engine symbol.Compute the LDL factorisation of a symmetric matrix.
Returns the packed factor and the pivot index tensor. Both follow the
LAPACK *sytrf storage convention so they are consumable by
lucid.linalg.ldl_solve (which composes triangular solves). Batched
inputs are supported: leading dimensions are treated as independent
matrices and the factorisation is run on each slice.
Math
where is the permutation implied by the pivots, is unit lower-triangular, and is block-diagonal with 11 and 22 blocks. The 22 blocks are necessary when no scalar pivot can be chosen without losing numerical stability — this is what allows the factorisation to handle indefinite .
Shape
a:(..., N, N).- return
[0]:(..., N, N). - return
[1]:(..., N).
See Also
cholesky_op— cheaper alternative when is SPD.solve_triangular_op— building block forldl_solve.
Parameters
aTensorImplPtrSquare symmetric matrix of shape
(..., N, N) with dtype F32 or F64. The matrix need not be positive definite; only the lower triangle is read.Returns
std::vector<TensorImplPtr> of size 2[0]packed factorLDof shape(..., N, N), same dtype asa. Strict lower triangle stores (unit diagonal implicit); diagonal and sub-diagonal entries jointly encode including 22 pivot blocks. -[1]pivot tensor of shape(..., N), dtypeI32, following the LAPACKipivconvention (positive: 11 pivot; pair of equal negatives: 22 pivot block).
Raises
LucidErrorIf
a is not at least 2-D, not square, or has a non-float dtype.LucidErrorIf LAPACK
info > 0 — is exactly singular, so is rank deficient and the factorisation cannot be completed.Notes
- No autograd node is registered; the outputs are leaves.
- The current
ldl_solvewrapper inlucid.linalgonly supports 11 pivots (no 22 Bunch-Kaufman block solving yet).