# Quantum Codes as an Application of Constacyclic Codes

Mohd Arif Raza, Mohammad Fareed Ahmad, Adel Alahmadi, Widyan Basaffar, Manish K Gupta, Nadeem Ur Rehman, Abdul Nadim Khan, Hatoon Shoaib, Patrick Sole

► To cite this version:

Mohd Arif Raza, Mohammad Fareed Ahmad, Adel Alahmadi, Widyan Basaffar, Manish K Gupta, et al.. Quantum Codes as an Application of Constacyclic Codes. Axioms, 2024, 13, 10.3390/axioms13100697. [https://doi.org/10.3390/axioms13100697](https://doi.org/10.3390/axioms13100697)

HAL Id: hal-04727087

https://hal.science/hal-04727087v1

Submitted on 9 Oct 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
Article

# Quantum Codes as an Application of Constacyclic Codes

Mohd Arif Raza <fnref n="1" />\*,*, Mohammad Fareed Ahmad <fnref n="2" />\*, Adel Alahmadi <fnref n="3" />, Widyan Basaffar <fnref n="3" />, Manish K. Gupta <fnref n="4" />\*, Nadeem ur Rehman <fnref n="2" />\*, Abdul Nadim Khan <fnref n="1" />, Hatoon Shoaib <fnref n="3" />\*\* and Patrick Sole <fnref n="5" />\*\*

**Abstract:** The main focus of this paper is to analyze the algebraic structure of constacyclic codes over the ring $\mathcal{R} = \mathbb{F}_p + w_1\mathbb{F}_p + w_2\mathbb{F}_p + w_2^2\mathbb{F}_p + w_1w_2\mathbb{F}_p + w_1w_2^2\mathbb{F}_p$, where $w_1^2 - \alpha^2 = 0$, $w_1w_2 = w_2w_1$, $w_2^3 - \beta^2w_2 = 0$, and $\alpha, \beta \in \mathbb{F}_p \setminus \{0\}$, for a prime $p$. We begin by introducing a Gray map defined over $\mathcal{R}$, which is associated with an invertible matrix. We demonstrate its advantages over the canonical Gray map through some examples. Finally, we create new and improved quantum codes from constacyclic codes over $\mathcal{R}$ using Calderbank–Shore–Steane (CSS) construction.

**Keywords:** linear codes; Gray map; CSS construction; quantum codes

MSC: 11T71; 94B05; 94B15

<figure><img src="image_2.png" /></figure>

check for
updates

**Citation:** Raza, M.A.; Ahmad, M.F.; Alahmadi, A.; Basaffar, W.; Gupta, M.K.; Rehman, N.u.; Khan, A.N.; Shoaib, H.; Sole, P. *Quantum Codes as an Application of Constacyclic Codes*. *Axioms* **2024**, *13*, 697. https://doi.org/10.3390/axioms13100697

Academic Editors: Deguang Han and Angel Ricardo Plastino

Received: 16 August 2024

Revised: 14 September 2024

Accepted: 20 September 2024

Published: 8 October 2024

<figure><img src="image_3.png" /></figure>

**Copyright:** © 2024 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).

## 1. Introduction

In contrast to classical information theory, quantum information theory is a relatively emerging field [1–3]. The concept of quantum error-correcting codes (QECCs) was initially introduced by Shor [4] and Steane [5], with a construction method outlined by Calderbank et al. [6]. Subsequently, researchers have explored various approaches to utilize classical error-correcting codes to create new quantum codes (QECCs). The quantum code database remains quite limited when compared to classical block codes. The existing database [7] encompasses finite fields of order up to 9, but it focuses exclusively on QECCs for $p = 2$. Some static tables of quantum codes are available in [8,9], building upon the work in [10]. The online tables [9] might have been overlooked by many researchers.

The field of quantum error-correcting codes has seen remarkable growth since the initial realization that such codes could safeguard quantum information, which is analogous to how classical error-correcting codes protects classical information. Shor's [4] pioneering work led to the discovery of the first quantum error-correcting code. In 1998, Calderbank et al. [6] provided a systematic method for constructing quantum codes from classical error-correcting codes. Many researchers have concentrated on using Calderbank–Shor–Steane (CSS) construction to produce quantum codes from linear codes that contain their duals (see [11–14]).

Qian et al. [15] initially presented the construction of quantum codes from cyclic codes of odd length over the chain ring $\mathbb{F}_2 + u\mathbb{F}_2$, where $u^2 = 0$. Subsequently, Kai and Zhu [16] introduced a technique for generating quantum codes from cyclic codes of odd length over the finite chain ring $\mathbb{F}_4 + u\mathbb{F}_4$. Qian [17] proposed a novel approach for constructing

<footnote n="1">¹ Research Group of Algebraic Structures and Applications, Department of Mathematics, Faculty of Science & Arts-Rabigh, King Abdulaziz University, Rabigh 21911, Saudi Arabia; abdulnadimkhan@gmail.com</footnote>

<footnote n="2">² Department of Mathematics, Aligarh Muslim University, Aligarh 202002, India; fareed3745@gmail.com (M.F.A.); nu.rehman.mm@amu.ac.in (N.u.R.)</footnote>

<footnote n="3">³ Research Group of Algebraic Structures and Applications, Department of Mathematics, Faculty of Science, King Abdulaziz University, Jeddah 21589, Saudi Arabia; analahmadi@kau.edu.sa (A.A.); whbasaffar@kau.edu.sa (W.B.); hashoaib@kau.edu.sa (H.S.)</footnote>

<footnote n="4">⁴ Director Academics Office, Kaushalya: The Skill University, Ahmedabad 382424, India; mankg@computer.org</footnote>

<footnote n="5">5 I2M, (CNRS, Aix-Marseille University, Centrale Marseille), 163 Avenue de Luminy, 13009 Marseilles, France; patrick.sole@telecom-paris.fr</footnote>

<footnote>* Correspondence: mreda@kau.edu.sa or arifraza03@gmail.com</footnote>
quantum error-correcting codes from cyclic codes over the finite non-chain ring $\mathbb{F}_2 + v\mathbb{F}_2$, where $v^2 = v$ of any length. Motivated by this study, Ashraf and Mohammad [18] obtained quantum codes from cyclic codes over the non-chain ring $\mathbb{F}_q + u\mathbb{F}_q + v\mathbb{F}_q + uv\mathbb{F}_q$, where $u^2 = u$, $v^2 = v$, $uv = vu$, $q = p^n$, and $p$ is an odd prime.

Constacyclic codes, a robust extension of cyclic codes over finite non-chain rings, have proven to be a prolific source of new quantum codes. Recent research by coding theorists has explored constacyclic codes extensively. Distinguished investigations include Li et al. [19] over $\mathbb{F}_p + u\mathbb{F}_p + v\mathbb{F}_p + uv\mathbb{F}_p$, with $u^2 - u = 0$, $v^2 - v = 0$, and $uv - vu = 0$; Ma et al.’s [20] contributions over $\mathbb{F}_p + v\mathbb{F}_p + v^2\mathbb{F}_p$, with $v^3 = v$; and Gao and Wang’s [21] over $\mathbb{F}_p + u\mathbb{F}_p$, where $u^2 = 1$. These studies have led to the construction of numerous significantly improved quantum codes, all originating from dual-containing constacyclic codes.

In light of these developments, it becomes evident that constacyclic codes over finite non-chain rings represent a valuable resource for generating new and better quantum codes. Therefore, this article delves into the exploration of constacyclic codes within the framework of the non-chain ring $\mathcal{R} = \mathbb{F}_p + w_1\mathbb{F}_p + w_2\mathbb{F}_p + w_2^2\mathbb{F}_p + w_1w_2\mathbb{F}_p + w_1w_2^2\mathbb{F}_p$, where $w_1^2 - a^2 = 0$, $w_1w_2 = w_2w_1$, $w_2^3 - \beta^2w_2 = 0$, and $a, \beta \in \mathbb{F}_p \setminus \{0\}$, for a prime $p$. The objective is to find new quantum codes over the finite field $\mathbb{F}_p$. The article makes two significant contributions:

* Comprehensive study of the structure of constacyclic codes with the length $l$ over $\mathcal{R}$.

* The construction of better quantum codes concerning their parameters, surpassing those previously documented in the literature.

A noteworthy aspect of this research involves the presentation of computational findings [22], highlighting the substantial impact of this work on the development of new quantum codes.

## 2. Preliminaries

Let $\mathbb{F}_p$ be a finite field of order $p$ (an odd prime). A subspace $C_0$ of $\mathbb{F}_p^m$ is called a linear code of length $m$ over $\mathbb{F}_p$, and its members are called the codewords. Let $\mathcal{R} = \mathbb{F}_p + w_1\mathbb{F}_p + w_2\mathbb{F}_p + w_2^2\mathbb{F}_p + w_1w_2\mathbb{F}_p + w_1w_2^2\mathbb{F}_p$, where $w_1^2 - a^2 = 0$, $w_1w_2 = w_2w_1$, $w_2^3 - \beta^2w_2 = 0$, and $a, \beta \in \mathbb{F}_p \setminus \{0\}$ be a finite commutative ring. Remember that a linear code $C$ over the ring $\mathcal{R}$ of length $n$ is essentially an $\mathcal{R}$-submodule of the module $\mathcal{R}^n$. One can also view an element $c = (c_0, c_1, \dots, c_{n-1})$ in $C$ as a polynomial $c(z) = c_0 + c_1z + \dots + c_{n-1}z^{n-1}$ within the ring $\frac{\mathcal{R}[z]}{\langle z^n - \Lambda \rangle}$. A linear code $C$ is called a $\Lambda$-constacyclic code of length $n$ over $\mathcal{R}$ if and only if it is an $\mathcal{R}$-submodule in the module $\frac{\mathcal{R}[z]}{\langle z^n - \Lambda \rangle}$. Many researchers have extensively explored constacyclic codes over finite fields and finite commutative Frobenius rings [23–27]. Consider the elements of $\mathcal{R}$ as follows:

$$ \kappa_1 = \frac{1}{2\alpha\beta^2}(\alpha + w_1)(\beta^2 - w_2^2), \quad \kappa_2 = \frac{1}{2\alpha\beta^2}(\alpha - w_1)(\beta^2 - w_2^2), $$

$$ \kappa_3 = \frac{1}{4\alpha\beta^2}(\alpha + w_1)(w_2^2 - \beta w_2), \quad \kappa_4 = \frac{1}{4\alpha\beta^2}(\alpha - w_1)(w_2^2 - \beta w_2), $$

$$ \kappa_5 = \frac{1}{4\alpha\beta^2}(\alpha + w_1)(w_2^2 + \beta w_2), \quad \kappa_6 = \frac{1}{4\alpha\beta^2}(\alpha - w_1)(w_2^2 + \beta w_2). $$

