enumerate small finite magmas up to isomorphism - Maple Help

Home : Support : Online Help : Mathematics : Algebra : Magma : Magma/Enumerate

Magma[Enumerate] - enumerate small finite magmas up to isomorphism

 Calling Sequence Enumerate( n ) Enumerate( n, options )

Parameters

 n - an integer greater than 1 options - optional property specifications

Description

 • The Enumerate command enumerates small (finite) magmas, optionally subject to certain constraints, described below. By default, it simply counts the number of such structures, up to isomorphism.
 When called with no options or optional arguments, the Enumerate command simply counts the number of isomorphism classes of magmas of order n.

Examples

 > $\mathrm{with}\left(\mathrm{Magma}\right):$

Count the number of two-element magmas, up to isomorphism

 > $\mathrm{Enumerate}\left(2\right)$
 ${10}$ (1)

Count the number of commutative and associative four-element magmas, up to isomorphism

 > $\mathrm{Enumerate}\left(4,'\mathrm{commutative}','\mathrm{associative}'\right)$
 ${58}$ (2)

Build a list of the three-element commutative and associative magmas.

 > $L:=\mathrm{Enumerate}\left(3,'\mathrm{associative}','\mathrm{commutative}','\mathrm{output}'='\mathrm{list}'\right)$
 ${L}{:=}\left[\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {1}& {1}\\ {1}& {1}& {1}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {1}& {1}\\ {1}& {1}& {2}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {1}& {1}\\ {1}& {1}& {3}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {1}& {2}\\ {1}& {2}& {3}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {1}\\ {1}& {1}& {3}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {2}\\ {1}& {2}& {2}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {2}\\ {1}& {2}& {3}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {1}\\ {1}& {2}& {3}\\ {1}& {3}& {2}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {3}\\ {1}& {1}& {3}\\ {3}& {3}& {1}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {1}& {3}\\ {1}& {2}& {3}\\ {3}& {3}& {1}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {2}& {2}\\ {2}& {1}& {1}\\ {2}& {1}& {1}\end{array}\right]{,}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {2}& {3}& {1}\\ {3}& {1}& {2}\end{array}\right]\right]$ (3)
 > $\mathrm{andmap}\left(\mathrm{IsAssociative},L\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{andmap}\left(\mathrm{IsCommutative},L\right)$
 ${\mathrm{true}}$ (5)

Count, and print compactly, the groups of order 4.

 > $\mathrm{Enumerate}\left(4,'\mathrm{group}','\mathrm{process}'=\left(\left(m,n\right)→\mathrm{lprint}\left(\mathrm{convert}\left(m,'\mathrm{listlist}'\right)\right)\right)\right)$
 [[1, 2, 3, 4], [2, 1, 4, 3], [3, 4, 1, 2], [4, 3, 2, 1]] [[1, 2, 3, 4], [2, 1, 4, 3], [3, 4, 2, 1], [4, 3, 1, 2]]
 ${2}$ (6)

Count the Moufang loops of order 6.

 > $L:=\mathrm{Enumerate}\left(6,\mathrm{leftbol},\mathrm{rightbol},\mathrm{loop}\right)$
 ${L}{:=}{2}$ (7)

Count connected quandles of order 5.

 > isconnected := proc( m, n )    local i, gens;    try      gens := map( convert, {seq}( convert( m[ .., i ], 'list' ), i = 1 .. n ), 'disjcyc' )    catch "not a permutation":      return true    end try;    evalb( nops( group:-orbit( permgroup( n, gens ), 1 ) ) = n ) end proc:
 > $\mathrm{Enumerate}\left(5,'\mathrm{quandle}','\mathrm{test}'=\mathrm{isconnected}\right)$
 ${3}$ (8)

Determine which groups of order 9 have the property that each member of the group is a square.  The passed procedures must ignore currently undefined entries (represented by zeros) in the table and return false just in the case that a duplicate diagonal entry is found.  Otherwise, true is returned to indicate to the enumeration engine that it should continue trying to complete the Cayley table.

 > Enumerate( 9, 'group', 'test' = proc( m, n )  local i, L := remove( type, [seq]( m[ i, i ], i = 1 .. n ), 0 );  evalb( nops( L ) = nops( {op}( L ) ) ) end proc );
 ${2}$ (9)

Count the loops of order 6 such that every square commutes with every member of the loop.  This illustrates the use of a procedure with the option autocompile.

 > sqcomm := proc( m :: Array( datatype = integer[4], order = C_order ), n :: posint )   option autocompile;   local i, j, z;   for i from 1 to n do     z := m[ i, i ];     if z <> 0 then # ignore undefined entries       for j from 1 to n do         if m[ z, j ] <> 0 and m[ j, z ] <> 0 then # ignore undefined entries           if m[ z, j ] <> m[ j, z ] then             return false           end if         end if       end do     end if   end do;   true end proc:
 > $L:=\mathrm{Enumerate}\left(6,'\mathrm{loop}','\mathrm{test}'='\mathrm{sqcomm}','\mathrm{output}'='\mathrm{list}'\right):$
 > $\mathrm{nops}\left(L\right)$
 ${15}$ (10)

How many of these are not commutative?

 > $\mathrm{nops}\left(\mathrm{remove}\left(\mathrm{IsCommutative},L\right)\right)$
 ${7}$ (11)