0% found this document useful (0 votes)
19 views26 pages

Rank-Metric Codes: Definitions, Isometries, and Equivalence of Codes

This document discusses the mathematical foundations of rank-metric codes, focusing on definitions, isometries, and equivalence of codes over finite fields. It introduces concepts such as rank distance, vector rank-metric codes, and their supports, providing various definitions and examples. The document also addresses the characterization of linear isometries and the MacWilliams Extension Theorem in the context of rank-metric codes.

Uploaded by

tchatchiemh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views26 pages

Rank-Metric Codes: Definitions, Isometries, and Equivalence of Codes

This document discusses the mathematical foundations of rank-metric codes, focusing on definitions, isometries, and equivalence of codes over finite fields. It introduces concepts such as rank distance, vector rank-metric codes, and their supports, providing various definitions and examples. The document also addresses the characterization of linear isometries and the MacWilliams Extension Theorem in the context of rank-metric codes.

Uploaded by

tchatchiemh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

RANK-METRIC CODES

E. GORLA

1. Definitions, isometries, and equivalence of codes


arXiv:1902.02650v1 [cs.IT] 7 Feb 2019

Let q be a prime power and let Fq denote the finite field with q elements. Let m, n
be positive integers and denote by Matn×m (Fq ) the Fq -vector space of matrices of size
n × m with entries in Fq .
In this chapter, we discuss the mathematical foundations of rank-metric codes. We
restrict our attention to linear codes. All dimensions are over Fq , unless otherwise stated.
Definition 1.1. For a matrix A ∈ Matn×m (Fq ), we let rk(A) denote the rank of A. The
function
d : Matn×m (Fq ) × Matn×m (Fq ) −→ Matn×m (Fq )
(A, B) 7−→ rk(A − B)
is a distance on Matn×m (Fq ), which we call rank distance or simply distance. The rank
is the corresponding weight function.
A (matrix) rank-metric code is an Fq -linear subspace C ⊆ Matn×m (Fq ).

A class of rank-metric codes that has received a lot of attention is that of vector
rank-metric codes, introduced independently by Gabidulin and Roth in [8] and [25].
Definition 1.2. The rank weight rk(v) of a vector v ∈ Fnqm is the dimension of the
Fq -linear space generated by its entries. The function
d : Fnqm × Fnqm −→ Fnqm
(u, v) 7−→ rk(u − v)
is a distance on Fnqm , which we call rank distance or simply distance.
A vector rank-metric code is an Fqm -linear subspace C ⊆ Fnqm .

Every vector rank-metric code can be regarded as a rank-metric code, up to the


choice of a basis of Fqm over Fq .
Definition 1.3. Let Γ = {γ1 , ..., γm } be a basis of Fqm over Fq and let v ∈ Fnqm . Define
Γ(v) ∈ Matn×m (Fq ) via the identity
Xm
vi = Γij (v)γj , i = 1, . . . , n.
j=1

Part of this chapter was written while the author was participating in the Nonlinear Algebra program
at ICERM in Fall 2018. The author wishes to thank ICERM and Brown University for an excellent
working environment.

1
2 E. GORLA

Let C ⊆ Fnqm be a vector rank-metric code. The set


Γ(C) = {Γ(v) | v ∈ C}
is the rank-metric code associated to C with respect to Γ.
Example 1.4. Let C be the vector rank-metric code C = h(1, α)i ⊆ F28 . Let F8 =
F2 [α]/(α3 + α + 1) and let γ1 = 1, γ2 = α, γ3 = α2 . Then Γ = {γ1 , γ2 , γ3 } is a basis of F8
over F2 and
     
1 0 0 2 0 1 0 2 0 0 1
Γ(1, α) = , Γ(α, α ) = , Γ(α , α + 1) = .
0 1 0 0 0 1 1 1 0
Hence      
1 0 0 0 1 0 0 0 1
Γ(C) = , , ⊆ Mat2×3 (F2 ).
0 1 0 0 0 1 1 1 0

The image Γ(C) of a vector rank-metric code C via Γ as defined above is a rank-
metric code, whose parameters are determined by those of C. The proof of the next
proposition is easy and may be found e.g. in [11, Section 1].
Proposition 1.5. The map v 7→ Γ(v) is an Fq -linear isometry, i.e., it is a homomorphism
of Fq -vector spaces which preserves the rank. In particular, if C ⊆ Fnqm is a vector rank-
metric code of dimension k over Fqm , then Γ(C) is an Fq -linear rank-metric code of
dimension mk over Fq .

The following is the natural notion of equivalence for rank-meric codes.


Definition 1.6. An Fq -linear isometry ϕ of Matn×m (Fq ) is an Fq -linear homomorphism
ϕ : Matn×m (Fq ) → Matn×m (Fq ) such that rk(ϕ(M)) = rk(M) for every M ∈ Matn×m (Fq ).
Two rank-metric codes C, D ⊆ Matn×m (Fq ) are equivalent if there is an Fq -linear
isometry ϕ : Matn×m (Fq ) → Matn×m (Fq ) such that ϕ(C) = D. If C and D are equivalent
rank-metric codes, we write C ∼ D.

Some authors define a notion of equivalence for vector rank-metric codes as follows.
Definition 1.7. An Fqm -linear isometry ψ of Fnqm is an Fqm -linear homomorphism
ψ : Fnqm → Fnqm such that rk(ψ(v)) = rk(v) for every v ∈ Fnqm .
Two vector rank-metric codes C, D ⊆ Fnqm are equivalent if there is an Fqm -linear
isometry ψ : Fnqm −→ Fnqm such that ψ(C) = D. If C and D are equivalent vector
rank-metric codes, we write C ∼ D.

Notice however that Definition 1.3 allows us to apply the notion of equivalence from
Definition 1.6 to vector rank-metric codes. It is therefore natural to ask whether the
rank-metric codes associated to equivalent rank-metric codes are also equivalent. It is
easy to show that the answer is affirmative.
Proposition 1.8 ([10], Proposition 1.15). Let C, D ⊆ Fnqm be vector rank-metric codes.
Let Γ and Γ′ be bases of Fqm over Fq . If C ∼ D, then Γ(C) ∼ Γ′ (D).
RANK-METRIC CODES 3

Linear isometries of Matn×m (Fq ) and of Fnqm can be easily characterized. The fol-
lowing result was shown by Hua for fields of odd characteristic and by Wan for fields of
characteristic 2.
Theorem 1.9 ([13, 27]). Let ϕ : Matn×m (Fq ) → Matn×m (Fq ) be an Fq -linear isometry
with respect to the rank metric.
• If m 6= n, then there exist matrices A ∈ GLn(Fq ) and B ∈ GLm (Fq ) such that
ϕ(M) = AMB for all M ∈ Matn×m (Fq ).
• If m = n, then there exist matrices A, B ∈ GLn(Fq ) such that either ϕ(M) = AMB
for all M ∈ Matn×n (Fq ), or ϕ(M) = AM T B for all M ∈ Matn×n (Fq ).

The corresponding characterization of isometries of Fnqm was given by Berger.


Theorem 1.10 ([2]). Let ψ : Fnqm → Fnqm be an Fqm -linear isometry with respect to the
rank metric. Then there exist α ∈ F∗qm and B ∈ GLn (Fq ) such that ψ(v) = αvB for all
v ∈ Fnqm .
Notation 1.11. For a vector rank-metric code C ⊆ Fnqm and B ∈ GLn (Fq ), let
CB = {vB | v ∈ C} ⊆ Fnqm .
For a rank-metric code C ⊆ Matn×m (Fq ), let
C T = {M T | M ∈ C} ⊆ Matm×n (Fq ).

The MacWilliams Extension Theorem is a classical result in the theory of linear


block codes in Fnq with the Hamming distance. It essentially says that any linear isometry
of block codes can be extended to a linear isometry of the ambient space Fnq . It is
natural to ask whether an analogue of the MacWilliams Extension Theorem holds for
rank-metric codes. In other words, given rank-metric codes C, D ⊆ Matn×m (Fq ) and an
Fq -linear isometry f : C → D, one may ask whether there exists an Fq -linear isometry
ϕ : Matn×m (Fq ) → Matn×m (Fq ) such that ϕ |C = f . The answer is no, as the next example
shows. More counterexamples can be found in [1] and in the preprint [4, Section 7].
Example 1.12 ([1], Example 2.9 (a)). Denote by 0 the zero matrix of size 2 × 1 and let
C = {(A 0) | A ∈ Mat2×2 (F2 )} ⊆ Mat2×3 (F2 ).
Let ϕ : C → Mat2×3 (F2 ) be defined by ϕ(A 0) = (AT 0). Then ϕ is an F2 -linear isometry
defined on C which is not the restriction
 to C of an F2 -linear isometry of Mat2×3 (F2 ). In
0 0 1
fact, there is no choice for ϕ that preserves the property that ϕ is an F2 -linear
0 0 0
isometry.

2. The notion of support in the rank-metric

