1 Introduction

Quantum error-correcting (QEC for brevity) codes were introduced for security of quantum information. Construction of good quantum codes via classical codes is a crucial task for quantum information and quantum computing (see Refs. [1, 4, 5, 7, 17, 27, 28, 30, 31, 33] for example). A q-ary quantum code Q,  denoted by parameters \(\llbracket n,k,d\rrbracket _{q},\) is a \(q^{k} \)-dimensional subspace of the Hilbert space \({\mathbb {C}}^{q^{n}}.\) A quantum code \({\mathcal {C}}\) with parameters \( \llbracket n,k,d\rrbracket _{q}\) satisfies the quantum singleton bound: \( k\le n-2d+2\) (see [17]). If \(k=n-2d+2,\) then \({\mathcal {C}}\) is called a quantum maximum-distance-separable (MDS) code. In recent years, many researchers have been working to find quantum MDS codes via constacyclic codes (for instance, see [6, 16, 18, 19, 22, 33, 34]).

Entanglement-assisted quantum error-correcting (EAQEC for short) codes use preexisting entanglement between the sender and receiver to improve information rate. For further details about EAQEC for example, see [3, 10, 11, 13, 14, 20, 21, 23, 32].

Recently, many papers have been devoted for obtaining EAQEC codes derived from classical error-correcting codes. Some of these papers can be summarized as follows: In [33], based on classical quaternary constacyclic codes, some parameters for quantum codes were obtained. In [8], a decomposition of the defining set of negacyclic codes has been proposed, and by virtue of the proposed decomposition four classes of EAQEC codes have been constructed. Fan et al. have constructed five classes of entanglement-assisted quantum MDS (EAQMDS for short) codes based on classical MDS codes by exploiting one or more pre-shared maximally entangled states [9]. Qian and Zhang have constructed some new classes of maximum-distance-separable (MDS) linear complementary dual (LCD) codes with respect to Hermitian inner product, and as an application, they have constructed new families of MDS maximal EAQEC codes in [29]. In [24], Lu et al. constructed six classes of q-ary EAQMDS codes based on classical negacyclic MDS codes. In [12], Guenda et al. have shown that the number of shared pairs required to construct an EAQEC code is related to the hull of the classical codes. Using this fact, they gave methods to construct EAQEC codes requiring desirable amounts of entanglement. Further, they constructed maximal entanglement EAQEC codes from LCD codes.

In this paper, based on a decomposition of the defining set of constacyclic codes we have obtained eight new families of EAQMDS codes as follows:

  1. 1.

    \(\llbracket n,n-\frac{6}{5}\left( q-7\right) -4\lambda -1,\frac{3}{5} \left( q-7\right) +2\lambda +4;5\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{10} , \) \(1\le \lambda \le \frac{q+3}{10},\) q is odd and \(q\equiv 7\left( \hbox {mod} \,\,10\right) .\)

  2. 2.

    \(\llbracket n,n-\frac{4}{5}\left( 2q+1\right) -4\lambda +7,\frac{2}{5} \left( 2q+1\right) +2\lambda +2;9\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{10} ,\) \(1\le \lambda \le \frac{q+3}{10},\) q is odd and \(q\equiv 7\left( \hbox {mod} \,\,10\right) .\)

  3. 3.

    \(\llbracket n,n-\frac{6}{5}\left( q-3\right) -4\lambda +3,\frac{3}{5} \left( q-3\right) +2\lambda +2;5\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{10} , \) \(1\le \lambda \le \frac{q-3}{10},\) q is odd and \(q\equiv 3\left( \hbox {mod} \,\,10\right) .\)

  4. 4.

    \(\llbracket n,n-\frac{8}{5}\left( q-3\right) -4\lambda +7,\frac{4}{5} \left( q-3\right) +2\lambda +2;9\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{10} , \) \(1\le \lambda \le \frac{q-3}{10},\) q is odd and \(q\equiv 3\left( \hbox {mod} \,\,10\right) .\)

  5. 5.

    \(\llbracket n,n-\frac{6}{5}\left( q-2\right) -4\lambda +4,\frac{3}{5} \left( q-2\right) +2\lambda +1;4\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{5},\) \(1\le \lambda \le \frac{q+3}{5},\) \(q=2^{e}\) and \(q\equiv 2\left( \hbox {mod} \,\,10\right) .\)

  6. 6.

    \(\llbracket n,n-\frac{2}{5}\left( 3q-14\right) -4\lambda ,\frac{\left( 3q-14\right) }{5}+2\lambda +3;4\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{5},\) \(1\le \lambda \le \frac{q+2}{5},\) \(q=2^{e}\) and \(q\equiv 8\left( \hbox {mod} \,\,10\right) .\)

  7. 7.

    \(\llbracket n,n-\frac{6}{5}\left( q-2\right) -4\lambda +4,\frac{3}{5} \left( q-2\right) +2\lambda +1;4\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{13} , \) \(1\le \lambda \le \frac{q+3}{5},\) \(q=2^{e}\) and \(q\equiv 5\left( \hbox {mod} \,\,13\right) .\)

  8. 8.

    \(\llbracket n,n-\frac{6}{5}\left( q-4\right) -4\lambda -8,\frac{3}{5} \left( q-4\right) +2\lambda +4;4\rrbracket _{q},\) where \(n=\frac{q^{2}+1}{17} , \) \(1\le \lambda \le \frac{q+4}{17},\) \(q=2^{e}\) and \(q\equiv 13\left( \hbox {mod} \,\,17\right) .\)

The rest of the paper is organized as follows. In Sect. 2, we review basics about linear codes and constacyclic codes. In Sect. 3, we review some basics about EAQEC codes. In Sect. 4 and Sect. 5, we define a decomposition of the defining set of constacyclic codes, and based on this method we construct eight families of EAQMDS codes. The last section contains some comparative results and concludes this paper.

2 Basics about constacyclic codes

In this section, we review some preliminaries of constacyclic codes. For further and detailed information, readers may refer to [6, 15, 18, 19, 34].

For given a positive integer e and prime number p,  let \(q=p^{e}\) and \( {\mathbb {F}}_{q^{2}}\) be the finite field of \(q^{2}\) elements. The Hermitian inner product of \(u=\left( u_{0},\ldots ,u_{n-1}\right) \) and \(v=\left( v_{0},\ldots ,v_{n-1}\right) \in {\mathbb {F}}_{q^{2}}^{n}\) is defined to be \( \left\langle u,v\right\rangle _{H}=\sum \limits _{i=0}^{n-1}u_{i}v_{i}^{q}.\) If \({\mathcal {C}} \) is a k-dimensional subspace of \({\mathbb {F}}_{q^{2}}^{n},\) then \({\mathcal {C}}\) is called as a \(q^{2}\)-ary linear code of length n and dimension k and denoted by \(\left[ n,k\right] _{q^{2}}.\) The weight \( wt\left( c\right) \) of a codeword \(c\in {\mathcal {C}}\) is defined as the number of its nonzero coordinates. The minimum nonzero weight d among all codewords of \({\mathcal {C}}\) is said to be the minimum weight of \(\mathcal { C}.\) A linear code \({\mathcal {C}}\) of length n is said to be constacyclic if for any codeword \(\left( c_{0},\ldots ,c_{n-1}\right) \in {\mathcal {C}}\) we have that \(\left( \alpha c_{n-1},\ldots ,c_{n-2}\right) \in {\mathcal {C}},\) where \(0\ne \alpha \in {\mathbb {F}}_{q^{2}}.\) It can be seen that \(xc\left( x\right) \) corresponds to a constacyclic shift of \(c\left( x\right) \) in the quotient ring \({\mathbb {F}}_{q^{2}}\left[ x\right] /\left\langle x^{n}-\alpha \right\rangle ,\) where \(c\left( x\right) =c_{0}+c_{1}x+\ldots +c_{n-1}x^{n-1}.\) Then, a \(q^{2} \)-ary constacyclic code \({\mathcal {C}}\) of length n is an ideal of \({\mathbb {F}}_{q^{2}}\left[ x\right] /\left\langle x^{n}-\alpha \right\rangle \) and \({\mathcal {C}}\) is generated by a monic polynomial \(g\left( x\right) \) such that \(g\left( x\right) |\left( x^{n}-\alpha \right) \). If \(\gcd \left( q,n\right) =1,\) then \(x^{n}-\alpha \) does not have multiple roots.

Let m be the multiplicative order of \(q^{2}\) in modulo rn,  where \(r=q+1,\) and suppose that \(\delta \) is a primitive \(rn^{th}\) root of unity in \( {\mathbb {F}}_{q^{2}}^{*}\) such that \(\delta ^{n}=\alpha \). Let \(\zeta =\delta ^{r}\), then \(\zeta \) is a primitive \(n^{th}\) root of unity. Therefore, the roots of \(x^{n}-\alpha \) are \(\left\{ \delta ,\delta ^{1+r},\ldots ,\delta ^{1+r(n-1)}\right\} \). Hence, it follows that \( x^{n}-\alpha =\prod \nolimits _{i=0}^{n-1}\left( x-\zeta ^{ri}\right) .\)

The \(q^{2}\)-cyclotomic coset of i modulo rn is defined by

$$\begin{aligned} {\mathcal {C}}_{i}=\left\{ \left. iq^{2j}\left( \hbox {mod} \,\,rn\right) \right| j\in {\mathbb {Z}}\right\} . \end{aligned}$$

The Hermitian dual of a linear code \({\mathcal {C}}\) of length n is defined as \({\mathcal {C}}^{\bot _{H}}=\{ u\in {\mathbb {F}} _{q^{2}}^{n}\vert \langle u,v\rangle _{H}=0\mathcal {\ } \text {for all }v\in {\mathcal {C}}\}.\) A \(q^{2}\)-ary linear code \( {\mathcal {C}}\) of length n is called Hermitian self-orthogonal if \(\mathcal {C }\subseteq {\mathcal {C}}^{\bot _{H}}.\)

Let \({\mathcal {O}}_{rn}=\left\{ \left. 1+rj\right| 0\le j\le n-1\right\} \). Then, the defining set of a constacyclic code \(\mathcal {C=}\left\langle g\left( x\right) \right\rangle \) of length n is the set \(Z=\{ i\in {\mathcal {O}}_{rn}\vert \delta ^{i}\text { is a root of }g\left( x\right) \}\). If \({\mathcal {C}}\) is an \(\left[ n,k\right] _{q^{2}}\) \( \alpha \)-constacyclic code with defining set Z,  then the Hermitian dual \( {\mathcal {C}}^{\bot _{H}}\) of \({\mathcal {C}}\) is an \(\alpha ^{-q}\)-constacyclic code with defining set \(Z^{\bot _{H}}=\left\{ \left. z\in {\mathcal {O}} _{rn}\right| -qz\text { }\left( \hbox {mod} \,\,rn\right) \notin Z\right\} .\)

