References Top Introduction Random generation of linear codes

Random generation of linear codes

In this section we want to demonstrate how the Dixon-Wilf-algorithm can be used in order to generate linear codes distributed over all isometry classes uniformly at random. Actually this algorithm was first developed for the random generation of unlabelled graphs (cf. [3]). Before describing it in all details for an arbitrary group action we need some more notions: The stabilizer of x∈ X under the action of a group G is the subgroup
Gx := {g∈ G | gx=x}
of G, whereas the set of fixed points of g∈ G is the subset
Xg := {x∈ X | gx=x}
of X. The set of all G-orbits in X will be denoted by
G\\X := {G(x) | x∈ X}.
Theorem: The Dixon-Wilf-algorithm. Let G be a finite group acting on a finite set X. Choose a conjugacy class C of G with the probability
p(C) := |C|⋅ |Xg|

|G|⋅ |G\\X|
, for an arbitrary g∈ C.
Pick any g∈ C and determine at random a fixed point x of g. Then the probability that x lies in a given orbit ω∈ G\\X is equal to 1/|G\\X|, i. e. it does not depend on the special choice of ω. So the output of this algorithm is distributed uniformly at random over all G-orbits on X.
Now we are in a position to apply this algorithm to the group action (*) describing the isometry classes of linear codes. The conjugacy classes of the operating group, which is a direct product of two groups, can be described as pairs of the conjugacy classes of the two factors. So each conjugacy class C is a direct product C=CP × CS of a conjugacy class CP in PGLk(q) and a conjugacy class CS in Sn. Furthermore we will use Tnkq as an abbreviation for the cardinality |PGLk(q) × Sn\\(PGk-1(q))n|. In other words Tnkq is the number of all isometry classes of linear (n,l)-codes without 0-columns for l≤ k.
Corollary: Let n and k≤ n be positive integers. The following algorithm computes generator matrices Γ of linear (n,l)-codes over GF(q) for l≤ k uniformly at random:

Choose a conjugacy class C of PGLk(q) × Sn with the probability

p(C) := |C|⋅ |(PGk-1(q))n(A,π)|

|Sn|⋅ |PGLk(q)| ⋅ Tnkq
, for an arbitrary pair (A,π)∈ C,
where (PGk-1(q))n(A,π) is the set of all fixed points of (A,π) in (PGk-1(q))n, i. e. the set of all functions Γ∈ (PGk-1(q))n which fulfill A⋅ Γ=Γ o π. Then pick any (A,π)∈ C and generate a fixed point Γ of (A,π) uniformly at random.
In order to apply this algorithm we want to take a closer look at it. The order of Sn is given by n!, the order of PGLk(q) equals [q]k/(q-1) where [q]k is the order of GLk(q) given by
[q]k=(qk-1)(qk-q)...(qk-qk-1).
For the computation of Tnkq consult one of the articles [8][5][4][6]. So we can compute the denominator in p(C).

For computing the nominator we must know the conjugacy classes of Sn and of PGLk(q). Each conjugacy class of Sn can be described by a cycle type λ of length n. Such a cycle type λ is a sequence of nonnegative integers (λ1,...,λn) such that

ni

i=1
⋅ λi=n.
The conjugacy class of Sn corresponding to λ consists of all permutations of cycle type λ. These are
n!

i iλi⋅ λi!
permutations.

In order to describe the conjugacy classes of PGLk(q) we first investigate the conjugacy classes of GLk(q). Two projectivities in PGLk(q) given in form of matrices A and B are conjugate in PGLk(q) if and only if there is a matrix R∈ GLk(q) and α∈ GF(q)* such that R⋅ B⋅ R-1=α⋅ A. Whereas the two matrices A and B are conjugate in GLk(q) if and only if there is a matrix R∈ GLk(q) such that R⋅ B⋅ R-1=A. As a consequence each conjugacy class in PGLk(q) splits into (at most q-1) conjugacy classes in GLk(q). Let A be a regular k × k-matrix over GF(q). The conjugacy class CP(A) of the projectivity induced by A consists of all the matrices in the union

α∈ GF(q)* CG(α⋅ A)
of conjugacy classes in GLk(q).