In analogy with the notion of support of a codeword for linear block codes, one
may define the support of a codeword in a vector rank-metric code. For a matrix M ∈
Matn×m (Fq ), we denote by colsp(M) ⊆ Fnq the Fq -vector space generated by the columns
of M and by rowsp(M) ⊆ Fm q the Fq -vector space generated by the rows of M.
4 E. GORLA

Definition 2.1. [[15], Definition 2.1] Let C ⊆ Fnqm be a vector rank-metric code, and let
Γ = {γ1 , . . . , γm } be a basis of Fqm over Fq . The support of v ∈ C is the Fq -linear space
supp(v) = colsp(Γ(v)) ⊆ Fnq .
The support of a subcode D ⊆ C is
X
supp(D) = supp(v) ⊆ Fnq .
v∈D

Notice that supp(v) does not depend on the choice of the basis Γ, since if Γ′ is another
basis of Fqm over Fq , then there exists a B ∈ GLm (Fq ) such that Γ(v) = Γ′ (v)B. This also
implies that supp(D) does not depend on the choice of Γ. See also [10, Proposition 1.13].
In the context of rank-metric codes, we define the support as follows.
Definition 2.2. Let C ⊆ Matn×m (Fq ) be a rank-metric code.
If n ≤ m define the support of M ∈ C as the Fq -linear space
supp(M) = colsp(M) ⊆ Fnq .
If n > m define the support of M ∈ C as the Fq -linear space
supp(M) = rowsp(M) ⊆ Fm
q .

The support of a subcode D ⊆ C is


X
supp(D) = supp(M) ⊆ Fqmin{m,n} .
M ∈D

Notice that, if n ≤ m, Definition 2.2 agrees with Definition 2.1, when restricted
to rank-metric codes associated to vector rank-metric codes. Precisely, if C ⊆ Fnqm is a
vector rank-metric code and Γ = {γ1 , . . . , γm } is a basis of Fqm over Fq , then
supp(Γ(v)) = supp(v)
for all v ∈ C, under the assumption that n ≤ m.
Remark 2.3. If n > m, the support of v ∈ Fnqm according to Definition 2.1 is colsp(Γ(v)),
while the support of Γ(v) ∈ Matn×m (Fq ) according to Definition 2.2 is rowsp(Γ(v)). In
other words, Definition 2.2 for the elements of the rank-metric code associated to a vector
rank-metric code does not coincide with Definition 2.1 for the elements of the vector rank-
metric code. This will not create confusion, since our notation allows us to distinguish
the two situations: supp(v) = colsp(Γ(v)) while supp(Γ(v)) = rowsp(Γ(v)), if n > m.

We wish to stress that, in the context of matrices, taking the support of the trans-
posed yields a different, but well-behaved notion of support of a matrix. Below we make
a few remarks on different possible notions of support and on why we choose to adopt
Definition 2.2. It is clear that, depending on the application or on the information that
one wishes to encode, one may also choose to work with different notions of support.
Remark 2.4. If n = m, then one may define a notion of support by considering row
spaces instead of column spaces. This yields a different, but substantially equivalent
notion of support. A different, but possibly interesting, notion of support for a square
RANK-METRIC CODES 5

matrix would be defining the support of M ∈ Matn×n (Fq ) to be the pair of vector spaces
(rowsp(M), colsp(M)). This is connected to the definition of generalized weights (see
Section 5) and to the approach taken in [10] for studying generalized weights of square
matrices via q-polymatroids (see Section 6).

Remark 2.5. For any value of m, n, one may define a different notion of support as
follows: For a rank-metric code C ⊆ Matn×m (Fq ) and for M ∈ C, let

(1) supp(M) = rowsp(M) ⊆ Fm


q if n ≤ m

and let

(2) supp(M) = colsp(M) ⊆ Fnq if n > m.

Then the support of a subcode D ⊆ C is


X
(3) supp(D) = supp(M) ⊆ Fmax{m,n}
q .
M ∈D

This definition yields a different notion of support from that of Definition 2.2, in particular
max{n,m}
it takes values in Fq . One can check that both notions of support are regular in
the sense of [24]. However, the definition of support in (1), (2), and (3) for n 6= m yields
an empty extremality theory in the sense of [24, Section 7] and a series of redundant
MacWilliams Identities. Moreover, in [10] we showed that, for n < m, the q-polymatroid
determined by the supports as in Definition 2.2 allows one to easily recover the generalized
weights of the code, while the q-polymatroid determined by the supports as in (1), (2),
and (3) does not. With these in mind, we choose to adopt Definition 2.2.

Remark 2.6. Some authors choose to work with a definition of support which is the
same for every value of m, n; e.g. in [19] the authors define

(4) supp(M) = colsp(M) for any m, n and any M ∈ Matn×m (Fq ).

This notion of support agrees with Definition 2.2 for n ≤ m and with the definition
discussed in the previous remark for n > m. For all the reasons discussed in the previous
remark, for n > m we prefer Definition 2.2 to this definition. Notice however that the
definition of support in (4) is compatible with the notion of generalized matrix weights as
defined by Martı́nez-Peñas and Matsumoto (see Definition 5.12). In this chapter, however,
we define generalized weights as in Definition 5.7, which is compatible with the notion of
support as by Definition 2.2.

Given a definition of support, it is natural to consider the subcodes of a code which


are supported on a fixed vector space.
min{m,n}
Definition 2.7. Let C ⊆ Matn×m (Fq ) be a rank-metric code. Let V ⊆ Fq be a
vector subspace. The subcode of C supported on V is

C(V ) = {M ∈ C | supp(M) ⊆ V }.
6 E. GORLA

3. MRD codes and optimal anticodes

The basic invariants of a rank-metric code C ⊆ Matn×m (Fq ) are n, m, the dimension
of C as a vector space over Fq , and its minimum distance.
Definition 3.1. The minimum distance of a rank-metric code 0 6= C ⊆ Matn×m (Fq ) is
the integer
dmin(C) = min{rk(M) | M ∈ C, M 6= 0}.
We define the minimum distance of the trivial code C = 0 as
dmin (0) = min{m, n} + 1.

Sometimes, one is also interested in the maximum rank of an element of C.


Definition 3.2. Let C ⊆ Matn×m (Fq ) be a rank-metric code. The maximum rank of C
is
max rk(C) = max{rk(M) | M ∈ C}.

Analogous definitions can be given for vector rank-metric codes, using the corre-
sponding rank distance.
Definition 3.3. The minimum distance of a vector rank-metric code 0 6= C ⊆ Fnqm is
dmin (C) = min{rk(v) | v ∈ C, v 6= 0}.
The minimum distance of the trivial code C = 0 is
dmin(0) = n + 1.

It follows from Proposition 1.5 that


dmin(C) = dmin (Γ(C))
for any vector rank-metric code 0 6= C ⊆ Fnqm and any basis Γ of Fqm over Fq .
Definition 3.4. Let C ⊆ Fnqm be a vector rank-metric code. The maximum rank of C
is
max rk(C) = max{rk(v) | v ∈ C}.

Both the minimum distance and the maximum rank of a code are related to the
other invariants of the code. The first inequality in the next theorem goes under the
name of Singleton Bound and was proved by Delsarte in [6, Theorem 5.4]. The second
goes under the name of Anticode Bound. The Anticode Bound was proved by Meshulam
in [20, Theorem 1] in the square case, but one can check that the proof also works in the
rectangular case. The proof by Meshulam relies heavily on a result by König [17] (see
also [14, Theorem 5.1.4]). Finally, a coding-theoretic proof of the Anticode Bound was
given by Ravagnani in [23, Proposition 47].
Theorem 3.5. Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then
dim(C) ≤ max{n, m}(min{m, n} − dmin(C) + 1)
and
dim(C) ≤ max{n, m} · max rk(C).
RANK-METRIC CODES 7

Remark 3.6. For a vector rank-metric code C ⊆ Fnqm , the Singleton Bound can be stated
as
dimFqm (C) ≤ n − dmin (C) + 1.
This bound appeared in [8, Corollary of Lemma 1], under the assumption that n ≤ m.
However, it is easy to check that the bound holds for any n, m.
Remark 3.7. For a vector rank-metric code C ⊆ Fnqm with dimFqm (C) ≤ m, the Anticode
Bound can be stated as
(5) dimFqm (C) ≤ max rk(C).
The bound was proved in [22, Proposition 11], under the assumption that n ≤ m. Using
the same type of arguments however, one can easily prove the bound in the more general
form stated here. Notice moreover that, if dimFqm (C) > m, then
dimFqm (C) > m ≥ max rk(C).
In particular, the inequality (5) cannot hold if dimFqm (C) > m.

