Constacyclic and Quasi-Twisted Hermitian Self-Dual Codes over Finite Fields

Constacyclic and quasi-twisted Hermitian self-dual codes over finite fields are studied. An algorithm for factorizing $x^n-\lambda$ over $\mathbb{F}_{q^2}$ is given, where $\lambda$ is a unit in $\mathbb{F}_{q^2}$. Based on this factorization, the dimensions of the Hermitian hulls of $\lambda$-constacyclic codes of length $n$ over $\mathbb{F}_{q^2}$ are determined. The characterization and enumeration of constacyclic Hermitian self-dual (resp., complementary dual) codes of length $n$ over $\mathbb{F}_{q^2}$ are given through their Hermitian hulls. Subsequently, a new family of MDS constacyclic Hermitian self-dual codes over $\mathbb{F}_{q^2}$ is introduced. As a generalization of constacyclic codes, quasi-twisted Hermitian self-dual codes are studied. Using the factorization of $x^n-\lambda$ and the Chinese Remainder Theorem, quasi-twisted codes can be viewed as a product of linear codes of shorter length some over extension fields of $\mathbb{F}_{q^2}$. Necessary and sufficient conditions for quasi-twisted codes to be Hermitian self-dual are given. The enumeration of such self-dual codes is determined as well.


Introduction
Quasi-twisted (QT) codes, introduced in [4], play an important role in coding theory since they contain remarkable classes of codes such as quasi-cyclic (QC) codes, constacyclic codes, and cyclic codes. In [8], [15] and [20], it has been shown that QT and QC codes meet a modified version of the Gilbert-Vashamov bound. Various codes with good parameters and some optimal codes over finite fields have been obtained from the classes of QT and QC codes (see [9], [1], [5] and [2]). Moreover, there is a link between QC codes and convolution codes in [11] and [28].
Self-dual codes are another interesting class of codes due to their fascinating links to other objects and their wide applications [23] and [25]. Both Euclidean and Hermitian self-dual codes are also closely related to quantum stabilizer codes [16]. In [19], [21], [22] and [12], QT and QC codes have been decomposed into a product of linear codes of shorter length and the Euclidean duals of such codes have been determined via this decomposition. Consequently, the characterization of QT and QC Euclidean self-dual codes have been given. In some cases, the enumeration of such codes has been established as well.
To the best of our knowledge, only few works have been done on Hermitian duals of constacyclic and QT codes. In [29], a characterization of Hermitian duals of constacyclic Hermitian self-dual codes has been established but not an enumeration. It is therefore of natural interest to characterize and enumerate constacyclic and QT codes with Hermitian self-duality.
Our goal is to study constacyclic and QT codes and their duals with respect to the Hermitian inner product which are defined over a finite field whose cardinality is square. Throughout the paper, we are therefore assume that the cardinality of a field is square and the notation F q 2 will be used.
For a nonzero λ ∈ F q 2 , let o q 2 (λ) denote the order of λ in the multiplicative group F × q 2 := F q 2 {0}. In [29,Proposition 2.3], it has been shown that the Hermitian dual of a λ-constacyclic code is also λ-constacyclic if and only if o q 2 (λ)|(q+1). Later, in Proposition 6.2, we show that the Hermitian dual of a (λ, ℓ)-QT code over F q 2 is again (λ, ℓ)-QT if and only if o q 2 (λ)|(q + 1). To study constacyclic and QT Hermitian self-dual codes, it suffices to restrict the study to the case where o q 2 (λ)|(q + 1). For λ ∈ {1, −1} (or equivalently, o q 2 (λ) ∈ {1, 2}), λ-constacyclic Hermitian self-dual codes have been studied in [26]. In this paper, we give the characterization and enumeration of λ-constacyclic Hermitian self-dual codes of any length n and over F q 2 for every nonzero λ ∈ F q 2 such that o q 2 (λ)|(q + 1). Subsequently, the characterization and enumeration of QT Hermitian self-dual codes of length nℓ over F q 2 are given in the case where gcd(q, n) = 1.
The paper is organized as follows. In Section 2, some preliminary concepts and proofs of some basic results are discussed. An algorithm for explicit factorization of x n − λ over F q 2 which is key to study constacyclic and QT codes is given in Section 3. In Section 4, the characterization of the Hermitian hulls of constacyclic codes of any length n over F q 2 is given. Subsequently, necessary and sufficient conditions for constacyclic codes of length n over F q 2 to be Hermitian self-dual (resp., Hermitian complementary dual) are determined together with the number of such codes. A new family of MDS constacyclic Hermitian self-dual codes over F q 2 is introduced in Section 5. The decomposition for quasi-cyclic codes is generalized to the case of quasi-twisted codes in Section 6. The number of (λ, ℓ)-QT Hermitian self-dual codes of length nℓ over F q 2 is also determined

