65.104 DirectSumCode

DirectSumCode( C_1, C_2 )

DirectSumCode returns the direct sum of codes C_1 and C_2. The direct sum code consists of every codeword of C_1 concatenated by every codeword of C_2. Therefore, if C_i was a (n_i,M_i,d_i) code, the result is a (n_1+n_2,M_1*M_2,min(d_1,d_2)) code.

If both C_1 and C_2 are linear codes, the result is also a linear code. If one of them is non-linear, the direct sum is non-linear too. In general, a direct sum code is not cyclic.

Performing a direct sum can also be done by adding two codes (see Operations for Codes). Another often used method is the "u, u+v"-construction, described in UUVCode.

    gap> C1 := ElementsCode( [ [1,0], [4,5] ], GF(7) );;
    gap> C2 := ElementsCode( [ [0,0,0], [3,3,3] ], GF(7) );;
    gap> D := DirectSumCode(C1, C2);;
    gap> Elements(D);
    [ [ 1 0 0 0 0 ], [ 1 0 3 3 3 ], [ 4 5 0 0 0 ], [ 4 5 3 3 3 ] ]
    gap> D = C1 + C2;   # addition = direct sum
    true 

Previous Up Top Next
Index

GAP 3.4.4
April 1997