The codes whose invariants meet the bounds of Theorem 3.5 go under the names
of MRD codes and optimal anticodes, respectively. They have both been extensively
studied.
Definition 3.8. A vector rank-metric code C ⊆ Fnqm is a Maximum Rank Distance
(MRD) code if
dimFqm (C) = n − dmin(C) + 1.
It is an optimal vector anticode if
dimFqm (C) = max rk(C).
A rank-metric code C ⊆ Matn×m (Fq ) is a Maximum Rank Distance (MRD) code if
dim(C) = max{n, m}(min{m, n} − dmin (C) + 1).
It is an optimal anticode if
dim(C) = max{n, m} · max rk(C).
Remark 3.9. Let C ⊆ Matn×m (Fq ) be a rank-metric code and let C T ⊆ Matm×n (Fq ) be
the code obtained from C by transposition. The following are immediate consequences of
the definitions:

• C is MRD if and only if C T is MRD,


• C is an optimal anticode if and only if C T is an optimal anticode.

Several examples and constructions of MRD codes are given in Chapter ??.
Remark 3.10. Notice that 0 and Fnqm are the only MRD vector rank-metric codes, if
n > m. In fact, if a vector rank-metric code C exists with
dimFqm (C) = n − dmin(C) + 1 < n,
8 E. GORLA

then dmin(C) > 1. Assume that C 6= 0 and let Γ be a basis of Fqm over Fq . Recall that
dim(Γ(C)) = m dimFqm (C) and dmin (C) = dmin (Γ(C)). Then Γ(C) is a rank-metric code
of dimension
dim(Γ(C)) = m(n − dmin(Γ(C)) + 1) ≤ n(m − dmin(Γ(C)) + 1),
contradicting the assumption that n > m.

It is easy to produce examples of optimal anticodes and optimal vector anticodes.


Example 3.11 (Standard optimal anticodes). If n ≤ m, let C ⊆ Matn×m (Fq ) consist of
the matrices whose last n − k rows are zero. Then dim(C) = mk and max rk(C) = k;
hence C is an optimal anticode.
If n ≥ m, let C ⊆ Matn×m (Fq ) consist of the matrices whose last m − k columns are
zero. Then dim(C) = nk and max rk(C) = k; hence C is an optimal anticode.
Example 3.12 (Standard optimal vector anticodes). Let 0 ≤ k ≤ m and let C =
he1 , . . . , ek i ⊆ Fnqm , where ei denotes the i-th vector of the standard basis of Fnqm . Then
dim(C) = k and max rk(C) = k; hence C is an optimal vector anticode.
Remark 3.13. Notice that every optimal vector anticode C ⊆ Fnqm has
dimFqm (C) = max rk(C) ≤ min{m, n}.
In particular, Fnqm is not an optimal vector anticode if n > m.

It is natural to ask whether the rank-metric code associated to an MRD vector rank-
metric code or to an optimal vector anticode is an MRD rank-metric code or an optimal
anticode, respectively. It is easy to show that, up to the trivial exceptions, this happens
only if n ≤ m.
Proposition 3.14. Let C ⊆ Fnqm be a vector rank-metric code with dmin(C) = d. Let Γ
be a basis of Fqm over Fq and let Γ(C) ⊆ Matn×m (Fq ) be the rank-metric code associated
to C with respect to Γ. If n ≤ m, then:

(1) C is MRD if and only if Γ(C) is MRD.


(2) C is an optimal vector anticode if and only if Γ(C) is an optimal anticode.

If n > m, then:

(1) The codes C and Γ(C) are both MRD if and only if C = 0 or C = Fnqm .
(2) C is an optimal vector anticode and Γ(C) is an optimal anticode if and only if
C = 0.

Proof: Notice that if C = 0 or C = Fnqm , then both C and Γ(C) are MRD for any n, m.
Moreover, C = 0 is an optimal vector anticode and Γ(C) = 0 is an optimal anticode
for any n, m. In the sequel, we suppose that C 6= 0. Recall that for any m, n one has
dim(Γ(C)) = m dimFqm (C), dmin (Γ(C)) = d, and max rk(Γ(C)) = max rk(C).
Suppose that n ≤ m. Then:
RANK-METRIC CODES 9

(1) The code C is MRD if and only if dimFmq


(C) = n − d + 1. The code Γ(C) is
MRD if and only if dim(Γ(C)) = m(n − d + 1). Then C is MRD if and only if Γ(C) is
MRD.
(2) The code C is an optimal vector anticode if and only if dimFm
q
(C) = max rk(C).
The code Γ(C) is an optimal anticode if and only if dim(Γ(C)) = m max rk(C). Then C
is an optimal vector anticode if and only if Γ(C) is an optimal anticode.
Suppose now that n > m. Then:
(1) C = 0 and C = Fnqm are the only MRD vector rank-metric codes by Remark 3.10.
The associated code Γ(C) is MRD in both cases.
(2) The code C is an optimal vector anticode if and only if dimFm
q
(C) = max rk(C).
The code Γ(C) is an optimal anticode if and only if dim(Γ(C)) = n max rk(C). Then C is
an optimal vector anticode and Γ(C) is an optimal anticode if and only if n max rk(C) =
m max rk(C). Since n > m, this is equivalent to max rk(C) = 0. ✷
Optimal anticodes were characterized by de Seguins Pazzis, who proved that, up to
code equivalence, they are exactly the standard optimal anticodes of Example 3.11.
Theorem 3.15 ([5], Theorem 4 and Theorem 6). The optimal anticodes of Matn×m (Fq )
with respect to the rank metric are exactly the following codes:
min{m,n}
• Matn×m (Fq )(V ) for some V ⊆ Fq , if m 6= n,
• Matn×n (Fq )(V ) and Matn×n (Fq )(V )T for some V ⊆ Fnq , if m = n.
In particular, every optimal anticode is equivalent to a standard optimal anticode.

Proof: The only part of the statement which is not contained in the proof of [5, Theorem
4 and Theorem 6] is the claim that every optimal anticode is equivalent to a standard
optimal anticode. Notice that the standard optimal anticodes are Matn×m (Fq )(Eℓ ) and
Matn×n (Fq )(Eℓ )T , where Eℓ = he1 , . . . , eℓ i and ℓ = 0, . . . , min{m, n}.
If n ≤ m let A ∈ GLn (Fq ) be a matrix whose first k = dim(V ) columns are a basis
of V and let B ∈ GLm (Fq ) be any matrix. If n > m, let A ∈ GLn (Fq ) be any matrix and
let B ∈ GLm (Fq ) be a matrix whose first k = dim(V ) rows are a basis of V . Then
(6) A Matn×m (Fq )(Ek )B = Matn×m (Fq )(V ).
In fact, if n ≤ m and colsp(M) ⊆ Ek , then
colsp(AMB) = colsp(AM) ⊆ V.
Similarly, if n > m and rowsp(M) ⊆ Ek , then
rowsp(AMB) = rowsp(MB) ⊆ V.
Therefore, AMB ∈ Matn×m (Fq )(V ) for every M ∈ Matn×m (Fq )(Ek ). Since the two vector
spaces in (6) have the same dimension and one is a subset of the other, they must be equal.
Hence Matn×m (Fq )(V ) is equivalent to the standard optimal anticode Matn×m (Fq )(Ek ).
Moreover, if n = m, by taking the transpose of (6) one has
B T Matn×n (Fq )(Ek )T AT = Matn×n (Fq )(V )T .
10 E. GORLA

Therefore Matn×n (Fq )(V )T is equivalent to the standard optimal anticode Matn×n (Fq )(Ek )T .

Optimal vector anticodes were characterized by Ravagnani in [22, Theorem 18], un-
der the assumption that n ≤ m. One can also show that, up to code equivalence, optimal
vector anticodes are exactly the standard optimal vector anticodes of Example 3.12. No-
tice that a vector rank-metric code C ⊆ Fnqm with dimFqm (C) > m cannot be an optimal
vector anticode by Remark 3.13. Hence we may assume without loss of generality that
dimFqm (C) ≤ m.
Theorem 3.16. Let C ⊆ Fnqm be a vector rank-metric code with k = dimFqm (C) ≤ m.
The following are equivalent:

(1) C is an optimal vector anticode,


(2) C has a basis consisting of vectors with entries in Fq ,
(3) C ∼ he1 , . . . , ek i, where ei denotes the i-th vector of the standard basis of Fnqm .

Proof: Let φ : Fnqm → Fnqm be the Frobenius endomorphism, defined by φ(v1 , . . . , vn ) =


(v1q , . . . , vnq ). Recall that a subspace V ⊆ Fnqm is fixed by φ if and only if it has an Fqm -basis
that consists of vectors with entries in Fq . Combining this fact with the argument in [22,
Theorem 18], one has that C is an optimal vector anticode if and only if C has a basis
consisting of vectors with entries in Fq . Although [22, Theorem 18] is proved under the
assumption that n ≤ m, one can check that the proof works for arbitrary n, m, under the
assumption that dimFqm (C) ≤ m. This proves that (1) and (2) are equivalent.
By Theorem 1.10, C ∼ he1 , . . . , ek i if and only if there exist α ∈ F∗qm and B ∈
GLm (Fq ) such that
C = αhe1 , . . . , ek iB = he1 , . . . , ek iB.
Equivalence of (2) and (3) follows readily. ✷

