Skip to content

Commit

Permalink
fix: polynomial factorization over rational function field
Browse files Browse the repository at this point in the history
- when making factors primitive, the unit needs to be adjusted
  using the correct power.
  • Loading branch information
thofma committed May 3, 2024
1 parent b259604 commit 6cac7c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EllCrv/MinimalModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ function _factor_rational_function_field(p)
for (p, e) in facpn
uu, pp = _make_primitive(p)
D[Kt(pp)] = e
u = u/uu
u = u/uu^e
end
new_unit = new_unit * u
@assert is_unit(u)
Expand All @@ -736,7 +736,7 @@ function _factor_rational_function_field(p)
for (p, e) in facpd
uu, pp = _make_primitive(p)
p = Kt(pp)
u = u/uu
u = u/uu^e
if !haskey(D, p)
D[p] = -e
else
Expand Down
9 changes: 9 additions & 0 deletions test/EllCrv/MinimalModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,14 @@
E = elliptic_curve(Kt.([0, t^21, (z + 1)//216, -7//1296, (z + 3)//t]))
EE, = integral_model(E)
EE = Hecke.reduce_model(E)

let
Qx, x = QQ["x"]
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, "x")
Kt, t = rational_function_field(K, "t")
p = ((101//168*x^15 - 1//84*x^13 + 905//42*x^11 - 6101//84*x^9 + 19627//84*x^7 - 5356//21*x^5 + 4379//42*x^3 - 67//6*x)*t^7 + (17//56*x^15 - 1//42*x^13 + 919//84*x^11 - 149//4*x^9 + 3425//28*x^7 - 5905//42*x^5 + 1627//21*x^3 - 185//14*x)*t^3)//(t^8 + (11//42*x^14 - 5//42*x^12 + 65//7*x^10 - 752//21*x^8 + 2347//21*x^6 - 3067//21*x^4 + 428//7*x^2 - 164//21)*t^4 + 29//42*x^14 + 13//42*x^12 + 524//21*x^10 - 502//7*x^8 + 4975//21*x^6 - 565//3*x^4 + 1082//21*x^2 - 5)
fun = Hecke._factor_rational_function_field(p)
@test unit(fun) * prod(q^e for (q, e) in fun) == p
end
end

0 comments on commit 6cac7c7

Please sign in to comment.