THE AUTOMORPHISM GROUPS OF LINEAR CODES AND CANONICAL REPRESENTATIVES OF THEIR SEMILINEAR ISOMETRY CLASSES

. The main aim of the classiﬁcation of linear codes is the evaluation of complete lists of representatives of the isometry classes. These classes are mostly deﬁned with respect to linear isometry, but it is well known that there is also the more general deﬁnition of semilinear isometry taking the ﬁeld automorphisms into account. This notion leads to bigger classes so the data becomes smaller. Hence we describe an algorithm that gives canonical representatives of these bigger classes by calculating a unique generator matrix to a given linear code, in a well deﬁned manner. The algorithm is based on the partitioning and reﬁnement idea which is also used to calculate the canonical labeling of a graph [12] and it similarly returns the automorphism group of the given linear code. The time needed by the implementation of the algorithm is comparable to Leon’s program [10] for the calculation of the linear automorphism group of a linear code, but it additionally provides a unique representative and the automorphism group with respect to the more general notion of semilinear equivalence. The program can be used online under http://www.algorithm.uni-bayreuth.de/en/research/ Coding_Theory/CanonicalForm/index.html .


Introduction
A (linear) [n, k, d] q -code is a k-dimensional subspace of F n q such that any two different codewords of C have Hamming distance d Ham at least d, i.e. they differ in at least d positions, and there is a pair whose distance is equal to d.The parameter d is called the minimum distance of the code C. The Hamming weight wt(c) of a codeword c ∈ C is the number of nonzero entries, i.e. wt(c) := d Ham (c, 0).
A matrix Γ ∈ F k×n q whose rows form a basis of the [n, k, d] q -code C is a generator matrix of the code C. The set of all generator matrices is constructed via left multiplication from an arbitrary generator matrix by all invertible (k × k)-matrices A ∈ GL k (q).A mapping ι : F n q → F n q is called isometry, if it respects the Hamming metric.A mapping σ : F n q → F n q is called semilinear, if there exists an automorphism α of F q such that, for all u, v ∈ F n q , κ ∈ F q we have σ(u + v) = σ(u) + σ(v) and σ(κu) = α(κ)σ(u).
Two codes C, C are equivalent, if there is a semilinear isometry ι : F n q → F n q with ι(C) = C .Such codes have the same error-correcting capability, and so we only need representatives of the equivalence classes.For this purpose we derive canonical generator matrices of these representatives.In Section 2 we formulate the equivalence classes as orbits of a group action from the left on the set of generator matrices.
In Section 4 the group action will be split into two actions.One action is the permutation of coordinates and therefore an action of the symmetric group S n .It acts on the orbits (on the set of all generator matrices) of a second group which consists of triples (A, ϕ; α) ∈ (GL k (q) × F * q n ) Aut(F q )1 , where F * q denotes the set of units and Aut(F q ) the group of field automorphisms of F q .We use this decomposition of the group action since only the permutational part really needs an expensive backtracking procedure for the canonization.We call the second action the inner one, and we will show that the canonization is straightforward.In fact, it is an easy minimization algorithm that amounts to choosing a lexicographically smallest element.
Section 5 describes how to manage the outer group action, i.e. the action of the symmetric group S n .An automorphism of a linear code C is a semilinear isometry which maps C onto itself.These mappings form a subgroup Aut(C) of the group of all semilinear isometries, the stabilizer subgroup of C. The automorphism group is used as a tool for pruning large parts of the search tree.Another very useful tool for pruning is a homomorphism of group actions, introduced in Section 3, which corresponds to the partitioning and refinement idea [11,12].
The algorithm that we describe is also based on a backtrack search through the search tree consisting of all elements of the acting group, but in contrast to Leon's (automorphism group) algorithm for linear codes [10] we are just using permutations instead of monomial mappings, although we apply the more general notion of semilinear instead of linear isometry.Furthermore, and even more important, this algorithm can also be used to calculate a unique representative within the semilinear isometry class of a given linear code.
There are some other approaches to solve the code equivalence problem.We mention Sendrier [13] and Bouyukliev [3].They also do not obtain canonical representatives, but this is urgently needed if we want to built up databases of representatives 2for each isometry class of [n, k, d] q -codes.Storing canonical representatives in these databases reduces the problem of isometry test to the comparison of two generator matrices instead of testing semilinear isometry for each pair of elements.Using the more general notion of semilinear isometry reduces the size of these databases approximately 3 by the factor r := |Aut(F q )|.

