Problem with residue_field
mkirschm opened this issue · 1 comments
mkirschm commented
The following example
P, x = polynomial_ring(ZZ)
K, a = number_field(x^5 + x^3 - x^2 - x - 1)
M = Order(K, [1, 121*a, a^2 - 17*a, a^3 - 72*a, a^4 - 76*a])
P = prime_ideals_over(M, 11)
for i in 1:1000
for p in P
k, h = residue_field(M, p, false)
tmp = preimage(h, Hecke.primitive_element(k))
end
end
fails with
ERROR: Not a valid order element
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] assure_has_coord
@ ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/Elem.jl:186 [inlined]
[3] coordinates(a::NfOrdElem; copy::Bool)
@ Hecke ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/Elem.jl:205
[4] coordinates
@ ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/Elem.jl:204 [inlined]
[5] (::Hecke.var"#_image#316"{FqFieldElem, Vector{FqFieldElem}, Int64, FqField})(x::NfOrdElem)
@ Hecke ~/.julia/dev/Hecke/src/Map/NfOrd.jl:590
[6] (::Hecke.var"#_preimage#317"{NfOrd, Hecke.var"#_image#316"{FqFieldElem, Vector{FqFieldElem}, Int64, FqField}, Vector{nf_elem}, Int64, ZZRingElem})(y::FqFieldElem)
@ Hecke ~/.julia/dev/Hecke/src/Map/NfOrd.jl:608
[7] preimage(f::Hecke.NfOrdToFqFieldMor, x::FqFieldElem)
@ Hecke ~/.julia/dev/Hecke/src/Map/NfOrd.jl:654
[8] top-level scope
@ ./REPL[6]:4
thofma commented
Thanks. I will open a PR with a fix soonish.