4. Duality and MacWilliams Identities

The usual scalar product for matrices induces a notion of dual for rank-metric codes.
Definition 4.1. The dual of C ⊆ Matn×m (Fq ) is
C ⊥ = {M ∈ Matn×m (Fq ) | tr(MN T ) = 0 for all N ∈ C},
where tr(·) denotes the trace of a matrix.

The usual scalar product of Fnqm induces a notion of dual for vector rank-metric
codes.
Definition 4.2. The dual of C ⊆ Fnqm is the vector rank-metric code
C ⊥ := {v ∈ Fnqm | hv, wi = 0 for all w ∈ C},
where h·, ·i is the standard inner product of Fnqm .
RANK-METRIC CODES 11

The two notions of dual code are compatible with the definition of associated rank-
metric code with respect to a basis of Fqm over Fq , for a suitable choice of bases.
Definition 4.3. Two bases Γ = {γ1 , . . . , γm } and Γ′ = {γ1′ , . . . , γm

} of Fqm over Fq are
orthogonal if 
′ 1 if i = j
tr(γi γj ) =
0 if i 6= j
where tr(·) denotes the trace relative to the field extension Fqm ⊇ Fq .
Proposition 4.4 ([23], Theorem 21). Let C ⊆ Fnqm be a vector rank-metric code and let
Γ, Γ′ be orthogonal bases of Fqm over Fq . Then
Γ(C)⊥ = Γ′ (C ⊥ ).

We now give a simple example to illustrate Proposition 4.4.


Example 4.5. Let C be the vector rank-metric code C = h(1, α)i ⊆ F28 , where F8 =
F2 [α]/(α3 + α + 1). Its dual code is C ⊥ = h(1, α2 + 1)i ⊆ F28 .
Let Γ = {γ1 = 1, γ2 = α, γ3 = α2 } be an F2 -basis of F8 . The rank-metric code associated
to C with respect to Γ is
     
1 0 0 0 1 0 0 0 1
Γ(C) = , , ⊆ Mat2×3 (F2 ).
0 1 0 0 0 1 1 1 0
Its dual code is
     
⊥ 0 0 1 1 0 1 0 1 0
Γ(C) = , , ⊆ Mat2×3 (F2 ).
1 0 0 0 1 0 0 0 1
The orthogonal basis of Γ is Γ′ = {γ1′ = 1, γ2′ = α2 , γ3′ = α}. The rank-metric code
associated to C ⊥ with respect to Γ′ is
     
′ ⊥ 1 0 0 0 0 1 0 1 0
Γ (C ) = , , .
1 1 0 1 0 0 0 0 1
It is easy to check that Γ(C)⊥ = Γ′ (C ⊥ ).

There are a number of interesting relations between the invariants of a code and
those of its dual. The simplest one is probably the equality
dim(C) + dim(C ⊥ ) = mn,
which holds for any rank-metric code C ⊆ Matn×m (Fq ).
The minimum distances of C and C ⊥ do not satisfy such a simple relation. Never-
theless, one can relate them through the next inequality, which follows easily from the
Singleton Bound.
Proposition 4.6 ([23], Proposition 43). Let C ⊆ Matn×m (Fq ) be a rank-metric code.
Then
dmin (C) + dmin(C ⊥ ) ≤ min{m, n} + 2
and equality holds if and only if C is MRD.
12 E. GORLA

Using the Anticode Bound, one can produce an inequality which involves max rk(C)
and max rk(C ⊥ ).
Proposition 4.7 ([23], Proposition 55). Let C ⊆ Matn×m (Fq ) be a rank-metric code.
Then
max rk(C) + max rk(C ⊥ ) ≥ min{m, n}
and equality holds if and only if C is an optimal anticode.

Finally, by combining the Singleton Bound and the Anticode Bound, one obtains
an inequality which involves dmin (C) and max rk(C ⊥ ).
Proposition 4.8 ([23], Proposition 49). Let C ⊆ Matn×m (Fq ) be a rank-metric code.
Then
dmin(C) ≤ max rk(C ⊥ ) + 1.

Notice that equality holds in Proposition 4.8 if and only if C is MRD and an optimal
anticode. We will see in Corollary 5.23 that this is the case if and only if C = 0 or
C = Matn×m (Fq ).
Although the minimum distance of C and C ⊥ do not determine each other, the weight
distribution of C determines the weight distribution of C ⊥ , and vice versa. We now define
the weight distribution, which is an important invariant of a rank-metric code.
Definition 4.9. Let C ⊆ Matn×m (Fq ) be a rank-metric code. The weight distribution
of C is the collection of natural numbers
Ai (C) = #{M ∈ C | rk(M) = i}, i = 0, . . . , min{m, n}.

Clearly A0 (C) = 1, dmin (C) = min{i | Ai (C) 6= 0, i 6= 0}, and max rk(C) = max{i |
Ai (C) 6= 0}.
Definition 4.10. The q-ary Gaussian coefficient of a, b ∈ Z is
0 if a < 0, b < 0, or b > a,

 
a

= 1 if b = 0 and a ≥ 0,
b q  (qa −1)(qa−1 −1)···(qa−b+1 −1)
(q b −1)(q b−1 −1)···(q−1)
otherwise.

The relations between the weight distribution of C and C ⊥ go under the name of
MacWilliams Identities, and were first proved in [6, Theorem 3.3]. A different proof,
inspired by [24, Theorem 27], was given in [11, Theorem 2]. Another proof was given
in [26, Proposition 15].
Theorem 4.11 (MacWilliams Identities). Let C ⊆ Matn×m (Fq ) be a rank-metric code.
One has
min{m,n} min{m,n}    
⊥ 1 X X
i−ℓ max{m,n}k+(i−ℓ ) min{m, n} − ℓ min{m, n} − j
Ai (C ) = Aj (C) (−1) q 2
|C| min{m, n} − i q ℓ q
j=0 ℓ=0

for i = 0, . . . , min{m, n}.


RANK-METRIC CODES 13

The following is an equivalent formulation of the MacWilliams Identities. Identities


of this form for vector rank-metric codes were proved in [9, Proposition 3]. The same
identities were proved in [23, Theorem 21] for rank-metric codes.
Theorem 4.12. Let C ⊆ Matn×m (Fq ) be a rank-metric code. One has
min{m,n}−ℓ   ℓ  
X min{m, n} − i |C| X
⊥ min{m, n} − j
Ai (C) = max{m,n}·ℓ Ai (C )
ℓ q q ℓ−j q
i=0 j=0

for ℓ = 0, . . . , min{m, n}.

From the MacWilliams Identities, one can derive a number of nontrivial conse-
quences. Here we give two relevant ones, starting with the celebrated result of Delsarte,
which states that the dual of an MRD code is MRD.
Theorem 4.13 ([6], Theorem 5.5). Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then C
is MRD if and only if C ⊥ is MRD.

The weight distribution of an MRD code was first computed by Delsarte in [6, Theo-
rem 5.6] and can be derived from the MacWilliams Identities via a standard computation.
An analogous result can be obtained for dually quasi-MRD codes.
Definition 4.14. Let C ⊆ Matn×m (Fq ) be a rank-metric code. C is dually quasi-MRD
if
dmin (C) + dmin (C ⊥ ) = min{m, n} + 1.

Discussing the family of dually quasi-MRD codes is beyond the scope of this chapter.
The definition however is motivated by Proposition 4.6, which shows that dually quasi-
MRD codes are exactly the non-MRD codes which maximize the quantity dmin(C) +
dmin(C ⊥ ). We refer the interested reader to [3] for a discussion of the properties of codes
which are close to being MRD in this sense. The weight distribution of a dually quasi-
MRD code was computed in [3, Corollary 28]. Below we give a statement that covers
both MRD and dually quasi-MRD codes.
Theorem 4.15. Let C ⊆ Matn×m (Fq ) be an MRD or dually quasi-MRD rank-metric code.
Let d = dmin (C). Then A0 (C) = 1, Ai (C) = 0 for i = 1, . . . , d − 1, and
  i−d  
min{m, n} X j (2j ) i
q dim(C)−max{m,n}(min{m,n}+j−i) − 1

Ai (C) = (−1) q
i q
j q
j=0

for i = d, . . . , min{m, n}.

The analogue of Theorem 4.13 for optimal anticodes was proved by Ravagnani.
Theorem 4.16 ([23], Theorem 54). Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then C
is an optimal anticode if and only if C ⊥ is an optimal anticode.

Ravagnani also proved the next interesting result, relating MRD codes and optimal
anticodes.
14 E. GORLA

Proposition 4.17 ([23], Proposition 53). Let C ⊆ Matn×m (Fq ) be a rank-metric code of
dimension dim(C) = k · max{m, n}. Then C is an optimal anticode if and only if
C + D = Matn×m (Fq )
for every D ⊆ Matn×m (Fq ) MRD code of minimum distance dmin(D) = k + 1.

