diff --git a/gap/attributes/isomorph.gi b/gap/attributes/isomorph.gi index 5d28954a8..c785ec0eb 100644 --- a/gap/attributes/isomorph.gi +++ b/gap/attributes/isomorph.gi @@ -105,7 +105,65 @@ end); InstallMethod(IsIsomorphicSemigroup, "for semigroups", [IsSemigroup, IsSemigroup], -{S, T} -> IsomorphismSemigroups(S, T) <> fail); +function(R, S) + local uR, uS, map, mat, next, row, entry, isoR, rmsR, isoS, rmsS; + + if not (IsFinite(R) and IsSimpleSemigroup(R) + and IsFinite(S) and IsSimpleSemigroup(S)) then + return IsomorphismSemigroups(R, S) <> fail; + fi; + + # Note that when experimenting the method for IsomorphismSemigroups for Rees + # 0-matrix semigroups is faster than the analogue of the below code, and so + # we do not special case finite 0-simple semigroups. + + # Take an isomorphism of R to an RMS if appropriate + if not (IsReesMatrixSemigroup(R) and IsWholeFamily(R) + and IsPermGroup(UnderlyingSemigroup(R))) then + isoR := IsomorphismReesMatrixSemigroupOverPermGroup(R); + rmsR := Range(isoR); + else + rmsR := R; + fi; + # Take an isomorphism of S to an RMS if appropriate + if not (IsReesMatrixSemigroup(S) and IsWholeFamily(S) + and IsPermGroup(UnderlyingSemigroup(S))) then + isoS := IsomorphismReesMatrixSemigroupOverPermGroup(S); + rmsS := Range(isoS); + else + rmsS := S; + fi; + + if Length(Rows(rmsR)) <> Length(Rows(rmsS)) + or (Length(Columns(rmsR)) <> Length(Columns(rmsS))) then + return false; + fi; + + uR := UnderlyingSemigroup(rmsR); + uS := UnderlyingSemigroup(rmsS); + + # uS and uR must be groups because we made them so above. + map := IsomorphismGroups(uS, uR); + if map = fail then + return false; + fi; + + # Make sure underlying groups are the same, and then compare + # canonical Rees matrix semigroups of both R and S + mat := []; + for row in Matrix(rmsS) do + next := []; + for entry in row do + Add(next, entry ^ map); + od; + Add(mat, next); + od; + + rmsR := CanonicalReesMatrixSemigroup(rmsR); + rmsS := ReesMatrixSemigroup(uR, mat); + rmsS := CanonicalReesMatrixSemigroup(rmsS); + return Matrix(rmsR) = Matrix(rmsS); +end); InstallMethod(IsomorphismSemigroups, "for finite simple semigroups", [IsSimpleSemigroup and IsFinite, IsSimpleSemigroup and IsFinite], diff --git a/gap/attributes/isorms.gi b/gap/attributes/isorms.gi index 60e6e75b9..16eb327f8 100644 --- a/gap/attributes/isorms.gi +++ b/gap/attributes/isorms.gi @@ -1368,7 +1368,7 @@ function(S) end); InstallMethod(CanonicalReesMatrixSemigroup, -"for a Rees 0-matrix semigroup", +"for a Rees matrix semigroup", [IsReesMatrixSemigroup], function(S) local G, mat; diff --git a/tst/standard/attributes/isomorph.tst b/tst/standard/attributes/isomorph.tst index 92d9ae609..428e3dd2d 100644 --- a/tst/standard/attributes/isomorph.tst +++ b/tst/standard/attributes/isomorph.tst @@ -9,7 +9,7 @@ ## #@local A, BruteForceInverseCheck, BruteForceIsoCheck, F, G, S, T, U, V, inv -#@local map, x, y +#@local map, x, y, M, N, R, L gap> START_TEST("Semigroups package: standard/attributes/isomorph.tst"); gap> LoadPackage("semigroups", false);; @@ -118,6 +118,44 @@ gap> T := JonesMonoid(4); gap> IsIsomorphicSemigroup(S, T); false +# isomorph: IsIsomorphicSemigroup, for finite simple semigroups +gap> M := [[(1, 2, 3), ()], [(), ()], [(), ()]]; +[ [ (1,2,3), () ], [ (), () ], [ (), () ] ] +gap> N := [[(1, 3, 2), ()], [(), (1, 2, 3)], [(1, 3, 2), (1, 3, 2)]]; +[ [ (1,3,2), () ], [ (), (1,2,3) ], [ (1,3,2), (1,3,2) ] ] +gap> R := ReesMatrixSemigroup(AlternatingGroup([1 .. 3]), M); + +gap> S := ReesMatrixSemigroup(Group([(1, 2, 3)]), N); + +gap> IsIsomorphicSemigroup(R, S); +true +gap> R := SemigroupByMultiplicationTable(MultiplicationTable(R));; +gap> S := SemigroupByMultiplicationTable(MultiplicationTable(S));; +gap> IsIsomorphicSemigroup(R, S); +true +gap> L := [[(), ()], [(), ()], [(1, 2, 3), ()]]; +[ [ (), () ], [ (), () ], [ (1,2,3), () ] ] +gap> T := ReesMatrixSemigroup(SymmetricGroup([1 .. 3]), L); + +gap> IsIsomorphicSemigroup(S, T); +false +gap> IsIsomorphicSemigroup(T, T); +true +gap> M := [[(1, 2, 3), ()], [(), ()], [(), ()]]; +[ [ (1,2,3), () ], [ (), () ], [ (), () ] ] +gap> N := [[(1, 3, 2), ()], [(), (1, 2, 3)]]; +[ [ (1,3,2), () ], [ (), (1,2,3) ] ] +gap> R := ReesMatrixSemigroup(AlternatingGroup([1 .. 3]), M);; +gap> S := ReesMatrixSemigroup(AlternatingGroup([1 .. 3]), N);; +gap> IsIsomorphicSemigroup(R, S); +false +gap> R := ReesMatrixSemigroup(AlternatingGroup([1 .. 5]), +> [[(), ()], [(), (1, 3, 2, 4, 5)]]);; +gap> S := ReesMatrixSemigroup(AlternatingGroup([1 .. 5]), +> [[(1, 5, 4, 3, 2), ()], [(1, 4, 5), (1, 4)(3, 5)]]);; +gap> IsIsomorphicSemigroup(R, S); +false + # isomorph: IsomorphismSemigroups, for infinite semigroup(s) gap> S := FreeSemigroup(1);; gap> T := TrivialSemigroup();;