Rank-Metric Codes: Definitions, Isometries, and Equivalence of Codes
Rank-Metric Codes: Definitions, Isometries, and Equivalence of Codes
E. GORLA
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 .
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
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 .
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 ).
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 .
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
and let
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
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.
C(V ) = {M ∈ C | supp(M) ⊆ V }.
6 E. GORLA
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.
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.
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:
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 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:
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
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:
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 ⊥ ).
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
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
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
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).
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
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.
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
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
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
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:
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, . . . , ℓ.
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}.
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.
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).
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.
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.