Skip to content

Commit

Permalink
Final tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Jul 29, 2024
1 parent 418ad14 commit b440972
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
39 changes: 17 additions & 22 deletions gap/attributes/isomorph.gi
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,18 @@ end);

InstallMethod(IsIsomorphicSemigroup, "for semigroups",
[IsSemigroup, IsSemigroup],
{S, T} -> IsomorphismSemigroups(S, T) <> fail);

InstallMethod(IsIsomorphicSemigroup, "for finite simple semigroups",
[IsSimpleSemigroup and IsFinite, IsSimpleSemigroup and IsFinite],
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
Expand All @@ -129,30 +134,22 @@ function(R, S)
rmsS := S;
fi;

uR := UnderlyingSemigroup(rmsR);
uS := UnderlyingSemigroup(rmsS);

if Length(Rows(rmsR)) <> Length(Rows(rmsS)) then
return false;
fi;
if Length(Columns(rmsR)) <> Length(Columns(rmsS)) then
return false;
fi;
if Size(uR) <> Size(uS) then
return false;
fi;
if not IsGroup(uR) then
return false;
fi;
if not IsGroup(uS) then
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 := [];
Expand All @@ -162,8 +159,6 @@ function(R, S)
Add(mat, next);
od;

# Make sure underlying groups are the same, and then compare
# canonical Rees matrix semigroups of both R and S
rmsR := CanonicalReesMatrixSemigroup(rmsR);
rmsS := ReesMatrixSemigroup(uR, mat);
rmsS := CanonicalReesMatrixSemigroup(rmsS);
Expand Down
14 changes: 14 additions & 0 deletions tst/standard/attributes/isomorph.tst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ 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);;
Expand Down

0 comments on commit b440972

Please sign in to comment.