Constacyclic Codes of Length 3<italic>p</italic><sup><italic>s</italic></sup> Over F<italic><sub>p</sub></italic><sup><italic>m</italic></sup> + <italic>u</italic>F<italic><sub>p</sub></italic><sup><italic>m</italic></sup> and Their Application in Various Distance Distributions

Let <inline-formula> <tex-math notation="LaTeX">$p\not =3$ </tex-math></inline-formula> be any prime. The structures of all <inline-formula> <tex-math notation="LaTeX">$\lambda $ </tex-math></inline-formula>-constacyclic codes of length <inline-formula> <tex-math notation="LaTeX">$3p^{s}$ </tex-math></inline-formula> over the finite commutative chain ring <inline-formula> <tex-math notation="LaTeX">$\mathbb {F}_{p^{m}}+u\mathbb {F}_{p^{m}}(u^{2}=0)$ </tex-math></inline-formula> are established in the term of their generator polynomials. As an application, Hamming and homogeneous distance of a class of such codes and RT distances of all are given. Among such <inline-formula> <tex-math notation="LaTeX">$\lambda $ </tex-math></inline-formula>-constacyclic codes, the unique maximum-distance-separable (briefly, MDS) code with respect to the RT distance is obtained. Moreover, when <inline-formula> <tex-math notation="LaTeX">$\lambda $ </tex-math></inline-formula> is not a cube in <inline-formula> <tex-math notation="LaTeX">$\mathbb F_{p^{m}}$ </tex-math></inline-formula>, the necessary and sufficient condition for the <inline-formula> <tex-math notation="LaTeX">$\lambda $ </tex-math></inline-formula>-constacyclic code of length <inline-formula> <tex-math notation="LaTeX">$3p^{s}$ </tex-math></inline-formula> over <inline-formula> <tex-math notation="LaTeX">$\mathbb {F}_{p^{m}}+u\mathbb {F}_{p^{m}}(u^{2}=0)$ </tex-math></inline-formula> be an MDS constacyclic code with respect to Hamming distance is provided.


I. INTRODUCTION
The class of constacyclic codes is an important class of linear codes in coding theory. Many optimal linear codes are directly derived from constacyclic codes. Consyacyclic codes have practical applications as they are effective for encoding and decoding with shift registers.
Let λ be a unit in the finite field F, then λ-constacyclic codes of length n over F are classified as the ideals g(x) of the ambient ring F[x] x n −λ where g(x) is a divisor of x n −λ. When the code-length n is relatively prime to the characteristic of the finite field F, the codes are called simple root codes. Otherwise, they are called repeated-root codes. Such codes are studied by some authors (for examples, Massey et al. [44], Roth and Seroussi [48], and van Lint [52]). Dinh, in a series of papers ( [21]- [23], [24], [25]), determined the algebraic structures of constacyclic codes in terms of generator polynomials over F p m of length mp s , where m = 1, 2, 3, 4, 6. Recently, Liu and Shi [41] and Y. Liu et al. [42] studied repeated-root constacyclic codes of lengths k p s and 3 m p s .
The constacyclic codes over F 2 + uF 2 are very interesting because the structure of F 2 + uF 2 is lying between F 2 2

