thofma / Hecke.jl

Computational algebraic number theory
Other
224 stars 64 forks source link

setprecision!(f::CompletionMap) #1509

Open simonbrandhorst opened 4 months ago

simonbrandhorst commented 4 months ago
julia> K,toK = completion(F, 2*OF);

julia> F,_ = cyclotomic_field(3)
(Cyclotomic field of order 3, z_3)

julia> OF = maximal_order(F);

julia> K,toK = completion(F, 2*OF);

julia> setprecision!(toK,5)

it seems buggy also for the other methods in the same file

By the way, I found it surprising that the completion map can have a different precision than its codomain.

joschmitt commented 4 months ago

(That is also one of the questions I have in #1500.)

simonbrandhorst commented 4 months ago

For the record, another bug in the ramified case:

  Qx, x = QQ["x"];
  f = x^9 - 828*x^7 - 4371*x^6 + 226071*x^5 + 2371023*x^4 - 14243253*x^3 - 318645900*x^2 - 1637156439*x - 2754662093;

  K, a = number_field(f, "a");
  OK = maximal_order(K);
  p = 3;
  P = prime_ideals_over(OK, p)[1];
  C, mC = completion(K, P, 8);

  setprecision!(mC, 20)
  setprecision!(mC, 21)
  setprecision!(mC, 20) #throws
joschmitt commented 4 months ago

Looks like there is an assert that effectively prevents one from setting the precision back to an earlier value. I also just realized that the field .precision of the map is never updated, although it is used in the setprecision! function.

@thofma These setprecision! methods need to be revised. I could try to understand what they are supposed to be doing. Or is this written down somewhere?

thofma commented 4 months ago

@fieker we forgot (did not have time) to discuss this. What is up with this @assert?