Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the fix from #2656 #2684

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions experimental/GModule/Cohomology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -429,21 +429,28 @@ end
"""
The relations defining 'F' as an array of pairs.
"""
function _relations_by_generators(G::Oscar.GAPGroup)
f = GAPWrap.IsomorphismFpGroupByGenerators(G.X, GAPWrap.GeneratorsOfGroup(G.X))
@req f != GAP.Globals.fail "Could not convert group into a group of type FPGroup"
H = FPGroup(GAPWrap.Image(f))
return relations(H)
end

Oscar.relations(G::Oscar.GAPGroup) = _relations_by_generators(G)

function Oscar.relations(F::FPGroup)
is_full_fp_group(F) || return _relations_by_generators(F)
R = relators(F)
z = one(free_group(F))
return [(x, z) for x = R]
end

function Oscar.relations(G::Oscar.GAPGroup)
f = GAP.Globals.IsomorphismFpGroupByGenerators(G.X, GAPWrap.GeneratorsOfGroup(G.X))
@req f != GAP.Globals.fail "Could not convert group into a group of type FPGroup"
H = FPGroup(GAPWrap.Image(f))
return relations(H)
end

function Oscar.relations(G::PcGroup)
f = GAP.Globals.IsomorphismFpGroupByPcgs(GAP.Globals.Pcgs(G.X), GAP.Obj("g"))
# Call `GAPWrap.IsomorphismFpGroupByPcgs` only if `gens(G)` is a pcgs.
Ggens = GAPWrap.GeneratorsOfGroup(G.X)
Gpcgs = GAPWrap.Pcgs(G.X)
Ggens == Gpcgs || return _relations_by_generators(G)
f = GAPWrap.IsomorphismFpGroupByPcgs(Gpcgs, GAP.Obj("g"))
@req f != GAP.Globals.fail "Could not convert group into a group of type FPGroup"
H = FPGroup(GAPWrap.Image(f))
return relations(H)
Expand Down
3 changes: 3 additions & 0 deletions src/GAP/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ GAP.@wrap IsWholeFamily(x::Any)::Bool
GAP.@wrap IsZero(x::Any)::Bool
GAP.@wrap IsZmodnZObj(x::Any)::Bool
GAP.@wrap IsZmodnZObjNonprimeCollection(x::Any)::Bool
GAP.@wrap IsomorphismFpGroupByGenerators(x::GapObj, y::GapObj)::GapObj
GAP.@wrap IsomorphismFpGroupByPcgs(x::GapObj, y::GapObj)::GapObj
GAP.@wrap Iterator(x::Any)::GapObj
GAP.@wrap KernelOfCharacter(x::GapObj, y::GapObj)::GapObj
GAP.@wrap LargestMovedPoint(x::Any)::Int
Expand Down Expand Up @@ -231,6 +233,7 @@ GAP.@wrap OnTuples(x::GapObj, y::GapObj)::GapObj
GAP.@wrap Order(x::Any)::GapInt
GAP.@wrap OrthogonalComponents(x::GapObj, y::GapObj, z::GapInt)::GapObj
GAP.@wrap OrthogonalDiscriminants(x::GapObj)::GapObj
GAP.@wrap Pcgs(x::GapObj)::GapObj
GAP.@wrap PermList(x::GapObj)::GapObj
GAP.@wrap Permuted(x::GapObj, y::GapObj)::GapObj
GAP.@wrap PolynomialByExtRep(x::GapObj, y::GapObj)::GapObj
Expand Down
17 changes: 17 additions & 0 deletions test/Experimental/gmodule.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
@testset "Experimental.gmodule" begin
function testrels(G::Oscar.GAPGroup)
ggens = gens(G)
rels = relations(G)
return all(p -> map_word(p[1], ggens) == map_word(p[2], ggens), rels)
end

G = dihedral_group(8)
@test testrels(G) # full pc group
@test testrels(center(G)[1]) # subgroup of full pc group
F = FPGroup(G)
@test testrels(F) # full f.p. group
@test testrels(center(F)[1]) # subgroup of full f.p. group
@test testrels(PermGroup(G)) # nothing of the above
end


@testset "Experimental.gmodule" begin

G = small_group(7*3, 1)
Expand Down
Loading