As in cyclic codes, there exists BCH bound for \(\alpha \)-constacyclic (see [2, 18]) as follows.

Proposition 1

[2, 18] (The BCH bound for constacyclic codes) Let \(\mathcal {C=}\left\langle g\left( x\right) \right\rangle \) be a \( q^{2}\)-ary \(\alpha \)-constacyclic code of length n,  where \(\alpha \) is an primitive \(r^{th}\) root of unity. If the polynomial \(g\left( x\right) \) has the elements \(\left\{ {\left. \delta ^{{1+}r{j}}\right| l\le j\le l+d-2 }\right\} \) as the roots, where \(\delta \) is a \(rn^{th}\) primitive root of unity with \(\delta ^{n}=\alpha \). Then, the minimum distance of \({\mathcal {C}}\) is at least d.

The following proposition gives a criterion to determine whether or not an \( \alpha \)-constacyclic code of length n over \({\mathbb {F}}_{q^{2}}\) is Hermitian dual containing (see [16] Lemma 2.2).

Proposition 2

Let \(\alpha \in {\mathbb {F}}_{q^{2}}^{*}\) be of order r. If \({\mathcal {C}}\) is an \(\alpha \)-constacyclic code of length n over \( {\mathbb {F}}_{q^{2}}\) with defining set \(Z\subseteq {\mathcal {O}}_{rn},\) then \( {\mathcal {C}} \) contains its Hermitian dual code if and only if \(Z\cap \left( -qZ\right) =\emptyset ,\) where \(-qZ=\left\{ \left. -qz\left( \hbox {mod} \,\, rn\right) \right| z\in Z\right\} .\)

3 Basics about entanglement-assisted quantum codes

In this section, we review some basic notions and results of EAQEC codes. The following result is about the singleton bound of classical linear codes.

Proposition 3

[26] (singleton bound) If an \(\left[ n,k,d \right] \) linear code \({\mathcal {C}}\) over \({\mathbb {F}}_{q}\) exists, then \( k\le n-d+1.\) If \(k=n-d+1,\) then \({\mathcal {C}}\) is called an MDS code.

Let H be an \(\left( n-k\right) \times n\) parity check matrix of \(\mathcal {C }\) over \({\mathbb {F}}_{q^{2}}.\) Then, \({\mathcal {C}}^{\bot _{H}}\) has an \( n\times \left( n-k\right) \) generator matrix \(H^{*},\) where \(H^{*}\) is the conjugate transpose matrix of H over \({\mathbb {F}}_{q^{2}}.\)

The following is called the Hermitian method and it enables us to construct EAQEC codes from classical linear codes.

Theorem 1

[23] If \({\mathcal {C}}\) is a classical code and H is its parity check matrix over \({\mathbb {F}}_{q^{2}},\) then there exist EAQEC codes with parameters \(\llbracket n,2k-n+c,d;c \rrbracket _{q},\) where \( c=rank\left( HH^{*}\right) .\)

Proposition 4

[3, 11] Assume that \({\mathcal {C}}\) is an EAQEC code with parameters \(\llbracket n,k,d;c\rrbracket _{q}\), if \(d\le (n+2)/2,\) then \({\mathcal {C}} \) satisfies the entanglement-assisted singleton bound \( n+c-k\ge 2(d-1).\) If \({\mathcal {C}}\) satisfies the equality \(n+c-k=2(d-1)\) for \(d\le (n+2)/2,\) then it is called an EAQMDS code.

A definition for decomposition of the defining set of cyclic codes was given in [23]. In the following, we give a decomposition of the defining set of constacyclic codes, which is the same as negacyclic case defined by Chen et al. in [8].

Definition 1

Let \(\alpha \in {\mathbb {F}}_{q^{2}}^{*}\) be a primitive \(r^{th}\) root of unity and \({\mathcal {C}}\) be an \(\alpha \)-constacyclic code of length n with defining set Z. Assume that \(Z_{1}=Z\cap (-qZ)\) and \(Z_{2}=Z\backslash Z_{1},\) where \(-qZ=\left\{ {rn-qx|x\in Z}\right\} \) r is a factor of \(q+1.\) Then, \(Z=Z_{1}\cup Z_{2}\) is called a decomposition of the defining set of \( {\mathcal {C}}\).

In [8], Chen et al. showed that the number of entangled states required for negacyclic codes is \(c=|Z_{1}|,\) which is the same for constacyclic codes.

Lemma 1

Let \({\mathcal {C}}\) be an \(\alpha \)-constacyclic code of length n over \({\mathbb {F}}_{q^{2}},\) where \(gcd(n,q)=1.\) Suppose that Z is the defining set of the \(\alpha \)-constacyclic code \({\mathcal {C}}\) and \( Z=Z_{1}\cup Z_{2}\) is a decomposition of Z. Then, the number of entangled states required is \(c=|Z_{1}|.\)

4 Construction of EAQMDS codes from constacyclic codes (q is odd)

Throughout this section, q is an odd prime, \(r=q+1\) and \(s=\frac{q^{2}+1}{2 }.\) The multiplicative order of q modulo n is denoted by \(ord_{n}\left( q\right) \). Let \(\alpha \in {\mathbb {F}}_{q^{2}}^{*}\) be a primitive \( r^{th}\) root of unity. Here, we need to emphasize that the codes we give in this section are different from the codes given in [25], because they obtained some parameters with the number of entangled states \(c=1.\)

4.1 EAQMDS codes of length \(n=\frac{q^{2}+1}{10},\) where \(q\equiv 7\left( \hbox {mod} \,\,10\right) \)

Note that \(n=\frac{q^{2}+1}{10},\) and so \(\hbox {ord}_{rn}\left( q^{2}\right) =2.\) This means that each \(q^{2}\)-cyclotomic coset modulo rn includes one or two elements. Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{ q^{2}+1}{2}.\) It can be easily seen that the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s}=\left\{ s\right\} \) and \(C_{s-rj}=\left\{ s-rj,s+rj\right\} ,\) where \(1\le j\le \frac{q+1}{2}.\)

Lemma 2

Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(Z=\cup _{j=1}^{\lambda }C_{s-rj},\) where \(1\le \lambda \le \frac{3\left( q-7\right) }{10}+1,\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

From Proposition 2, it is sufficient to prove that \(Z\cap \left( -qZ\right) =\emptyset \). Assume that \(Z\cap \left( -qZ\right) \ne \emptyset \). Then, there exist two integers jk,  where \(1\le j,k\le \frac{3\left( q-7\right) }{10}+1,\) such that \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\,rn\right) \) or \(s-rj\equiv -q\left( s+rk\right) \) \(\left( \hbox {mod} \,\, rn\right) .\)

Case 1 Let \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j+qk\left( \hbox {mod} \,\,n\right) \). As \(s\equiv 0\left( \hbox {mod} \,\,n\right) ,\) we get \(j+qk\equiv 0\left( \hbox {mod} \,\,n\right) \). Since \(1\le j,k\le \frac{3\left( q-7\right) }{10}+1,\) \( q+1\le j+qk\le \frac{3\left( q-7\right) }{10}+1+q\left( \frac{3\left( q-7\right) }{10}+1\right) <3n.\) Then, we have that \(j+qk\equiv n\left( \hbox {mod} \,\,n\right) \) or \(j+qk\equiv 2n\left( \hbox {mod} \,\,n\right) \). If \( j+qk=n, \) then \(j+qk=\frac{q^{2}+1}{10}=q\frac{\left( q-7\right) }{10}+\frac{ 7q+1}{10}.\) By division algorithm, \(j=\frac{7q+1}{10}.\) This is a contradiction, because \(0\le j\le \frac{3\left( q-7\right) }{10}.\) If \( j+qk=2n,\) then \(j+qk=\frac{2\left( q^{2}+1\right) }{10}=q\frac{2\left( q-7\right) }{10}+\frac{2\left( 7q+1\right) }{10}.\) By division algorithm, \( j=\frac{2\left( 7q+1\right) }{10}.\) This contradicts with the fact \(0\le j\le \frac{3\left( q-7\right) }{10}.\)

