Skip to content
Open
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
6 changes: 4 additions & 2 deletions gap/attributes/cartan.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DeclareAttribute("GeneralizedConjugacyClassesRepresentatives", IsSemigroup);
DeclareAttribute("GeneralizedConjugacyClasses", IsSemigroup);
DeclareCategory("IsMonoidCharacterTable", IsObject);
DeclareAttribute("ParentAttr", IsMonoidCharacterTable);
DeclareAttribute("Irr", IsMonoidCharacterTable);
DeclareAttribute("MonoidCharacterTable", IsSemigroup);

DeclareCategory("IsMonoidCharacter", IsObject);
Expand All @@ -34,10 +35,11 @@ DeclareAttribute("RClassBicharacterOfGroupHClass", IsGroupHClass);
DeclareAttribute("RClassRadicalOfGroupHClass", IsGroupHClass);
DeclareAttribute("RClassRadicalBicharacterOfGroupHClass", IsGroupHClass);
DeclareAttribute("BlockDiagonalMatrixOfCharacterTables", IsSemigroup);
DeclareAttribute("Irr", IsMonoidCharacterTable);

DeclareCategory("IsMonoidCartanMatrix", IsObject);
DeclareAttribute("ParentAttr", IsMonoidCartanMatrix);
DeclareAttribute("MonoidCartanMatrix", IsSemigroup);

DeclareAttribute("Pims", IsMonoidCartanMatrix);
DeclareAttribute("Pims", IsMonoidCartanMatrix);

DeclareOperation("PrepareTableDisplay", [IsList, IsString, IsString]);
260 changes: 102 additions & 158 deletions gap/attributes/cartan.gi
Original file line number Diff line number Diff line change
Expand Up @@ -94,115 +94,18 @@ function(ct)
ParentAttr(ct));
end);

# Notes to consider when changing the code for the display string
# for IsMonoidCharacterTable.
#
# The following conventions were observed in the character tables of
# groups.
# Integer entries are never truncated and make their column bigger
# -/A prefix makes a column bigger
# Checking for redunacnies under *M is not implemented. However
# character tables of groups do check for *M redundancies.
# Column headers do not get padded to match wider columns.

