Four classes of few-weight self-orthogonal codes and their applications for LCD codes and quantum codes


Abstract

Since self-orthogonal codes, few-weight codes, linear complementary dual codes(LCD codes, for short) and quantum codes have nice applications in coding theory and cryptography, they have received continuous attention. In 2024, by introducing the notion of the augment code, Heng et al.[1] constructed several classes of few-weight self-orthogonal codes basing on defining sets, which are introduced by Ding et al.[2] in 2007. In this manuscript, for two classes of defining sets, we consider the corresponding augmented codes, construct a class of projective four-weight self-orthogonal codes and three classes of four-weight self-orthogonal codes. And for two classes of these four-weight self-orthogonal linear codes, we determine the parameters of their dual codes. As applications, we construct two classes of LCD codes and a class of quantum codes. In particular, we prove that there exists a class of these LCD codes whose dual codes are almost optimal LCD codes according to the sphere packing bound, and a class of quantum codes are AMDS according to the quantum Singleton bound.

Few-weight code; Weight distribution; Self-orthogonal code; LCD code; Quantum code.

1 Introduction↩︎

Let \(\mathbb{F}_{p^m}\) be the finite field with \(p^m\) elements, where \(p\) is a prime and \(m\) is a positive integer. An \([n,k,d]\) linear code \(\mathcal{C}\) over \(\mathbb{F}_{p^m}\) is a \(k\)-dimensional linear subspace of \(\mathbb{F}_{p^m}^n\) with minimum (Hamming) distance \(d.\) The weight \(wt(\boldsymbol{c})\) of a codeword \(\boldsymbol{c} \in \mathcal{C}\) is the number of nonzero coordinates in \(\boldsymbol{c}.\) Let \(A_i\) be the number of codewords \(\boldsymbol{c} \in \mathcal{C}\) with weight \(i.\) Then \(\left( 1,A_1,\cdots,A_n\right)\) is called the weight distribution of \(\mathcal{C}\) and the polynomial \(1+A_1z+\cdots+A_nz^n\) is called the weight enumerator of \(\mathcal{C}.\) If \(\#\left\lbrace i : A_i \neq 0, 1 \leq i \leq n \right\rbrace=t,\) then \(\mathcal{C}\) is \(t\)-weight. If the Hamming weight of each codeword in \(\mathcal{C}\) is divisible by \(p\), then \(\mathcal{C}\) is \(p\)-divisible. The dual code \(\mathcal{C}^ \perp\) of \(\mathcal{C}\) is defined by \(\mathcal{C}^\perp=\left\lbrace\boldsymbol{x} \in \mathbb{F}_{p^m}^n: \boldsymbol{x} \cdot \boldsymbol{c}=0 ~\text{for all } \boldsymbol{c} \in \mathcal{C}\right\rbrace.\) If the dual code of \(\mathcal{C}\) has the minimal distance \(d ^ \perp \geq 3,\) then \(\mathcal{C}\) is a projective code. If \(\mathcal{C} \subseteq \mathcal{C}^\perp,\) then \(\mathcal{C}\) is self-orthogonal; and if \(\mathcal{C} \cap \mathcal{C}^{\perp}=\left\lbrace \boldsymbol{0}\right\rbrace,\) then \(\mathcal{C}\) is a linear complementary dual code(LCD code, for short).

It is well-known that any linear code over \(\mathbb{F}_{p^m}\) has three fundamental parameters: the length \(n,\) the dimension \(k\) and the minimum Hamming distance \(d.\) A central goal in error-correcting code theory is to construct codes with good performance, i.e., simultaneously large \(n,k,d.\) Nevertheless, classical coding bounds show that these parameters cannot be maximized simultaneously, which introduces three separate definitions of optimality as follows: for any given \(\left[ n,k,d\right]_{p^m}\) linear code \(\mathcal{C},\) if there is no \(\left[ n-1,k,d\right]_{p^m}\) linear code, then \(\mathcal{C}\) is length-optimal; if there is no \(\left[ n,k+1,d\right]_{p^m}\) linear code, then \(\mathcal{C}\) is dimension-optimal; if there is no \(\left[ n,k,d+1\right]_{p^m}\) linear code, then \(\mathcal{C}\) is distance-optimal. In 2025, Chen et al.[3], defined the distance-almost optimal \(\left[ n,k,d\right]_{p^m}\) linear code. Similarly, the dimension-almost optimal also can be defined, i.e., for any given \(\left[ n,k,d\right]_{p^m}\) linear code \(\mathcal{C}\), if there exists an \(\left[ n,k+1,d\right]_{p^m}\) linear code, but there is no \(\left[ n,k+2,d\right]_{p^m}\) code, then \(\mathcal{C}\) is dimension-almost optimal. So far, there are a lot of works on constructing optimal linear codes [3][6].

Since self-orthogonal codes and few-weight codes play significant roles in coding theory and cryptography, they have been received considerable attention[1], [4][18]. Especially, in 2007, Ding et al.\(\cite{8}\) introduced a new way to construct linear codes. Let \(D=\left\lbrace d_1,d_2,\cdots,d_n \right\rbrace \subseteq \mathbb{F}_{p^m}\) and defined \[\mathcal{C}_D=\left\lbrace (\mathrm{Tr}(bd_1),\mathrm{Tr}(bd_2),\cdots,\mathrm{Tr}(bd_n)) : b \in \mathbb{F}_{p^m}\right\rbrace,\] where \(\mathrm{Tr}\) is the trace function from \(\mathbb{F}_{p^m}\) to \(\mathbb{F}_p.\) And \(D\) is called the defining set of \(\mathcal{C}_D.\) So far, there are many works on constructing linear codes with good coding properties by choosing the proper defining set \(\cite{10,13,31,44,45,51,55,56}\). However, it is generally difficult to verify whether these codes obtained via such constructions are self-orthogonal. Recently, by establishing a sufficient condition such that the \(p\)-divisible linear code \(\mathcal{C}\) is self-orthogonal, Li and Heng[14] introduced the augmented code \(\bar{\mathcal{C}}\) of \(\mathcal{C},\) which is defined as \[\overline{\mathcal{C}}= \{ \bar{\boldsymbol{c}} = \boldsymbol{c} + \mu \mathbf{1} : \boldsymbol{c} \in \mathcal{C}, \mu \in \mathbb{F}_{p^m} \},\] where \(\mathbf{1}=(1,1,\cdots,1) \in \mathbb{F}_{p^m}^n.\) To date, there are only a few works devoted to investigating the properties of augmented codes constructed from defining sets[12][14], [16], [19][21]. Moreover, existing results show that if the original defining-set code \(\mathcal{C}_D\) is a few-weight code, its augmented code \(\overline{\mathcal{C}_D}\) is not necessarily few-weight. Therefore, it’s interesting to find some proper defining set \(D\) such that both \(\mathcal{C}_D\) and \(\overline{\mathcal{C}_D}\) \(None\) are few-weight.

In 2023, Du et al. [15] introduced the linear code

\[\begin{align} \mathcal{C}_D=\left\lbrace \boldsymbol{c}(a , b)=(\mathrm{Tr}(ax+by))_{(x , y) \in D} :(a , b) \in \mathbb{F}_{p^m} \times \mathbb{F}_{p^m} \right\rbrace, \label{40146141} \end{align}\tag{1}\] where \[D=\left\lbrace (x , y) \in {\mathbb{F}^2_{p^m}} \setminus \left\lbrace (0 , 0)\right\rbrace : \mathrm{Tr} (\alpha xy +\beta y +x)=\gamma \right\rbrace(\alpha \in \mathbb{F}_{p^m}^*,\beta \in \mathbb{F}_{p^m},\gamma \in \mathbb{F}_p ),\] and constructed a class of three-weight linear codes.

In this manuscript, by taking \(D=D_1\) or \(D_2\) in (1 ), where \[\begin{align} D_1=&\left\lbrace (x , y) \in {\mathbb{F}_{p^m} \times \mathbb{F}_{p^m} } : \mathrm{Tr} (\alpha xy +\beta y +x)=\gamma \right\rbrace , \tag{2}\\ D_2=&\left\lbrace (x , y) \in \mathbb{F}_{p^m}^* \times \mathbb{F}_{p^m} : \mathrm{Tr} (\alpha xy +x)=\gamma \right\rbrace, \tag{3} \end{align}\] we consider the augmented code \(\overline{\mathcal{C}_{D_i}}(i=1,2),\) which is defined by \[\begin{align} \overline{\mathcal{C}_{D_i}}=\left\lbrace \boldsymbol{c}(a,b,c)=\left( \mathrm{Tr}\left(ax+by \right) \right)_{\left( x,y\right)\in D_i } +c\boldsymbol{1}: a,b \in \mathbb{F}_{p^m} ,c \in \mathbb{F}_{p}\right\rbrace , \label{40146441} \end{align}\tag{4}\] construct a class of projective four-weight self-orthogonal codes and three classes of four-weight self-orthogonal codes. As applications, we construct two classes of LCD codes and a class of quantum codes. In particular, we prove that there exists a class of these LCD codes whose dual codes are almost optimal LCD according to the sphere packing bound, and a class of quantum codes are AMDS according to the quantum Singleton bound.

This manuscript is organized as follows. In Section 2, we introduce some necessary notations and lemmas. In Section 3, we give our main results and some auxiliary results. In Section 4, we give the proofs of our main results and some examples. In Section 5, we derive LCD codes and quantum codes from the constructed self-orthogonal codes. In Section 6, we conclude the whole manuscript.

2 Preliminaries↩︎

Throughout this manuscript, for the convenience, we fix some notations as follows.

  • \(p\) is an odd prime and \(m \geq 2\) is a positive integer.

  • \(\mathbb{F}_{p^m}\) is the finite field with \(p^m\) elements, where \(\mathbb{F}_{p^m}^* = \mathbb{F}_{p^m} \setminus \{0\}\).

  • \(\operatorname{Tr}(\cdot)\) is the trace map from \(\mathbb{F}_{p^m}\) to \(\mathbb{F}_p\).

  • For any positive integer \(t,\) \(\boldsymbol{I_t}, \boldsymbol{0_t}\) and \(\boldsymbol{1_t}\) denote the identity matrix of size \(t \times t\), the zero matrix of size \(t \times t\) and the all-1 vector of length \(t,\) respectively.

  • For any positive integer \(t,S_{p^t} = \{x^2 : x \in \mathbb{F}_{p^t}^*\}\) and \(NS_{p^t} = \mathbb{F}_{p^t}^* \setminus S_{p^t}\).

  • \(\chi\) and \(\bar{\chi}\) denote the additive characters over \(\mathbb{F}_{p^m}\) and \(\mathbb{F}_{p}\), respectively.

  • \(\eta\) and \(\bar{\eta}\) denote the quadratic multiplicative characters over \(\mathbb{F}_{p^m}\) and \(\mathbb{F}_{p}\), respectively.

  • \(\zeta_{p}\) be the primitive \(p\)-th root of unity and \(\zeta_{p}=\frac{2\pi i}{p}(i=\sqrt{-1})\).

  • \(G\) and \(\bar{G}\) denote the Gauss sums over \(\mathbb{F}_{p^m}\) and \(\mathbb{F}_{p}\), respectively.

  • \(t_1=\mathrm{Tr}(-\frac{\beta}{\alpha})-\gamma,t_2=\mathrm{Tr}(-\frac{b+a\beta}{\alpha})+c\) and \(t_3=\mathrm{Tr}(-\frac{ab}{\alpha}).\)

  • \(l_1=-\gamma,l_2=\mathrm{Tr}(-\frac{b}{\alpha})+c\) and \(l_3=\mathrm{Tr}(-\frac{ab}{\alpha}).\)

In this section, we firstly give some basic notations and known results on additive characters, quadratic characters, Gauss sums over \(\mathbb{F}_{p^m}\), the Pless power moments, self-orthogonal codes, LCD codes and quantum codes.

The following Lemmas 1-4 are crucial for computing the weight distributions in Section 4.1.

Lemma 1. ([22], Lemma 2.1) For any \(a,x\) \(\in \mathbb{F}_{p^m}\), we have \[\sum_{x\in \mathbb{F}_{p^m}}\zeta_p^{\mathrm{Tr}(ax)}= \begin{array}{c} \begin{cases} p^m , &\text{if} ~a=0\\ 0 , &\text{if} ~a\in \mathbb{F}_{p^m}^* \end{cases}, \end{array} \sum_{x\in \mathbb{F}_{p^m}^*}\zeta_p^{\mathrm{Tr}(ax)}= \begin{array}{c} \begin{cases} p^m-1, &\text{if} ~a=0\\ -1, &\text{if} ~a\in \mathbb{F}_{p^m}^* \end{cases}. \end{array}\]

Lemma 2. ([16]) For any \(a\in \mathbb{F}_{p^m},\) we have \[\eta(a)=\begin{array}{c} \begin{cases} 0 , &\text{if} ~a=0\\ 1 , &\text{if} ~a \in S_{p^m}\\ -1 , &\text{if} ~a \in NS_{p^m} \end{cases}, \end{array} \sum\limits_{a\in \mathbb{F}_{p^m}^*}\eta(a)=0.\]

Lemma 3. ([23], Theorem 5.51) For the Gauss sum \(G(\bar\eta,\bar\chi)=\sum\limits_{c\in \mathbb{F}_{p}^*}\bar\eta(c)\bar\chi(c),\) we have \[G^2(\bar\eta,\bar\chi)=\bar\eta (-1)p.\]

Lemma 4. ([23], Theorem 5.33) Let \(f(x)=a_2x^2+a_1x+a_0 \in \mathbb{F}_{p^m}\left[x \right]\) and \(a_2 \in \mathbb{F}_{p^m}^* .\) Then \[\sum_{x\in \mathbb{F}_{p^m}}\zeta_p^{\mathrm{Tr}(f(x))}=\zeta_p^{\mathrm{Tr}(a_0-a_1^2(4a_2)^{-1})}\eta(a_2)G(\eta,\chi).\]

The Pless power moments provided in the following Lemma 5 plays a key role in computing the distance of the dual code.

Lemma 5. ([24], Page 259) Let \(\mathcal{C}\) be an \(\left[n,k \right]\) code over \(\mathbb{F}_{p^m}\) with weight distribution \(\left(1,A_1,\cdots , A_n \right)\) and \(\mathcal{C}^\perp\) be the dual code with weight distribution \(\left(1,A_1^\perp,\cdots , A_n^\perp \right)\), then the first four Pless power moments are as follows,

\[\begin{align} &\sum\limits_{j=0}^{n}A_j=p^k,\label{40246141}\\ &\sum\limits_{j=0}^{n}jA_j=p^{k-1}\left(pn-n-A_1^\perp \right),\label{40246241}\\ &\sum\limits_{j=0}^{n}j^2A_j=p^{k-2}\left[\left(p-1 \right)n\left( pn-n+1\right)-\left(2pn-p-2n+2 \right)A_1^\perp +2A_2^\perp \right] ,\label{40246341}\\ &\sum_{j=0}^n j^3 A_j = p^{k-3} \left[ (p - 1)nE - FA_1^\perp + 6(pn - p - n + 2)A_2^\perp - 6A_3^\perp \right]\label{40246441}, \end{align}\] {#eq: sublabel=eq:40246141,eq:40246241,eq:40246341,eq:40246441} where \[E=p^2n^2 - 2pn^2 + 3pn - p + n^2 - 3n + 2\] and \[F=3p^2n^2 - 3p^2n - 6pn^2 + 12pn + p^2 - 6p + 3n^2 - 9n + 6.\]

The following Lemma 6 presents a sufficient condition for a \(p\)-divisible code to be self-orthogonal.

Lemma 6. ([14], Theorem 1) Let \(\mathcal{C}\) be an \(\left[n,k,d \right]\) linear code over \(\mathbb{F}_{p^m}.\) If \(\boldsymbol{1_n} \in \mathcal{C}\) and \(\mathcal{C}\) is \(p\)-divisible, then \(\mathcal{C}\) is self-orthogonal.

The following Lemmas 7-8 provide a method to construct LCD codes and quantum codes based on self-orthogonal linear codes, respectively.

Lemma 7. ([16], Lemma 5.9) Let \(\mathcal{C}\) be an \(\left[ n ,k ,d\right]\) linear code generated by the matrix \(G\) over \(\mathbb{F}_{p^m}.\) If \(\mathcal{C}\) is self-orthogonal, then the matrix \(\bar{G} = [I_k :G]\) generates an \(\left[ n +k ,k \right]\) LCD code over \(\mathbb{F}_{p^m}.\)

Lemma 8. ([25], Theorem 2.6) Let \(\mathcal{C}_1\) and \(\mathcal{C}_2\) be \(\left[n,k_1,d_1 \right]_{p^m}\) and \(\left[n,k_2,d_2 \right]_{p^m}\) linear codes, respectively. If \(\mathcal{C}_1^{\perp} \subseteq \mathcal{C}_1 \subseteq \mathcal{C}_2\) and \(k_1+2 \leq k_2,\) then there exists an \[\left\llbracket n,\;k_1 + k_2 - n,\min\left\{ d_1,\left\lceil \tfrac{p^m+1}{p^m}d_2 \right\rceil \right\} \right\rrbracket_{p^m}\] quantum code, where \(\lceil \cdot \rceil\) denotes the ceiling function.

The following Lemmas 9-10 give the well-known sphere packing bound for a linear code and the quantum Singleton bound for a quantum code.

Lemma 9. ([24], Theorem 1.12.1) Let \(\mathcal{C}\) be an \([n,k,d]_p\) linear code. Then \[p^n \geq p^k \sum_{i=0}^{\left\lfloor \frac{d-1}{2} \right\rfloor} \binom{n}{i} (p-1)^i,\] where \(\lfloor \cdot \rfloor\) denotes the floor function.

Lemma 10. ([26], Corollary 28) For any \(\left\llbracket n,\;k,\;d \right\rrbracket_{p^m}\) quantum code, \(2(d-1) \leq n-k.\)

Remark 1. For an \(\left\llbracket n, k, d\right\rrbracket_{p^m}\) quantum code, if the quantum Singleton bound is achieved, i.e., \(2(d-1) = n-k\), then it is called a maximum distance separable (MDS, for short) quantum code. If \(2d = n-k\), then it is called an almost maximum distance separable (AMDS, for short) quantum code.

The following Lemma 11 will be used to calculate \(\# D_1\) in Section 4.1.

Lemma 11. ([15])Let \(\Omega_1=\sum\limits_{u\in \mathbb{F}_p^*} \sum\limits_{x\in \mathbb{F}_{p^m}} \sum\limits_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (u\alpha xy +u\beta y +ux)-u\gamma},\) then \[\Omega_1= \begin{array}{c} \begin{cases} p^m(p-1) , &\text{if} ~\gamma = \mathrm{Tr}(-\frac{\beta}{\alpha});\\ -p^m , &\text{if} ~\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha}). \end{cases} \end{array}\]