Case 2 Let \(s-rj\equiv -q\left( s+rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j-qk\left( \hbox {mod} \,\,n\right) \). Since \(s\equiv 0\left( \hbox {mod} \,\,n\right) ,\) we have \(j-qk\equiv 0\left( \hbox {mod} \,\,n\right) \). Also we have \(1\le j,k\le \frac{3\left( q-7\right) }{10 }.\) This results in \(-3n<1-3q\left( \frac{3\left( q-7\right) }{10}+1\right) \le j-qk\le 1-q<0.\) Thus, the solution is \(j-qk\equiv -2n\left( \hbox {mod} \,\, n\right) \) or \(j-qk\equiv -n\left( \hbox {mod} \,\,n\right) .\) If \(j-qk=-2n,\) then \(j-qk=\frac{-2\left( q^{2}+1\right) }{10}=-q\frac{2\left( q-7\right) }{ 10}+\frac{2\left( 7q-1\right) }{10}.\) From division algorithm, \(j=\frac{ 2\left( 7q-1\right) }{10}.\) This is a contradiction, because \(1\le j\le \frac{3\left( q-7\right) }{10}+1.\) If \(j-qk=-n,\) then \(j-qk=\frac{-\left( q^{2}+1\right) }{10}=-q\frac{\left( q-7\right) }{10}-\frac{\left( 7q+1\right) }{10}.\) By division algorithm, \(j=\frac{-\left( 7q+1\right) }{10} \equiv \frac{q\left( q-7\right) }{10}\left( \hbox {mod} \,\,n\right) \). This is a contradiction, because \(0\le j\le \frac{3\left( q-7\right) }{10}.\) \(\square \)

Lemma 3

Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(\overline{ Z}=\cup _{j=\frac{3\left( q-7\right) }{10}}^{t}C_{s-rj},\) where \(1\le t\le \frac{\left( q-7\right) }{10},\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

The proof for this lemma is very similar to the proof of Lemma 2. \(\square \)

As an immediate result of Lemma 3, we have \({\overline{Z}}\cap \left( -q{\overline{Z}}\right) =\emptyset .\)

Lemma 4

Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{q^{2}+1}{2}.\) Then we have the following:

  1. 1.

    \(-qC_{s}=C_{s}=\left\{ s\right\} ,\)

  2. 2.

    \(-qC_{s-r\frac{\left( q+3\right) }{10}}=C_{s-r\left( \frac{3q-1}{10} \right) }=\left\{ s-r\left( \frac{3q-1}{10}\right) ,s+r\left( \frac{3q-1}{10} \right) \right\} ,\)

  3. 3.

    \(-qC_{s-r\left( \frac{2q-4}{10}\right) }=C_{s-r\left( \frac{2q+1}{5} \right) }=\left\{ s-r\frac{\left( 2q+1\right) }{5},s+r\frac{\left( 2q+1\right) }{5}\right\} .\)

Proof

  1. 1.

    Since \(s=\frac{q^{2}+1}{2}=5n,\) we have \( -qs=-5qn=-5qn-5n+5n=-(q+1)5n+5n\equiv 5n\left( \hbox {mod} \,\,rn\right) .\) This implies that \(-qC_{s}=C_{s}.\)

  2. 2.

    Observe that \(-q\left( s-r\frac{\left( q+3\right) }{10}\right) =-qs+qr \frac{\left( q+3\right) }{10}\equiv 5n+qr\frac{\left( q+3\right) }{10}\left( \hbox {mod} \,\,rn\right) \). We conclude that \(5n+r\left( \frac{q^{2}+1}{10}+ \frac{3q-1}{10}\right) \equiv s+r\frac{\left( 3q-1\right) }{10}\left( \hbox {mod} \,\,rn\right) .\)

  3. 3.

    It is enough to show that \(-q\left( s-r\left( \frac{2q-4}{10}\right) \right) \equiv s-r\frac{\left( 2q+1\right) }{5}\left( \hbox {mod} \,\,rn\right) \). It follows that \(-q\left( s-r\left( \frac{2q-4}{10}\right) \right) \equiv -qs+rq\left( \frac{2q-4}{10}\right) \equiv -qs+r\left( \frac{2\left( q^{2}+1\right) }{10}-\frac{4q+2}{10}\right) \) \(\left( \hbox {mod} \,\,rn\right) ,\) and so we have \(-q\left( s-r\left( \frac{2q-4}{10}\right) \right) \equiv s-r \frac{\left( 2q+1\right) }{5}\left( \hbox {mod} \,\,rn\right) .\)

\(\square \)

In Theorem 2, we give a class of EAQMDS codes of length \(n=\frac{ q^{2}+1}{10}\) and with entangled states \(c=5.\)

Theorem 2

Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \(Z=\cup _{j=0}^{\frac{3\left( q-7\right) }{10}+1+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-7\right) -4\lambda -1,\frac{3}{5}\left( q-7\right) +2\lambda +4;5\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{\left( q+3\right) }{10}.\)

Proof

Since the defining set of given \(\alpha \)-constacyclic code \({\mathcal {C}}\) of length n is \(Z=\cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj},\) and the cardinality \(\left| Z\right| =\frac{3}{5}\left( q-7\right) +2\lambda +3,\) then from Propositions 1 and 3, \({\mathcal {C}}\) is a \(q^{2}\)-ary MDS \(\alpha \)-constacyclic code with parameters

$$\begin{aligned} \left[ n,n-\left( \frac{3}{5}\left( q-7\right) +2\lambda +3\right) ,\frac{3}{ 5}\left( q-7\right) +2\lambda +4\right] _{q^{2}}. \end{aligned}$$

Thus, we have the following:

$$\begin{aligned} Z_{1}= & {} Z\cap (-qZ) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cup \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{ \frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \right) \\&\cap \left( -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cup -q\left( \cup _{j=\frac{3}{10}\left( q-7\right) +7}^{ \frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \right) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{ \frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10} \left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{ \frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10} \left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3 }{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} Z_{1}=Z\cap (-qZ)=C_{s}\cup C_{s-r\frac{3q-1}{10}}\cup C_{s-r\frac{\left( q+3\right) }{10}}. \end{aligned}$$

From Lemma 2, we have \(\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) =\emptyset \). By examining the coset structure of the defining set Z,  we can see that if \(j=0,\) then \(\ C_{s}\cap -qC_{s}=\left\{ s\right\} .\)

Hence, we need to show that

$$\begin{aligned}&\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q+3\right) }{10} },\\&\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) =C_{s-r\frac{3q-1}{10}},\\&\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

We first show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) =C_{s-r\frac{3q-1}{10}}. \end{aligned}$$

We have the following:

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3q-1}{10}}\cup \left( \cup _{j=\frac{3}{10}\left( q-7\right) +3}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3q-1}{10}}\cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-7\right) +1}C_{s-rj}\right) \right) \\&\qquad \cup \left( \left( \cup _{j=\frac{3}{10}\left( q-7\right) +3}^{\frac{3}{10} \left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{ \frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} \left( C_{s-r\frac{3q-1}{10}}\cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \right) =C_{s-r\frac{3q-1}{10}} \end{aligned}$$

and

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-7\right) +3}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) =\emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{10}.\)

Contrary to the our claim, let assume that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-7\right) +3}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) \\&\quad =\left( \cup _{j=3}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-7\right) +1\right) }\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{10}.\) If \(\left( \cup _{j=3}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-7\right) +1\right) }\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \ne \emptyset ,\) then there exist two integers \(u^{\prime }\) and \(v^{\prime },\) where \(3\le u^{\prime }\le \frac{q+3}{10},\) and \(1\le v^{\prime }\le \frac{3\left( q-7\right) }{10}+1\) such that \(s-r\left( u^{\prime }+\frac{3}{ 10}\left( q-7\right) +1\right) \equiv -q\left( s-rv^{\prime }\right) \) \( \left( \hbox {mod} \,\,rn\right) \) or \(s-r\left( u^{\prime }+\frac{3}{10}\left( q-7\right) +1\right) \equiv -q\left( s+rv^{\prime }\right) \) \(\left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-r\left( u^{\prime }+\frac{3}{10}\left( q-7\right) +1\right) \equiv -q\left( s-rv^{\prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). It follows that \(s\equiv \left( u^{\prime }+\frac{3}{10}\left( q-7\right) +1+qv^{\prime }\right) \ \left( \hbox {mod} \,\,n\right) \). We know that \(s\equiv 0\ \left( \hbox {mod} \,\,n\right) \). Then, \(0\le u^{\prime }+qv^{\prime }<n.\) This is possible only when \(u^{\prime }+qv^{\prime }=n.\) Let \(u^{\prime }+qv^{\prime }=\frac{q^{2}+1}{10},\) then \(u^{\prime }+qv^{\prime }=q\frac{\left( q-7\right) }{10}+\frac{7q+1}{10}.\) This requires that \(u^{\prime }=\frac{7q+1}{10},\) which is in contradiction with \( 3\le u^{\prime }\le \frac{q+3}{10}.\)

Case 2 Let \(s-r\left( u^{\prime }+\frac{3}{10}\left( q-7\right) +1\right) \equiv -q\left( s+rv^{\prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). Then, \(s\equiv \left( u^{\prime }+\frac{3}{10}\left( q-7\right) +1-qv^{\prime }\right) \ \left( \hbox {mod} \,\,n\right) \). It follows that \( -3n<u^{\prime }-qv^{\prime }<0,\) This is possible only when \(u^{\prime }-qv^{\prime }=-n\) or \(u^{\prime }-qv^{\prime }=-2n.\) Let \(u^{\prime }-qv^{\prime }=-\frac{q^{2}+1}{10},\) then \(u^{\prime }-qv^{\prime }=-q\frac{ \left( q-3\right) }{10}-\frac{3q+1}{10}.\) This requires that \(u=-\frac{3q+1}{ 10},\) which contradicts with \(2\le u\le \frac{q-3}{10}.\) The case \( u^{\prime }-qv^{\prime }=-2n\) can be shown in a similar way with the case \( u^{\prime }-qv^{\prime }=-n.\)

The above discussions show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10 }\left( q-7\right) +1}C_{s-rj}\right) =C_{s-r\frac{3q-1}{10}}. \end{aligned}$$

From 4, we have \(-q\left( s-r\frac{\left( q+3\right) }{10}\right) \equiv s-r\frac{3q-1}{10}\) \(\left( \hbox {mod} \,\,rn\right) .\) This fact says that

$$\begin{aligned} -q\left( \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10} \left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{ \frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \right)= & {} -qC_{s-r\frac{ 3q-1}{10}} \\= & {} C_{s-r\frac{\left( q+3\right) }{10}}, \end{aligned}$$

and it follows that

$$\begin{aligned} \left( \cup _{j=1}^{\frac{3}{10}\left( q-7\right) +1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q+3\right) }{10} }. \end{aligned}$$

Contrary to the our claim, we assume that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \\&\quad =\left( \cup _{j=2}^{\lambda +1}C_{s-r\left( j+\frac{3}{10}\left( q-7\right) \right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-7\right) \right) }\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{10}.\) If \(\left( \cup _{j=2}^{\lambda +1}C_{s-r\left( j+\frac{3}{10}\left( q-7\right) \right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-7\right) \right) }\right) \ne \emptyset ,\) then there exist two integers \(b^{\prime }\) and \(b^{\prime \prime },\) where \(1\le b^{\prime },b^{\prime \prime }\le \frac{q+3}{10},\) such that \(s-r\left( b^{\prime }+\frac{3}{10}\left( q-7\right) \right) \equiv -q\left( s-rb^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \(s-r\left( b^{\prime }+\frac{3}{10}\left( q-7\right) \right) \equiv -q\left( s+rb^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) .\)

Case 1 Let \(s-r\left( b^{\prime }+\frac{3}{10}\left( q-7\right) \right) \equiv -q\left( s-rb^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). It follows that \(s\equiv \left( b^{\prime }+\frac{3}{10}\left( q-7\right) +qb^{\prime \prime }\right) \ \left( \hbox {mod} \,\,n\right) \). It is known that \(s\equiv 0\ \left( \hbox {mod} \,\,n\right) \). Then, we have \(2+q\le b^{\prime }+qb^{\prime \prime }\le \frac{\left( q+3\right) }{10}+q\frac{ \left( q+3\right) }{10}=n+\frac{2q+1}{5}<2n.\) This is possible only when \( b^{\prime }+qb^{\prime \prime }=n.\) Then, \(b^{\prime }+qb^{\prime \prime }=q \frac{\left( q+3\right) }{10}+\frac{-3q+1}{10}.\) This means that \(b^{\prime }=\frac{-3q+1}{10},\) which is in contradiction with the fact \(1\le b^{\prime }\le \frac{q+3}{10}.\)

Case 2 Let \(s-r\left( b^{\prime }+\frac{3}{10}\left( q-7\right) \right) \equiv -q\left( s+rb^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). Then, \(s\equiv \left( b^{\prime }+\frac{3}{10}\left( q-7\right) -qb^{\prime \prime }\right) \ \left( \hbox {mod} \,\,n\right) \). It follows that \( -2n<-\frac{\left( q^{2}+1\right) }{10}-\frac{\left( 3q-11\right) }{10}\le b^{\prime }+qb^{\prime \prime }\le \frac{-9q+3}{10}<0.\) This is possible only when \(b^{\prime }+qb^{\prime \prime }=-n.\) Let \(b^{\prime }+qb^{\prime \prime }=-\frac{q^{2}+1}{10},\) then \(b^{\prime }+qb^{\prime \prime }=-q\frac{ \left( q+3\right) }{10}-\frac{3q+1}{10}.\) This requires that \(b^{\prime }= \frac{3q-1}{10},\) which contradicts with \(1\le b^{\prime }\le \frac{q+3}{10 }.\)

Consequently, we have

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-7\right) +2}^{\frac{3}{10}\left( q-7\right) +1+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

From Lemma 1, we have \(c=5,\) and by Theorem 1, there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-7\right) -4\lambda -1,\frac{3}{5}\left( q-7\right) +2\lambda +4;5\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{10}.\) \(\square \)

Example 1

We present some parameters of EAQMDS codes obtained from Theorem 2 in Table 1.

Table 1 Some EAQMDS codes obtained by Theorem 5

Let Z and \({\overline{Z}}\) be the sets defined in Lemmas 2 and 3, respectively. Define \(T=Z\cup {\overline{Z}}\cup F=\cup _{j=0}^{ \frac{2q+1}{5}+\lambda },\) where \(F=\cup _{j=\frac{2q+1}{5}+1}^{\frac{2q+1}{5 }+1+\lambda }\) and \(1\le \lambda \le \frac{q+3}{10}.\) By combining results of Lemmas 24 and Theorem , we see that the number of entangled states \(c=9.\) Based on this fact, in Theorem 3, we give a class of EAQMDS codes of length \(n=\frac{ q^{2}+1}{10}\) and with entangled states \(c=9.\)

Theorem 3

Let \(q\equiv 7\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \(T=\cup _{j=0}^{\frac{2q+1}{5}+\lambda },\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{4}{5}\left( 2q+1\right) -4\lambda +7,\frac{2}{5}\left( 2q+1\right) +2\lambda +2;9\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{\left( q+3\right) }{10}.\)

Proof

The proof is a direct result of Lemmas 24 and Theorem 2. \(\square \)

Example 2

We present some parameters of EAQMDS codes obtained from Theorem 3 in Table 2.

Table 2 Some EAQMDS codes obtained by Theorem 4

4.2 EAQMDS codes of length \(n=\frac{q^{2}+1}{10},\) where \(q\equiv 3\left( \hbox {mod} \,\,10\right) \)

Note that \(n=\frac{q^{2}+1}{10},\) and so \(\hbox {ord}_{rn}\left( q^{2}\right) =2.\) This means that each \(q^{2}\)-cyclotomic coset modulo rn includes one or two elements. Let \(q\equiv 3\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{ q^{2}+1}{2}.\) It is easy to see that the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s}=\left\{ s\right\} \) and \(C_{s-rj}=\left\{ s-rj,s+rj\right\} ,\) where \(1\le j\le \frac{q-1}{2}.\)

Lemma 5

Let \(q\equiv 3\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(Z=\cup _{j=1}^{\lambda }C_{s-rj},\) where \(1\le \lambda \le \frac{3\left( q-3\right) }{10},\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

By Proposition 2, it is sufficient to prove that \(Z\cap \left( -qZ\right) =\emptyset \). Suppose that \(Z\cap \left( -qZ\right) \ne \emptyset \). Then, there exist two integers jk,  where \(1\le j,k\le \frac{3\left( q-3\right) }{10},\) such that \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\,rn\right) \) or \(s-rj\equiv -q\left( s+rk\right) \left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j+qk\left( \hbox {mod} \,\,n\right) \). As \(s\equiv 0\left( \hbox {mod} \,\,n\right) ,\) we get \(j+qk\equiv 0\left( \hbox {mod} \,\,n\right) \). Since \(1\le j,k\le \frac{3q-9}{10},\) \(q+1\le j+qk\le \frac{3q-9}{10}+q\frac{3q-9}{10}=\left( q+1\right) \frac{3\left( q-3\right) }{10}<3n.\) Then, we have that \(j+qk\equiv n\left( \hbox {mod} \,\,n\right) \) or \( j+qk\equiv 2n\left( \hbox {mod} \,\,n\right) .\) If \(j+qk=n,\) then \(j+qk=\frac{ q^{2}+1}{10}=q\frac{\left( q-3\right) }{10}+\frac{3q+1}{10}.\) By division algorithm, \(j=\frac{3q+1}{10}.\) This is a contradiction, because \(0\le j\le \frac{3\left( q-3\right) }{10}.\) If \(j+qk=2n,\) then \(j+qk=\frac{ 2\left( q^{2}+1\right) }{10}=q\frac{2\left( q-3\right) }{10}+\frac{2\left( 3q+1\right) }{10}.\) By division algorithm, \(j=\frac{2\left( 3q+1\right) }{10}\). This is a contradiction, because \(0\le j\le \frac{3\left( q-3\right) }{ 10}.\)

Case 2 Let \(s-rj\equiv -q\left( s+rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j-qk\left( \hbox {mod} \,\,n\right) \). By \(s\equiv 0\left( \hbox {mod} \,\,n\right) ,\) we have \(j-qk\equiv 0\left( \hbox {mod} \,\,n\right) \). Since \(1\le j,k\le \frac{3\left( q-3\right) }{10},\) \( -4n<1-3q\frac{\left( q-3\right) }{10}\le j-qk\le \frac{-7q-9}{10}<-n.\) We have that \(j-qk\equiv -2n\left( \hbox {mod} \,\,n\right) \) or \(j-qk\equiv -3n\left( \hbox {mod} \,\,n\right) \). If \(j+qk=-2n,\) then \(j-qk=\frac{-2\left( q^{2}+1\right) }{10}=-q\frac{2\left( q-3\right) }{10}+\frac{2\left( 3q-1\right) }{10}.\) By division algorithm, \(k=\frac{2\left( q-3\right) }{10} . \) This is a contradiction, because \(0\le k\le \frac{3\left( q-3\right) }{ 10}.\) If \(j+qk=-3n,\) then \(j-qk=\frac{3\left( q^{2}+1\right) }{10}=-q\frac{ 3\left( q-3\right) }{10}+\frac{3\left( 3q-1\right) }{10}.\) By division algorithm, \(k=\frac{3\left( q-3\right) }{10}.\) This is a contradiction, because \(0\le k\le \frac{3\left( q-3\right) }{10}.\) \(\square \)

Lemma 6

Let \(q\equiv 3\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{q^{2}+1 }{2}.\) Then we have the following:

  1. 1.

    \(-qC_{s}=C_{s}=\left\{ s\right\} ,\)

  2. 2.

    \(-qC_{s-r\frac{\left( q-3\right) }{10}}=C_{s-r\left( \frac{3q+1}{10} \right) }=\left\{ s-r\left( \frac{3q+1}{10}\right) ,s+r\left( \frac{3q+1}{10} \right) \right\} ,\)

  3. 3.

    \(-qC_{s-r\left( \frac{q+2}{5}\right) }=C_{s-r\left( \frac{2q-1}{5} \right) }=\left\{ s-r\frac{\left( 2q-1\right) }{5},s+r\frac{\left( 2q-1\right) }{5}\right\} .\)

Lemma 7

Let \(q\equiv 3( \hbox {mod} \,\,10)\). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(\overline{ Z}=\cup _{j=\frac{3\left( q-3\right) }{10}}^{t}C_{s-rj},\) where \(1\le t\le \frac{\left( q-3\right) }{10},\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

The proof for this lemma is very similar to the proof of Lemma 5. \(\square \)

As an immediate result of Lemma 7, we have \({\overline{Z}}\cap \left( -q{\overline{Z}}\right) =\emptyset .\)

In Theorem 4, we give a class of EAQMDS codes of length \(n=\frac{ q^{2}+1}{10}\) and with entangled states \(c=5.\)

Theorem 4

Let \(q\equiv 3( \hbox {mod} \,\,10) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \(Z=\cup _{j=0}^{\frac{3\left( q-3\right) }{10}+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-3\right) -4\lambda +3,\frac{3}{5}\left( q-3\right) +2\lambda +2;5\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{\left( q-3\right) }{10}.\)

Proof

Since the defining set of an \(\alpha \)-constacyclic code \({\mathcal {C}}\) of length n is \(Z=\cup _{j=0}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj},\) and the cardinality of Z,  which we denoted by \(\left| Z\right| ,\) is \(\left| Z\right| =\frac{3}{5}\left( q-3\right) +2\lambda +1,\) then by Propositions 1 and 3 , \({\mathcal {C}}\) is a \(q^{2}\)-ary MDS \(\alpha \)-constacyclic code with parameters

$$\begin{aligned} \left[ n,n-\left( \frac{3}{5}\left( q-3\right) +2\lambda +1\right) ,\frac{3}{ 5}\left( q-3\right) +2\lambda +2\right] _{q^{2}}. \end{aligned}$$

Hence, we have the following:

$$\begin{aligned} Z_{1}= & {} Z\cap (-qZ) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cup \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \right) \\&\cap \left( -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cup -q\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{ \frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \right) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10} \left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{ 3}{10}\left( q-3\right) }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10} \left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{ 10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} Z_{1}=Z\cap (-qZ)=C_{s}\cup C_{s-r\frac{3q+1}{10}}\cup C_{s-r\frac{\left( q-3\right) }{10}}. \end{aligned}$$

From Lemma 8, we have \(\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) =\emptyset \). By examining the coset structure of the defining set Z,  we can see that if \(j=0,\) then \(\ C_{s}\cap -qC_{s}=\left\{ s\right\} .\)

Thus, we need to show that

$$\begin{aligned}&\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q-3\right) }{10}},\\&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) =C_{s-r\frac{3q+1}{10}},\\&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

We first show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) =C_{s-r\frac{3q+1}{10}}. \end{aligned}$$

We have the following:

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3q+1}{10}}\cup \left( \cup _{j=\frac{3}{10}\left( q-3\right) +2}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3q+1}{10}}\cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) \right) \\&\qquad \cup \left( \left( \cup _{j=\frac{3}{10}\left( q-3\right) +2}^{\frac{3}{10} \left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{ 3}{10}\left( q-3\right) }C_{s-rj}\right) \right) \\&\quad =C_{s-r\frac{3q+1}{10}}. \end{aligned}$$

We claim that

$$\begin{aligned}&\left( C_{s-r\frac{3q+1}{10}}\cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \right) =C_{s-r\frac{3q+1}{10}}, \\&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +2}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) =\emptyset \end{aligned}$$

where \(1\le \lambda \le \frac{q-3}{10}.\)

Contrary to the claim, we assume that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +2}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) \\&\quad =\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-3\right) \right) }\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q-3}{10}.\) If \(\left( \cup _{j=2}^{\lambda }C_{s-r( j+\frac{3}{10}\left( q-3\right) ) }\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \ne \emptyset ,\) then there exist two integers u and v,  where \(2\le u\le \frac{q-3}{10} ,\) and \(1\le v\le \frac{3\left( q-3\right) }{10}\) such that \(s-r\left( u+ \frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s-rv\right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \(s-r\left( u+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s+rv\right) \) \(\left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-r\left( u+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s-rv\right) \) \(\left( \hbox {mod} \,\,rn\right) .\) It follows that \(s\equiv \left( u+\frac{3}{10}\left( q-3\right) +qv\right) \ \left( \hbox {mod} \,\,n\right) \). We know that \(s\equiv 0\ \left( \hbox {mod} \,\,n\right) \). Then, \(2+q\le u+qv\le \frac{\left( q-3\right) }{10}+3q\frac{\left( q-3\right) }{10}=\frac{3\left( q^{2}+1\right) }{10}-\frac{\left( 8q+6\right) }{10}<3n.\) This is possible only when \(u+qv=n\) or \(u+qv=2n.\) Let \(u+qv=\frac{ q^{2}+1}{10},\) then \(u+qv=q\frac{\left( q-3\right) }{10}+\frac{3q+1}{10}.\) This requires that \(u=\frac{3q+1}{10},\) which is in contradiction with \( 2\le u\le \frac{q-3}{10}.\) Let \(u+qv=2\frac{q^{2}+1}{10},\) then \(u+qv=2q \frac{\left( q-3\right) }{10}+2\frac{3q+1}{10}.\) This requires that \(u=\frac{ 3q+1}{10},\) which is in contradiction with \(2\le u\le \frac{q-3}{10}.\)

Case 2 Let \(s-r\left( u+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s+rv\right) \) \(\left( \hbox {mod} \,\,rn\right) .\) Then,

$$\begin{aligned} s\equiv \left( u+\frac{3}{10}\left( q-3\right) -qv\right) \ \left( \hbox {mod} \,\,n\right) . \end{aligned}$$

It follows that \(-3n<-\frac{\left( 3q^{2}+3\right) }{10}+\frac{9q+23}{10} \le u-qv\le \frac{q-3}{10}<0,\) This is possible only when \(u-qv=-n\) or \( u-qv=-2n.\) Let \(u-qv=-\frac{q^{2}+1}{10},\) then \(u-qv=-q\frac{\left( q-3\right) }{10}-\frac{3q+1}{10}.\) This requires that \(u=-\frac{3q+1}{10},\) which contradicts with \(2\le u\le \frac{q-3}{10}.\) Let \(u-qv=-2\frac{ q^{2}+1}{10},\) then \(u-qv=-2q\frac{\left( q-3\right) }{10}-\frac{2\left( 3q+1\right) }{10}.\) This requires that \(u=-\frac{2\left( 3q+1\right) }{10},\) which is in contradiction with \(2\le u\le \frac{q-3}{10}.\)

The above discussions show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{3}{10} \left( q-3\right) }C_{s-rj}\right) =C_{s-r\frac{3q+1}{10}}. \end{aligned}$$

We have \(-q\left( s-r\frac{3q+1}{10}\right) \equiv s-r\frac{\left( q-3\right) }{10}\) \(\left( \hbox {mod} \,\,rn\right) \). This fact says that

$$\begin{aligned} -q\left( \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10} \left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=1}^{\frac{ 3}{10}\left( q-3\right) }C_{s-rj}\right) \right) =-qC_{s-r\frac{3q+1}{10} }=C_{s-r\frac{\left( q-3\right) }{10}}, \end{aligned}$$

and it follows that

$$\begin{aligned} \left( \cup _{j=1}^{\frac{3}{10}\left( q-3\right) }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q-3\right) }{10}}. \end{aligned}$$

Contrary to the our claim, suppose that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \\&\quad =\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-3\right) \right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3}{ 10}\left( q-3\right) \right) }\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q-3}{10}.\) If \(\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-3\right) \right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-3\right) \right) }\right) \ne \emptyset ,\) then there exist two integers \(a^{\prime }\) and \( a^{\prime \prime },\) where \(1\le a^{\prime },a^{\prime \prime }\le \frac{ q-3}{10},\) such that \(s-r\left( a^{\prime }+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s-ra^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \) or \(s-r\left( a^{\prime }+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s+ra^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\,rn\right) . \)

Case 1 Let \(s-r\left( a^{\prime }+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s-ra^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). It follows that \(s\equiv \left( a^{\prime }+\frac{3}{10}\left( q-3\right) +qa^{\prime \prime }\right) \ \left( \hbox {mod} \,\,n\right) \). We know that \(s\equiv 0\ \left( \hbox {mod} \,\,n\right) \). Then, \(2+q\le a^{\prime }+qa^{\prime \prime }\le \frac{\left( q-3\right) }{10}+3q\frac{\left( q-3\right) }{10}=\frac{3\left( q^{2}+1\right) }{10}-\frac{\left( 8q+6\right) }{10}<3n.\) This is possible only when \(a^{\prime }+qa^{\prime \prime }=n\) or \(a^{\prime }+qa^{\prime \prime }=2n.\) Let \(a^{\prime }+qa^{\prime \prime }= \frac{q^{2}+1}{10},\) then \(a^{\prime }+qa^{\prime \prime }=q\frac{\left( q-3\right) }{10}+\frac{3q+1}{10}.\) This requires that \(a^{\prime }=\frac{3q+1 }{10},\) which is in contradiction with \(2\le a^{\prime }\le \frac{q-3}{10} . \) Let \(a^{\prime }+qa^{\prime \prime }=2\frac{q^{2}+1}{10},\) then \( a^{\prime }+qa^{\prime \prime }=2q\frac{\left( q-3\right) }{10}+2\frac{3q+1}{ 10}.\) This requires that \(a^{\prime }=\frac{3q+1}{10},\) which is in contradiction with \(2\le a^{\prime }\le \frac{q-3}{10}.\)

Case 2 Let \(s-r\left( a^{\prime }+\frac{3}{10}\left( q-3\right) \right) \equiv -q\left( s+ra^{\prime \prime }\right) \) \(\left( \hbox {mod} \,\, rn\right) \). Then, \(s\equiv \left( a^{\prime }+\frac{3}{10}\left( q-3\right) -qa^{\prime \prime }\right) \ \left( \hbox {mod} \,\,n\right) \). It follows that \( -3n<-\frac{\left( 3q^{2}+3\right) }{10}+\frac{9q+23}{10}\le a^{\prime }-qa^{\prime \prime }\le \frac{q-3}{10}<0,\) This is possible only when \( a^{\prime }-qa^{\prime \prime }=-n\) or \(a^{\prime }-qa^{\prime \prime }=-2n.\) Let \(a^{\prime }-qa^{\prime \prime }=-\frac{q^{2}+1}{10},\) then \(a^{\prime }-qa^{\prime \prime }=-q\frac{\left( q-3\right) }{10}-\frac{3q+1}{10}.\) This requires that \(a^{\prime }=-\frac{3q+1}{10},\) which contradicts with \(2\le a^{\prime }\le \frac{q-3}{10}.\) Let \(a^{\prime }-qa^{\prime \prime }=-2 \frac{q^{2}+1}{10},\) then \(a^{\prime }-qa^{\prime \prime }=-2q\frac{\left( q-3\right) }{10}-\frac{2\left( 3q+1\right) }{10}.\) This requires that \( a^{\prime }=-\frac{2\left( 3q+1\right) }{10},\) which is in contradiction with \(2\le a^{\prime }\le \frac{q-3}{10}.\)

This means that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-3\right) +1}^{\frac{3}{10}\left( q-3\right) +\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

From Lemma 1, we have \(c=5,\) and by Theorem 1, there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-3\right) -4\lambda +3,\frac{3}{5}\left( q-3\right) +2\lambda +2;5\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q-3}{10}.\) \(\square \)

Example 3

We present some parameters of EAQMDS codes obtained from Theorem 4 in Table 3.

Table 3 Some EAQMDS codes obtained by Theorem 4

Let Z and \({\overline{Z}}\) be the sets defined in Lemmas 5 and 7, respectively. Define \(T=Z\cup {\overline{Z}}\cup F=\cup _{j=0}^{ \frac{4\left( q-3\right) }{10}+\lambda },\) where \(F=\cup _{j=\frac{3\left( q-3\right) }{10}+1}^{\frac{3\left( q-3\right) }{10}+1+\lambda }\) and \(1\le \lambda \le \frac{q-3}{10}.\) By combining results of Lemmas 57 and Theorem 4, we see that the number of entangled states \(c=9.\) Based on this fact, in Theorem 5, we give a class of EAQMDS codes of length \(n=\frac{q^{2}+1}{10}\) and with entangled states \(c=9.\)

Theorem 5

Let \(q\equiv 3\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \(T=Z\cup {\overline{Z}}=\cup _{j=0}^{\frac{4\left( q-3\right) }{10} +\lambda },\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{8}{5}\left( q-3\right) -4\lambda +7,\frac{4}{5}\left( q-3\right) +2\lambda +2;9\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{\left( q-3\right) }{10}.\)

Proof

Since the defining set of an \(\alpha \)-constacyclic code \({\mathcal {C}}\) of length n is \(T=\cup _{j=0}^{\frac{4\left( q-3\right) }{10}+\lambda }\) and the cardinality of T,  which we denoted by \(\left| T\right| ,\) is \( \left| T\right| =\frac{4}{5}\left( q-3\right) +2\lambda +1,\) then by Propositions 1 and 3 , \({\mathcal {C}}\) is a \(q^{2}\)-ary MDS \( \alpha \)-constacyclic code with parameters

$$\begin{aligned} \left[ n,n-\left( \frac{4}{5}\left( q-3\right) +2\lambda +1\right) ,\frac{4}{ 5}\left( q-3\right) +2\lambda +2\right] _{q^{2}}. \end{aligned}$$

The remaining part of the proof is obtained directly from Theorem 4 , Lemmas 6 and 7. \(\square \)

Example 4

We present some parameters of EAQMDS codes obtained from Theorem 5 in Table 4.

Table 4 Some EAQMDS codes obtained by Theorem 4

5 Construction of EAQMDS codes from constacyclic codes (q is even)

Throughout this section, we set \(q=2^{e},\) \(r=q+1,\) \(s=\frac{q^{2}-q}{2}.\) The multiplicative order of q modulo n is denoted by \(\hbox {ord}_{n}\left( q\right) \). Let \(\alpha \in {\mathbb {F}}_{q^{2}}^{*}\) be a primitive \( r^{th}\) root of unity.

5.1 EAQMDS codes of length \(n=\frac{q^{2}+1}{5},\) where \(q\equiv 2\left( \hbox {mod} \,\,10\right) \)

Note that \(n=\frac{q^{2}+1}{5},\) and so \(\hbox {ord}_{rn}\left( q^{2}\right) =2.\) This means that each \(q^{2}\)-cyclotomic coset modulo rn includes one or two elements. Let \(q\equiv 2\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{ q^{2}-q}{2}.\) It is easy to see that the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s-rj}=\left\{ s-rj,s+r\left( j+1\right) \right\} ,\) where \(0\le j\le \frac{q-2}{2}.\)

Lemma 8

Let \(q\equiv 2\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(Z=\cup _{j=0}^{\lambda }C_{s-rj},\) where \(0\le \lambda \le \frac{3\left( q-2\right) }{10}-1,\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

By Proposition 2, it is sufficient to prove that \(Z\cap \left( -qZ\right) =\emptyset \). Assume that \(Z\cap \left( -qZ\right) \ne \emptyset \). Then, there exist two integers jk,  where \(0\le j,k\le \frac{3\left( q-2\right) }{10}-1,\) such that \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\,rn\right) \) or \(s-rj\equiv -q\left( s+rk\right) \) \(\left( \hbox {mod} \,\, rn\right) .\)

Case 1 Let \(s-rj\equiv -q\left( s-rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j+qk\left( \hbox {mod} \,\,n\right) \). As \(s\equiv r\frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) ,\) we get \(j+qk\equiv r\frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) \). Since \(0\le j,k\le \frac{3q-16}{10},\) \(0\le j+qk\le \frac{3q-16}{10}+q \frac{3q-16}{10}<\left( q+1\right) \frac{\left( q-2\right) }{10}<3\left( q+1\right) \frac{\left( n-1\right) }{2}.\) Then, we have that \(j+qk\equiv r \frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) \) if and only if \( j+qk=r\frac{\left( n-1\right) }{2}.\) Since \(r\frac{\left( n-1\right) }{2}=r \frac{\frac{q^{2}+1}{5}-1}{2}=r\frac{q^{2}-4}{10}=r\frac{q^{2}-2q+2q-4}{10} =qr\frac{\left( q-2\right) }{10}+2r\frac{\left( q-2\right) }{10},\) we obtain \(j+qk=qr\frac{\left( q-2\right) }{10}+2r\frac{\left( q-2\right) }{10}.\) By division algorithm, \(j=2r\frac{\left( q-2\right) }{10}.\) This is a contradiction, because \(0\le j\le \frac{3\left( q-2\right) }{10}-1.\)

Case 2 Let \(s-rj\equiv -q\left( s+rk\right) \left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j-qk\left( \hbox {mod} \,\,n\right) \). By \(s\equiv r\frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) ,\) we have \(j-qk\equiv r\frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) \). Since \(0\le j,k\le \frac{3\left( q-2\right) }{10}-1,\) \(-3\left( q+1\right) \frac{\left( n-1\right) }{2}<-q\frac{3q-16}{10}\le j-qk\le \frac{3q-16}{10} <\left( q+1\right) \frac{\left( n-1\right) }{2}.\) We have that \(j-qk\equiv r \frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\,n\right) \) if and only if \( j-qk=-r\frac{\left( n+1\right) }{2}.\) Since \(-r\frac{\left( n+1\right) }{2} =-r\frac{\frac{q^{2}+1}{5}+1}{2}=-r\frac{q^{2}+6}{10}=-r\frac{q^{2}-2q+2q+6}{ 10}=-qr\frac{\left( q-2\right) }{10}-r\frac{\left( q+3\right) }{5},\) we obtain \(j-qk=-qr\frac{\left( q-2\right) }{10}-r\frac{\left( q+3\right) }{5}.\) By division algorithm, \(k=\frac{\left( q+1\right) \left( q-2\right) }{10}.\) This is a contradiction, because \(0\le k\le \frac{3\left( q-2\right) }{10} -1.\) \(\square \)

Theorem 6

Let \(q\equiv 2\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \( Z=\) \(\cup _{j=0}^{\frac{3\left( q-2\right) }{10}-1+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-2\right) -4\lambda +4,\frac{3}{5}\left( q-2\right) +2\lambda +1;4\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\)

Proof

Since the defining set of \(\alpha \)-constacyclic code \({\mathcal {C}}\) of length n is \(Z=\) \(\cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj},\) and the cardinality of Z,  which we denoted by \(\left| Z\right| ,\) is \(\left| Z\right| =\frac{3}{5}\left( q-2\right) +2\lambda ,\) then by Propositions 1 and 3 , \({\mathcal {C}}\) is an \(q^{2}\)-ary MDS \(\alpha \)-constacyclic code with parameters

$$\begin{aligned} \left[ n,n-\left( \frac{3}{5}\left( q-2\right) +2\lambda \right) ,\frac{3}{5} \left( q-2\right) +2\lambda +1\right] _{q^{2}}. \end{aligned}$$

Hence, we have the following:

$$\begin{aligned} Z_{1}= & {} Z\cap (-qZ) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cup \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{ \frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \right) \\&\cap \left( -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cup -q\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{ \frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \right) \\= & {} \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{ \frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10} \left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{ \frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10} \left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3 }{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} Z_{1}=Z\cap (-qZ)=C_{s-r\frac{3\left( q-2\right) }{10}}\cup C_{s-r\frac{ \left( q-2\right) }{10}}. \end{aligned}$$

By Lemma 8, we have \(\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) =\emptyset .\)

We need to show that

$$\begin{aligned}&\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q-2\right) }{10} },\\&\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) =C_{s-r\frac{3\left( q-2\right) }{10} },\\&\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

We first show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) =C_{s-r\frac{3\left( q-2\right) }{10} }. \end{aligned}$$

We have the following:

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3\left( q-2\right) }{10}}\cup \left( \cup _{j=\frac{3}{ 10}\left( q-2\right) +1}^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{3\left( q-2\right) }{10}}\cap -q\left( \cup _{j=0}^{ \frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \right) \\&\qquad \cup \left( \left( \cup _{j=\frac{3}{10}\left( q-2\right) +1}^{\frac{3}{10} \left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{ \frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} \left( C_{s-r\frac{3\left( q-2\right) }{10}}\cap -q\left( \cup _{j=0}^{\frac{ 3}{10}\left( q-2\right) -1}C_{s-rj}\right) \right) =C_{s-r\frac{3\left( q-2\right) }{10}} \end{aligned}$$

and

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-2\right) +1}^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) =\emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\)

Contrary to the claim, we assume that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-2\right) +1}^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) \\&\quad =\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-2\right) -1\right) }\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\) If \(\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-2\right) -1\right) }\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \ne \emptyset ,\) then there exist two integers u and v,  where \(1\le u\le \frac{q+3}{5},\) and \(0\le v\le \frac{3\left( q-4\right) }{10}\) such that \( s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s-rv\right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \(s-r\left( u+\frac{3}{10} \left( q-2\right) -1\right) \equiv -q\left( s+r\left( v+1\right) \right) \) \( \left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s-rv\right) \) \(\left( \hbox {mod} \,\,rn\right) .\) It follows that \(s\equiv \left( u+\frac{3}{10}\left( q-2\right) +qv-1\right) \ \left( \hbox {mod} \,\,n\right) \). Then, \(\frac{3\left( q-2\right) }{10}\le u+\frac{3}{ 10}\left( q-2\right) +qv-1<\frac{2\left( q+3\right) }{10}+\frac{3}{10}\left( q-2\right) +q\frac{3\left( q-4\right) }{10}=\frac{3q^{2}-7q}{10}<\frac{ q^{2}-2q}{2}=s-\frac{q}{2},\) which is in contradiction with \(s\equiv \frac{ n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

Case 2 Let \(s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s+r\left( v+1\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) . \) Then, \(s\equiv \left( u+\frac{3}{10}q-2-q\left( v+1\right) -1\right) \ \left( \hbox {mod} \,\,n\right) \). It follows that \(-q\frac{3\left( q-4\right) }{ 10}+\frac{3\left( q-2\right) }{10}-q\le u+\frac{3}{10}\left( q-2\right) -q\left( v+1\right) -1<\frac{2\left( q+3\right) }{10}+\frac{3}{10}\left( q-2\right) -q=\frac{-q}{2},\) which is a contradiction, since \(s\equiv \frac{ n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

The above discussions show that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) =C_{s-r\frac{3\left( q-2\right) }{10}} \end{aligned}$$

Since \(-qs\equiv s-r\frac{\left( 3q+1\right) \left( q-2\right) }{10}\) \( \left( \hbox {mod} \,\,rn\right) ,\) we have \(-q\left( s-r\frac{3\left( q-2\right) }{10}\right) \equiv s-r\frac{\left( q-2\right) }{10}\) \(\left( \hbox {mod} \,\, rn\right) \). This fact says that

$$\begin{aligned} -q\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3}{10 }\left( q-2\right) -1}C_{s-rj}\right) =-qC_{s-r\frac{3\left( q-2\right) }{10} }=C_{s-r\frac{\left( q-2\right) }{10}}, \end{aligned}$$

and it follows that

$$\begin{aligned} \left( \cup _{j=0}^{\frac{3}{10}\left( q-2\right) -1}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10} \left( q-2\right) -1+\lambda }C_{s-rj}\right) =C_{s-r\frac{\left( q-2\right) }{10}}. \end{aligned}$$

Contrary to the claim, suppose that

