The Average Dimension of the Hermitian Hull of Constayclic Codes over Finite Fields

The hulls of linear and cyclic codes have been extensively studied due to their wide applications. In this paper, the average dimension of the Hermitian hull of constacyclic codes of length $n$ over a finite field $\mathbb{F}_{q^2}$ is determined together with some upper and lower bounds. It turns out that either the average dimension of the Hermitian hull of constacyclic codes of length $n$ over $\mathbb{F}_{q^2}$ is zero or it grows the same rate as $n$. Comparison to the average dimension of the Euclidean hull of cyclic codes is discussed as well.


INTRODUCTION
The (Euclidean) hull of a linear code has been introduced to classify finite projective planes in [1].It is defined to be the intersection of a linear code and its Euclidean dual.Later, it turns out that the hulls of linear codes play a vital role in determining the complexity of algorithms for checking permutation equivalence of two linear codes in [8,13,14].Subsequently, it has been shown that the hull is an indicator for the complexity of algorithms for computing the automorphism group of a linear code in [5,12].Precisely, most of the algorithms do not work if the size of the hull is large.Recently, the hulls of linear codes have been applied in constructing good entanglement-assisted quantum error correcting codes in [4].Due to these wide applications, the hulls of linear codes and their properties have been extensively studied.The number of linear codes of length n over F q whose hulls have a common dimension and the average dimension of the hull of linear codes were studied in [11].It has been shown that the average dimension of the hull of linear codes is asymptotically a positive constant dependent of q.
Constacyclic codes constitute an important class of linear codes due to their nice algebraic structures and various applications in engineering [2] and [3].Especially, this family of codes contains a class of well-studied cyclic codes.In [9], the number of cyclic codes of length n over F q having hull of a fixed dimension has been determined together with the dimensions of the hulls of cyclic codes of length n over F q .The average dimension of the hull of cyclic codes with respect to the Euclidean and Hermitian inner products have been investigated in [15] and [7], respectively.It has been shown that either the average dimension of the hull of such codes is zero or it grows at the same rate with n.In [10], the dimensions of the Hermitian hulls of constacyclic codes of length n over F q 2 have been determined.However, in the literature, the average dimension of the Hermitian hull of constacyclic codes has not been studied.Therefore, it is of natural interest to study the average dimension of the Hermitian hull of constacyclic codes.
In this paper, we focus on the average dimension of the Hermitian hull of constacyclic codes.Employ the techniques modified from [10] and [15], a general formula for the average dimension of the Hermitian hull of constacyclic codes of length n over F q 2 is determined.Asymptotically, either the average dimension of the Hermitian hull of constacyclic codes is zero or it grows at the same rate with n.This result coincides with the case of the average dimension of the Euclidean hull of cyclic codes.However, there are interesting differences on lower bounds discussed in Section 6.
The paper is organized as follows.In Section 2, some basic knowledge concerning polynomials and codes over finite fields are recalled.A general formula for the average dimension of the Hermitian hull of constacyclic codes is given in Section 3. In Section 4, some number theoretical tools are discussed together with a simplified formula for the average dimension of the Hermitian hull of constacyclic codes.Lower and upper bounds for the average dimension of the Hermitian hull of constacyclic codes are studied in Section 5.The summary and remarks are given in Section 6.

