Skip to content
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
8 changes: 1 addition & 7 deletions src/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,7 @@ function isomorphism(::Type{FPGroup}, G::GAPGroup; on_gens::Bool=false)
# Known isomorphisms are cached in the attribute `:isomorphisms`.
isos = get_attribute!(Dict{Tuple{Type, Bool}, Any}, G, :isomorphisms)::Dict{Tuple{Type, Bool}, Any}
return get!(isos, (FPGroup, on_gens)) do
if is_trivial(G)
# TODO: remove this special treatment as soon as the change from
# https://github.com/gap-system/gap/pull/5700 is available in Oscar
# (not yet in GAP 4.13.0)
f = GAP.Globals.GroupHomomorphismByImages(GapObj(G), GAP.Globals.FreeGroup(0), GAP.Obj([]), GAP.Obj([]))
GAP.Globals.SetIsBijective(f, true)
elseif on_gens
if on_gens
Ggens = GAPWrap.GeneratorsOfGroup(GapObj(G))
# The computations are easy if `Ggens` is a pcgs,
# otherwise GAP will call `CoKernel`.
Expand Down
8 changes: 7 additions & 1 deletion test/Groups/homomorphisms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,13 @@ end
@test [preimage(f2, x) for x in gens(codomain(f2))] == gens(G)
@test [preimage(f, x) for x in gens(codomain(f))] != gens(G)

@test is_bijective(isomorphism(FPGroup, symmetric_group(1), on_gens = true))
G = symmetric_group(1)
iso = @inferred isomorphism(FPGroup, G, on_gens = true)
@test ngens(G) == ngens(codomain(iso))
@test is_bijective(iso)
G = sub(G, [one(G)])[1]
iso = @inferred isomorphism(FPGroup, G, on_gens = true)
@test ngens(G) == ngens(codomain(iso))

G = abelian_group(PermGroup, [2, 2])
f = @inferred isomorphism(FinGenAbGroup, G)
Expand Down