3 Four classes of four-weight self-orthogonal codes↩︎

In this section, we give our main results, namely, four classes of four-weight self-orthogonal linear codes, and some auxiliary results will be used in Section 4.1.

3.1 Main results↩︎

Let \(\overline{\mathcal{C}_{D_1}}\) and \(D_1\) be defined by (4 ) and (2 ) in Theorems 2-3, respectively.

Theorem 2. If \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha}),\) then \(\overline{\mathcal{C}_{D_1}}\) is a \(\left[p^{m-1}(p^m+p-1),2m+1,p^{2m-2}(p-1) \right]_p\) four-weight self-orthogonal linear code with the weight distribution given by Table 1 , and the dual code \({\overline{\mathcal{C}_{D_1}}}^{\perp}\) is a \([p^{m-1}(p^m+p-1),\) \(p^{m-1}(p^m+p-1)-2m-1,2 ]_p\) code.

Table 1: The weight distribution of \(\overline{\mathcal{C}_{D_1}}\)
weight frequency
0 1
\(p^{2m-2}(p-1)\) \(p^{2m-1}+p^m-p^{m-1}-1\)
\(p^{m-1}(p^m-p^{m-1}+p-1)\) \((p^m-1)(2p^m-2p^{m-1}+p-1)\)
\(p^{m-1}(p^m-p^{m-1}+p-2)\) \(p^{m-1}(p^{m+2}-2p^{m+1}+p^m-p^2+2p-1)\)
\(p^{m-1}(p^m+p-1)\) \(p - 1\)

Theorem 3. If \(\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha}),\) then \(\overline{\mathcal{C}_{D_1}}\) is a \(\left[p^{m-1}(p^m-1),2m+1,p^{m-1}(p^m-p^{m-1}-2) \right]_p\) four-weight self-orthogonal linear code.

Remark 4. For \(\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha}),\) and \({wt}_1(\mathbf{c})\) given by the proof of Theorem 3, it’s not easy to compute \[\# \left\lbrace a \in \mathbb{F}_{p^m}^*, b \in \mathbb{F}_{p^m},c \in \mathbb{F}_p : t_3 \neq 0~ \text{and}~ t_2^2-4t_1t_3 \in NS_p \right\rbrace,\] \[\# \left\lbrace a \in \mathbb{F}_{p^m}^*, b \in \mathbb{F}_{p^m},c \in \mathbb{F}_p : t_3 \neq 0~ \text{and}~ 4t_1t_3-t_2^2=0 \right\rbrace\] and \[\# \left\lbrace a \in \mathbb{F}_{p^m}^*, b \in \mathbb{F}_{p^m},c \in \mathbb{F}_p : t_3 \neq 0~ \text{and}~ t_2^2-4t_1t_3 \in S_p \right\rbrace.\] Therefore, the weight distribution of \(\overline{\mathcal{C}_{D_1}}\) for \(\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha})\) is not given in this manuscript.

Let \(\overline{\mathcal{C}_{D_2}}\) and \(D_2\) be defined by (4 ) and (3 ) in Theorems 5-6, respectively.

Theorem 5. If \(\gamma=0,\) then \(\overline{\mathcal{C}_{D_2}}\) is a \(\left[ p^{m-1}(p^m-1),2m+1,p^{m-1}(p^m-p^{m-1}-p+1)\right]_p\) four-weight self-orthogonal linear code with the weight distribution given by Table 2, and the dual code \({\overline{\mathcal{C}_{D_2}}}^{\perp}\) is a \([p^{m-1}(p^m-1),\) \(p^{m-1}(p^m-1)-2m-1,3 ]_p\) code. Furthermore \({\overline{\mathcal{C}_{D_2}}}\) is a projective linear code.

Table 2: The weight distribution of \(\overline{\mathcal{C}_{D_2}}\)
weight frequency
0 1
\(p^{2m-2}(p-1)\) \((p^m-1)(2p^m-2p^{m-1}+1)\)
\(p^{m-1}(p^m-p^{m-1}-1)\) \((p-1)(p^m-1)(p^m-p^{m-1}+1)\)
\(p^{m-1}(p^m-p^{m-1}-p+1)\) \(p^{m-1}(p^m-1)\)
\(p^{m-1}(p^m-1)\) \(p - 1\)

Theorem 6. If \(\gamma \neq 0,\) then \(\overline{\mathcal{C}_{D_2}}\) is a \(\left[ p^{m-1}(p^m-1),2m+1,p^{m-2}(p^{m+1}-2p^{m}-p+2)\right]_p\) four-weight self-orthogonal linear code.

Remark 7. For \(\gamma \neq 0,\) and \({wt}_2(\mathbf{c})\) given by the proof of Theorem 6, it’s not easy to compute \[\# \left\lbrace a \in \mathbb{F}_{p^m}, b \in \mathbb{F}_{p^m}^*,c \in \mathbb{F}_p : l_3 \neq 0~ \text{and}~ l_2^2-4l_1l_3 \in NS_p \right\rbrace,\] \[\# \left\lbrace a \in \mathbb{F}_{p^m}, b \in \mathbb{F}_{p^m}^*,c \in \mathbb{F}_p : l_3 \neq 0~ \text{and}~ 4l_1l_3-l_2^2=0 \right\rbrace\] and \[\# \left\lbrace a \in \mathbb{F}_{p^m}, b \in \mathbb{F}_{p^m}^*,c \in \mathbb{F}_p : l_3 \neq 0~ \text{and}~ l_2^2-4l_1l_3 \in S_p \right\rbrace.\] Therefore, the weight distribution of \(\overline{\mathcal{C}_{D_2}}\) for \(\gamma \neq 0\) is not given in this manuscript.

3.2 Some auxiliary results↩︎

In this subsection, we give some auxiliary results which will be used in the sequel. Let \(n\) be the length of \(\overline{\mathcal{C}_{D_i}}.\) Obviously, \(\left( \mathrm{Tr}\left(ax+by \right) \right)_{\left( x,y\right)\in D_i } +c\boldsymbol{1_n}\) is the zero codeword when \((a,b,c)=(0,0,0).\) Hence, we default \((a,b,c) \neq (0,0,0)\) later.

Proposition 8. Let \(\Omega_2=\sum\limits_{v\in \mathbb{F}_p^*} \sum\limits_{x\in \mathbb{F}_{p^m}} \sum\limits_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (vax+vby)+vc},\) then \[\Omega_2= \begin{array}{c} \begin{cases} 0 , &\text{if} ~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p, \\ &~~\text{or}~ a=0, b\neq 0,c \in \mathbb{F}_p;\\ -p^{2m} , &\text{if} ~ a=b=0,c\neq0. \end{cases} \end{array}\]

Proof.  It’s easy to get

\[\Omega_2=\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{vc} \sum_{x\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vax)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vby)}.\] Next depending on the non-zeroness of \(a,b\) or \(c,\) we have the following three cases.

\(\boldsymbol{Case~ 1.}\) If \(a \neq 0,b \in \mathbb{F}_{p^m}\) and \(c \in \mathbb{F}_p\), then by Lemma 1, we have \(\sum\limits_{x\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vax)}=0,\) thus, \(\Omega_2=0.\)

\(\boldsymbol{Case~ 2.}\) If \(a=0, b \neq 0\) and \(c \in \mathbb{F}_p\), then by Lemma 1, we have \(\sum\limits_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vby)}=0,\) thus, \(\Omega_2=0.\)

\(\boldsymbol{Case ~3.}\) If \(a=b=0\) and \(c \neq 0\), then by Lemma 1, we have \(\sum\limits_{v\in \mathbb{F}_p^*}\zeta_{p}^{vc}=-1,\) thus, \(\Omega_2=-p^{2m}.\)

From the above, we complete the proof of Proposition 8.\(\square\)

Proposition 9. Let \(\Omega_3=\sum\limits_{u\in \mathbb{F}_p^*}\sum\limits_{v\in \mathbb{F}_p^*} \sum\limits_{x\in \mathbb{F}_{p^m}} \sum\limits_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (u\alpha xy +u\beta y +ux+vax+vby)-u \gamma +vc},\) then \[\Omega_3= \begin{array}{c} \begin{cases} p^m(p-1)^2, &\text{if}~ t_1=t_2=t_3=0;\\ -p^m(p-1), &\text{if}~ t_1=0,t_2 \neq 0, t_3=0,\\ &~~\text{or}~t_1\neq0,t_2=t_3=0, \\ &~~\text{or}~ t_1=t_2=0,t_3\neq0,\\ &~~\text{or}~t_1 \neq 0,t_3 \neq 0,t_2^2-4t_1t_3 \in NS_p; \\ p^m,&\text{if}~ t_1\neq0,t_2 \neq 0,t_3=0, \\ &~~\text{or}~ t_1=0,t_2\neq 0,t_3 \neq 0,\\ &~~\text{or}~ t_1 \neq 0,t_3 \neq 0, 4t_1t_3-t_2^2=0;\\ p^m(p+1), &\text{if}~ t_1\neq 0,t_3 \neq 0 ,t_2^2-4t_1t_3 \in S_p. \end{cases} \end{array}\]

Proof. By Lemma 1, it’s easy to get \[\begin{align} \Omega_3 =&\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\sum_{x\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr}((u+av)x)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}((u\alpha x+u \beta +vb)y)}\\ =&\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\sum_{x\in \mathbb{F}_{p^m}\setminus \left\lbrace -\frac{u\beta+vb}{u\alpha} \right\rbrace } \zeta_{p}^{\mathrm{Tr}((u+av)x)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}((u\alpha x+u \beta +vb)y)}\\ &+p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\zeta_{p}^{\mathrm{Tr}(-\frac{(u+av)(u\beta+vb)}{u\alpha})}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\zeta_{p}^{\mathrm{Tr}(-\frac{(u+av)(u\beta+vb)}{u\alpha})}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{(\mathrm{Tr}(-\frac{\beta}{\alpha})-\gamma)u+(\mathrm{Tr}(-\frac{b+a\beta}{\alpha})+c)v+\mathrm{Tr}(-\frac{ab}{\alpha})\frac{v^2}{u}}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{t_1u+t_2v+t_3\frac{v^2}{u}}. \end{align}\] Next depending on \(t_3=0\) or not, we have the following two cases.

\(\boldsymbol{Case ~1.}\) If \(t_3=0,\) then \(\Omega_3=p^m\sum\limits_{u\in \mathbb{F}_p^*}\sum\limits_{v\in \mathbb{F}_p^*}\zeta_{p}^{t_1u+t_2v}.\) Now, depending on \(t_i=0\) or not \((i=1,2),\) we have

\[\Omega_3= \begin{array}{c} \begin{cases} p^m(p-1)^2 ,& \text{if}~ t_1=t_2=0;\\ -p^m(p-1) ,&\text{if} ~ t_1=0,t_2 \neq 0,\\ &~~\text{or}~ t_1 \neq 0,t_2=0;\\ p^m, &\text{if} ~ t_1 \neq 0,t_2 \neq 0. \end{cases} \end{array}\]

\(\boldsymbol{Case~ 2.}\) If \(t_3\neq 0,\) then by Lemma 4, we have \[\begin{align} \Omega_3=&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{t_2v+t_3\frac{v^2}{u}}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\left( \sum_{v\in \mathbb{F}_p}\zeta_{p}^{t_2v+t_3\frac{v^2}{u}}-1\right) \\ =&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\sum_{v\in \mathbb{F}_p}\zeta_{p}^{t_2v+t_3\frac{v^2}{u}}-p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\zeta_{p}^{-\frac{t_2^2u}{4t_3}}\bar{\eta}(\frac{t_3}{u})G(\bar{\eta},\bar{\chi})-p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{4t_1t_3-t_2^2}{4t_3}u}\bar{\eta}({t_3}{u})G(\bar{\eta},\bar{\chi})-p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{t_1u}. \end{align}\] Now depending on \(t_1=0\) or not, we have the following two cases.

(1) If \(t_1=0,\) then we have \(\Omega_3=p^m\sum\limits_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{-t_2^2}{4t_3}u}\bar{\eta}({t_3}{u})G(\bar{\eta},\bar{\chi})-p^m(p-1).\) If \(t_2= 0,\) then \(\sum\limits_{u\in \mathbb{F}_p^*}\bar{\eta}({t_3}{u})=0,\) thus, \(\Omega_3=-p^m(p-1).\) If \(t_2\neq 0,\) then \[\begin{align} \Omega_3=&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{-t_2^2}{4t_3}u}\bar{\eta}({t_3}{u})G(\bar{\eta},\bar{\chi})-p^m(p-1)\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{-t_2^2}{4t_3}u}\bar{\eta}(\frac{-t_2^2}{4t_3}u)\bar{\eta}(-\frac{4t_3^2}{t_2^2})G(\bar{\eta},\bar{\chi})-p^m(p-1)\\ =& p^mG^2(\bar{\eta},\bar{\chi}) \bar{\eta}(-1)-p^m(p-1)\\ =&p^{m+1} \bar{\eta}^2(-1)-p^m(p-1)\\ =&p^{m+1}-p^m(p-1)\\ =&p^m. \end{align}\]

(2) If \(t_1\neq 0,\) then \(\Omega_3= p^m\sum\limits_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{4t_1t_3-t_2^2}{4t_3}u}\bar{\eta}({t_3}{u})G(\bar{\eta},\bar{\chi})+p^m.\) If \(4t_1t_3-t_2^2=0,\) then \(\sum\limits_{u\in \mathbb{F}_p^*}\bar{\eta}(t_3u)=0,\) thus, \(\Omega_3=p^m.\) If \(t_2^2-4t_1t_3 \in S_p,\) then \[\begin{align} \Omega_3=&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{4t_1t_3-t_2^2}{4t_3}u}\bar{\eta}(\frac{4t_1t_3-t_2^2}{4t_3}u)\bar{\eta}(\frac{4t_3^2}{4t_1t_3-t_2^2})G(\bar{\eta},\bar{\chi})+p^m\\ =&p^mG^2\bar{\eta}(-1)+p^m\\ =&p^m(p+1). \end{align}\] If \(t_2^2-4t_1t_3 \in NS_p,\) then \[\begin{align} \Omega_3=&p^m\sum_{u\in \mathbb{F}_p^*}\zeta_{p}^{\frac{4t_1t_3-t_2^2}{4t_3}u}\bar{\eta}(\frac{4t_1t_3-t_2^2}{4t_3}u)\bar{\eta}(\frac{4t_3^2}{4t_1t_3-t_2^2})G(\bar{\eta},\bar{\chi})+p^m\\ =&-p^mG^2\bar{\eta}(-1)+p^m\\ =&p^m(1-p). \end{align}\]

From the above, we complete the proof of Proposition 9.\(\square\)

Proposition 10. Let \(\Omega_4=\sum\limits_{v\in \mathbb{F}_p^*} \sum\limits_{x\in \mathbb{F}_{p^m}^*} \sum\limits_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (vax+vby)+vc},\) then \[\Omega_4= \begin{array}{c} \begin{cases} -p^m(p-1) ,& \text{if} ~a\neq 0,b=c=0;\\ p^m ,&\text{if} ~ a\neq 0, b=0,c\neq0;\\ 0, &\text{if} ~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p};\\ -p^m(p^m-1),&\text{if} ~a=b=0,c\neq 0. \end{cases} \end{array}\]

Proof. It’s easy to get \[\Omega_4=\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{vc} \sum_{x\in \mathbb{F}_{p^m}^*}\zeta_{p}^{\mathrm{Tr} (vax)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vby)}.\] Next depending on the non-zeroness of \(a,b\) or \(c,\) we have the following four cases.

\(\boldsymbol{Case~ 1.}\) If \(b \neq 0,a \in \mathbb{F}_{p^m}\) and \(c \in \mathbb{F}_p\), then by Lemma 1, we have \(\sum\limits_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr} (vby)}=0,\) thus, \(\Omega_4=0.\)

\(\boldsymbol{Case~ 2.}\) If \(b=0, a \neq 0\) and \(c =0\), then by Lemma 1, we have \(\sum\limits_{x\in \mathbb{F}_{p^m}^*}\zeta_{p}^{\mathrm{Tr} (vax)}=-1,\) thus, \(\Omega_4=-p^m(p-1).\)

\(\boldsymbol{Case~ 3.}\) If \(b=0, a \neq 0\) and \(c \neq 0\), then by Lemmas 1, we have \(\sum\limits_{x\in \mathbb{F}_{p^m}^*}\zeta_{p}^{\mathrm{Tr} (vax)}=-1\) and \(\sum\limits_{v\in \mathbb{F}_p^*}\zeta_{p}^{vc}=-1\) , thus, \(\Omega_4=p^m.\)

\(\boldsymbol{Case~ 4.}\) If \(b=a=0\) and \(c \neq 0\), then by Lemma 1, we have \(\sum\limits_{v\in \mathbb{F}_p^*}\zeta_{p}^{vc}=-1,\) thus, \(\Omega_4=-p^{m}(p^m-1).\)

From the above, we complete the proof of Proposition 10.\(\square\)

Proposition 11. Let \(\Omega_5=\sum\limits_{u\in \mathbb{F}_p^*}\sum\limits_{v\in \mathbb{F}_p^*} \sum\limits_{x\in \mathbb{F}_{p^m}^*} \sum\limits_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (u\alpha xy +ux+vax+vby)-u \gamma +vc},\) then \[\Omega_5= \begin{array}{c} \begin{cases} 0,&\text{if}~b=0;\\ p^m(p-1)^2, &\text{if}~ l_1=l_2=l_3=0,b\neq0;\\ -p^m(p-1), &\text{if}~ l_1=0,l_2 \neq 0, l_3=0,b\neq0,\\ &~~\text{or}~l_1\neq0,l_2=l_3=0,b\neq0 ,\\ &~~\text{or}~ l_1=l_2=0,l_3\neq0,b\neq0,\\ &~~\text{or}~l_1 \neq 0,l_3 \neq 0,b\neq0,l_2^2-4l_1l_3 \in NS_p;\\ p^m,&\text{if}~ l_1\neq0,l_2 \neq 0,l_3=0,b\neq0, \\ &~~\text{or}~ l_1=0,l_2\neq 0,l_3 \neq 0,b\neq0 ,\\ &~~\text{or}~ l_1 \neq 0, l_3 \neq 0,b\neq0,4l_1l_3-l_2^2=0;\\ p^m(p+1), &\text{if}~ l_1\neq 0, l_3 \neq 0,b\neq0,l_2^2-4l_1l_3 \in S_p. \end{cases} \end{array}\]

Proof. It’s easy to get \[\Omega_5=\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\sum_{x\in \mathbb{F}_{p^m}^*} \zeta_{p}^{\mathrm{Tr}((u+av)x)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}((u\alpha x+vb)y)}.\] If \(b=0,\) then by Lemma 1, we have \(\sum\limits_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}(u\alpha x y)}=0,\) thus, \(\Omega_5=0.\) If \(b\neq0,\) then \(-\frac{vb}{u \alpha} \neq 0.\) Furthermore, by Lemma 1, we have \[\begin{align} \Omega_5 =&\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\sum_{x\in \mathbb{F}_{p^m}^*} \zeta_{p}^{\mathrm{Tr}((u+av)x)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}((u\alpha x+vb)y)}\\ =&\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\sum_{x\in \mathbb{F}_{p^m}\setminus \left\lbrace 0,-\frac{vb}{u\alpha} \right\rbrace } \zeta_{p}^{\mathrm{Tr}((u+av)x)}\sum_{y\in \mathbb{F}_{p^m}}\zeta_{p}^{\mathrm{Tr}((u\alpha x +vb)y)}\\ &+p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\zeta_{p}^{\mathrm{Tr}(-\frac{(u+av)vb}{u\alpha})}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u \gamma +vc}\zeta_{p}^{\mathrm{Tr}(-\frac{(u+av)vb}{u\alpha})}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{-u\gamma + (\mathrm{Tr}(-\frac{b}{\alpha})+c)v+\mathrm{Tr}(-\frac{ab}{\alpha})\frac{v^2}{u}}\\ =&p^m\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*}\zeta_{p}^{l_1u + l_2v+\frac{l_3}{u}v^2}. \end{align}\] In the similar proof as that of Proposition 9, we can obtain \[\Omega_5= \begin{array}{c} \begin{cases} p^m(p-1)^2, &\text{if}~ l_1=l_2=l_3=0,b\neq0;\\ -p^m(p-1), &\text{if}~ l_1=0,l_2 \neq 0, l_3=0,b\neq0,\\ &~~\text{or}~l_1\neq0,l_2=l_3=0,b\neq0 ,\\ &~~\text{or}~ l_1=l_2=0,l_3\neq0,b\neq0,\\ &~~\text{or}~l_1 \neq 0,l_3 \neq 0,b\neq0,l_2^2-4l_1l_3 \in NS_p;\\ p^m,&\text{if}~ l_1\neq0,l_2 \neq 0,l_3=0,b\neq0, \\ &~~\text{or}~ l_1=0,l_2\neq 0,l_3 \neq 0,b\neq0 ,\\ &~~\text{or}~ l_1 \neq 0, l_3 \neq 0,b\neq0,4l_1l_3-l_2^2=0;\\ p^m(p+1), &\text{if}~ l_1\neq 0, l_3 \neq 0,b\neq0,l_2^2-4l_1l_3 \in S_p. \end{cases} \end{array}\]

From the above, we complete the proof of Proposition 11.\(\square\)

4 The proofs of main results↩︎

In this section, we give the proofs of Theorems 2-3, Theorems 5-6 and some corresponding examples.

4.1 The proofs of Theorems 2-3 and Theorems 5-6↩︎

In this subsection, we give the proofs of Theorems 2-3 and Theorems 5-6 basing on some auxiliary results in Section 3.2.

The proofs of Theorems 2-3.

According to the definition of \(\overline{\mathcal{C}_{D_1}},\) we know that the length of \(\overline{\mathcal{C}_{D_1}}\) equals to \[\begin{align} n_1=&\# D_1 \\ =&\frac{1}{p}\sum_{u\in \mathbb{F}_p} \sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +\beta y +x)-\gamma})}\\ =&\frac{1}{p}\sum_{u\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{\mathrm{Tr} (u\alpha xy +u\beta y +ux)-u\gamma}+p^{2m-1}\\ =&\frac{1}{p}\Omega_1+p^{2m-1}. \end{align}\] Now by Lemma 11, we have \[n_1= \begin{array}{c} \begin{cases} p^{2m-1}+p^{m}-p^{m-1}, &\text{if} ~\gamma = \mathrm{Tr}(-\frac{\beta}{\alpha});\\ p^{2m-1}-p^{m-1} , &\text{if} ~\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha}). \end{cases} \end{array}\]

Let \(N_1=\#\left\lbrace (x , y) \in {\mathbb{F}^2_{p^m}} : \mathrm{Tr} (\alpha xy +\beta y +x)=\gamma ~\text{and}~ \mathrm{Tr}(ax+by)+c=0\right\rbrace,\) then the weight of the nonzero codeword c in \(\overline{\mathcal{C}_{D_1}}\) is \[\begin{align} wt_1(\boldsymbol{c})=&n_1-N_1\\ =&n_1-\frac{1}{p^2}\sum_{u\in \mathbb{F}_p}\sum_{v\in \mathbb{F}_p} \sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +\beta y +ux)-\gamma})}\zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)}\\ =&n_1-\frac{1}{p^2}(p^{2m}+\sum_{u\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +\beta y +ux)-\gamma})}+\sum_{v\in \mathbb{F}_p^*}\sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)}\\ &+\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +\beta y +ux)-\gamma})}\zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)})\\ =&n_1-\frac{1}{p^2}(p^{2m}+\Omega_1+\Omega_2+\Omega_3). \end{align}\]

Now depending on \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha})\) or not, by Lemma 11, Propositions 8-9 and directly computing, we have the following two cases.

\(\boldsymbol{Case~ 1.}\) If \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha})\), then \[\begin{align} \Omega_1+\Omega_2+\Omega_3 =\begin{array}{c} \begin{cases} p^{m+2}-p^{m+1}, &\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2=t_3=0,\\ &~~\text{or}~a=0, b\neq 0,c \in \mathbb{F}_p,t_2=t_3=0;\\ 0, &\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2\neq 0,t_3=0,\\ &~~\text{or}~a=0, b\neq 0,c \in \mathbb{F}_p,t_2\neq0,t_3=0,\\ &~~\text{or}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p ,t_2=0,t_3\neq0;\\ p^{m+1},&\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p ,t_2\neq0,t_3=0;\\ -p^{2m},&\text{if}~ a=b=0,c\neq0,t_2 \neq 0,t_3=0. \end{cases} \end{array} \\ \end{align}\]

Furthermore, \[wt_1(\boldsymbol{c})=\begin{array}{c} \begin{cases} p^{2m-2}(p-1),&\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2=t_3=0,\\ &~~\text{or}~a=0, b\neq 0,c \in \mathbb{F}_p,t_2=t_3=0;\\ p^{m-1}(p^m-p^{m-1}+p-1), &\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2\neq 0,t_3=0;\\ &~~\text{or}~a=0, b\neq 0,c \in \mathbb{F}_p,t_2\neq0,t_3=0,\\ &~~\text{or}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p ,t_2=0,t_3\neq0;\\ p^{m-1}(p^m-p^{m-1}+p-2),&\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p ,t_2 \neq0,t_3=0;\\ p^{m-1}(p^m+p-1),&\text{if}~ a=b=0,c\neq0,t_2\neq0,t_3=0. \end{cases} \end{array} \\None\]

\(\boldsymbol{Case ~2.}\) If \(\gamma\neq\mathrm{Tr}(-\frac{\beta}{\alpha})\), then \[\begin{align} \Omega_1+\Omega_2+\Omega_3= \begin{array}{c} \begin{cases} -p^{m+1}, &\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2=t_3=0,\\ &~~\text{or}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_3\neq0,t_2^2-4t_1t_3 \in NS_p,\\ &~~\text{or}~a=0, b\neq 0,c \in \mathbb{F}_p,t_2=t_3=0;\\ 0, &\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_2\neq 0,t_3=0,\\ &~~\text{or}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p , t_3\neq0,4t_1t_3 -t_2^2 =0,\\ &~~\text{or}~a= 0,b \neq 0,c\in \mathbb{F}_p , t_2\neq 0,t_3=0;\\ p^{m+1},&\text{if}~a\neq 0,b \in \mathbb{F}_{p^m},c\in \mathbb{F}_p ,t_3\neq0,t_2^2-4t_1t_3 \in S_p;\\ -p^{2m},&\text{if}~ a=b=0,c\neq0,t_2\neq0,t_3=0. \end{cases} \end{array} \\ \end{align}\]

Furthermore,

\[{wt}_1(\mathbf{c})= \begin{cases} p^{2m-2}(p-1), \quad &\text{if } a\neq 0,\;b \in \mathbb{F}_{p^m},\;c\in \mathbb{F}_p,\;t_2=t_3=0,\\ &~~\text{or } a\neq 0,\;b \in \mathbb{F}_{p^m},\;c\in \mathbb{F}_p,\;t_3\neq0,\;t_2^2-4t_1t_3 \in NS_p,\\ &~~\text{or } a=0,\;b\neq 0,\;c \in \mathbb{F}_p,\;t_2=t_3=0;\\ p^{m-1}(p^m-p^{m-1}-1), \quad &\text{if } a\neq 0,\;b \in \mathbb{F}_{p^m},\;c\in \mathbb{F}_p,\;t_2\neq 0,\;t_3=0,\\ &~~\text{or } a\neq 0,\;b \in \mathbb{F}_{p^m},\;c\in \mathbb{F}_p,\;t_3\neq0,\;4t_1t_3-t_2^2 =0,\\ &~~\text{or } a= 0,\;b \neq 0,\;c\in \mathbb{F}_p,\;t_2\neq 0,\;t_3=0;\\ p^{m-1}(p^m-p^{m-1}-2), \quad &\text{if } a\neq 0,\;b \in \mathbb{F}_{p^m},\;c\in \mathbb{F}_p,\;t_3\neq0,\;t_2^2-4t_1t_3 \in S_p;\\ p^{m-1}(p^m-1), \quad &\text{if } a=b=0,\;c\neq0,\;t_2\neq0,\;t_3=0. \end{cases}\]

Now if \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha}),\) then the weight \(w_1=p^{2m-2}(p-1),w_2=p^{m-1}(p^m-p^{m-1}+p-1),w_3=p^{m-1}(p^m-p^{m-1}+p-2)\) and \(w_4=p^{m-1}(p^m+p-1),\) and so we can get \[\begin{align} &A_{w_1}=p^{2m-1}+p^m-p^{m-1}-1, A_{w_2}=(p^m-1)(2p^m-2p^{m-1}+p-1),\\ &A_{w_3}=p^{m-1}(p^{m+2}-2p^{m+1}+p^m-p^2+2p-1),A_{w_4}=p-1. \end{align}\] If \(\gamma \neq \mathrm{Tr}(-\frac{\beta}{\alpha}),\) then the weight \(\tilde{w}_1=p^{2m-2}(p-1),\tilde{w}_2=p^{m-1}(p^m-p^{m-1}-1),\tilde{w}_3=p^{m-1}(p^m-p^{m-1}-2)\) and \(\tilde{w}_4=p^{m-1}(p^m-1).\)

Note that \(2 \leq m,\) it’s easy to get \(p \mid w_i\) and \(p \mid \tilde{w}_i (i=1,2,3,4).\) Hence, by Lemma 6, the corresponding code \(\overline{\mathcal{C}_{D_1}}\) is self-orthogonal whether \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha})\) or not.

Finally, we determine the distance of the dual code \({\overline{\mathcal{C}_{D_1}}}^{\perp}\) for \(\gamma = \mathrm{Tr}(-\frac{\beta}{\alpha}).\) By Lemma 5 (?? )-(?? ) and directly computing, we have \(A_1^{\perp}=0\) and \(A_2^{\perp}>0\), which means that \(d({\overline{\mathcal{C}_{D_1}}}^{\perp})=2.\)

From the above, the proofs of Theorems 2-3 are complete. \(\square\)

The proofs of Theorems 5-6.