PRELIMINARIES
The main focus of this paper is the average dimension of the Hermitian hull of constacyclic codes which is well-defined only over a finite field of square order (see Equation ( 1)).In this section, some basic properties of codes and polynomials over such finite fields.
For convenience, let p be a prime, q be a p-power integer and let F q 2 denote a finite field of order q 2 and characteristic p.For a given positive integer n, let F n q 2 denote the F q 2 -vector space of all vectors of length n over F q 2 .For 0 ≤ k ≤ n, a linear code of length n and dimension k over F q 2 is defined to be a k-dimensional subspace of the F q 2 -vector space F n q 2 .The Hermitian dual of a linear code C is defined to be the set The Hermitian hull of a linear code C is defined to be For a fixed nonzero element λ in F q 2 , a linear code of length n over F q 2 is said to be constacyclic, or specifically, λ-constacyclic if (λc n−1 , c 1 , . . ., c n−2 ) ∈ C whenever (c 0 , c 1 , . . ., c n−1 ) ∈ C. Every λ-constacyclic code C of length n over F q 2 can be identified by an ideal in the principal ideal ring F q 2 [x]/ x n − λ uniquely generated by a monic divisor of x n − λ.In this case, In this case, g(x) is called the generator polynomial for C and we have dim C = n − deg(g(x).
Denote by r the order of an element λ in the multiplication group F * q 2 := F q 2 \ {0}.In [16,Proposition 2.3], it has been shown that the Hermitian dual of a λconstacyclic code over F q 2 is again λ-constacyclic if and only if r|(q + 1).Based on this characterization, we assume that λ is an element in F q 2 of order r such that r|(q + 1) throughout the paper.
Let C be a λ-constacyclic code of length n over F q 2 with the generator polynomial g(x) and let h(x) = x n −λ g(x) .Then h † (x) is a monic divisor of x n − λ and it is the generator polynomial of C ⊥ H (see [16,Lemma 2.1]).By [9, Theorem 1], the hull Hull H (C) of C is generated by the polynomial lcm(g(x), h † (x)).Let C(n, λ, q 2 ) denote the set of all λ-constacyclic codes of length n over F q 2 .The average dimension of the Hermitian hull of λ-constacyclic codes of length n over F q 2 is defined to be For each positive integer n, it can be written in the form of n = np ν , where p ∤ n and ν ≥ 0. Since the map α → α p ν is an automorphism on F q 2 , there exists an element Λ ∈ F q 2 such that Λ p ν = λ and the multiplicative order of Λ is r.Using arguments similar to those in [10, Section 3], up to permutation, there exist nonnegative integers s and t such that where f j (x) and f † j (x) are a conjugate-reciprocal polynomial pair and g i (x) is a monic irreducible self-conjugate-reciprocal polynomial for all 1 ≤ i ≤ s and 1 ≤ j ≤ t.
Based on the factorization in Equation ( 2), the generator polynomial of a λconstacyclic code C of length n over F q 2 can be viewed of the form where 0 ≤ u i , z j , w j ≤ p ν .It follows that the generator polynomial of and hence, the generator polynomial of Hull It follows that

The Average Dimension
In this section, a general formula for the average dimension E H (n, λ, q 2 ) of the Hermitian hull of λ-constacyclic codes of length n over F q 2 is given together with some upper bounds.
Assume that x n − Λ has the factorization in the form of Equation ( 2) and let ).The formula for the average dimension of the Hermitian hull of constacyclic codes can be determined using the expectation E( • ) in Probability Theory as follows.
Lemma 3.1.Let p be a prime and let ν be a nonnegative integer.Let 0 ≤ u, z, w ≤ p ν .Then the following statements hold.

