From 2f7e0d631ba9979c8cf046e31629e770f9eca184 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Wed, 17 Apr 2024 16:23:42 +0200 Subject: [PATCH] move code from `Oscar.jl/experimental/GModule/Misc.jl` here The idea is to add this code to Nemo.jl, and then to remove it from Oscar.jl. Concerning the usefulness of this code (and tests to be added), I am not sure which vectors shall be supported by the new methods; vectors of integers are already addressed by other methods. --- src/HeckeMiscFiniteField.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/HeckeMiscFiniteField.jl b/src/HeckeMiscFiniteField.jl index bb7f07282..7ae1a87d5 100644 --- a/src/HeckeMiscFiniteField.jl +++ b/src/HeckeMiscFiniteField.jl @@ -222,6 +222,15 @@ function (k::FqPolyRepField)(a::QQFieldElem) return k(numerator(a)) // k(denominator(a)) end +function (k::Nemo.fpField)(a::Vector) + @assert length(a) == 1 + return k(a[1]) +end + +function (k::fqPolyRepField)(a::Vector) + return k(polynomial(Native.GF(Int(characteristic(k))), a)) +end + (F::fqPolyRepField)(a::zzModRingElem) = F(a.data)