InstallMethod(DisplayString, "for a monoid character table",
[IsMonoidCharacterTable],
function(ct)
local str, columnlabels, rowlabels, strarray, sizetable, i, j, ctmatrix,
rosetastone, coltable, columnwidth, rowlabelwidth, currentwidth, currentpage,
screensizeassume, quotientcolumnwidthsums, temp, temp2, temp3, temp4;
local str;

str := StringFormatted("MonoidCharacterTable( {} )",
ParentAttr(ct));

if HasIrr(ct) then
sizetable := Length(Irr(ct));

strarray := List([1 .. sizetable], x -> List([1 .. sizetable], y -> "."));
ctmatrix := List(Irr(ct), ValuesOfMonoidClassFunction);
rosetastone := Filtered(Unique(Concatenation(List(Irr(ct),
ValuesOfMonoidClassFunction))),
x -> not IsInt(x));

columnlabels := List([1 .. 2], x -> List([1 .. sizetable], y -> " "));
rowlabels := List([1 .. (sizetable + 2)], x -> " ");

for i in [1 .. sizetable] do
rowlabels[i + 2] := Concatenation("X.", String(i));
od;

for j in [1 .. sizetable] do
columnlabels[1, j] := Concatenation("c.", String(j));
od;

for j in [1 .. sizetable] do
columnlabels[2, j] := " ";
od;

for i in [1 .. sizetable] do
for j in [1 .. sizetable] do
if IsInt(ctmatrix[i, j]) then
if not IsZero(ctmatrix[i, j]) then
strarray[i, j] := String(ctmatrix[i, j]);
fi;
else
strarray[i, j] := WordAlp("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
Position(rosetastone, ctmatrix[i, j]));
fi;
od;
od;

coltable := Concatenation(columnlabels, strarray);

columnwidth := List(List(TransposedMat(coltable),
x -> List(x, Length)), Maximum) + 1;

rowlabelwidth := Maximum(List(rowlabels, Length));

for i in [1 .. Length(rowlabels)] do

rowlabels[i] := Concatenation(rowlabels[i],
WordAlp(" ", rowlabelwidth - Length(rowlabels[i])));
od;

for i in [1 .. Length(coltable)] do
for j in [1 .. sizetable] do
coltable[i, j] := Concatenation(WordAlp(" ",
columnwidth[j] - Length(coltable[i, j])),
coltable[i, j]);
od;
od;

screensizeassume := Maximum(SizeScreen()[1], 20) - rowlabelwidth;
currentwidth := 0;
currentpage := 0;
quotientcolumnwidthsums := List(columnwidth, x -> 0);
for i in [1 .. sizetable] do
currentwidth := currentwidth + columnwidth[i];
if currentwidth + 1 < screensizeassume then
quotientcolumnwidthsums[i] := currentpage;
else
currentwidth := columnwidth[i];
currentpage := currentpage + 1;
quotientcolumnwidthsums[i] := currentpage;
fi;
od;

temp := Concatenation(List([0 .. Last(quotientcolumnwidthsums)],
k -> List(coltable,
x -> Concatenation(x{Positions(quotientcolumnwidthsums, k)}))));

temp2 := List(temp, x -> Concatenation(x, "\n"));

temp3 := Concatenation(List([1 .. Length(temp2)],
x -> Concatenation(rowlabels[((x - 1) mod Length(rowlabels)) + 1],
temp2[x])));

temp4 := List([1 .. Length(rosetastone)],
x -> Concatenation(WordAlp("ABCDEFGHIJKLMNOPQRSTUVWXYZ", x),
" := ", String(rosetastone[x]), "\n"));

str := Concatenation(temp3, "\n", Concatenation(temp4));
str := PrepareTableDisplay(List(Irr(ct), ValuesOfMonoidClassFunction),
"X", "c");

fi;

Expand Down Expand Up @@ -235,90 +138,131 @@ end);
InstallMethod(DisplayString, "for a monoid cartan matrix",
[IsMonoidCartanMatrix],
function(cm)
local str, columnlabels, rowlabels, strarray, sizetable, i, j, cmmatrix,
coltable, columnwidth, rowlabelwidth, currentwidth, currentpage,
screensizeassume, quotientcolumnwidthsums, temp, temp2;
local str;

str := StringFormatted("MonoidCartanMatrix( {} )",
ParentAttr(cm));

if HasPims(cm) then
sizetable := Length(Pims(cm));

strarray := List([1 .. sizetable], x -> List([1 .. sizetable], y -> "."));
cmmatrix := List(Pims(cm), ValuesOfCompositionFactorsFunction);
str := PrepareTableDisplay(List(Pims(cm),
ValuesOfCompositionFactorsFunction),
"P", "X");

columnlabels := List([1 .. 2], x -> List([1 .. sizetable], y -> " "));
rowlabels := List([1 .. (sizetable + 2)], x -> " ");
fi;

for i in [1 .. sizetable] do
rowlabels[i + 2] := Concatenation("P.", String(i));
od;
return str;
end);

for j in [1 .. sizetable] do
columnlabels[1, j] := Concatenation("X.", String(j));
od;
# Notes to consider when changing the code for the PrepareTableDisplay
#
# This affects both the MonoidCharacterTable and MonoidCartanMatrix
# display functionality
#
# The following conventions were observed in the character tables of
# groups.
# Integer entries are never truncated and make their column bigger
# -/A prefix makes a column bigger
# Checking for redunacnies under *M is not implemented. However
# character tables of groups do check for *M redundancies.
# Column headers do not get padded to match wider columns.

