MOLS( q )
MOLS( q, n )
MOLS
returns a list of n Mutually Orthogonal Latin Squares
(MOLS). A Latin square of order q is a q by q matrix whose
entries are from a set F_{<q>} of q distinct symbols (GUAVA uses
the integers from 0 to q) such that each row and each column of the
matrix contains each symbol exactly once.
A set of Latin squares is a set of MOLS if and only if for each pair of Latin squares in this set, every ordered pair of elements that are in the same position in these matrices occurs exactly once.
n must be less than q. If n is omitted, two MOLS are returned. If
q is not a prime power, at most 2 MOLS can be created. For all values
of q with <q> > 2 and <q> neq 6, a list of MOLS can be
constructed. GUAVA however does not yet construct MOLS for <q> mod
4 = 2. If it is not possible to construct n MOLS, the function
returns false
.
MOLS are used to create q-ary codes (see MOLSCode).
gap> M := MOLS( 4, 3 );;PrintArray( M[1] ); [ [ 0, 1, 2, 3 ], [ 1, 0, 3, 2 ], [ 2, 3, 0, 1 ], [ 3, 2, 1, 0 ] ] gap> PrintArray( M[2] ); [ [ 0, 2, 3, 1 ], [ 1, 3, 2, 0 ], [ 2, 0, 1, 3 ], [ 3, 1, 0, 2 ] ] gap> PrintArray( M[3] ); [ [ 0, 3, 1, 2 ], [ 1, 2, 0, 3 ], [ 2, 1, 3, 0 ], [ 3, 0, 2, 1 ] ] gap> MOLS( 12, 3 ); false
GAP 3.4.4