Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't use polynomial rings over zero rings #1684

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/FunField/HessQR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
expressify(a.g, context = context)))
end

Hecke.characteristic(::HessQR) = 0

Check warning on line 114 in src/FunField/HessQR.jl

View check run for this annotation

Codecov / codecov/patch

src/FunField/HessQR.jl#L114

Added line #L114 was not covered by tests

function Hecke.integral_split(a::Generic.RationalFunctionFieldElem{QQFieldElem}, S::HessQR)
if iszero(a)
return zero(S), one(S)
Expand Down
3 changes: 3 additions & 0 deletions src/Misc/nmod_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ function resultant_ideal_pp(f::PolyRingElem{T}, g::PolyRingElem{T}) where T <: R
s = gcd(lift(res), pn)
if !isone(s)
new_pn = divexact(pn, s)
if is_one(new_pn)
return zero(R)
end
R1 = residue_ring(ZZ, S(new_pn), cached = false)[1]
R1t = polynomial_ring(R1, "y", cached = false)[1]
f2 = R1t(T[R1(lift(coeff(f, i))) for i = 0:degree(f)])
Expand Down
2 changes: 2 additions & 0 deletions src/NumField/NfAbs/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ end

#In this version, n is supposed to be a prime power
function is_norm_divisible_pp(a::AbsSimpleNumFieldElem, n::ZZRingElem)
Main.a = a
Main.n = n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder to remove these debugging artifacts again once you are finished tracking down all uses of zero rings

K = parent(a)
if !is_coprime(denominator(K.pol), n)
na = norm(a)
Expand Down
3 changes: 3 additions & 0 deletions src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,9 @@ function _minmod_easy(a::ZZRingElem, b::AbsSimpleNumFieldOrderElem)
end

function _minmod_easy_pp(a::ZZRingElem, b::AbsSimpleNumFieldOrderElem)
if isone(a)
return one(a)
end
Zk = parent(b)
k = number_field(Zk)
if fits(Int, a)
Expand Down
1 change: 1 addition & 0 deletions src/NumFieldOrd/NfOrd/MaxOrd/Polygons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ function _decomposition(O::AbsNumFieldOrder, I::AbsNumFieldOrderIdeal, Ip::AbsNu
Ba = basis(P, copy = false)
for i in 1:degree(O)
if !is_norm_divisible_pp((v*Ba[i] + u).elem_in_nf, modulo)
@assert !is_zero(mod(ZZ(norm((v*Ba[i] + u).elem_in_nf)), modulo))
u = v*Ba[i] + u
break
end
Expand Down
Loading