for j in [1 .. sizetable] do
columnlabels[2, j] := " ";
od;
InstallMethod(PrepareTableDisplay, "for a square list of lists with values",
[IsList, IsString, IsString],
function(datamatrix, labela, labelb)
local columnlabels, rowlabels, strarray, sizetable, i, j,
rosetastone, coltable, columnwidth, rowlabelwidth, currentwidth, currentpage,
screensizeassume, quotientcolumnwidthsums, temp, temp2, temp3, temp4;

for i in [1 .. sizetable] do
for j in [1 .. sizetable] do
if not IsZero(cmmatrix[i, j]) then
strarray[i, j] := String(cmmatrix[i, j]);
fi;
od;
od;
sizetable := Length(datamatrix);

coltable := Concatenation(columnlabels, strarray);
strarray := List([1 .. sizetable], x -> List([1 .. sizetable], y -> "."));
rosetastone := Filtered(Unique(Concatenation(datamatrix)),
x -> not IsInt(x));

columnwidth := List(List(TransposedMat(coltable),
x -> List(x, Length)), Maximum) + 1;
columnlabels := List([1 .. 2], x -> List([1 .. sizetable], y -> " "));
rowlabels := List([1 .. (sizetable + 2)], x -> " ");

rowlabelwidth := Maximum(List(rowlabels, Length));
for i in [1 .. sizetable] do
rowlabels[i + 2] := Concatenation(labela, ".", String(i));
od;

for i in [1 .. Length(rowlabels)] do
rowlabels[i] := Concatenation(rowlabels[i],
WordAlp(" ", rowlabelwidth - Length(rowlabels[i])));
od;
for j in [1 .. sizetable] do
columnlabels[1, j] := Concatenation(labelb, ".", String(j));
od;

for i in [1 .. Length(coltable)] do
for j in [1 .. sizetable] do
coltable[i, j] := Concatenation(WordAlp(" ",
columnwidth[j] - Length(coltable[i, j])),
coltable[i, j]);
od;
od;
for j in [1 .. sizetable] do
columnlabels[2, j] := " ";
od;

screensizeassume := Maximum(SizeScreen()[1], 20) - rowlabelwidth;
currentwidth := 0;
currentpage := 0;
quotientcolumnwidthsums := List(columnwidth, x -> 0);
for i in [1 .. sizetable] do
currentwidth := currentwidth + columnwidth[i];
if currentwidth + 1 < screensizeassume then
quotientcolumnwidthsums[i] := currentpage;
for i in [1 .. sizetable] do
for j in [1 .. sizetable] do
if IsInt(datamatrix[i, j]) then
if not IsZero(datamatrix[i, j]) then
strarray[i, j] := String(datamatrix[i, j]);
fi;
else
currentwidth := columnwidth[i];
currentpage := currentpage + 1;
quotientcolumnwidthsums[i] := currentpage;
strarray[i, j] := WordAlp("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
Position(rosetastone, datamatrix[i, j]));
fi;
od;
od;

coltable := Concatenation(columnlabels, strarray);

temp := Concatenation(List([0 .. Last(quotientcolumnwidthsums)],
k -> List(coltable,
x -> Concatenation(x{Positions(quotientcolumnwidthsums, k)}))));
columnwidth := List(List(TransposedMat(coltable),
x -> List(x, Length)), Maximum) + 1;

temp2 := List(temp, x -> Concatenation(x, "\n"));
rowlabelwidth := Maximum(List(rowlabels, Length));

str := Concatenation(List([1 .. Length(temp2)],
x -> Concatenation(rowlabels[((x - 1) mod Length(rowlabels)) + 1],
temp2[x])));
for i in [1 .. Length(rowlabels)] do

rowlabels[i] := Concatenation(rowlabels[i],
WordAlp(" ", rowlabelwidth - Length(rowlabels[i])));
od;

for i in [1 .. Length(coltable)] do
for j in [1 .. sizetable] do
coltable[i, j] := Concatenation(WordAlp(" ",
columnwidth[j] - Length(coltable[i, j])),
coltable[i, j]);
od;
od;

screensizeassume := Maximum(SizeScreen()[1], 20) - rowlabelwidth;
currentwidth := 0;
currentpage := 0;
quotientcolumnwidthsums := List(columnwidth, x -> 0);
for i in [1 .. sizetable] do
currentwidth := currentwidth + columnwidth[i];
if currentwidth + 1 < screensizeassume then
quotientcolumnwidthsums[i] := currentpage;
else
currentwidth := columnwidth[i];
currentpage := currentpage + 1;
quotientcolumnwidthsums[i] := currentpage;
fi;
od;

temp := Concatenation(List([0 .. Last(quotientcolumnwidthsums)],
k -> List(coltable,
x -> Concatenation(x{Positions(quotientcolumnwidthsums, k)}))));

temp2 := List(temp, x -> Concatenation(x, "\n"));

temp3 := Concatenation(List([1 .. Length(temp2)],
x -> Concatenation(rowlabels[((x - 1) mod Length(rowlabels)) + 1],
temp2[x])));

if Length(rosetastone) > 0 then
temp4 := List([1 .. Length(rosetastone)],
x -> Concatenation(WordAlp("ABCDEFGHIJKLMNOPQRSTUVWXYZ", x),
" := ", String(rosetastone[x]), "\n"));

return Concatenation(temp3, "\n", Concatenation(temp4));
fi;

return str;
return temp3;
end);

BindGlobal("MonoidCharacterType",
Expand Down
1 change: 0 additions & 1 deletion tst/standard/attributes/cartan.tst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ X.4 2 . -1 1 -1 .
X.5 3 1 . 1 1 .
X.6 1 1 1 1 1 1


# Creation of a lazy monoid cartan matrix - 1
gap> S := FullTransformationMonoid(3);;
gap> MonoidCartanMatrix(S);
Expand Down
Loading