FLINT3.7.0-dev

padic_radix_mat_det_lu_full, padic_radix_mat_det_levels, padic_radix_mat_det

Synopsis#include <flint/padic_radix.h>
int padic_radix_mat_det_lu_full(padic_radix_t res, const gr_mat_t A, gr_ctx_t ctx)source
int padic_radix_mat_det_levels(padic_radix_t res, const gr_mat_t A, gr_ctx_t ctx)source
int padic_radix_mat_det(padic_radix_t res, const gr_mat_t A, gr_ctx_t ctx)source

Set res to the determinant of the square matrix A. The lu_full version uses Gaussian elimination with full pivoting on valuations (an entry of minimal valuation in the whole remaining submatrix). Then the multipliers and the pivot rows have valuations at least that of the pivot, the Schur complements keep the absolute precision of the input, and the pivots have the valuations a1≤⋯≤ana_1 \le \cdots \le a_n of the elementary divisors. For a matrix with entries known to O(pN)O(p^N) (and an<Na_n < N) the determinant is obtained to precision N+a1+⋯+an−1N + a_1 + \cdots + a_{n-1}, which is optimal: it is that of the differential ddet⁡(A)=tr⁡(adj⁡(A) dA)d \det(A) = \operatorname{tr}(\operatorname{adj}(A)\, dA). In comparison, division-free algorithms (Berkowitz, cofactor expansion) only give precision about NN, losing up to v(det⁡A)−anv(\det A) - a_n digits, and Gaussian elimination with the first nonzero pivot loses precision growing with the dimension for small pp, even for generic matrices (about 19 digits at n=60n = 60 for p=7p = 7). If the remaining submatrix consists of zeros, the determinant of that block is bounded using the sums of the row and column minima of the precisions.

The levels version is a blocked form of full pivoting. At the minimal valuation aa of the current Schur complement SS, a rank-revealing LU decomposition of (S/pa) mod p(S / p^a) \bmod p over Fp\mathbb{F}_p selects rr rows and columns such that S11=paUS_{11} = p^a U with UU invertible modulo pp: these rr pivots all have valuation aa, as in full pivoting, and are eliminated at once, with det⁡S=±det⁡(S11)det⁡(S22−S21S11−1S12)\det S = \pm \det(S_{11}) \det(S_{22} - S_{21} S_{11}^{-1} S_{12}), using the LU decomposition of S11S_{11}, triangular solves and one matrix product. The new Schur complement has entries of valuation at least a+1a + 1. The precision is again optimal, and the cost is that of a blocked LU decomposition (a single level for a matrix invertible modulo pp).

padic_radix_mat_det implements the generic method gr_mat_det: the cofactor formula for n≤2n \le 2, the lu_full version up to a dimension depending on the precision (40 at one limb, 24 at two limbs, 16 beyond), and the levels version above.

Cite this page

The FLINT team, “padic_radix_mat_det_lu_full, padic_radix_mat_det_levels, padic_radix_mat_det (padic_radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/padic_radix/padic_radix_mat_det_lu_full.html (generated 2026-11-02).