and
The associate editor coordinating the review of this manuscript and approving it for publication was Chi-Yuan Chen . Z 4 in the sense that it is additively analogous to F 2 2 and multiplication analogous to Z 4 (see [1], [19]). Moreover, the cyclic codes over F 2 + uF 2 can be constructed to be DNA codes which is important for biology (see [34]). So, many mathematicians are interested in cyclic codes over F 2 + uF 2 and study constacyclic codes over F 2 + uF 2 in general.
Dinh et al. studied the structures of constacyclic codes of length 2p s and 3p s over F p m (see [22], [26]). In 2009, Dinh [19] classified all constacylic codes of length 2 s over the Galois ring F 2 + uF 2 and provided their structures. In 2010, Dinh [20] determined the algebraic structures of constacyclic codes of length p s over F p m + uF p m and their dual codes. He obtained that the ideals of (F p m +uF p m ) [x] x p s −λ is a local ring when λ ∈ F p m \{0} but it is not a chain ring. For λ = α + uβ where α, β ∈ F p m \{0}, he get (F p m +uF p m ) [x] x p s −λ is a chain ring. In 2012, Dinh et al. [13] gave the algebraic structures of constacyclic codes of length 2p s over F p m + uF p m and their dual codes. In 2018, Dinh et al. [27] investigated the algebraic structures of negacyclic codes of length 4p s over F p m + uF p m and their dual codes. Moreover, constacyclic codes of length 4p s over F p m + uF p m are investigated in [28] and [29].
In [4], the authors studied a class of repeated-root constacyclic codes over F p m [u]/ u e . [5] gave an explicit VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ representation and enumeration for self-dual cyclic codes of length 2 s over F 2 m + uF 2 m . In 2020, the construction and enumeration for self-dual cyclic codes of even length over F 2 m +uF 2 m is considered by Cao et al. [7]. They also provided an explicit representation and enumeration for negacyclic codes of length 2 k n over Z 4 +uZ 4 [9]. In addition, an explicit representation and enumeration of repeated-root δ 2 + αu 2constacyclic codes over F 2 m [u]/ u 2λ is given in [10]. Moreover, an eficient method to construct self-dual cyclic codes of length p s over F p m + uF p m is studied in [11]. In [3], Cao et al. gave the structure of constacyclic codes of length np s over F p m + uF p m . After that, some authors extended the study of codes over finite commutative rings to many more general lengths and alphabets (see, e.g., [18], [42], [49]).
Given a code with the parameters [n, k, d H ] q , then n, k, d H must satisfy the Singleton bound [43], i.e., k ≤ n − d H +1. If k = n − d H +1, then the code is called a MDS code. If we fix n and k, then a MDS code has the greatest detecting and error-correcting capabilities. Therefore, the problem of constructing maximum distance separable codes is an important topic in coding theory.
Homogeneous weight on the integer residue rings was first considered by Constantinescu [15]. In 1996, Constantinescu, Heise, and Honold [17] continued to study homogeneous weight over Z m . In 1997, Constantinescu and Heise [16] investigated homogeneous weight over the residue class rings. After that, homogeneous weight was extended to finite modules over arbitrary finite rings [36]. In 2007, Solé and Sison studied minimum homogeneous weight of the image of a linear block code over the Galois ring GR(p m , m) [51]. This weight can be applied for constructing extensions of the Gray isometry to finite chain rings. The homogeneous weight also uses for a combinatorical approach to MacWilliams equivalence theorems for codes over finite Frobenius rings [35].
The problem of determining Hamming distance is very important in coding theory. However, not much work has been done on determining the exact values of Hamming distances of constacyclic codes as it is a very complicated and difficult task in general. By now, only a few results have been obtained ([30], [37]).
Motivated by these, in this article, we investigate the structure of λ-constacyclic codes of length 3p s over F p m + uF p m , where p = 3 is a prime and λ is any unit in F p m + uF p m . By using this structure, we study RT, Hamming, and homogeneous distances. We also determine the unique MDS constacyclic code with respect to the RT distance. When 0 = λ ∈ F p m is not a cube, by applying Singleton bound for the class of λ-constacyclic codes of length 3p s over F p m + uF p m , we get all MDS constacyclic codes with respect to the Hamming distance. Moreover, constructing quantum error-correcting codes from all λ-constacyclic codes of length 3p s over F p m + uF p m is an important direction for future work. We believe that we can provide good and new quantum error-correcting codes constructed from this class of codes.
The rest of this article is organized as follows. After presenting preliminary concepts in Section 2, we first study the case that the unit λ is a cube in the ring F p m + uF p m in Section III. In third section, each λ-constacyclic code of length 3p s over F p m + uF p m is represented as a direct sum where the structures of each constacyclic code were given in [20] which we divide this section into 2 cases, namely, p m ≡ 1 (mod 3) and p m ≡ 2 (mod 3). In Section IV, we focus on the situation that the unit λ = α + uβ is not a cube for nonzero elements α, β ∈ F p m . Section 5 investigates λ-constacyclic codes of length 3p s over F p m + uF p m when λ is not a cube and 0 = λ ∈ F p m . As an important application, RT, Hamming, and homogeneous distances are studied in Section 6. In addition, we identify all MDS constacyclic codes with respect to the RT and Hamming distances in Section 6. Section 7 concludes the paper and mention some open directions for future works.

