Skip to content

Add Hadamard bound include and update determinant function#331

Open
cxzhong wants to merge 1 commit into
linbox-team:masterfrom
cxzhong:patch-2
Open

Add Hadamard bound include and update determinant function#331
cxzhong wants to merge 1 commit into
linbox-team:masterfrom
cxzhong:patch-2

Conversation

@cxzhong
Copy link
Copy Markdown

@cxzhong cxzhong commented Apr 30, 2026

LinBox computes the determinant of an integer matrix A by Chinese
remaindering of modular determinants. In linbox/solutions/det.h, the
integer-tag dispatch is:

template <class Blackbox, class MyMethod>
typename Blackbox::Field::Element &det (..., const RingCategories::IntegerTag &tag, const MyMethod &Meth)
{
    ...
    return SOLUTION_CRA_DET(d, A, tag, Meth);
}

SOLUTION_CRA_DET resolves to:

  • lif_cra_det (from linbox/algorithms/hybrid-det.h) when LinBox is
    built with __LINBOX_HAVE_NTL, or
  • cra_det otherwise.

The non-NTL cra_det path — which is the one used in the SageMath
conda environment, and is also the default in many distro packages —
uses a heuristic CRT driver:

ChineseRemainder< CRABuilderEarlySingle< Field > >
    cra(LINBOX_DEFAULT_EARLY_TERMINATION_THRESHOLD);
cra(dd, iteration, genprime);

CRABuilderEarlySingle stops as soon as the running CRT reconstruction
has not changed across LINBOX_DEFAULT_EARLY_TERMINATION_THRESHOLD
consecutive primes. This is a probabilistic termination criterion:
if the residues for several primes happen to agree on a wrong lift
before the combined modulus exceeds 2|det(A)|, cra_det returns the
wrong determinant.

The lif_cra_det (NTL) path is not a safe fallback either: in our
testing it returned 0 for nonsingular dense integer matrices in this
build configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant