Given an [n, k] linear code C over R, construct the subcode of C, generated by the elements specified by the list L, where L is a list of one or more items of the following types:
- (a)
- An element of C;
- (b)
- A set or sequence of elements of C;
- (c)
- A sequence of n elements of R, defining an element of C;
- (d)
- A set or sequence of sequences of type (c);
- (e)
- A subcode of C;
Given an [n, k] linear code C and an integer t, 1 ≤t < n, return a subcode of C of dimension t.
Given an [n, k] linear code C and a set S of integers, each of which lies in the range [1, k], return the subcode of C generated by the basis elements whose positions appear in S.
Given a linear code C1 and a subcode C2 of C1, return a subcode of C1 of dimension k containing C2.
Given an [n, k] linear code C and a set S of integers, each of which lies in the range [1, n], return the subcode of C generated by those words of C whose weights lie in S.
> C1 := RepetitionCode(GF(2),6); > C1; [6, 1, 6] Cyclic Code over GF(2) Generator matrix: [1 1 1 1 1 1] > C3 := EvenWeightCode(6); > C3; [6, 5, 2] Linear Code over GF(2) Generator matrix: [1 0 0 0 0 1] [0 1 0 0 0 1] [0 0 1 0 0 1] [0 0 0 1 0 1] [0 0 0 0 1 1] > C1 subset C3; true > C2 := SubcodeBetweenCode(C3, C1, 4); > C2; [6, 4, 2] Linear Code over GF(2) Generator matrix: [1 0 0 0 1 0] [0 1 0 0 0 1] [0 0 1 0 0 1] [0 0 0 1 0 1] > (C1 subset C2) and (C2 subset C3); true
For the following operators, C and D are codes defined as subsets (or subspaces) of the same R-space V.
The (vector space) sum of the linear codes C and D, where C and D are contained in the same K-space V.
The intersection of the linear codes C and D, where C and D are contained in the same K-space V.
The dual D of the linear code C. The dual consists of all codewords in the K-space V which are orthogonal to all codewords of C.
> C := EvenWeightCode(5); > C; [5, 4, 2] Linear Code over GF(2) Generator matrix: [1 0 0 0 1] [0 1 0 0 1] [0 0 1 0 1] [0 0 0 1 1] > C1 := sub< C | C.1 >; > C2 := sub< C | C.4 >; > C3 := sub< C | { C.1 , C.4} >; > (C1 + C2) eq C3; true > (C1 meet C3) eq C1; true
> K<w> := GF(8); > R := ReedSolomonCode(K, 3); > R; [7, 5, 3] BCH code (d = 3, b = 1) over GF(2^3) Generator matrix: [ 1 0 0 0 0 w^3 w^4] [ 0 1 0 0 0 1 1] [ 0 0 1 0 0 w^3 w^5] [ 0 0 0 1 0 w w^5] [ 0 0 0 0 1 w w^4] > D := Dual(R); > D; [7, 2, 6] Cyclic Code over GF(2^3) Generator matrix: [ 1 0 w^3 1 w^3 w w] [ 0 1 w^4 1 w^5 w^5 w^4] > {<u,v> : u in R, v in D | InnerProduct(u,v) ne 0};
The Hermitian dual D of the linear code C. The Hermitian dual consists of all codewords in the K-space V which are orthogonal to all codewords of C with respect to the Hermitian inner product for quadratic extensions.
The (Euclidean) hull of the linear code C is the intersection of the code with its dual.
The Hermitian hull of the linear code C is the intersection of the code with its Hermitian dual.
For the following operators, C and D are codes defined as a subset (or subspace) of the R-space V.
Return true if and only if the vector u of V belongs to the code C.
Return true if and only if the vector u of V does not belong to the code C.
Return true if and only if the code C is a subcode of the code D.
Return true if and only if the code C is not a subcode of the code D.
Return true if and only if the codes C and D are equal.
Return true if and only if the codes C and D are not equal.