HadamardCode( H, t )
HadamardCode( H )
In the first form HadamardCode
returns a Hadamard code from the
Hadamard matrix H, of the <t>^{th} kind. In the second form, <t> =
3 is used.
A Hadamard matrix is a square matrix H with <H>*<H>^T = -n*I_n, where n is the size of H. The entries of H are either 1 or -1.
The matrix H is first transformed into a binary matrix A_n (by replacing the 1's by 0's and the -1's by 1's).
The first kind (t=1) is created by using the rows of A_n as elements, after deleting the first column. This is a (n-1, n, n/2) code. We use this code for creating the Hadamard code of the second kind (t=2), by adding all the complements of the already existing codewords. This results in a (n-1, 2n, n/2 -1) code. The third code (t=3) is created by using the rows of A_n (without cutting a column) and their complements as elements. This way, we have an (n, 2n, n/2) code. The returned code is generally an unrestricted code, but for n = 2^r, the code is linear.
gap> H4 := [[1,1,1,1],[1,-1,1,-1],[1,1,-1,-1],[1,-1,-1,1]];; gap> HadamardCode( H4, 1 ); a (3,4,2)1 Hadamard code of order 4 over GF(2) gap> HadamardCode( H4, 2 ); a (3,8,1)0 Hadamard code of order 4 over GF(2) gap> HadamardCode( H4 ); a (4,8,2)1 Hadamard code of order 4 over GF(2)
HadamardCode( n, t )
HadamardCode( n )
In the first form HadamardCode
returns a Hadamard code with parameter
n of the <t>^{th} kind. In the second form, <t>=3 is used.
When called in these forms, HadamardCode
first creates a Hadamard
matrix (see HadamardMat), of size n and then follows the same
procedure as described above. Therefore the same restrictions with
respect to n as for Hadamard matrices hold.
gap> C1 := HadamardCode( 4 ); a (4,8,2)1 Hadamard code of order 4 over GF(2) gap> C1 = HadamardCode( H4 ); true
GAP 3.4.4