5. Generalized weights

Generalized Hamming weights were introduced by Helleseth, Kløve, and Mykkeltveit


in [12] for linear block codes. In [28], Wei studied them in the context of wire-tap channels.
Different definitions of generalized weights were given for vector rank-metric codes and
rank-metric codes. In this section, we give the different definitions and compare them
with each other.
In the context of vector rank-metric codes, generalized weights were first defined by
Oggier and Sboui.
Definition 5.1 ([21], Definition 1). Let n ≤ m and let C ⊆ Fnqm be a vector rank-metric
code. The generalized weights of C are
wi (C) = min{max{dim supp(v) | v ∈ D, v 6= 0} | D ⊆ C, dimFqm (D) = i},
D v
i = 1, . . . , dimFqm (C).

A definition of relative generalized weights for vector rank-metric codes was given
by Kurihara, Matsumoto, and Uyematsu. Let φ : Fnqm → Fnqm be the Frobenius endo-
morphism, defined by φ(v1 , . . . , vn ) = (v1q , . . . , vnq ).
Definition 5.2 ([18], Definition 2). Let C ⊆ Fnqm be a vector rank-metric code, and let
D ( C be a proper subcode. Let φ : Fnqm → Fnqm be the Frobenius endomorphism. The
relative generalized weights of C and D are
wi (C, D) = min{dim supp(V ) | V ⊆ Fnqm , φ(V ) = V, dimFqm (C ∩ V ) − dimFqm (D ∩ V ) ≥ i},
i = 1, . . . , dimFqm (C) − dimFqm (D).

The relative generalized weights of C and 0 are by definition


wi (C, 0) = min{dim supp(V ) | V ⊆ Fnqm , φ(V ) = V, dimFqm (C ∩ V ) ≥ i},
i = 1, . . . , dimFqm (C).

In [7], Ducoat proposed and studied the following modification of Definition 5.1.
For any D ⊆ Fnqm , let D ∗ = D + φ(D) + · · · + φm−1 (D), where φ denotes the Frobenius
endomorphism. D ∗ is the smallest Fqm -linear space containing D which is fixed by φ.
Definition 5.3. Let C ⊆ Fnqm be a vector rank-metric code. The generalized weights
of C are
wi (C) = min{max{dim supp(v) | v ∈ D ∗ , v 6= 0} | D ⊆ C, dimFqm (D) = i},
D v
i = 1, . . . , dimFqm (C).
RANK-METRIC CODES 15

Notice that, although the definition by Ducoat does not assume n ≤ m, most of the
results that he establishes in [7] do.
It was shown by Ducoat in [7, Proposition II.1] for n ≤ m, and by Jurrius and
Pellikaan in [15, Theorem 5.4] for any n, m, that the relative generalized weights of C and
0 agree with the generalized weights of C, i.e.,
wi (C, 0) = wi (C), for i = 1, . . . , dimFqm (C).
Moreover, it follows from [15, Theorem 5.2 and Theorem 5.8] that Definition 5.1 and
Definition 5.3 are equivalent for n ≤ m.
The next definition is the natural analogue of the definition of generalized rank
weights for linear block codes, endowed with the Hamming distance. It was given by Jur-
rius and Pellikaan, who in [15, Theorem 5.2] proved that it is equivalent to Definition 5.1
if n ≤ m. In [15, Theorem 5.8] they proved that it is equivalent to Definition 5.3.
Definition 5.4 ([15], Definition 2.5). Let C ⊆ Fnqm be a vector rank-metric code. The
generalized weights of C are
wi (C) = min{dim supp(D) | D ⊆ C, dimFqm (D) = i}, i = 1, . . . , dimFqm (C).

The next result provides another equivalent definition of generalized weights for
vector rank-metric codes. It was proved by Ravagnani under the assumption n ≤ m, but
it can easily be extended to arbitrary n, m as follows.
Theorem 5.5 ([22], Corollary 19). Let C ⊆ Fnqm be a vector rank-metric code of dimension
dimFqm (C) ≤ m. Then
wi (C) = min{dimFqm (A) | A ⊆ Fnqm optimal vector anticode, dimFqm (C ∩ A) ≥ i}
for i = 1, . . . , dimFqm (C).
Remark 5.6. Let C ⊆ Fnqm be a vector rank-metric code of dimension dimFqm (C) > m
and let m < i ≤ dimFqm (C). Then the quantity
min{dimFqm (A) | A ⊆ Fnqm optimal vector anticode, dimFqm (C ∩ A) ≥ i}
cannot be equal to wi (C), since by Remark 3.13 there exists no optimal vector anticode
A with dimFqm (A) ≥ dimFqm (C ∩ A) ≥ i > m .

The first definition of generalized weights for the larger class of rank-metric codes
was given by Ravagnani.
Definition 5.7 ([22], Definition 23). Let C ⊆ Matn×m (Fq ) be a rank-metric code. The
generalized weights of C are
1
di (C) = min{dim(A) | A ⊆ Matn×m (Fq ) optimal anticode, dim(C ∩ A) ≥ i},
max{m, n}
i = 1, . . . , dim(C).
Remark 5.8. The characterization of optimal anticodes from Theorem 3.15, together
with the observation that
dim(Matn×m (Fq )(V )) = max{n, m} · dim(V ),
16 E. GORLA

implies that for i = 1, . . . , dim(C) one has


di (C) = min{dim(V ) | V ⊆ Fmin{n,m}
q , dim(C(V )) ≥ i} if m 6= n
and
di (C) = min{dim(V ) | V ⊆ Fnq , max{dim(C(V )), dim(C T (V ))} ≥ i} if m = n.
Notice that, for m = n, this definition of generalized weights is coherent with the definition
of support given in Remark 2.4.

Generalized weights for vector rank-metric codes and their associated rank-metric
codes are related as follows.
Theorem 5.9 ([22], Theorem 28). Let n ≤ m and let C ⊆ Fnqm be a vector rank-metric
code. Let Γ = {γ1 , . . . , γm } be a basis of Fqm over Fq . Then
wi (C) = dmi−e (Γ(C))
for i = 1, . . . , dimFqm (C) and e = 0, . . . , m − 1.
Remark 5.10. In particular, under the assumptions of Theorem 5.9 one has that
dm(i−1)+1 (Γ(C)) = . . . = dmi−1 (Γ(C)) = dmi (Γ(C))
for i = 1, . . . , dimFqm (C).

One can easily find an example that shows that the equality in Theorem 5.9 does
not hold if n > m.
Example 5.11. Let C = h(1, 0, 0)i ⊆ F34 , where F4 = F2 [α]/(α2 + α + 1). Then
w1 (C) = dmin (C) = 1.
Let Γ = {1, α} be an F2 -basis of F4 . Then
*   +
1 0 0 1
Γ(C) = 0 0 , 0 0
0 0 0 0
has d1 (Γ(C)) = dmin(Γ(C)) = 1. Since Γ(C) is not an optimal anticode, any nonzero
optimal anticode A ) Γ(C). Hence A must have max rk(A) = 2 and dim(A) = 6.
Therefore, d2 (Γ(C)) = 2.

A definition of relative generalized weights for rank-metric codes was proposed by


