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

Add more matrix generators. #822

Merged
merged 5 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
Binary file added data/gens/fullbool-8.pickle.gz
Binary file not shown.
Binary file modified data/gens/fullbool.pickle.gz
Binary file not shown.
Binary file modified data/gens/hall.pickle.gz
Binary file not shown.
Binary file added data/gens/reflex-6.pickle.gz
Binary file not shown.
40 changes: 34 additions & 6 deletions gap/semigroups/semiex.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1378,9 +1378,17 @@ function(n)
"/data/gens/reflex.pickle.gz"));
fi;

if n = 6 and not IsBound(SEMIGROUPS.GENERATORS.Reflex[6]) then
Info(InfoSemigroups, 2, "reading generators; this may take some time");
Add(SEMIGROUPS.GENERATORS.Reflex,
ReadGenerators(Concatenation(SEMIGROUPS.PackageDir,
"/data/gens/reflex-6.pickle.gz")));
fi;

if not IsBound(SEMIGROUPS.GENERATORS.Reflex[n]) then
ErrorNoReturn("generators for this monoid are only known up to dimension ",
String(Length(SEMIGROUPS.GENERATORS.Reflex)));
ErrorNoReturn("Semigroups: ReflexiveBooleanMatMonoid:\n",
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
"generators for this monoid are only provided up to ",
"dimension 6,");
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
fi;

return Monoid(SEMIGROUPS.GENERATORS.Reflex[n]);
Expand All @@ -1389,15 +1397,26 @@ end);
InstallMethod(HallMonoid, "for a positive integer",
[IsPosInt],
function(n)
local gens, p;

if not IsBound(SEMIGROUPS.GENERATORS.Hall) then
SEMIGROUPS.GENERATORS.Hall :=
ReadGenerators(Concatenation(SEMIGROUPS.PackageDir,
"/data/gens/hall.pickle.gz"));
fi;

if n = 8 then
gens := GeneratorsOfSemigroup(FullBooleanMatMonoid(8));
p := PositionProperty(gens,
x -> ListWithIdenticalEntries(8, false)
in AsList(x));
return Monoid(gens{[1 .. p - 1]}, gens{[p + 1 .. Length(gens)]});
fi;

if not IsBound(SEMIGROUPS.GENERATORS.Hall[n]) then
ErrorNoReturn("generators for this monoid are only known up to dimension ",
String(Length(SEMIGROUPS.GENERATORS.Hall)));
ErrorNoReturn("Semigroups: HallMonoid:\n",
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
"generators for this monoid are only known up to dimension ",
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
"8,");
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
fi;

return Monoid(SEMIGROUPS.GENERATORS.Hall[n]);
Expand All @@ -1412,14 +1431,23 @@ function(n)
"/data/gens/fullbool.pickle.gz"));
fi;

if n = 8 and not IsBound(SEMIGROUPS.GENERATORS.FullBool[8]) then
Info(InfoSemigroups, 2, "reading generators; this may take some time");
Add(SEMIGROUPS.GENERATORS.FullBool,
ReadGenerators(Concatenation(SEMIGROUPS.PackageDir,
"/data/gens/fullbool-8.pickle.gz")));
fi;

if not IsBound(SEMIGROUPS.GENERATORS.FullBool[n]) then
ErrorNoReturn("generators for this monoid are only known up to dimension ",
String(Length(SEMIGROUPS.GENERATORS.FullBool)));
ErrorNoReturn("Semigroups: FullBooleanMatMonoid:\n",
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
"generators for this monoid are only known up to dimension ",
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
"8,");
james-d-mitchell marked this conversation as resolved.
Show resolved Hide resolved
fi;

return Monoid(SEMIGROUPS.GENERATORS.FullBool[n]);
end);


#############################################################################
## Tropical matrix monoids
#############################################################################
Expand Down
23 changes: 17 additions & 6 deletions tst/standard/semigroups/semiex.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2013,10 +2013,11 @@ gap> S := ReflexiveBooleanMatMonoid(3);
<monoid of 3x3 boolean matrices with 8 generators>
gap> S := ReflexiveBooleanMatMonoid(5);
<monoid of 5x5 boolean matrices with 1414 generators>
gap> S := ReflexiveBooleanMatMonoid(6);
Error, generators for this monoid are only known up to dimension 5
gap> S := ReflexiveBooleanMatMonoid(7);
Error, Semigroups: ReflexiveBooleanMatMonoid:
generators for this monoid are only provided up to dimension 6,

# Test HallBooleanMatMonoid
# Test HallMonoid
gap> HallMonoid(1);
<trivial group of 1x1 boolean matrices with 1 generator>
gap> S := HallMonoid(3);
Expand All @@ -2026,9 +2027,14 @@ gap> Size(S);
gap> S := HallMonoid(5);
<monoid of 5x5 boolean matrices with 12 generators>
gap> S := HallMonoid(6);
Error, generators for this monoid are only known up to dimension 5
<monoid of 6x6 boolean matrices with 67 generators>
gap> S := HallMonoid(7);
<monoid of 7x7 boolean matrices with 2141 generators>
gap> S := HallMonoid(9);
Error, Semigroups: HallMonoid:
generators for this monoid are only known up to dimension 8,

# Test FullBooleanMatBooleanMatMonoid
# Test FullBooleanMatMonoid
gap> FullBooleanMatMonoid(1);
<commutative monoid of 1x1 boolean matrices with 1 generator>
gap> S := FullBooleanMatMonoid(3);
Expand All @@ -2038,7 +2044,12 @@ true
gap> S := FullBooleanMatMonoid(5);
<monoid of 5x5 boolean matrices with 13 generators>
gap> S := FullBooleanMatMonoid(6);
Error, generators for this monoid are only known up to dimension 5
<monoid of 6x6 boolean matrices with 68 generators>
gap> S := FullBooleanMatMonoid(7);
<monoid of 7x7 boolean matrices with 2142 generators>
gap> S := FullBooleanMatMonoid(9);
Error, Semigroups: FullBooleanMatMonoid:
generators for this monoid are only known up to dimension 8,

#
gap> SEMIGROUPS.StopTest();
Expand Down