$$\begin{aligned}&\left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{10} \left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) \\&\quad =\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3}{10}\left( q-2\right) -1\right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3 }{10}\left( q-2\right) -1\right) }\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\) Then, there exist two integers u and v,  where \(1\le u,v\le \frac{q+3}{5},\) such that \(s-r\left( u+\frac{3 }{10}\left( q-2\right) -1\right) \equiv -q\left( s-\left( v+\frac{3}{10} \left( q-2\right) -1\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \( s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s+\left( v+\frac{3}{10}\left( q-2\right) \right) \right) \) \(\left( \hbox {mod} \,\, rn\right) .\)

Case 1 Let \(s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s-r\left( v+\frac{3}{10}\left( q-2\right) -1\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) \). It follows that \(s\equiv \left( u+qv+\frac{3 }{10}\left( q+1\right) \left( 3q-16\right) \right) \ \left( \hbox {mod} \,\, n\right) \). Then, we get \(\frac{3\left( q-2\right) \left( q+1\right) }{10} \le u+\frac{\left( q+1\right) \left( 3q-16\right) }{10}+qv\le \frac{\left( q+1\right) \left( 5q-10\right) }{10}=\frac{q^{2}-q-2}{2}=s-1.\) This contradicts with \(s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

Case 2 Let \(s-r\left( u+\frac{3}{10}\left( q-2\right) -1\right) \equiv -q\left( s+r\left( v+\frac{3}{10}\left( q-2\right) \right) \right) \). It follows that \(s\equiv \left( u-qv+\left( 1-q\right) \frac{3\left( q-2\right) }{10}-1\right) \ \left( \hbox {mod} \,\,n\right) \). Then, we have \( \frac{-3q^{2}+3q-6}{10}\le u-qv+\left( 1-q\right) \frac{3\left( q-2\right) }{10}-1=\frac{-3q^{2}-9q}{10},\) which is in contradiction with \(s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

This means that

$$\begin{aligned} \left( \cup _{j=\frac{3}{10}\left( q-2\right) }^{\frac{3}{10} \left( q-2\right) -1+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3}{ 10}\left( q-2\right) }^{\frac{3}{10}\left( q-2\right) -1+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

From Lemma 1, we have \(c=4,\) and by Theorem 1, there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-2\right) -4\lambda +4,\frac{3}{5}\left( q-2\right) +2\lambda +1;4 \rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\) \(\square \)

Example 5

We present some parameters of EAQMDS codes obtained from Theorem 6 in Table 5.

Table 5 Some EAQMDS codes obtained by Theorem 6

5.2 EAQMDS codes of length \(n=\frac{q^{2}+1}{5},\) where \(q\equiv 8\left( \hbox {mod} \,\,10\right) \)

Let \(q\equiv 8\left( \hbox {mod} \,\,10\right) \) and \(s=\frac{q^{2}-q}{2}.\) Then, the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s-rj}=\left\{ s-rj,s+r\left( j+1\right) \right\} ,\) where \( 0\le j\le \frac{q-2}{2}.\)

Lemma 9

Let \(q\equiv 8\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and its defining set is \( Z=\cup _{j=0}^{\lambda }C_{s-rj},\) where \(0\le \lambda \le \frac{3q-14}{10} ,\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

By Proposition 2, it is sufficient to prove that \(Z\cap \left( -qZ\right) =\emptyset \). Assume that \(Z\cap \left( -qZ\right) \ne \emptyset \). Then, there exist two integers j\(k,0\le j,k\le \frac{3q-14}{10},\) such that \(s-rj\equiv -q\left( s-rk\right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \(s-rj\equiv -q\left( s+rk\right) \left( \hbox {mod} \,\,rn\right) .\)

Case 1 \(s-rj\equiv -q\left( s-rk\right) \) \(\left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j+qk\) \(\left( \hbox {mod} \,\, n\right) \). As \(s\equiv r\frac{\left( n-1\right) }{2}\) \(\left( \hbox {mod} \,\, n\right) ,\) we get \(j+qk\equiv r\frac{\left( n-1\right) }{2}\) \(\left( \hbox {mod} \,\,n\right) \). Since \(0\le j,k\le \frac{3q-14}{10},\) \(0\le j+qk\le \frac{3q-14}{10}+q\frac{3q-14}{10}\le \left( q+1\right) \frac{\left( 3q-14\right) }{10}<3r\frac{\left( n-1\right) }{2}.\) Then, we have that \( j+qk\equiv r\frac{\left( n-1\right) }{2}\) \(\left( \hbox {mod} \,\,n\right) \) if and only if \(j+qk=r\frac{\left( n-1\right) }{2}+nt,\) for some integer t. Then, we obtain \(r\frac{\left( n-1\right) }{2}=r\frac{\left( \frac{q^{2}+1}{5 }-1\right) }{2}=r\frac{\left( q^{2}-4\right) }{10}.\) This is a contradiction, because \(0\le j\le \frac{3q-14}{10}<\frac{\left( q^{2}-4\right) }{10}.\)

Case 2 \(s-rj\equiv -q\left( s+rk\right) \) \(\left( \hbox {mod} \,\, rn\right) \). This is equivalent to \(s\equiv j-qk\) \(\left( \hbox {mod} \,\, n\right) \). Since \(s\equiv r\frac{\left( n-1\right) }{2}\left( \hbox {mod} \,\, n\right) ,\) we have \(j-qk\equiv r\frac{\left( n-1\right) }{2}\) \(\left( \hbox {mod} \,\,n\right) ,\) where \(0\le j,k\le \frac{3q-14}{10}.\) Then, \(-q\frac{ 3q-14}{10}\le j-qk\le \frac{3q-14}{10}.\) We have that \(j-qk\equiv r\frac{ \left( n-1\right) }{2}\) \(\left( \hbox {mod} \,\,n\right) \) if and only if \(j-qk=-r \frac{\left( n+1\right) }{2}+nt,\) for some integer t. Then, \(-r\frac{ \left( n+1\right) }{2}=-r\frac{\frac{q^{2}+1}{5}+1}{2}=-r\frac{q^{2}+6}{10}.\) This is a contradiction, because \(-q\frac{3q-14}{10}\le j-qk\le \frac{3q-14 }{10}.\) \(\square \)

Theorem 7

Let \(q\equiv 8\left( \hbox {mod} \,\,10\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \( Z=\cup _{j=0}^{\frac{3q-14}{10}+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{2}{5}\left( 3q-14\right) -4\lambda ,\frac{ \left( 3q-14\right) }{5}+2\lambda +3;4\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+2}{5}.\)

Proof

Because the defining set of \(\alpha \)-constacyclic code \({\mathcal {C}}\) of length n is \(Z=\) \(\cup _{j=0}^{\frac{3q-14}{10}+\lambda }C_{s-rj},\) then the cardinality of Z is \(\left| Z\right| =\) \(\frac{3q-14}{5} +2\lambda +2.\) From Propositions 1 and 3 , \({\mathcal {C}}\) is an MDS \(\alpha \)-constacyclic code with parameters

$$\begin{aligned} \left[ n,n-\left( \frac{3q-14}{5}+2\lambda +2\right) ,\frac{\left( 3q-14\right) }{5}+2\lambda +3\right] _{q^{2}}. \end{aligned}$$

Thus, we have the following:

$$\begin{aligned} Z_{1}= & {} Z\cap (-qZ) \\= & {} \left( \left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cup \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \right) \\&\cap \left( -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cup -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \right) \\= & {} \left( \left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \right) \cup \\&\left( \left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \right) \\&\cup \left( \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10} +\lambda }C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} Z_{1}=Z\cap (-qZ)=C_{s-r\frac{\left( q-8\right) }{10}}\cup C_{s-r\frac{ \left( 3q-4\right) }{10}}. \end{aligned}$$

By Lemma 8, we have \(\left( \cup _{j=0}^{\frac{3q-14}{10} }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =\emptyset .\)

It is sufficient to show that

$$\begin{aligned}&\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =C_{s-r\frac{\left( q-8\right) }{10} },\\&\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =C_{s-r\frac{ \left( 3q-4\right) }{10}},\\&\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

We first show that

$$\begin{aligned} \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =C_{s-r\frac{\left( 3q-4\right) }{10}}. \end{aligned}$$

The following is immediate:

$$\begin{aligned}&\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{\left( 3q-4\right) }{10}}\cup \left( \cup _{j=\frac{ 3q+6}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \\&\quad =\left( C_{s-r\frac{\left( 3q-4\right) }{10}}\cap -q\left( \cup _{j=0}^{ \frac{3q-14}{10}}C_{s-rj}\right) \right) \\&\qquad \cup \left( \left( \cup _{j=\frac{3q+6}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \right) . \end{aligned}$$

We claim that

$$\begin{aligned} C_{s-r\frac{\left( 3q-4\right) }{10}}\cap -q\left( \cup _{j=0}^{\frac{3q-14}{ 10}}C_{s-rj}\right) =C_{s-r\frac{\left( 3q-4\right) }{10}}, \end{aligned}$$

and

$$\begin{aligned} \left( \cup _{j=\frac{3q+6}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =\emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+2}{5}.\)

Contrary to the our claim, assume that

$$\begin{aligned}&\left( \cup _{j=\frac{3q+6}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \\&\quad =\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3q-14}{10}\right) }\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+2}{5}.\) If \(\left( \cup _{j=2}^{\lambda }C_{s-r\left( j+\frac{3q-14}{10}\right) }\right) \cap -q\left( \cup _{j=0}^{ \frac{3q-14}{10}}C_{s-rj}\right) \ne \emptyset ,\) then there exist two integers a and b,  where \(1\le a\le \frac{q+2}{5},\) and \(0\le b\le \frac{\left( 3q-14\right) }{10}\) such that \(s-r\left( a+\frac{3q-14}{10} \right) \equiv -q\left( s-rb\right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \( s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s+r\left( b+1\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s-rb\right) \) \(\left( \hbox {mod} \,\,rn\right) \). It follows that \(s\equiv \left( a+\frac{3q-14}{10}+qb\right) \ \left( \hbox {mod} \,\,n\right) \). Then, \( \frac{\left( 3q-4\right) }{10}\le a+\frac{3q-14}{10}+qb\le \frac{3q^{2}-9q }{10}-1<\frac{q^{2}-2q}{2}=s-\frac{q}{2},\) which is in contradiction with \( s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

Case 2 Let \(s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s+r\left( b+1\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) .\) It follows that \(s\equiv \left( a+\frac{3q-14}{10}-q\left( b+1\right) \right) \ \left( \hbox {mod} \,\,n\right) \). Then, \(\frac{-3q^{2}+3q}{10}-1\le a+\frac{3q-14}{10} -q\left( b+1\right) \le -\frac{q}{2}-1,\) which is a contradiction, since \( s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) .\)

The above arguments show that

$$\begin{aligned} \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =C_{s-r\frac{ \left( 3q-4\right) }{10}}. \end{aligned}$$

We have \(-q\left( s-r\frac{3q-4}{10}\right) \equiv s-r\frac{q-8}{10}\) \( \left( \hbox {mod} \,\,rn\right) \). This means that

$$\begin{aligned} -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =-qC_{s-r\frac{3q-4}{10}}=C_{s-r\frac{q-8}{10}}, \end{aligned}$$

and it follows that

$$\begin{aligned} \left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) \cap -q\left( \cup _{j=0}^{\frac{3q-14}{10}}C_{s-rj}\right) =C_{s-r\frac{\left( q-8\right) }{10} }. \end{aligned}$$

For the remaining part of the proof, suppose that

$$\begin{aligned}&\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10} +\lambda }C_{s-rj}\right) \\&\quad =\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3q-14}{10}\right) }\right) \cap -q\left( \cup _{j=1}^{\lambda }C_{s-r\left( j+\frac{3q-14}{10} \right) }\right) \ne \emptyset , \end{aligned}$$