According to the definition of \(\overline{\mathcal{C}_{D_2}},\) the length of \(\overline{\mathcal{C}_{D_2}}\) equals to \[\begin{align} n_2=&\# D_2 \\ =&\frac{1}{p}\sum_{u\in \mathbb{F}_p} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +x)-\gamma})}\\ =&\frac{1}{p}\sum_{u\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{{\mathrm{Tr} (u\alpha xy +ux)-u\gamma}}+p^{m-1}(p^m-1)\\ =&\frac{1}{p}\sum_{u\in \mathbb{F}_p^*} \zeta_{p}^{{\mathrm{Tr} (ux)-u\gamma}} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{{\mathrm{Tr} (u\alpha xy )}}+p^{m-1}(p^m-1)\\ =&p^{m-1}(p^m-1). \end{align}\] Let \(N_2=\#\left\lbrace (x , y) \in {\mathbb{F}_{p^m}^*} \times {\mathbb{F}_{p^m}} : \mathrm{Tr} (\alpha xy +x)=\gamma ~\text{and}~ \mathrm{Tr}(ax+by)+c=0\right\rbrace,\) then the weight of the nonzero codeword c in \(\overline{\mathcal{C}_{D_2}}\) is \[\begin{align} wt_2(\boldsymbol{c})=&n_2-N_2\\ =&n_2-\frac{1}{p^2}\sum_{u\in \mathbb{F}_p}\sum_{v\in \mathbb{F}_p} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +ux)-\gamma})}\zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)}\\ =&n_2-\frac{1}{p^2}(p^{m}(p^m-1)+\sum_{u\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +x)-\gamma})}+\sum_{v\in \mathbb{F}_p^*}\sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)}\\ &+\sum_{u\in \mathbb{F}_p^*}\sum_{v\in \mathbb{F}_p^*} \sum_{x\in \mathbb{F}_{p^m}^*} \sum_{y\in \mathbb{F}_{p^m}} \zeta_{p}^{u({\mathrm{Tr} (\alpha xy +x)-\gamma})}\zeta_{p}^{v(\mathrm{Tr}(ax+by)+c)})\\ =&n_2-\frac{1}{p^2}(p^{m}(p^m-1)+\Omega_4+\Omega_5). \end{align}\]

Now depending on \(\gamma=0\) or not, by Propositions 10-11 and directly computing, we have the following two cases.

\(\boldsymbol{Case ~1.}\) If \(\gamma=0\), then \[\begin{align}\Omega_4+\Omega_5= \begin{array}{c} \begin{cases} -p^m(p-1) , &\text{if} ~a\neq 0,b=c=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_p, l_2\neq0,l_3=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=0,l_3\neq0;\\ p^m , &\text{if} ~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2 \neq0,l_3\neq0,\\ &~~\text{or}~a\neq 0, b=0,c\neq0;\\ p^m(p-1)^2, &\text{if} ~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=l_3=0;\\ -p^m(p^m-1),&\text{if} ~a=b=0,c\neq 0. \end{cases} \end{array} . \end{align}\] Furthermore, \[wt_2(\boldsymbol{c})= \begin{cases} p^{2m-2}(p-1) , &\text{if} ~a\neq 0,b=c=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_p, l_2\neq0,l_3=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=0,l_3\neq0;\\ p^{m-1}(p^m-p^{m-1}-1) , &\text{if} ~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2\neq0,l_3\neq0,\\ &~~\text{or}~a\neq 0, b=0,c\neq0;\\ p^{m-1}(p^m-p^{m-1}-p+1),&\text{if} ~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=l_3=0;\\ p^{m-1}(p^m-1),&\text{if} ~a=b=0,c\neq 0. \end{cases}\label{wt239}\tag{5}\]

\(\boldsymbol{Case~ 2.}\) If \(\gamma\neq0\), then \[\begin{align}\Omega_4+\Omega_5= \begin{array}{c} \begin{cases} -p^m(p-1) , &\text{if} ~a\neq 0,b=c=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=l_3=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_3\neq0, l_2^2-4l_1l_3\in NS_p;\\ p^m , &\text{if} ~ a\neq 0, b=0,c\neq0,\\ &~~\text{or}~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2\neq0,l_3=0,\\ &~~\text{or}~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_3\neq0, 4l_1l_3-l_2^2=0;\\ p^m(p+1), &\text{if} ~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_p, l_3\neq0, l_2^2-4l_1l_3\in S_p;\\ -p^m(p^m-1),&\text{if} ~a=b=0,c\neq 0. \end{cases} \end{array} \end{align}\] Furthermore, \[wt_2(\boldsymbol{c})= \begin{cases} p^{2m-2}(p-1) , &\text{if} ~a\neq 0,b=c=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2=l_3=0,\\ &~~\text{or}~ a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_3\neq0, l_2^2-4l_1l_3\in NS_p;\\ p^{m-1}(p^m-p^{m-1}-1) , &\text{if} ~ a\neq 0, b=0,c\neq0,\\ &~~\text{or}~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_2\neq0,l_3=0,\\ &~~\text{or}~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_{p},l_3\neq0, 4l_1l_3-l_2^2=0;\\ p^{m-1}(p^m-p^{m-1}-2), &\text{if} ~a\in \mathbb{F}_{p^m}, b\neq 0, c \in \mathbb{F}_p, l_3\neq0, l_2^2-4l_1l_3\in S_p;\\ p^{m-1}(p^m-1),&\text{if} ~a=b=0,c\neq 0. \end{cases} \label{wt2}\tag{6}\]

Now if \(\gamma=0\), then the weight \(w_5=p^{2m-2}(p-1),w_6=p^{m-1}(p^m-p^{m-1}-1),w_7=p^{m-1}(p^m-p^{m-1}-p+1)\) and \(w_8=p^{m-1}(p^m-1)\), and so we can get \[\begin{align} &A_{w_5}=p^{m-1}(2p^m-2p^{m-1}+1), A_{w_6}=(p-1)(p^m-1)(p^m-p^{m-1}+1),\\ &A_{w_7}=p^{m-1}(p^{m}-1),A_{w_8}=p-1. \end{align}\] If \(\gamma \neq 0\), then the weight \(\tilde{w}_5=p^{2m-2}(p-1),\tilde{w}_6=p^{m-1}(p^m-p^{m-1}-1),\tilde{w}_7=p^{m-1}(p^m-p^{m-1}-2)\) and \(\tilde{w}_8=p^{m-2}(p^{m+1}-2p^m-p+2).\)

Note that \(2 \leq m,\) it’s easy to get \(p \mid w_i\) and \(p \mid \tilde{w}_i (i=5,6,7,8).\) Hence, by Lemma 6, the corresponding code \(\overline{\mathcal{C}_{D_2}}\) is self-orthogonal whether \(\gamma=0\) or not.

Finally, we determine the distance of the dual code \({\overline{\mathcal{C}_{D_2}}}^{\perp}\) for \(\gamma = 0.\) By Lemma 5 (?? )-(?? ) and directly computing, we have \(A_1^{\perp}=A_2^{\perp}=0\) and \(A_3^{\perp}>0\), which means that \(d({\overline{\mathcal{C}_{D_2}}}^{\perp})=3,\) and by the definition of the projective code, \({\overline{\mathcal{C}_{D_2}}}\) is a projective linear code.

From the above, the proofs of Theorems 5-6 are complete. \(\square\)

4.2 Some examples↩︎

In this subsection, for Theorems 2-3 and Theorems 5-6, we give some examples which are checked by the Magma program.

Table 3: Some examples for Theorems [theorem3461]-[theorem3462] and Theorems [theorem3464]-[theorem3465]
\(p\) \(m\) Theorem parameters weight enumerator
3 \(m=2\) Theorem [theorem3461] \(\left[33,5,18 \right]_3\) \(1+96z^{21}+32z^{18}+112z^{24}+2z^3\)
Theorem [theorem3462] \(\left[ 24,5,12\right]_3\) \(1+104z^{18}+112z^{15}+24z^{12}+2z^{24}\)
Theorem [theorem3464] \(\left[ 24,5,12\right]_3\) \(1+24z^{12}+112z^{15}+104z^{18}+2z^{24}\)
Theorem [theorem3465] \(\left[ 24,5,12\right]_3\) \(1+104z^{18}+112z^{15}+24z^{12}+2z^{24}\)
\(m=3\) Theorem [theorem3461] \(\left[261,7,162\right]_3\) \(1+260z^{162}+936z^{171}+988z^{180}+2z^{261}\)
Theorem [theorem3462] \(\left[234,7,144 \right]_3\) \(1+962z^{162}+988z^{153}+234z^{144}+2z^{234}\)
Theorem [theorem3464] \(\left[234,7,144 \right]_3\) \(1+234z^{144}+988z^{153}+962z^{162}+2z^{234}\)
Theorem [theorem3465] \(\left[234,7,144 \right]_3\) \(1+962z^{162}+988z^{153}+234z^{144}+2z^{234}\)
\(m=4\) Theorem [theorem3461] \(\left[2241,9,1458 \right]_3\) \(1+2240z^{1458}+8640z^{1485}+8800z^{1512}+2z^{2241}\)
Theorem [theorem3462] \(\left[2160,9,1404 \right]_3\) \(1+8720z^{1458}+8800z^{1431}+2160z^{1404}+2z^{2160}\)
Theorem [theorem3464] \(\left[2160,9,1404 \right]_3\) \(1+2160z^{1404}+8800z^{1431}+8720z^{1458}+2z^{2160}\)
Theorem [theorem3465] \(\left[2160,9,1404 \right]_3\) \(1+8720z^{1458}+8800z^{1431}+2160z^{1404}+2z^{2160}\)

5 Applications for LCD codes and quantum codes↩︎

In this section, we construct two classes of LCD codes and a class of quantum codes from self-orthogonal codes given by Section 3.

5.1 LCD codes from self-orthogonal codes↩︎

In this subsection,we construct two classes of LCD codes, and prove that there exists a class of these LCD codes whose dual codes are almost optimal LCD codes according to the sphere packing bound, and give some corresponding examples.

Theorem 12. Let \(\mathbb{F}_{p^m}^*=\left\langle \omega\right\rangle.\) For the linear code \(\overline{\mathcal{C}_{D_1}},\) if \(\gamma=\mathrm{Tr}(-\frac{\beta}{\alpha}),\) then the following two statements are true.

(1) \(\overline{\mathcal{C}_{D_1}}\) has the generator matrix \[\begin{align} G_{D_1} =& \begin{bmatrix} 1 & 1 & \cdots & 1&1 \\ \operatorname{Tr}(x_1\omega^0) & \operatorname{Tr}(x_2\omega^0)& \cdots &\operatorname{Tr}(x_{n_1-1}\omega^0)& \operatorname{Tr}(x_{n_1}\omega^0) \\ \operatorname{Tr}(x_1\omega) & \operatorname{Tr}(x_2\omega)& \cdots &\operatorname{Tr}(x_{n_1-1}\omega)& \operatorname{Tr}(x_{n_1}\omega) \\ \vdots & \vdots & &\vdots \\ \operatorname{Tr}(x_1\omega^{m-1}) & \operatorname{Tr}(x_2\omega^{m-1})& \cdots &\operatorname{Tr}(x_{n_1-1}\omega^{m-1})& \operatorname{Tr}(x_{n_1}\omega^{m-1})\\ \operatorname{Tr}(y_1\omega^{0}) & \operatorname{Tr}(y_2\omega^{0})& \cdots &\operatorname{Tr}(y_{n_1-1}\omega^{0})& \operatorname{Tr}(y_{n_1}\omega^{0})\\ \vdots & \vdots & &\vdots&\vdots \\ \operatorname{Tr}(y_1\omega^{m-1}) & \operatorname{Tr}(y_2\omega^{m-1})& \cdots &\operatorname{Tr}(y_{n_1-1}\omega^{m-1})& \operatorname{Tr}(y_{n_1}\omega^{m-1})\\ \end{bmatrix}, \end{align}\] where \(D_1=\left\lbrace (x_1,y_1),(x_2,y_2),\cdots,(x_{n_1},y_{n_1}) \right\rbrace \subseteq \mathbb{F}_{p^m}^{2} .\)

(2) The linear code \(\mathcal{C}_1\) generated by \(\mathcal{G}_1=\left[\mathrm{I}_{2m+1,2m+1}: G_{D_1}\right]\) is LCD with the parameters \[\left[p^{m-1}(p^m+p-1)+2m+1,2m+1,\geq p^{2m-2}(p-1)+1 \right]_p.\]

Proof. (1) By \(\mathbb{F}_{p^m}^*=\left\langle \omega\right\rangle,\) it’s easy to know that \(\{ 1,\omega,\omega^2,\cdots,\omega^{m-1}\}\) is a basis of \(\mathbb{F}_{p^m}\) over \(\mathbb{F}_{p}\), furthermore, the generator matrix of \(\overline{\mathcal{C}_{D_1}}\) can be represented as follows, \[\begin{align} G_{D_1} =& \begin{bmatrix} 1 & 1 & \cdots & 1&1 \\ \operatorname{Tr}(x_1\omega^0) & \operatorname{Tr}(x_2\omega^0)& \cdots &\operatorname{Tr}(x_{n_1-1}\omega^0)& \operatorname{Tr}(x_{n_1}\omega^0) \\ \operatorname{Tr}(x_1\omega) & \operatorname{Tr}(x_2\omega)& \cdots &\operatorname{Tr}(x_{n_1-1}\omega)& \operatorname{Tr}(x_{n_1}\omega) \\ \vdots & \vdots & &\vdots \\ \operatorname{Tr}(x_1\omega^{m-1}) & \operatorname{Tr}(x_2\omega^{m-1})& \cdots &\operatorname{Tr}(x_{n_1-1}\omega^{m-1})& \operatorname{Tr}(x_{n_1}\omega^{m-1})\\ \operatorname{Tr}(y_1\omega^{0}) & \operatorname{Tr}(y_2\omega^{0})& \cdots &\operatorname{Tr}(y_{n_1-1}\omega^{0})& \operatorname{Tr}(y_{n_1}\omega^{0})\\ \vdots & \vdots & &\vdots&\vdots \\ \operatorname{Tr}(y_1\omega^{m-1}) & \operatorname{Tr}(y_2\omega^{m-1})& \cdots &\operatorname{Tr}(y_{n_1-1}\omega^{m-1})& \operatorname{Tr}(y_{n_1}\omega^{m-1})\\ \end{bmatrix}, \end{align}\] where \(D_1=\left\lbrace (x_1,y_1),(x_2,y_2),\cdots,(x_{n_1},y_{n_1}) \right\rbrace \subseteq \mathbb{F}_{p^m}^{2} .\)

(2) On the one hand, by Theorem 2, \(\overline{\mathcal{C}_{D_1}}\) is a self-orthogonal code over \(\mathbb{F}_p\) with the parameters \([p^{m-1}(p^m+p-1),2m\) \(+1,p^{2m-2}(p-1) ]_p\). Since \(\mathcal{G}_1=\left[\mathrm{I}_{2m+1,2m+1}: G_{D_1}\right]\) is the generator matrix of the linear code \(\mathcal{C}_1,\) then by Lemma 7, we know that \(\mathcal{C}_1\) is LCD.

On the other hand, it’s easy to know that the length of \(\mathcal{C}_1\) is \(p^{m-1}(p^m+p-1)+2m+1\) and the dimension of \(\mathcal{C}_1\) is \(2m+1.\) Then we only determine the minimum distance of \(\mathcal{C}_1.\) For any non-zero codeword \(\boldsymbol{c} \in \mathcal{C}_1,\) by \(\mathcal{G}_1=\left[I_{2m+1,2m+1}:G_{D_1} \right],\) we know that there exists a non-zero vector \(\boldsymbol{u} \in \mathbb{F}_p^{2m+1}\) such that \[\boldsymbol{c}=\boldsymbol{u}\mathcal{G}_1=(\boldsymbol{u},\boldsymbol{u}G_{D_1}),\] where \(\boldsymbol{u}G_{D_1} \in \overline{\mathcal{C}_{D_1}}.\) Then \[wt(\boldsymbol{c})=wt((\boldsymbol{u},\boldsymbol{u}G_{D_1}))=wt(\boldsymbol{u})+wt(\boldsymbol{u}G_{D_1}).\] Note that \(\boldsymbol{u} \neq \boldsymbol{0},\) then \(wt(\boldsymbol{u}) \geq 1 ,\) and so we have \[wt(\boldsymbol{c}) \geq wt(\boldsymbol{u}G_{D_1})+1 \geq d(\overline{\mathcal{C}_{D_1}})+1=p^{2m-2}(p-1)+1.\]

From the above, the proof of Theorem 12 is complete. \(\square\)

In the similar proof as that for Theorem 12, one can obtain the following

Theorem 13. Let \(\mathbb{F}_{p^m}^*=\left\langle \omega\right\rangle.\) For the linear code \(\overline{\mathcal{C}_{D_2}},\) if \(\gamma=0,\) then the following two statements are true.

(1) \(\overline{\mathcal{C}_{D_2}}\) has the generator matrix \[\begin{align} G_{D_2} =& \begin{bmatrix} 1 & 1 & \cdots & 1&1 \\ \operatorname{Tr}(x_1\omega^0) & \operatorname{Tr}(x_2\omega^0)& \cdots &\operatorname{Tr}(x_{n_2-1}\omega^0)& \operatorname{Tr}(x_{n_2}\omega^0) \\ \operatorname{Tr}(x_1\omega) & \operatorname{Tr}(x_2\omega)& \cdots &\operatorname{Tr}(x_{n_2-1}\omega)& \operatorname{Tr}(x_{n_2}\omega) \\ \vdots & \vdots & &\vdots&\vdots \\ \operatorname{Tr}(x_1\omega^{m-1}) & \operatorname{Tr}(x_2\omega^{m-1})& \cdots &\operatorname{Tr}(x_{n_2-1}\omega^{m-1})& \operatorname{Tr}(x_{n_2}\omega^{m-1})\\ \operatorname{Tr}(y_1\omega^{0}) & \operatorname{Tr}(y_2\omega^{0})& \cdots &\operatorname{Tr}(y_{n_2-1}\omega^{0})&0\\ \vdots & \vdots & &\vdots&\vdots \\ \operatorname{Tr}(y_1\omega^{m-1}) & \operatorname{Tr}(y_2\omega^{m-1})& \cdots & \operatorname{Tr}(y_{n_2-1}\omega^{m-1})&0\\ \end{bmatrix}, \end{align}\] where \(D_2=\left\lbrace (x_1,y_1),(x_2,y_2),\cdots,(x_{n_2},0) \right\rbrace \subseteq \mathbb{F}_{p^m}^{2} .\)

(2) The linear code \(\mathcal{C}_2\) generated by \(\mathcal{G}_2=\left[\mathrm{I}_{2m+1,2m+1}: G_{D_2}\right]\) is LCD with the parameters \[\left[ p^{m-1}(p^m-1)+2m+1,2m+1, \geq p^{m-1}(p^m-p^{m-1}-p+1)+1\right]_p.\]

By taking \(m=2\) and \(\alpha=1\) in Theorem 13, the corresponding code \(\mathcal{C}_2\) is denoted by \(\mathcal{C}_3,\) we prove that there exists an almost optimal code according to the sphere packing bound.

Theorem 14. Let \(\mathbb{F}_{p^2}^*=\langle\omega \rangle.\) If \(\gamma=0,\) then the following three statements are true.

(1) \(\mathcal{C}_3\) has the generator matrix \(\mathcal{G}_3=\left[ I_5 : G_{D_2}^{(1)}\right] ,\) where \[\begin{align} G_{D_2}^{(1)}=& \begin{bmatrix} 1 & 1 & \cdots & 1 &1 \\ \operatorname{Tr_1^2}(x_1\omega^0) & \operatorname{Tr_1^2}(x_2\omega^0)& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega^0) &\operatorname{Tr_1^2}(x_{n_2}\omega^0)\\ \operatorname{Tr_1^2}(x_1\omega)+1 & \operatorname{Tr_1^2}(x_2\omega)+1& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega)+1 &\operatorname{Tr_1^2}(x_{n_2}\omega)+1 \\ \operatorname{Tr_1^2}(y_1\omega^{0}) & \operatorname{Tr_1^2}(y_2\omega^{0})& \cdots & \operatorname{Tr_1^2}(y_{n_2-1}\omega^{0}) &0\\ \operatorname{Tr_1^2}(y_1\omega^{1})+1 & \operatorname{Tr_1^2}(y_2\omega^{1})+1&\cdots&\operatorname{Tr_1^2}(y_{n_2-1}\omega^{1})+1&1\\ \end{bmatrix}, \end{align}\] \(D_2=\left\lbrace (x_1,y_1),(x_2,y_2),\cdots,(x_{n_2-1},y_{n_2-1}),(x_{n_2},y_{n_2})=(x_{n_2},0)\right\rbrace \subseteq \mathbb{F}_{p^2}^{2}\) and \(\mathrm{Tr}_1^2\) is the trace function from \(\mathbb{F}_p^2\) to \(\mathbb{F}_p.\)

