Skip to content

Commit

Permalink
fix: deprecate rres and use reduced_resultant (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Jul 19, 2024
1 parent 1e6873b commit 6756757
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions src/Deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,7 @@ end

@deprecate hom(G::FinGenAbGroup, H::FinGenAbGroup, A::Matrix{ <: Map{FinGenAbGroup, FinGenAbGroup}}) hom_direct_sum(G, H, A)
@deprecate hom(G::FinGenAbGroup, H::FinGenAbGroup, A::Vector{ <: Map{FinGenAbGroup, FinGenAbGroup}}) hom_tensor(G, H, A)

# Deprecated in 0.33.0

@deprecate rres reduced_resultant
7 changes: 3 additions & 4 deletions src/LocalField/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,9 @@ end
#
################################################################################

reduced_resultant(f::T, g::T) where T <: PolyRingElem = rres(f, g)
reduced_discriminant(f::PolyRingElem) = rres(f, derivative(f))
reduced_discriminant(f::PolyRingElem) = reduced_resultant(f, derivative(f))

function rres(f::Generic.Poly{PadicFieldElem}, g::Generic.Poly{PadicFieldElem})
function redcued_resultant(f::Generic.Poly{PadicFieldElem}, g::Generic.Poly{PadicFieldElem})
Kt = parent(f)
K = base_ring(Kt)
p = prime(K)
Expand Down Expand Up @@ -625,7 +624,7 @@ function _resultant(f::Generic.Poly{T}, g::Generic.Poly{T}) where T <: Union{Pad
return res*res1*res2
end

function rres(f::Generic.Poly{T}, g::Generic.Poly{T}) where T <: Union{QadicFieldElem, LocalFieldElem}
function reduced_resultant(f::Generic.Poly{T}, g::Generic.Poly{T}) where T <: Union{QadicFieldElem, LocalFieldElem}
Nemo.check_parent(f, g)
@assert is_monic(f) || is_monic(g) "One of the two polynomials must be monic!"
#First, we need to make the polynomials integral
Expand Down
4 changes: 2 additions & 2 deletions src/Misc/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ end
################################################################################

@doc raw"""
rres(f::ZZPolyRingElem, g::ZZPolyRingElem) -> ZZRingElem
reduced_resultant(f::ZZPolyRingElem, g::ZZPolyRingElem) -> ZZRingElem
The reduced resultant of $f$ and $g$,
that is a generator for the ideal $(f, g) \cap Z$.
"""
function rres(f::ZZPolyRingElem, g::ZZPolyRingElem)
function reduced_resultant(f::ZZPolyRingElem, g::ZZPolyRingElem)
return rres_bez(f,g)
end

Expand Down
10 changes: 5 additions & 5 deletions src/Misc/nmod_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,12 @@ end
# in Z/p^kZ, hence the ideal (f, g) = (f, b) where b is now monic.
#Thus rres(f,g ) = rres(f, b).... and the division can continue
@doc raw"""
rres(f::PolyRingElem{T}, g::PolyRingElem{T}) where T <: ResElem{S} where S <: IntegerUnion -> T
reduced_resultant(f::PolyRingElem{T}, g::PolyRingElem{T}) where T <: ResElem{S} where S <: IntegerUnion -> T
The reduced resultant of $f$ and $g$ using a quadratic-time algorithm.
That is a generator for the $(f, g) \cap Z$
"""
function rres(f::PolyRingElem{T}, g::PolyRingElem{T}) where T <: ResElem{S} where S <: IntegerUnion
function reduced_resultant(f::PolyRingElem{T}, g::PolyRingElem{T}) where T <: ResElem{S} where S <: IntegerUnion
Nemo.check_parent(f, g)
return rres_sircana(f, g)
end
Expand Down Expand Up @@ -1383,7 +1383,7 @@ function _coprimality_test(f::T, g::T, h::T) where T <: Union{zzModPolyRingElem,
if is_unit(coeff(f, 0))
return true
else
return is_unit(gcd(coeff(f, 0), rres(f, h)))
return is_unit(gcd(coeff(f, 0), reduced_resultant(f, h)))
end
end
if is_unit(leading_coefficient(f))
Expand All @@ -1393,13 +1393,13 @@ function _coprimality_test(f::T, g::T, h::T) where T <: Union{zzModPolyRingElem,
if is_unit(g)
return true
else
return is_unit(gcd(coeff(g, 0), rres(f, h)))
return is_unit(gcd(coeff(g, 0), reduced_resultant(f, h)))
end
elseif is_constant(h)
if is_unit(h)
return true
else
return is_unit(gcd(coeff(h, 0), rres(f, g)))
return is_unit(gcd(coeff(h, 0), reduced_resultant(f, g)))
end
end
if degree(g) > degree(h)
Expand Down
4 changes: 2 additions & 2 deletions src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1042,14 +1042,14 @@ function _minmod_easy(a::ZZRingElem, b::AbsSimpleNumFieldOrderElem)
St = polynomial_ring(S, cached=false)[1]
B = St(b.elem_in_nf)
F = St(k.pol)
m = data(rres(B, F))
m = data(reduced_resultant(B, F))
return gcd(a, m)
else
S1 = residue_ring(FlintZZ, a, cached = false)[1]
St1 = polynomial_ring(S1, cached=false)[1]
B1 = St1(b.elem_in_nf)
F1 = St1(k.pol)
m1 = data(rres(B1, F1))
m1 = data(reduced_resultant(B1, F1))
return gcd(a, m1)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function new_maximal_order(O::AbsSimpleNumFieldOrder; index_divisors::Vector{ZZR
if is_defining_polynomial_nice(K) && (is_equation_order(O) || contains_equation_order(O))
Zx, x = polynomial_ring(FlintZZ, "x", cached = false)
f1 = Zx(K.pol)
ds = gcd(rres(f1, derivative(f1)), discriminant(O))
ds = gcd(reduced_resultant(f1, derivative(f1)), discriminant(O))
l = prefactorization(f1, ds)
else
ds = discriminant(O)
Expand Down
2 changes: 1 addition & 1 deletion src/NumFieldOrd/NfOrd/NfOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function reduced_discriminant(O::AbsSimpleNumFieldOrder)
if is_equation_order(O)
Zx = polynomial_ring(FlintZZ, cached = false)[1]
f = Zx(nf(O).pol)
return rres(f, derivative(f))
return reduced_resultant(f, derivative(f))
end
return maximal_elementary_divisor(trace_matrix(O, copy = false))
end
Expand Down
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ export real_places
export reduce_full
export reduced_charpoly
export reduced_discriminant
export reduced_resultant
export reduced_tate_pairing
export reduction_type
export refine_alpha_bound
Expand Down

0 comments on commit 6756757

Please sign in to comment.