@@ -83,7 +83,35 @@ 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 modulo `l`) to the group algebra of the abelian group `ℤ/lℤ` of order `l`.
89+
90+ # Example
91+
92+ ```jldoctest
93+ julia> import Hecke; import QuantumClifford.ECC
94+
95+ julia> base_matrix = [0 0 0 0; 0 1 2 5; 0 6 3 1]; l = 3;
96+
97+ julia> c = LiftedCode(base_matrix, l);
98+
99+ julia> parity_checks(c)
100+ 9×12 Matrix{Bool}:
101+ 1 0 0 1 0 0 1 0 0 1 0 0
102+ 0 1 0 0 1 0 0 1 0 0 1 0
103+ 0 0 1 0 0 1 0 0 1 0 0 1
104+ 1 0 0 0 0 1 0 1 0 0 1 0
105+ 0 1 0 1 0 0 0 0 1 0 0 1
106+ 0 0 1 0 1 0 1 0 0 1 0 0
107+ 1 0 0 1 0 0 1 0 0 0 0 1
108+ 0 1 0 0 1 0 0 1 0 1 0 0
109+ 0 0 1 0 0 1 0 0 1 0 1 0
110+
111+ julia> code_n(c), code_k(c), code_s(c)
112+ (12, 5, 9)
113+ ```
114+ """
87115function LiftedCode (shift_array:: Matrix{Int} , l:: Int ; GA:: GroupAlgebra = group_algebra (GF (2 ), abelian_group (l)))
88116 A = zeros (GA, size (shift_array)... )
89117 for i in 1 : size (shift_array, 1 )
@@ -103,10 +131,12 @@ function concat_lift_repr(repr, mat)
103131 return z
104132end
105133
106- function parity_checks (c:: LiftedCode )
107- return lift (c. repr, c. A)
134+ function parity_matrix (c:: LiftedCode )
135+ return concat_lift_repr (c. repr, c. A)
108136end
109137
110- code_n (c:: LiftedCode ) = size (c. A, 2 ) * size (zero (c. GA), 2 )
138+ code_n (c:: LiftedCode ) = size (c. A, 2 ) * order (group (c. GA))
139+
140+ code_s (c:: LiftedCode ) = size (c. A, 1 ) * order (group (c. GA))
111141
112- code_s (c:: LiftedCode ) = size (c . A, 1 ) * size ( zero (c . GA ), 1 )
142+ code_k (c:: LiftedCode ) = code_n (c) - rank ( matrix ( GF ( 2 ), parity_checks (c)) )
0 commit comments