E(max{z, p
Proof.The statements can be obtained using arguments similar to those in the proof of [15,Theorem 23]. Theorem 3.2.Let F q 2 be a finite field of order q 2 and characteristic p and let n be a positive integer such that n = np ν , p ∤ n and ν ≥ 0. Let λ be an element in F q 2 of order r such that r|(q + 1).Then the average dimension of the Hermitian hull of λ-constacyclic codes of length n over Proof.Let Y be the random variable of the dimension dim Hull H (C), where C is chosen randomly from C(n, λ, q 2 ) with uniform probability.By Lemma 3.1, Equation ( 4), and arguments similar to those in the proof of [7, Theorem 3.2], we obtain The proof is therefore completed.
The following corollary is straightforward from Theorem 3.2.
Corollary 3.3.Assume the notations as in Theorem 3.2.Then the following statements hold.

Properties of B H n,λ,q 2
In this section, some properties of B H n,λ,q 2 are given as well as their applications in determining a simplified formula for E H (n, λ, q 2 ).
For each positive integer j such that gcd( j, q) = 1, denote by ord j (q) the multiplicative order of q modulo j.
The formula for B H n,λ,q 2 can be simplify using the sets M q and χ as follows.
Altogether, it can be concluded that Hence, as desired.
Remark 4.2.From Lemma 4.1, we have the following facts.
1.If λ = 1, then B H n,1,q 2 is alway positive since 1 ∈ χ ∩ M q .2. If λ 1, then χ ∩ M q can be empty.In this case, B H n,λ,q 2 = 0.For example, B H 4,2,9 = 0 since χ ∩ M 3 = ∅.Recall that λ is an element in F q 2 of order r such that r|(q + 1).Assume that the prime factorization of gcd(n, r) is of the form gcd(n, r) = 2 c 0 p c 1 1 . . .p c s s for some s ≥ 0, where p 1 , p 2 , . . ., p s are distinct odd primes, c 0 ≥ 0 and c i ≥ 1 for all 1 ≤ i ≤ s.Then n and r can be factorized in the forms of where β(n) ≥ c 0 and β(r) ≥ c 0 are integers, µ and τ are odd (not necessarily prime) integers relative prime to p i for all 1 ≤ i ≤ s, a i and b i are positive integers.
Based on the factorizations above, the presentation of the set χ can be simplified as follows.
Lemma 4.3.Let n and r be positive integers and let χ be defined as in Equation (6).Then Proof.Consider the following 2 cases.Case 1 r is even.We have χ = j ≥ 1 j|nr and gcd nr j , r = 1 Case 2 r is odd.We have Combining the two cases, the result follows.
For integers i ≥ 0 and j ≥ 1, we say that 2 i exactly divides j, denoted by 2 i || j, if 2 i divides j but 2 i+1 does not divide j.
From [6, Corollary 3.7] and its proof, we have the following proposition.
Proposition 4.4.Let q be a prime power and let ℓ = 2 β ℓ be a positive integer such that ℓ is odd and β ≥ 0. Let γ ≥ 0 be an integer such that 2 γ ||(q + 1).If ℓ ∈ M q , then one of the following statements holds.
3. ℓ > 2 and one of the following statements holds.
The necessary and sufficient conditions for B H n,λ,q 2 to be non-zero are given as follows.
To prove 1), assume that r is even.Suppose that B H n,λ,q 2 0. Then χ ∩ M q ∅.Let j be an element in χ ∩ M q .By Equations ( 8) and ( 9), we have for some k|µ.Since j ∈ M q , we have β(n) + β(r) ≤ γ and r ∈ M q by Proposition 4.4.
Conversely, assume that β(n) + β(r) ≤ γ and r ∈ M q .By setting k = 1, we have since r is even.To prove 2), assume that r is odd.Assume that B H n,λ,q 2 0. Then χ ∩ M q ∅.Let j be an element in χ ∩ M q .Then for some k|2 β(n) µ by Equations ( 10) and (11).Since j ∈ M q and r| j, we have r ∈ M q by Proposition 4.4.Conversely, assume that r ∈ M q .By setting k = 1, we have since r is odd.
The next lemma can be deduced form Lemma 4.5.
2. If r is odd, then B n,λ,q 2 = 0 if and only if r M q .
In the case where B n,λ,q 2 = 0, the average dimension E H (n, λ, q 2 ) can be simplified from Theorem 3.2 and Corollary 4.6 as follows.
Corollary 4.7.Let q be a power of a prime p and let n ≥ 1.Then the following statements holds.
Let ℓ be a positive integer relatively prime to q.Let ℓ = 2 β p e 1 1 . . .p e k k be the prime factorization of ℓ where e i ≥ 1, β ≥ 0 and k ≥ 0. Let K ′ := {i|p i M q } and K 1 := {i|p i ∈ M q }.Then K ′ and K 1 form a partition of {1, . . ., k}.
For convenience, the empty product will be regards as 1.We therefore have ℓ = 2 β(ℓ) d ′ (ℓ)d 1 (ℓ) and it is called the M q -factorization of ℓ.
From Corollary 4.6, if r M q , then B n,λ,q 2 = 0. Next, the expression of B H n,λ,q 2 when r ∈ M q is determined using properties of set M q and the expression of χ in the following proposition.By Proposition 4.4, r is of the form r = 2 β(r) d 1 (r).Since r|(q + 1), we have 2 β(r) |(q + 1).
be the M q -factorizations of n and r.Then one of the following statements holds.
. By Lemma 4.1, it can be concluded that Case 2 gcd(n, r) 1. Recall that n = 2 β(n) s i=1 p a i i µ and r = 2 β(r) s i=1 p b i i τ are factorizations of n and r as in Equation (7).By Lemma 4.3, we have Next, assume that r is odd and r ∈ M q .Then r = s i=1 p b i i τ = d 1 (r).By Lemma 4.3, we have as desired.
By Lemma 4.5 and Proposition 4.8, we obtain the following corollary.

