Skip to content

Commit

Permalink
Avoid use of deprecated aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 18, 2023
1 parent ed60d7f commit 0839c17
Show file tree
Hide file tree
Showing 58 changed files with 261 additions and 261 deletions.
2 changes: 1 addition & 1 deletion docs/src/class_fields/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ the narrow class group, or strict class group.
```@docs
ray_class_group(m::Hecke.NfAbsOrdIdl{Nemo.AnticNumberField,Nemo.nf_elem}, inf_plc::Vector{Hecke.InfPlc}; p_part, n_quo)
class_group(K::Nemo.AnticNumberField)
norm_group(f::Nemo.PolyElem, mR::Hecke.MapRayClassGrp, is_abelian::Bool)
norm_group(f::Nemo.PolyRingElem, mR::Hecke.MapRayClassGrp, is_abelian::Bool)
norm_group(K::NfRel{nf_elem}, mR::Hecke.MapRayClassGrp, is_abelian::Bool)
```

Expand Down
4 changes: 2 additions & 2 deletions examples/MPolyFact.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
density(f::PolyElem) = length(findall(x->!iszero(x), coefficients(f)))/length(f)
density(f::PolyRingElem) = length(findall(x->!iszero(x), coefficients(f)))/length(f)

#move elsewhere? Not used in here
function Hecke.representation_matrix(a::ResElem{<:PolyElem})
function Hecke.representation_matrix(a::ResElem{<:PolyRingElem})
R = parent(a)
S = base_ring(base_ring(R))
n = degree(modulus(R))
Expand Down
6 changes: 3 additions & 3 deletions examples/Plesken.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function steinitz(a::ResElem{ZZRingElem})
return lift(a)
end

