Add new function is_probably_zero_det (for ZZMatrix, QQMatrix)#2152
Add new function is_probably_zero_det (for ZZMatrix, QQMatrix)#2152JohnAAbbott wants to merge 10 commits intoNemocas:masterfrom
is_probably_zero_det (for ZZMatrix, QQMatrix)#2152Conversation
|
This is currently restricted to |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
+ Coverage 88.30% 88.34% +0.03%
==========================================
Files 100 100
Lines 37202 37290 +88
==========================================
+ Hits 32853 32944 +91
+ Misses 4349 4346 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/flint/fmpq_mat.jl
Outdated
| catch IgnoreError | ||
| # The prime was bad, so we just ignore it | ||
| end |
There was a problem hiding this comment.
"The prime was bad, so we just ignore it" or your code triggers another error and it is not caught. This should test agains the real error and rethrow the error otherwise.
There was a problem hiding this comment.
"The prime was bad, so we just ignore it" or your code triggers another error and it is not caught. This should test against the real error and rethrow the error otherwise.
Modified the code; not sure what else it could throw (but maybe the coercion code will change in the future?) Really the documentation should also indicate which exceptions might be thrown...
|
There is a lot of code duplication. How much slower is it to just do |
Yes, there is duplication, but I don't know how to avoid that without risking a significant speed penalty in some cases, e.g. the current test uses a matrix 250x250 whose entries are |
|
Thanks for checking. I agree that the overhead of converting to |
Co-authored-by: Tommy Hofmann <thofma@gmail.com>
|
Converting to a non-draft PR. The extensions mentioned in comment 2 (near the start of this discussion) can be dealt with separately if there is call for them. |
src/flint/fmpq_mat.jl
Outdated
| # we switch to larger 61-bit primes (which are faster amortized). | ||
|
|
||
| @doc raw""" | ||
| is_zero_det_probabilistic(M::QQMatrix; modulus_bitsize::Int = 100) |
There was a problem hiding this comment.
tests whether "is_zero(det(M)) is probably true (if it returns true) and otherwise definitely false (if it returns false)
We have is_probable_prime so maybe this should be is_probably_zero_det (but sounds weird?).
Having it at end makes it easier to find, though.
Should this function be added to the documentation? It is currently being exported in this PR, which to me suggests it should be in the manual...
There was a problem hiding this comment.
Having it at end makes it easier to find, though.
I agree
…bbott/Nemo.jl into JAA/NEW-is_zero_det_probabilistic
|
Is the |
is_probably_zero_det (for ZZMatrix, QQMatrix)
yes, looks good |
New heuristic function
is_zero_det_probabilistic; incl. doc & tests.