Error in `absolute_coordinates` method with native prime fields
mjrodgers opened this issue · 2 comments
mjrodgers commented
We have the absolute_coordinates
method to convert a finite field element to a vector over the prime field corresponding to its internal representation. However while this method is defined for all types of finite field elements, it fails when called on an fpFieldElem
or an FpFieldElem
due to a missing coeff
method for these element types.
julia> k = Native.GF(7)
Finite field of characteristic 7
julia> a = (k)(3)
3
julia> absolute_coordinates(a)
ERROR: MethodError: no method matching coeff(::fpFieldElem, ::Int64)
Closest candidates are:
coeff(::QQPolyRingElem, ::Int64)
@ Nemo ~/.julia/packages/Nemo/0n54t/src/flint/fmpq_poly.jl:53
coeff(::DualRootSpaceElem, ::Int64)
@ Oscar ~/.julia/dev/Oscar/experimental/LieAlgebras/src/RootSystem.jl:627
coeff(::fpAbsPowerSeriesRingElem, ::Int64)
@ Nemo ~/.julia/packages/Nemo/0n54t/src/flint/nmod_abs_series.jl:76
...
Stacktrace:
[1] absolute_coordinates(x::fpFieldElem)
@ Hecke ~/.julia/packages/Hecke/gMNzj/src/Misc/RelFiniteField.jl:518
[2] top-level scope
@ REPL[4]:1
fieker commented
On Wed, Jun 19, 2024 at 04:49:23AM -0700, Morgan Rodgers wrote:
Can be argued if coeffs should be added or a direct implementation of
abs_coord
… We have the `absolute_coordinates` method to convert a finite field element to a vector over the prime field corresponding to its internal representation. However while this method is defined for all types of finite field elements, it fails when called on an `fpFieldElem` or an `FpFieldElem` due to a missing `coeff` method for these element types.
```julia
julia> k = Native.GF(7)
Finite field of characteristic 7
julia> a = (k)(3)
3
julia> absolute_coordinates(a)
ERROR: MethodError: no method matching coeff(::fpFieldElem, ::Int64)
Closest candidates are:
coeff(::QQPolyRingElem, ::Int64)
@ Nemo ~/.julia/packages/Nemo/0n54t/src/flint/fmpq_poly.jl:53
coeff(::DualRootSpaceElem, ::Int64)
@ Oscar ~/.julia/dev/Oscar/experimental/LieAlgebras/src/RootSystem.jl:627
coeff(::fpAbsPowerSeriesRingElem, ::Int64)
@ Nemo ~/.julia/packages/Nemo/0n54t/src/flint/nmod_abs_series.jl:76
...
Stacktrace:
[1] absolute_coordinates(x::fpFieldElem)
@ Hecke ~/.julia/packages/Hecke/gMNzj/src/Misc/RelFiniteField.jl:518
[2] top-level scope
@ REPL[4]:1
```
--
Reply to this email directly or view it on GitHub:
#1546
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
mjrodgers commented
I went with adding coeffs
because it was easy and could possibly fix other issues if anything else generic calls coeffs
. But I'm open to the alternative if that's preferable for any reason.