We can verify that $\kappa_1 + \kappa_2 + \kappa_3 + \kappa_4 + \kappa_5 + \kappa_6 = 1$, and $\kappa_i\kappa_j = \delta_{ij}$ (Kronecker delta) for $i, j \in \{1, 2, \dots, 6\}$. Consequently, the set $\{\kappa_1, \kappa_2, \dots, \kappa_6\}$ forms a set of non-zero pairwise orthogonal idempotent elements in $\mathcal{R}$. This implies that $\mathcal{R}$ can be expressed as a sum of submodules as follows:

$$ \begin{aligned} \mathcal{R} &= \kappa_1 \mathcal{R} \oplus \kappa_2 \mathcal{R} \oplus \kappa_3 \mathcal{R} \oplus \kappa_4 \mathcal{R} \oplus \kappa_5 \mathcal{R} \oplus \kappa_6 \mathcal{R} \\ &\cong \kappa_1 \mathbb{F}_p \oplus \kappa_2 \mathbb{F}_p \oplus \kappa_3 \mathbb{F}_p \oplus \kappa_4 \mathbb{F}_p \oplus \kappa_5 \mathbb{F}_p \oplus \kappa_6 \mathbb{F}_p. \end{aligned} $$

Therefore, any element $r = a + w_1b + w_2c + w_2^2d + w_1w_2e + w_1w_2^2f \in \mathcal{R}$ can be uniquely written as
$$ 
\begin{aligned}
r &= a + w_1 b + w_2 c + w_2^2 d + w_1 w_2 e + w_1 w_2^2 f \\
  &= \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f},
\end{aligned} 
\quad (1) $$

where

$$ \bar{a} = a + \alpha b, $$

$$ \bar{b} = a - \alpha b, $$

$$ \bar{c} = a + \alpha b - \beta c + \beta^2 d - \alpha \beta e + \alpha \beta^2 f, $$

$$ \bar{d} = a - \alpha b - \beta c + \beta^2 d + \alpha \beta e - \alpha \beta^2 f, $$

$$ \bar{e} = a + \alpha b + \beta c + \beta^2 d + \alpha \beta e + \alpha \beta^2 f, $$

$$ \bar{f} = a - \alpha b + \beta c + \beta^2 d - \alpha \beta e - \alpha \beta^2 f, $$

are the elements of $\mathbb{F}_p$.

Suppose that $GL_n(\mathbb{F}_p)$ is the group of invertible matrices of order $n$ over $\mathbb{F}_p$ and let $\mathbf{N} \in GL_6(\mathbb{F}_p)$ in such a way that $\mathbf{NN}^T = kI_6$, where $\mathbf{N}^T$ is the transpose of the matrix $\mathbf{N}$, $I_6$ is the identity matrix of order 6, and $k \in \mathbb{F}_p - \{0\}$. With the above notation, we define a Gray map associated with an invertible matrix $\mathbf{N}$ as follows:

$$ \nabla : \mathcal{R} \longrightarrow \mathbb{F}_p^6 \text{ such that } \nabla(r) := (\bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{e}, \bar{f})\mathbf{N}. $$

We can extend the Gray map $\nabla$ for each component individually, as follows:

$$ \nabla : \mathcal{R}^l \longrightarrow \mathbb{F}_p^{6l} \text{ such that} $$

$$ \nabla(r_0, r_1, \dots, r_{l-1}) = ((\bar{a}_0, \bar{b}_0, \bar{c}_0, \bar{d}_0, \bar{e}_0, \bar{f}_0)\mathbf{N}, (\bar{a}_1, \bar{b}_1, \bar{c}_1, \bar{d}_1, \bar{e}_1, \bar{f}_1)\mathbf{N}, \dots, (\bar{a}_{l-1}, \bar{b}_{l-1}, \bar{c}_{l-1}, \bar{d}_{l-1}, \bar{e}_{l-1}, \bar{f}_{l-1})\mathbf{N}), \quad (2) $$

where $r_i = \kappa_1 \bar{a}_i + \kappa_2 \bar{b}_i + \kappa_3 \bar{c}_i + \kappa_4 \bar{d}_i + \kappa_5 \bar{e}_i + \kappa_6 \bar{f}_i \in \mathcal{R}$, for $i \in \{0, 1, \dots, l-1\}$. Here, we introduce the Lee weight for the vector $r \in \mathcal{R}$ as $w_L(r) = w_H(\nabla(r))$, where $w_L$ (resp. $w_H$) denotes the Lee weight (resp. the Hamming weight). The Lee weight of $w_L$ ($r = (r_0, r_1, \dots, r_{l-1})$) is $w_L(r_0) + w_L(r_1) + \dots + w_L(r_{l-1})$ and the Lee distance from $r$ to $r' \in \mathcal{R}^l$, is established as $d_L(r, r') = w_L(r - r') = w_H(\nabla(r - r'))$. The Lee distance $d_L(C)$ for the code $C$ is defined as follows:

$$ d_L(C) = \min\{d_L(r, r') \mid r \neq r'\}. $$

It is notable that the Gray map $\nabla$ is a linear map over $\mathbb{F}_p$ that preserves distances and mapping vectors from $\mathcal{R}^l$ to $\mathbb{F}_p^{6l}$. Since the Gray map $\nabla$ is bijective, it follows that $\nabla(C)$ forms a $[6l, k, d_H]$ linear code over $\mathbb{F}_p$, where $d_L$ is equal to $d_H$.

The Euclidean inner product of any two vectors, $r = (r_0, r_1, \dots, r_{l-1})$ and $r' = (r'_0, r'_1, \dots, r'_{l-1})$ in $\mathcal{R}^l$ is defined as $r \cdot r' = r_0 r'_0 + r_1 r'_1 + \dots + r_{l-1} r'_{l-1}$. The dual code of $C$ is formulated as $C^\perp = \{r \in \mathcal{R}^l \mid r \cdot r' = 0 \forall r' \in C\}$. A code $C$ is called dual-containing if $C^\perp \subseteq C$, self-orthogonal if $C \subseteq C^\perp$, and self-dual if $C^\perp = C$.

**Example 1.** Let $\mathcal{R}_3 = \frac{\mathbb{F}_3[w_1, w_2]}{\langle w_1^2 - 1, w_2^3 - w_2, w_1w_2 - w_2w_1 \rangle}$ be a finite commutative non-chain ring. Then, we have $w_1^2 - 1 = (w_1 - 1)(w_1 + 1)$ and $w_2^3 - w_2 = w_2(w_2 - 1)(w_2 + 1)$. Thus, the orthogonal idempotent elements in $\mathcal{R}_3$ are
$$ \kappa_1 = 2(1 + w_1)(1 + 2w_2^2), \quad \kappa_2 = \frac{1}{2}(1 - w_1)(1 - w_2^2) = 2(1 + 2w_1)(1 + 2w_2^2), $$

$$ \kappa_3 = (1 + w_1)(w_2^2 + 2w_2), \quad \kappa_4 = \frac{1}{4}(1 - w_1)(w_2^2 - w_2) = (1 + 2w_1)(w_2^2 + 2w_2), $$

$$ \kappa_5 = (1 + w_1)(w_2^2 + w_2), \quad \kappa_6 = \frac{1}{4}(1 - w_1)(w_2^2 + w_2) = (1 + 2w_1)(w_2^2 + w_2), $$

where $\kappa_1 + \kappa_2 + \kappa_3 + \kappa_4 + \kappa_5 + \kappa_6 = 1$. By Chinese Remainder Theorem, we have $\mathcal{R}_3 = \kappa_1 \mathcal{R}_3 \oplus \kappa_2 \mathcal{R}_3 \oplus \kappa_3 \mathcal{R}_3 \oplus \kappa_4 \mathcal{R}_3 \oplus \kappa_5 \mathcal{R}_3 \oplus \kappa_6 \mathcal{R}_3 \cong \kappa_1 \mathcal{F}_3 \oplus \kappa_2 \mathcal{F}_3 \oplus \kappa_3 \mathcal{F}_3 \oplus \kappa_4 \mathcal{F}_3 \oplus \kappa_5 \mathcal{F}_3 \oplus \kappa_6 \mathcal{F}_3$. Therefore, any element $r = a + w_1 b + w_2 c + w_2^2 d + w_1 w_2 e + w_1 w_2^2 f \in \mathcal{R}$ can be expressed as follows:

$$ \begin{aligned} r &= a + w_1 b + w_2 c + w_2^2 d + w_1 w_2 e + w_1 w_2^2 f \\ &= (a + b)\kappa_1 + (a + 2b)\kappa_2 + (a + b + 2c + d + 2e + f)\kappa_3 + (a + 2b + 2c + d + e + 2f)\kappa_4 + (a + b + c + d + e + f)\kappa_5 + (a + 2b + c + d + 2e + 2f)\kappa_6. \end{aligned} $$

Hence, the Gray map $\nabla : \mathcal{R}_3 \to \mathcal{F}_3^6$ can be established as follows:

$$ \nabla(r) := (a + b, a + 2b, a + b + 2c + d + 2e + f, a + 2b + 2c + d + e + 2f, a + b + c + d + e + f, a + 2b + c + d + 2e + 2f)\mathbf{N}_1, $$

where $a, b, c, d, e, f \in \mathcal{F}_3$, and $\mathbf{N}_1 \in \mathrm{GL}_6(\mathcal{F}_3)$, where

$$ \mathbf{N}_1 = \begin{bmatrix} 1 & 2 & 1 & 1 & 0 & 1 \\ 1 & 1 & 2 & 1 & 1 & 0 \\ 0 & 1 & 1 & 2 & 1 & 1 \\ 2 & 1 & 0 & 1 & 2 & 1 \\ 2 & 2 & 2 & 0 & 1 & 1 \\ 2 & 0 & 1 & 1 & 1 & 2 \end{bmatrix}, $$

which has the property that $\mathbf{N}_1 \mathbf{N}_1^T = 2I_6$.

**Example 2.** Let $\mathcal{R}_5 = \frac{\mathcal{F}_5[w_1, w_2]}{\langle w_1^2 - \alpha^2, w_2^2 - \beta^2 w_2, w_1 w_2 - w_2 w_1 \rangle}$ be a finite commutative non-chain ring, where $\alpha = 2$ and $\beta = 3$ are non-zero elements of $\mathcal{F}_5$. Then, we have $w_1^2 - \alpha^2 = (w_1 - 2)(w_1 + 2)$ and $w_2^3 - \beta^2 w_2 = w_2(w_2 - 3)(w_2 + 3)$. The orthogonal idempotent elements in $\mathcal{R}_5$ are as follows:

$$ \kappa_1 = 4(2 + w_1)(1 + w_2^2), \quad \kappa_2 = \frac{1}{2\alpha\beta^2}(\alpha - w_1)(\beta^2 - w_2^2) = 4(2 - w_1)(1 + w_2^2), $$

$$ \kappa_3 = 2(2 + w_1)(w_2^2 - 3w_2), \quad \kappa_4 = \frac{1}{4\alpha\beta^2}(\alpha - w_1)(w_2^2 - \beta w_2) = 2(2 - w_1)(w_2^2 - 3w_2), $$

$$ \kappa_5 = 2(2 + w_1)(w_2^2 + 3w_2), \quad \kappa_6 = \frac{1}{4\alpha\beta^2}(\alpha - w_1)(w_2^2 + \beta w_2) = 2(2 - w_1)(w_2^2 + 3w_2), $$

where $\kappa_1 + \kappa_2 + \kappa_3 + \kappa_4 + \kappa_5 + \kappa_6 = 1$. By Chinese Remainder Theorem, we have $\mathcal{R}_5 = \kappa_1 \mathcal{R}_5 \oplus \kappa_2 \mathcal{R}_5 \oplus \kappa_3 \mathcal{R}_5 \oplus \kappa_4 \mathcal{R}_5 \oplus \kappa_5 \mathcal{R}_5 \oplus \kappa_6 \mathcal{R}_5 \cong \kappa_1 \mathcal{F}_5 \oplus \kappa_2 \mathcal{F}_5 \oplus \kappa_3 \mathcal{F}_5 \oplus \kappa_4 \mathcal{F}_5 \oplus \kappa_5 \mathcal{F}_5 \oplus \kappa_6 \mathcal{F}_5$. Therefore, any element $r = a + w_1 b + w_2 c + w_2^2 d + w_1 w_2 e + w_1 w_2^2 f \in \mathcal{R}$ can be expressed as follows:

$$ \begin{aligned} r &= a + w_1 b + w_2 c + w_2^2 d + w_1 w_2 e + w_1 w_2^2 f \\ &= (a + 2b)\kappa_1 + (a + 3b)\kappa_2 + (a + 2b + 2c + 4d + 4e + 3f)\kappa_3 + (a + 3b + 2c + 4d + e + 2f)\kappa_4 + (a + 2b + 3c + 4d + e + 3f)\kappa_5 + (a + 3b + 3c + 4d + 4e + 2f)\kappa_6. \end{aligned} $$
The Gray map $\nabla : \mathcal{R}_5 \to \mathbb{F}_5^6$ can be established as follows:

$$ \nabla(r) := (a + 2b, a + 3b, a + 2b + 2c + 4d + 4e + 3f, a + 3b + 2c + 4d + e + 2f, a + 2b + 3c + 4d + e + 3f, a + 3b + 3c + 4d + 4e + 2f)\mathbf{N}_2, $$

where $a, b, c, d, e, f \in \mathbb{F}_5$, and $\mathbf{N}_2 \in \text{GL}_6(\mathbb{F}_5)$, where

$$ \mathbf{N}_2 = \begin{pmatrix} 3 & 1 & 1 & 1 & 1 & 1 \\ 1 & 3 & 1 & 1 & 1 & 1 \\ 1 & 1 & 3 & 1 & 1 & 1 \\ 1 & 1 & 1 & 3 & 1 & 1 \\ 1 & 1 & 1 & 1 & 3 & 1 \\ 1 & 1 & 1 & 1 & 1 & 3 \end{pmatrix}, $$

which has the property that $\mathbf{N}_2\mathbf{N}_2^T = 4I_6$.

**Theorem 1.** The Gray map $\nabla : \mathcal{R}^l \to \mathbb{F}_p^{6l}$ defined in Equation (2) is linear and isometric.

**Proof.** To prove that $\nabla$ is a linear map, assume that $z = a_1\kappa_1 + a_2\kappa_2 + a_3\kappa_3 + a_4\kappa_4 + a_5\kappa_5 + a_6\kappa_6$ and $y = b_1\kappa_1 + b_2\kappa_2 + b_3\kappa_3 + b_4\kappa_4 + b_5\kappa_5 + b_6\kappa_6$ are any two elements of $\mathcal{R}$ and $\lambda$ is a non-zero scalar in $\mathbb{F}_p$. Then, we have

$$ \begin{aligned} \nabla(z + y) &= (a_1 + b_1, a_2 + b_2, a_3 + b_3, a_4 + b_4, a_5 + b_5, a_6 + b_6)\mathbf{N} \\ &= [(a_1, a_2, a_3, a_4, a_5, a_6) + (b_1, b_2, b_3, b_4, b_5, b_6)]\mathbf{N} \\ &= (a_1, a_2, a_3, a_4, a_5, a_6)\mathbf{N} + (b_1, b_2, b_3, b_4, b_5, b_6)\mathbf{N} \\ &= \nabla(z) + \nabla(y), \end{aligned} $$

$$ \begin{aligned} \nabla(\lambda \cdot z) &= (\lambda a_1, \lambda a_2, \lambda a_3, \lambda a_4, \lambda a_5, \lambda a_6)\mathbf{N} \\ &= \lambda(a_1, a_2, a_3, a_4, a_5, a_6)\mathbf{N} \\ &= \lambda \nabla(z). \end{aligned} $$

This ensures that $\nabla$ is a linear map. To prove that $\nabla$ is an isometry, we shall show that the Lee distance and the Hamming distance of code C are the same. As $z, y \in \mathcal{R}^l$, then by definition of the Lee distance, we see that

$$ d_L(z, y) = wt_H(\nabla(z - y)) = wt_H(\nabla(z) - \nabla(y)) = d_H(\nabla(z), \nabla(y)). \quad (3) $$

Therefore, the Gray map $\nabla$ is an isometry. $\square$

**Theorem 2.** Let C be a linear code with parameters $[l, k, d_L]$ over $\mathcal{R}$.

(i) Then, $\nabla(C)$ is a linear code with parameters $[6l, k, d_H]$ over $\mathbb{F}_p$, where $d_L$ and $d_H$ are the same.

(ii) The image $\nabla(C)$ is self-orthogonal over $\mathbb{F}_p$, provided C is self-orthogonal over $\mathcal{R}$.

(iii) The image $\nabla(C)$ is a dual-containing code over $\mathbb{F}_p$, provided C is a dual-containing code over $\mathcal{R}$.

(iv) C is a self-dual code over $\mathcal{R}$ if and only if $\nabla(C)$ is a self-dual code over $\mathbb{F}_p$.

**Proof.**

(i) The proof follows by Theorem 1.

(ii) If C is self-orthogonal over $\mathcal{R}$. Then, for any codewords $z = (z_1, z_2, \dots, z_l)$ and $y = (y_1, y_2, \dots, y_l)$ in C, where $z_i = a_i^1\kappa_1 + a_i^2\kappa_2 + a_i^3\kappa_3 + a_i^4\kappa_4 + a_i^5\kappa_5 + a_i^6\kappa_6$ and $y_i = b_i^1\kappa_1 + b_i^2\kappa_2 + b_i^3\kappa_3 + b_i^4\kappa_4 + b_i^5\kappa_5 + b_i^6\kappa_6$ are elements of $\mathcal{R}$ for $1 \le i \le l$, we have $z \cdot y = 0$. This suggests that $a_j^1b_j^1 + a_j^2b_j^2 + \dots + a_j^lb_j^l = 0$ for $1 \le j \le 6$. Let $z', y' \in \nabla(C)$ be any two elements, then some $z, y \in C$ exists such that $z' = \nabla(z)$ and $y' = \nabla(y)$, i.e.,
$$
\begin{align*}
z' &= (\nabla(z_1), \nabla(z_2), \dots, \nabla(z_l)) \\
  &= ((a_1^1, a_2^1, a_3^1, a_4^1, a_5^1, a_6^1)\mathbf{N}, (a_1^2, a_2^2, a_3^2, a_4^2, a_5^2, a_6^2)\mathbf{N}, \dots, (a_1^l, a_2^l, a_3^l, a_4^l, a_5^l, a_6^l)\mathbf{N}), \\
y' &= (\nabla(y_1), \nabla(y_2), \dots, \nabla(y_l)) \\
  &= ((b_1^1, b_2^1, b_3^1, b_4^1, b_5^1, b_6^1)\mathbf{N}, (b_1^2, b_2^2, b_3^2, b_4^2, b_5^2, b_6^2)\mathbf{N}, \dots, (b_1^l, b_2^l, b_3^l, b_4^l, b_5^l, b_6^l)\mathbf{N}),
\end{align*}
$$

where $\mathbf{N} \in GL_6(\mathbb{F}_p)$ such that $\mathbf{N}\mathbf{N}^T = \lambda I_6$, $\lambda \in \mathbb{F}_p - \{0\}$. Now, we have

$$
\begin{align*}
z' \cdot y' &= \nabla(z) \cdot \nabla(y) = \nabla(z) \cdot \nabla(y)^T \\
&= \sum_{i=1}^{l} (a_1^i, a_2^i, a_3^i, a_4^i, a_5^i, a_6^i) \mathbf{N} \mathbf{N}^T \cdot (b_1^i, b_2^i, b_3^i, b_4^i, b_5^i, b_6^i) \\
&= \sum_{i=1}^{l} (a_1^i, a_2^i, a_3^i, a_4^i, a_5^i, a_6^i) \lambda I_6 \cdot (b_1^i, b_2^i, b_3^i, b_4^i, b_5^i, b_6^i) \\
&= \sum_{i=1}^{l} \lambda (a_1^i b_1^i + a_2^i b_2^i + a_3^i b_3^i + a_4^i b_4^i + a_5^i b_5^i + a_6^i b_6^i) \\
&= \sum_{i=j}^{6} \lambda (a_j^1 b_j^1 + a_j^2 b_j^2 + \dots + a_j^l b_j^l) = 0.
\end{align*}
$$

Thus, we have $z' \cdot y' = \nabla(z) \cdot \nabla(y) = 0$ for all $z', y' \in \nabla(C)$ if $C$ is self-orthogonal over $\mathcal{R}$. Hence, $\nabla(C)$ is a self-orthogonal code of length $6l$ over $\mathbb{F}_p$, provided $C$ is a self-orthogonal code over $\mathcal{R}$.

(iii) Suppose that $C^{\perp} \subseteq C$, then by the linearity of $\nabla$, we have $\nabla(C^{\perp}) \subseteq \nabla(C)$. To prove that $\nabla(C)$ is dual-containing, it remains to show that $\nabla(C^{\perp}) = \nabla(C)^{\perp}$. For this, let $z = (z_1, z_2, \dots, z_l) \in C$ and $y = (y_1, y_2, \dots, y_l) \in C^{\perp}$, where $z_i = a_1^i \kappa_1 + a_2^i \kappa_2 + a_3^i \kappa_3 + a_4^i \kappa_4 + a_5^i \kappa_5 + a_6^i \kappa_6$ and $y_i = b_1^i \kappa_1 + b_2^i \kappa_2 + b_3^i \kappa_3 + b_4^i \kappa_4 + b_5^i \kappa_5 + b_6^i \kappa_6$ are elements of $\mathcal{R}$ for $1 \le i \le l$. Now, $x \cdot y = 0$ gives that $a_j^1 b_j^1 + a_j^2 b_j^2 + \dots + a_j^l b_j^l = 0$ for $1 \le j \le 6$. Consider

$$
\begin{align*}
\nabla(z) &= ((a_1^1, a_2^1, a_3^1, a_4^1, a_5^1, a_6^1)\mathbf{N}, (a_1^2, a_2^2, a_3^2, a_4^2, a_5^2, a_6^2)\mathbf{N}, \dots, (a_1^l, a_2^l, a_3^l, a_4^l, a_5^l, a_6^l)\mathbf{N}), \\
\nabla(y) &= ((b_1^1, b_2^1, b_3^1, b_4^1, b_5^1, b_6^1)\mathbf{N}, (b_1^2, b_2^2, b_3^2, b_4^2, b_5^2, b_6^2)\mathbf{N}, \dots, (b_1^l, b_2^l, b_3^l, b_4^l, b_5^l, b_6^l)\mathbf{N}),
\end{align*}
$$

Now, $\nabla(z) \cdot \nabla(y) = 0$ suggests that $\nabla(y) \in \nabla(C)^{\perp}$. Thus, we have $\nabla(C^{\perp}) \subseteq \nabla(C)^{\perp}$. Contrarily, $\nabla$ is a bijective linear map, so the sizes of $\nabla(C^{\perp})$ and $\nabla(C)^{\perp}$ are the same. Thus, $\nabla(C^{\perp}) = \nabla(C)^{\perp}$. Hence, $\nabla(C)$ is a dual-containing code over $\mathbb{F}_p$ provided $C$ is a dual-containing code over $\mathcal{R}$.

(iv) It follows from part (iii). □

<figure><img src="image_4.png" /></figure>

**Theorem 3** ([11]). Let $C = \kappa_1\bar{C}_1 \oplus \kappa_2\bar{C}_2 \oplus \kappa_3\bar{C}_3 \oplus \kappa_4\bar{C}_4 \oplus \kappa_5\bar{C}_5 \oplus \kappa_6\bar{C}_6$ be a linear code over $\mathcal{R}$. Then:

(i) $C^{\perp} = \kappa_1\bar{C}_1^{\perp} \oplus \kappa_2\bar{C}_2^{\perp} \oplus \kappa_3\bar{C}_3^{\perp} \oplus \kappa_4\bar{C}_4^{\perp} \oplus \kappa_5\bar{C}_5^{\perp} \oplus \kappa_6\bar{C}_6^{\perp}$;

(ii) $C$ is self-dual over $\mathcal{R}$ if $\bar{C}_i$ are self-dual codes over $\mathbb{F}_p$ for $1 \le i \le 6$.

Here, we define the direct sum and the direct product as defined by Dinh et al. [24] in the following ways:

$$
D_1 \oplus D_2 = \{d_1 + d_2 \mid d_j \in D_j; j = 1, 2\}, \quad (4)
$$

$$
D_1 \otimes D_2 = \{(d_1, d_2) \mid d_j \in D_j; j = 1, 2\}. \quad (5)
$$
Suppose that C is a linear code with length l over $\mathbb{R}$. Consider the following sets:

$$ \bar{C}_1 = \{ \bar{a} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{b}, \bar{c}, \bar{d}, \bar{e}, \bar{f} \in \mathbb{F}_p^l \} $$

$$ \bar{C}_2 = \{ \bar{b} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{a}, \bar{c}, \bar{d}, \bar{e}, \bar{f} \in \mathbb{F}_p^l \} $$

$$ \bar{C}_3 = \{ \bar{c} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{a}, \bar{b}, \bar{d}, \bar{e}, \bar{f} \in \mathbb{F}_p^l \} $$

$$ \bar{C}_4 = \{ \bar{d} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{a}, \bar{b}, \bar{c}, \bar{e}, \bar{f} \in \mathbb{F}_p^l \} $$

$$ \bar{C}_5 = \{ \bar{e} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{f} \in \mathbb{F}_p^l \} $$

$$ \bar{C}_6 = \{ \bar{f} \in \mathbb{F}_p^l | \kappa_1 \bar{a} + \kappa_2 \bar{b} + \kappa_3 \bar{c} + \kappa_4 \bar{d} + \kappa_5 \bar{e} + \kappa_6 \bar{f} \in C; \text{ for some } \bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{e} \in \mathbb{F}_p^l \} $$

It can be seen that $\bar{C}_i$ for $1 \le i \le 6$ is a linear code with length $l$ over $\mathbb{F}_p$. Therefore, we can express a linear code C with length $l$ over $\mathbb{R}$ as $C = \kappa_1 \bar{C}_1 \oplus \kappa_2 \bar{C}_2 \oplus \kappa_3 \bar{C}_3 \oplus \kappa_4 \bar{C}_4 \oplus \kappa_5 \bar{C}_5 \oplus \kappa_6 \bar{C}_6$. If $G_i$ is the generator matrix of $\bar{C}_i$ for $1 \le i \le 6$, then the generator matrix $\nabla(G)$ of the Gray image $\nabla(C)$ is given as follows:

$$ \nabla(G) = \begin{bmatrix} \nabla(\kappa_1 G_1) \\ \nabla(\kappa_2 G_2) \\ \nabla(\kappa_3 G_3) \\ \nabla(\kappa_4 G_4) \\ \nabla(\kappa_5 G_5) \\ \nabla(\kappa_6 G_6) \end{bmatrix} $$

### 3. $\Lambda$-Constacyclic Codes over $\mathbb{R}$

A constacyclic code is an important class of linear error-correcting codes. It is a generalization of cyclic codes, which are themselves a subset of linear codes. Suppose that $\Lambda = \kappa_1 a + \kappa_2 b + \kappa_3 c + \kappa_4 d + \kappa_5 e + \kappa_6 f$ is a unit element in $\mathbb{R}$. Then, a linear code C with length $l$ over $\mathbb{R}$ is called a $\Lambda$-constacyclic code if, for any codeword $c = (c_0, c_1, \dots, c_{l-1})$ in C, it satisfies the property that $\omega_{\Lambda}(c) = (\Lambda c_{l-1}, c_0, \dots, c_{l-2})$ is again a member of C. In particular, if $\Lambda = 1$, then $\Lambda$-constacyclic code C becomes a cyclic code, and if $\Lambda = -1$, then C becomes a negacyclic code.

**Lemma 1.** Let $\Lambda = \kappa_1 a + \kappa_2 b + \kappa_3 c + \kappa_4 d + \kappa_5 e + \kappa_6 f \in \mathbb{R}$ be a non-zero element. Then, the element $\Lambda \in \mathbb{R}$ is a unit element in $\mathbb{R}$ if $a, b, c, d, e, f$ are unit elements in $\mathbb{F}_p$. Moreover, when $\Lambda \in \mathbb{R}$ is a unit element, then its inverse is given by $\Lambda^{-1} = \kappa_1 a^{-1} + \kappa_2 b^{-1} + \kappa_3 c^{-1} + \kappa_4 d^{-1} + \kappa_5 e^{-1} + \kappa_6 f^{-1}$.

**Proof.** Suppose that $\Lambda = \kappa_1 a + \kappa_2 b + \kappa_3 c + \kappa_4 d + \kappa_5 e + \kappa_6 f \in \mathbb{R}$ is a unit element. Then, an element $\Lambda_1 = \kappa_1 a_1 + \kappa_2 b_1 + \kappa_3 c_1 + \kappa_4 d_1 + \kappa_5 e_1 + \kappa_6 f_1 \in \mathbb{R}$ exists such that $\Lambda \Lambda_1 = 1$. Using the idempotent orthogonality of $\kappa_i$ for $1 \le i \le 6$, we have $\kappa_1 a_1 + \kappa_2 b_1 + \kappa_3 c_1 + \kappa_4 d_1 + \kappa_5 e_1 + \kappa_6 f_1 = 1$. Putting the values of $\kappa_i$ for $1 \le i \le 6$ and comparing the constant term and coefficients of $w_1, w_2, w_2^2, w_1 w_2, w_1 w_2^2$, we obtain

$$ \begin{align*} aa_1 + bb_1 &= 2, \\ aa_1 - bb_1 &= 0, \\ -cc_1 - dd_1 + ee_1 + ff_1 &= 0, \\ cc_1 + dd_1 + ee_1 + ff_1 &= 4, \\ -cc_1 + dd_1 + ee_1 - ff_1 &= 0, \\ cc_1 - dd_1 + ee_1 - ff_1 &= 0. \end{align*} $$

Solving these equations, we obtain $aa_1 = 1, bb_1 = 1, cc_1 = 1, dd_1 = 1, ee_1 = 1$, and $ff_1 = 1$. Therefore, we have $\Lambda^{-1} = \kappa_1 a^{-1} + \kappa_2 b^{-1} + \kappa_3 c^{-1} + \kappa_4 d^{-1} + \kappa_5 e^{-1} + \kappa_6 f^{-1}$.

The converse part can be performed in a similar way. $\square$
**Theorem 4.** Let $C = \kappa_1\bar{C}_1 \oplus \kappa_2\bar{C}_2 \oplus \kappa_3\bar{C}_3 \oplus \kappa_4\bar{C}_4 \oplus \kappa_5\bar{C}_5 \oplus \kappa_6\bar{C}_6$ be a linear code over $\mathbb{R}$ and $\Lambda = \kappa_1\Lambda_1 + \kappa_2\Lambda_2 + \kappa_3\Lambda_3 + \kappa_4\Lambda_4 + \kappa_5\Lambda_5 + \kappa_6\Lambda_6 \in \mathbb{R}$ be a unit element. Then, $C$ is a $\Lambda$-constacyclic code over $\mathbb{R}$ if $\bar{C}_i$ is a $\Lambda_i$-constacyclic code for $1 \le i \le 6$ over $\mathbb{F}_p$.

**Proof.** Suppose that $C$ is a $\Lambda$-constacyclic code with length $l$ over $\mathbb{R}$. If $c = (r_0, r_1, \dots, r_{l-1}) \in C$, where $r_j = \kappa_1 a_{1,j} + \kappa_2 a_{2,j} + \kappa_3 a_{3,j} + \kappa_4 a_{4,j} + \kappa_5 a_{5,j} + \kappa_6 a_{6,j}$ such that $a_{i,j} \in \mathbb{F}_p$ for $1 \le i \le 6$ and $0 \le j \le l-1$, then we have $(a_{i,0}, a_{i,1}, \dots, a_{i,l-1}) \in \bar{C}_i$. Thus, the $\Lambda$-constacyclic shift of $c$ is $\omega_{\Lambda}(c) = (\Lambda r_{l-1}, r_0, \dots, r_{l-2}) \in C$, where

$$ \Lambda r_{l-1} = \kappa_1 \Lambda_1 a_{1,l-1} + \kappa_2 \Lambda_2 a_{2,l-1} + \kappa_3 \Lambda_3 a_{3,l-1} + \kappa_4 \Lambda_4 a_{4,l-1} + \kappa_5 \Lambda_5 a_{5,l-1} + \kappa_6 \Lambda_6 a_{6,l-1}. $$

Therefore, we obtain $\omega_{\Lambda}(c) = \sum_{i=1}^6 \kappa_i (\Lambda_i a_{i,l-1}, a_{i,0}, a_{i,1}, \dots, a_{i,l-2}) \in C$, which leads to $(\Lambda_i a_{i,l-1}, a_{i,0}, a_{i,1}, \dots, a_{i,l-2}) \in \bar{C}_i$. Therefore, $\bar{C}_i$ is a $\Lambda_i$-constacyclic code for $1 \le i \le 6$ of length $l$ over $\mathbb{F}_p$.

Conversely, assume that $\bar{C}_i$ is a $\Lambda_i$-constacyclic code of length $l$ over $\mathbb{F}_p$ for $1 \le i \le 6$. Then, for a vector $\bar{a}_i = (a_{i,0}, a_{i,1}, \dots, a_{i,l-1}) \in \bar{C}_i$, we have $\omega_{\Lambda_i}(\bar{a}_i) = (\Lambda_i a_{i,l-1}, a_{i,0}, a_{i,1}, \dots, a_{i,l-2}) \in \bar{C}_i$. Thus, we have

$$ \sum_{i=1}^{6} \kappa_i \omega_{\Lambda_i}(\bar{a}_i) = \sum_{i=1}^{6} \kappa_i (\Lambda_i a_{i,l-1}, a_{i,0}, a_{i,1}, \dots, a_{i,l-2}) = (\Lambda r_{l-1}, r_0, \dots, r_{l-2}) = \omega_{\Lambda}(c). $$

Therefore, if $\bar{C}_i$ is a $\Lambda_i$-constacyclic code for $1 \le i \le 6$ of length $l$ over $\mathbb{F}_p$, then $C$ is a $\Lambda$-constacyclic code over $\mathbb{R}$. $\square$

**Theorem 5.** Let $C = \kappa_1\bar{C}_1 \oplus \kappa_2\bar{C}_2 \oplus \kappa_3\bar{C}_3 \oplus \kappa_4\bar{C}_4 \oplus \kappa_5\bar{C}_5 \oplus \kappa_6\bar{C}_6$ be a $\Lambda$-constacyclic code over $\mathbb{R}$ and $p_i(z) \in \frac{\mathbb{F}_p[z]}{\langle z^l - \Lambda_i \rangle}$ a unique monic polynomial of the lowest degree such that $\bar{C}_i = \langle p_i(z) \rangle$ and $p_i(z) \mid (z^l - \Lambda_i)$ for $1 \le i \le 6$. Then, $C = \langle p(z) \rangle$, where $p(z) = \kappa_1 p_1(z) + \kappa_2 p_2(z) + \kappa_3 p_3(z) + \kappa_4 p_4(z) + \kappa_5 p_5(z) + \kappa_6 p_6(z)$ and $p(z) \mid (z^l - \Lambda)$.

**Proof.** Suppose that $C = \kappa_1\bar{C}_1 \oplus \kappa_2\bar{C}_2 \oplus \kappa_3\bar{C}_3 \oplus \kappa_4\bar{C}_4 \oplus \kappa_5\bar{C}_5 \oplus \kappa_6\bar{C}_6$ is a $\Lambda$-constacyclic code with length $l$ over $\mathbb{R}$, then each $\bar{C}_i$ is a $\Lambda_i$-constacyclic code over $\mathbb{F}_p$ for $1 \le i \le 6$. Therefore, $\bar{C}_i \subseteq \frac{\mathbb{F}_p[z]}{\langle z^l - \Lambda_i \rangle}$ is a principal ideal generated by a monic polynomial $p_i(z) \in \frac{\mathbb{F}_p[z]}{\langle z^l - \Lambda_i \rangle}$ of lowest degree such that $p_i(z) \mid (z^l - \Lambda_i)$ for $1 \le i \le 6$. Thus, $\kappa_i p_i(z)$ are the generator polynomials of $C$.

If we take $p(z) = \kappa_1 p_1(z) + \kappa_2 p_2(z) + \kappa_3 p_3(z) + \kappa_4 p_4(z) + \kappa_5 p_5(z) + \kappa_6 p_6(z)$, then $\langle p(z) \rangle \subseteq C$. Furthermore, we see that $\kappa_i p(z) = \kappa_i p_i(z) \in \langle p(z) \rangle$ implies that $C \subseteq \langle p(z) \rangle$. Thus, we conclude that $C = \langle p(z) \rangle$.

Moreover, we have $p_i(z) \in \frac{\mathbb{F}_p[z]}{\langle z^l - \Lambda_i \rangle}$ such that $p_i(z) \mid (z^l - \Lambda_i)$. Thus, polynomials $q_i(z) \in \mathbb{F}_p[z]$ exist such that $(z^l - \Lambda_i) = p_i(z)q_i(z)$ for $1 \le i \le 6$. Thus, we have

$$ p(z) \left( \sum_{i=1}^{6} \kappa_i q_i(z) \right) = \sum_{i=1}^{6} \kappa_i p_i(z) q_i(z) = \kappa_i (z^l - \Lambda_i) = z^l - \Lambda. $$

Thus, we conclude that $p(z) \mid (z^l - \Lambda)$. $\square$

**Corollary 1.** Let $C = \oplus_{i=1}^6 \kappa_i \bar{C}_i$ be a $\Lambda$-constacyclic code over $\mathbb{R}$, and $\bar{C}_i = \langle p_i(z) \rangle$ such that $z^l - \Lambda_i = p_i(z)q_i(z)$ for $1 \le i \le 6$. Then:

(i) $C^{\perp} = \oplus_{i=1}^6 \kappa_i \bar{C}_i^{\perp}$ is a $\Lambda^{-1}$-constacyclic code over $\mathbb{R}$;

(ii) $C^{\perp} = \langle \sum_{i=1}^6 \kappa_i q_i^*(z) \rangle$, where $q_i^*(z)$ is the reciprocal polynomial of $q_i(z)$, which is defined as $q_i^*(z) = z^{\deg(q_i(z))} q_i(z^{-1})$ for $1 \le i \le 6$;

(iii) $|C^{\perp}| = p^{\sum_{i=1}^6 \deg(p_i(z))}$.
### 4. Dual-Containing Λ-Constacyclic Codes

The dual-containing code is a very important class of code for the construction of quantum error-correcting codes.

**Definition 1.** Suppose that C is a Λ-constacyclic code of length l over $\mathbb{R}$, where Λ is a unit element of $\mathbb{R}$. Then, C is said to be dual-containing if $C^{\perp} \subseteq C$.

**Proposition 1.** Let C be a Λ-constacyclic code over $\mathbb{R}$, where $\Lambda = \kappa_1\Lambda_1 + \kappa_2\Lambda_2 + \kappa_3\Lambda_3 + \kappa_4\Lambda_4 + \kappa_5\Lambda_5 + \kappa_6\Lambda_6 \in \mathbb{R}$. If C is a non-trivial dual-containing code, then $\Lambda_i = \pm 1$ for $1 \le i \le 6$, i.e., $\Lambda \in \{\pm\kappa_1 \pm \kappa_2 \pm \kappa_3 \pm \kappa_4 \pm \kappa_5 \pm \kappa_6\} \in \mathbb{R}$.

**Remark 1.** Suppose that C is a Λ-constacyclic code over $\mathbb{R}$, then from Proposition 1 we conclude that:

(i) If $\Lambda = 1$, then $\Lambda_i = 1$ and $C_i$ is a cyclic code over $\mathbb{F}_p$ for $1 \le i \le 6$.

(ii) If $\Lambda = -1$, then $\Lambda_i = -1$ and $C_i$ is a negacyclic code over $\mathbb{F}_p$ for $1 \le i \le 6$.

(iii) If $\Lambda_i = 1$ and $\Lambda_j = -1$, then $C_i$ is a cyclic code, and $C_j$ is a negacyclic code over $\mathbb{F}_p$ for $1 \le i \ne j \le 6$.

**Example 3.** Let C be a $(w_1 - w_2^2 - w_1w_2^2)$-constacyclic code over $\mathbb{R}$, then $\Lambda_1 = 1$ implies that $C_1$ is a cyclic code, and $\Lambda_j = -1$ further implies that $C_j$ is a negacyclic code for $2 \le j \le 6$ over $\mathbb{F}_p$.

**Example 4.** Let C be a $(1 - 2w_2^2)$-constacyclic code over $\mathbb{R}$, then $\Lambda_i = 1$ implies that $C_i$ is a cyclic code for $i = 1, 2$, and $\Lambda_j = -1$ further implies that $C_j$ is a negacyclic code for $3 \le j \le 6$ over $\mathbb{F}_p$.

**Example 5.** Let C be a $(1 - \frac{1}{2}w_2 - \frac{3}{2}w_2^2 - w_1w_2 + w_1w_2^2)$-constacyclic code over $\mathbb{R}$, then $\Lambda_i = 1$ implies that $C_i$ is a cyclic code for $i = 1, 2, 3$, and $\Lambda_j = -1$ further implies that $C_j$ is a negacyclic code for $j = 4, 5, 6$ over $\mathbb{F}_p$.

**Lemma 2 ([6]).** Let $C_j$ be a $\Lambda_j$-constacyclic code with generator polynomial $p_j(z)$ over $\mathbb{F}_p$. Then, $C_j$ is a dual-containing code if $z^n - \Lambda_j \equiv 0 \mod (p_j(z)p_j^*(z))$, where $\Lambda_j = \pm 1$ and $p_j^*(z)$ is the reciprocal polynomial of $p_j(z)$, for $j = 1, 2, \dots, 6$.

**Lemma 3.** Let C be a linear code over $\mathbb{R}$ and $C^{\perp}$ be the dual of C. If $\nabla$ is a Gray map as defined in Equation (2), then $\nabla(C^{\perp}) = \nabla(C)^{\perp}$. Moreover, if C is a self-orthogonal (self-dual) code over $\mathbb{R}$, then $\nabla(C)$ is a self-orthogonal (resp. self-dual) code over $\mathbb{F}_p$.

**Proof.** The set $K = \{\kappa_1, \kappa_2, \dots, \kappa_6\}$ forms a basis for 6-dimensional vector space $\mathbb{R}$ over $\mathbb{F}_p$. An element $r \in \mathbb{R}$ can be uniquely expressed as $r = \kappa_1 a_1 + \kappa_2 a_2 + \kappa_3 a_3 + \kappa_4 a_4 + \kappa_5 a_5 + \kappa_6 a_6$, where $a_i \in \mathbb{F}_p$ for $1 \le i \le 6$. Then, we have

$$ \nabla(r) = (a_1, a_2, a_3, a_4, a_5, a_6)M, $$

where $M \in GL_6(\mathbb{F}_p)$ such that $MM^T = \alpha I_6$ and $\alpha \in \mathbb{F}_p - \{0\}$. Let $z = (z_0, z_1, \dots, z_{l-1}) \in \mathbb{C} \subseteq \mathbb{R}^l$, where $z_j = \kappa_1 a_j^l + \kappa_2 a_j^{l+1} + \kappa_3 a_j^{l+2} + \kappa_4 a_j^{l+3} + \kappa_5 a_j^{l+4} + \kappa_6 a_j^{l+5} \in \mathbb{R}$ for $0 \le j \le l-1$. Then, we have $z = \kappa_1 a_1 + \kappa_2 a_2 + \kappa_3 a_3 + \kappa_4 a_4 + \kappa_5 a_5 + \kappa_6 a_6$, where $a_i = (a_i^0, a_i^1, \dots, a_i^{l-1}) \in \mathbb{F}_p$. Suppose that $y = \kappa_1 b_1 + \kappa_2 b_2 + \kappa_3 b_3 + \kappa_4 b_4 + \kappa_5 b_5 + \kappa_6 b_6 \in C^{\perp}$. Then, we obtain that $z \cdot y = 0$ implies that

$$ \kappa_1 a_1 b_1 + \kappa_2 a_2 b_2 + \kappa_3 a_3 b_3 + \kappa_4 a_4 b_4 + \kappa_5 a_5 b_5 + \kappa_6 a_6 b_6 = 0. $$

Since K is linearly independent, we obtain $a_i b_i = 0$ for $1 \le i \le 6$. Also, we have $\nabla(z) = (a_1, a_2, a_3, a_4, a_5, a_6)M \in \nabla(C)$ and $\nabla(y) = (b_1, b_2, b_3, b_4, b_5, b_6)M \in \nabla(C^{\perp})$. Consider
$$ 
\begin{aligned}
\nabla(z) \cdot \nabla(y) &= \nabla(z) \cdot \nabla(y)^T = (a_1, a_2, a_3, a_4, a_5, a_6)MM^T(b_1, b_2, b_3, b_4, b_5, b_6) \\
&= \alpha(a_1b_1 + a_2b_2 + a_3b_3 + a_4b_4 + a_5b_5 + a_6b_6) \\
&= 0.
\end{aligned}
$$

Therefore, $\nabla(y) \in \nabla(C)^{\perp}$, i.e., $\nabla(C^{\perp}) \subseteq \nabla(C)^{\perp}$. Since the Gray map $\nabla$ is bijective, $|\nabla(C^{\perp})| = |\nabla(C)^{\perp}|$ suggests that $\nabla(C^{\perp}) = \nabla(C)^{\perp}$. If C is a self-orthogonal code, then $C \subseteq C^{\perp}$, and hence, $\nabla(C) \subseteq \nabla(C^{\perp}) = \nabla(C)^{\perp}$. Therefore, $\nabla(C)$ is a self-orthogonal code.

<figure><img src="image_5.png" /></figure>

**Theorem 6 ([25]).** Let $C_1 = [n, k_1, d_1]_q$ and $C_2 = [n, k_2, d_2]_q$ be two linear codes over GF($q$) with $C_2^{\perp} \subseteq C_1$. Then, a QECC exists with parameters $[[n, k_1 + k_2 - n, d]]_q$, where $d = \min\{wt(v) : v \in (C_1 \setminus C_2^{\perp}) \cup (C_2 \setminus C_1^{\perp})\} \ge \min\{d_1, d_2\}$. Moreover, if $C_1$ is a dual-containing code, then a QECC with parameters $[[n, 2k_1 - n, d_1]]_q$ exists, where $d_1 = \min\{wt(v) : v \in C_1 \setminus C_1^{\perp}\}$.

**Theorem 7 ([6]).** Let C be a $\Lambda$-constacyclic code over $\mathbb{F}_p$ having a generator polynomial $p(z)$. Then, C is dual-containing if $(z^l - \Lambda) \equiv 0 \mod (p(z)p^*(z))$, where $\Lambda = \pm 1$.

The dual-containing cyclic and negacyclic codes over $\mathbb{F}_p$ are provided by Theorem 7. Using this outcome, we can now ascertain the prerequisites and requirements for $\Lambda$-constacyclic codes over $\mathcal{R}$ to have their duals, as demonstrated in the following theorem.

**Theorem 8.** Let $C = \bigoplus_{i=1}^6 \kappa_i \bar{C}_i$ be a $\Lambda$-constacyclic code of length $l$ over $\mathcal{R}$, where $\Lambda = \kappa_1 \Lambda_1 + \kappa_2 \Lambda_2 + \dots + \kappa_6 \Lambda_6 \in \mathcal{R}$ and $C = \langle p(z) \rangle = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \dots + \kappa_6 p_6(z) \rangle$, where $p_i(z)$ is the generating polynomial of code $\bar{C}_i$ over $\mathbb{F}_p$ for $1 \le i \le 6$. Then, C is a dual-containing code if and only if $(z^l - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$, where $\Lambda_i = \pm 1$ for $1 \le i \le 6$.

**Proof.** Suppose that $C = \bigoplus_{i=1}^6 \kappa_i \bar{C}_i$ is a $\Lambda$-constacyclic code over $\mathcal{R}$, where $\Lambda = \kappa_1 \Lambda_1 + \kappa_2 \Lambda_2 + \dots + \kappa_6 \Lambda_6 \in \mathcal{R}$. Then, by Theorem 4, the code $\bar{C}_i$ is a $\Lambda_i$-constacyclic code with generating polynomial $p_i(z)$ over $\mathbb{F}_p$. If C is a dual-containing code, then we have $\bigoplus_{i=1}^6 \kappa_i \bar{C}_i^{\perp} \subseteq \bigoplus_{i=1}^6 \kappa_i \bar{C}_i$. Since this expression is unique, we have $\bar{C}_i^{\perp} \subseteq \bar{C}_i$. Therefore, by Lemma 2 we have $(z^l - \Lambda_i) \equiv 0 \mod (p_i(z) \cdot p_i^*(z))$. $\square$

**Corollary 2.** Let $C = \bigoplus_{i=1}^6 \kappa_i \bar{C}_i$ be a $\Lambda$-constacyclic code over $\mathcal{R}$. Then, C is a dual-containing code over $\mathcal{R}$ if and only if $C_i$ is a dual-containing code over $\mathbb{F}_p$ for $1 \le i \le 6$.

**Theorem 9.** Let $C = \bigoplus_{i=1}^6 \kappa_i \bar{C}_i$ be a $\Lambda$-constacyclic code of length $l$ over $\mathcal{R}$, and $\nabla$ be the Gray map. If $\nabla(C)$ has parameters $[6l, k, d_H]$, where $k = k_1 + k_2 + \dots + k_6$ is the dimension of $\nabla(C)$ and $d_L$ is the Lee distance of C, if C is a dual-containing code, then a QECC exists with parameters $[6l, 2k - 6l, d_H]$ over $\mathbb{F}_p$.

**Proof.** Suppose that C is a dual-containing code over $\mathcal{R}$ and $\nabla$ is a Gray map. Then, $\nabla(C)$ is also a dual-containing code with parameters $[6l, k, d_H]$ over $\mathbb{F}_p$. Therefore, by Theorem 6, a QECC with parameters $[[6l, 2k - 6l, d_H]]_p$ exists over $\mathbb{F}_p$. $\square$

**Example 6.** Let $\mathcal{R}_3 = \frac{\mathbb{F}_3[w_1, w_2]}{\langle w_1^2 - 1, w_2^3 - w_2, w_1w_2 - w_2w_1 \rangle}$ be a finite non-chain ring. Suppose that $\Lambda = 2w_2^2 - 1$ is a unit element in $\mathcal{R}_3$. Then, $\Lambda_1 = \Lambda_2 = -1$ and $\Lambda_3 = \Lambda_4 = \Lambda_5 = \Lambda_6 = 1$. Thus, in $\mathbb{F}_3[z]$, we have

$$ 
\begin{aligned}
z^9 - 1 &= (z + 2)^9 \\
z^9 + 1 &= (z + 1)^9.
\end{aligned}
$$
Let $p_1(z) = p_2(z) = (z+1)^4$, $p_3(z) = p_4(z) = (z+2)$, and $p_5(z) = p_6(z) = 1$ be the generator polynomials of $\bar{C}_i$ for $1 \le i \le 6$, respectively. Then, $C = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \cdots + \kappa_6 p_6(z) \rangle$ is a $(2w_2^2 - 1)$-constacyclic code of length 9 over $\mathbb{F}_3$. Let $\mathbf{N}_1 \in GL_6(\mathbb{F}_3)$, as given in Example 1, then $\mathbf{N}_1 \mathbf{N}_1^T = 2I_6$ and the Gray image $\nabla(C)$ has the parameters $[54, 44, 4]$. Moreover, $(x^9 - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$ for $1 \le i \le 6$; thus, by Theorem 8, we find that $C$ is a dual-containing code; so, by Theorem 9, we have a QECC $[[54, 34, 4]]_3$, which is a new QECC with this parameter.

**Remark 2.** In the previous example, we have seen that the Gray image $\nabla(C)$ is a linear code with parameters $[54, 44, 4]$ over the field $\mathbb{F}_3$. Specifically, for a code with a length 9, the Gray image's length is 54, and its dimension is equal to the rational sum of the dimensions of the individual codes, yielding 44 as a result. Let $G_i$ denote the generator matrix of $\bar{C}_i = \langle p_i(z) \rangle$ for $i \in \{1, 2, \dots, 6\}$. Then, the generator matrix for $\nabla(C)$ is given in Section 2.

After providing the generator matrix $\nabla(G)$ as input to the Magma Computation System [22], it was determined that the minimum distance of $\nabla(C)$ is 4. Based on this computation, it is crucial to note that the minimum distance of the Gray image is greater than the distance of each $C_i$. As in Example 6, $d_H(C_1) = d_H(C_2) = 3$, $d_H(C_3) = d_H(C_4) = 2$, and $d_H(C_5) = d_H(C_6) = 1$, while the Lee distance is 4. Notably, employing the canonical Gray map rather than the Gray map $\nabla$ would result in a Lee distance of 1 instead of 4. Which underlines one of the primary advantages of using the Gray map $\nabla$.

**Example 7.** Let $\mathbb{R}_5 = \frac{\mathbb{F}_5[w_1, w_2]}{\langle w_1^2 - 4, w_2^2 - 4w_2, w_1w_2 - w_2w_1 \rangle}$ be a non-chain ring. Suppose that $\Lambda = 1 + w_2(1 + 3w_1)(1 + 3w_2)$ is a unit element in $\mathbb{R}_5$. Then, $\Lambda_1 = \Lambda_2 = \Lambda_3 = 1$ and $\Lambda_4 = \Lambda_5 = \Lambda_6 = -1$. Thus, in $\mathbb{F}_5[z]$, we have

$$z^{15} - 1 = (z + 4)^5 (z^2 + z + 1)^5 \\ z^{15} + 1 = (z + 1)^5 (z^2 + 4z + 1)^5.$$

Let $p_1(z) = (z^2 + z + 1)$, $p_2(z) = (z + 4)^2$, $p_3(z) = 1$, and $p_4(z) = p_5(z) = p_6(z) = (z + 1)$ be the generator polynomials of $\bar{C}_i$ for $1 \le i \le 6$, respectively. Then, $C = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \cdots + \kappa_6 p_6(z) \rangle$ is a $(1 + \frac{1}{2}(1 - w_1)(w_2 - w_2^2))$-constacyclic code with length 15 over $\mathbb{F}_5$. Let $\mathbf{N}_2 \in GL_6(\mathbb{F}_5)$, as given in Example 2, then $\mathbf{N}_2 \mathbf{N}_2^T = 4I_6$ and the Gray image $\nabla(C)$ has the parameters $[90, 83, 3]$. Moreover, $(z^{15} - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$ for $1 \le i \le 6$; thus, by Theorem 8, we find that $C$ is a dual-containing code; hence, by Theorem 9 we have a new QECC $[[90, 76, 3]]_5$, with this parameter. Again, here we can see that the distance of $\nabla(C) \ge d_H(\bar{C}_i)$ for $1 \le i \le 6$.

**Example 8.** Let $\mathbb{R}_5 = \frac{\mathbb{F}_5[w_1, w_2]}{\langle w_1^2+1, w_2^2-4w_2, w_1w_2-w_2w_1 \rangle}$ be a non-chain ring. Suppose that $\Lambda = 4$ is a unit element in $\mathbb{R}_5$. Then, $\Lambda_1 = -1 = \Lambda_2$ and $\Lambda_3 = 1 = \Lambda_4 = \Lambda_5 = \Lambda_6$. Thus, in $\mathbb{F}_5[z]$, we have

$$z^{35} - 1 = (z + 4)^5 (z^6 + z^5 + z^4 + z^3 + z^2 + z + 1)^5 \\ z^{35} + 1 = (z + 1)^5 (z^6 + 4z^5 + z^4 + 4z^3 + z^2 + 4z + 1)^5.$$

Let $p_1(z) = (z^6 + 4z^5 + z^4 + 4z^3 + z^2 + 4z + 1)$, $p_2(z) = (z + 1)^2$, $p_3(z) = 1$, and $p_4(z) = p_5(z) = p_6(z) = (z + 4)$ be the generator polynomials of $\bar{C}_i$ for $1 \le i \le 6$, respectively. Then, $C = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \cdots + \kappa_6 p_6(z) \rangle$ is a $\Lambda$-constacyclic code with length 35 over $\mathbb{F}_5$. Let $\mathbf{N}_2 \in GL_6(\mathbb{F}_5)$, as given in Example 2, then $\mathbf{N}_2 \mathbf{N}_2^T = 4I_6$ and the Gray image $\nabla(C)$ has the parameters $[210, 199, 3]$. Moreover, $(z^{35} - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$ for $1 \le i \le 6$; thus, by Theorem 8, we find that $C$ is a dual-containing code; so, by Theorem 9 we have an improved QECC $[[210, 188, 3]]_5$ against the existing code $[[210, 186, 3]]_5$ [14]. Here, we can see that the distance of $\nabla(C) \ge d_H(\bar{C}_i)$ for $1 \le i \le 6$.
**Example 9.** Let $\mathbb{R}_5$ be a non-chain ring, as in Example 7. Suppose that $\Lambda = 4 + w_2(2 + w_1)$ $(2 + w_2)$ is a unit element in $\mathbb{R}_5$. Then, $\Lambda_1 = -1 = \Lambda_2 = \Lambda_3$ and $\Lambda_4 = 1 = \Lambda_5 = \Lambda_6$. Thus, in $\mathbb{F}_5[z]$, we have

$$z^{45} - 1 = (z + 4)^5(z^2 + z + 1)^5(z^6 + z^3 + 1)^5 \\ z^{45} + 1 = (z + 1)^5(z^2 + 4z + 1)^5(z^6 + 4z^3 + 1)^5.$$

Let $p_1(z) = (z^6 + 4z^3 + 1)$, $p_2(z) = (z + 1)$, $p_3(z) = (z + 1)^2$, $p_4(z) = 1$, and $p_5(z) = p_6(z) = (z + 4)$ be the generator polynomials of $\bar{C}_i$ for $1 \le i \le 6$, respectively. Then, $C = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \dots + \kappa_6 p_6(z) \rangle$ is a $(4 + w_2(2 + w_1)(2 + w_2))$-constacyclic code with length 45 over $\mathbb{R}_5$. Let $\mathbf{N}_2 \in GL_6(\mathbb{F}_5)$, as given in Example 2, then $\mathbf{N}_2\mathbf{N}_2^T = 4I_6$ and the Gray image $\nabla(C)$ has the parameters $[270, 259, 3]$. Moreover, $(z^{45} - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$ for $1 \le i \le 6$; thus, by Theorem 8, we find that $C$ is a dual-containing code; thus, by Theorem 9 we have an improved QECC with parameters $[[270, 248, 3]]_5$ against the existing code $[[270, 246, 3]]_5$ [28]. Here, we can see that the distance of $\nabla(C) \ge d_H(\bar{C}_i)$ for $1 \le i \le 6$.

**Example 10.** Let $\mathbb{R}_7 = \frac{\mathbb{F}_7[w_1,w_2]}{\langle w_1^2 - 1, w_2^2 - w_2, w_1w_2 - w_2w_1 \rangle}$ be a non-chain ring. Suppose that $\Lambda = 2w_2^2 - 1$ is a unit element in $\mathbb{R}_7$. Then, $\Lambda_1 = -1 = \Lambda_2$ and $\Lambda_3 = \Lambda_4 = 1 = \Lambda_5 = \Lambda_6$. Thus, in $\mathbb{F}_7[z]$, we have

$$z^9 - 1 = (z + 3)(z + 5)(z + 6)(z^3 + 3)(z^3 + 5) \\ z^9 + 1 = (z + 1)(z + 2)(z + 4)(z^3 + 2)(z^3 + 4).$$

Let $p_1(z) = (z^3 + 2)$, $p_2(z) = 1$, and $p_3(z) = p_4(z) = (z + 3) = p_5(z) = p_6(z)$ be the generator polynomials of $\bar{C}_i$ for $1 \le i \le 6$, respectively. Then, $C = \langle \kappa_1 p_1(z) + \kappa_2 p_2(z) + \dots + \kappa_6 p_6(z) \rangle$ is a $(2w_2^2 - 1)$-constacyclic code of length 9 over $\mathbb{R}_7$. Let $\mathbf{N}_3 \in GL_6(\mathbb{F}_7)$ such that

$$N_3 = \begin{bmatrix} 3 & 2 & 2 & 2 & 2 & 2 \\ 2 & 3 & 2 & 2 & 2 & 2 \\ 2 & 2 & 3 & 2 & 2 & 2 \\ 2 & 2 & 2 & 3 & 2 & 2 \\ 2 & 2 & 2 & 2 & 3 & 2 \\ 2 & 2 & 2 & 2 & 2 & 3 \end{bmatrix},$$

then $\mathbf{N}_3\mathbf{N}_3^T = I_6$ and the Gray image $\nabla(C)$ has the parameters $[54, 47, 3]$. Moreover, $(z^9 - \Lambda_i) \equiv 0 \mod (p_i(z)p_i^*(z))$ for $1 \le i \le 6$; thus, by Theorem 8, we find that $C$ is a dual-containing code; so, by Theorem 9, we have a new QECC with parameters $[[54, 40, 3]]_7$. Here, one can see that the distance of $\nabla(C) \ge d_H(\bar{C}_i)$ for $1 \le i \le 6$.

**Note:** In Table 1, $q, n$, and $\Lambda$ represent the order of the field, the length of the code defined over $\mathbb{R}$, and the unit element in $\mathbb{R}$, respectively. $p_i(z)$ is a generator polynomial of $C_i$ for $i \in \{1, 2, \dots, 6\}$, $N_1, N_2, N_3$ are the invertible matrices over $\mathbb{F}_3, \mathbb{F}_5, \mathbb{F}_7$, respectively, used to define the Gray map $\nabla$. The parameters of the corresponding Gray image (dual-containing code) are denoted by $\nabla(C)$. $[[n, k, d]]$ and $[[n, k', d']]$ represent the parameters of the new QECC and existing QECC, respectively.
<table><caption>**Table 1.** Some new and improved QECCs over $\mathbb{F}_p$ from constacyclic codes over $\mathcal{R}_p$ for ($p = 3, 5, 7$).</caption><thead><tr><th>q</th><th>n</th><th>Λ</th><th>p<sub>1</sub>(z)</th><th>p<sub>2</sub>(z)</th><th>p<sub>3</sub>(z) = p<sub>4</sub>(z)</th><th>p<sub>5</sub>(x) = p<sub>6</sub>(x)</th><th>N</th><th>∇(C)</th><th>[[n, k, d]]</th><th>[[n, k', d']]</th></tr></thead><tbody><tr><td>3</td><td>9</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>11</td><td>12</td><td>1</td><td>1</td><td>N<sub>1</sub></td><td>[54, 52, 2]</td><td>[[54, 50, 2]]<sub>3</sub></td><td>[[54, 46, 2]]<sub>3</sub> [12]</td></tr><tr><td>3</td><td>9</td><td>2w<sub>2</sub><sup>2</sup> - 1</td><td>11011</td><td>11011</td><td>12</td><td>1</td><td>N<sub>1</sub></td><td>[54, 44, 4]</td><td>[[54, 34, 4]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>3</td><td>11</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>102221</td><td>1</td><td>102122</td><td>1</td><td>N<sub>1</sub></td><td>[66, 51, 3]</td><td>[[66, 36, 3]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>3</td><td>11</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>102221</td><td>102122</td><td>102122</td><td>1</td><td>N<sub>1</sub></td><td>[66, 46, 4]</td><td>[[66, 26, 4]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>3</td><td>11</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>102221</td><td>1</td><td>102122</td><td>1022122</td><td>N<sub>1</sub></td><td>[66, 41, 5]</td><td>[[66, 16, 5]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>3</td><td>13</td><td>2w<sub>2</sub><sup>2</sup> - 1</td><td>1021</td><td>1021</td><td>1102</td><td>1</td><td>N<sub>1</sub></td><td>[78, 66, 4]</td><td>[[78, 54, 4]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>3</td><td>18</td><td>1</td><td>11011</td><td>11011</td><td>12</td><td>1</td><td>N<sub>1</sub></td><td>[108, 98, 3]</td><td>[[108, 88, 3]]<sub>3</sub></td><td>New QECC</td></tr><tr><td>5</td><td>6</td><td>-1</td><td>134</td><td>13</td><td>12</td><td>12</td><td>N<sub>2</sub></td><td>[36, 29, 4]</td><td>[[36, 22, 4]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>18</td><td>-1</td><td>1003004</td><td>13</td><td>12</td><td>12</td><td>N<sub>2</sub></td><td>[108, 97, 4]</td><td>[[108, 86, 4]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>19</td><td>-1</td><td>1</td><td>1033234341</td><td>1033234341</td><td>1033234341</td><td>N<sub>2</sub></td><td>[114, 69, 6]</td><td>[[114, 24, 6]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>19</td><td>-1</td><td>1033234341</td><td>1033234341</td><td>1033234341</td><td>1033234341</td><td>N<sub>2</sub></td><td>[114, 60, 7]</td><td>[[114, 6, 7]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>20</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>10404</td><td>11</td><td>11</td><td>11</td><td>N<sub>2</sub></td><td>[120, 111, 3]</td><td>[[120, 102, 3]]<sub>5</sub></td><td>[[120, 96, 3]]<sub>5</sub> [14]</td></tr><tr><td>5</td><td>22</td><td>-w<sub>1</sub> - w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>111212</td><td>1</td><td>13</td><td>12</td><td>N<sub>2</sub></td><td>[132, 123, 4]</td><td>[[132, 114, 4]]<sub>5</sub></td><td>[[132, 110, 4]]<sub>5</sub> [21]</td></tr><tr><td>5</td><td>25</td><td>1 - 2w<sub>2</sub><sup>2</sup></td><td>1400041</td><td>1</td><td>11</td><td>11</td><td>N<sub>2</sub></td><td>[150, 140, 3]</td><td>[[150, 130, 3]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>25</td><td>1 - 2w<sub>2</sub><sup>2</sup></td><td>140000000014</td><td>1</td><td>11</td><td>11</td><td>N<sub>2</sub></td><td>[150, 135, 4]</td><td>[[150, 120, 4]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>5</td><td>40</td><td>1</td><td>12342</td><td>1</td><td>12</td><td>13</td><td>N<sub>2</sub></td><td>[240, 232, 3]</td><td>[[240, 224, 3]]<sub>5</sub></td><td>New QECC</td></tr><tr><td>7</td><td>7</td><td>1 - 2w<sub>2</sub><sup>2</sup></td><td>1436</td><td>1</td><td>11</td><td>11</td><td>N<sub>3</sub></td><td>[42, 35, 4]</td><td>[[42, 28, 4]]<sub>7</sub></td><td>New QECC</td></tr><tr><td>7</td><td>9</td><td>2w<sub>2</sub><sup>2</sup> - 1</td><td>1002</td><td>12</td><td>13</td><td>13</td><td>N<sub>3</sub></td><td>[54, 46, 4]</td><td>[[54, 38, 4]]<sub>7</sub></td><td>New QECC</td></tr><tr><td>7</td><td>14</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>10201</td><td>1331</td><td>11</td><td>11</td><td>N<sub>3</sub></td><td>[84, 73, 4]</td><td>[[84, 62, 4]]<sub>7</sub></td><td>New QECC</td></tr><tr><td>7</td><td>15</td><td>1 - 2w<sub>2</sub><sup>2</sup></td><td>153356</td><td>1</td><td>12</td><td>14</td><td>N<sub>3</sub></td><td>[90, 81, 4]</td><td>[[90, 72, 4]]<sub>7</sub></td><td>New QECC</td></tr><tr><td>7</td><td>18</td><td>-w<sub>1</sub> + w<sub>2</sub><sup>2</sup> + w<sub>1</sub>w<sub>2</sub><sup>2</sup></td><td>102</td><td>13026</td><td>12</td><td>12</td><td>N<sub>3</sub></td><td>[108, 98, 4]</td><td>[[108, 88, 4]]<sub>7</sub></td><td>New QECC</td></tr></tbody></table>
**5. Conclusions**

This article focuses on the exploration of constacyclic codes in the context of non-chain rings $\mathcal{R} = \frac{\mathbb{F}_p[u,v]}{\langle w_1^2 - a^2, w_2^2 - \beta^2 w_2, w_1w_2 - w_2w_1 \rangle}$, where $\alpha, \beta \in \mathbb{F}_p - \{0\}$ for a prime $p$. From this investigation, numerous new and improved quantum codes have been derived. Substantial potential exists for discovering additional quantum codes within the finite field $\mathbb{F}_p$ by considering prime powers instead of primes. Applying the Gray map $\nabla$ harnesses this potential. In a more general context, substituting the ring $\mathcal{R}$ with alternative commutative finite rings offers the prospect of developing many fresh quantum code constructions.

**Author Contributions:** Conceptualization, M.A.R. and P.S.; methodology, N.u.R., A.A. and M.F.A.; investigation, M.A.R., M.F.A., A.A. and M.K.G.; writing—original draft preparation, M.A.R., M.F.A., N.u.R., A.A. and A.N.K.; writing—review and editing, M.A.R., M.F.A., H.S., W.B. and N.u.R.; supervision, M.A.R. and A.A.; project administration, M.A.R., W.B., M.K.G., A.N.K., H.S. and P.S.; funding acquisition, M.A.R. and A.N.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research work was funded by the Institutional Fund Projects of Saudi Arabia under grant number IFPRC-167-130-2020. Therefore, the authors gratefully acknowledge technical and financial support from the Ministry of Education and King Abdulaziz University, Jeddah, Saudi Arabia.

**Data Availability Statement:** This article required no data set.

**Acknowledgments:** We appreciate the constructive feedback provided by the reviewers, which has greatly improved the quality of our work.

**Conflicts of Interest:** The authors declare no conflicts of interest.

**References**

1. Nielsen, M.A.; Chuang, I.L. *Quantum Computation and Quantum Information*, 10th ed.; Cambridge University Press: Cambridge, UK, 2010.

2. Qiang, W.C.; Sun, G.H.; Dong, Q.; Dong, S.H. Genuine multipartite concurrence for entanglement of Dirac fields in noninertial frames. *Phys. Rev. A* **2018**, *98*, 022320. [CrossRef]

3. Torres-Arenas, A.J.; Dong, Q.; Sun, G.H.; Qiang, W.C.; Dong, S.H. Entanglement measures of W-state in noninertial frames. *Phys. Lett. B* **2019**, *789*, 93–105. [CrossRef]

4. Shor, P.W. Scheme for reducing decoherence in quantum computer memory. *Phys. Rev. A* **1995**, *52*, R2493. [CrossRef] [PubMed]

5. Steane, A.M. Error correcting codes in quantum theory. *Phys. Rev. Lett.* **1996**, *77*, 793. [CrossRef] [PubMed]

6. Calderbank, A.R.; Rains, E.M.; Shor, P.M.; Sloane, N.J. Quantum error correction via codes over GF(4). *IEEE Trans. Inf. Theory* **1998**, *44*, 1369–1387. [CrossRef]

7. Grassl, M. Bounds on the Minimum Distance of Linear Codes and Quantum Codes. 2007. Available online: http://www.codetables.de (accessed on 1 January 2024).

8. Aydin, N.; Liu, P.; Yoshino, B. A Database of Quantum Codes. 2021. Available online: http://quantumcodes.info/ (accessed on 1 January 2024).

9. Bierbrauer, J.; Edel, Y. Some Good Quantum Twisted Codes. 2020. Available online: https://www.mathi.uni-heidelberg.de/yves/Matritzen/QTBCH/QTBCHIndex.html (accessed on 1 January 2024).

10. Bierbrauer, J.; Edel, Y. Quantum twisted codes. *J. Comb. Des.* **2000**, *8*, 174–188. [CrossRef]

11. Alahmadi, A.; Islam, H.; Prakash, O.; Solé, P.; Alkenani, A.; Muthana, N.; Hijazi, R. New quantum codes from constacyclic codes over a non-chain ring. *Quantum Inf. Process.* **2021**, *20*, 1–17. [CrossRef]

12. Bag, T.; Upadhyay, A.K.; Ashraf, M.; Mohammad, G. Quantum codes from cyclic codes over the ring $\mathbb{F}_p[u]/\langle u^3-u\rangle$. *Asian Eur. J. Math.* **2019**, *12*, 2050008. [CrossRef]

13. Dertli, A.; Cengellenmis, Y.; Eren, S. On quantum codes obtained from cyclic codes over $\mathbb{F}_2$. *Int. J. Quantum Inf.* **2015**, *13*, 1550031. [CrossRef]

14. Islam, H.; Prakash, O. New quantum codes from constacyclic and additive constacyclic codes. *Quantum Inf. Process.* **2020**, *19*, 1–17. [CrossRef]

15. Qian, J.; Ma, W.; Guo, W. Quantum codes from cyclic codes over finite ring. *Int. J. Quantum Inf.* **2009**, *7*, 1277–1283. [CrossRef]

16. Kai, X.; Zhu, S. Quaternary construction of quantum codes from cyclic codes over $\mathbb{F}_4 + u\mathbb{F}_4$. *Int. J. Quantum Inf.* **2011**, *9*, 689–700. [CrossRef]

17. Qian, J. Quantum Codes from Cyclic Codes over $F_2 + vF_2$. *J. Inf. Comput. Sci.* **2013**, *10*, 1715–1722. [CrossRef]

18. Ashraf, M.; Mohammad, G. Quantum codes from cyclic codes over $\mathbb{F}_p + u\mathbb{F}_p + v\mathbb{F}_p + uv\mathbb{F}_p$. *Quantum Inf. Process.* **2016**, *15*, 4089–4098. [CrossRef]
19. Li, J.; Gao, J.; Wang, Y. Quantum codes from $(1-2v)$-constacyclic codes over the ring $\mathbb{F}_p + u\mathbb{F}_p + v\mathbb{F}_p + uv\mathbb{F}_p$. *Discret. Math. Algorithms Appl.* **2018**, *10*, 1850046:1–1850046:11. [CrossRef]

20. Ma, F.; Gao, J.; Fu, F.W. Constacyclic codes over the ring $\mathbb{F}_q + v\mathbb{F}_q + v^2\mathbb{F}_q$ and their applications of constructing new non-binary quantum codes. *Quantum Inf. Process.* **2018**, *17*, 1–19. [CrossRef]

21. Ma, F.; Gao, J.; Fu, F.W. New non-binary quantum codes from constacyclic codes over $\mathbb{F}_q[u, v]/(u^2 - 1, v^2 - v, uv - vu)$. *Adv. Math. Commun.* **2019**, *13*, 421–434. [CrossRef]

22. Bosma, W.; Cannon, J.; Playoust, C. The Magma algebra system I: The user language. *J. Symb. Comput.* **1997**, *24*, 235–265. [CrossRef]

23. Chen, B.; Ling, S.; Zhang, G. Application of constacyclic codes to quantum MDS codes. *IEEE Trans. Inf. Theory* **2015**, *61*, 1474–1484. [CrossRef]

24. Dinh, H.Q.; Bag, T.; Pathak, S.; Upadhyay, A.K.; Chinnakum, W. Quantum codes obtained from constacyclic codes over a family of finite rings $\mathbb{F}_p[u_1, u_2, \dots, u_s]$. *IEEE Access* **2020**, *8*, 194082–194091. [CrossRef]

25. Grassl, M.; Beth, T.; Roetteler, M. On optimal quantum codes. *Int. J. Quantum Inf.* **2004**, *2*, 55–64. [CrossRef]

26. Islam, H.; Prakash, O. Construction of LCD and new quantum codes from cyclic codes over a finite non-chain ring. *Cryptogr. Commun.* **2022**, *14*, 59–73. [CrossRef]

27. Kai, X.; Zhu, S.; Li, P. Constacyclic codes and some new quantum MDS codes. *IEEE Trans. Inf. Theory* **2014**, *60*, 2080–2086. [CrossRef]

28. Ashraf, M.; Ali, S.; Mohammad, G. Constacyclic codes over the ring $\frac{\mathbb{F}_p[u, v]}{\langle u^2 - 1, v^3 - v, uv - vu \rangle}$ and their applications. *Eur. Phys. J. Plus* **2021**, *136*, 1–10. [CrossRef]

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.