Skip to content

Commit

Permalink
coefficient_ring -> base_field for p/q-adics
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt committed May 21, 2024
1 parent b04719f commit 3e508c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
3 changes: 3 additions & 0 deletions src/Deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ function (R::QadicField)(n::ZZPolyRingElem, pr::Int)
#Base.depwarn("`(::QadicField)(::ZZPolyRingElem, ::Int)` is deprecated, use `(::QadicField)(::ZZPolyRingElem; precision::Int)` instead.", :QadicField)
return (R::QadicField)(n::ZZPolyRingElem; precision=pr)
end

@deprecate coefficient_ring(k::PadicField) base_field(k)
@deprecate coefficient_ring(k::QadicField) base_field(k)
3 changes: 0 additions & 3 deletions src/flint/padic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ degree(::PadicField) = 1

base_field(k::PadicField) = k

# TODO: Remove in the next minor/breaking release
coefficient_ring(k::PadicField) = base_field(k)

# Return generators of k "over" K
function gens(k::PadicField, K::PadicField)
@assert k === K
Expand Down
11 changes: 2 additions & 9 deletions src/flint/qadic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,8 @@ function _prime(R::QadicField, n::Int = 1)
return z
end

# TODO: For the next minor/breaking release, rename this to base_field and
# deprecate coefficient_ring (and remove the corresponding base_field in Hecke)
function coefficient_ring(K::QadicField)
L = get_attribute!(K, :base_field) do
return PadicField(prime(K), precision(K), cached = false)
end::PadicField
# Should not be here, but Hecke needs it
setprecision!(L, precision(K))
return L
@attr PadicField function base_field(K::QadicField)
return PadicField(prime(K), precision(K), cached = false)
end

###############################################################################
Expand Down
10 changes: 5 additions & 5 deletions test/flint/qadic-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Qp = padic_field(7, cached = false)
K, _ = unramified_extension(Qp, 2)
@test isa(K, QadicField)
@test coefficient_ring(K) === Qp
@test base_field(K) === Qp

R, _ = qadic_field(7, 1, precision = 30)

Expand Down Expand Up @@ -396,8 +396,8 @@ end

@testset "QadicFieldElem.base_field" begin
L, _ = QadicField(7, 2, 10)
@test coefficient_ring(L) isa PadicField
@test prime(coefficient_ring(L)) == 7
@test base_field(L) isa PadicField
@test prime(base_field(L)) == 7
end

@testset "QadicField.setprecision" begin
Expand All @@ -421,7 +421,7 @@ end
a = one(K)
return coeff(a, 0) + 1
end
@test parent(b) === coefficient_ring(K)
@test parent(b) === base_field(K)
@test precision(b) == 30

a = 1 + 2 + 2^2 + O(K, 2^3)
Expand All @@ -444,7 +444,7 @@ end

@testset "QadicField.as_polynomial" begin
L, _ = qadic_field(5, 4)
K = coefficient_ring(L)
K = base_field(L)
Kx, x = K["x"]

for i in 1:100
Expand Down

0 comments on commit 3e508c0

Please sign in to comment.