In [7] (but also in many text books on Algebra) the conjugacy classes in GLk(q) are described by the Jacobi normal forms, which are block diagonal matrices of blocks strongly related to monic polynomials.

Let f=i=0dκixi, κd=1 be a monic polynomial over GF(q), then the companion matrix C(f) of f is given by

C(f): =







0
0
...
0
0
−κ0
1
0
...
0
0
−κ1
0
1
...
0
0
−κ2
:
:
···
:
:
:
0
0
...
1
0
−κd−2
0
0
...
0
1
−κd−1








.
For an integer r≥ 1 the hypercompanion matrix H(fr) of fr is an rd × rd-matrix given as a block matrix
H(fr): =







C(f)
0
0
...
0
0
E1d
C(f)
0
...
0
0
0
E1d
C(f)
...
0
0
:
:
:
···
:
:
0
0
0
...
C(f)
0
0
0
0
...
E1d
C(f)
















 rtimes,
where
E1d:=(eij)1 ≤ i,j ≤ d is givenby eij=



1
if (i,j)=(1,d)
0
else.
A complete list of all Jacobi normal forms, i. e. a complete set of representatives of the conjugacy classes in GLk(q) can be computed in the following way:
Theorem: Let {f1,...,ftk} be the set of all monic irreducible polynomials over GF(q) of degree deg(fi)≤ k which are different from the polynomial f=x. Compute all solutions γ=(γ1,...,γtk) of
tk

i=1
γi⋅ deg(fi)=k.
For each solution γ determine all possible combinations λ=(λ(1),...,λ(tk)) of cycle types λ(i) of length γi. From each choice of λ we compute a normal form
  Nλ := diag (D(f1(1)),...,D(ftk(tk))),
which is a block diagonal matrix of blocks of the form
D(fi,l(i)): = diag(

C(fi),...,C(fi)
l(i)1-times 
,

H(fi2),...,H(fi2)
l(i)2-times 
,...,

H(figi),...,H(figi)
l(i)gi-times 
).

For computing the size of a conjugacy class we can use the following method by Kung (cf. [12]):

Theorem: Let f be a monic irreducible polynomial of degree d over GF(q), and let λ be a cycle type of length γ. For 1≤ i≤ γ determine numbers mi by
mi := i

j=1
j⋅ λj + γ

j=i+1
i⋅ λj.
Then the size of the centralizer of D(f,λ) in GLd⋅ γ(q) is given by
b(d,λ) := γ

i=1
λi

j=1
(qd⋅ mi-qd⋅ (mi-j)).
This formula proves that the size of the centralizer of D(f,λ) depends only on the degree d and on the cycle type λ, but not on the special choice of the irreducible polynomial.

The number of matrices in the conjugacy class of the normal form in (*) is given by

|CG(Nλ)|= [q]k

i=1tkb(deg(fi),λ(i))
.

In order to write down explicitly the Jacobi normal forms in GLk(q) it is necessary to know all the monic irreducible polynomials over GF(q) of degree d≤ k. For certain parameters there are complete lists of these polynomials available. Moreover it is possible to compute irreducible polynomials from so called Lyndon words which will be described now. Any given total order of the elements in GF(q) can be used for defining a lexicographic order on GF(q)d. The cyclic group Cd of order d generated by π := (1,2,...,d) acts on GF(q)d by a cyclic shift,

v:=(κ1,...,κd) π

 
π(v): = (κd1, ...,κd−1).
A vector v∈ GF(q)d is called acyclic if its orbit Cd(v) consists of d pairwise different vectors. An acyclic vector v is a Lyndon word if and only if it is the smallest vector in the orbit Cd(v).

Let σ:GF(qd)→ GF(qd) be the Frobenius automorphism τ↦ σ(τ) := τq. There exist elements β∈ GF(qd) such that the set

{β,σ(β),..., σd-1(β)}
is a basis of GF(qd) over GF(q), which is called a normal basis of GF(qd). Then each element τ of GF(qd) can uniquely be written as
τ= d