II. PRELIMINARIES
Let R be a finite commutative ring with identity 1. An ideal I of R is called principal if it is generated by a single element. The ring R is a principal ideal ring if all its ideals are principal. R is called a local ring if R has a unique maximal ideal. Furthermore, R is called a chain ring if the set of all ideals of R is linearly ordered under set-theoretic inclusion. The following proposition is proved in [31].
Proposition 1: [31]: If R is a finite commutative ring with identity, then the following conditions are equivalent: 1) R is a local ring and the maximal ideal M of R is principal, i.e., M = r for some r ∈ R, 2) R is a local principal ideal ring, 3) R is a chain ring with ideals r i , 0 ≤ i ≤ N (r), where N (r) is the nilpotentcy of r. Let R be a finite commutative ring with identity, each code C of length n over R is a nonempty subset of R n , and the element of ring R is referred to as the alphabet of the code. If C is an R-submodule of R n , then C is called a linear code of length n over R. For a unit λ of R, the λ-constacyclic (λ-twisted) shift τ λ on R n is the shift evaluated in R. Two n-tuples x, y are called orthogonal if x · y = 0. If C is a linear code over R, its dual code C ⊥ is defined The following result is well known. Proposition 3: [39]: Let p be a prime and R be a finite chain ring of size p m . The number of codewords in each linear code C of length n over R is p k , for some integer k ∈ {0, 1, . . . , mn}. Moreover, the dual code C ⊥ has p l codewords, where k + l = mn, i.e., |C| · |C ⊥ | = |R| n . The following result is given in [31]. Proposition 4: [31]: The dual of a λ-constacyclic code is a λ −1 -constacyclic code.
In this article, we determine all λ-constacyclic codes of length 3p s over the ring R := F p m + uF p m where u 2 = 0. The ring R consists of all p m -ary polynomials of degree 0 and 1 in indeterminate u, it is closed under p m -ary polynomial addition and multiplication modulo u 2 . Thus, R = } is a local ring with the maximal ideal u = uF p m , and hence, it is a chain ring. Denote Then, by applying Proposition 2, all λ-constacyclic codes of length 3p s over R are ideals of R λ . Let ξ be a primitive (p m −1)th root of identity in F p m . Then Moreover, we denote the order of element a by ord(a). Definition 5: [13] If f (x) = a 0 + a 1 x + · · · + a r x r then the reciprocal of f (x) is the polynomial f * (x) = a r + a r−1 x + a r−2 x 2 + · · · + a 0 x r . f * (x) can be expressed by f * (x) = x r f ( 1 x ). If I is an ideal of R λ , then I * = {f * (x) : f (x) ∈ I } is also an ideal of R λ −1 . Definition 6: [13] Let I be an ideal of R λ . We define From the above definition, if I is an ideal of R λ , then A(I ) is an ideal of R λ . Moreover, if C is a λ-constacyclic code of length n over R with the associated ideal I , then the associated ideal of C ⊥ is A(I ) * . The following lemma is straightforward and it will be useful in Section V.
Lemma 7: [13]: Let α and β be elements in F p m and then, α+uβ is invertible over R if and only if α = 0. Thus, the ring R has p m (p m − 1) units. In this article, we assume that p = 3 is a prime number and separate all λ-constacyclic codes of length 3p s over R into the following cases.