Preliminaries
In this section, we recall some basic properties of codes and polynomials over finite fields.
Let F q 2 denote a finite field of order q 2 . For a positive integer n, denote by F n q 2 the vector space of all vectors of length n over F q 2 . A linear code C of length n and dimension k over F q 2 is a kdimensional subspace of F n q 2 . A linear code C over F q 2 is said to have parameters [n, k, d] if C is of length n, dimension k, and minimum Hamming distance d = min{ω(c) | 0 c ∈ C}, where ω(c) denotes the Hamming weight of c. The parameters of every [n, k, d] linear code satisfy the Singleton bound k ≤ n − d + 1.
An [n, k, d] linear code over F q 2 is said to be a maximum distance separable (MDS) code if k = n − d + 1.
For a linear code C over F q 2 , the Euclidean dual C ⊥ E of C is defined under the Euclidean inner product The Hermitian dual C ⊥ H of C is defined under the Hermitian inner product where a = (a 0 , . . . , a n−1 ), b = (b 0 , . . . , b n−1 ) ∈ F n q 2 . The Hermitian hull of C is defined to be Hull H (C) = C ∩ C ⊥ H . A linear code C is said to be Hermitian self-dual (resp., Hermitian complementary dual) if C = Hull H (C) = C ⊥ H (resp., Hull H (C) = {0}). The Euclidean hull of a linear code C is defined in the same fasion and studied in [26].

Constacyclic Codes
Given a nonzero λ ∈ F q 2 , a linear code C of length n over F q 2 is said to be constacyclic, or specifically, λ-constacyclic if for each (c 0 , c 1 , . . . , c n−1 ) ∈ C, the vector (λc n−1 , c 0 , . . . , c n−2 ) is again a codeword in C. A λ-constacyclic code is called cyclic and negacyclic if λ = 1 and λ = −1, respectively. It is well known (see, for example, [29]) that every λ-constacyclic code C of length n over F q 2 can be identified with an ideal in F q 2 [x]/ x n − λ generated by a unique monic divisor of x n − λ. Such a polynomial is called the generator polynomial of C.
Given a polynomial f (x) = a 0 + a 1 x + . . . + a k x k ∈ F q 2 [x] with nonzeros a 0 and a k , denote by . Otherwise, f (x) and f † (x) are called a conjugatereciprocal polynomial pair.
Let g(x) be the generator polynomial of a λ-constacyclic code C of length n over F q 2 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 [29,Lemma 2.1]). Therefore, C is Hermitian self-dual if and only if g(x) = h † (x). By [26,Theorem 1], Hull H (C) is generated by lcm(g(x), h † (x)).

Quasi-Twisted Codes
View a codeword in a linear code C of length nℓ over F q 2 as an n×ℓ matrix over F q 2 . Given a nonzero λ ∈ F q 2 , a linear code C of length nℓ over F q 2 is said to be (λ, ℓ)-quasi-twisted ((λ, ℓ)-QT) of length nℓ over F q 2 if for each the vector is again a codeword in C. We define an action T λ,ℓ on the codewords as T λ,ℓ (c) = c ′ . Then every (λ, ℓ)-QT code is invariant as a subspace under the action T λ,ℓ .
Then the next lemma follows.
Lemma 2.1. The map ψ induces a one-to-one correspondence between the QT-codes of length nℓ over F q 2 and the R-submodules of R ℓ .