where \(1\le \lambda \le \frac{q+2}{5}.\) Then, there exist two integers a and b,  where \(2\le a,b\le \frac{q+2}{5},\) such that \(s-r\left( a+\frac{ 3q-14}{10}\right) \equiv -q\left( s-\left( b+\frac{3q-14}{10}\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) \) or \(s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s+r\left( b+1+\frac{3q-14}{10}\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) .\)

Case 1 Let \(s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s-\left( b+\frac{3q-14}{10}\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) \). It follows that \(s\equiv \left( a+qb+\left( q+1\right) \frac{3q-14}{10} \right) \ \left( \hbox {mod} \,\,n\right) .\) It is immediate that \(\frac{\left( q+1\right) \left( 3q-4\right) }{10}\le a+qb+\left( q+1\right) \frac{3q-14}{ 10}\le \frac{\left( q+1\right) \left( 5q-10\right) }{10}=\frac{q^{2}-q-2}{2} =s-1.\) This contradicts with \(s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\, n\right) .\)

Case 2 Let \(s-r\left( a+\frac{3q-14}{10}\right) \equiv -q\left( s+r\left( b+1+\frac{3q-14}{10}\right) \right) \) \(\left( \hbox {mod} \,\,rn\right) \). It follows that \(s\equiv \left( a-q\left( b+1\right) +\left( 1-q\right) \frac{3q-14}{10}\right) \ \left( \hbox {mod} \,\,n\right) \). We have \(\frac{ -5q^{2}+3q-4}{10}\) \(\le a-q\left( b+1\right) +\left( 1-q\right) \frac{3q-14 }{10}\le \frac{-3q^{2}-q}{10}-1<s,\) which is in contradiction with \(s\equiv \frac{n-r}{2}\) \(\left( \hbox {mod} \,\,n\right) \). This means that

$$\begin{aligned} \left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) \cap -q\left( \cup _{j=\frac{3q-4}{10}}^{\frac{3q-14}{10}+\lambda }C_{s-rj}\right) =\emptyset . \end{aligned}$$

From Lemma 1, we have \(c=4,\) and by Theorem 1, there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{2}{5}\left( 3q-14\right) -4\lambda ,\frac{\left( 3q-14\right) }{5}+2\lambda +3;4\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+2}{5}.\) \(\square \)

Example 6

We present some parameters of EAQMDS codes obtained from Theorem 7 in Table 6.

Table 6 Some EAQMDS codes obtained by Theorem 7

5.3 EAQMDS codes of length \(n=\frac{q^{2}+1}{13},\) where \(q\equiv 5\left( \hbox {mod} \,\,13\right) \)

Note that \(n=\frac{q^{2}+1}{13},\) and so \(\hbox {ord}_{rn}\left( q^{2}\right) =2.\) This means that each \(q^{2}\)-cyclotomic coset modulo rn includes one or two elements. Let \(q\equiv 5\left( \hbox {mod} \,\,13\right) \) and \(s=\frac{ q^{2}-q}{2}.\) It is easy to see that the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s-rj}=\left\{ s-rj,s+r\left( j+1\right) \right\} ,\) where \(0\le j\le \frac{q-2}{2}.\)

Lemma 10

Let \(q\equiv 5\left( \hbox {mod} \,\,13\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(Z=\cup _{j=0}^{\lambda }C_{s-rj},\) where \(0\le \lambda \le \frac{3\left( q-2\right) }{10}-1,\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

The proof is analogous to the proof of Lemma 8. \(\square \)

Theorem 8

Let \(q\equiv 5\left( \hbox {mod} \,\,13\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \( Z=\cup _{j=0}^{\frac{3\left( q-2\right) }{10}-1+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-2\right) -4\lambda +4,\frac{3}{5}\left( q-2\right) +2\lambda +1;4\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+3}{5}.\)

Proof

The proof is analogous to the proof of Theorem 6. \(\square \)

Example 7

We present some parameters of EAQMDS codes obtained from Theorem 8 in Table 7.

Table 7 Some EAQMDS codes obtained by Theorem 8

5.4 EAQMDS codes of length \(n=\frac{q^{2}+1}{17},\) where \(q\equiv 13\left( \hbox {mod} \,\,17\right) \)

Note that \(n=\frac{q^{2}+1}{17},\) and so \(\hbox {ord}_{rn}\left( q^{2}\right) =2.\) This means that each \(q^{2}\)-cyclotomic coset modulo rn includes one or two elements. Let \(q\equiv 13\left( \hbox {mod} \,\,17\right) \) and \(s=\frac{ q^{2}-q}{2}.\) It is easy to see that the \(q^{2}\)-cyclotomic cosets modulo rn containing some integers from 1 to rn are \(C_{s-rj}=\left\{ s-rj,s+r\left( j+1\right) \right\} ,\) where \(0\le j\le \frac{q-2}{2}.\)

Lemma 11

Let \(q\equiv 13\left( \hbox {mod} \,\,17\right) \). If \({\mathcal {C}}\) is a \(q^{2}\)-ary constacyclic code of length n and defining set \(Z=\cup _{j=0}^{\lambda }C_{s-rj},\) where \(0\le \lambda \le \frac{3\left( q-4\right) }{10}+2,\) then \({\mathcal {C}}^{\perp _{H}}\subseteq {\mathcal {C}}.\)

Proof

The proof is analogous to the proof of Lemma 8. \(\square \)

Theorem 9

Let \(q\equiv 13\left( \hbox {mod} \,\,17\right) \). If \({\mathcal {C}}\) is an \(q^{2}\)-ary \(\alpha \)-constacyclic code of length n with defining set \(Z=\cup _{j=0}^{\frac{3\left( q-2\right) }{10}+2+\lambda }C_{s-rj},\) then there exist EAQMDS codes with parameters

$$\begin{aligned} \llbracket n,n-\frac{6}{5}\left( q-4\right) -4\lambda -8,\frac{3}{5}\left( q-4\right) +2\lambda +4;4\rrbracket _{q}, \end{aligned}$$

where \(1\le \lambda \le \frac{q+4}{17}.\)

Proof

The proof is analogous to the proof of Theorem 6. \(\square \)

Example 8

We present some parameters of EAQMDS codes obtained from Theorem 9 in Table 8.

Table 8 Some EAQMDS codes obtained by Theorem 9

6 Conclusion

In this work, via a decomposition of the defining set of constacyclic codes we have constructed eight new families of EAQMDS codes. In addition to the parameters of EAQMDS and EAQEC codes given in [12, 24], we remark that the parameters of EAQMDS and EAQEC codes listed below have not covered ones given in this paper.

  1. 1.

    \(\llbracket q^{2}+1,q^{2}-2d+4,d;1\rrbracket _{q},\) where q is a prime power, \(2\le d\le 2q\) is an even integer [9].

  2. 2.

    \(\llbracket \frac{q^{2}-1}{2},\frac{q^{2}-1}{2}-2d+4,d;2\rrbracket _{q},\) where q is an odd prime power, \(\frac{q+5}{2}\le d\le \frac{3q-1}{ 2}\) [9].

  3. 3.

    \(\llbracket n,n-2\delta -1,2\delta +2;2\delta +1\rrbracket _{q},\) where q is an odd prime power, \(n=q^{2}+1,\) \(s=\frac{n}{2},r|q-1,\) \(r\not \mid q+1,\)and \(0\le \delta \le \frac{(r-1)(s-1)}{r}\) [29].

  4. 4.

    \(\llbracket n,n-2\delta -2,2\delta +3;2\delta +2\rrbracket _{q},\) where \(q=2^{m},n=q^{2}+1,r|q-1,r\not \mid q+1,u=\frac{n-r}{2}\) and \(0\le \delta \le \frac{u-1}{r}\) [29].

  5. 5.

    \(\llbracket n,n-2\delta -1,2\delta +2;2\delta +1\rrbracket _{q},\) where \(q=2^{m},n=q^{2}+1,r|q-1,r\not \mid q+1\) and \(0\le \delta \le \frac{ (r-1)(n-2)}{2r}\) [29].

  6. 6.

    \(\llbracket q^{2}+1,q^{2}+5-2q-4t,q+2t+1;4\rrbracket _{q},\) where \( 2\le t\le \frac{q-1}{2},\) q is an odd prime power with \(q\ge 5\) and \( q\equiv 1\) \(\left( \hbox {mod} \,\,4\right) \) [8].

  7. 7.

    \(\llbracket \frac{q^{2}+1}{2},\frac{q^{2}+1}{2}-2q-4t+5,q+2t+1;5 \rrbracket _{q},\) where \(2\le t\le \frac{q-1}{2},\) q is an odd prime power with \(q>7\) [8].

  8. 8.

    \(\llbracket \lambda (q+1),\lambda (q+1)-2\lambda -2t-q+5,\frac{q+1}{2} +t+\lambda ;4\rrbracket _{q},\) where q is an odd prime power with \(q\ge 7,\) \(\lambda \) is an odd divisor of \(q-1\) with \(\lambda \ge 3\) and \(\frac{q+3 }{2}\le t\le \frac{q-1}{2}+\lambda \) [8].

  9. 9.

    \(\llbracket 2\lambda (q+1),2\lambda (q+1)-4\lambda -2t-q+5,\frac{q+1}{2} +t+2\lambda ;4\rrbracket _{q},\) where q is an odd prime power with \(q\ge 13,\) \(q\equiv 1\) \(\left( \hbox {mod} \,\,4\right) ,\) \(\lambda \) is an odd divisor of \(q-1 \) with \(\lambda \ge 3\) and \(\frac{q+3}{2}\le t\le \frac{q-1}{2} +2\lambda \) [8].

  10. 10.

    \(\llbracket \frac{q^{2}+1}{2},\frac{q^{2}+1}{2}-5,d\ge 3;5 \rrbracket _{q},\) where q is an odd prime power with \(q>3\) [8].

  11. 11.

    \(\llbracket q^{2}+1,q^{2}-3,d\ge 3;4\rrbracket _{q},\) where q is an odd prime power with \(q\ge 5\) and \(q\equiv 1\) \(\left( \hbox {mod} \,\, 4\right) \) [8].

  12. 12.

    \(\llbracket \frac{q^{2}+1}{10},\frac{q^{2}+1}{10}-2d+3,d;1\rrbracket _{q},\) where q is an odd prime power of the form \(10m +3,\) \(2 \le d \le 6m +2\) is even [25].

  13. 13.

    \(\llbracket \frac{q^{2}+1}{10},\frac{q^{2}+1}{10}-2d+3,d;1\rrbracket _{q},\) where q is an odd prime power of the form \(10m +7,\) \(2 \le d \le 6m +4\) is even [25].