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

Improved IsIsomorphicSemigroup Method #1023

Merged
merged 23 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c31b830
Some template improvements
james-d-mitchell Jun 25, 2024
43f8503
More example isomorph code
james-d-mitchell Jun 27, 2024
90aafa2
Added the isomtest file created in the meeting yesterday
tillman-froehlich Jun 28, 2024
da90942
Fixed some (but not all) syntax errors
tillman-froehlich Jun 28, 2024
ac95981
Added reminder of which packages to load
tillman-froehlich Jul 2, 2024
6bc3900
Removed useless comments
tillman-froehlich Jul 2, 2024
98f816f
Commented out code that doesn't work yet
tillman-froehlich Jul 2, 2024
cfa3fc2
Added function to make some random Rees matrix semigroups.
tillman-froehlich Jul 3, 2024
caef411
Added testing function to compare isomorphism functions.
tillman-froehlich Jul 3, 2024
dc79b25
Improved testing function
tillman-froehlich Jul 3, 2024
e2f8ec9
Made testing function compare both isomorphic and non-isomorphic semi…
tillman-froehlich Jul 4, 2024
1a74538
Added testing both isomorphism methods against comparing canonical mu…
tillman-froehlich Jul 4, 2024
3f67203
Finished writing IsIsomorphicRMS function, ready to add it to isomorp…
tillman-froehlich Jul 5, 2024
a74a717
Added new isomorphism function to isomorph.gi
tillman-froehlich Jul 5, 2024
8952697
Added tests to isomorph.tst for new function
tillman-froehlich Jul 5, 2024
549141c
Added local variables used in test
tillman-froehlich Jul 5, 2024
08f27cd
Deleted isomtest.g
tillman-froehlich Jul 5, 2024
6febcf7
Fixed code styling
tillman-froehlich Jul 9, 2024
74396f1
Fixed styling in test file
tillman-froehlich Jul 9, 2024
4e0431a
Changed order of processes to improve performance
tillman-froehlich Jul 24, 2024
c51247b
Added test to make sure function works on simple semigroups that aren…
tillman-froehlich Jul 24, 2024
418ad14
Remove slower code
james-d-mitchell Jul 29, 2024
b440972
Final tweaks
james-d-mitchell Jul 29, 2024
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
74 changes: 68 additions & 6 deletions gap/attributes/isomorph.gi
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,69 @@ 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;

# 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;

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
return false;
fi;

map := IsomorphismGroups(uS, uR);
if map = fail then
return false;
fi;

mat := [];
for row in Matrix(rmsS) do
next := [];
for entry in row do
Add(next, entry ^ map);
od;
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);
return Matrix(rmsR) = Matrix(rmsS);
end);

InstallMethod(IsomorphismSemigroups, "for finite simple semigroups",
[IsSimpleSemigroup and IsFinite, IsSimpleSemigroup and IsFinite],
function(S, T)
Expand Down Expand Up @@ -253,7 +316,7 @@ end;
InstallMethod(IsomorphismSemigroups, "for semigroups",
[IsSemigroup, IsSemigroup],
function(S, T)
local invariants, map, DS, DT, p, inv;
local invariants, map, p, inv;

# TODO(later) more invariants
invariants := [IsFinite, IsSimpleSemigroup, IsZeroSimpleSemigroup, Size,
Expand All @@ -279,13 +342,12 @@ function(S, T)
return fail;
fi;

DS := SEMIGROUPS.CanonicalDigraph(S);
DT := SEMIGROUPS.CanonicalDigraph(T);
p := IsomorphismDigraphs(DS[1], DT[1], DS[2], DT[2]);
if p = fail then
if CanonicalMultiplicationTable(S) <> CanonicalMultiplicationTable(T) then
return fail;
fi;
p := RestrictedPerm(p, [1 .. Size(S)]);
p := CanonicalMultiplicationTablePerm(S)
* CanonicalMultiplicationTablePerm(T) ^ -1;

reiniscirpons marked this conversation as resolved.
Show resolved Hide resolved
map := x -> AsSSortedList(T)[PositionSorted(S, x) ^ p];
inv := x -> AsSSortedList(S)[PositionSorted(T, x) ^ (p ^ -1)];
return SemigroupIsomorphismByFunctionNC(S, T, map, inv);
Expand Down
2 changes: 1 addition & 1 deletion gap/attributes/isorms.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 21 additions & 1 deletion tst/standard/attributes/isomorph.tst
Original file line number Diff line number Diff line change
Expand Up @@ -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);;

Expand Down Expand Up @@ -118,6 +118,26 @@ 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);
<Rees matrix semigroup 2x3 over Alt( [ 1 .. 3 ] )>
gap> S := ReesMatrixSemigroup(Group([(1, 2, 3)]), N);
<Rees matrix semigroup 2x3 over Group([ (1,2,3) ])>
gap> IsIsomorphicSemigroup(R, S);
true
reiniscirpons marked this conversation as resolved.
Show resolved Hide resolved
gap> L := [[(), ()], [(), ()], [(1, 2, 3), ()]];
[ [ (), () ], [ (), () ], [ (1,2,3), () ] ]
gap> T := ReesMatrixSemigroup(SymmetricGroup([1 .. 3]), L);
<Rees matrix semigroup 2x3 over Sym( [ 1 .. 3 ] )>
gap> IsIsomorphicSemigroup(S, T);
false
gap> IsIsomorphicSemigroup(T, T);
true

# isomorph: IsomorphismSemigroups, for infinite semigroup(s)
gap> S := FreeSemigroup(1);;
gap> T := TrivialSemigroup();;
Expand Down
Loading