Skip to content

Commit

Permalink
proof of comcept: use map in restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
fieker committed Sep 26, 2024
1 parent c1c0067 commit 75fce4b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
21 changes: 14 additions & 7 deletions experimental/GModule/src/GModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include("Misc.jl")

module GModuleFromGap
using Oscar
using Hecke
import Hecke: data

#XXX: clash of names!
Expand Down Expand Up @@ -44,7 +43,7 @@ julia> C = gmodule(CyclotomicField, C);
julia> h = subfields(base_ring(C), degree = 2)[1][2];
julia> restriction_of_scalars(C, h)
G-module for G acting on vector space of dimension 4 over number field
(G-module for G acting on vector space of dimension 4 over number field, Map: C -> g-module for G acting on vector space of dimension 4 over number field)
julia> restriction_of_scalars(C, QQ)
G-module for G acting on vector space of dimension 8 over QQ
Expand All @@ -57,9 +56,15 @@ function restriction_of_scalars(M::GModule{<:Oscar.GAPGroup, <:AbstractAlgebra.F
@assert codomain(phi) == base_ring(M)
d = divexact(degree(codomain(phi)), degree(domain(phi)))
F = free_module(domain(phi), dim(M)*d)
_, _, rep = relative_field(phi)
_, coord, rep = relative_field(phi)

return GModule(F, group(M), [hom(F, F, hvcat(dim(M), [rep(x) for x in transpose(matrix(y))]...)) for y in M.ac])
D = GModule(F, group(M), [hom(F, F, hvcat(dim(M), [rep(x) for x in transpose(matrix(y))]...)) for y in M.ac])
#the blow-up function is not a "nice" module hom as tis is used
#to make from a K-Module to e.g. a QQ-module, so the map
#will be QQ-linear and we'd need to get QQ-gens from a K-module
#also: pre-image is not working (not implemented) (needs more info from
#relative_field)
return D, hom(M, D, MapFromFunc(M.M, D.M, x->D.M(vcat([coord(t) for t = x.v[1,:]]...))); check = false)
end

function restriction_of_scalars(C::GModule{<:Any, <:AbstractAlgebra.FPModule{AbsSimpleNumFieldElem}}, ::QQField)
Expand Down Expand Up @@ -314,7 +319,7 @@ function maximal_submodule_bases(M::GModule{<:Oscar.GAPGroup, <:AbstractAlgebra.
return res
end

function maximal_submodules(M::GModule{<:Oscar.GAPGroup, <:AbstractAlgebra.FPModule{<:FinFieldElem}})
function Oscar.maximal_submodules(M::GModule{<:Oscar.GAPGroup, <:AbstractAlgebra.FPModule{<:FinFieldElem}})
return [sub(M, s) for s = maximal_submodule_bases(M)]
end

Expand Down Expand Up @@ -928,7 +933,8 @@ function Oscar.sub(C::GModule{<:Any, <:AbstractAlgebra.FPModule{T}}, m::MatElem{

y = GAP.Globals.MTX.InducedActionSubmoduleNB(g, x)
F = free_module(k, nrows(b))
return gmodule(F, Group(C), [hom(F, F, matrix([preimage(h, x[i, j]) for i in 1:GAPWrap.NrRows(x), j in 1:GAPWrap.NrCols(x)])) for x = y.generators]), hom(F, C.M, b)
D = gmodule(F, Group(C), [hom(F, F, matrix([preimage(h, x[i, j]) for i in 1:GAPWrap.NrRows(x), j in 1:GAPWrap.NrCols(x)])) for x = y.generators])
return D, hom(C, D, b)
return b
end

Expand All @@ -938,7 +944,8 @@ function Oscar.sub(M::GModule{<:Any, <:AbstractAlgebra.FPModule{T}}, f::Abstract
@assert codomain(f) == M.M
S = domain(f)
Sac = [hom(S, S, [preimage(f, h(f(x))) for x in gens(S)]) for h in M.ac]
return gmodule(S, M.G, Sac)
D = gmodule(S, M.G, Sac)
return D, hom(D, M, f)
end

function gmodule(k::Nemo.FinField, C::GModule{<:Any, <:AbstractAlgebra.FPModule{<:FinFieldElem}})
Expand Down
3 changes: 3 additions & 0 deletions experimental/GModule/src/Misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ Hecke.restrict(::Hecke.NumFieldEmb, ::Map{QQField, AbsSimpleNumField}) = complex
function relative_field(m::Map{<:AbstractAlgebra.Field, <:AbstractAlgebra.Field})
k = domain(m)
K = codomain(m)
if k == base_field(K)
return defining_polynomial(K), Hecke.coordinates, representation_matrix
end
@assert base_field(k) == base_field(K)
kt, t = polynomial_ring(k, cached = false)
f = defining_polynomial(K)
Expand Down
9 changes: 5 additions & 4 deletions experimental/GModule/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ mutable struct GModuleHom{ G, T1, T2} <: Map{GModule{G, T1}, GModule{G, T2}, Osc
@req domain(mp) === M1.M && codomain(mp) === M2.M "map need to map 1st module into 2nd"
#not every hom is a G-Hom...that is what check is supposed to do - eventually
#see 2.
if check
if check #only works if mp is a morphism so that "*" and "==" are doing
#s.th. useful
@assert all(g->action(M1, g)*mp == mp*action(M2, g), gens(M1.G))
end

Expand All @@ -33,8 +34,8 @@ function hom(M1::GModule{T}, M2::GModule{T}, mp::MatElem; check::Bool = true) wh
return GModuleHom(M1, M2, hom(M1.M, M2.M, mp); check)
end

domain(M::GModuleHom) = M.Gm1
codomain(M::GModuleHom) = M.Gm2
domain(M::GModuleHom) = M.GM1
codomain(M::GModuleHom) = M.GM2
parent(M::GModuleHom) = Hecke.MapParent(domain(M), codomain(M), "homomorphisms")

mutable struct GModuleElem{T}
Expand Down Expand Up @@ -79,7 +80,7 @@ end

function (A::GModuleHom)(a::GModuleElem)
@req parent(a) === domain(A) "element has wrong parent"
return GModuleElem(codomain(A), A.module_map(a))
return GModuleElem(codomain(A), A.module_map(a.data))
end

function kernel(A::GModuleHom)
Expand Down

0 comments on commit 75fce4b

Please sign in to comment.