Code Equivalence
Two linear codes C 1 , C 2 ≤ F n q are linearly isometric if there is a linear isometry ι : F n q → F n q mapping C 1 onto C 2 .This isometry ι can also be expressed as an element (ϕ; π) ∈ F * q n S n of the group of monomial permutations.The semidirect product F * q n S n acts on and the multiplication within this group is defined by (ϕ; π)(ψ; σ) := (ϕψ π , πσ) where (ϕψ π ) i := ϕ i ψ π −1 (i) , i = 0, . . ., n − 1.
If q = p r is not a prime, then the Frobenius automorphism τ : F q → F q , x → x p applied on each coordinate of F n q preserves the Hamming distance, too.Furthermore, linear subspaces are mapped to linear subspaces.Therefore, we include the group of field automorphisms to a more general notion of equivalence of linear codes.We call two codes C 1 , C 2 equivalent or semilinearly isometric if and only if there is a field automorphism α ∈ Aut(F q ) and a linear isometry ι : F n q → F n q such that ι(α(C 1 )) = C 2 .All these mappings again form a group which is isomorphic to , where the multiplication of elements is defined by It acts in a natural way on F n q and on the set L(F n q ) := {C | C ≤ F n q } of linear subspaces as well.
It is well-known that for n ≥ 3 the set of all isometries of F n q mapping subspaces to subspaces is the group of semilinear isometries, see [1].Therefore, the notion of semilinear isometry of linear codes is the most general which can be expressed as a group action on the set of linear subspaces (with respect to the natural action). 4inally, we want to represent the codes by their generator matrices.Let F k×n,k q denote the set of all (k × n)-matrices of rank k, i.e. the set of generator matrices of (linear) [n, k] q -codes.Since all generator matrices of a given code can be reached by the left multiplication of an arbitrary generator matrix of the code by all invertible matrices A ∈ GL k (q), we add this group in an appropriate way to the one previously constructed.We end up in the group action of (GL k (q) × F * q n ) (Aut(F q ) × S n ) on the set of all (k × n)-matrices Γ ∈ F k×n,k q of rank k.The group action is defined by where α is applied to each entry and (ϕ; π) is a linear isometry mapping the rows to a basis of another linear subspace.The multiplication of two group elements is defined by ((A, ϕ); (α, π)) • ((B, ψ); (β, σ)) := ((Aα(B), ϕ • α(ψ π )); (αβ, πσ)).