III. THE UNIT λ IS A CUBE IN R
Let λ be a unit of F p m . We investigate all λ-constacyclic codes of length 3p s over R, where λ is a cube in R. Since λ is a cube in R, there exists λ 0 ∈ R such that λ = λ 3 0 . For this section, we divide this section into two cases, namely, p m ≡ 1 (mod 3) and p m ≡ 2 (mod 3).
By Lemma 8, we have , and using Chinese Remainder Theorem, we obtain that That means that each λ-constacyclic code of length 3p s over R can be expressed as a direct sum of a λ 0 -constacyclic code of length p s over R, a δλ 0 -constacyclic code of length p s over R and a γ λ 0 -constacyclic code of length p s over R. So, the number of codewords of each λ-constacyclic code of length 3p s over R can be obtained by the number of codewords of all λ-constacyclic codes of length p s over R studied in [20].
Theorem 9: Let C be a constacyclic code of length 3p s over R. Then C = C 1 ⊕C 2 ⊕C 3 where C 1 is a λ 0 -constacyclic code of length p s over R, C 2 is a δλ 0 -constacyclic code of length p s over R and C 3 is a γ λ 0 -constacyclic code of length p s over R. In particular, |C| = |C 1 ||C 2 ||C 3 |.
Proof: Note that By this isomorphism, we have C = C 1 ⊕ C 2 ⊕ C 3 where C 1 is a λ 0 -constacyclic code of length p s over R, C 2 is a δλ 0 -constacyclic code of length p s over R and C 3 is a γ λ 0constacyclic code of length p s over R. Moreover, the dual of code C ⊥ of a code C is also determine as follow: Theorem 10: Let C = C 1 ⊕ C 2 ⊕ C 3 be a constacyclic code of length 3p s over R where C 1 is a λ 0 -constacyclic code of length p s over R, C 2 is a δλ 0 -constacyclic code of length p s over R and C 3 is a γ λ 0 -constacyclic code of length p s over R.
This implies that First of all, we consider the polynomial x 2 + ax + a 2 for nonzero element a ∈ F p m and obtain the following lemma.
Lemma 11: The polynomial . There exists δ ∈ F p m such that δ 2 + aδ + a 2 = 0. We consider that . This implies that δ is a root of x 3 − a 3 = 0 over F p m . This implies that δ 3 = a 3 , and then (a −1 δ) 3 = 1. If a −1 δ = 1, then δ = a. So, 0 = a 2 + a 2 + a 2 = 3a 2 . This means that a = 0. It is a contradiction. Thus, a −1 δ = 1, and then ord(a −1 δ) = 3. Hence, 3|(p m − 1). It is a contradiction with p m ≡ 2 (mod 3). Therefore, Lemma 12: The polynomial Proof: Assume that This implies that δ 2 0 + aδ 0 + a 2 = 0 and 2δ 0 δ 1 + aδ 1 = 0. Thus, δ 0 is a root of x 2 + ax + a 2 = 0. It is a contradiction with Lemma 11. Hence, Throughout this case, we see that Applying Proposition 2, in [20], each ideal of R[x] x p s −λ 0 is a λ 0 -constacyclic code of length p s over R. Moreover, λ-constacyclic codes and their dual codes of length 3p s over R are given as follows: Theorem 13: Let C be a λ-constacyclic code of length 3p s over R. Then 1) C = C 1 ⊕ C 2 where C 1 is a λ 0 -constacyclic code of length p s over R and C 2 is an ideal of Proof: It follows from Theorems 9 and 10. In order to determine the algebraic structure of the quotient ring , we separate this case into two subcases, i.e., . If a = 0, then . Then f (x) can be uniquely expressed as , it can be viewed as a polynomial of degree less than 2p s over R. We see that ( with nilpotency index 2p s . Hence, f (x) is non-invertible if and only if a 00 = b 00 = 0.
From Lemma 16, we can characterize the quotient ring +λ 0 x p s +λ 2 0 as following theorem.
Theorem 17: 1) In the quotient ring is a nilpotent element with the nilpotent index 2p s . 2) The ring is a chain ring with ideals that are precisely Proof: 1) If p = 2, then characteristic of R is 2. We now consider By Lemma 15, we have u = −β −1 0 x −p s (x 2 + α 1 x + α 2 1 ) p s . If p = 2. Since 2 ∈ F p m , there exists η ∈ F p m such that 2 = η p s . We now consider Moreover, we see that the nilpotentcy index x 2 + α 1 x + α 2 1 is 2p s . 2) Using Lemma 16, the set of all non-invertible elements of is a local ring with the maximal ideal x 2 + α 1 x + α 2 1 , u . Next, we will show that is a chain ring. By 1, we have is a chain ring and each ideal forms ( Now, we can see that the number of elements of an ideal I is p 2m(2p s −i) . To get the dual code of (α + uβ)-constacyclic codes of length 3p s over R, we must determine A( (x 2 + α 1 x + α 2 1 ) i ) * as follows: In this subcase, we need to determine the algebraic structures of the quotient ring (x 2 +λ 1 x+λ 2 1 ) p s , it can be viewed as a polynomial of degree less than 2p s over R. We see that ( Theorem 23: The quotient ring , u and it is not a chain ring.
Proof: By applying Lemma 22, the set of all non-invertible elements of Since nilpotentcy indexes of x 2 + λ 1 x + λ 2 1 and u are p s and 2, respectively, we have is a principal ideal, in light of Proposition 1, we see that Theorem 25: All ideals of Type 2: (principal ideals with nonmonic polynomial generators) Proof: First of all, it is simple to check that ideals of Type 1 are 0 and 1 . Let I be an arbitrary nontrivial ideal of R[x] (x 2 +λ 1 x+λ 2 1 ) p s . We processed by establishing all possible forms that this nontrivial ideal I can have.
Case 1: I ⊆ u : Each element of I must be of the form u They are ideals of Type 2. Case 2: I u : Let I u denotes the set of elements in I which are reduced modulo u. Note that I u is a nonzero ideal of the ring

Then there is an integer
(t 1 (x)) p s . This follows that there is an element We now consider two subcases.
Case 2a: . It shows that r(x) can be expressed as It has been proved that for any showing that Thus, Let T be the smallest integer satisfying If ω ≥ T , then It is a contradiction by assumption of this case. It shows that ω < T , implying that I is of Type 4.
The following proposition allows us to determine the number T .
. Therefore, Then u(t 1 (x)) T can be expressed as follows: In addition, Hence, Recall that for a code C of length n over R, their torsion and residue codes are codes over F p m , defined as follows: The reduction modulo u from C to Res(C) is given by Obviously, φ is well-defined and onto, with Ker φ ∼ = Tor(C), and φ(C) = Res(C). Then | Res(C)| = |C| | Tor(C)| . Therefore, we have following result.
Proposition 27: Let C be a code of length n over R whose torsion and residue codes are Tor(C) and Res(C), respectively. Then |C| = | Tor(C)| · | Res(C)|.
We now give the number of elements in each ideal of the quotient ring R[x] (x 2 +λ 1 x+λ 2 1 ) p s as following theorem. Theorem 28: Let I be an ideal of the ring R[x] (x 2 +λ 1 x+λ 2 1 ) p s , then the number of elements of I , denoted by n I , is determined as follows: • If I = 0 and I = 1 , then n I = 1 and n I = p 4mp s , respectively.
is 0 or a unit, then .
Proof: We apply Proposition 27 for computing the number of elements of I and separate this proof into following types in Theorem 25.
1) Type 1: To get dual codes and the annihilator of I , where I is an ideal of the ring ) p s , we need to give the following lemma.
Lemma 29: Let I be an ideal of We have i + r ≥ p s . It implies that the smallest value of r is Theorem 30: The other inclusion follows from the fact that the coefficient vector of (x 2 +λ 1 x +λ 2 1 ) p s −i is orthogonal to the coefficient vector of u(x 2 + λ 1 x + λ 2 1 ) i and all its constacyclic shift. Therefore, is 0 or a unit. Then A(I ) * is determined as follows: Proof: It is straightforward to show (1). We will prove the case (ii) and (iii).
, we have a + i ≥ p s . Next, we consider that two ranges of i, namely, 1 ≤ i ≤ p s +t 2 and p s +t 2 < i ≤ p s − 1.
The proof of (ii) is complete.
• p s +t Now A(C) = l 2 (x), u(x 2 + λ 1 x + λ 2 1 ) p s −i , and by Lemma 48, we have Proof: It is straightforward to show (1). The case (ii) will be proved as follows. We see that VOLUME 8, 2020 and n I = p 2m(i+ω) . Then In this section, we investigate the case that the unit λ = α + uβ, where α, β in F p m \{0}, and λ is not a cube in R. Using Proposition 2, all (α + uβ)-constacyclic codes of length 3p s are ideals of the ambient ring .
First of all, we have the following observation. Proposition 33: α + uβ is not a cube in R if and only if α is not a cube in F p m \{0}.
Proof: Suppose that α + uβ is not a cube in R. We prove by contradiction, assume that α is a cube in F p m \{0}. So, there exists α 1 ∈ F p m such that α = α 3 1 . We choose β 1 = 3 −1 α −2 β. Then Thus α + uβ is a cube in R, which is a contradiction. On the other hand, then it is obvious that if α is not a cube in F p m \{0}, then α + uβ is not a cube in R.
Since α ∈ F p m , there exists α 1 ∈ F p m such that α = α p s 1 . By Proposition 33, α is not a cube if and only if α 1 is not a cube. Next, we give an important proposition as follows: Proposition 34: Each nonzero polynomial of degree less than 3 in F p m [x] is invertible in R α,β .
Proof: Let f (x) = ax 2 + bx + c be a nonzero polynomial in F p m [x], i.e., a, b, c ∈ F p m so that they are not all zeros. We will prove that f (x) is invertible in R α,β . We consider 3 cases according to degree of f (x). Obviously, c is an invertible element because c ∈ F p m \{0}. Thus f (x) is also invertible.
Case 2: deg f (x) = 1, i.e., a = 0, b = 0 and f (x) = bx +c. In R α,β , we have It is a contradiction because α 1 is not a cube. Hence, f (x) is an invertible element. Now, we give the following lemma to determine the ring R α,β .
Lemma 35: In R α,β , (x 3 − α 1 ) p s = u and x 3 − α 1 is a nilpotent with nilpotency index 2p s . VOLUME 8, 2020 Proof: Note that, in R α,β , ( − α 1 is nilpotent with nilpotency index 2p s because u 2 = 0. Each f (x) of R α,β can be represented as a polynomial of degree less than 3p s of R [x], and then f (x) = f 1 (x) + uf 2 (x), where f 1 (x), f 2 (x) are polynomials of degree less than 3p s in F p m [x]. Therefore, f (x) can be uniquely written as . Thus, f (x) is not invertible if and only if a 00 = b 00 = c 00 = 0, i.e., f (x) ∈ x 3 − α 1 . This implies that x 3 − α 1 forms the set of all non-invertible elements in R α,β . Hence, R α,β is a local ring with the maximal ideal x 3 − α 1 . It implies that R α,β is a finite chain ring. We summarize discussion above in the following theorem.
Theorem 36: The ring R α,β is a chain ring with the maximal ideal x 3 − α 1 whose ideals are From theorem above, we can determine all (α + uβ)constacyclic codes of length 3p s over R, and their sizes.

Corollary 40:
The ideal u is the unique self-dual (α + uβ)-constacyclic code of length 3p s over R.

V. THE UNIT λ IS NOT A CUBE IN F p m
In this section, we discuss the last type of the unit λ, which is the case that λ ∈ F p m \{0}, and λ is not a cube. Then the λ-constacyclic codes of length 3p s over R are ideals of the ambient ring We have the following proposition. Proposition 41: Any nonzero polynomial of degree less Proof: It follows that Proposition 34. We now characterize the ring R λ as follows: Proposition 42: The polynomial x 3 −λ 1 is nilpotent in R λ with nilpotency index p s . R λ is a local ring with the maximal ideal x 3 − λ 1 , u , but it is not a chain ring.
− λ 1 is nilpotent in R λ with nilpotency index p s . Next, consider an arbitrary element f (x) of R λ . Then f (x) can be rewritten as a polynomial of degree less than 3p s of R [x], and so f (x) = f 1 (x) + uf 2 (x), where f 1 (x), f 2 (x) are polynomials of degrees less than 3p s in F p m [x]. Hence, is not invertible if and only if a 00 = b 00 = c 00 = 0, i.e.,f (x) ∈ x 3 − λ 1 , u . This implies that x 3 − λ 1 forms the set of all non-invertible elements of R λ . Therefore, R λ is a local ring with the maximal ideal It is a contradiction because x 3 −λ 1 is a nilpotent element. So u ∈ x 3 −λ 1 . Since x 3 −λ 1 and u have nilpotentcy indexes are p s and 2, respectively, we have x 3 − λ 1 ∈ u . Thus, x 3 − λ 1 , u is not a principal ideal of R λ . It implies that R λ is not a chain ring.
Proposition 43: The quotient ring is a chain ring whose each ideal forms (x 3 − λ 1 ) i for 0 ≤ i ≤ p s . Proof: It follows that Proposition 24. Thus, we can divide the λ-constacyclic codes of length 3p s over R into 4 types as following proposition.
Type 2: (principal ideals with nonmonic polynomial generators) where 0 ≤ i ≤ p s − 1. Type 3: (principal ideals with monic polynomial generators) Proof: It is easy to see that ideals of Type 1 are 0 and 1 . Let I be an arbitrary nontrivial ideal of R λ . We determine all possible forms that the ideal I can have.
Case 1: Assume that I ⊆ u . This implies that each element in I must be of the form where a 0i , b 0i , c 0i ∈ F p m . So, there is an element a(x) ∈ I and we can choose the smallest k satisfying a 0k x 2 + b 0k x + c 0k = 0. Thus, each element c(x) ∈ I has the form It shows that I ⊆ u(x 3 − λ 1 ) k . Since a(x) ∈ I , we can express Since a 0k x 2 x 3p s −λ . Therefore, there exists an element Now, we will consider two subcases. Case 2a: Then I can be expressed as where h(x) is 0 or h(x) is a unit which can be written as Since r(x) = 0, there exits a smallest integer k, 0 ≤ k ≤ i − 1, satisfying r 2k x 2 + r 1k x + r 0k = 0. Then Since r 2k x 2 + r 1k x + r 0k = 0, we have (r 2k which contradicts the assumption of this case. Thus, ω < T , proving that I is of Type 4.
The following proposition allows us to determine T . Proposition 45: Let T be the smallest integer satisfying We can write f (x) as It is well-known that for a code C of length n over R, their torsion and residue codes are codes over F p m , defined as follows: The reduction modulo u from C to Res(C) is given by Obviously, φ is well-defined and onto, with Ker(φ) ∼ = Tor(C), and φ(C) = Res(C). Therefore, | Res(C)| = |C| | Tor(C)| . Thus, we have following proposition.
By definition and the classification in Theorem 5.4, Res(C) and Tor(C) can be provided.
Lemma 46: Let C be a λ-constacyclic code C of length 3p s over R, then the residue and torsion codes of C are obtained as follows: Type 1: • If C = 0 , then Res(C) = Tor(C) = 0 , • If C = 1 , then Res(C) = Tor(C) = 1 .
is a unit and κ < T , then Res(C) = (x 3 − λ 1 ) i and Tor(C) = (x 3 − λ 1 ) κ . VOLUME 8, 2020 Thus, by multiplying the sizes of Res(C) and Tor(C) in each case, we get the size of all λ-constacyclic codes of length 3p s over R.
Theorem 47: Assume that C is a λ-constacyclic code of length 3p s over R. Then the number of codewords of C, denoted by n C , is determined as follows: • If C = 0 and C = 1 , then n C = 1 and n C = p 6mp s , respectively. and h(x) is 0 or a unit, then is 0 or a unit, and . Now, in order to determine the duals of all λ-constacyclic codes with respect to each type as categorized in Theorem 5.4, we need to have two lemmas as follows.
Lemma 48: Lemma 49: Since the nilpotency index of x 3 − λ 1 is p s , we see that i + r ≥ p s , i.e., r ≥ p s − i. Theorem 50: Let C = u(x 3 − λ 1 ) i be a λ-constacyclic code of length 3p s over R, Therefore, This implies that 0 or h(x) is a unit. Then C ⊥ is associated to the ideal A(C) * , determined as follows: , we give the simplest form for the generators f (x) and u(x 3 − λ 1 ) k . In light of Lemma 49, p s − i is the smallest integer r satisfying u(x 3 − λ 1 ) r ∈ A(C), hence, k = p s − i. On the other hand, Clearly, a + i ≥ p s , i.e., a ≥ p s − i. At this point, we consider two ranges of i, namely, 1 ≤ i ≤ p s +t 2 and p s +t 2 < i ≤ p s − 1. .
we have Then C ⊥ is associated to the ideal A(C) * , determined as follows: On the other hand, we have

VI. RT, HAMMING AND HOMOGENEOUS DISTANCES
In this section we will apply the structure of λ-constacyclic codes of length 3p s over F p m found in Sections 3,4,5 to determine three distances of such codes, namely, the RT, Hamming and homogeneous distances.

A. RT DISTANCES
In 1997, Rosenbloom-Tsfasman (RT) distance was first introduced by Rosenbloom and Tsfasman [47]. Then the Singleton bound, the Plotkin bound, the Hamming bound, and the Gilbert bound were determined for the RT distance. After VOLUME 8, 2020 that, many authors studied codes with respect to this RT metric (see, [14], [32], [40], [50].) For any finite commutative ring R, we recall the Rosenbloom-Tsfasman weight (briefly, RT weight) (see [47]) of an n-tuple x = (x 0 , x 1 , . . . , x n−1 ) ∈ R n as follows: The Rosenbloom-Tsfasman distance (RT distance) of any two n-tuples x, y of R n is defined as: Let C be a code of length n over R. Then the RT distance of C is given as follows: In this subsection, we determine the Rosenbloom-Tsfasman distances of λ-constacyclic codes of length 3p s over the ring R such that λ is not a cube in F p m . The following proposition is quite straightforward from the definition of the RT weight.
Proposition 53: Let c = (c 0 , c 1 , . . . , c n−1 ) ∈ R n be a word of length n over R, and c(x) be its polynomial presentation. Then Theorem 54: Let λ be not a cube in F p m . Assume that C is a λ-constacyclic code of length 3p s over R, i.e., C = ( x 3p s −λ , for some i ∈ {0, 1, . . . , 2p s }. Then the Rosenbloom-Tsfasman distance d RT (C) of C is completely determined as follows.
Proof: If i = 2p s , C = 0 . It implies that d RT (C) = 0. Using Lemma 35 and Theorem 36, when 0 ≤ i ≤ p s , It suffices to show that, in each ideal u(x 3 − α 1 ) i−p s , the generator polynomial u(x 3 − α 1 ) i−p s is of smallest degree, which is 3i − 3p s . Hence, in light of Proposition 53, its RT distance is 3i − 3p s + 1. Assume that f (x) is a nonzero polynomial in u(x 3 − α 1 ) i−p s of degree 0 ≤ k < 3i − 3p s , then we can express f (x) as where a j , b j , c j ∈ R. Let (0 ≤ ≤ k) be the smallest index such that a j x 2 + b j x + c j = 0, then we have where g(x) ∈ R λ and g(x) can be written as We see that in R λ , x 3 − α 1 is nilpotent. It implies that there is an odd integer t such that ( − α 1 ) +1 , and in particular, f (x) ∈ C. Therefore, we have proved that any nonzero polynomial of degree less than 3i − 3p s is not in C, i.e., the smallest degree of nonzero polynomials in C is 3i − 3p s , as desired.
Proposition 55: For p s where A j is the number of codewords of RT weight j of (x 3 − α 1 ) i .
Proof: As in the proof of Theorem 54, when p s From this, we get their weight distributions as follows.
Proposition 56: For i = p s t, 0 ≤ t ≤ 1, the RT weight distribution of the λ-constacyclic code (x 3 − α 1 ) i ⊆ R λ is determined as follows.
where A j is the number of codewords of RT weight j of (x 3 − α 1 ) i .
Proposition 57: is determined as follows.
where A j is the number of codewords of RT weight j of (x 3 − α 1 ) i .
Proof: Using Lemma 35, we have Let B j be the number of codewords of RT weight j of (x 3 − α 1 ) i , which are not in u ; and B j be the number of codewords of RT weight j of u . Hence, for all j, A j = B j + B j . Similar to Proposition 55, we have From Proposition 56, it is easy to see that

Thus,
Remark 58: Propositions 55, 56, and 57 allow us to determine the RT weight distributions for λ-constacyclic codes C i = (x 3 − α 1 ) i ⊆ R λ of length 3p s over R λ when λ is not a cube in F p m . By applying Theorem ??, |C i | = p 3m(2p s −i) . As |C i | = 3p s j=0 A j , we can use these RT weight distributions to compute the size |C i | of such codes.
It is well-known that the Singleton Bound of RT distance is given in [47]. Let C be a linear code of length n over R with Rosenbloom-Tsfasman distance d RT (C). Mark the first VOLUME 8, 2020 d RT (C) − 1 entries of each codeword of C, then two different codewords of C can not coincide in all other n − d RT (C) + 1 entries, otherwise C would have had a nonzero codeword of RT weight less than or equal to d RT (C) − 1. Thus, C can contain at most p am(n−d RT (C)+1) codewords.
Theorem 59: (Singleton Bound for RT distance) Let C be a linear code of length n over R with Rosenbloom-Tsfasman distance d RT (C). Then |C| ≤ p am(n−d RT (C)+1) .
When a code C attains this Singleton Bound, i.e., |C| = p am(n−d RT +1) , it is said to be a Maximum Distance Separable (MDS) code (with respect to the RT distance). We now point out the unique MDS λconstacyclic codes of length 3p s over R a with respect to the RT distance when λ is not a cube in F p m .
Theorem 60: The only maximum distance separable λconstacyclic code of length 3p s over R, where λ is not a cube in F p m , with respect to the RT distance, is the whole ambient ring R λ .

B. HAMMING DISTANCES
In general, the Hamming distances of a class of codes are very difficult to determine the exact values, however, for the class of λ-constacyclic codes of length 3p s over R when λ is not a cube in F p m , we can obtain all Hamming distances of such codes.
Theorem 61: Let C be a λ-constacyclic code of length 3p s over R, where λ is not a cube in F p m , i.e., C = ( Proof: In R λ , by using Lemma 35, (x 3 − α 1 ) p s = u . We consider two cases.
Hence, the codewords of the code C in R λ , are precisely the codewords of the code ( are λ 0constacyclic codes of length p s over F p m , whose Hamming distances are provided in [20]. Thus, we get the Hamming distances of λ-constacyclic code of length 3p s over R when λ is not a cube in F p m , as stated.
We see that the dimension of a constacyclic code It is easy to see that β + 4 + 3βp s−1 > 0 for all 0 ≤ β ≤ p − 2. Hence, C i = (x 3 − α 1 ) i is not an MDS constacyclic code when p s + βp s−1 Then we see that It is easy to see that 3p s − 3p s−k + (t + 1)p k + 3(t −1)p s−k−1 +2 > 0 for all 1 ≤ t ≤ p−1 and 1 ≤ k ≤ s − 1. Hence, C i is not an MDS constacyclic code when 2p s − p s−k We summarize our discussion above in the following theorem.

C. HOMOGENEOUS DISTANCES
Homogeneous distance of λ-constacyclic codes is also an important distance in coding theory. In 1995, Constantinescu [15] introduced the homogeneous weight over integer residue rings, and homogeneous weight of λ-constacyclic codes is also developed over finite Frobenius rings. This weight has numerous applications for codes over finite rings, such as constructing extensions of the Gray isometry to finite chain rings, or providing a combinatorical approach to MacWilliams equivalence theorems for codes over finite Frobenius rings [35].
Recall that the homogeneous weight on a finite chain ring R with p m -element residual field is defined as : if x ∈ soc(R) and x = 0, 0 : otherwise.
where κ is a factor that we may choose. For R λ , : if x ∈ soc(R) and x = 0, 0 : otherwise.
The homogeneous weight on R λ is a weight function on R λ defined as The homogeneous weight of a codeword (c 0 , c 1 , . . . , c n−1 ) of length n over R λ is given as the rational sum of the homogeneous weights of its components, i.e., w h (c 0 , c 1 , . . . , c k−1 ) = w h (c 0 ) + · · · + w h (c n−1 ).
For 1 ≤ t ≤ p − Hence, d h (C) = (t + 1)p m+k , as required. We finish this section by providing some examples to illustrate our results.
Example 69: Let p = 7 and s = 2. λ = 2+4u. It is easy to check that 2 is not a cube in F 7 . We determine all Hamming distance of (2 + 4u)-constacyclic codes of length 147 over F 7 + uF 7 in Table 2.
Example 70: Let p = 7 and s = 2. λ = 2 + 4u. It is easy to check that 2 is not a cube in F 7 . We determine all the homogeneous distances of (2 + 4u)-constacyclic codes of length 147 over F 7 + uF 7 in Table 3.

VII. CONCLUSION
In this article, Section 3 studies λ-constacyclic codes of length 3p s over R when λ is a cube in R. The structure of λ-constacyclic codes of length 3p s over R is considered in Section 4, where λ = α + uβ is not a cube and 0 = α, β ∈ F p m . For the remaining case, that 0 = λ ∈ F p m is not a cube, the structures, number of codewords and duals of λconstacyclic codes are obtained in Section 5. Section 6 investigates Hamming and homogeneous distance of a class of such codes and RT distances of all. As an important application, we identify all MDS constacyclic codes with respect to the RT and Hamming distances in Section 6.
One of the problems against the feasibility of quantum computation appears to be the difficulty of eliminating error caused by inaccuracy and decoherence. Since the classical error-correcting techniques based on redundancy or repetition codes seemed to contradict the quantum no-cloning theorem, classical error-correcting codes can not be used in quantum computation. Therefore, quantum error-correcting codes are proposed to protect quantum information from errors due to the decoherence and other quantum noise. For future work, it will be interesting to apply these structures and distances in constructing quantum error-correcting codes from this class of codes.