Skip to content

Commit

Permalink
Fix local fundamental class
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Nov 7, 2023
1 parent cced335 commit 195f22d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Hecke"
uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
version = "0.22.6"
version = "0.22.7"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
9 changes: 8 additions & 1 deletion src/LocalField/neq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,14 @@ end
absolute_representation_matrix(a::fqPolyRepField) = representation_matrix(a)
absolute_representation_matrix(a::fpFieldElem) = matrix(parent(a), 1, 1, [a])

function absolute_representation_matrix(a::RelFinFieldElem)
function absolute_frobenius_matrix(a::FqField, d::Int = 1)
b = absolute_basis(a)
b = [absolute_frobenius(x, d) for x = b]
return matrix([absolute_coordinates(x) for x = b])

Check warning on line 454 in src/LocalField/neq.jl

View check run for this annotation

Codecov / codecov/patch

src/LocalField/neq.jl#L451-L454

Added lines #L451 - L454 were not covered by tests
end


function absolute_representation_matrix(a::Union{RelFinFieldElem, FqFieldElem})

Check warning on line 458 in src/LocalField/neq.jl

View check run for this annotation

Codecov / codecov/patch

src/LocalField/neq.jl#L458

Added line #L458 was not covered by tests
b = a .* absolute_basis(parent(a))
return matrix([absolute_coordinates(x) for x = b])
end
Expand Down
9 changes: 9 additions & 0 deletions src/Misc/RelFiniteField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ function absolute_basis(F::T) where T <: FinField
return powers(gen(F), degree(F)-1)
end

function absolute_basis(F::FqField)
return powers(Nemo._gen(F), absolute_degree(F) - 1)
end

function absolute_coordinates(x::FqFieldElem)
F = prime_field(parent(x))
return FqFieldElem[F(Nemo._coeff(x, i)) for i in 0:Nemo._degree(parent(x))-1]
end

function absolute_coordinates(x::FinFieldElem)
F = parent(x)
Fp = prime_field(F)
Expand Down
23 changes: 23 additions & 0 deletions test/Misc/RelFinField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,29 @@
end
end
end

F = Hecke.Nemo._GF(3^3, cached = false)
x = polynomial_ring(F, "x", cached = false)[2]
K, gK = Hecke.Nemo._residue_field(x^2+1, "a")
Kt, t = K["t"]
L, gL = Hecke.Nemo._residue_field(t^5+t^4+t^2+1, "b")
B = absolute_basis(L)
for i = 1:length(B)
v = absolute_coordinates(B[i])
for j = 1:length(v)
if i == j
@test isone(v[j])
else
@test iszero(v[j])
end
end
end

for i in 1:100
z = rand(L)
@test dot(absolute_coordinates(z), absolute_basis(L)) == z
end

end

@testset "Polynomials" begin
Expand Down

0 comments on commit 195f22d

Please sign in to comment.