Martı́nez-Peñas and Matsumoto. This yields in particular a definition of generalized
weights, which is different from Definition 5.7, as we discuss below. In order to avoid
confusion, we call the weights defined by Martı́nez-Peñas and Matsumoto generalized
matrix weights.
Definition 5.12 ([19], Definition 10). Let C ⊆ Matn×m (Fq ) be a rank-metric code, and
let D ( C be a proper subcode. Denote by
Matn×m (Fq )colsp
V = {M ∈ Matn×m (Fq ) | colsp(M) ⊆ V }.
RANK-METRIC CODES 17

The i-th relative generalized matrix weight of C and D is


δi (C, D) = min{dim(V ) | dim(C ∩ Matn×m (Fq )colsp
V ) − dim(D ∩ Matn×m (Fq )colsp
V ) ≥ i,
V ⊆ Fnq }, i = 1, . . . , dim(C) − dim(D).
The i-th generalized matrix weight of C is the i-th relative generalized matrix weight
of C and 0, i.e.,
δi (C) = min{dim(V ) | V ⊆ Fnq , dim(C ∩ Matn×m (Fq )colsp
V ) ≥ i}, i = 1, . . . , dim(C).

Generalized matrix weights measure the information leakage to a wire-tapper in


a linearly coded network and, more generally, in a matrix-multiplicative channel. The
model discussed in [19] is not invariant with respect to transposition, since the wiretap-
per’s observation is AM, where M is the codeword and A is the wiretap transfer matrix.
Accordingly, in Definition 5.12 the authors consider the column space of the matrix inde-
pendently of whether the matrix has more rows or columns. In particular, one should not
expect Definition 5.12 to be equivalence-invariant, i.e. equivalent codes may not have the
same generalized matrix weights. In Example 5.15 we show that this can in fact happen.
Therefore, Definition 5.12 is not equivalence-invariant. The next proposition shows that
Definition 5.7 is equivalence-invariant.
Proposition 5.13 ([10], Proposition 2.4). Let C, D ⊆ Matn×m (Fq ) be rank-metric codes.
If C ∼ D, then
di (C) = di (D) for i = 1, . . . , dim(C).

The next result compares Definition 5.7 and Definition 5.12. It follows easily from
Theorem 3.15 and appears in the literature as [19, Theorem 9]. Notice that the assumption
that n ≤ m is missing throughout [19, Section VIII.C]. As a consequence, the statement
of [19, Theorem 9] claims that Definition 5.7 and Definition 5.12 agreee for m 6= n; however
the result is proved only for n < m.
Theorem 5.14. Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then:
• If m > n, then di (C) = δi (C) for i = 1, . . . , dim(C).
• If m = n, then di (C) ≤ δi (C) for i = 1, . . . , dim(C).

Proof: The thesis follows from Remark 5.8, after observing that for n ≤ m one has
C(V ) = C ∩ Matn×m (Fq )colsp
V .

One can easily find examples that show that Definition 5.7 and Definition 5.12 do
not agree in the case m = n.
Example 5.15 ([10], Example 2.10). Let C ⊆ Mat2×2 (F2 ) be the code
  
a a
C := : a, b ∈ F2 .
b b
Then C is an optimal anticode of dimension 2. Therefore d2 (C) = 1. On the other hand,
supp(C) = F22 ; hence δ2 (C) = 2 6= d2 (C).
18 E. GORLA

Moreover, observe that C ∼ C T . In particular, d2 (C) = d2 (C T ) = 1. However,


δ2 (C) = 2, while δ2 (C T ) = 1.

In fact, one can also find examples that show that Definition 5.7 and Definition 5.12
do not agree in the case m < n. This implies in particular that the part of the statement
of [19, Theorem 9] concerning the case m < n is incorrect.
Example 5.16. Let C ⊆ Mat3×2 (F2 ) be the code
  
 a a 
C :=  b b : a, b, c ∈ F2 .

c c
 

Then C is an optimal anticode of dimension 3. Therefore d3 (C) = 1. On the other hand,


X
colsp(M) = F32 ;
M ∈C

hence δ3 (C) = 3.

The code C ⊆ Mat3×2 (F2 ) of Example 5.16 has d3 (C) < δ3 (C). One may wonder
whether di (C) ≤ δi (C) for all i, for a rank-metric code C ⊆ Matn×m (Fq ) with n > m. The
answer turns out to be negative, as the next example shows.
Example 5.17. Let C ⊆ Mat3×2 (F2 ) be the code
  
 a b 
C := 0 0 : a, b ∈ F2 .
0 0
 

In Example 5.11 we showed that d2 (C) = 2. On the other hand,


X
colsp(M) = h(1, 0, 0)i;
M ∈C

hence δ2 (C) = 1.

In fact, as an easy consequence of Theorem 3.15 and of Remark 3.9 one obtains the
following result.
Theorem 5.18. Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then:

• If m < n, then di (C) = δi (C T ) for i = 1, . . . , dim(C).


• If m = n, then di (C) = min{δi (C), δi (C T )} for i = 1, . . . , dim(C).

Proof: Since n ≥ m, then


(7) C T (V ) = C T ∩ Matm×n (Fq )colsp
V .
If n > m, then
di (C) = di (C T ) = min{dim(V ) | V ⊆ Fm T T
q , dim(C (V )) ≥ i} = δi (C ),
RANK-METRIC CODES 19

where the first equality follows from Proposition 5.13, the second from Remark 5.8, and
the third from (7). If n = m, then
di (C) = min{dim(V ) | V ⊆ Fnq , max{dim(C(V )), dim(C T (V ))} ≥ i} = min{δi (C), δi (C T )},
where the first equality follows from Remark 5.8 and the second from (7). ✷
As in the case of generalized weights, one can relate the generalized weights of a
vector rank-metric code and the generalized matrix weights of its associated rank-metric
code. In fact more is true, since the relative versions of the weights can also be related,
and the assumption n ≤ m is not needed. The proof of the next result is essentially the
same as the proof of Theorem 5.9.
Theorem 5.19 ([19], Theorem 7). Let C ⊆ Fnqm be a vector rank-metric code and let
D ( C be a proper subcode. Let Γ = {γ1 , . . . , γm } be a basis of Fqm over Fq . Then
wi (C, D) = δmi−e (Γ(C), Γ(D))
for i = 1, . . . , dimFqm (C) − dimFqm (D) and e = 0, . . . , m − 1.

We conclude this section with a few results on generalized weights. The next theorem
establishes some properties of the sequence of generalized weights of a rank-metric code.
Theorem 5.20 ([22], Theorem 30). Let C ⊆ Matn×m (Fq ) be a rank-metric code of di-
mension dim(C) = ℓ. Then:
(1) d1 (C) = dmin (C),
(2) dℓ (C) ≤ min{m, n},
(3) di (C) ≤ di+1 (C) for i = 1, . . . , ℓ − 1,
(4) di (C) ≤ di+max{m,n} (C) for i = 1, . . . , ℓ − max{m, n}.

Theorem 5.20 allows one to compute the generalized weights of MRD codes and
optimal anticodes. In Section 4 we stated analogous results for the weight distribution of
MRD codes and optimal anticodes.
Corollary 5.21 ([22], Corollary 31). Let C ⊆ Matn×m (Fq ) be a rank-metric code of
dimension dim(C) = ℓ = k · max{m, n}. The following are equivalent:
• C is MRD,
• di (C) = min{m, n} − k + ⌈i/ max{m, n}⌉ for i = 1, . . . , ℓ.
Corollary 5.22 ([22], Corollary 32). Let C ⊆ Matn×m (Fq ) be a rank-metric code of
dimension dim(C) = ℓ = k · max{m, n}. The following are equivalent:
• C is an optimal anticode,
• dℓ (C) = k,
• di (C) = ⌈i/ max{m, n}⌉ for i = 1, . . . , ℓ.

An immediate consequence of Corollary 5.21 and Corollary 5.22 is the following.


Corollary 5.23. Let C ⊆ Matn×m (Fq ) be a rank-metric code. Then C is both MRD and
an optimal anticode if and only if C = 0 or C = Matn×m (Fq ).
20 E. GORLA

A similar result can be obtained for dually quasi-MRD codes. It follows from [3,
Corollary 18] that the dimension of a dually quasi-MRD code C ⊆ Matn×m (Fq ) is not
divisible by max{m, n}. Therefore, in the next result we make this assumption without
loss of generality.
Corollary 5.24 ([3], Theorem 22). Let C ⊆ Matn×m (Fq ) be a rank-metric code of dimen-
sion dim(C) = ℓ = k · max{m, n} + r, with k ≥ 0 and 0 < r < max{m, n}. The following
are equivalent:
• C is dually quasi-MRD,
• d1 (C) = min{m, n} − k and dr+1(C) = min{m, n} + 1 − k.
Moreover, if C is dually quasi-MRD, then its generalized weights are:
d1 (C) = · · · = dr (C) = min{m, n} − k,
dr+1+i·max{m,n} (C) = · · · = dr+(i+1) max{m,n} (C) = min{m, n} + 1 + i − k for i = 0, . . . , k − 2,
dr+1+(k−1) max{m,n} (C) = · · · = dℓ (C) = min{m, n}.

We already observed that, while there is no easy relation between the minimum
distance of C and C ⊥ , the weight distribution of C determines the weight distribution of
C ⊥ . The next result shows that the generalized weights of C determine the generalized
weights of C ⊥ .
Theorem 5.25 ([22], Corollary 38). Let C ⊆ Matn×m (Fq ) be a rank-metric code of di-
mension dim(C) = ℓ. Define the sets
Wi (C) = {di+j·max{m,n} (C) | j ≥ 0, 1 ≤ i + j · max{m, n} ≤ ℓ}
and
W i (C) = {min{m, n} + 1 − di+j·max{m,n} (C) | j ≥ 0, 1 ≤ i + j · max{m, n} ≤ ℓ}.
Then
Wi (C ⊥ ) = {1, . . . , min{m, n}} \ W i+ℓ (C)
for i = 1, . . . , max{m, n}.

6. q-polymatroids and code invariants

q-polymatroids are the q-analog of polymatroids. In this section we associate to


every rank-metric code a q-polymatroid for m 6= n and a pair of q-polymatroids for
m = n. We then discuss how several invariants and structural properties of codes, such
as generalized weights, the property of being MRD or an optimal anticode, and duality,
are captured by the associated q-polymatroids. The material of this section is contained
in [26, 10], but the presentation we give differs at times from the original papers.
We start by giving the definition of a q-matroid, the q-analog of a matroid.
Definition 6.1 ([16], Definition 2.1). A q-matroid is a pair P = (Fℓq , ρ) where ρ is a
function from the set of all subspaces of Fℓq to Z such that, for all U, V ⊆ Fℓq :

(P1) 0 ≤ ρ(V ) ≤ dim(V ),


RANK-METRIC CODES 21

(P2) if U ⊆ V , then ρ(U) ≤ ρ(V ),


(P3) ρ(U + V ) + ρ(U ∩ V ) ≤ ρ(U) + ρ(V ).

q-polymatroids were defined independently by Shiromoto in [26] and by Gorla, Ju-


rrius, Lopez, and Ravagnani in [10]. The two definitions are essentially equivalent. Here
we follow the approach of [10].
Definition 6.2 ([10], Definition 4.1). A q-polymatroid is a pair P = (Fℓq , ρ) where ρ is
a function from the set of all subspaces of Fℓq to R such that, for all U, V ⊆ Fℓq :

(P1) 0 ≤ ρ(V ) ≤ dim(V ),


(P2) if U ⊆ V , then ρ(U) ≤ ρ(V ),
(P3) ρ(U + V ) + ρ(U ∩ V ) ≤ ρ(U) + ρ(V ).

Definition 6.2 is a direct q-analogue of the definition of an ordinary polymatroid,


with the extra property that ρ(V ) ≤ dim(V ) for all V ⊆ Fℓq . As in the ordinary case, a
q-matroid is a q-polymatroid.
Remark 6.3. Definition 6.2 is slightly different from the definition of (q, r)-polymatroid
given by Shiromoto in [26, Definition 2]. However, a (q, r)-polymatroid (E, ρ) as de-
fined by Shiromoto corresponds to the q-polymatroid (E, ρ/r) according to Definition 6.2.
Moreover, a q-polymatroid whose rank function takes values in Q corresponds to a (q, r)-
polymatroid as defined by Shiromoto up to multiplying the rank function by an r which
clears denominators.

We now give two simple examples of q-matroids.


Example 6.4. The pair (Fℓq , dim(·)) is a q-matroid, where dim(·) denotes the function
that associates to a vector space its dimension.
Example 6.5. For a fixed U ⊆ Fℓq , let
ρU (V ) = dim(V ) − dim(V ∩ U ⊥ )
for V ⊆ Fℓq . The pair (Fℓq , ρU ) is a q-matroid.

One has the following natural notion of equivalence for q-polymatroids.


Definition 6.6 ([10], Definition 4.4). Let (Fℓq , ρ1 ) and (Fℓq , ρ2 ) be q-polymatroids. We say
that (Fℓq , ρ1 ) and (Fℓq , ρ2 ) are equivalent if there exists an Fq -linear isomorphism ϕ : Fℓq →
Fℓq such that ρ1 (V ) = ρ2 (ϕ(V )) for all V ⊆ Fℓq . In this case we write (Fℓq , ρ1 ) ∼ (Fℓq , ρ2 ).

The following is the natural notion of duality for q-polymatroids.


Definition 6.7 ([10], Definition 4.5). Let P = (Fℓq , ρ) be a q-polymatroid. For all sub-
spaces V ⊆ Fℓq define
ρ∗ (V ) = dim(V ) − ρ(Fℓq ) + ρ(V ⊥ ),
where V ⊥ is the dual of V with respect to the standard inner product on Fℓq . We call
P ∗ = (Fℓq , ρ∗ ) the dual of the q-polymatroid P .
22 E. GORLA

It is easy to show that P ∗ is indeed a q-polymatroid. The dual of a q-polymatroid


satisfies the usual properties for a dual. Moreover, duality is compatible with equivalence.
Theorem 6.8 ([10], Theorem 4.6 and Proposition 4.7). Let P, Q be q-polymatroids. Then:
• P ∗ is a q-polymatroid.
• P ∗∗ = P .
• If P ∼ Q, then P ∗ ∼ Q∗ .

One can associate q-polymatroids to rank-metric codes as follows. In [10, Theo-


rem 5.4] it is shown that these are indeed q-polymatroids according to Definition 6.2.
Definition 6.9 ([10], Notation 5.3). Let C ⊆ Matn×m (Fq ) be a rank-metric code, and let
min{m,n}
V ⊆ Fq . Define
1
ρC (V ) = (dim(C) − dim(C(V ⊥ )) ∈ Q.
max{m, n}
 
min{m,n}
If m 6= n, we associate to C the q-polymatroid P (C) = Fq , ρC .
If m = n, we associate to C the pair of q-polymatroids P (C) = (Fnq , ρC ), P (C T ) = (Fnq , ρC T ).

Notice that this is slightly different from what is done in [10], where a pair of q-
polymatroids is associated to each rank-metric code. In this chapter, we choose to present
the material of [10] differently, in order to stress the following facts (stated following the
notation [10, Notation 5.3]):
• for n < m the q-polymatroid that contains all the relevant information on C is
(Fnq , ρc (C, ·)),
• for n > m the q-polymatroid that contains all the relevant information on C is
(Fmq , ρr (C, ·)),
• for n = m one needs to consider both (Fnq , ρc (C, ·)) and (Fnq , ρr (C, ·)), at least if
one wishes to have the property that equivalent codes have equivalent associated
q-polymatroids.
Remark 6.10. In [26, Proposition 3], Shiromoto associates a (q, m)-polymatroid to any
rank-metric code with n ≤ m. If n < m, his definition is equivalent to Definition 6.9, given
what we observed in Remark 6.3. For n = m, Shiromoto’s definition is not equivalent to
Definition 6.9; in particular it is not equivalence-invariant (while Definition 6.9 is). Notice
moreover that the original definition by Shiromoto does not contain the assumption that
n ≤ m. However, this hypothesis is used implicitly throughout his paper. Whenever
stating the results from [26], we always add the assumption n ≤ m.

The code of [10, Example 2.10] shows that the definition of an associated (q, n)-
polymatroid given by Shiromoto for a rank-metric code C ⊆ Matn×n (Fq ) is not equivalence-
invariant.
Example 6.11. Let C ⊆ Mat2×2 (F2 ) be the code
  
a a
C := | a, b ∈ F2 .
b b
RANK-METRIC CODES 23

Let (F22 , ρ1 ) and (F22 , ρ2 ) be the (q, 2)-polymatroids associated to C and C T respectively,
according to [26, Proposition 3]. By definition, for any V ⊆ F22
ρ1 (V ) = 2 − dim(C(V ⊥ )) = dim(V )
and 
T ⊥ dim(V ) if V = 0, h(1, 1)i, F22,
ρ2 (V ) = 2 − dim(C (V )) =
2 if V = h(1, 0)i, h(0, 1)i.
The natural notion of equivalence for (q, r)-polymatroids is the following: (Fℓq , ρ1 ) and
(Fℓq , ρ2 ) are equivalent if there exists an Fq -linear isomorphism ϕ : Fℓq → Fℓq such that
ρ1 (V ) = ρ2 (ϕ(V )) for all V ⊆ Fℓq . Clearly (F22 , ρ1 ) and (F22 , ρ2 ) are not equivalent with
respect to such a notion of equivalence.

The interest in associating q-polymatroids to rank-metric codes comes from the


fact that many invariants of rank-metric codes can be computed from the associated
q-polymatroids. In fact, one could think of (equivalence classes of) q-polymatroids as
invariants of the rank-metric codes to which they are associated, since equivalent codes
are associated to equivalent q-polymatroids.
Proposition 6.12 ([10], Proposition 6.8). Let C, D ⊆ Matn×m (Fq ) be rank-metric codes.
Assume that C ∼ D. If m 6= n, then P (C) ∼ P (D). If n = m, then one of the following
holds:

• P (C) ∼ P (D) and P (C T ) ∼ P (D T),


• P (C) ∼ P (D T) and P (C T ) ∼ P (D).

One can also show that the q-polymatroid(s) associated to the rank-metric code
Γ(C) associated to a vector rank-metric code C ⊆ Fnqm do not depend on the choice of
the basis Γ.
Proposition 6.13 ([16], Corollary 4.7 and [10], Proposition 6.10). Let C ⊆ Fnqm be a
vector rank-metric code, and let Γ, Γ′ be Fq -bases of Fqm . Then
P (Γ(C)) ∼ P (Γ′ (C)).

In the rest of this section, we discuss how to recover various invariants of rank-metric
codes from the associated q-polymatroids. We start with the simplest invariants, namely
the dimension and the minimum distance.
Proposition 6.14 ([10], Proposition 6.1 and Corollary 6.3). Let C ⊆ Matn×m (Fq ) be a
rank-metric code. Then
dim(C) = max{m, n} · ρC Fmin{m,n}

q

and
dmin(C) = min{m, n} + 1 − δ
where
 
dim(C)
δ = min k ρC (V ) = for all V ⊆ Fmin{m,n}
q with dim(V ) = k .
max{m, n}
24 E. GORLA

The next results shows how one can compute the generalized weights of a rank-
metric codes from its associated q-polymatroid(s).
Theorem 6.15 ([10], Theorem 7.1). Let C ⊆ Matn×m (Fq ) be a rank-metric code. Let
di (P (C)) = min{m, n} − max{dim(V ) | V ⊆ Fmin{m,n}
q , dim(C) − max{m, n} · ρC (V ) ≥ i},
i = 1, . . . , dim(C).
If n 6= m, then
di (C) = di (P (C)) for i = 1, . . . , dim(C).
If n = m, then
di (C) = min{di (P (C)), di (P (C T ))} for i = 1, . . . , dim(C).

The associated q-polymatroid(s) also determine the weight distribution of a rank-


metric code. The result is stated in terms of the weight enumerator of the code.
Definition 6.16. Let C ⊆ Matn×m (Fq ) be a rank-metric code. The weight enumerator
of C is the polynomial
min{m,n}
X
WC (x, y) = Ai (C)xi y min{m,n}−i .
i=0

The next theorem was proved by Shiromoto.


Theorem 6.17 ([26], Theorem 14). Let C ⊆ Matn×m (Fq ) be a rank-metric code of di-
mension dim(C) = ℓ. Assume that n ≤ m. Then
 
dim(V )−1
m ρC (Fn
X Y
n−ℓ/m  )−ρ (V ) −(dim(V )−ρ (V ))
WC (x, y) = x (q x) q C
x C  (y − q i x).
V ⊆Fn
q i=0

Finally, we state two results that show that the property of being MRD or an optimal
anticode can be characterized in terms of the associated q-polymatroid(s).
Theorem 6.18 ([10], Theorem 6.4 and Corollary 6.6). Let C ⊆ Matn×m (Fq ) be a rank-
metric code with minimum distance dmin (C) = d. The following are equivalent:
• C is MRD,
min{m,n}
• ρC (V ) = dim(V ) for all V ⊆ Fq with dim(V ) ≤ min{m, n} − d + 1,
min{m,n}
• ρC (V ) = dim(V ) for some V ⊆ Fq with dim(V ) = min{m, n} − d + 1.
 
min{m,n}
In particular, if C is MRD with minimum distance dmin (C) = d, then P (C) = Fq , ρC
where 
min{m, n} − d + 1 if dim(V ) ≥ min{m, n} − d + 1,
ρC (V ) =
dim(V ) if dim(V ) ≤ min{m, n} − d + 1.

The corresponding result for optimal anticodes is the following. Notice that the
q-polymatroids associated to MRD codes or optimal anticodes are in fact q-matroids.
RANK-METRIC CODES 25

Theorem 6.19 ([10], Theorem 7.2 and Corollary 6.6). Let C ⊆ Matn×m (Fq ) be a rank-
metric code with r = max rk(C). The following are equivalent:

• n
C is an optimal anticode,o
min{m,n} 
• ρC (V ) | V ⊆ Fq = {0, 1, . . . , r}, or ρC T (V ) | V ⊆ Fnq = {0, 1, . . . , r}
and m = n, 
min{m,n}
• ρC Fq = r, or ρC T (Fnq ) = r and m = n.

In particular, if C is an optimal anticode with r = max rk(C), let


ρ(V ) = dim(V + he1 , . . . , emin{m,n}−r i) − (min{m, n} − r),
min{m,n}
where ei denotes the i-th vector of the standard basis of Fq .
min{m,n}
If m 6= n, then P (C) ∼ (Fq , ρ).
If m = n, then either P (C) ∼ (Fnq , ρ) or P (C T ) ∼ (Fnq , ρ).

We conclude with a result on associated q-polymatroids and duality. The theorem


as we state it was proved by Gorla, Jurrius, López, and Ravagnani in [10, Theorem 8.1
and Corollary 8.2]. Shiromoto also proved in [26, Proposition 11] that P (C)∗ = P (C ⊥ ) for
a rank-metric code C ⊆ Matn×m (Fq ) with n ≤ m.
Theorem 6.20. Let C ⊆ Matn×m (Fq ) be a rank-metric code and let C ⊆ Fnqm be a vector
rank-metric code. Let Γ be a basis of Fqm over Fq . Then
P (C)∗ = P (C ⊥ ) and P (Γ(C))∗ ∼ P (Γ(C ⊥ )).

References
1. A. Barra and H. Gluesing-Luerssen, MacWilliams Extension Theorems and the Local-Global Property
for Codes over Frobenius Rings, Journal of Pure and Applied Algebra 219 (2015), 703–728.
2. T.P. Berger, Isometries for rank distance and permutation group of Gabidulin codes, IEEE Transac-
tions on Information Theory 49 (2002), no. 11, 3016–3019.
3. J. De La Cruz, E. Gorla, H. Lopez, and A. Ravagnani, Weight distribution of rank-metric codes, Des.
Codes Cryptogr. 86 (2018), no. 1, 1–16.
4. J. de la Cruz, M. Kiermaier, A. Wassermann, and W. Willems, Algebraic structures of MRD codes,
preprint available at https://arxiv.org/abs/1502.02711v1.
5. C. de Seguins Pazzis, The classification of large spaces of matrices with bounded rank, Isr. J. Math.
208 (2015), no. 1, 219–259.
6. P. Delsarte, Bilinear forms over a finite field, with applications to coding theory, J. Combin. Theory
Ser. A 25 (1978), 226–241.
7. J. Ducoat, Generalized rank weights: A duality statement, Topics in Finite Fields (G. Kyureghyan,
G. Mullen, and A. Pott, eds.), Contemporary Mathematics, vol. 632, American Mathematical Society,
2015, pp. 101–109.
8. È. M. Gabidulin, Theory of Codes with Maximum Rank Distance, Probl. Peredachi Inf. 21 (1985),
no. 1, 3–16.
9. M. Gadouleau and Z. Yan, MacWilliams identities for the rank metric, IEEE International Sympo-
sium on Information Theory Proceedings, 2007, pp. 36–40.
10. E. Gorla, R. Jurrius, H. H. López, and A. Ravagnani, Rank-metric codes and q-polymatroids, preprint,
2018.
26 E. GORLA

11. E. Gorla and A. Ravagnani, Codes endowed with the rank metric, ch. 1, pp. 3–23, Springer, 2018.
12. T. Helleseth, T. Kløve, and J. Mykkeltveit, The weight distribution of irreducible cyclic codes with
block lengths n1 ((q ℓ − 1)/n), Discrete Math. 18 (1977), 179–211.
13. L.K. Hua, A theorem on matrices over a sfield and its applications, Acta Mathematica Sinica 1
(1951), 109–163.
14. M. Hall Jr., Combinatorial theory, Blaisdell Publishing Company, 1967.
15. R. Jurrius and R. Pellikaan, On defining generalized rank weights, Advances in Mathematics of
Communications 11 (2017), 225–235.
16. , Defining the q-analogue of a matroid, Electron. J. Combin. 25 (2018), no. 3.
17. D. König, Graphok és matrixok, Mat. Fiz. Lapok 38 (1931), 115–119.
18. J. Kurihara, R. Matsumoto, and T. Uyematsu, Relative Generalized Rank Weight of Linear Codes
and Its Applications to Network Coding, IEEE Trans. Inform. Theory 61 (2015), no. 7, 3912–3936.
19. U. Martı́nez-Peñas and R. Matsumoto, Relative Generalized Matrix Weights of Matrix Codes for
Universal Security on Wire-Tap Networks, IEEE Transactions on Information Theory 64 (2018),
no. 4, 2529–2549.
20. R. Meshulam, On the maximal rank in a subspace of matrices, The Quarterly Journal of Mathematics
36 (1985), no. 2, 225–229.
21. F. Oggier and A. Sboui, On the existence of generalized rank weights, 2012 International Symposium
on Information Theory and its Applications, 2012, pp. 406–410.
22. A. Ravagnani, Generalized weights: an anticode approach, J. Pure Appl. Alg. 220 (2016), no. 5,
1946–1962.
23. , Rank-metric codes and their duality theory, Des. Codes Cryptogr. 80 (2016), no. 1, 197–216.
24. , Duality of codes supported on regular lattices, with an application to enumerative combina-
torics, Des. Codes Cryptogr. 86 (2018), no. 9, 2035–2063.
25. R. M. Roth, Maximum-rank array codes and their application to criss-cross error correction, IEEE
Trans. Inform. Theory 37 (1991), no. 2, 328–336.
26. K. Shiromoto, Matroids and codes with the rank metric, preprint, 2018.
27. Z. X. Wan, A proof of the automorphisms of linear groups over a sfield of characteristic 2, Scientia
Sinica 11 (1962), 1183–1194.
28. V. K. Wei, Generalized Hamming weights for linear codes, IEEE Trans. Inform. Theory 37 (1991),
no. 5, 1412–1418.

Institut de Mathématiques, Université de Neuchâtel, Rue Emile-Argand 11, 2000


Neuchâtel, Switzerland
E-mail address: [email protected]

You might also like