pivoted_cholesky
pivoted_cholesky(matrix, tolerance=1e-10, max_rank=None, method='greedy', block_size=32, seed=None, return_info=False):
Factor a PSD matrix as F F*, stopping at max residual diagonal <= tolerance.
Random pivots use residual-diagonal probabilities. Accelerated random pivots
use block proposals and rejection sampling (Epperly, Tropp, Webber, 2024).
The accelerated method checks tolerance after each accepted block. matrix
is unscaled: normalize its diagonal first for a per-function error criterion.
Returns (factor, pivots), optionally followed by diagnostics.