Skip to content

Commit

Permalink
fix: don't use polynomial rings over zero rings (#1684)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Nov 18, 2024
1 parent 0d6625a commit 8532b39
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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 @@ function expressify(a::HessQRElem; context = nothing)
expressify(a.g, context = context)))
end

Hecke.characteristic(::HessQR) = 0

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
7 changes: 6 additions & 1 deletion src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ function _minmod(a::ZZRingElem, b::AbsNumFieldOrderElem)
end

function _minmod_easy(a::ZZRingElem, b::AbsSimpleNumFieldOrderElem)
if is_one(a)
return a
end
Zk = parent(b)
k = number_field(Zk)
if fits(Int, a)
Expand All @@ -1053,6 +1056,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 Expand Up @@ -1147,7 +1153,6 @@ end


function _minmod_comp(a::ZZRingElem, b::AbsSimpleNumFieldOrderElem)

Zk = parent(b)
k = number_field(Zk)
acom, auncom = ppio(a, index(Zk))
Expand Down

0 comments on commit 8532b39

Please sign in to comment.