The Factorization of
In this section, we give an algorithm for the factorization of x n − λ in F q 2 [x] which is key to study both the structures of λ-constacyclic and (λ, ℓ)-QT codes. Let λ be a nonzero element in F q 2 such that o q 2 (λ) = r and let n be a positive integer written in the form of n = n ′ p ν , where p = char(F q 2 ), p ∤ n ′ and ν ≥ 0.
Since the map a → a p ν on F q 2 is a power of the Frobenious automorphism of F q 2 over F p , there is a unique Λ ∈ F q 2 such that Λ p ν = λ. Then (3.1) Since an automorphism is order preserving, we have o q 2 (Λ) = o q 2 (λ) = r. Therefore, it is sufficient to focus on the factorization of x n ′ − Λ.
Let k be the smallest integer such that (n ′ r)|(q 2k − 1). Then, there exists a primitive n ′ rth root of ξ in F q 2k such that ξ n ′ = Λ, and hence, is the jth cyclotomic polynomial over F q 2 (see [13]) , we have Hence, for each divisor j of n ′ r, ξ The set of elements in Z n ′ r satisfying the preceeding conditions is denoted by In other words, S j is the set of all s's such that ξ s is a root of It follows that For each j | n ′ r, necessary and sufficient conditions for S j to be nonempty are given in the following proposition.
Proof. Assume that S j ∅. Then there exists n ′ r j z ∈ S j . Then n ′ r j z − rm = 1 for some m ∈ N. It follows that gcd n ′ r j , r = 1. Conversely, assume that gcd n ′ r j , r = 1. Then there exists w 1 ∈ Z × r such that n ′ r j w 1 ≡ 1 mod r. Observe that (rm + w 1 ) n ′ r j ≡ 1 mod r for all m ∈ Z + . By Dirichlet's theorem on arithmetic progressions (see [27]), there exist infinitely many primes of the form rm + w 1 . Let m 1 ∈ Z + be such that rm 1 + w 1 is prime and rm 1 + w 1 > j. Hence, we obtain w = (rm 1 + w 1 ) mod j such that w ∈ Z × j and w n ′ r j ≡ 1 mod r. Therefore, S j ∅ as desired.
From now on, we focus only on the positive divisors j of n ′ r such that S j ∅, or equivalently, gcd n ′ r j , r = 1. The cardinality of S j is determined in the following lemma.

Lemma 3.2.
Let j be a positive divisor of n ′ r such that gcd n ′ r j , r = 1.
We divide the proof into two steps. First, we show that |S j | = |H j |. Then we determine |H j |.
Then Φ is surjective, and hence, it is a bijection. Therefore, |S j | = |H j |.
By the Fundamental Theorem of Arithmetic, we have j = p a 1 1 . . . p a t t , where p 1 < p 2 < · · · < p t are primes and a i is a positive integer. Since gcd( n ′ r j , r) = 1, we have r| j. Hence, we can write as desired.
Therefore, for each divisor j of n ′ r with gcd n ′ r j , r = 1, we have Let π be a map defined on the pair ( j, q 2 ), where i is a positive integer, by For each positive integer j such that gcd( j, q) = 1, the order of q 2 in the multiplicative group Z × j is denoted by ord j (q 2 ). The following lemma can be obtained by replacing q with q 2 in the proofs of [26, Lemma 3 and Lemma 19].

Lemma 3.3.
Let j be a positive integer and let F q 2 be a finite field with gcd( j, q) = 1. The jth cyclotomic polynomial Q j (x) factors into φ( j) ord j (q 2 ) distinct monic irreducible polynomials over F q 2 of the same degree ord j (q 2 ), where φ is the Euler's totient function.
If π( j, q 2 ) = 0, then all the irreducible polynomials in the factorization of Q j (x) are selfconjugate-reciprocal. Otherwise, they form conjugate-reciprocal polynomial pairs. By Lemma 3.3, gcd(Q j (x), x n ′ − ξ n ′ ) can be factored into φ( j) φ(r)ord j (q 2 ) distinct monic irreducible polynomials over F q 2 of the same degree ord j (q 2 ). In addition, , are a monic irreducible conjugate-reciprocal polynomial pair, and g i j (x) is a monic irreducible self-conjugate-reciprocal polynomial.
From the discussion above, we can determine the degrees and the number of self-conjugatereciprocal polynomials and conjugate-reciprocal polynomial pairs in the factorization of x n ′ − Λ in (3.11). However, we are not yet able to determine the explicit irreducible factors of x n ′ − Λ. The following algorithm gives the explicit factors of x n ′ − Λ.
A q 2 -cyclotomic coset modulo n ′ r containing a, denoted by S q 2 (a), is defined to be the set S q 2 (a) := q 2i · a mod n ′ r | i = 0, 1, . . . .
Since gcd(Q j (x), x n ′ − ξ n ′ ) can be factored as a product of irreducible polynomials in F q 2 [x], S j is a union of some q 2 -cyclotomic cosets modulo n ′ r. Therefore, we conclude the following algorithm.

