HadamardMat( n )
HadamardMat
returns a Hadamard matrix of order n. This is an n by
n matrix with the property that the matrix multiplied by its transpose
returns n times the identity matrix. This is only possible for <n>=1,
<n>=2 or in cases where n is a multiple of 4. If the matrix does not
exist or is not known, HadamardMat
returns an error. A large number of
construction methods is known to create these matrices for different
orders. HadamardMat
makes use of two construction methods (among which
the Sylvester construction (see SylvesterMat)). These methods cover
most of the possible Hadamard matrices, although some special algorithms
have not been implemented yet. The following orders less than 100 do not
have an implementation for a Hadamard matrix in GUAVA: 28, 36, 52,
76, 92.
gap> C := HadamardMat(8);; PrintArray(C); [ [ 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, -1, 1, -1, 1, -1, 1, -1 ], [ 1, 1, -1, -1, 1, 1, -1, -1 ], [ 1, -1, -1, 1, 1, -1, -1, 1 ], [ 1, 1, 1, 1, -1, -1, -1, -1 ], [ 1, -1, 1, -1, -1, 1, -1, 1 ], [ 1, 1, -1, -1, -1, -1, 1, 1 ], [ 1, -1, -1, 1, -1, 1, 1, -1 ] ] gap> C * TransposedMat(C) = 8 * IdentityMat( 8, 8 ); true
GAP 3.4.4