function steinitz(a::ResElem{T}) where T <: Union{zzModPolyRingElem, fqPolyRepPolyRingElem, PolyElem}
function steinitz(a::ResElem{T}) where T <: Union{zzModPolyRingElem, fqPolyRepPolyRingElem, PolyRingElem}
f = [steinitz(coeff(a.data, i))::ZZRingElem for i=0:degree(a.data)]
ZZx = polynomial_ring(FlintZZ)[1]
S = base_ring(base_ring(parent(a)))
Expand Down Expand Up @@ -83,7 +83,7 @@ function minpoly_aut(a::ResElem{T}, aut :: Function) where T <: Union{fqPolyRepP
return f
end

function minpoly_aut(a::ResElem{T}, aut :: Function) where T <: PolyElem
function minpoly_aut(a::ResElem{T}, aut :: Function) where T <: PolyRingElem
R = parent(a)
RX, X = polynomial_ring(R)
o = Set{typeof(X)}()
Expand All @@ -97,7 +97,7 @@ function minpoly_aut(a::ResElem{T}, aut :: Function) where T <: PolyElem
return f
end

function minpoly_pow(a::ResElem{T}, deg::Int) where T <: Union{PolyElem, fqPolyRepPolyRingElem}
function minpoly_pow(a::ResElem{T}, deg::Int) where T <: Union{PolyRingElem, fqPolyRepPolyRingElem}
R = parent(a)
S = base_ring(base_ring(R))
M = matrix_space(S, deg, degree(R.modulus))()
Expand Down
2 changes: 1 addition & 1 deletion examples/PolyRoot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module PolyRoot

using Hecke

function is_power(f::PolyElem{T}, n::Int) where {T <: FieldElem}
function is_power(f::PolyRingElem{T}, n::Int) where {T <: FieldElem}
#iteration is for roots of x^-n -f^(n-1) which has root f^((1-n)/n)
#or root(f, n)^(1-n)

Expand Down
4 changes: 2 additions & 2 deletions examples/Round2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ function Hecke.residue_field(R::QQPolyRing, p::QQPolyRingElem)
return K, MapFromFunc(R, K, x->K(x), y->R(y))
end

function (F::Generic.FunctionField{T})(p::PolyElem{<:AbstractAlgebra.Generic.RationalFunctionFieldElem{T}}) where {T}
function (F::Generic.FunctionField{T})(p::PolyRingElem{<:AbstractAlgebra.Generic.RationalFunctionFieldElem{T}}) where {T}
@assert parent(p) == parent(F.pol)
@assert degree(p) < degree(F) # the reduction is not implemented
R = parent(gen(F).num)
Expand Down Expand Up @@ -1352,7 +1352,7 @@ G, b = function_field(x^6 + (140*t - 70)*x^3 + 8788*t^2 - 8788*t + 2197, "b")
module FactorFF
using Hecke

function Hecke.norm(f::PolyElem{<: Generic.FunctionFieldElem})
function Hecke.norm(f::PolyRingElem{<: Generic.FunctionFieldElem})
K = base_ring(f)
P = polynomial_to_power_sums(f, degree(f)*degree(K))
PQ = elem_type(base_field(K))[tr(x) for x in P]
Expand Down
2 changes: 1 addition & 1 deletion examples/Tropics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function _intersect(M::MatElem{T}, N::MatElem{T}) where T <: Hecke.FieldElem
return transpose(rref(transpose(l))[2])
end

function valuation_of_roots(f::PolyElem{<:Hecke.NonArchLocalFieldElem})
function valuation_of_roots(f::PolyRingElem{<:Hecke.NonArchLocalFieldElem})
iszero(f) && error("polynomial must not be zero")
return (valuation(constant_coefficient(f)) - valuation(leading_coefficient(f)))//degree(f)
end
Expand Down
6 changes: 3 additions & 3 deletions src/AlgAss/AlgAss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ function AlgAss(R::Ring, d::Int, arr::Vector{T}) where {T}
end

raw"""
associative_algebra(f::PolyElem)
associative_algebra(f::PolyRingElem)
Associative algebra $R[x]/f$.
"""
associative_algebra(f::PolyElem) = AlgAss(f)
function AlgAss(f::PolyElem)
associative_algebra(f::PolyRingElem) = AlgAss(f)
function AlgAss(f::PolyRingElem)
R = base_ring(parent(f))
n = degree(f)
Rx = parent(f)
Expand Down
6 changes: 3 additions & 3 deletions src/AlgAss/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ end
################################################################################

@doc raw"""
minpoly(a::AbsAlgAssElem) -> PolyElem
minpoly(a::AbsAlgAssElem) -> PolyRingElem
Returns the minimal polynomial of $a$ as a polynomial over
`base_ring(algebra(a))`.
Expand All @@ -731,7 +731,7 @@ function Generic.minpoly(R::PolyRing, a::AbsAlgAssElem)
end

@doc raw"""
charpoly(a::AbsAlgAssElem) -> PolyElem
charpoly(a::AbsAlgAssElem) -> PolyRingElem
Returns the characteristic polynomial of $a$ as a polynomial over
`base_ring(algebra(a))`.
Expand Down Expand Up @@ -773,7 +773,7 @@ function _reduced_charpoly_simple(a::AbsAlgAssElem, R::PolyRing)
end

@doc raw"""
reduced_charpoly(a::AbsAlgAssElem) -> PolyElem
reduced_charpoly(a::AbsAlgAssElem) -> PolyRingElem
Returns the reduced characteristic polynomial of $a$ as a polynomial over
`base_ring(algebra(a))`.
Expand Down
4 changes: 2 additions & 2 deletions src/AlgAssRelOrd/NEQ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function _as_subfield(A::AbsAlgAss{T}, x::AbsAlgAssElem{T}) where { T <: Union{
return _as_subfield(A, x, minpoly(x))
end

function _as_subfield(A::AbsAlgAss{QQFieldElem}, x::AbsAlgAssElem{QQFieldElem}, f::PolyElem{QQFieldElem})
function _as_subfield(A::AbsAlgAss{QQFieldElem}, x::AbsAlgAssElem{QQFieldElem}, f::PolyRingElem{QQFieldElem})
s = one(A)
M = zero_matrix(FlintQQ, degree(f), dim(A))
elem_to_mat_row!(M, 1, s)
Expand All @@ -424,7 +424,7 @@ function _as_subfield(A::AbsAlgAss{QQFieldElem}, x::AbsAlgAssElem{QQFieldElem},
return K, NfAbsToAbsAlgAssMor(K, A, M)
end

function _as_subfield(A::AbsAlgAss{T}, x::AbsAlgAssElem{T}, f::PolyElem{T}) where { T <: Union{ nf_elem, NfRelElem } }
function _as_subfield(A::AbsAlgAss{T}, x::AbsAlgAssElem{T}, f::PolyRingElem{T}) where { T <: Union{ nf_elem, NfRelElem } }
s = one(A)
M = zero_matrix(base_ring(A), degree(f), dim(A))
elem_to_mat_row!(M, 1, s)
Expand Down
10 changes: 5 additions & 5 deletions src/EllCrv/EllCrv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ end


@doc raw"""
elliptic_curve(f::PolyElem, [h::PolyElem,] check::Bool = true) -> EllCrv
elliptic_curve(f::PolyRingElem, [h::PolyRingElem,] check::Bool = true) -> EllCrv
Return the elliptic curve $y^2 + h(x)y = f(x)$ respectively $y^2 + y = f(x)$,
if no $h$ is specified. The polynomial $f$ must be monic of degree 3 and $h$ of
Expand All @@ -298,7 +298,7 @@ Elliptic curve with equation
y^2 + x*y = x^3 + x + 1
```
"""
function elliptic_curve(f::PolyElem{T}, h::PolyElem{T} = zero(parent(f)); check::Bool = true) where T
function elliptic_curve(f::PolyRingElem{T}, h::PolyRingElem{T} = zero(parent(f)); check::Bool = true) where T
@req ismonic(f) "First polynomial must be monic"
@req degree(f) == 3 "First polynomial must be of degree 3"
@req degree(h) <= 1 "Second polynomial must be of degree at most 1"
Expand All @@ -313,7 +313,7 @@ function elliptic_curve(f::PolyElem{T}, h::PolyElem{T} = zero(parent(f)); check:
return elliptic_curve([a1, a2, a3, a4, a6], check = check)
end

function elliptic_curve(f::PolyElem{T}, g; check::Bool = true) where T
function elliptic_curve(f::PolyRingElem{T}, g; check::Bool = true) where T
return elliptic_curve(f, parent(f)(g))
end

Expand Down Expand Up @@ -537,7 +537,7 @@ end
################################################################################

@doc raw"""
equation([R::MPolyRing,] E::EllCrv) -> MPolyElem
equation([R::MPolyRing,] E::EllCrv) -> MPolyRingElem
Return the equation defining the elliptic curve $E$ as a bivariate polynomial.
If the polynomial ring $R$ is specified, it must by a bivariate polynomial
Expand Down Expand Up @@ -567,7 +567,7 @@ function equation(Kxy::MPolyRing, E::EllCrv)
end

@doc raw"""
hyperelliptic_polynomials([R::PolyRing,] E::EllCrv) -> PolyElem, PolyElem
hyperelliptic_polynomials([R::PolyRing,] E::EllCrv) -> PolyRingElem, PolyRingElem
Return univariate polynomials $f, h$ such that $E$ is given by $y^2 + h*y = f$.
Expand Down
2 changes: 1 addition & 1 deletion src/EllCrv/Finite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ function trace_of_frobenius(E::EllCrv{T}, n::Int) where T<:FinFieldElem
a = q +1 - order(E)
R, x = polynomial_ring(QQ)
f = x^2 - a*x + q
if isirreducible(f)
if is_irreducible(f)
L, alpha = number_field(f)
return ZZ(trace(alpha^n))
else
Expand Down
4 changes: 2 additions & 2 deletions src/EllCrv/Heights.jl
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ function CPS_dvev_complex(E::EllCrv{T}, v::V, prec::Int = 100) where T where V<:
return approx_dv, approx_ev
end

function refine_alpha_bound(P::PolyElem, Q::PolyElem, E, mu::arb, a::arb, b::arb, r::arb, alpha_bound::arb, prec)
function refine_alpha_bound(P::PolyRingElem, Q::PolyRingElem, E, mu::arb, a::arb, b::arb, r::arb, alpha_bound::arb, prec)

C = AcbField(prec, cached = false)
Rc = ArbField(prec, cached = false)
Expand Down Expand Up @@ -925,7 +925,7 @@ end



function refine_beta_bound(P::PolyElem, Q::PolyElem, E, mu::arb, a::arb, b::arb, r::arb, beta_bound::arb, prec)
function refine_beta_bound(P::PolyRingElem, Q::PolyRingElem, E, mu::arb, a::arb, b::arb, r::arb, beta_bound::arb, prec)

C = AcbField(prec, cached = false)
Rc = ArbField(prec, cached = false)
Expand Down
12 changes: 6 additions & 6 deletions src/EllCrv/Isogeny.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ end


#Maybe this can be done more efficiently
function is_kernel_polynomial(E::EllCrv{T}, f::PolyElem{T}, check::Bool = false) where T
function is_kernel_polynomial(E::EllCrv{T}, f::PolyRingElem{T}, check::Bool = false) where T
@req base_ring(f) === base_field(E) "Polynomial and elliptic curve must be defined over same field"

#Assume f to be square-free
Expand Down Expand Up @@ -135,16 +135,16 @@ end


@doc raw"""
is_prime_cyclic_kernel_polynomial(E::EllCrv, p::IntegerUnion, f::PolyElem)
is_prime_cyclic_kernel_polynomial(E::EllCrv, p::IntegerUnion, f::PolyRingElem)
Return whether `E` has a cyclic isogeny of with kernel polynomial
`f`.
"""
function is_cyclic_kernel_polynomial(E::EllCrv, f::PolyElem)
function is_cyclic_kernel_polynomial(E::EllCrv, f::PolyRingElem)
return is_kernel_polynomial(E, f, true)
end

function is_prime_cyclic_kernel_polynomial(E::EllCrv, p::IntegerUnion, f::PolyElem)
function is_prime_cyclic_kernel_polynomial(E::EllCrv, p::IntegerUnion, f::PolyRingElem)
@req base_ring(f) === base_field(E) "Polynomial and elliptic curve must be defined over the same field"
@req is_prime(p) || p ==1 "p needs to be prime"
m2 = div(p, 2)
Expand Down Expand Up @@ -881,7 +881,7 @@ function compute_codomain(E::EllCrv, v, w)
return elliptic_curve([a1, a2, a3, newa4, newa6])
end

function to_bivariate(f::AbstractAlgebra.Generic.Poly{S}) where S<:PolyElem{T} where T<:FieldElem
function to_bivariate(f::AbstractAlgebra.Generic.Poly{S}) where S<:PolyRingElem{T} where T<:FieldElem
Rxy = parent(f)
Rx = base_ring(Rxy)
R = base_ring(Rx)
Expand All @@ -897,7 +897,7 @@ function to_bivariate(f::AbstractAlgebra.Generic.Poly{S}) where S<:PolyElem{T} w
return newf
end

function to_bivariate(f::PolyElem{T}) where T<:FieldElem
function to_bivariate(f::PolyRingElem{T}) where T<:FieldElem

K = base_ring(f)

Expand Down
4 changes: 2 additions & 2 deletions src/EllCrv/Isomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function is_isomorphic(E1::EllCrv{T}, E2::EllCrv{T}) where T


if j1!=0 && j1!=1728
return issquare(c6//_c6)
return is_square(c6//_c6)
else
Rx, x = polynomial_ring(K, "x")
if j1 == 1728
Expand Down Expand Up @@ -309,7 +309,7 @@ function isomorphism(E1::EllCrv, E2::EllCrv)
_c4, _c6 = c_invars(E2)
usq = (c6//_c6)//(c4//_c4)

issquare(usq) || error("Curves are not isomorphic")
is_square(usq) || error("Curves are not isomorphic")
u = sqrt(usq)
phi = isomorphism(E1s, [0, 0, 0, u])
F = codomain(phi)
Expand Down
4 changes: 2 additions & 2 deletions src/EllCrv/RationalPointSearch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ function prime_check_arrays(coeff::Vector{<: IntegerUnion}, p::Int, N)

chunk = _chunk
#for (j, x) in enumerate(F)
# @inbounds chunk[j] = issquare(sum([az[i + 1]*x^i for i in (0:n)]))
# @inbounds chunk[j] = is_square(sum([az[i + 1]*x^i for i in (0:n)]))
#end
chunk = Bool[issquare(sum([az[i + 1]*x^i for i in (0:n)])) for x in F]
chunk = Bool[is_square(sum([az[i + 1]*x^i for i in (0:n)])) for x in F]
chunk_odd = vcat(chunk[2:2:p], chunk[1:2:p])
chunk_even = vcat(chunk[1:2:p], chunk[2:2:p])

Expand Down
2 changes: 1 addition & 1 deletion src/FunField/Factor.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module FactorFF
using Hecke

function Hecke.norm(f::PolyElem{<: Generic.FunctionFieldElem})
function Hecke.norm(f::PolyRingElem{<: Generic.FunctionFieldElem})
K = base_ring(f)
P = polynomial_to_power_sums(f, degree(f)*degree(K))
PQ = elem_type(base_field(K))[tr(x) for x in P]
Expand Down
6 changes: 3 additions & 3 deletions src/FunField/HessQR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function Nemo.residue_ring(a::HessQR, b::HessQRElem)
y->HessQRElem(a, ZZRingElem(1), lift(parent(b.f), numerator(y, false)), lift(parent(b.f), denominator(y, false))))
end

function +(a::FracElem{T}, b::FracElem{T}) where T <: PolyElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
function +(a::FracElem{T}, b::FracElem{T}) where T <: PolyRingElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
na = numerator(a, false)
da = denominator(a, false)

Expand All @@ -365,7 +365,7 @@ function +(a::FracElem{T}, b::FracElem{T}) where T <: PolyElem{<:ResElem{S}} whe
return parent(a)(da, db)
end

function -(a::FracElem{T}, b::FracElem{T}) where T <: PolyElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
function -(a::FracElem{T}, b::FracElem{T}) where T <: PolyRingElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
na = numerator(a, false)
da = denominator(a, false)

Expand All @@ -378,7 +378,7 @@ function -(a::FracElem{T}, b::FracElem{T}) where T <: PolyElem{<:ResElem{S}} whe
return parent(a)(da, db)
end

function *(a::FracElem{T}, b::FracElem{T}) where T <: PolyElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
function *(a::FracElem{T}, b::FracElem{T}) where T <: PolyRingElem{<:ResElem{S}} where S <: Hecke.IntegerUnion
na = numerator(a, false)
da = denominator(a, false)

Expand Down
8 changes: 4 additions & 4 deletions src/GenOrd/Auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ function hnf_modular(M::MatElem{T}, d::T, is_prime::Bool = false) where {T}
return H[1:ncols(M), :]
end

function function_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
function function_field(f::PolyRingElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
return function_field(f, s, cached = cached)
end

function extension_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
function extension_field(f::PolyRingElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
return function_field(f, s, cached = cached)
end

Expand All @@ -94,13 +94,13 @@ function Hecke.residue_field(R::QQPolyRing, p::QQPolyRingElem)
return K, MapFromFunc(R, K, x -> K(x), y -> R(y))
end

function Hecke.residue_field(R::PolyRing{T}, p::PolyElem{T}) where {T <: NumFieldElem}
function Hecke.residue_field(R::PolyRing{T}, p::PolyRingElem{T}) where {T <: NumFieldElem}
@assert parent(p) === R
K, _ = number_field(p)
return K, MapFromFunc(R, K, x -> K(x), y -> R(y))
end

function (F::Generic.FunctionField{T})(p::PolyElem{<:AbstractAlgebra.Generic.RationalFunctionFieldElem{T}}) where {T <: FieldElem}
function (F::Generic.FunctionField{T})(p::PolyRingElem{<:AbstractAlgebra.Generic.RationalFunctionFieldElem{T}}) where {T <: FieldElem}
@assert parent(p) == parent(F.pol)
@assert degree(p) < degree(F) # the reduction is not implemented
R = parent(gen(F).num)
Expand Down
Loading

0 comments on commit 0839c17

Please sign in to comment.