Algorithm
1. For each j|n ′ r such that gcd n ′ r j , r = 1, find the set S j .
(3.1) If π( j, q 2 ) = 1, then denote by T j a set of q 2 -cyclotomic cosets of S j such that S q 2 (a) ∈ T j if and only if S q 2 (−qa) T j . Let T j denote a set of representative of q 2 -cyclotomic cosets in each q 2 -cyclotomic cosets in T j .
(3.2) If π( j, q 2 ) = 0, let S j denote a set of representative of q 2 -cyclotomic cosets in S j .

4.
We have The following example illustrates an application of the algorithm.

Hermitian Hull of λ-Constacyclic Codes
In this section, the dimensions of the Hermitian hulls of constacyclic codes of length n over F q 2 are determined via the factorization of x n − λ given in Section 3. The number of constacyclic Hermitian self-dual codes and the number of Hermitian complementary dual constacyclic codes of length n over F q 2 are given as well.
Theorem 4.1. Let F q 2 denote a finite field of order q 2 with characteristic p and let n = np ν with p ∤ n. Then the dimensions of the Hermitian hulls of λ-constacyclic codes of length n over F q 2 are of the form The theorem can be obtained using arguments similar to those in the proof of [26,Theorem 5] by replacing χ with π and q with q 2 .
Next theorem gives a characterization of λ-constacyclic Hermitian self-dual codes in terms of Ω defined in (3.9). In this case, the generator polynomial of a code is of the form where 0 ≤ v i j , w i j ≤ p ν and v i j + w i j = p ν .
Proof. Let C be a λ-constacyclic code of length n over F q with the generator polynomial g(x). Then, by (3.11), we have where 0 ≤ u i j , v i j , w i j ≤ p ν . It follows that and hence, Assume that C is Hermitian self-dual. Then g(x) = h(x) † . By comparing the exponents, we have and hence, 2u i j = p ν and v i j + w i j = p ν . Since 2u i j = p ν , we have p = 2 or Ω = ∅. Conversely, assume that Ω = ∅, or Ω ∅ and p = 2. Let g(x) be defined as in (4.2) and . It is not difficult to see that g(x) = h † (x), and hence, a constacyclic code generated by g(x) is Hermitian self-dual.