i=1
κi⋅ βi,     βi := σi-1 (β), κi∈ GF(q),
and we can identify τ with its coefficient vector (κ1,...,κd). Applying the Frobenius automorphism to τ is the same as applying the cyclic shift π to its coefficient vector.

A monic irreducible polynomial f of degree d over GF(q) has d different roots in GF(qd). It is the minimal polynomial of each of its roots over GF(q). If τ∈ GF(qd) is a root of f then all the other roots, which are called conjugates of τ, are obtained by applying the Frobenius automorphism to τ, i. e. the set of roots is given by

i(τ) | 0≤ i≤ d-1}.
Then the minimal polynomial f of τ (and of each of its conjugates) over GF(q) is given by
f= d-1

i=0
(x-σi(τ)).
Using a normal basis of GF(qd) the coefficient vector of τ (and so the coefficient vector of each root of f) must be an acyclic vector.

The other way round, if τ∈ GF(qd) has an acyclic coefficient vector with respect to a normal basis over GF(q), then the minimal polynomial over GF(q) of τ is a monic irreducible polynomial of degree d.

Since each monic irreducible polynomial of degree d over GF(q) occurs as a minimal polynomial of certain elements of GF(qd), we only have to find all elements with an acyclic coefficient vector for determining all irreducible polynomials of degree d over GF(q). The Frobenius automorphism collects d conjugate elements, which are the roots of the same irreducible polynomial over GF(q), and which correspond to one Cd-orbit on the set of acyclic coefficient vectors. So we described a one to one correspondence between the set of all Lyndon words of length d over GF(q) and the set of all monic irreducible polynomials of degree d over GF(q).

In order to find the set of all conjugacy classes in PGLk(q) we have to determine which conjugacy classes in GLk(q) must be merged in order to get a conjugacy class in PGLk(q). So for each normal form Nλ (cf. (*)) and each α∈ GF(q)* we must determine the normal-form of α⋅ Nλ. For doing this it is enough to determine the normal forms of α⋅ C(f) and α⋅ H(fr) of monic irreducible polynomials f=i=0d κixi. It is easy to deduce that these normal forms are given by the companion or hypercompanion matrices C(fα) and H(fαr) of the polynomial

fα := d

i=0
αd-iκixi,
which is again a monic and irreducible polynomial of degree d over GF(q). It is irreducible since the roots of fα are of the form α⋅ τ, where τ is a root of f, so the roots of fα form a set of d conjugates in GF(qd).

From each conjugacy class in PGLk(q) we can choose a representative in form of a matrix, since we know the Jacobi normal-forms, from which we can compute a permutation representation on PGk-1(q).

Coming back to the description of the algorithm we finally have to investigate the set of all functions f∈ YX which fulfill ρ o f o π-1=f for given permutations π of X and ρ of Y. This set of fixed points YX(ρ,π) can be described in the following way: Choose from each cycle of length ℓ in the cycle decomposition of π one element x; this element must be mapped by f onto an element y which lies in a cycle of length dividing ℓ in the cycle decomposition of ρ. By f o πi(x)=ρi o f(x) the function f is defined on the whole cycle of x. When λ=λ(π) denotes the cycle type of the permutation π, i. e. there are λi cycles of length i in the cycle decomposition of π, then

|YX(ρ,π)|= |X|

i=1
|Yρi|λi,
where Yρi is the set of all fixed points of ρi in Y.