(2) \(\mathcal{C}_3\) is a \([ p(p^2-1)+5,5, \geq p(p^2-2p+1)+2]_p\) LCD code.

(3) \(\mathcal{C}_3^{\perp}\) is a \(\left[ p(p^2-1)+5,p(p^2-1),3\right]_p\) almost optimal LCD code according to the sphere packing bound and \(\mathcal{C}_3\) is a projective LCD code.

Proof. (1) By Theorem 13, we know that \(\overline{\mathcal{C}_{D_2}}\) has the generator matrix \[\begin{align} {G}_{D_2}=& \begin{bmatrix} 1 & 1 & \cdots & 1 &1 \\ \operatorname{Tr_1^2}(x_1\omega^0) & \operatorname{Tr_1^2}(x_2\omega^0)& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega^0) &\operatorname{Tr_1^2}(x_{n_2}\omega^0)\\ \operatorname{Tr_1^2}(x_1\omega) & \operatorname{Tr_1^2}(x_2\omega)& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega) &\operatorname{Tr_1^2}(x_{n_2}\omega) \\ \operatorname{Tr_1^2}(y_1\omega^{0}) & \operatorname{Tr_1^2}(y_2\omega^{0})& \cdots & \operatorname{Tr_1^2}(y_{n_2-1}\omega^{0}) &0\\ \operatorname{Tr_1^2}(y_1\omega^{1}) & \operatorname{Tr_1^2}(y_2\omega^{1})&\cdots&\operatorname{Tr_1^2}(y_{n_2-1}\omega^{1})&0\\ \end{bmatrix}. \end{align}\] Now we transform the matrix \({G}_{D_2}\) by elementary row operations. For convenience, we denote the vector \(\boldsymbol{a}_u\) be the \(u\)-th row of the matrix \({G}_{D_2},\) where \(1 \leq u \leq 5,\) then replace \(\boldsymbol{a}_3\) with \(\boldsymbol{a}_3+\boldsymbol{a}_1,\) and replace \(\boldsymbol{a}_5\) with \(\boldsymbol{a}_5+\boldsymbol{a}_1,\) we obtain the matrix \[\begin{align} G_{D_2}^{(1)}=& \begin{bmatrix} 1 & 1 & \cdots & 1 &1 \\ \operatorname{Tr_1^2}(x_1\omega^0) & \operatorname{Tr_1^2}(x_2\omega^0)& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega^0) &\operatorname{Tr_1^2}(x_{n_2}\omega^0)\\ \operatorname{Tr_1^2}(x_1\omega)+1 & \operatorname{Tr_1^2}(x_2\omega)+1& \cdots & \operatorname{Tr_1^2}(x_{n_2-1}\omega)+1 &\operatorname{Tr_1^2}(x_{n_2}\omega)+1 \\ \operatorname{Tr_1^2}(y_1\omega^{0}) & \operatorname{Tr_1^2}(y_2\omega^{0})& \cdots & \operatorname{Tr_1^2}(y_{n_2-1}\omega^{0}) &0\\ \operatorname{Tr_1^2}(y_1\omega^{1})+1 & \operatorname{Tr_1^2}(y_2\omega^{1})+1&\cdots&\operatorname{Tr_1^2}(y_{n_2-1}\omega^{1})+1&1\\ \end{bmatrix}, \end{align}\] where \(D_2=\left\lbrace (x_1,y_1),(x_2,y_2),\cdots,(x_{n_2-1},y_{n_2-1}),(x_{n_2},y_{n_2})=(x_{n_2},0)\right\rbrace \subseteq \mathbb{F}_{p^2}^{2}.\) It’s easy to know that \(G_{D_2}^{(1)}\) is also a generator matrix of \(\overline{\mathcal{C}_{D_2}}.\)

(2) By Lemma 7 and \(\mathcal{G}_3=\left[ I_5 :G_{D_2}^{(1)}\right],\) we know that the linear code \(\mathcal{C}_3\) is LCD. Obviously, the length of \(\mathcal{C}_3\) is \(p(p^2-1)+5\) and the dimension of \(\mathcal{C}_3\) is \(5.\)

Next, we determine the minimum distance of \(\mathcal{C}_3.\) Let \(d(\overline{\mathcal{C}_{D_2}})\) and \(d(\mathcal{C}_3)\) be the minimum distance of \(\overline{\mathcal{C}_{D_2}}\) and \(\mathcal{C}_3,\) respectively.

Firstly, let \(\tilde{\boldsymbol{c}}\) be a non-zero codeword of \(\mathcal{C}_3\), then \(\tilde{\boldsymbol{c}}\) can be expressed as \[\tilde{\boldsymbol{c}}=(l,a_0,a_1,b_0,b_1)\mathcal{G}_3=(l,a_0,a_1,b_0,b_1,L_1,L_2,\cdots,L_{n_2}),\] where \(l,a_0,a_1,b_0,b_1\in \mathbb{F}_{p},\) \(L_i=\operatorname{Tr_1^2}(ax_i+by_i)+l+a_1+b_1, (x_i,y_i) \in D_2( 1 \leq i \leq n_2), a=a_0+a_1\omega,b=b_0+b_1\omega.\) Note that \[(L_1,L_2,\cdots,L_{n_2})=(\operatorname{Tr_1^2}(ax+by)+l+a_1+b_1)_{(x,y) \in D_2} \in \overline{\mathcal{C}_{D_2}},\] we denote \(\boldsymbol{c}=(L_1,L_2,\cdots,L_{n_2}).\) Then for \(\tilde{\boldsymbol{c}},\) we have \[\begin{align}wt(\tilde{\boldsymbol{c}})=&wt((l,a_0,a_1,b_0,b_1,L_1,L_2, \cdots,L_{n_2}))\\ =&wt((l,a_0,a_1,b_0,b_1))+wt((L_1,L_2,\cdots,L_{n_2}))\\ =&wt((l,a_0,a_1,b_0,b_1))+wt(\boldsymbol{c}). \end{align}\] Now by \(\boldsymbol{c} \in \overline{\mathcal{C}_{D_2}}\) and the proof of Theorem 5, we have \(wt(\boldsymbol{c}) \in {\left\lbrace w_5,w_6,w_7,w_8\right\rbrace },\) where \[\begin{align} &w_5=p^{2m-2}(p-1), w_6=p^{m-1}(p^m-p^{m-1}-1),\\ &w_7=p^{m-1}(p^m-p^{m-1}-p+1), w_8=p^{m-1}(p^m-1). \end{align}\]

Secondly, depending on \(wt(\boldsymbol{c})=w_5,w_6,w_7\) or \(w_8,\) we have the following four cases.

\(\boldsymbol{Case ~1.}\) If \(wt(\boldsymbol{c})=w_5,\) then by the proof of Theorem 5, there exist some \(l,a_0,a_1,b_0\) and \(b_1\) such that one of the following conditions is true,

\(\boldsymbol{(}1.1)\) \(a_0+a_1\omega \neq 0\) and \(b_0+b_1\omega=l+a_1+b_1=0;\)

\(\boldsymbol{(}1.2)\) \(b_0+b_1\omega \neq 0, \operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1\neq0\) and \(\operatorname{Tr_1^2}(-(a_0+a_1\omega)(b_0+b_1\omega))=0;\)

\(\boldsymbol{(}1.3)\) \(b_0+b_1\omega \neq 0, \operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1=0\) and \(\operatorname{Tr_1^2}(-(a_0+a_1\omega)(b_0+b_1\omega))\neq 0.\)

It’s easy to know that \(l=a_1=b_0=b_1=0\) and \(a_0 \neq 0,\) thus the condition \(\boldsymbol{(}1.1)\) is satisfied. Then the minimum weight \(wt(l,a_0,a_1,b_0,b_1)=1.\) Hence, \[wt(\tilde{\boldsymbol{c}})\geq w_5(\boldsymbol{c})+1=p^{2}(p-1)+1.\]

\(\boldsymbol{Case ~2.}\) If \(wt(\boldsymbol{c})=w_6,\) then in the similar proof as that for \(\boldsymbol{Case ~1}\), we know that there exist \(l=a_0=b_0=b_1=0\) and \(a_1 \neq 0\) such that \(wt(\boldsymbol{c})=w_6,\) furthermore, \(wt(l,a_0,a_1,b_0,b_1)=1.\) Hence, \[wt(\tilde{\boldsymbol{c}})\geq w_6(\boldsymbol{c})+1=p(p^2-p-1)+1.\]

\(\boldsymbol{Case ~3.}\) If \(wt(\boldsymbol{c})=w_7,\) then by the proof of Theorem 5, there exist some \(l,a_0,a_1,b_0\) and \(b_1\) such that the following three conditions are true simultaneously,

\(\boldsymbol{(3.1)}\) \(b_0+b_1 \omega \neq 0;\)

\(\boldsymbol{(3.2)}\) \(\operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1=0;\)

\(\boldsymbol{(3.3)}\) \(\operatorname{Tr_1^2}(-(a_0+a_1\omega)(b_0+b_1\omega))=0.\)

Next, to prove \(wt(l,a_0,\) \(a_1,b_0,b_1) \geq 2,\) we only prove the following two statements,

\(\boldsymbol{1)}\) there do not exist any \(l,a_0,a_1,b_0\) and \(b_1\) such that \(wt(l,a_0,a_1,b_0,b_1)=1;\)

\(\boldsymbol{2)}\) there exist \(l,a_0,a_1,b_0\) and \(b_1\) such that \(wt(l,a_0,a_1,b_0,b_1) = 2.\)

For the statement \(1)\) Otherwise, by \(wt(l,a_0,a_1,b_0,b_1)=1,\) we know that one of \(l,a_0,a_1,b_0\) and \(b_1\) is nonzero. Now by \(\boldsymbol{(3.1)},\) we have \(b_0 \neq 0\) or \(b_1 \neq 0,\) it means that \(l=a_0=a_1=0.\) Then by directly computing, \(\boldsymbol{(3.3)}\) holds.

If \(b_0 \neq 0,\) then \(b_1=0.\) By \(\boldsymbol{(3.2)}\), we can get \[\operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1=\operatorname{Tr_1^2}(-b_0)=(-b_0)+(-b_0)^p=-2b_0=0,\] which contradicts the fact \(b_0 \neq 0.\)

If \(b_1\neq0,\) then \(b_0=0.\) By \(\boldsymbol{(3.2)}\), we have \[\begin{align} \operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1&=\operatorname{Tr_1^2}(-b_1 \omega)=(-b_1\omega)+(-b_1 \omega)^p\\ &=-b_1\omega-b_1\omega^p=-b_1(\omega+\omega^p)\\ &=0, \end{align}\] since \(\mathbb{F}_{p^2}^*=\langle\omega \rangle,\) \(\omega+\omega^p \neq 0,\) then we have \(b_1=0,\) which contradicts the fact \(b_1 \neq 0.\)

And so, there do not exist \(l,a_0,a_1,b_0\) and \(b_1\) such that \(wt(l,a_0,a_1,b_0,b_1)=1.\)

For the statement \(2)\) There exist \(a_0=a_1=b_1=0, b_0 \neq 0\) and \(l=2b_0 \neq 0\) such that \(\boldsymbol{(3.1)}\) and \(\boldsymbol{(3.3)}\) are both true. And by directly computing, we have \[\operatorname{Tr_1^2}(-(b_0+b_1\omega))+l+a_1+b_1=\operatorname{Tr_1^2}(-b_0)+l=(-b_0)+(-b_0)^p+2b_0=-2b_0+2b_0=0,\] it means that \(\boldsymbol{(3.2)}\) is true.

In summary of the above discussions, we know that there exist \(a_0=a_1=b_1=0, b_0 \neq 0\) and \(l=2b_0 \neq 0\) such that \(wt(\boldsymbol{c})=w_7,\) furthermore, \(wt(l,a_0,a_1,b_0,b_1)=2.\) Hence, \[wt(\tilde{\boldsymbol{c}}) \geq w_7(\boldsymbol{c})+2=p(p^2-2p+1)+2.\]

\(\boldsymbol{Case ~4.}\) If \(wt(\boldsymbol{c})=w_8,\) then in the similar proof as that for \(\boldsymbol{Case ~1},\) we know that there exist \(a_0=a_1=b_0=b_1=0\) and \(l \neq 0\) such that \(wt(\boldsymbol{c})=w_8,\) furthermore, \(wt(l,a_0,a_1,b_0,b_1)=1.\) Hence, \[wt(\tilde{\boldsymbol{c}})\geq w_8(\boldsymbol{c})+1=p(p^2-1)+1.\]

Finally, from the above four cases, we have \[\begin{align} wt(\tilde{\boldsymbol{c}}) \geq &\min\left\lbrace p^{2}(p-1)+1, p(p^2-p-1)+1, p(p^2-2p+1)+2, p(p^2-1)+1 \right\rbrace\\ &=p(p^2-2p+1)+2. \end{align}\] Namely, \(d(\mathcal{C}_3) \geq d(\overline{\mathcal{C}_{D_2}})+2= p(p^2-2p+1)+2.\) Therefore, \(\mathcal{C}_3\) is a \([ p(p^2-1)+5,5, \geq p(p^2-2p+1)+2]\) LCD code.

(3) Note that the dual of an LCD code is also an LCD code, and so \(\mathcal{C}_3^{\perp}\) is also an LCD code with the length \(p(p^2-1)+5\) and the dimension \(p(p^2-1).\)

