From e389cb9b191503c16c36eb3a20366e3840dea360 Mon Sep 17 00:00:00 2001 From: Claus Fieker Date: Thu, 21 Sep 2023 10:30:25 +0200 Subject: [PATCH 1/2] add attributes so some fields --- src/LocalField/Types.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LocalField/Types.jl b/src/LocalField/Types.jl index 9bc7d49586..9eb1d5f909 100644 --- a/src/LocalField/Types.jl +++ b/src/LocalField/Types.jl @@ -3,7 +3,7 @@ abstract type EisensteinLocalField <: LocalFieldParameter end abstract type UnramifiedLocalField <: LocalFieldParameter end abstract type GenericLocalField <: LocalFieldParameter end -mutable struct LocalField{S, T} <: NonArchLocalField +@attributes mutable struct LocalField{S, T} <: NonArchLocalField def_poly::Function #Int -> Poly at prec n def_poly_cache::Dict{Int, Generic.Poly{S}} S::Symbol From ab46e1f72f2c3066b17d9884fd271ea6de027c88 Mon Sep 17 00:00:00 2001 From: Claus Fieker Date: Thu, 21 Sep 2023 10:30:46 +0200 Subject: [PATCH 2/2] "fix" precision settings solves Tommy's log problem Underlying problem: map_coefficients is clever: a zero coefficient is mapped to zero(target), thus when applying it with x->setprecision(x, new) the target precision is ignored and the ring precision is used instead --- src/LocalField/Elem.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LocalField/Elem.jl b/src/LocalField/Elem.jl index 798a89abcb..7d7c54720f 100644 --- a/src/LocalField/Elem.jl +++ b/src/LocalField/Elem.jl @@ -693,7 +693,9 @@ function Base.:(^)(a::LocalFieldElem, n::Int) e = absolute_ramification_index(parent(a)) v = valuation(n, prime(parent(a))) if v > 0 - b = setprecision(a.data, precision(a.data)+v) + b = setprecision(base_ring(a.data), precision(a.data)+v) do + setprecision(a.data, precision(a.data)+v) + end else b = a.data end