thofma/Hecke.jl

`Hecke.reduce_mod_powers`

Closed this issue · 2 comments

The function Hecke.reduce_mod_powers(a::nf_elem, n::Int) has been advertised in oscar-system/Oscar.jl/pull/2748.
The interesting situation there is n == 2, and I get the following examples.

julia> K, z = cyclotomic_field(7); a = (z + z^6)^2;

julia> Hecke.reduce_mod_powers(a, 2)   # the square is detected as such, fine
1^1
julia> Hecke.reduce_mod_powers(4*a, 2)  # the given value is still a square, but the common coefficient 4 is not dealt with
4^1
julia> Hecke.reduce_mod_powers(z, 2)  # this root of unity is not detected as the square of z^4
z_7^1

Am I perhaps asking the wrong questions?
(is_square says that the above values are squares.)

thofma commented

Sorry, I forgot to replay to oscar-system/Oscar.jl#2748 (comment). The problem is that reduce_mod_powers does not guarantees what you want. It tries to reduce, but it does not, for example, factor anything.

@thofma O.k., then I will close this issue.
(The documentation of Hecke.reduce_mod_powers does not promise more than what the function does.
It could be improved: Write "integer", write a not \alpha, and the return value is a FacElem not a nf_elem.)