A Hadamard matrix is a square matrix, all of whose entries are ±1, such that every pair of rows differ in exactly half the number of places (and similarly, every pair of columns differ in exactly half the number of places). Given a Hadamard matrix it is always possible to find an equivalent matrix (a normalised matrix) in which the first row and column consist entirely of +1's. Given a normalised Hadamard matrix, a symmetric (4t – 1,2t – 1,t – 1) design may be constructed, and conversely.
Two Hadamard matrices are said to be equivalent if one can be transformed into the other by performing a sequence of row swaps, column swaps, row negations, or column negations. Determining whether two Hadamard matrices are equivalent is a hard problem, due to the regularity of the structure. Magma determines this equivalence by first transforming the matrices to equivalent graph as described by Brouwer et al., and then applying the nauty tools to determine if the resulting graphs are isomorphic. A variant of this approach can be used to get a canonical form for a Hadamard matrix. A further modification of the algorithm is used to compute the automorphism group.
Magma also implements the 4-profile, an invariant based on considering sets of four rows at a time of the matrix. Since equivalent matrices have equal 4-profiles, this can sometimes be used as a fast test for inequivalence before commencing the more expensive full tests. More recently, Magma has installed the alternative graph isomorphism code of Traces for the Hadamard computations. Traces functions much like nauty but with a different choice of strategy that is sometimes much more efficient. Testing has shown that for larger Hadamard matrices the time savings of using Traces can be considerable.
Magma includes a large database of Hadamard matrices, with at least one example in all possible dimensions up to 256. It contains complete enumerations up to dimension 28, and a decent number of representatives up to dimension 72 (note that the dimension of a Hadamard matrix must be 1, 2, or a multiple of 4). A recent project has produced 29,613 Hadamard matrices of order 256 from difference sets constructed in groups of order 256. These will be added to the database in the near future.
The Hadamard matrix machinery has been used in a number of applications. The main application known to us is in equivalence testing by groups constructing new Hadamard matrices. Another application has been to the construction of codes and other combinatorial objects from Hadamard matrices.