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

Ajust to padic renaming #1356

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions examples/IsPower.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function Base.lastindex(M::MatElem, i::Int)
error("illegal dimensino")
end

function Hecke.is_power(a::qadic, i::Int)
function Hecke.is_power(a::QadicFieldElem, i::Int)
@assert i>0
if i==1
return true, a
Expand Down Expand Up @@ -238,7 +238,7 @@ function Hecke.is_power(a::qadic, i::Int)
return true, b*uniformizer(parent(a))^rv
end

function Hecke.roots(a::qadic, i::Int)
function Hecke.roots(a::QadicFieldElem, i::Int)
@assert i>0
if i==1
return a
Expand Down Expand Up @@ -373,11 +373,11 @@ function Hecke.crt(v::Vector{ZZPolyRingElem}, m::Vector{ZZPolyRingElem}, H::Heck
return res[end]
end

function Hecke.degree(R::qadic) #TODO XXXX
function Hecke.degree(R::QadicFieldElem) #TODO XXXX
return R.length
end

function Hecke.ideal(R::NfAbsOrd, f::MapFromFunc{AnticNumberField,FlintQadicField})
function Hecke.ideal(R::NfAbsOrd, f::MapFromFunc{AnticNumberField,QadicField})
K = nf(R)
Cq = codomain(f)
if degree(Cq) == degree(K)
Expand Down
2 changes: 1 addition & 1 deletion examples/MultDep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ function verify_gamma(a::Vector{FacElem{nf_elem, AnticNumberField}}, g::Vector{Z
return B > sum(x*x for x = b)
end

function lift_reco(::QQField, a::padic; reco::Bool = false)
function lift_reco(::QQField, a::PadicFieldElem; reco::Bool = false)
if reco
u, v, N = getUnit(a)
R = parent(a)
Expand Down
6 changes: 3 additions & 3 deletions src/Deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

@deprecate automorphisms(x::NumField) automorphism_list(x)

@deprecate automorphisms(x::Union{FlintPadicField, FlintQadicField, LocalField}) automorphism_list(x)
@deprecate automorphisms(x::Union{PadicField, QadicField, LocalField}) automorphism_list(x)

@deprecate automorphisms(x::LocalField, y::Union{FlintPadicField, FlintQadicField, LocalField}) automorphism_list(x, y)
@deprecate automorphisms(x::LocalField, y::Union{PadicField, QadicField, LocalField}) automorphism_list(x, y)

# Deprecated during 0.18.*

Expand Down Expand Up @@ -107,7 +107,7 @@

@deprecate roots(f::Union{ZZPolyRingElem, QQPolyRingElem}, R::AcbField, abs_tol::Int=R.prec, initial_prec::Int...) roots(R, f, abs_tol, initial_prec...)

@deprecate roots(f::ZZPolyRingElem, Q::FlintQadicField; max_roots::Int = degree(f)) roots(Q, f; max_roots = max_roots)
@deprecate roots(f::ZZPolyRingElem, Q::QadicField; max_roots::Int = degree(f)) roots(Q, f; max_roots = max_roots)

@deprecate roots(f::ZZPolyRingElem, Q::QQField; max_roots::Int = degree(f)) roots(Q, f; max_roots = max_roots)

Expand Down
4 changes: 2 additions & 2 deletions src/HeckeTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2226,9 +2226,9 @@ mutable struct qAdicRootCtx
f::ZZPolyRingElem
p::Int
n::Int
Q::Vector{FlintQadicField}
Q::Vector{QadicField}
H::Hecke.HenselCtx
R::Vector{qadic}
R::Vector{QadicFieldElem}
is_splitting::Bool
function qAdicRootCtx(f::ZZPolyRingElem, p::Int; splitting_field::Bool = false)
r = new()
Expand Down
26 changes: 13 additions & 13 deletions src/LocalField/Completions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function image(f::CompletionMap, a::nf_elem)
return z
end

function preimage(f::CompletionMap{LocalField{qadic, EisensteinLocalField}, LocalFieldElem{qadic, EisensteinLocalField}}, a::LocalFieldElem{qadic, EisensteinLocalField})
function preimage(f::CompletionMap{LocalField{QadicFieldElem, EisensteinLocalField}, LocalFieldElem{QadicFieldElem, EisensteinLocalField}}, a::LocalFieldElem{QadicFieldElem, EisensteinLocalField})
Kp = codomain(f)
@assert Kp === parent(a)
Qq = base_field(Kp)
Expand All @@ -43,12 +43,12 @@ function preimage(f::CompletionMap{LocalField{qadic, EisensteinLocalField}, Loca
return evaluate(r, f.inv_img[2])
end

function preimage(f::CompletionMap{LocalField{padic, EisensteinLocalField}, LocalFieldElem{padic, EisensteinLocalField}}, a::LocalFieldElem{padic, EisensteinLocalField})
function preimage(f::CompletionMap{LocalField{PadicFieldElem, EisensteinLocalField}, LocalFieldElem{PadicFieldElem, EisensteinLocalField}}, a::LocalFieldElem{PadicFieldElem, EisensteinLocalField})
@assert codomain(f) === parent(a)
return evaluate(map_coefficients(lift, a.data), f.inv_img[2])
end

function preimage(f::CompletionMap{FlintQadicField, qadic}, a::qadic)
function preimage(f::CompletionMap{QadicField, QadicFieldElem}, a::QadicFieldElem)
Kp = codomain(f)
@assert Kp == parent(a)
Qpx = parent(defining_polynomial(Kp))
Expand Down Expand Up @@ -170,7 +170,7 @@ function completion(K::AnticNumberField, P::NfOrdIdl, precision::Int = 64)
pol_gen = Qqx(coeffs_eisenstein)
Kp, gKp = eisenstein_extension(pol_gen, "a", cached = false)
Kp.def_poly = x->setprecision(pol_gen, x)
img_prim_elem = Vector{qadic}(undef, e)
img_prim_elem = Vector{QadicFieldElem}(undef, e)
for i = 1:e
coeff = Qq()
for j = 0:f-1
Expand Down Expand Up @@ -241,7 +241,7 @@ else
fl, xZp = can_solve_with_solution(MZp, bZp, side = :left)
@assert fl
end
coeffs_eisenstein = Vector{qadic}(undef, e+1)
coeffs_eisenstein = Vector{QadicFieldElem}(undef, e+1)
gQq = gen(Qq)
for i = 1:e
coeff = zero(Qq)
Expand All @@ -259,7 +259,7 @@ end



function setprecision!(f::CompletionMap{LocalField{qadic, EisensteinLocalField}, LocalFieldElem{qadic, EisensteinLocalField}}, new_prec::Int)
function setprecision!(f::CompletionMap{LocalField{QadicFieldElem, EisensteinLocalField}, LocalFieldElem{QadicFieldElem, EisensteinLocalField}}, new_prec::Int)
P = prime(f)
OK = order(P)
new_prec += valuation(denominator(basis_matrix(OK, copy = false)), P)
Expand Down Expand Up @@ -296,7 +296,7 @@ function setprecision!(f::CompletionMap{LocalField{qadic, EisensteinLocalField},

pol_gen = Qqx(coeffs_eisenstein)
Kp.def_poly_cache[new_prec] = pol_gen
img_prim_elem = Vector{qadic}(undef, e)
img_prim_elem = Vector{QadicFieldElem}(undef, e)
for i = 1:e
coeff = Qq()
for j = 0:_f-1
Expand Down Expand Up @@ -351,14 +351,14 @@ function totally_ramified_completion(K::AnticNumberField, P::NfOrdIdl, precision
bZp = map_entries(Zp, bK.num)
fl, xZp = can_solve_with_solution(MZp, bZp, side = :left)
@assert fl
coeffs_eisenstein = Vector{padic}(undef, e+1)
coeffs_eisenstein = Vector{PadicFieldElem}(undef, e+1)
for i = 1:e
coeffs_eisenstein[i] = -xZp[1, i].x
end
coeffs_eisenstein[e+1] = one(Qp)
pol_gen = Qpx(coeffs_eisenstein)
Kp, gKp = eisenstein_extension(pol_gen, "a")
img_prim_elem = Vector{padic}(undef, e)
img_prim_elem = Vector{PadicFieldElem}(undef, e)
for i = 1:e
img_prim_elem[i] = xZp[2, i].x
end
Expand All @@ -372,7 +372,7 @@ function totally_ramified_completion(K::AnticNumberField, P::NfOrdIdl, precision
end


function setprecision!(f::CompletionMap{LocalField{padic, EisensteinLocalField}, LocalFieldElem{padic, EisensteinLocalField}}, new_prec::Int)
function setprecision!(f::CompletionMap{LocalField{PadicFieldElem, EisensteinLocalField}, LocalFieldElem{PadicFieldElem, EisensteinLocalField}}, new_prec::Int)
if new_prec < f.precision
K = domain(f)
setprecision!(K, new_prec)
Expand Down Expand Up @@ -400,7 +400,7 @@ function setprecision!(f::CompletionMap{LocalField{padic, EisensteinLocalField},
bQp = map_entries(Zp, bK)
fl, xZp = can_solve_with_solution(MZp, bZp, side = :left)
@assert fl
coeffs_eisenstein = Vector{padic}(undef, e+1)
coeffs_eisenstein = Vector{PadicFieldElem}(undef, e+1)
for i = 1:e
coeffs_eisenstein[i] = -xZp[1, i].x
end
Expand All @@ -409,7 +409,7 @@ function setprecision!(f::CompletionMap{LocalField{padic, EisensteinLocalField},
Kp.def_poly_cache[new_prec] = pol_gen
Kp.precision = new_prec
#Should I update the traces too?
img_prim_elem = Vector{padic}(undef, e)
img_prim_elem = Vector{PadicFieldElem}(undef, e)
for i = 1:e
img_prim_elem[i] = xZp[2, i].x
end
Expand Down Expand Up @@ -483,7 +483,7 @@ function unramified_completion(K::AnticNumberField, P::NfOrdIdl, precision::Int
return Qq, completion_map
end

function setprecision!(f::CompletionMap{FlintQadicField, qadic}, new_prec::Int)
function setprecision!(f::CompletionMap{QadicField, QadicFieldElem}, new_prec::Int)
Kp = codomain(f)
setprecision!(Kp, new_prec)
if new_prec < f.precision
Expand Down
48 changes: 24 additions & 24 deletions src/LocalField/Conjugates.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#XXX: valuation(Q(0)) == 0 !!!!!
function newton_lift(f::ZZPolyRingElem, r::qadic, prec::Int = parent(r).prec_max, starting_prec::Int = 2)
function newton_lift(f::ZZPolyRingElem, r::QadicFieldElem, prec::Int = parent(r).prec_max, starting_prec::Int = 2)
Q = parent(r)
n = prec
i = n
Expand Down Expand Up @@ -67,14 +67,14 @@ function newton_lift(f::ZZPolyRingElem, r::LocalFieldElem, precision::Int = pare
end

@doc raw"""
roots(Q::FlintQadicField, f::ZZPolyRingElem; max_roots::Int = degree(f)) -> Vector{qadic}
roots(Q::QadicField, f::ZZPolyRingElem; max_roots::Int = degree(f)) -> Vector{QadicFieldElem}

The roots of $f$ in $Q$, $f$ has to be square-free (at least the roots have to be simple roots).
"""
function roots(Q::FlintQadicField, f::ZZPolyRingElem; max_roots::Int = degree(f))
function roots(Q::QadicField, f::ZZPolyRingElem; max_roots::Int = degree(f))
k, mk = residue_field(Q)
rt = roots(k, f)
RT = qadic[]
RT = QadicFieldElem[]
for r = rt
push!(RT, newton_lift(f, preimage(mk, r)))
if length(RT) >= max_roots
Expand All @@ -91,7 +91,7 @@ function roots(C::qAdicRootCtx, n::Int = 10)
return [setprecision(x, n) for x = C.R]
end
lf = factor_mod_pk(Array, C.H, n)
rt = qadic[]
rt = QadicFieldElem[]
for Q = C.Q
Q.prec_max = n
for x = lf
Expand All @@ -101,7 +101,7 @@ function roots(C::qAdicRootCtx, n::Int = 10)
end
end
if isdefined(C, :R)
st = qadic[]
st = QadicFieldElem[]
for r = C.R
p = findfirst(x -> degree(parent(r)) == degree(parent(x)) && iszero(x-r), rt)
push!(st, rt[p])
Expand Down Expand Up @@ -182,8 +182,8 @@ function conjugates(a::nf_elem, C::qAdicConj, n::Int = 10; flat::Bool = false, a
end
end

function expand(a::Vector{qadic}; all::Bool, flat::Bool, degs::Vector{Int}= Int[])
re = qadic[]
function expand(a::Vector{QadicFieldElem}; all::Bool, flat::Bool, degs::Vector{Int}= Int[])
re = QadicFieldElem[]
if all
for ix = 1:length(a)
x = a[ix]
Expand All @@ -206,7 +206,7 @@ function expand(a::Vector{qadic}; all::Bool, flat::Bool, degs::Vector{Int}= Int[
re = a
end
if flat
r = padic[]
r = PadicFieldElem[]
for x = re
for i=1:degree(parent(x))
push!(r, coeff(x, i-1))
Expand All @@ -225,15 +225,15 @@ function _conjugates(a::nf_elem, C::qAdicConj, n::Int, op::Function)
Zx = polynomial_ring(FlintZZ, cached = false)[1]
d = denominator(a)
f = Zx(d*a)
res = qadic[]
res = QadicFieldElem[]
for x = R
a = op(inv(parent(x)(d))*f(x))::qadic
a = op(inv(parent(x)(d))*f(x))::QadicFieldElem
push!(res, a)
end
return res
end

function _log(a::qadic)
function _log(a::QadicFieldElem)
q = prime(parent(a))^degree(parent(a))
if iseven(q) # an error in flint
return log((a^(q-1))^2)//2//(q-1)
Expand Down Expand Up @@ -268,7 +268,7 @@ end

function conjugates_log(a::FacElem{nf_elem, AnticNumberField}, C::qAdicConj, n::Int = 10; all::Bool = false, flat::Bool = true)
first = true
local res::Vector{qadic}
local res::Vector{QadicFieldElem}
for (k, v) = a.fac
try
y = conjugates_log(k, C, n, flat = false, all = false)
Expand Down Expand Up @@ -306,10 +306,10 @@ function conjugates_log(a::FacElem{nf_elem, AnticNumberField}, C::qAdicConj, n::
end


function special_gram(m::Vector{Vector{qadic}})
g = Vector{padic}[]
function special_gram(m::Vector{Vector{QadicFieldElem}})
g = Vector{PadicFieldElem}[]
for i = m
r = padic[]
r = PadicFieldElem[]
for j = m
k = 1
S = 0
Expand All @@ -329,7 +329,7 @@ function special_gram(m::Vector{Vector{qadic}})
return g
end

function special_gram(m::Vector{Vector{padic}})
function special_gram(m::Vector{Vector{PadicFieldElem}})
n = transpose(matrix(m))
n = transpose(n)*n
return [[n[i,j] for j=1:ncols(n)] for i = 1:nrows(n)]
Expand Down Expand Up @@ -360,9 +360,9 @@ function regulator(R::NfAbsOrd{AnticNumberField, nf_elem}, C::qAdicConj, n::Int
end

@doc raw"""
regulator_iwasawa(u::Vector{T}, C::qAdicConj, n::Int = 10) where {T<: Union{nf_elem, FacElem{nf_elem, AnticNumberField}}} -> qadic
regulator_iwasawa(K::AnticNumberField, C::qAdicConj, n::Int = 10) -> qadic
regulator_iwasawa(R::NfAbsOrd, C::qAdicConj, n::Int = 10) -> qadic
regulator_iwasawa(u::Vector{T}, C::qAdicConj, n::Int = 10) where {T<: Union{nf_elem, FacElem{nf_elem, AnticNumberField}}} -> QadicFieldElem
regulator_iwasawa(K::AnticNumberField, C::qAdicConj, n::Int = 10) -> QadicFieldElem
regulator_iwasawa(R::NfAbsOrd, C::qAdicConj, n::Int = 10) -> QadicFieldElem

For a totally real field $K$, the regulator as defined by Iwasawa: the determinant of the
matrix containing the logarithms of the conjugates, supplemented by a column containing all $1$.
Expand Down Expand Up @@ -497,7 +497,7 @@ end

@doc raw"""
completion_easy(K::AnticNumberField, P::NfOrdIdl)
-> FlintQadicField, CompletionMap
-> QadicField, CompletionMap

The completion of $K$ wrt to the topology induced by the valuation at the
unramified prime ideal $P$.
Expand All @@ -519,7 +519,7 @@ end
completion(K::AnticNumberField, p::Integer, i::Int, precision::Int = 64) = completion(K, ZZRingElem(p), i, precision)

@doc raw"""
completion(K::AnticNumberField, p::ZZRingElem, i::Int) -> FlintQadicField, Map
completion(K::AnticNumberField, p::ZZRingElem, i::Int) -> QadicField, Map

The completion corresponding to the $i$-th conjugate in the non-canonical ordering of
`conjugates`.
Expand All @@ -532,7 +532,7 @@ function completion(K::AnticNumberField, p::ZZRingElem, i::Int, n = 64)
return completion(K, ca)
end

function completion(K::AnticNumberField, ca::qadic)
function completion(K::AnticNumberField, ca::QadicFieldElem)
p = prime(parent(ca))
C = qAdicConj(K, Int(p))
r = roots(C.C, precision(ca))
Expand Down Expand Up @@ -585,7 +585,7 @@ function completion(K::AnticNumberField, ca::qadic)

c = lift_root(f, a, b, p, 10)
pc = ZZRingElem(10)
function lif(x::qadic)
function lif(x::QadicFieldElem)
if iszero(x)
return K(0)
end
Expand Down
Loading
Loading