@@ -83,7 +83,37 @@ function LiftedCode(group_elem_array::Matrix{<: GroupOrAdditiveGroupElem}; GA::G
8383 end
8484end
8585
86- # TODO document and doctest example
86+ """
87+ Constructs a group algebra code over GF(2) by lifting a matrix of cyclic shifts
88+ (entries mod l) to the group algebra of the abelian group ℤ/lℤ, with 0 mapped
89+ to the identity.
90+
91+ # Example
92+
93+ ```jldoctest
94+ julia> base_matrix = [0 0 0 0; 0 1 2 5; 0 6 3 1]; l = 4;
95+
96+ julia> c = LiftedCode(base_matrix, l);
97+
98+ julia> parity_checks(c)
99+ 12×16 Matrix{Bool}:
100+ 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
101+ 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0
102+ 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0
103+ 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
104+ 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1
105+ 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0
106+ 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0
107+ 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0
108+ 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1
109+ 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0
110+ 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0
111+ 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0
112+
113+ julia> code_n(c), code_k(c)
114+ (16, 12)
115+ ```
116+ """
87117function LiftedCode (shift_array:: Matrix{Int} , l:: Int ; GA:: GroupAlgebra = group_algebra (GF (2 ), abelian_group (l)))
88118 A = zeros (GA, size (shift_array)... )
89119 for i in 1 : size (shift_array, 1 )
@@ -104,9 +134,9 @@ function concat_lift_repr(repr, mat)
104134end
105135
106136function parity_checks (c:: LiftedCode )
107- return lift (c. repr, c. A)
137+ return concat_lift_repr (c. repr, c. A)
108138end
109139
110- code_n (c:: LiftedCode ) = size (c. A, 2 ) * size ( zero (c. GA), 2 )
140+ code_n (c:: LiftedCode ) = size (c. A, 2 ) * order ( group (c. GA))
111141
112- code_s (c:: LiftedCode ) = size (c. A, 1 ) * size ( zero (c. GA), 1 )
142+ code_s (c:: LiftedCode ) = size (c. A, 1 ) * order ( group (c. GA))
0 commit comments