Groups and Group Actions
Let G be a group acting on some non-empty set X.The orbit of an element x ∈ X will be denoted by Gx and the set of all orbits by G\ \X := {Gx | x ∈ X}.Fact 3.1 (Homomorphism Principle, Laue [9]).Let G be a group acting on a set X and H another group acting on Y with surjective mappings θ : X → Y and ϕ : G → H. Furthermore let the pair (θ, ϕ) be a homomorphism of group actions, i.e. θ(gx if T H\ \Y is a transversal of H\ \Y , i.e. a minimal, but complete set of orbit representatives, then is a transversal of G\ \X. We shall mostly apply this theorem with one group G acting on two different sets, where the second set is smaller or easier to handle.A mapping f : X → Y where (f, id) is a homomorphism of group actions, is called G-homomorphism.
The most common way of getting transversal elements of a group action of G on X, is to calculate the smallest elements of the orbits according to some total order on the set X.This would also be possible in our case of a group acting on the set of (k × n)-matrices over F q .But a naive approach would have to calculate all the matrices within the same orbit in order to decide which one is the minimum.
The Homomorphism Principle provides another transversal T G\ \X of the action of G on X.This choice of representatives might be not so intuitive, but the calculation of the unique orbit representative t ∈ T G\ \X in the orbit Gx of an element x ∈ X becomes much more easier.This choice of representatives corresponds to another total order on the set X where we supposed the transversals of minimal elements to be used in both steps of the theorem.The canonization algorithm is as follows: 1. calculate an element g 0 ∈ G whose image ϕ(g 0 ) maps θ(x) to the smallest element y ∈ T H\ \Y in the same orbit, 2. calculate an element g 1 ∈ ϕ −1 (H y ) mapping g 0 x to its minimal representative g 1 g 0 x in the orbit ϕ −1 (H y ) g 0 x.Using homomorphisms of group actions reduces the overall complexity about logarithmically.Considering this, we will use the Homomorphism Principle, although it forces us to return transversal elements which are depending on the choice of (θ, ϕ).
Of course, the calculation of orbit representatives in H\ \Y and ϕ −1 (H y )\ \θ −1 (y) can be further improved by using this idea iteratively.Fact 3.2.Let N be a normal subgroup of a group G, which acts on a set X. Then the factor group G/N := {gN | g ∈ G} naturally acts on the set of orbits N \ \X and there is a bijection Φ(Gx) := (G/N )(N x) between the orbits of G on X and the orbit set (G/N )\ \(N \ \X).
The following lemma provides the basis to split the group action of semilinear isometries on generator matrices.Lemma 3.3.Let N (G × H) be a semidirect product of groups, where the right factor is a direct product of two groups G, H.We assume that the group N (G×H) is acting on a set X. Then there is a natural bijection between the orbit sets We can calculate a transversal element t ∈ (N (G × H)) x in two steps: 1. Calculate the transversal element ω ∈ H((N G) x) of the outer group action.
2. Take the representative t ∈ ω ∩ T (N G)\ \X of the inner group action, i.e.
(N G) acting on X.
Proof.The group can be expressed equivalently by (N G) H and the group (N G) (N G) {1 H } on the left is a normal subgroup of the outer semidirect product.Furthermore, the factor group ((N G) H) /(N G) is isomorphic to H.So Lemma 3.2 provides the bijection.
We use the Homomorphism Principle 3.1 with the projection on H, i.e. ϕ : N (G × H) → H and the orbit map: θ : X → (N G)\ \X, x → (N G) x to show the second part.These maps are surjective and they respect the group actions.For the transversal element ω we conclude that ϕ −1 (H ω ) ⊇ ϕ −1 ({id H }) = (N G) {id H } and θ −1 (ω) = ω.Therefore the action of ϕ −1 (H ω ) is transitive on θ −1 (ω) and we just have to pick the orbit representative t ∈ ω of the inner group action.

Splitting the group action
Applying Lemma 3.3 to the action of (GL k (q) × F * q n ) (Aut(F q ) × S n ) on F k×n,k q splits the group action into two parts and gives a first algorithmic instruction for the calculation of a canonical element.This will be used in Section 4.2.1 after showing that -in our case -the calculation of transversal elements of the inner group action is easily achieved.
Corollary 1.There is a bijection between the orbit sets of the group (GL k (q) × F * q n ) (Aut(F q ) × S n ) acting on the set F k×n,k q and the group S n acting on Since the parameters n, k, q are fixed within the whole article, we suppress them for the sake of clarity in the notion of the inner group according to this break-up and define The multiplication of two elements ((A, ϕ); α), ((B, ψ); β) is defined by ((A, ϕ); α)((B, ψ); β) := ((Aα(B), ϕα(ψ)); αβ).
Of course, we can decompose the group of linear isometries analogously using the notation G (l) := GL k (q) × F * q n for the normal subgroup.

4.1.
The inner group action.The canonization algorithm for this group action is a generalization of the calculation of the reduced row echelon form of an arbitrary (k × n)-matrix from the left to the right, where we additionally have to take the multiplication of the columns with nonzero field elements and the field automorphisms into account.In fact, we use the Gaussian elemination as a subprocedure.The only difference is that the columns which cannot be mapped to unit vectors will be further minimized.
The group action of G (sl) also induces an action on the matrices with i ≤ n columns by taking the first i entries of the vector ϕ ∈ F * q n to define the multiplication on the columns.The projection . is compatible with these group actions and therefore a G (sl) -homomorphism.
We assume that the field F q is totally ordered in a canonical way (see Section 6) by some fixed order ≤ with 0 < 1 ≤ ξ, ∀ ξ ∈ F * q .The lexicographical order induces a total order on F n q .Matrices are interpreted as vectors of columns of length k.The order of these k-dimensional column vectors is the colexicographical order, while the order of these n-dimensional vectors of columns is the lexicographic one: The reason for the choice of the colexicographical order is that in this case the unit vectors appear in their natural order.We introduce some notion for those matrices whose projections are minimal in their orbits: Of course, an i-semicanonical matrix is also i -semicanonical for 1 ≤ i ≤ i.The matrix Γ min is the unique n-semicanonical element in the orbit G (sl) Γ, but for an arbitrary i there might be other i-semicanonical elements.
We proceed to calculate an (i+1)-semicanonical element inductively starting from an i-semicanonical Γ (i) .The column with index i is minimized under the stabilizer subgroup G (sl) Πi(Γ (i) ) of the preceding columns.This is once again an application of the Homomorphism Principle 3.1.
The first column of a 1-semicanonical representative Γ (1) in the orbit G (sl) Γ must be either the zero column or the first unit vector e T 0 since we are allowed to multiply Γ by any invertible matrix.In our notion of the group elements ((A, ϕ); α) ∈ G (sl) we will often suppress components which are the identity elements of their groups.

Advances in Mathematics of Communications
Volume X, No. X (200X), X-XX By this recursion starting with Semicanonical(n, Γ), we calculate the lexicographically smallest representative Γ (n) in the orbit G (sl) Γ for a given Γ ∈ F k×n q .
Proof of Algorithm 1.We show by induction that the algorithm is correct.For i = 0 the algorithm of course returns the right answer.The induction further shows that the matrix Γ (i) returned by Semicanonical(i − 1, Γ) contains the unit vectors e T 0 , . . ., e T s−1 , s := rk(Π i−1 (Γ (i) )) and these columns of course remain unchanged by the stabilizer.
We have to distinguish two different cases.In the first case, the vector γ Πi−1(Γ (i) ) containing the invertible matrices Is A1 0 A2 .Therefore, we can obtain the vector e T s by the left multiplication with an appropriate matrix B ∈ G (sl) Πi−1(Γ (i) ) and Π i (BΓ (i) ) must be minimal in its orbit.Of course, s must be increased by one and we have to append the subset {s} to the partition p.In the second case, the column with index i−1 is linearly dependent on the preceding ones.This implies that its entries with index ≥ s must be equal to zero.We search for the last nonzero entry.If it is found, the column is treated by the block starting at line 17 which transform this entry to 1 by the multiplication of the column by the inverse field element.Now, each set p l of the partiton p which is not equal to p union index and has a nontrivial intersection with the support supp(γ gives us the opportunity to transform the entry Γ (i) j,i−1 with j = max(p l ∩ supp(γ (i) i−1 )) to 1.This is implemented by the crossed row-column-multiplication in line 21.Finally, the remaining subgroup of the field automorphisms allows us to minimize all the remaining entries in supp(γ ).This step is described in line 25.It is easy to see that the operations on the parameters (s, p, t) ensures the conditions of Definition 4.2.
With some minor modifications Algorithm 1 can be used to minimize the columns in an arbitrary fixed order and to return the applied group element.If we are interested in a minimal orbit representative of the group G (l) , we just have to remove the lines 24-28.The parameter t of the stabilizer subgroup becomes redundant in this case.
We want to calculate Semicanonical(n, Γ (0) ) with Γ (0) := . We call Algorithm 1 recursively until reaching level i = 1.See also Table 1 for the output in each step.
For i = 1, 2 we have to follow the instructions given by the block starting at line 7, mapping the first two columns of Γ to the unit vectors e T 0 and e T 1 .The next recursive call of the algorithm for i = 3 has to use the line 10 and the following.Starting with j = 1, the if-condition in line 17 is satisfied.We multiply the column with Γ x and set union index = 1.For j = 0 we have to perform a crossed row-column-multiplication RC p 0 , (x 2 ) −1 , Γ (3) following the lines starting at 21. Since both nonzero entries of the column (γ 2 ) T are now equal to 1 they will not be changed by the Frobenius automorphism τ .

Advances in Mathematics of Communications
Volume X, No. X (200X), X-XX i performed operation in step i Table 1.Output in Example 1 In step i = 4 we perform a Gaussian elimination.On level i = 5 we first multiply the column (γ (5) 4 ) T by x 2 resulting in (x, x 2 , 1) T .The entry x 2 is mapped to 1 by the crossed row-column-multiplication RC p 0 , (x 2 ) −1 , Γ (5) .Now the last two columns are and the entry x 2 can be mapped by the Frobenius automorphism τ to x.For i = 6, we just multiply the last column by x.

4.2.
The outer group action.For the outer group action -the action of the symmetric group S n on a set X -there is a well-known approach for canonization applying partitions and refinements (Leon [11] , McKay [12]).We will follow this idea.
At first glance, the complexity of the set X in our case might lead to more difficulties.But as we have seen above, we are able to manage this set of orbits by n-semicanonical representatives efficiently.Thereby we avoid to take the bigger group of monomial permutations interpreted as a subgroup of S n(q−1) to formulate the backtrack search algorithm [10].This reduces the size of the search tree and allows us to use the more appropriate concept of semilinear isometry for the notion of equivalence of linear codes.

4.2.1.
A first naive Algorithm.With the help of Algorithm 1 we are already able to calculate the automorphism group of a linear code C given by a generator matrix Γ and a uniquely determined generator matrix Γ can of all semilinearly isometric codes to C. We just have to apply all permutations π ∈ S n on the generator matrix Γ and have to call Semicanonical(n, πΓ) returning a uniquely determined matrix Γ (n,π) .We define the canonical element according to Lemma 3.3 Two different permutations π, σ ∈ S n with minimal n-semicanonical representatives Γ can = Γ (n,π) = ((A, ϕ); (α, π))Γ and Γ can = Γ (n,σ) = ((B, ψ); (β, σ))Γ give rise to an automorphism of Γ.The automorphism group Aut(Γ) is generated by all those products together with the stabilizer of the inner group action which is also returned by Algorithm 1. 4.2.2.Backtrack Search.Of course, the naive approach described above is only applicable for very small parameters n, because the cardinality of the symmetric group S n grows exponentially.The next step is to merge permutations which imply similar i-semicanonical representatives.
Let G be a subgroup of S n .We define the pointwise stabilizer of the first i points by We use the following example to motivate an improved approach, which will allow us to handle codes with higher length efficiently.For any permutation π ∈ S n which permutes those four columns and maps the last column (0, 0, 1) T to a position further left the matrix πΓ will contain three linearly independent columns on its first positions.For this reason the n-semicanonical representative Γ (n,π) will contain the 3×3 identity matrix on its first three columns.Due to the lexicographic order on the columns and   we conclude that the n-semicanonical representatives Γ (n,π) cannot be equal to Γ can and we are able to detect this difference by comparing the projections on the first three columns of any of the 3-semicanonical matrices Γ (3,π) ∈ G (sl) (πΓ): Let σ ∈ S (3) n be another permutation.We have Π 3 (σΓ ) = Π 3 (Γ ) for any Γ ∈ F k×n q which implies σΓ (3,π) to be a 3-semicanonical representative in G (sl) (σπΓ).This information can be used to conclude that σπ does not lead to the canonical representative, since Π 3 (Γ (3,σπ) As soon as we have found a permutation π ∈ S n which leads to an i-semicanonical representative Γ (i,π) whose projection Π i (Γ (i,π) ) is greater than the projection of our candidate for the canonical representative Γ can we can eliminate the whole right coset S (i) n π from our search.In the case Π i (Γ (i,π) ) < Π i (Γ can ) the candidate Γ can cannot be the canonical representative and we replace Γ can by Γ (n,π) .

Advances in Mathematics of Communications
Volume X, No. X (200X), X-XX We substitute the naive brute force approach by a systematical enumeration of all permutations.The coset S (i) n π consists of all permutations whose preimages of the first i positions are given by the preimages of π: Prescribing additionally the preimage of the point i gives us n − i possibilities to extend the vector (π −1 (0), . . ., π −1 (i − 1)) by a further preimage.This corresponds to the disjoint decomposition of the coset where n .We interprete the cosets n π as nodes of a rooted tree structure with root node S (0) n π is parent of the nodes S (i+1) n σπ, σ ∈ T (i) .We label the arc (S Using a depth-first-search procedure to visit all leafs of this search tree corresponds to the enumeration of all permutations, such that the elements of an arbitrary coset S (i) n π are consecutive.As we have seen in the example above, we can skip the permutations S (i) n π in certain situations, i.e. we can prune the subtree rooted in Algorithm 2 describes the backtrack search algorithm to calculate the canonical generator matrix of an equivalence class of a linear code C given by its generator matrix Γ.We replace the nodes S (i) n π by i-semicanonical representatives of the orbits G (sl) (πΓ), remembering that the first i columns stay fixed and the remaining columns may be further permuted.The root node of this search tree is therefore equal to Γ.The sons of this node -calculated in Algorithm 3 -represent all possibilities to move an arbitrary column of the matrix Γ to the first position.Increasing i by 1 in the next step, see line 13 of Algorithm 3, tells us to fix this column in the whole subtree rooted in this node.
By calling Algorithm 1, see line 5, we receive i-semicanonical representatives in each step.We always keep a candidate Γ can for the canonical representative, which is n-semicanonical and therefore also i-semicanonical for all i ≤ n.If the projections Π i (Γ can ) and Π i (Γ (i,π) ) do not coincide, then all orbits G (sl) (σπΓ), σ ∈ S CodeCanStep(1, id, Γ);// construct the sons of the root node for j ← i − 1 to n − 1 do

3:
Γ ← (i − 1, j)Γ; // swap columns i − 1 and j 4: σ ← (i − 1, j); 5: (Γ , ) ← Semicanonical(i, Γ ); // take an i-semicanonical representative of the orbit continue;// prune this subtree, it has no canonical elements 8: end for 23: end procedure different cases.The first is that the projection of this node is smaller than the projection of Γ can -see line 9.In this case, we replace the candidate Γ can by Γ (i,π) (more precisely: by the n-semicanonical orbit representative which is calculated in the next leaf).If the projection of this node is greater than the projection of the candidate, we can skip this subtree, since no representative would be found there, see line 6.
The calculation of unique representatives of the linear isometry classes and the linear automorphism group can be done with the same backtracking, where we just have to replace the calculation of the i-semicanonical representatives, see line 5 of Algorithm 3, by the linear version of Algorithm 1.
It is not necessary to store the elements of G (sl) applied to Γ during the backtracking.The calculation is done after finishing Algorithm 2 for the generators of A and the element π can using an adapted version of Algorithm 1.

Pruning the Search Tree
In this section we describe the possibilities to further reduce the size of the search tree and we introduce the two most important functions in the final implementation of Algorithm 3.

5.1.
Pruning subtrees by the Homomorphism Principle.In order to use the Homomorphism Principle, we define suitable G-homomorphisms f : G (sl) \ \F k×n q → X for appropriate subgroups G ≤ S n and codomains X which will be used in Algorithm 3.All homomorphisms which will be used are of some special type: G-signature if it assigns to each column index j ∈ {0, . . ., n − 1} a value y j ∈ Y and the operation of G on the codomain is just the natural action on n-vectors (y 0 , . . ., y n−1 ) ∈ Y n .
The next definition introduces a generalization of the pointwise stabilizer.Afterwards we will show that only these special subgroups of S n will occur as stabilizers.The intersection of two canonical Young subgroups of S n is again a canonical Young subgroup.The same holds for the stabilizer S (i) n = S [0,1,...,i−1,i,n] of the first i points.Suppose we reached some node on level i in our backtracking procedure and the stabilizer of the predecessor node on level i − 1 is some canonical Young subgroup.On level i the column i − 1 is additionally fixed and we have to build the intersection of this group with S Next, we use the homomorphism principle by applying an S [α0,...,αm] -signature with codomain Y n , which is ordered lexicographically or colexicographically according to some total order on the set Y .The canonical elements should be the smallest elements in the orbits.Calculating the orbit representatives y can ∈ S [α0,...,αm] f (G (sl) Γ) of the image f (G (sl) Γ) is easily achieved by sorting the entries of the vector f (G (sl) Γ) within the blocks {α i−1 . . ., α i − 1}, i = 1, . . ., m given by [α 0 , . . ., α m ].Now we are only allowed to permute equal entries of the vector y can within the same blocks.But these entries are consecutive and therefore the stabilizer S [α0,...,αm] y can is a canonical Young subgroup as well.
Induction shows that the occurring subgroups of S n are always canonical Young subgroups.This is just the group theoretic validity of McKay's algorithm [12].
Algorithm 4 describes some additional code lines which can be placed after line 11 of Algorithm 3 to apply the Homomorphism Principle.The sequence (f of homomorphisms has to be chosen in some unique way.The signatures which are explicitly used are stated next.
Proof.The map is well defined since any other i-semicanonical representative is reached by the multiplication of an element in G Πi(Γ) .These elements respect the support of a column γ j ∈ span(γ 0 , . . ., γ i−1 ).Of course, f Taking this matrix as input to f (3) 0 we get: Canonizing the image tells us to apply the permutation (3,4,5) in order to sort the columns 3, 4 and 5 of the image.This gives us a discrete partition of the column indices, i.e. a trivial stabilizer subgroup S [0,1,2,3,4,5,6] = {id}.We conclude that there is only one leaf G (sl) ((3, 4, 5)Γ) in the pruned subtree below the original node instead of 6 = |S Πi(Γ) cannot be arbitrary.Let (s, p, t) be the parameter set of Definition 4.2 defined by Π i (Γ).Now, take a column γ T l of Γ which lies in the span of the first i columns.Suppose Γ κ,l = 0 for some κ < s and κ * is defined by κ ∈ p κ * ∈ p. Applying (A, ϕ) to α(Γ) multiplies all rows m ∈ p κ * by the same nonzero field element 7 and therefore the quotients satisfy , where α is an element of τ t ≤ Aut(F q ).Lemma 5.4.Let 0 ≤ κ ≤ k − 1 be arbitrary and ∞ ∈ F q one more symbol.The mapping defined on i-semicanonical representatives Γ := (γ T 0 , . . ., γ T n−1 ) is well-defined and an S (i) n -signature.
For the column j = 4 we have to take the minimization by the field automorphism into account since the quotient vector originally is equal to (1, x 2 ) T .
A wide range of S (i) n -and S [α0,...,α m ] -homomorphisms can be constructed by taking code invariants V : L(F n q ) → X, i.e. mappings which return the same result for semilinearly isometric codes.
The most important example in our case might be the weight enumerator W C (x) := c∈C x wt(c) of the code C. By puncturing and shortening the code -which are defined below -in selected subsets of the column indices, we are able to construct a lot of different homomorphisms.Definition 5.5.Let Γ be a generator matrix of a linear code C of length n.For a subset J ⊂ {0, . . ., n − 1} • the punctured code C J is constructed by replacing the entries at positions j ∈ J of all codewords by zero, and • the shortened code C \J of the code C is the subset of all codewords (c 0 , . . ., c n−1 ) ∈ C with c j = 0 ∀ j ∈ J.
In contrast to the standard definition of shortening and puncturing a code, we do not remove the positions indexed by J and therefore C J as well as C \J are linear codes of length n.This avoids problems in defining the signatures in the next lemma: Lemma 5.6.Let J 1 , J 2 be disjoint subsets of {0, . . ., i−1}, C(Γ) the code generated by Γ and V : L(F n q ) → X a code invariant, then the mapping n -signature.The same is true for f 3,J1,\J2 defined analogously by shortening at the coordinates j ∈ {0, . . ., n − 1}.
words of the shortened code C \{0,1} j f In order to reduce the computational complexity of the signature using the weight enumerator as invariant, we modify it to only count the number of codewords equal to the minimum distance of the code.This set of words can be calculated once for the root node and adapted to the actually considered permutation to get an S (i) n -signature on any level i.
Since our acting group is already reduced to a subgroup S [α0,...,αm] ≤ S (i) n , we are not restricted to code invariants at all.We can also construct S [α0,...,αm] -signatures using S [α0,...,αm] -invariants of the code.The most important example of such an invariant is the block weight enumerator of the partition [α 0 , . . ., α m ]: Definition 5.7.Let [α 0 , . . ., α m ] be a partition of n.We define the block weight enumerator of this partition to be the polynomial n -signature may be formulated by Leon's idea [10] of taking invariant subsets of the code C. The adaption of this idea is possible, but not applied.We also did not investigate invariants using the hull of a linear code, see [13].
5.2.Pruning subtrees by automorphisms.We introduce complete labeled branchings due to Jerrum [8] to manage the group of known automorphisms within our backtrack search algorithm.This gives us a test for pruning isomorphic subtrees.The type of a permutation g ∈ G ≤ S n , g = id is defined as the pair type(g) := (i, j) where j := g(i) is the image of the first nonfixed position i ∈ {0, . . ., n − 1}.
A tuple (B, γ) is called labeled branching of G, if 1. B is a branching on the set of nodes {0, . . ., n − 1}, i.e. an acyclic, directed graph with at most one arc ending at each node.Each arc (i, j) fulfills the condition i < j. 2. γ = (γ 0 , . . ., γ n−1 ) ∈ (S n ) n is a vector of permutations with • if (i, j) is an arc in B, then σ ij := γ −1 j γ i is of type(σ ij ) = (i, j) and • the set {σ ij | (i, j) is an arc in B} generates G.A branching B defines a partial order on the set {0, . . ., n − 1} via: i j :⇐⇒ there is a directed path from i to j in B.

If each set T
, we say the labeled branching is complete.Fact 5.8 (Jerrum [8]).Let A be a subgroup of S n and (B, γ) a complete labeled branching of A. A permutation π ∈ S n is lexicographically minimal in πA, if and only if π is a topological sorting of B, i.e. i j =⇒ π(i) ≤ π(j).
We will store the group A ≤ S n of known automorphisms of G (sl) Γ using a complete labeled branching.During our backtrack search algorithm we are only interested in visiting the transversal of lexicographically minimal elements t of each coset of A, since all other elements in tA lead to isomorphic copies of G (sl) (tΓ).
Suppose we have reached level i in our backtrack search algorithm.Let π be the permutation which we have already applied to the root node and S [α0,...,αm] ≤ S (i) n the remaining permutations.Lemma 5.9 gives us a test, if there are topological sortings in the subtree S [α0,...,αm] π.The lemma tightens a test of Gugisch [7] formulated for S (i) n π.

Advances in Mathematics of Communications
Volume X, No. X (200X), X-XX Lemma 5.9.Let (B, γ) be a complete labeled branching of a subgroup A of S n , [α 0 , . . ., α m ] a partition of n and π ∈ S n arbitrary.There are topological sortings of B in the coset S [α0,...,αm] π if and only if for any arc (i, j) in B the image π(i) is not allowed to lie in a cell further right than the cell containing π(j), i.e.
Once we found a new automorphism in our search, we add it to the group A and update the complete labeled branching to this bigger group.This reduces the set of transversal elements of S n /A and thereby makes the test more restrictive.In fact, the effort is always reduced by the order |A| of the group of known automorphisms.The test is applied in each iteration of Algorithm 4 just before calling the homomorphism and once again, when returning to Algorithm 3.

Numbering the Field Elements
Within the article the field was just specified to be totally ordered in some way with the zero element to be smallest and 1 ≤ µ, ∀ µ ∈ F * q .Of course, different ways of numbering the field elements lead to different lexicographical orders on the generator matrices and therefore they result in different i-semicanonical orbit representatives calculated by the algorithm.To realize and utilize databases of canonical forms traceable and independent from the different isomorphic field representations, we need a canonical order of the field, too.
Of course, prime fields F p , can be ordered by identifying the residue classes x+(p) by their representatives x ∈ {0, . . ., p−1} and the natural order 0 < 1 < . . .< p−1.If q = p r with r > 1, we choose the Conway polynomial [14] f of degree r over F p to define the field extension, since these polynomials are used in most computer algebra systems by default.Let α be a root of this polynomial.Then any element µ ∈ F q can be uniquely expressed by µ = r−1 i=0 a i α i with a i ∈ F p , i = 0, . . ., r − 1.
For n = 12 the number of words of minimal weight is 1397760 and 350MB of memory are sufficient during the calculation process 8 .For n = 14 there are even 22368256 words with Hamming weight 8064 and the program uses less than 4GB of memory.We are still looking for some appropriate signatures for a better performance in the odd case.
Moreover, we applied the algorithm to the database provided by Kohnert [5] and compared runtimes for the calculation with Leon's algorithm.In most cases time spent in the two different algorithms only differed by a factor less than 2 independent from the parameter set [n, k, d] q , but there are counter examples in both directions.Moreover, this comparison discounts the fact that our algorithm solves a more general problem.
The adaption of the algorithm to linear codes over finite chain rings R is possible, but the performance will mainly depend on the minimization algorithm of the inner group action.In the special case of R = Z 4 we are already able to give such an algorithm, which is hardly more difficult than the procedure for finite fields.

Example 2 . 4 (
Let Γ ∈ F 3×n q with n ≥ 4, where the first four columns are given by Π the transversal element σ.The leafs of this tree are the cosets S (n) n π = {π}.

Γ
orbit G (sl) Γ can -see Example 2. We have to distinguish two Algorithm 2 CodeCan -Linear code canonization algorithm Input: Γ ∈ F k×n q Output: π can ∈ S n Transporter Element Output: Γ can ∈ F k×n q canonical representative of the semilinear isometry class Output: A = Aut(C) the automorphism group of C 1: procedure CodeCan(Γ) can ← NIL; 4: