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:
- An element of C;
- A set or sequence of elements of C;
- A sequence of n elements of R, defining an element of C;
- A set or sequence of sequences of type (c);
- A subcode of C;
- A set or sequence of subcodes of C.
Given an [n, k] linear code C and an integer t, 1 <= t < n, return a subcode of C of pseudo-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.
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 R-space V.
The intersection of the linear codes C and D, where C and D are contained in the same R-space V.
The dual D of the linear code C. The dual consists of all codewords in the R-space V which are orthogonal to all codewords of C.
> Z4 := IntegerRing(4);
> C := LinearCode<Z4, 8 |
> [1,0,0,0,3,1,2,1],
> [0,1,0,0,1,2,3,1],
> [0,0,1,0,3,3,3,2],
> [0,0,0,1,2,3,1,1]>;
> C;
[8, 4, 4] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
[0 1 0 0 1 2 3 1]
[0 0 1 0 3 3 3 2]
[0 0 0 1 2 3 1 1]
> C1 := sub< C | C.1 >;
> C1;
[8, 1, 4] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
> C2 := sub< C | C.4 >;
> C2;
[8, 1, 4] Linear Code over IntegerRing(4)
Generator matrix:
[0 0 0 1 2 3 1 1]
> C3 := sub< C | { C.1 , C.4} >;
> C3;
[8, 2, 4] Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
[0 0 0 1 2 3 1 1]
> (C1 + C2) eq C3;
true
> (C1 meet C3) eq C1;
true
> Dual(C) eq C;
true