This finishes the description of the algorithm for the random generation of linear codes. It was implemented in the computer algebra system SYMMETRICA [15] for the generation of linear codes over prime fields, i. e. for q is a prime. In order to minimize the amount of work before the algorithm actually starts to generate codes it is useful to start the generation at once after having computed the information on the first conjugacy class, and evaluate further conjugacy classes and their probabilities only if required. This means we have to compute p(Ci) only if the random number (lying in [0,1[) determining which conjugacy class to choose exceeds j=1i-1p(Cj).

n k S_nk2 d_2 1 2 3 4 5 6 7 8 9
15 5 62812 7 5.5 31.4 29.6 29.3 4.1 0.1 >0
16 5 160106 8 3.9 24.1 26.8 34.7 9.8 0.7 >0 >0
17 5 401824 8 2.8 18.2 22.8 36.6 16.9 2.7 0.01 >0
18 5 992033 8 1.9 13.8 18.7 35.0 23.7 6.8 0.1 >0
19 5 2.406329 8 1.3 10.0 15.0 31.6 27.9 13.1 1.0 0.02
20 5 5.730955 9 1.0 7.4 11.7 27.2 29.4 19.9 3.4 1.1 .
15 6 350097 6 7.0 42.7 33.2 16.7 0.3 >0
16 6 1.413251 6 4.4 32.1 33.4 27.9 2.1 0.01
17 6 5.708158 7 2.7 23.1 29.7 36.7 7.5 0.2 >0
18 6 22.903161 8 1.8 16.1 24.4 40.2 16.5 1.0 >0 .
19 6 90.699398 8 1.0 11.0 18.6 38.7 26.2 4.4 0.02 .
20 6 352.749035 8 0.7 7.4 13.7 33.6 33.2 11.1 0.3 >0
15 7 901491 5 9.6 57.7 28.0 4.67 >0
16 7 5.985278 6 5.9 44.8 36.0 13.2 0.07 .
17 7 41.175203 6 3.4 31.9 36.9 26.7 1.1 >0
18 7 287.813284 7 2.0 21.6 32.2 38.4 5.8 0.02 .
19 7 2009.864185 8 1.1 13.9 25.2 43.6 15.7 0.4 . .
20 7 13848.061942 8 0.7 8.8 18.2 41.6 27.9 2.8 .
15 8 957357 4 14.8 71.3 13.6 0.3
16 8 10.174566 5 8.8 61.2 27.3 2.7 .
17 8 119.235347 6 5.0 46.3 38.1 10.5 >0 .
18 8 1482.297912 6 2.8 31.6 40.1 24.9 0.5 .
19 8 18884.450721 7 1.5 20.3 34.6 39.3 4.2 >0 .
20 8 240477.821389 8 0.8 12.6 26.1 46.5 13.9 0.1 . .
15 9 428260 4 23.9 73.4 2.6 >0
16 9 6.592538 4 14.6 74.5 10.8 0.1
17 9 123.424635 5 8.2 64.1 26.1 1.5 .
18 9 2647.026212 6 4.5 47.8 39.5 8.2 >0 .
19 9 61154.777955 6 2.4 32.1 42.7 22.5 0.2 .
20 9 1.453217.697135 7 0.8 12.6 26.1 46.5 13.9 0.1 >0 .
15 10 94177 4 36.5 63.4 0.1 .
16 10 1.778699 4 24.0 74.5 1.5 >0
17 10 46.354490 4 8.2 64.2 26.1 1.5
18 10 1564.547344 4 8.0 66.8 24.4 0.8
19 10 62319.506255 5 4.3 49.8 40.0 5.9 >0
20 10 2.702716.939976 6 2.3 33.0 45.2 19.4 >0 .
Distribution (in %) of the minimum distance of binary linear (n,k)-codes.

Finally we want to present some results about the distribution of the minimum distance among binary linear codes of given parameters n and k which were generated uniformly at random using the algorithm above. For each pair of parameters (n,k) we were computing the minimum distance of 500000 codes of length n and dimension ≤ k. The results are collected in table 1. Snk2 indicates the number of isometry classes of linear (n,k)-codes over GF(2) without 0-columns. Furthermore d2=d2(n,k) stands for the maximal value that occurs as the minimum distance of linear (n,k)-codes over GF(2). Tables of dq(n,k) can be found in [2]. In the right half of table 1 for each d≤ d2(n,k) the percentage of codes with minimum distance d is indicated. We can deduce that in general the percentage of codes with maximal minimum distance is very small. In some cases indicated with "." in table 1 there was even no code with parameters (n,k,d) produced after having generated 500000 codes.

Acknowledgment: The author wants to thank both Prof. Adalbert Kerber and Prof. Jens Schwaiger for their guidance and support while preparing this article.


harald.fripertinger "at" uni-graz.at, November 17, 2011

References Top Introduction Uni-Graz Mathematik Random generation of linear codes Valid HTML 4.0 Transitional Valid CSS!