Abstract
Let \(\mathbb {F}_{q}\) be the finite field with \(q=p^{m}\) elements, where p is an odd prime and m is a positive integer. For a positive integer t, let \(D\subset \mathbb {F}^{t}_{q}\) and let \({\mathrm {Tr}}_{m}\) be the trace function from \(\mathbb {F}_{q}\) onto \(\mathbb {F}_{p}\). In this paper, let \(D=\{(x_{1},x_{2},\ldots ,x_{t}) \in \mathbb {F}_{q}^{t}\setminus \{(0,0,\ldots ,0)\} : {\mathrm {Tr}}_{m}(x_{1}+x_{2}+\cdots +x_{t})=0\},\) we define a p-ary linear code \(\mathcal {C}_{D}\) by
where
We shall present the complete weight enumerators of the linear codes \(\mathcal {C}_{D}\) and give several classes of linear codes with a few weights. This paper generalizes the results of Yang and Yao (Des Codes Cryptogr, 2016).
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Let \(\mathbb {F}_{p}\) be the finite field with p elements where p is an odd prime. An [n, k, d] linear code \(\mathcal {C}\) over \(\mathbb {F}_{p}\) is k-dimensional subspace of \(\mathbb {F}^{n}_{p}\) with minimum distance d. We recall the definition of the complete weight enumerator of linear code [14]. Suppose that the elements of \(\mathbb {F}_{q}\) are \(w_{0}=0,w_{1},\ldots ,w_{q-1}\), which are listed in some fixed order. The composition of a vector \(\mathbf v =(v_{0},v_{1},\ldots ,v_{n-1})\in \mathbb {F}_{q}^{n}\) is defined to be comp(v)=\((t_{0},t_{1},\ldots ,t_{q-1}),\) where each \(t_{i}=t_{i}(\mathbf v )\) is the number of components \(v_{j}(0\leqslant j\leqslant n-1)\) of v that equal to \(w_{i}\). Clearly, we have
Definition 1.1
Let \(\textit{C}\) be an [n, k] linear code over \(\mathbb {F}_{q}\) and let \(A(t_{0},t_{1}\ldots ,t_{q-1})\) be the number of codewords \(\mathbf{c }\in \textit{C}\) with comp(c)=\((t_{0},t_{1},\ldots ,t_{q-1}).\) Then the complete weight enumerator of C is defined to be the polynomial
\(\mathrm{where}\;B_{n}=\lbrace (t_{0},t_{1},\ldots ,t_{q-1}):0\leqslant t_{i}\leqslant n, \displaystyle \sum _{i=0}^{q-1}t_{i}=n\rbrace .\)
Recently, linear codes with a few weights have been investigated [1, 6–10, 13, 16, 19] by using exponential sums in some cases. They may have many applications in association schemes [3], strongly regular graphs [4], and secret sharing schemes [5, 18]. In addition, the complete weight enumerators of linear codes over finite fields can be applied to compute the deception probabilities of certain authentication codes constructed from linear codes [11, 12]. We begin to recall a class of two-weight and three-weight linear codes which were proposed by Ding and Ding [9]. Let \(D=\{x \in \mathbb {F}^{*}_{q} : {\mathrm {Tr}}_{m}(x^{2})=0\},\) where \({\mathrm {Tr}}_{m}\) is the trace function from \(\mathbb {F}_{q}\) onto \(\mathbb {F}_{p}\). Then a linear code of length \(n=|D|\) over \(\mathbb {F}_{p}\) can be defined by
It was proved that \(\mathcal {C}_{D}\) is a two-weight code if m is even and a three-weight code if m is odd. Motivated by the results given in [9], Bae et al. gave a generalization of Ding and Ding’s case [1]. Let \(D = \{(x_{1},x_{2},\ldots ,x_{t}) \in \mathbb {F}_{q}^{t}\setminus \{(0,0,\ldots ,0)\} : {\mathrm {Tr}}_{m}(x_{1}^{2}+x_{2}^{2}+\cdots +x_{t}^{2})=0\}.\) They define a p-ary linear code \(\mathcal {C}_{D}\) by
where
It was also shown that \(\mathcal {C}_{D}\) is two-weight if tm is even and three-weight if tm is odd. If \(D=\{x \in \mathbb {F}^{*}_{q} : {\mathrm {Tr}}_{m}(x)=0\}\) and \(\mathcal {C}_{D}=\{{\mathrm {Tr}}_{m}(ax^{2})_{x\in D} : a\in \mathbb {F}_{q}\},\) Yang and Yao [17] determined the complete weight enumerators of \(\mathcal {C}_{D}\). In this paper, let \(D = \{(x_{1},x_{2},\ldots ,x_{t}) \in \mathbb {F}_{q}^{t}\setminus \{(0,0,\ldots ,0)\} : {\mathrm {Tr}}_{m}(x_{1}+x_{2}+\cdots +x_{t})=0\}.\) We define a p-ary linear code \(\mathcal {C}_{D}\) by
where
We shall present the complete weight enumerators of this class of linear codes and get several linear codes with a few weights. In addition, this paper generalizes the results of Yang and Yao [17].
2 Preliminaries
Let p be an odd prime and \(q=p^{m}\) for a positive integer m. For any \(a\in \mathbb {F}_{q}\), we can define an additive character of the finite field \(\mathbb {F}_{q}\) as follows:
where \(\zeta _p=e^{\frac{2\pi \sqrt{-1}}{p}}\) is a p-th primitive root of unity. It is clear that \(\psi _0(x)=1\) for all \(x \in \mathbb {F}_{q}\). Then \(\psi _0\) is called the trivial additive character of \(\mathbb {F}_{q}\). If \(a=1\), we call \(\psi :=\psi _1\) the canonical additive character of \(\mathbb {F}_{q}\). It is easy to see that \(\psi _a(x)=\psi (ax)\) for all \(a, x \in \mathbb {F}_q\). The orthogonal property of additive characters which can be found in [14] is given by
Let \(\lambda : \mathbb {F}_q^* \rightarrow \mathbb {C}^*\) be a multiplicative character of \(\mathbb {F}_q^*\). Now we define the Gauss sum over \(\mathbb {F}_{q}\) by
Let \(q-1=sN\) for two positive integers \(s>1\), \(N>1\) and \(\alpha \) be a fixed primitive element of \(\mathbb {F}_{q}\). Let \(\langle \alpha ^{N} \rangle \) denote the subgroup of \(\mathbb {F}_{q}^{*}\) generated by \(\alpha ^{N}\). The cyclotomic classes of order N in \(\mathbb {F}_{q}\) are the cosets \(C_{i}^{(N,q)}=\alpha ^{i}\langle \alpha ^{N}\rangle \) for \(i=0,1,\ldots , N-1.\) We know that \(|C_{i}^{(N,q)}|=\frac{q-1}{N}\). The Gaussian periods of order N are defined by
Lemma 2.1
[2, 14] Suppose that \(q=p^m\) and \(\eta \) is the quadratic character of \(\mathbb {F}_{q}^{*}\) where p is an odd prime and \(m \ge 1\). Then
where \(p^*=\big (\frac{-1}{p}\big )p=(-1)^{\frac{p-1}{2}}p\).
Lemma 2.2
[14] If q is odd and \(f(x)=a_{2}x^{2}+a_{1}x+a_{0}\in \mathbb {F}_{q}[x]\) with \(a_{2}\ne 0,\) then
where \(\eta \) is the quadratic character of \(\mathbb {F}_{q}^{*}\).
Lemma 2.3
[15] When \(N=2\), the Gaussian periods are given by
and \(\eta ^{(2,q)}_{1}=-1-\eta ^{(2,q)}_{0}\).
3 Complete weight enumerators
In this section, we will investigate the complete weight enumerators of the linear codes \(\mathcal {C}_{D}\) defined by (1) and (2), where
Let \(\eta _{p}\) be the quadratic character of \(\mathbb {F}^{*}_{p}\) and let \(G(\eta _{p})\) denote the quadratic Gauss sum over \(\mathbb {F}_{p}\). For \(z\in \mathbb {F}^{*}_{p}\), it is easily checked that \(\eta (z)=\eta _{p}(z)\) if m is odd and \(\eta (z)=1\) if m is even, where \(\eta \) is the quadratic character of \(\mathbb {F}^{*}_{q}\) (see [9]). Since the trace function is balanced, we have the following lemma.
Lemma 3.1
Denote \(n_{c}=|\{(x_{1}, x_{2}, \ldots , x_{t}) \in \mathbb {F}^{t}_{q} :{\mathrm {Tr}}_{m}(x_{1}+x_{2}+\cdots +x_{t})=c\}|\) for each \(c \in \mathbb {F}_{p}\), then \(n_{c}=p^{tm-1}.\)
By Lemma 3.1 it is easy to see that the length of \(\mathcal {C}_{D}\) is \(n=n_{0}-1=p^{tm-1}-1.\) For a codeword \(\mathbf {c}(a_{1},a_{2},\ldots ,a_{t})\) of \(\mathcal {C}_{D}\) and \(\rho \in \mathbb {F}_{p}^{*},\) let \(N_{\rho }:=N_{\rho }(a_{1},a_{2},\ldots ,a_{t})\) be the number of components \({\mathrm {Tr}}_{m}(a_{1}x^{2}_{1}+\cdots +a_{t}x^{2}_{t})\) of \(\mathbf {c}(a_{1},\ldots , a_{t})\) which are equal to \(\rho \). Then
where
Lemma 3.2
Suppose that there are exactly k elements \(a_{i_{1}},\ldots ,a_{i_{k}}\ne 0\) among \(a_{1},\ldots ,a_{t}\) for \(1\le k\le t\).
-
(1)
If m is even, then
$$\begin{aligned} \displaystyle \Omega _{2}=-q^{t-k}\eta (a_{i_{1}}\cdots a_{i_{k}})G(\eta )^{k}. \end{aligned}$$ -
(2)
If m is odd, then
$$\begin{aligned} \Omega _{2}=&\left\{ \begin{array}{ll} -q^{t-k}\eta (a_{i_{1}}\cdots a_{i_{k}})G(\eta )^{k}, &{}\quad k\;\mathrm{is\;even,}\\ q^{t-k}\eta (a_{i_{1}}\cdots a_{i_{k}})G(\eta )^{k}G(\eta _{p})\eta _{p}(-\rho ), &{}\quad k\;\mathrm{is\;odd.} \end{array} \right. \end{aligned}$$
Proof
If \(a_{1}=a_{2}=\cdots =a_{t}=0\), then it is easy to see that \(\Omega _{2}=-q^{t}\). Otherwise by Lemma 2.2, we get
If m is even or if m is odd and k is even, then \(\eta (z)^{k}=1\). Thus, we get the result.
If m is odd and k is odd, then \(\eta _{p}(z)^{k}=\eta _{p}(z)\) and \(\displaystyle \sum _{z \in \mathbb {F}^{*}_{p}}\zeta _{p}^{-z\rho }\eta _{p}(z)=G(\eta _{p})\eta _{p}(-\rho ).\) Thus, we get the result. \(\square \)
To simplify formulas, we denote \(A=a_{1}\cdots a_{t}\) and \(B=a^{-1}_{1}+\cdots +a^{-1}_{t}\) throughout this paper.
Lemma 3.3
If \(a_{1}a_{2}\cdots a_{t}=0\), then \(\Omega _{3}=0\). Assume that \(a_{1}a_{2}\cdots a_{t}\ne 0\).
-
(1)
If tm is even, then
$$\begin{aligned} \displaystyle \Omega _{3}=&\left\{ \begin{array}{ll} -(p-1)G(\eta )^{t}\eta (A), &{} \quad \mathrm{if}\;{\mathrm {Tr}}_{m}(B)=0,\\ G(\eta )^{t}\eta (A)\big (p\eta _{p}(-{\mathrm {Tr}}_{m}(B))\eta _{p}(\rho )+1\big ), &{}\quad \mathrm{if}\;{\mathrm {Tr}}_{m}(B)\ne 0. \end{array} \right. \end{aligned}$$ -
(2)
If tm is odd, then
$$\begin{aligned} \displaystyle \Omega _{3}=&\left\{ \begin{array}{ll} (p-1)G(\eta )^{t}\eta (A)G(\eta _{p})\eta _{p}(-\rho ),\quad \;\;\,\,\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\mathrm{if}\;{\mathrm {Tr}}_{m}(B)=0,\\ -G(\eta )^{t}\eta (A)G(\eta _{p})\big (\eta _{p}(-{\mathrm {Tr}}_{m}(B))+\eta (-\rho )\big ),\quad \;\;\;\;\;\;\;\;\;\;\;\;\;\mathrm{if}\;{\mathrm {Tr}}_{m}(B)\ne 0. \end{array} \right. \end{aligned}$$
Proof
By Lemma 2.2 we have
Now, we consider the case that tm is even. If \({\mathrm {Tr}}_{m}(B)=0\), then from (4) we have
If \({\mathrm {Tr}}_{m}(B)\ne 0\), then from Lemma 2.2 and (5) we have
Thus, we get the result.
Now, assume that tm is odd. If \({\mathrm {Tr}}_{m}(B)=0\), then it follows from (4) that
Also, if \({\mathrm {Tr}}_{m}(B)\ne 0\), then it follows from Lemma 2.2 and (5) that
Thus, we get the results. \(\square \)
By the Lemmas 3.2 and 3.3, we obtain the values of \(N_{\rho }\). To get the frequency of each composition, we need the following lemmas.
Lemma 3.4
For \(c \in \mathbb {F}_{p}\), let
Then we have
Proof
By the orthogonal property of additive characters we get
Thus, we get the desired results. \(\square \)
Lemma 3.5
For \(i\in \{-1,1\}\), let
-
(1)
If m is even, then
$$\begin{aligned}&n_{1}=\frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}+G(\eta )^{t}\big )\big )\\&n_{-1}=\frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}-G(\eta )^{t}\big )\big ). \end{aligned}$$ -
(2)
If m is odd, then
$$\begin{aligned} n_{1}=&\left\{ \begin{array}{ll} \frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}+G(\eta )^{t}\big )\big ), &{}\quad \mathrm{{if}}\;t\;\mathrm{{is\;even}},\\ \frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)(-1)^{t}\big ), &{}\quad \mathrm{{if}}\;t\;\mathrm{{is\;odd}}.\\ \end{array} \right. \\ n_{-1}=&\left\{ \begin{array}{ll} \frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}-G(\eta )^{t}\big )\big ), &{}\quad \mathrm{{if}}\;t\;\mathrm{{is\;even}},\\ \frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)(-1)^{t}\big ), &{}\quad \mathrm{{if}}\;t\;\mathrm{{is\;odd}}. \end{array} \right. \end{aligned}$$
Proof
It follows from Lemma 3.4 that \(n_{-1}=n^{'}_{0}-n_{1}\). Thus, we only need to compute \(n_{1}\). Let \(\alpha \) be a primitive element of \(\mathbb {F}_{q}\). Then \(\mathbb {F}^{*}_{p}=\langle \alpha ^{\frac{q-1}{p-1}}\rangle \). Note that \(\eta (A)=1\) if and only if \(A\in C_{0}^{(2,q)}=\langle \alpha ^{2}\rangle \).
Assume that m is even, then 2 divides \(\frac{q-1}{p-1}\) and so \(\mathbb {F}^{*}_{p}\subseteq C_{0}^{(2,q)}.\) By (6) we can get
Note that \(\eta ^{(2,q)}_{1}+\eta ^{(2,q)}_{0}\)=\(-1\) and \(\eta ^{(2,q)}_{0}-\eta ^{(2,q)}_{1}=G(\eta ).\) Thus, we get the result. Now suppose that m is odd, then \(|\mathbb {F}^{*}_{p}\cap C^{(2,q)}_{0}|=|\mathbb {F}^{*}_{p}\cap C^{(2,q)}_{1}|=\frac{p-1}{2}.\) By (6) we have
Note that \(n_{-1}=n^{'}-n_{1}\) and this completes the proof. \(\square \)
Recall that \(\alpha \) is a fixed primitive element of \(\mathbb {F}_{q}\).
Lemma 3.6
For \(0\le k \le [t/2]\) and \(c\in C_{0}^{(2,p)}\), let \(n_{2k,c}=|\{a_{1},\ldots ,a_{t}\in \mathbb {F}^{*}_{q} : {\mathrm {Tr}}_{m}(\alpha a_{1}^{2}+\cdots +\alpha a_{2k}^{2}+a_{2k+1}^{2}+\cdots +a_{t}^{2})=c\}|.\)
-
(1)
If m is even, then
$$\begin{aligned} n_{2k,c}=\frac{(p^{m}-1)^{t}}{p}-\frac{1}{p}(G(\eta )+1)^{2k}(G(\eta )-1)^{t-2k}. \end{aligned}$$ -
(2)
If m is odd and \(k<t/4\), then
$$\begin{aligned} n_{2k,c}=&\left\{ \begin{array}{ll} \displaystyle \frac{(p^{m}-1)^{t}}{p}-\frac{1}{p}(G(\eta )^{2}-1)^{2k}\left( \sum ^{\frac{t-4k}{2}}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i\end{array}}\right) G(\eta )^{2i}\right. \\ \left. \displaystyle +\,\eta _{p}(-c)\sum ^{\frac{t-4k}{2}-1}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right) ,\;\mathrm{{if}}\;t\;\mathrm{{is\;even}},\\ \displaystyle \frac{(p^{m}-1)^{t}}{p}+\frac{1}{p}(G(\eta )^{2}-1)^{2k}\left( \sum ^{\frac{t-4k-1}{2}}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i\end{array}}\right) G(\eta )^{2i}\right. \\ \left. \displaystyle +\,\eta _{p}(-c)\sum ^{\frac{t-4k-1}{2}}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right) ,\;\mathrm{{if}}\;t\;\;\mathrm{{is\;odd}}. \end{array} \right. \end{aligned}$$ -
(3)
If m is odd and \(k>t/4\), then
$$\begin{aligned} n_{2k,c}=&\left\{ \begin{array}{ll} \displaystyle \frac{(p^{m}-1)^{t}}{p}+\frac{1}{p}(G(\eta )^{2}-1)^{t-2k}\left( -\sum ^{\frac{4k-t}{2}}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i\end{array}}\right) G(\eta )^{2i}\right. \\ \left. \displaystyle +\,\eta _{p}(-c)\sum ^{\frac{4k-t}{2}-1}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right) ,\;\mathrm{{if}}\;t\;\mathrm{{is\;even}},\\ \displaystyle \frac{(p^{m}-1)^{t}}{p}+\frac{1}{p}(G(\eta )^{2}-1)^{t-2k}\left( -\sum ^{\frac{4k-t-1}{2}}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i\end{array}}\right) G(\eta )^{2i}\right. \\ \left. \displaystyle +\,\eta _{p}(-c)\sum ^{\frac{4k-t-1}{2}}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right) ,\;\;\mathrm{{if}}\;t\;\mathrm{{is\;odd}}.\\ \end{array} \right. \end{aligned}$$ -
(4)
If m is odd, \(t\equiv 0\pmod {4}\) and \(k=t/4\), then
$$\begin{aligned} n_{2k,c}=n_{\frac{t}{2},c}&=\frac{(p^{m}-1)^{t}}{p}-\frac{1}{p}(G(\eta )^{2}-1)^{\frac{t}{2}}. \end{aligned}$$
Proof
By the orthogonal property of additive characters, we have
It follows from Lemma 2.2 that
Now, if m is even, then we have
Suppose that m is odd and \(k<t/4\). Then by (7) we have
If t is even, then it follows from (8) that
Thus, we get the desired result.
It is similar to give the proof when t is odd or m is odd for \(k>t/4\). Finally, if m is odd, \(t\equiv 0\pmod {4}\) and \(k=t/4\), it follows from (7) that
\(\square \)
Lemma 3.7
For \(i,j\in \{-1,1\},\) let
Then we have
where \(\beta =\alpha ^{\frac{q-1}{p-1}}\). Moreover, if tm is even, then \(n_{1,1}=n_{1,-1}.\)
Proof
For \(j\in \{-1,1\}\), we have
By Lemma 3.6 we have
If m is even, from Lemma 3.6, then it is easy to see that \(n_{2k,c}\) are independent of \(c \in \mathbb {F}^{*}_{p}\). Thus \(n_{2k,-1}=n_{2k,-\beta }\) and so \(n_{1,1}=n_{1,-1}.\)
Next assume that m is odd and \(t\equiv 2\pmod 4\). By Lemma 3.6 we have
By changing k with \(\frac{t}{2}-k\) in the second summation we have
For \(n_{1,-1}\), we similarly have
By changing k with \(\frac{t}{2}-k\) in the second summation we have
Thus, \(n_{1,1}=n_{1,-1}.\) It is similar to get the desired results when m is odd and \(t\equiv 0\pmod 4\). This completes the proof. \(\square \)
Lemma 3.8
For \(i\in \{-1,1\}\), let
-
(1)
If tm is even, then we have
$$\begin{aligned} s_{1}=s_{-1}=\frac{p-1}{2p}\big ((p^{m}-1)^{t}-(-1)^{t}\big ). \end{aligned}$$ -
(2)
If tm is odd, then we have
$$\begin{aligned} s_{\pm 1}=&\pm \frac{p-1}{2^{t}}\left( \sum ^{[\frac{t}{4}]}_{k=0}\left( {\begin{array}{c}t\\ 2k\end{array}}\right) \left\{ \frac{1}{p}(G(\eta )^{2}-1)^{2k}\sum ^{\frac{t-4k-1}{2}}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right\} \right. \\&\left. +\sum ^{\frac{t-1}{2}}_{k=[\frac{t}{4}]+1}\left( {\begin{array}{c}t\\ 2k\end{array}}\right) \left\{ \frac{1}{p}(G(\eta )^{2}-1)^{t-2k}\sum ^{\frac{4k-t-1}{2}}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i+1\end{array}}\right) G(\eta )^{2i+1}G(\eta _{p})\right\} \right) \\&+\frac{p-1}{2p}\big ((p^{m}-1)^{t}-(-1)^{t}\big ). \end{aligned}$$
Proof
It is easy to see that \(s_{1}=n_{1,1}+n_{-1,-1}=n_{1,1}+T-n_{1,-1},\) where \(T=|\{a_{1},\ldots ,a_{t}\in \mathbb {F}^{*}_{q} :\eta _{p}(-{\mathrm {Tr}}_{m}(B))=-1\}|.\) By Lemma 3.4 we have
Similarly, we have \(s_{-1}=n_{1,-1}+T-n_{1,1}.\) If tm is even, then by Lemma 3.7, we get the desired result.
Next, if tm is odd, then by Lemmas 3.6 and 3.7 we have
Now, it is easy to get \(s_{1}\) and \(s_{-1}\). This completes the proof. \(\square \)
Theorem 3.9
Let \(\mathcal {C}_{D}\) be the linear code defined by (1) and (2), where \(D=\{(x_{1},x_{2},\ldots ,x_{t}) \in \mathbb {F}_{q}^{t}\setminus \{(0,0,\ldots ,0)\} : {\mathrm {Tr}}_{m}(x_{1}+x_{2}+\cdots +x_{t})=0\}\) and \(\rho \in \mathbb {F}_{p}^{*}\). Then \(\mathcal {C}_{D}\) is a \([p^{tm-1}-1,tm]\) linear code.
-
(1)
If m is even, then the complete weight enumerator of \(\mathcal {C}_{D}\) is given as follows:
$$\begin{aligned}&N_{\rho }=0\;\mathrm {occurs}\;1\;\mathrm {time,}\\&N_{\rho }=p^{tm-2}\pm p^{m(t-\frac{k}{2})-2}\;(0<k<t)\;\mathrm{{occurs}}\;\left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(p^{m}-1)^{k}}{2}\;\mathrm{{times,}}\\&N_{\rho }=p^{tm-2}\pm p^{\frac{tm-2}{2}}\;\mathrm{{occurs}}\;\frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}\mp p^{\frac{tm}{2}}\big )\big )\;\mathrm{{times,}}\\&N_{\rho }=p^{tm-2}\pm p^{\frac{tm-2}{2}}\eta _{p}(\rho )\;\mathrm{{occurs}}\;\frac{p-1}{2p}\big ((p^{m}-1)^{t}-(-1)^{t}\big )\;\mathrm{{times.}} \end{aligned}$$ -
(2)
If m is odd and t is even, then the complete weight enumerator of \(\mathcal {C}_{D}\) is given as follows:
$$\begin{aligned}&N_{\rho }=0\;\mathrm {occurs}\;1\;\mathrm {time,}\\&N_{\rho }=p^{tm-2}\pm p^{m(t-\frac{k}{2})-2}\;(0<k<t\;\mathrm{{and}}\;k\;\mathrm{{is\;even}})\;\mathrm{{occurs}}\;\left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(p^{m}-1)^{k}}{2}\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm p^{m(t-\frac{k}{2})-\frac{3}{2}}\eta _{p}(\rho )\;(0<k<t\;\mathrm{{and}}\;k\;\mathrm{{is\;odd}})\;\mathrm{{occurs}}\;\left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(p^{m}-1)^{k}}{2}\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm p^{\frac{tm-2}{2}}\;\mathrm{{occurs}}\;\frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)\big ((-1)^{t}\mp p^{\frac{tm}{2}}\big )\big )\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm p^{\frac{tm-2}{2}}\eta _{p}(\rho )\;\mathrm{{occurs}}\;\frac{p-1}{2p}\big ((p^{m}-1)^{t}-(-1)^{t}\big )\;\mathrm {times.} \end{aligned}$$ -
(3)
If m is odd and t is odd, then the complete weight enumerator of \(\mathcal {C}_{D}\) is given as follows:
$$\begin{aligned}&N_{\rho }=0\;\mathrm {occurs}\;1\;\mathrm {time,}\\&N_{\rho }=p^{tm-2}\pm p^{m(t-\frac{k}{2})-2}\;(0<k<t\;\mathrm{{and}}\;k\;\mathrm{{is\;even}})\;\mathrm{{occurs}}\;\left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(p^{m}-1)^{k}}{2}\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm p^{m(t-\frac{k}{2})-\frac{3}{2}}\eta _{p}(\rho )\;(0<k<t\;\mathrm{{and}}\;k\;\mathrm{{is\;odd}})\;\mathrm{{occurs}}\;\left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(p^{m}-1)^{k}}{2}\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm p^{\frac{tm-1}{2}}\eta _{p}(\rho )\;\mathrm{{occurs}}\;\frac{1}{2p}\big ((p^{m}-1)^{t}+(p-1)(-1)^{t}\big )\;\mathrm {times,}\\&N_{\rho }=p^{tm-2}\pm (-1)^{\frac{(tm+1)(p-1)}{4}}p^{\frac{tm-3}{2}}\;\mathrm {occurs}\\&\mp \frac{p-1}{2^{t}}\left( \sum ^{[\frac{t}{4}]}_{k=0}\left( {\begin{array}{c}t\\ 2k\end{array}}\right) \left\{ \frac{1}{p}\big ((-1)^{\frac{m(p-1)}{2}}p^{m}-1\big )^{2k}\sum ^{\frac{t-4k-1}{2}}_{i=0}\left( {\begin{array}{c}t-4k\\ 2i+1\end{array}}\right) (-1)^{\frac{((2i+1)m+1)(p-1)}{4}}p^{\frac{(2i+1)m+1}{2}} \right\} \right. \\&\left. \quad +\sum ^{\frac{t-1}{2}}_{k=[\frac{t}{4}]+1}\left( {\begin{array}{c}t\\ 2k\end{array}}\right) \left\{ \frac{1}{p}\big ((-1)^{\frac{m(p-1)}{2}}p^{m}-1\big )^{t-2k}\sum ^{\frac{4k-t-1}{2}}_{i=0}\left( {\begin{array}{c}4k-t\\ 2i+1\end{array}}\right) (-1)^{\frac{((2i+1)m+1)(p-1)}{4}}p^{\frac{(2i+1)m+1}{2}}\right\} \right) \\&\quad +\frac{p-1}{2p}\big ((p^{m}-1)^{t}-(-1)^{t}\big )\;\mathrm {times.} \end{aligned}$$
Proof
Recall that \(N_{\rho }=p^{tm-2}+\frac{1}{p^{2}}(\Omega _{1}+\Omega _{2}+\Omega _{3})\). We employ Lemmas 3.2 and 3.3 to compute \(N_{\rho }\). As computations for frequencies are done by Lemmas 3.4, 3.5, 3.6, 3.7 and 3.8 it is sufficient to give a proof for even m.
Suppose that there are exactly k elements \(a_{i_{1}},\ldots ,a_{i_{k}}\ne 0\) among \(a_{1},\ldots ,a_{t}\) for \(1\le k\le t\).
If \(1\le k \le t-1\), then we obtain
In this case, the frequencies are both \(\displaystyle \left( {\begin{array}{c}t\\ k\end{array}}\right) \frac{(q-1)^{k}}{2}.\)
If \(k=t\) and \({\mathrm {Tr}}_{m}(B)=0\), then
Thus,
Now the frequencies follow from Lemma 3.5.
If \(k=t\) and \({\mathrm {Tr}}_{m}(B)\ne 0\), then
Thus,
Now the frequencies follow from Lemma 3.7. \(\square \)
In fact, when \(t=1\), the complete weight enumerators of \(\mathcal {C}_{D}\) were given by [17]. Thus Theorem 3.9 can be viewed as a generalization of the results in [17]. From Theorem 3.9 we can also get the weight enumerators of \(\mathcal {C}_{D}\) directly.
Corollary 3.10
Let \(\mathcal {C}_{D}\) be a linear code defined by (1) and (2), where \(D = \{(x_{1},x_{2},\ldots ,x_{t}) \in \mathbb {F}_{q}^{t}\setminus \{(0,0,\ldots ,0)\} : {\mathrm {Tr}}_{m}(x_{1}+x_{2}+\cdots +x_{t})=0\}.\)
-
(1)
If m is even, then the weight distribution of \(\mathcal {C}_{D}\) is given by Table 1.
-
(2)
If m is odd and t is even, then the weight distribution of \(\mathcal {C}_{D}\) is given by Table 2.
-
(3)
If m is odd and t is odd, then the weight distribution of \(\mathcal {C}_{D}\) is given by Table 3.
Remark 3.11
By Corollary 3.10, we easily get several linear codes with a few weights. For example, we obtain 3-weight linear codes for \(m=2\) and \(t=2\), and 5-weight linear codes for even \(m\ge 4\), \(t=2\) and \(m=2\), \(t=3\). We also have 3-weight linear codes for odd m, \(t=2\), and 5-weight linear codes for odd m, \(t=3,4\).
Example 3.12
-
(1)
Let \(p=3, m=2,\) and \(t=3.\) Then \(q=9\) and \(n=242.\) By Theorem 3.9, the code \(\textit{C}_{D}\) is a [242, 6, 108] linear code. Its complete weight enumerator is
$$\begin{aligned}&z^{242}_{0}+12z_{0}^{134}(z_{1}z_{2})^{54}+190z_{0}^{98}(z_{1}z_{2})^{72}+171z_{0}^{80}z_{1}^{72}z_{2}^{90}+171z_{0}^{80}z_{1}^{90}z_{2}^{72}\\&\quad +172z_{0}^{62}(z_{1}z_{2})^{90}+12z^{26}_{0}(z_{1}z_{2})^{108}, \end{aligned}$$and its weight enumerator is
$$\begin{aligned} 1+12x^{108}+190x^{144}+342x^{162}+172x^{180}+12x^{216}, \end{aligned}$$which are checked by Magma.
-
(2)
Let \(p=3, m=3,\) and \(t=3.\) Then \(q=27\) and \(n=6560.\) By Theorem 3.9, the code \(\textit{C}_{D}\) is a [6560, 9, 4212] linear code. Its complete weight enumerator is
$$\begin{aligned}&z^{6560}_{0}+1014z_{0}^{2348}(z_{1}z_{2})^{2106}+5940z^{2240}_{0}(z_{1}z_{2})^{2160}+39z^{2186}_{0}z_{1}^{1458}z_{2}^{2916}\\&\quad +39z_{0}^{2186}z_{1}^{2916}z_{2}^{1458}+2929z^{2186}_{0}z_{1}^{2106}z_{2}^{2268}+2929z^{2186}_{0}z_{1}^{2268}z_{2}^{2106}\\&\quad +5778z^{2132}_{0}(z_{1}z_{2})^{2214}+1014z_{0}^{2024}(z_{1}z_{2})^{2268}, \end{aligned}$$and its weight enumerator is
$$\begin{aligned} 1+1014x^{4212}+5940x^{4320}+5936x^{4374}+5778x^{4428}+1014x^{4536}, \end{aligned}$$which are checked by Magma.
References
Bae S., Li C., Yue Q.: Some results on two-weight and three-weight linear codes, preprint (2015).
Berndt B., Evans R., Williams K.: Gauss and Jacobi Sums. Wiley, New York (1997).
Calderbank A.R., Goethals J.M.: Three-weight codes and association schemes. Philips J. Res. 39, 143–152 (1984).
Calderbank A.R., Kantor W.M.: The geometry of two-weight codes. Bull. Lond. Math. Soc. 18, 97–122 (1986).
Carlet C., Ding C., Yuan J.: Linear codes from perfect nonlinear mappings and their secret sharing schemes. IEEE Trans. Inf. Theory 51(6), 2089–2102 (2005).
Ding C.: Codes from Difference Sets. World Scientific, Singapore (2014).
Ding C.: Linear codes from some 2-designs. IEEE Trans. Inf. Theory 61(6), 3265–3275 (2015).
Ding K., Ding C.: Binary linear codes with three weights. IEEE Commun. Lett. 18(11), 1879–1882 (2014).
Ding K., Ding C.: A class of two-weight and three-weight codes and their applications in secret sharing. IEEE Trans. Inf. Theory 61(11), 5835–5842 (2015).
Ding C., Niederreiter H.: Cyclotomic linear codes of order 3. IEEE Trans. Inf. Theory 53(6), 2274–2277 (2007).
Ding C., Wang X.: A coding theory construction of new systematic authentication codes. Theor. Comput. Sci. 330(1), 81–99 (2005).
Ding C., Helleseth T., Kløve T., Wang X.: A general construction of authentication codes. IEEE Trans. Inf. Theory 53(6), 2229–2235 (2007).
Ding C., Luo J., Niederreiter H.: Two-weight codes puncturedfrom irreducible cyclic codes. In: Li Y, et al. (eds.) Proceedings of the First Worshop on Coding and Cryptography, pp. 119–124. World Scientific, Singapore (2008).
Lidl R., Niederreiter H.: Finite Fields. Addison-Wesley, Reading (1983).
Myerson G.: Period polynomials and gauss sums for finite fields. Acta Arith. 39(3), 251–264 (1981).
Tang C., Li N., Qi Y., Zhou Z., Helleseth T.: Linear codes with two or three weights from weakly regular bent functions. IEEE Trans. Inf. Theory 62(3), 1166–1176 (2016).
Yang S., Yao Z.: Complete weight enumerators of a family of three-weight liner codes. Des. Codes Cryptogr. (2016). doi:10.1007/s10623-016-0191-x.
Yuan J., Ding C.: Secret sharing schemes from three classes of linear codes. IEEE Trans. Inf. Theory 52(1), 206–212 (2006).
Zhou Z., Li N., Fan C., Helleseth T.: Linear codes with two or three weights from quadratic Bent functions. Des. Codes Cryptogr. (2015). doi:10.1007/s10623-015-0144-9.
Acknowledgments
The authors would like to express deepest thanks to the editor and the anonymous reviewers for their invaluable comments and suggestions to improve the quality of this paper. Without their careful reading and sophisticated advice, the paper would have never been developed like this.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by T. Helleseth.
Rights and permissions
About this article
Cite this article
Ahn, J., Ka, D. & Li, C. Complete weight enumerators of a class of linear codes. Des. Codes Cryptogr. 83, 83–99 (2017). https://doi.org/10.1007/s10623-016-0205-8
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10623-016-0205-8