Next we prove the minimum distance of \(\mathcal{C}_3^{\perp}\) is 3. In fact, since \(\mathcal{G}_3=\left[ I_5 : G_{D_2}^{(1)}\right]\) is the parity-check matrix of \(\mathcal{C}_3^{\perp},\) we only prove the following two statements,

\(\boldsymbol{1})\) there are three columns in \(\mathcal{G}_3\) which are \(\mathbb{F}_p\)-linearly dependent;

\(\boldsymbol{2})\) for any two columns of \(\mathcal{G}_3\) are \(\mathbb{F}_p\)-linearly independent.

For the statement 1) Since \(d(\overline{\mathcal{C}_{D_2}}^{\perp})=3\) and \(G_{D_2}^{(1)}\) is the parity-check matrix of \(\overline{\mathcal{C}_{D_2}}^{\perp},\) there are three columns in \(G_{D_2}^{(1)}\) which are \(\mathbb{F}_p\)-linearly dependent. By \(\mathcal{G}_3=\left[ I_5 :G_{D_2}^{(1)}~\right],\) it’s easy to know that there are three columns in \(\mathcal{G}_3\) which are \(\mathbb{F}_p\)-linearly dependent. This implies that \(d(\mathcal{C}_3^{\perp}) \leq d(\overline{\mathcal{C}_{D_2}}^{\perp})=3\).

For the statement 2) Now we divide the following five cases to prove that any two columns of \(\mathcal{G}_3\) are \(\mathbb{F}_p\)-linearly independent. For convenience, we denote \[\mathcal{G}_3=\left[ I_5 :G_{D_2}^{(1)}\right]=\left[\boldsymbol{e}_1,\boldsymbol{e}_2,\cdots,\boldsymbol{e}_5,\boldsymbol{g}_1,\cdots,\boldsymbol{g}_{p(p^2-1)-1},\boldsymbol{g}_{p(p^2-1)} \right].\]

\(\boldsymbol{Case~1.}\) Since \(I_5\) is an identity matrix, then \(\boldsymbol{e}_i\) and \(\boldsymbol{e}_j\) are \(\mathbb{F}_p\)-linearly independent for any \(i \neq j\)(\(1 \leq i,j \leq 5\)).

\(\boldsymbol{Case~2.}\) By \(d(\overline{\mathcal{C}_{D_2}}^{\perp})=3, \boldsymbol{g}_i\) and \(\boldsymbol{g}_j\) are \(\mathbb{F}_p\)-linearly independent for any \(i \neq j\)(\(1 \leq i,j \leq p(p^2-1)\)).

\(\boldsymbol{Case~3.}\) It’s easy to know that \(\boldsymbol{e}_i\) and \(\boldsymbol{g}_{p(p^2-1)}\) are \(\mathbb{F}_p\)-linearly independent for any \(i(1 \leq i \leq 5)\).

\(\boldsymbol{Case~4.}\) It’s easy to know that \(\boldsymbol{e}_i\) and \(\boldsymbol{g}_{j}\) are \(\mathbb{F}_p\)-linearly independent for any \(i(2 \leq i \leq 5)\) and \(j(1 \leq j \leq p(p^2-1)-1)\).

\(\boldsymbol{Case~5.}\) From \(\boldsymbol{e}_1=(1, 0, \ldots, 0)^\top,\) we know that \(\boldsymbol{e_1}\) and \(\boldsymbol{g_i}\) are \(\mathbb{F}_p\)-linearly dependent for any \(i(1 \leq i \leq p(p^2-1)-1)\) if and only if there exist two nonzero elements \(a\) and \(b\) such that \(a\boldsymbol{e}_1+b\boldsymbol{g_i}=0,\) namely, the following system of equations holds, \[\begin{align} \begin{cases} x_i + x_i^p = 0 \\ \omega x_i + \omega^p x_i^p + 1 = 0 \\ y_i + y_i^p = 0 \\ \omega y_i + \omega^p y_i^p + 1 = 0 \end{cases}, \label{40546141} \end{align}\tag{7}\] where \((x_i,y_i)\in D_2\) for any \(i(1 \leq i \leq p(p^2-1)-1)\). It’s easy to know that \(x_i=y_i\) if (7 ) holds for any \(i(1 \leq i \leq p(p^2-1)-1)\). Since \(x_i=y_i\) and \[(x_i,y_i) \in D_2=\left\lbrace (x , y) \in \mathbb{F}_{p^m}^* \times \mathbb{F}_{p^m} : \mathrm{Tr} ( xy +x)=0 \right\rbrace,\] we can deduce that \[\begin{align} \operatorname{Tr_1^2}(x_iy_i+x_i)&=\operatorname{Tr_1^2}(x_i^2+x_i)=\operatorname{Tr_1^2}(x_i^2)+\operatorname{Tr_1^2}(x_i)\\ &=x_i^2+x_i^{2p}+x_i+x_i^{p}=x_i^2+x_i^{2p}\\ &=(x_i+x_i^{p})^2-2x_i^{p+1}\\ &=-2x_i^{p+1}\neq0,\end{align}\] which contradicts the fact \((x_i,y_i)\in D_2 .\) Hence, \(\boldsymbol{e_1}\) and \(\boldsymbol{g_i}\) are \(\mathbb{F}_p\)-linearly independent for any \(i(1 \leq i \leq p(p^2-1)-1)\).

From the above five cases, any two columns of \(\mathcal{G}_3\) are \(\mathbb{F}_p\)-linearly independent. And then according to \(\boldsymbol{1})\)-\(\boldsymbol{2})\), the minimum distance of the dual code \(\mathcal{C}_3^{\perp}\) is 3. Now by the definition of the projective code, \(\mathcal{C}_3\) is a projective LCD code.

Moreover, we have \(p^{n-(p(p^2-1)+2)}<1+n(p-1),\) where \(n=p(p^2-1)+5.\) Then from the sphere packing bound given by Lemma 9, we know that there does not exist any \([ p(p^2-1)+5,p(p^2-1)\) \(+2,3]\) code. Therefore, \(\mathcal{C}_3^{ \perp}\) is a \(\left[ p(p^2-1)+5,p(p^2-1),3\right]_p\) almost optimal LCD code.

From the above, the proof of Theorem 14 is complete. \(\square\)

Example 1. By taking \(p=3,m=2\) and \(\alpha=\beta=\gamma=1\) in Theorem 2. Let \(\mathbb{F}_{3^2}^*=\left\langle \omega\right\rangle,\) then \(\overline{\mathcal{C}_{D_1}}\) defined by (4 ) has parameters \(\left[33,5,18 \right]_{3},\) and by the Magma program, the corresponding defining set \[\tilde{D}=\left\lbrace \begin{align} &(0,\omega), (0,\omega^3), (0,2), (1,\omega),(1,\omega^3),(1,2),(\omega,0),(\omega,1),(\omega,2), (\omega^2,\omega^2),(\omega^2,2),(\omega^2,\omega^5),\\&(\omega^3,0),(\omega^3,1),(\omega^3,2),(2,0),(2,1), (2,\omega),(2,\omega^2),(2,\omega^3),(2,2),(2,\omega^5),(2,\omega^6),(2,\omega^7),\\ &(\omega^5,\omega^2),(\omega^5,2),(\omega^5,\omega^5),(\omega^6,2),(\omega^6,\omega^6),(\omega^6,\omega^7),(\omega^7,2),(\omega^7,\omega^6),(\omega^7,\omega^7) \end{align} \right\rbrace.\]

By taking \(D_1=\tilde{D}\) in Theorem 12 and directly computing, \(\overline{\mathcal{C}_{D_1}}\) has the generator matrix

\[\begin{align} G_{D_1}=& \begin{bmatrix} g_1 \\ g_2 \\ g_3 \\ g_4\\ g_5\\ \end{bmatrix}, \end{align}\] where \[\begin{align} g_1&=\left(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 \right),\\ g_2&=\left(2,1,1,2,0,1,0,2,2,1,0,2,1,1,1,0,1,0,1,2,1,2,1,2,0,2,0,1,1,1,0,1,0 \right),\\ g_3&=\left(1,0,2,1,0,2,1,1,2,2,2,0,1,2,2,1,1,2,2,0,0,2,1,2,1,0,0,2,2,0,0,2,2 \right),\\ g_4&=\left(1,1,1,1,1,1,0,1,2,1,1,2,2,0,2,2,0,2,2,1,2,1,1,0,1,0,1,0,0,0,1,2,0\right),\\ g_5&=\left(2,2,1,0,0,2,1,1,2,0,2,0,1,0,0,0,0,2,1,2,1,2,2,2,2,1,1,2,1,0,2,2,2\right). \end{align}\]

Based on the Magma program, the code \(\mathcal{C}_1\) generated by \(\mathcal{G}_1\) is an LCD code with the parameters \(\left[ 38,5,20 \right]_3,\) which is consistent with Theorem 12.

Example 2. By taking \(p=3,m=2\) and \(\alpha=1,\gamma=0\) in Theorem 3.3. Let \(\mathbb{F}_{3^2}^*=\left\langle \omega\right\rangle,\) then \(\overline{\mathcal{C}_{D_2}}\) defined by (4 ) has parameters \(\left[24,5,12 \right]_3,\) and by the Magma program, the corresponding defining set \[D^*=\left\lbrace \begin{align} &(1,\omega), (1,\omega^3), (1,2),(\omega,2),(\omega,\omega^6),(\omega,\omega^7) (\omega^2,0),(\omega^2,1),(\omega^2,2),(\omega^3,\omega^2),(\omega^3,2),\\&(\omega^3,\omega^5),(2,\omega),(2,\omega^3), (2,2),(\omega^5,2),(\omega^5,\omega^6),(\omega^5,\omega^7),(\omega^6,0),(\omega^6,1),(\omega^6,2),\\&(\omega^7,\omega^2),(\omega^7,2),(\omega^7,\omega^5) \end{align} \right\rbrace.\]

By taking \(D_2=D^*\) in Theorem 13 and directly computing, \(\overline{\mathcal{C}_{D_2}}\) has the generator matrix

\[\begin{align} G_{D_2}=& \begin{bmatrix} h_1 \\ h_2 \\ h_3 \\ h_4\\ h_5\\ \end{bmatrix} \end{align}\] where \[\begin{align} h_1&=\left(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 \right),\\ h_2&=\left(2, 0 ,2, 1, 0 ,2 ,1, 1 ,2, 0 ,1, 0 ,2 ,1, 2, 2, 0 ,2, 1, 2, 1, 1, 1, 0 \right),\\ h_3&=\left(0, 1 ,2 ,1, 2, 0 ,2, 2 ,0, 1, 0 ,2 ,1 ,1 ,2 ,1, 1 ,2 ,0, 1 ,0 ,2, 1, 2\right),\\ h_4&=\left(2, 1 ,2, 1, 1, 1,1, 1 ,0 ,2, 0 ,2,1, 0 ,1, 1, 0 ,0, 2 ,1, 1, 1,2, 0\right),\\ h_5&=\left(2, 2, 0, 2, 2, 2, 0 ,2, 2, 1, 2 ,1, 0 ,1, 2, 2, 0 ,1,2, 1 ,2 ,1, 0 ,0\right). \end{align}\]

Based on the Magma program, the code \(\mathcal{C}_2\) generated by \(\mathcal{G}_2\) is an LCD code with the parameters \(\left[ 29,5,14 \right]_3,\) which is consistent with Theorem 13.

Let \(G_{D_2}^{(1)}=[h_1,h_2,h_3+h_1,h_5+h_1]\) in Theorem 14, based on the Magma program, the code \(\mathcal{C}_3\) generated by \(\mathcal{G}_3=\left[ I_5 :G_{D_2}^{(1)}\right]\) is a projective LCD code with the parameters \(\left[ 29,5,14 \right]_3,\) and the dual code is a \(\left[ 29,24,3 \right]_3\) almost optimal LCD code, which is consistent with Theorem 14.

Remark 15. In Table ¿tbl:table4? of the Appendix, we list the known LCD codes, and compared with the parameters, it’s easy to know that the length, the dimension or the distance of LCD codes constructed in this section are different from all known codes listed in Table ¿tbl:table4?. Therefore, LCD codes constructed in this section are new.

5.2 Quantum codes from self-orthogonal codes↩︎

In this subsection, we construct a class of quantum codes which are quantum AMDS codes for \(m=2\) according to the quantum Singleton bound and give some corresponding examples.

Theorem 16. Let \(\overline{\mathcal{C}_{D_2}}\) be a \(\left[ p^{m-1}(p^m-1),2m+1,p^{m-1}(p^m-p^{m-1}-p+1)\right]_p\) self-orthogonal linear code, then there exists a quantum code \(\mathcal{Q}\) with parameters \[\llbracket p^{m-1}(p^m-1), p^{m-1}(p^m-1)-2m-2, 3 \rrbracket_{p}.\]

Proof. By Theorem 5, it is clear that the dual code \({\overline{\mathcal{C}_{D_2}}}^{\perp}\) is an \([n,\) \(n-2m-1,3 ]_p\) linear code, where \(n=p^{m-1}(p^m-1),\) and \(\overline{\mathcal{C}_{D_2}} \subseteq {\overline{\mathcal{C}_{D_2}}}^{\perp}.\) Let \(\tilde{\mathcal{C}}_1={\overline{\mathcal{C}_{D_2}}}^{\perp}\) and \(\tilde{\mathcal{C}}_2\) be the dual of the code \(\left\lbrace c\boldsymbol{1_n} : c \in \mathbb{F}_{p^m} \right\rbrace \subseteq \overline{\mathcal{C}_{D_2}}.\) It is easy to know that \(\tilde{\mathcal{C}}_2\) has parameters \(\left[n,n-1,2 \right]_p\). Then we can deduce that \(\tilde{\mathcal{C}}_1^{\perp} \subseteq \tilde{\mathcal{C}}_1 \subseteq \tilde{\mathcal{C}}_2.\) Now by \(2 \leq m,\) we have \[\mathrm{dim}(\tilde{\mathcal{C}}_1)+2=n-2m+1 \leq n-1= \mathrm{dim}(\tilde{\mathcal{C}}_2).\] Thus, by Lemma 8, there exists a quantum code \(\mathcal{Q}\) with parameters \(\llbracket n, n-2m-2, 3 \rrbracket_{p}.\)

