Skip to content

Conversation

@JohnAAbbott
Copy link
Collaborator

This is the determinant code I have been working on for the last several weeks/months.
It is fragile in that it requires that the input matrix have non-zero determinant -- it won't work if the determinant is zero (I'm not sure exactly what it will do in that case).

@JohnAAbbott
Copy link
Collaborator Author

For reasons that I do not understand the OSCAR det function is significantly faster on random matrices whose entries are uniformly (& symmetrically?) chosen.
The algorithm is "new" in that it has not been published anywhere. At least on some of the matrices which arose during a collaboration with Linda Hoyer the new algorithm is faster than OSCAR's det and also faster than Pauderis-Storjohann's HCOL algorithm. These matrices have many non-trivial Smith invariant factors.

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 199 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.78%. Comparing base (e23ad1d) to head (8815d60).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/ZZMatrix-linalg.jl 0.00% 199 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2212      +/-   ##
==========================================
- Coverage   88.25%   87.78%   -0.48%     
==========================================
  Files          99       99              
  Lines       37123    37322     +199     
==========================================
- Hits        32764    32763       -1     
- Misses       4359     4559     +200     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thofma
Copy link
Member

thofma commented Dec 19, 2025

The is the decision tree for the "Oscar det" method in flint:

    if (dim < 5)
        fmpz_mat_det_cofactor(det, A);
    else if (dim < 25)
        fmpz_mat_det_bareiss(det, A);
    else if (dim < 60)
        fmpz_mat_det_modular(det, A, 1);
    else
    {
        slong bits = fmpz_mat_max_bits(A);

        if (dim < FLINT_ABS(bits))
            fmpz_mat_det_modular(det, A, 1);
        else
            fmpz_mat_det_modular_accelerated(det, A, 1);
    }

A random matrix will have few non-trivial Smith divisors, but I think the runtime of modular algorithms should be Smith invariant factor-agnostic.

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.

2 participants