Magma
Enumerate
enumerate small finite magmas up to isomorphism
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Enumerate( n )
Enumerate( n, options )
n
-
an integer greater than 1
options
optional property specifications
Several options are provided to filter the kind of magmas enumerated. For the most part, these circumscribe various equational identities that the enumerated magmas are required to satisfy.
The recognized options are as follows:
alternative
enumerate alternative magmas
anticommutative
enumerate anti-commutative magmas
associative
enumerate associative magmas
band
enumerate bands (idempotent semigroups)
commutative
enumerate commutative magmas
distributive
enumerate distributive magmas
group
enumerate groups
identity
enumerate magmas in which 1 is the identity element
idempotent
enumerate idempotent magmas
inverses
enumerate magmas with identity in which elements are invertible
kei
enumerate kei (involutary quandles)
leftbol
enumerate left Bol magmas
leftcancellative
enumerate left cancellative magmas
leftdistributive
enumerate left distributive magmas
leftinvolutary
enumerate left involutary magmas (X(XY) = Y)
leftsemimedial
enumerate left semimedial magmas
loop
enumerate loops
medial
enumerate medial magmas
monoid
enumerate monoids
quandle
enumerate quandles
quasigroup
enumerate quasigroups
rack
enumerate racks
rightbol
enumerate right Bol magmas
rightcancellative
enumerate right cancellative magmas
rightdistributive
enumerate right distributive magmas
rightinvolutary
enumerate right involutary magmas (X(YY) = X)
rightsemimedial
enumerate right semimedial magmas
semilattice
enumerate semilattices (commutative and idempotent semigroups)
squag
enumerate squags (idempotent Steiner magmas)
steiner
enumerate Steiner magmas
szasz
enumerate Szasz (uniquely nonassociative) magmas
zeropotent
enumerate zeropotent magmas
The presence of multiple property options implies the conjunction of all the passed option properties. Consequently, contradictory properties, such as associative and szasz will result in no magmas being enumerated.
process = processor
The process = processor option allows you to specify a procedure to be called on each representative of the isomorphism classes of magmas enumerated. The procedure (processor) will be passed the Cayley table as the first argument and the order of the magma (a positive integer) as the second argument, and it can do whatever processing you want with the isomorphism class representative. Note that, if you want the processor argument to keep a copy of the Cayley table, then it must make an explicit copy (using, for instance, the copy command), since the same Array will be passed on each call, but with different numerical entries each time. The processor procedure should not attempt to modify the passed Array representing the Cayley table of the magma; changes will not be reflected in the enumeration.
test = tester
The test = tester option allows you to specify a nonbuilt-in predicate to be used to prune the search tree. It is passed a partially completed Cayley table for a magma of the specified order, as well as the order. Only nonzero elements of the Cayley table are to be tested, as zero elements are, at the time the supplied predicate is called, deemed to be undetermined. It will be called after all the built-in tests have been performed. Therefore, it is safe to assume that partial Cayley tables passed to it already satisfy all partial checks implied by any other properties specified. The tester predicate you pass with this option will be called as a procedure with the partially completed Cayley table as the first argument, and the order of the magma (a positive integer) as the second argument. The partially completed Cayley table has the form of a two-dimensional array with datatype equal to integer[4] and with C_order storage order. Thus, it is possible to use a compiled procedure as the value of this option.
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.
with⁡Magma:
Count the number of two-element magmas, up to isomorphism
Enumerate⁡2
10
Count the number of commutative and associative four-element magmas, up to isomorphism
Enumerate⁡4,commutative,associative
58
Build a list of the three-element commutative and associative magmas.
L≔Enumerate⁡3,associative,commutative,output=list
L≔111111111,111111112,111111113,111112123,111121113,111122122,111122123,111123132,113113331,113123331,122211211,123231312
andmap⁡IsAssociative,L
true
andmap⁡IsCommutative,L
Count, and print compactly, the groups of order 4.
Enumerate⁡4,group,`=`⁡process,m,n↦lprint⁡convert⁡m,listlist
[[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
Count the Moufang loops of order 6.
L≔Enumerate⁡6,leftbol,rightbol,loop
L≔2
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", "argument must be a permutation, but received %1": return true end try; GroupTheory:-IsTransitive( GroupTheory:-Group( map( Perm, gens ) ), {seq}( 1 .. n ) ) end proc:
Enumerate⁡5,quandle,test=isconnected
3
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 );
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≔Enumerate⁡6,loop,test=sqcomm,output=list:
nops⁡L
15
How many of these are not commutative?
nops⁡remove⁡IsCommutative,L
7
The Magma[Enumerate] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
The semilattice option was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
AreIsomorphic
autocompile
IsAssociative
IsCommutative
orbit
permgroup
Download Help Document