From the above, the proof of Theorem 16 is complete. \(\square\)

Remark 17. When \(m=2,\mathcal{Q}\) is a \(\llbracket p(p^2-1), p(p^2-1)-6, 3 \rrbracket_p\) quantum AMDS code according to the quantum Singleton bound.

Remark 18. In Table [tbl:table5] of the Appendix, we list the known quantum codes with minimum distance 3. And compared with the parameters, it’s easy to know that the length or the dimension of quantum code constructed in this section is different from all known codes listed in Table [tbl:table5]. Therefore, the quantum code with minimum distance 3 constructed in this section is new.

6 Conclusions↩︎

In this manuscript, a class of projective four-weight self-orthogonal codes and three classes of four-weight self-orthogonal codes are constructed. As applications, we obtain two classes of LCD codes and a class of quantum codes. In particular, we prove that there exists a class of these LCD codes whose dual codes are almost optimal LCD codes according to the sphere packing bound, and a class of quantum codes are AMDS according to the quantum Singleton bound. Comparing with the parameters of LCD codes and quantum codes in Tables ¿tbl:table4?-[tbl:table5] of the Appendix, LCD codes and quantum codes constructed in this manuscript are both new.

Acknowledgments↩︎

This paper is supported by National Natural Science Foundation of China (Grant No. 12471494) and Natural Science Foundation of Sichuan Province (2024NSFSC2051).

\(n\) \([n, k, d]\) Condition Ref.
\(n = q^l + 1\) \([n, k, \ge 2(\delta - 1)]_q\) \(3 \le \delta \le \frac{q^{l-1}}{2} + 3\) [4] Thm 18
\(n = \frac{q^m-1}{q-1}\) \([n, n - 1 - 2m \lceil \frac{\delta-1}{q-1} \rceil, \ge 2\delta]_q\) \(2 \le \delta \le \frac{q^{m-1}}{2}\) [4] Thm 32
\(n = \frac{q-1}{N}q^{m-1}+m+1\) \([n,m+1,\frac{q-1-N}{N}q^{m-1}+2]_q\) \((q,m) \neq (3,2),\; 1 \le N < q-1,\; N \mid (q-1)\) [27] Thm 30
\(n = q^{m-1}(q^m+1)+2m+1\) \([n,2m+1,\ge (q-1)q^{2m-2}+1]_q\) \(q\) is odd \(m \ge 2\); \(q\) is even \(m \ge 3\) [27] Thm 31
\(n = \frac{q-1}{N}q^{m-1}(q^m+1)+2m+1\) \([n,2m+1,\ge \frac{q-1}{N}q^{2m-2}(q-1)+1]_q\) \(1 < N,\; N \mid (q-1)\)
\(q\) is odd \(m \ge 2\); \(q\) is even and \(m \ge 3\)
[27] Thm 32
\(n = p^m + 2m + 1\) \([n, 2m + 1, p^m - p^{m-1} - p^{\frac{m-1}{2}} + 1]_p\) \(p \equiv 1 \pmod{4}, m\) is odd
\(p \equiv 3 \pmod{4}, m \equiv 3 \pmod{4}\)
[1] Thm 40,48
\(n = p^m + 2m + 1\) \([n, 2m + 1, p^m - p^{m-1} - p^{\frac{m-1}{2}} + 2]_p\) \(p \equiv 3 \pmod{4},\; m \equiv 1 \pmod{4}\) [1] Thm 40,48
\(n = p^m + 2m + 1\) \([n, 2m + 1, p^m - p^{m-1} - (p-1)p^{\frac{m-2}{2}} + 1]_p\) \(p \equiv 1 \pmod{4}, m\) is even
\(p \equiv 3 \pmod{4}, m \ge 4\) is even
[1] Thm 40,48
\(n = p^m + 2m + 1\) \([n, 2m + 1, p^m - p^{m-1} - (p-1)p^{\frac{m-2}{2}} + 2]_p\) \(p \equiv 3 \pmod{4},\; m = 2\) [1] Thm 40,48
\(n = p^m + 2m + 1\) \([n, p^m, 3]_p\) \((p, m) \neq (3, 2)\) [28] Thm 40,48
\(n = p^m + m + 2\) \([n, m+2, d']_p\) \(p\) is odd and \(m \in \mathbb{Z}^{+}\) [29] Prop 3
The known infinite families of LCD codes.
\(n\) \(\llbracket n, k, d\rrbracket\) Condition Ref.
\(n = q^r\) \(\llbracket n, n-(r+2), 3 \rrbracket_q\) \(r \ge 2\) [30] Thm 9
\(4 \le n \le q^2+1\) \(\llbracket n, n-4,3 \rrbracket_q\) \(q=3^r, r \le 1\) [31] Thm 1.1
\(n = 9m\) \(\llbracket n,n-\lceil \log_3 m \rceil -4 ,3\rrbracket_q\) \(3^{k-1} < n \le 3^k,\; m \ge 1\) [8] Thm 4.3
\(n = 9m+3,9m+6\) \(\llbracket n,n-6,3\rrbracket_q\) \(1 \le m \le 7\) [8] Thm 4.3
\(3^{k-1}-9 < n \le 3^k-9\) \(\llbracket n,n-k-2,3\rrbracket_q\) \(5 \le k,\; (n,9)=3\) [8] Thm 4.3
\(n = \frac{q^2-1}{2}\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le q\) [32] Thm 3.2
\(n = \frac{q^2-1}{2}\) \([n, n-2d+2, d]_q\) \(\frac{q+1}{2} \le d \le q\) [32] Thm 3.4
\(n = \lambda(q+1)\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le \frac{q+1}{2} + \lambda,\; \lambda \mid q-1,\; \lambda\) is odd [32] Thm 3.7
\(n = 2\lambda(q+1)\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le \frac{q+1}{2} + 2\lambda,\; q \equiv 1 \pmod{4},\; \lambda \mid q-1,\; \lambda\) is odd [32] Thm 3.10
\(n = \frac{q^2+1}{5}\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le \frac{q+5}{2},\; d\) is even [32] Thm 3.14
\(n = \frac{q^2+1}{5}\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le \frac{q+3}{2},\; d\) is even [32] Thm 3.15
\(n = \frac{q^2-1}{6}\) \(\llbracket n, n-2d+2, d\rrbracket_q\) \(2 \le d \le \frac{2q-1}{3},\; q\) is odd, \(6 \mid q+1\) [33] Thm 3.8
\(n = \frac{p^{2s}+(p^{s_1}-1)G^2}{p^{s_1}}\) \(\llbracket n, n-\frac{2s}{s_2}-2, 3\rrbracket_p\) \(s_1 \mid s_2, s \ge 2s_1\); or \(s_2/s_1\) is odd, \(2s>s_1+s_2\); or \(s_2/s_1\) is even, \(2s>2s_1+s_2\) [34] Thm 5.5

3pt

3pt

References↩︎

[1]
X. Li, F. Cheng, C. Tang, Z. Zhou, Some classes of LCD codes and self-orthogonal codes over finite fields, Adv. Math. Commun. 13 (2019) 267–280.
[2]
C. Ding, X. Wang, A coding theory construction of new systematic authentication codes, Theoret. Comput. Sci. 330 (2005), no. 1, 81–99. https://doi.org/10.1016/j. tcs.2004.09.011.
[3]
C. Xie, H. Chen, H. Zhou, Y. Li, and H. Lao, Optimal, almost optimal few-weight linear codes and related quantum codes, IEEE Trans. Inf. Theory, vol. 71, no. 6, pp. 4250–4259, Jun. 2025, https:// doi. org/10.1109/TIT.2025.3557315.
[4]
C. Li, C. Ding, S. Li, LCD cyclic codes over finite fields, IEEE Trans. Inf. Theory 63 (2017) 4344–4356.
[5]
Q. Liao, Z. Zhang, P. Zheng. Several classes of three-weight or four-weight linear codes[J]. Journal of the Korean Mathematical Society, 2026, 63(3): 493-508.
[6]
X. Wang, Z. Heng. Several families of self-orthogonal codes and their applications in optimal quantum codes and LCD codes[J]. IEEE Transactions on Information Theory, 2024, 70(7): 4769-4791.
[7]
A. R. Calderbank and J.-M. Goethals, Three-weight codes and association schemes, Philips J. Res. 39 (1984), no. 4-5, 143–152.
[8]
G. Chen, R. Li, Ternary self-orthogonal codes of dual distance three and ternary quantum codes of distance three, Des. Codes Cryptogr. 69 (2013) 53–63.
[9]
K. Ding, C. Ding, Binary linear codes with three weights, IEEE Commun. Lett., 18 (2014), 1879–1882.
[10]
G. Guo, R. Li, Y. Liu, Application of Hermitian self-orthogonal GRS codes to some quantum MDS codes, Finite Fields Appl. 76 (2021) 101901.
[11]
Z. Heng, Q. Yue, A class of binary linear codes with at most three weights, IEEE Commun. Lett., 19 (2015), 1488–1491.
[12]
Z. Heng, D. Li, F. Liu, Ternary self-orthogonal codes from weakly regular bent functions and their application in LCD codes, Des. Codes Cryptogr. 91 (2023) 3953–3976.
[13]
Z. Heng, X. Li, Y. Wu, et al. Two families of linear codes with desirable properties from some functions over finite fields[J]. IEEE Transactions on Information Theory, 2025, 71(1): 170-184.
[14]
X. Li, Z. Heng. Self-orthogonal codes from \(p\)-divisible codes[J]. IEEE Transactions on Information Theory, 2024, 70(12): 8562-8586.
[15]
W. Liu, X. Du, X. Qiao. Construction of a class of linear codes with at most three-weight and the application[J]. IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, 2024, E107-A(1): 119-124.
[16]
Y. Zhang, D. Zheng, X. Wang. A new class of self-orthogonal linear codes and their applications[J]. Discrete Mathematics, 2026, 349(5): 114935.
[17]
M. Zhang, Z. Li, L. Xing, N. Tang, Construction of some new quantum BCH codes, IEEE Access 6 (2018) 36122–36131.
[18]
M.Zhao , Y.Chang, Several classes of three-weight and four-weight linear codes[J]. Advances in Mathematics of Communications, 2026, 22: 39-47.
[19]
W. Chen, J. Zhang, and M. Shi, A new family of p-ary self-orthogonal code from weakly regular plateaued functions, J. Appl. Math. Comput., vol. 71, no. 2, pp. 2327–2348, 2025, doi: 10.1007/s12190-024-02316-9.
[20]
S. Mesnager, A. Sınak, Further designs for self-orthogonal and LCD codes developed from functions over finite fields, Comput. Appl. Math., vol. 44, no. 7, art. no. 341, 2025, doi: 10.1007/s40314-025-03287-8.
[21]
D. Xie, S. Zhu, Two families of self-orthogonal codes with applications in LCD codes and optimally extendable codes. Finite Fields Appl. 108, 102659 (2025).
[22]
C. Zhu, Q. Liao, Constructions for several classes of few-weight linear codes and their applications, Adv. Math. Commun., 18(4), 967-994 (2024).
[23]
R. Lidl, H. Niederreiter, F.M. Cohn, Finite Fields, Cambridge University Press, Cambridge, 1997.
[24]
W.C. Huffman, V. Pless, Fundamentals of Error-Correcting Codes, Cambridge University Press, Cambridge, 2003.
[25]
S. Ling, J. Luo, C. Xing, Generalization of Steane’s enlargement construction of quantum codes and applications, IEEE Trans. Inf. Theory 56 (2010) 4080–4084.
[26]
A. Ketkar, A. Klappenecker, S. Kumar, K.P. Sarvepalli, Nonbinary stabilizer codes over finite fields, IEEE Trans. Inf. Theory 52 (2006) 4892–4914.
[27]
X. Wang, D. Zheng, Y. Zhang. Binary linear codes with few weights from Boolean functions[J]. Designs, Codes and Cryptography, 2021, 89(8): 2009-2030.
[28]
R. Li and X. Li, Quantum codes constructed from binary cyclic codes, Int. J. Quantum Inf., vol. 2, no. 2, pp. 265–272, Jun. 2004.
[29]
R. Li and Z. Xu, Construction of \([[n,n-4,3]]_q\) quantum codes for odd prime power \(q\), Phys. Rev. A, vol. 82, no. 5, p. 052316, Nov. 2010, doi: 10.1103/PhysRevA.82.052316.
[30]
J. Bierbrauer, Y. Edel, Quantum twisted codes, J. Comb. Des. 8 (2000) 174–188.
[31]
J.L. Massey, Linear codes with complementary duals, Discrete Math. 106 (1992) 337–342.
[32]
X. Kai, S. Zhu, and P. Li, Constacyclic codes and some new quantum MDS codes, IEEE Trans. Inf. Theory, vol. 60, no. 4, pp. 2080–2086, Apr. 2014, doi: 10.1109/TIT.2014.2308180.
[33]
X. Hu, G. Zhang, and B. Chen, Constructions of new nonbinary quantum codes, Int. J. Theor. Phys., vol. 54, no. 1, pp. 92–99, Jan. 2015, doi: 10.1007/s10773-014-2204-8.
[34]
J. Yuan and C. Ding, Secret sharing schemes from three classes of linear codes, IEEE Trans. Inform. Theory 52 (2006), no. 1, 206–212. https://doi.org/10.1109/TIT.2005. 860412.

  1. Corresponding author: Qunying Liao. Emails:2907245673@qq.com; liangzhongh0807@163.com; 3120193984@qq.com; 2475636261@qq.com; qunyingliao@sicnu.edu.cn.↩︎

  2. Chenlu Jia, Zhonghao Liang, Yue Huang and Qunying Liao are with College of Mathematical Sciences, Sichuan Normal University, Chengdu 610066, China.↩︎

  3. This paper is supported by National Natural Science Foundation of China (12471494) and Natural Science Foundation of Sichuan Province (2024NSFSC2051).↩︎