Bounds on E H (n, λ, q 2 )
In this section, we focus on upper and lower bounds of E H (n, λ, q 2 ).Based on this bounds, it can be concluded that either E H (n, λ, q 2 ) is 0 or it grows at the same rate with n as n tends to infinity.Theorem 5.1.Let q be a prime power and 2 γ ||(q + 1).Let n = np ν , where p ∤ n and ν ≥ 0. Let λ ∈ F * q 2 be such that the multiplicative order of λ is r and r|(q + 1).Then one of the following statements holds.
It follows that and hence, B H n,λ,q 2 = n d ′ (n) .Therefore, Altogether, it can be concluded that n 6 ≤ E H (n, λ, q 2 ).(b): Assume that β(n) + β(r) > γ or r M q .By Corollary 4.7, we have To prove 3), assume that r is odd.(a): Assume that r ∈ M q and n M q .Case 1 gcd(n, q) 1.Similar to the prove of Case 1 in 2), we have Since n M q , we consider the following 2 cases.Case 2.1 d ′ (n) = 1 and β(n) > γ.We have From Cases 2.1 and 2.2, we get B H n,q 2 ≤ n 2 which implies that Consequently, we have n 8 ≤ E H (n, λ, q 2 ).(b): Assume that r M q .By Corollary 4.7, we have The proof is completed.
Remark 5.2.Assume the notations as in Theorem 5.1.If n ∈ M q , then n ∈ M q by Proposition 4.4 which implies that β(n) ≤ γ.In the case where r is odd, we have β(r) = 0 which implies that β(n) + β(r) = β(n) ≤ γ.Hence, if r is odd, it can be concluded that E H (n, λ, q 2 ) = 0 if and only if r, n ∈ M q .
From Theorem 5.1, it can be concluded that either E H (n, λ, q 2 ) = 0 or it grows at the same rate with n as n tends to infinity.

Conclusion and Remarks
For an element λ in F q 2 of order r such that r|(q + 1), a general formula for the average dimension E H (n, λ, q 2 ) of the hull of λ-constacyclic codes has been given in Theorem 3.2 and as well as its lower and upper bounds in Theorem 5.1.Asymptotically, either the average dimension of the Hermitian hull of constacyclic codes is zero or it grows at the same rate with n.
Let E(n, q) denote the average dimension of the Euclidean hull of cyclic codes of length n over F q and let N q := {ℓ ≥ 1|ℓ divides q i +1 for some positive integer i}.In [15,Theorem 25], it has been shown that E(n, q) = 0 if and only if n ∈ N q , and n 12 ≤ E(n, q) < n 3 otherwise.This means that either the average dimension of the Euclidean hull of cyclic codes is zero or it grows at the same rate with n.This result coincides the result for Hermitian case in this paper.However, there are interesting difference on lower bounds explained in Table 1.
Order of λ n LB UB Remarks r is odd r ∈ M q and n ∈ M q 0 0 Remark 5.2 and r|(q + 1).r ∈ M q and n M q n 8 n 3 Theorem 5.1 r M q n 4 n 3 r is even β(n) + β(r) ≤ γ, 0 0 Theorem 5.1 r ∈ M q and n ∈ M q β(n) + β(r) ≤ γ, n 6 n 3 and r|(q + 1).r ∈ M q and n M q β(n) + β(r) > γ n 4 n 3 or r M q

Table 1 :
The lower and upper bounds for E H (n, λ, q 2 )