Skip to content

Commit

Permalink
feat: Add DiagonalOfMultiplication method (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
limakzi authored Aug 26, 2024
1 parent 6fc4639 commit 13a1718
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/properties.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#! @Arguments M
#! @Description
#! identifies associativity index of <A>M</A>.
#!
#! @BeginExampleSession
#! gap> List(AllSmallAntimagmas(3), M -> DiagonalOfMultiplicationTable((M)));
#! [ [ 2, 1, 1 ], [ 2, 1, 1 ], [ 2, 3, 2 ], [ 2, 1, 1 ], [ 2, 1, 1 ], [ 2, 1, 2 ], [ 2, 3, 2 ], [ 2, 1, 2 ],
#! [ 2, 3, 1 ], [ 2, 3, 1 ] ]
#! @EndExampleSession
#!
DeclareAttribute( "AssociativityIndex", IsMagma );

#! @Arguments M
#! @Description
#! indentifies associativity index of <A>M</A>.
Expand All @@ -14,8 +26,7 @@
#! gap> AssociativityIndex(OneSmallGroup(4)) = 4 ^ 3;
#! true
#! @EndExampleSession
#!
DeclareAttribute( "AssociativityIndex", IsMagma );
DeclareAttribute( "DiagonalOfMultiplicationTable", IsMagma);

#! @Arguments M
#! @Description
Expand Down
5 changes: 5 additions & 0 deletions lib/properties.gi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ InstallGlobalFunction(AllSubmagmas,
return result;
end);

InstallMethod(DiagonalOfMultiplicationTable, "for a magma", [IsMagma],
function(M)
return DiagonalOfMatrix(MultiplicationTable(M));
end);

InstallMethod(AssociativityIndex, "for a magma", [IsMagma],
function(M)
return Size(Filtered(Tuples(M, 3), t -> (t[1] * t[2]) * t[3] = t[1] * (t[2] * t[3])));
Expand Down

0 comments on commit 13a1718

Please sign in to comment.