sparsax.lu_logdet_factor

sparsax.lu_logdet_factor(token)[source]

Return log|det(A)| from a pre-computed KLU factor (no refactor).

Reads the U diagonal from the factor held in token (from lu_factor`()); O(n) cost. Not differentiable.

Parameters:
token

Factor from lu_factor().

Returns:

Scalar float64 log(abs(det(A))).

Note

The logdet is computed from the held factor’s U diagonal at call time (no caching on the token, since KLU factors are shared objects). Under vmap over a batch of tokens it routes to the batched handler (one logdet per chain).