Hecke.jl
Hecke.jl copied to clipboard
feat: make gcd over number fields faster
Not terminating for the following example:
julia> Qx, x = QQ["x"];
julia> K, a = number_field(x^16 + 36*x^12 - 120*x^10 + 392*x^8 - 432*x^6 + 216*x^4 - 48*x^2 + 4, "a");
julia> R, (x, y, t) = polynomial_ring(K, ["x", "y", "t"]);
julia> gcd((x + 1)^10 * (x + y)^5, (x + 1)^5 * (x + y)^10 * t^10)
Because coeff(gl, 0) == 0 and so glp == 0 for every p.
Codecov Report
Attention: Patch coverage is 69.09091% with 34 lines in your changes are missing coverage. Please review.
Project coverage is 75.33%. Comparing base (
cd37d53) to head (8ba3bcd). Report is 4 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #1505 +/- ##
==========================================
+ Coverage 75.22% 75.33% +0.11%
==========================================
Files 354 354
Lines 112724 112796 +72
==========================================
+ Hits 84796 84980 +184
+ Misses 27928 27816 -112
| Files | Coverage Δ | |
|---|---|---|
| src/NumFieldOrd/NfOrd/Ideal/TwoElement.jl | 58.39% <100.00%> (+2.44%) |
:arrow_up: |
| src/NumFieldOrd/NfOrd/LLL.jl | 78.01% <100.00%> (+0.31%) |
:arrow_up: |
| src/NumField/NfRel/absolute_field.jl | 91.83% <0.00%> (-1.92%) |
:arrow_down: |
| src/Misc/CRT.jl | 59.10% <78.78%> (+0.40%) |
:arrow_up: |
| src/NumField/NfAbs/MPolyGcd.jl | 64.07% <61.29%> (-3.67%) |
:arrow_down: |
Let's do a mini multivariate polynomial triage and decide:
- Should we always use the trick to work over $\mathbf{F}_p[X]/(f)$ with squarefree $f$? But this does not seem to scale well. Or stick to the idea of using prime ideals of degree $1$? Or mix both?
- Should we recognize rational polynomials and do the computation with
fmpq_mpoly? (We could speed up thefinish!in this case). - Do we agree that for towers, we should pass to an
absolute_simple_field? (Of course caching it together with both maps).
No. Yes. Yes.
Should be good to go. I noticed no regression. Even for rationals_as_number_field(), passing to the rationals is still faster.
@benlorenz Some non-canonical output changed for the booktest (but the result is isomorphic). What is the recommended way? Do a breaking release and then adjust it?
@benlorenz Some non-canonical output changed for the booktest (but the result is isomorphic). What is the recommended way? Do a breaking release and then adjust it?
Yes. Since it only affects Oscar master and not a release we could do without a breaking release as well, but with a version bump would be safer and probably avoids some intermittent booktest errors on Oscar PRs until the adjusted output is merged into all branches.