Corollary 4.3.
Let t be the number of monic irreducible conjugate-reciprocal polynomial pairs as in (3.13). The number of λ-constacyclic Hermitian self-dual codes of length n over F q 2 is if Ω ∅ and p 2.
In particular, if Ω ′ = ∅ (or equivalently, π(nr, q 2 ) = 0) and p = 2, then there exists a unique λ-constacyclic Hermitian self-dual code. In this case, the generator polynomial is Proof. By Theorem 4.2, the number of generator polynomials of λ-constacyclic Hermitain self-dual codes of length n over F q 2 depends only on v i j and w i j such that v i j +w i j = p ν where 0 ≤ v i j , w i j ≤ p ν . Then the number of λ-constacyclic Hermitain self-dual codes of length n over F q 2 is (p ν + 1) t .
Since the number of generator polynomials of λ-constacyclic Hermitian self-dual codes of length n over F q 2 depends only on v i j and w i j , a unique λ-constacylic Hermitian self-dual code occurs if Ω ′ = ∅ and p = 2. It is not difficult to see that Ω ′ = ∅ is equivalent to π(n ′ r, q 2 ) = 0. Therefore, the generator polynomial of the code is Necessary and sufficient conditions for constacyclic Hermitian complementary dual codes are given as follows.
Theorem 4.4. Let F q 2 denote a finite field of order q 2 with characteristic p and let n = np ν with p ∤ n. Let C be a λ-constacyclic code of length n over F q 2 . Then C is Hermitian complementary dual if and only if its generator polynomial is of the form where u i j ∈ {0, p ν }, and (v i j , w i j ) ∈ {(0, 0), (p ν , p ν )}.
Proof. In the proof of Theorem 4.2, we have λ-constacyclic codes C and C ⊥ of length n over F q 2 generated by g(x) and h † (x) respectively. Hence, C is a λ-constacyclic Hermitian complementary dual code if and only if lcm(g(x), h † (x)) = x n −λ or, equivalently max{u i j ,

MDS Constacyclic Hermitian Self-dual Codes over F q 2
In this section, we construct a class of MDS λ-constacyclic Hermitian self-dual codes over F q 2 . Throughout this section, let n be an even positive integer relatively prime to q such that (nr)|(q 2 − 1) and r|(q + 1), where r = o q 2 (λ). Equivalently, n = n ′ in the previous section. In [29], a family of MDS constacyclic Hermitian self-dual code over F q 2 whose length is a divisor of q − 1 is introduced. We now introduce a new family of MDS constacyclic Hermitian self-dual code over F q 2 whose length is a divisor of q + 1. Therefore, our family is different to a family in [29] if n 2.
Let ξ be a primitive nrth root of unity in an extension field F q 2k of F q 2 such that ξ n = λ. Then the set of all roots of x n − λ is ξ, ξ r+1 , ξ 2r+1 , . . . , ξ (n−1)r+1 . Define Let C be a λ-constacyclic code. The roots of the code C is defined to be the roots of its generator polynomial. The defining set of λ-constacyclic code C is defined as It is not difficult to see that T ⊆ O r,n and dim C = n − |T |. The following theorem can be obtained by slightly modified [29,Corollary 3.3]. The proof of (ii) can be obtained similarly.
The BCH bound for constacyclic codes is as follows.

Theorem 5.2 ([2, Theorem 2.2]
). Let C be a λ-constacyclic code of length n over F q 2 . Let r = o q 2 (λ). Let ξ be a primitive nrth root of unity in an extension field of F q 2 such that ξ n = λ. Assume the generator polynomial of C has roots that include the set ξ ri+1 | i 1 ≤ i ≤ i 1 + d − 1 . Then the minimum distance of C is at least d + 1. Theorem 5.5. Let λ ∈ F q 2 be such that r = o q 2 (λ) is even. Let n be an even integer such that nr|(q 2 − 1) both n and r divide q + 1. Let If 2(q+1) nr is odd, then C T is an MDS λ-constacyclic Hermitian self-dual code with parameters n, n 2 , n 2 + 1 .
Since the length of the MDS codes given in [29] is a divisor of q − 1 and the MDS codes condtructed in Theorem 5.5 is a divisor of q + 1, the later is different from the former whenever n 2. Some families of codes derived from Theorem 5.5 are given in the following example.
Conditions for nonexistence MDS λ-constacyclic Hermitian self-dual codes of length n over F q 2 are given as follows.
Theorem 5.7. Let λ ∈ F q 2 be such that r = o q 2 (λ) is even. Let n be an even integer such that nr|(q 2 − 1). If a q+1 r ≡ 0 mod n for some a in O r,n then there are no MDS λ-constacyclic Hermitian self-dual codes of length n over F q 2 .
Proof. Let a in O r,n be such that a q+1 r ≡ 0 mod n. Then, a(q + 1) ≡ 0 mod nr, which implies −qa = a. Let C T be an MDS λ-constacyclic Hermitian self-dual code and let T ⊆ O r,n be the defining set of a code C T . By Theorem 5.1, T ∩ −qT = ∅ and T ∪ −qT = O r,n .
If a ∈ T , then a ∈ T ∩ −qT , a contradiction. If a T , then a ∈ −qT . So a = −qa ∈ q 2 T = T , a contradiction.
The following example shows that there are no (−1)-constacyclic Hermitian self-dual code of length 6 over F 49 .

Quasi-Twisted Hermitian Self-Dual Codes over F q 2
In this section, we focus on simple root (λ, ℓ)-QT Hermitian self-dual codes of length nℓ over F q 2 , or equivalently, gcd(n, q) = 1. The decomposition of (λ, ℓ)-QT codes is given. The characterization and enumeration of (λ, ℓ)-QT Hermitian self-dual codes of length nℓ over F q 2 can be obtained via this decomposition.
In [12], QT codes over finite fields with respect to the Euclidean inner product were studied. QT codes were decomposed and the Euclidean duals of such codes are determined. In particular, the characterization of Euclidean self-dual QT codes were given. As a generalization of [12] and [19], we study QT codes over finite fields with respect to the Hermitian inner product.. From Lemma 2.1, every (λ, ℓ)-QT code of length nℓ over F q 2 can be viewed as an R submodule of R ℓ , where R := F q 2 [x]/ x n − λ .
Define an involution ∼ on R to be the F q 2 -linear map that sends α to α q for all α ∈ F q 2 and sends x to We say that Next proposition follows from the definition of QT codes and [29, Proposition 2.3].
Proposition 6.2. Let C be a (λ, ℓ)-QT code of length nℓ over F q 2 and let C ⊥ H be the Hermitian dual of C. Then C ⊥ H is a (λ −q , ℓ)-QT code of length nℓ over F q 2 .

Decomposition
Since gcd(q, n) = 1, by (3.11), x n − λ can be factored as follows where h j (x) and h † j (x) are a monic irreducible conjugate-reciprocal polynomial pair for all 1 ≤ j ≤ t and g i (x) is a monic irreducible self-conjugate-reciprocal polynomial for all 1 ≤ i ≤ s.
By the Chinese Remainder Theorem (c.f. [12] and [19] ), we write For simplicity, let G : is an isomorphism. Using the above isomorphisms, we have Remark 6.4. If f (x) is self-conjugate-reciprocal, then ∼ induces the field automorphism¯on F q 2 [x]/ f (x) F q 2k . The map r → r on F q 2 [x]/ f (x) is actually the map r → r q k on F q 2k .
Using statements similar to those in the proof of [19,Proposition 4.1], we conclude the next proposition. Proposition 6.5. Let a, b ∈ R ℓ and write a = (a 0 , a 1 , . . . , a ℓ−1 ) and b = (b 0 , b 1 , . . . , b ℓ−1 ). Decomposing σ 2 (a i ) and σ 2 (b i ) using (6.4), we have In particular, σ 2 (a), σ 2 (b) ∼ = 0 if and only if i a i j b i j = 0 for all 1 ≤ j ≤ s and i a ′ ik b ′′ ik = 0 = i a ′′ ik b ′ ik for all 1 ≤ k ≤ t. By (6.4), we have In particular, R submodule C of R ℓ can be decomposed as where C ′ j and C ′′ j are linear codes of length ℓ over H ′ j and C i is a linear code of length ℓ over G i . By Proposition 6.5, we have and hence, the next corollary follows. Corollary 6.6. An R submodule C of R ℓ is ∼-self-dual, or equivalently, a (λ, ℓ)-QT code ψ −1 (C) of length nℓ over F q 2 is Hermitian self-dual if and only if where C i is a Hermitian self-dual code of length ℓ over G i for 1 ≤ i ≤ s, C ′ j is a linear code of length ℓ over H j , and C ′⊥ E j is Euclidean dual of C ′ j for 1 ≤ j ≤ t. Let N(q, ℓ) (resp., N H (q, ℓ)) denote the number of linear codes (resp., Hermitian self-dual codes) of length ℓ over F q . It is well known [25] that N(q, ℓ) = (q i+ 1 2 + 1) if ℓ is even, 0, otherwise, (6.8) where the empty product is regarded as 1.
Proposition 6.7. Let F q 2 be a finite field and let n, ℓ be positive integers such that ℓ is even and gcd(n, q) = 1. Let λ be a nonzero element in F q 2 such that o q 2 (λ)|(q + 1). Suppose that x n − λ = g 1 (x) . . . g s (x)h 1 (x)h † 1 (x) . . . h t (x)h † t (x). Let d i deg g i (x) and e j = deg h j (x). The number of (λ, ℓ)-QT Hermitian self-dual codes of length nℓ over F q 2 is s i=1 N H (q 2d i , ℓ) t j=1 N(q 2e j , ℓ).