## On Euclidean Hulls of MDS Codes

Xiaolei Fang

Meiqing Liu Jinquan Luo*

Abstract : In this paper, we propose a mechanism on the constructions of MDS codes with arbitrary dimensions of Euclidean hulls. Precisely, we construct (extended) generalized Reed-Solomon(GRS) codes with assigned dimensions of Euclidean hulls from self-orthogonal GRS codes. It turns out that our constructions are more general than previous works on Euclidean hulls of (extended) GRS codes.

Key words : MDS self-orthogonal code, Generalized Reed-Solomon(GRS) code, Extended generalized Reed-Solomon(GRS) code, Euclidean hull

## 1 Introduction

Let q be a prime power and F q a finite field with q elements. A q -ary [ n, k, d ] code C is a linear code over F q with length n , dimension k and minimum distance d . The Singleton bound states that k ≤ n -d + 1. The code C attaching the Singleton bound(i.e., k = n -d + 1) is called a maximum distance separable(MDS) code. Due to their optimal properties, MDS codes play an important role in coding theory and related fields, see [2, 28].

For any two vectors -→ a = ( a , a 1 2 , . . . , a n ) and -→ b = ( b 1 , b 2 , . . . , b n ) ∈ F n q , we define their Euclidean inner product as:

The dual code of C is defined as

$$\overrightarrow { a } \cdot \overrightarrow { b } = \sum _ { i = 1 } ^ { n } a _ { i } b _ { i }.$$

$$C ^ { \perp } = \left \{ \overrightarrow { a } \in \mathbb { F } _ { q } ^ { n } \colon \overrightarrow { a } \cdot \overrightarrow { b } = 0 \text{ for any } \overrightarrow { b } \in C \right \}. \\ \text{odd} \text{,}$$

The hull of C is defined by

$$H u l l ( C ) = C \cap C ^ { \perp }.$$

Readers are referred to [1] for more details on hull of linear code.

The authors are with School of Mathematics and Statistics &amp; Hubei Key Laboratory of Mathematical Sciences, Central China Normal University, Wuhan China, 430079.

E-mail: fangxiaolei@mails.ccnu.edu.cn(X.Fang), 15732155720@163.com(M.Liu), luojinquan@mail.ccnu.edu.cn(J.Luo)

The code C satisfying Hull C ( ) = { -→ 0 } is called a linear complementary dual(LCD) code, which has been extensively investigated recently ([5, 6, 7, 24]). In [5], Carlet et al. investigated constructions of LCD codes utilizing cyclic codes, expanded Reed-Solomon codes and generalized residue codes, together with direct sum, puncturing, shortening, extension, ( u u | + v ) construction and suitable automorphism action. In [6] and [7], Carlet et al. showed that any linear code over F q ( q &gt; 3) is equivalent to a Euclidean LCD code and any linear code over F q 2 ( q &gt; 2) is equivalent to a Hermitian LCD code. In [24], Li et al. presented some LCD cyclic codes with very good parameters in general and a well-rounded treatment of reversible cyclic codes is also given. The linear code C satisfying Hull C ( ) = C (resp. C ⊥ ) is called self-orthogonal (resp. dual containing) code. In particular, the code C satisfying C = C ⊥ is called a self-dual code. Some MDS self-dual codes are constructed through various ways, see [10, 14, 19, 20, 29, 31, 32]. On the other hand, many classes of quantum MDS codes are constructed by MDS Hermitian self-orthogonal codes, see [8, 9, 15-18, 21, 26, 27, 33, 34].

In general, linear codes with assigned dimensions of hulls can be applied to construct entanglementassisted quantum error-correcting codes(EAQECCs). EAQECCs were firstly introduced in [3]. Wilde and Brun proposed a method for constructing EAQECCs by utilizing classical linear codes over finite fields [30]. However, it is not explicit to calculate the required number of entangled states. Recently, this number is related to the hull of classical linear code [13]. Thereafter, several new families of optimal EAQECCs are proposed by determining the hulls of classical linear codes, see [11, 13, 22, 23].

By using (extended) GRS codes, Luo et al. proposed several infinite families of MDS codes with hulls of arbitrary dimensions, which can be applied to construct some families of MDS EAQECCs with flexible parameters, see [22] and [23]. In [11], Fang et al. presented several MDS codes by utilizing (extended) GRS codes, and determined the dimensions of their Euclidean or Hermitian hulls. In particular, some of the associated EAQECCs have the required number of maximally entangled states. They also gave some new classes of MDS codes with Hermitian hulls of arbitrary dimensions.

Based on [11], [22] and [23], we propose a mechanism on the constructions of MDS codes with arbitrary dimensions of Euclidean hulls. After the main results, we give some examples.

The rest of this paper is organized as follows. In Section 2, we briefly recall some basic notations and properties of (extended) GRS codes. In Section 3, the mechanism on general constructions of MDS codes with Euclidean hulls of arbitrary dimensions is presented. We give several examples to illustrate the general construction mechanism in Section 4. Section 5 concludes the paper.

## 2 Preliminaries

In this section, we introduce some basic notations and useful results on (extended) GRS codes. Readers are referred to [25, Chapter 10] for more details.

Let F q be a finite field with q elements. Denote by F ∗ q = F q \{ 0 } . For 1 ≤ n ≤ q , choose two vectors -→ v = ( v , v 1 2 , . . . , v n ) ∈ ( F ∗ q ) n and -→ a = ( a , a 1 2 , . . . , a n ) ∈ F n q , where a i (1 ≤ i ≤ n ) are distinct. For an integer k with 1 ≤ k ≤ n , the GRS code of length n associated with -→ v and -→ a is defined as follows:

$$\text{GRS} _ { k } ( \overrightarrow { a }, \overrightarrow { v } ) = \{ ( v _ { 1 } f ( a _ { 1 } ), \dots, v _ { n } f ( a _ { n } ) ) \, \colon f ( x ) \in \mathbb { F } _ { q } [ x ], \deg ( f ( x ) ) \leq k - 1 \} \,.$$

A generator matrix of GRS k ( - -→ → a , v ) is

$$G _ { k } = \left ( \begin{array} { c c c c } v _ { 1 } & v _ { 2 } & \cdots & v _ { n } \\ v _ { 1 } a _ { 1 } & v _ { 2 } a _ { 2 } & \cdots & v _ { n } a _ { n } \\ v _ { 1 } a _ { 1 } ^ { 2 } & v _ { 2 } a _ { 2 } ^ { 2 } & \cdots & v _ { n } a _ { n } ^ { 2 } \\ \vdots & \vdots & \ddots & \vdots \\ v _ { 1 } a _ { 1 } ^ { k - 1 } & v _ { 2 } a _ { 2 } ^ { k - 1 } & \cdots & v _ { n } a _ { n } ^ { k - 1 } \end{array} \right ). \\ \} \right ) \, \text{is a $q$-ary $[n,k] MDS code and its dual is also MDS [25,\tau$}$$

The code GRS k ( - -→ → a , v ) is a q -ary [ n, k ] MDS code and its dual is also MDS [25, Chapter 11].

The extended GRS code associated with -→ v and -→ a is defined by:

$$\text{GRS} _ { k } ( \overrightarrow { a }, \overrightarrow { v }, \infty ) = \{ ( v _ { 1 } f ( a _ { 1 } ), \dots, v _ { n } f ( a _ { n } ), f _ { k - 1 } ) \, \colon f ( x ) \in \mathbb { F } _ { q } [ x ], \deg ( f ( x ) ) \leq k - 1 \}, \quad ( 2 )$$

where f k -1 is the coefficient of x k -1 in f ( x ). A generator matrix of GRS k ( - -→ → ∞ a , v , ) is

$$G _ { k, \infty } = \left ( \begin{array} { c c c c c c } v _ { 1 } & v _ { 2 } & \cdots & v _ { n } & 0 \\ v _ { 1 } a _ { 1 } & v _ { 2 } a _ { 2 } & \cdots & v _ { n } a _ { n } & 0 \\ v _ { 1 } a _ { 1 } ^ { 2 } & v _ { 2 } a _ { 2 } ^ { 2 } & \cdots & v _ { n } a _ { n } ^ { 2 } & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ v _ { 1 } a _ { 1 } ^ { k - 1 } & v _ { 2 } a _ { 2 } ^ { k - 1 } & \cdots & v _ { n } a _ { n } ^ { k - 1 } & 1 \end{array} \right ). \\ \vec { \gamma }, \, \vec { \nu }, \infty \right ) \, \text{is a $q$-ary $[n+1,k]$ MDS code and its dual is also MDS $[2$}$$

The code GRS k ( - -→ → ∞ a , v , ) is a q -ary [ n +1 , k ] MDS code and its dual is also MDS [25, Chapter 11].

For 1 ≤ i ≤ n , we define

/negationslash

$$u _ { i } \coloneqq \prod _ { 1 \leq j \leq n, j \neq i } ( a _ { i } - a _ { j } ) ^ { - 1 }. \\ \text{nouns some numbers of $\mathbb{F}$} \text{ } \text{Thos comb with in this}$$

Let QR q denote the set of nonzero square elements of F q . These symbols will be used frequently in this paper.

Lemma 2.1. ([4, Lemma 2]) A codeword -→ c = ( v f 1 ( a 1 ) , . . . , v n f ( a n )) ∈ Hull ( GRS k ( - -→ → a , v ) ) if and only if there exists a polynomial g x ( ) ∈ F q [ x ] with deg( g x ( )) ≤ n -k -1 , such that

$$( v _ { 1 } ^ { 2 } f ( a _ { 1 } ), v _ { 2 } ^ { 2 } f ( a _ { 2 } ), \dots, v _ { n } ^ { 2 } f ( a _ { n } ) ) = ( u _ { 1 } g ( a _ { 1 } ), u _ { 2 } g ( a _ { 2 } ), \dots, u _ { n } g ( a _ { n } ) ).$$

Lemma 2.2. ([4, Lemma 3]) A codeword -→ c = ( v f 1 ( a 1 ) , . . . , v n f ( a n ) , f k -1 ) ∈ Hull ( GRS k ( - -→ → ∞ a , v , ) ) if and only if there exists a polynomial g x ( ) ∈ F q [ x ] with deg( g x ( )) ≤ n -k , such that

$$( v _ { 1 } ^ { 2 } f ( a _ { 1 } ), v _ { 2 } ^ { 2 } f ( a _ { 2 } ), \dots, v _ { n } ^ { 2 } f ( a _ { n } ), f _ { k - 1 } ) = ( u _ { 1 } g ( a _ { 1 } ), u _ { 2 } g ( a _ { 2 } ), \dots, u _ { n } g ( a _ { n } ), - g _ { n - k } ).$$

Lemma 2.3. ([21, Lemma 5]) Let a , a 1 2 , · · · , a n be distinct elements in F q . Then we have

$$\sum _ { i = 1 } ^ { n } a _ { i } ^ { m } u _ { i } = \begin{cases} 0, \ 0 \leq m \leq n - 2 ; \\ 1, \ m = n - 1. \end{cases} \\ \text{ficient condition for CRS codes in} \sigma \text{ self} \,.$$

In Corollary 2.4 of [19], sufficient condition for GRS codes being self-dual is presented. In the following lemma, we show that the condition is also necessary. Furthermore, an equivalent condition for a GRS code being self-orthogonal is presented.

/negationslash

Lemma 2.4. If 1 ≤ m ≤ /floorleft n 2 /floorright , then GRS m ( - -→ → a , v ) is Euclidean self-orthogonal if and only if v 2 i = λ a ( i ) u i = 0(1 ≤ i ≤ n ) , where λ a ( i ) = λ 0 + λ a 1 i + · · · + λ n -2 m i a n -2 m with λ h ∈ F q (0 ≤ h ≤ n -2 m ) .

Proof. It is easy to check that

$$\text{GRS} _ { m } ( \overrightarrow { a }, \overrightarrow { v } ) \text{ is self-orthogonal} \Leftrightarrow \sum _ { i = 1 } ^ { n } v _ { i } ^ { 2 } a _ { i } ^ { l } = 0 \text{ for } 0 \leq l \leq 2 m - 2. \\ \text{ how we } - a ^ { 2 } / 1 < i < n \rangle \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{ } \text{                                                                                                                                                                                                        
\text{                                                                                                                                                                                                     
\end{cases}$$

Denote by x i = v 2 i (1 ≤ i ≤ n ). The system of linear equations

$$\sum _ { i = 1 } ^ { n } a _ { i } ^ { l } x _ { i } & = 0$$

for 0 ≤ l ≤ 2 m -2 has solutions

$$( u _ { 1 }, \dots, u _ { n } ), ( a _ { 1 } u _ { 1 }, \dots, a _ { n } u _ { n } ), \dots, ( a _ { 1 } ^ { n - 2 m } u _ { 1 }, \dots, a _ { n } ^ { n - 2 m } u _ { n } ),$$

which are linear independent. Note that the rank of coefficient matrix of (4) is 2 m -1. It follows that (5) is a basic solution system of (4). Therefore,

/negationslash

/negationslash

$$v _ { i } ^ { 2 } = \sum _ { h = 0 } ^ { n - 2 m } \lambda _ { h } a _ { i } ^ { h } u _ { i } \neq 0 \text{ for any } 1 \leq i \leq n \text{ and } \lambda _ { h } \in \mathbb { F } _ { q }. \\ \text{let } v _ { i } ^ { 2 } \, = \, \lambda ( a _ { i } ) u _ { i } \, \neq \, 0 ( 1 \, \leq \, i \, \leq \, n ) \text{ where } \lambda ( a _ { i } ) \, = \, \lambda _ { 0 } + \lambda _ { 1 } a _ { i } + \cdots + \lambda _ { n }$$

Conversely, let v 2 i = λ a ( i ) u i = 0(1 ≤ i ≤ n ) where λ a ( i ) = λ 0 + λ a 1 i + · · · + λ n -2 m i a n -2 m with λ h ∈ F q (0 ≤ h ≤ n -2 m ). Then

$$\sum _ { i = 1 } ^ { n } v _ { i } ^ { 2 } a _ { i } ^ { l } = 0 \text{ for } 0 \leq l \leq 2 m - 2. \\ \text{elision cell of or not } 0 \text{ }$$

It implies GRS m ( - -→ → a , v ) is Euclidean self-orthogonal.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.01173v3-figure-3b6ca9a0-4bd5-49cb-886b-49e7daa5a509.jpg)

Corollary 2.1. Assume 1 ≤ m ≤ /floorleft n 2 /floorright . Then GRS m ( - -→ → a , v ) ⊥ = GRS n -m ( - -→ → a , v ) if and only if there exists λ ∈ F ∗ q such that λu i = v 2 i , where 1 ≤ i ≤ n . In particular, when m = n 2 with n even, GRS n 2 ( - -→ → a , v ) is MDS self-dual (see Corollary 2.4 of [19]).

Similarly as GRS codes, Lemma 2 of [31] presents sufficient condition for extended GRS codes being self-dual. The following lemma shows that the condition is also necessary. More precisely, we give a criterion for an extended GRS code being self-orthogonal.

/negationslash

Lemma 2.5. If 1 ≤ m ≤ /floorleft n +1 2 /floorright , then GRS m ( - -→ → ∞ a , v , ) is Euclidean self-orthogonal if and only if v 2 i = λ a ( i ) u i = 0(1 ≤ i ≤ n ) , where λ a ( i ) = λ 0 + λ a 1 i + · · · + λ n -2 m i a n -2 m -a n -2 m +1 i with λ h ∈ F q (0 ≤ h ≤ n -2 m ) .

Proof. By taking inner product of all pairs in the basis of GRS m ( - -→ → ∞ a , v , ),

$$\cdots \nu ^ { - \nu } \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \dashrightarrow \, \cdots \nu ^ { - \nu } \, \cdots \nu ^ { - \nu } \, \cdots \nu ^ { - \nu } \, \cdots \nu ^ { - \nu } \, \cdots \nu ^ { - \nu } \, \cdots \\ \text{GRS} _ { m } ( \overrightarrow { u }, \overrightarrow { v }, \infty ) \, \text{is self-orthogonal} \, \Leftrightarrow \, \begin{cases} \sum _ { i = 1 } ^ { n } v _ { i } ^ { 2 } a _ { i } ^ { l } = 0, & 0 \leq l \leq 2 m - 3 ; \\ \sum _ { i = 1 } ^ { n } v _ { i } ^ { 2 } a _ { i } ^ { 2 m - 2 } + 1 = 0. \end{cases} \\ \text{Denote by } x _ { i } = v _ { i } ^ { 2 } ( 1 \leq i \leq n ). \, \text{If we only consider the system of equations } \sum _ { i = 1 } ^ { n } a _ { i } ^ { l } x _ { i } = 0 ( 0 \leq l \leq 2 m - 3 ),$$

Denote by x i = v 2 i (1 ≤ i ≤ n ). If we only consider the system of equations n ∑ i =1 a x l i i = 0(0 ≤ l ≤ 2 m -3), similarly as Lemma 2.4, the solution is

/negationslash

$$x _ { i } = \sum _ { h = 0 } ^ { n - 2 m + 1 } \lambda _ { h } a _ { i } ^ { h } u _ { i } \neq 0 \text{ for any } 1 \leq i \leq n \text{ and } \lambda _ { h } \in \mathbb { F } _ { q }.$$

Substituting (6) to n ∑ i =1 a 2 m -2 i x i +1 = 0,

$$\sum _ { i = 1 } ^ { n } \lambda _ { n - 2 m + 1 } a _ { i } ^ { n - 1 } u _ { i } + 1 = 0. \\ \dots \dots \ \tau \dots \ \alpha \, \partial \quad \pi \dots \ \dots \. 2 \quad \nu \,.$$

It deduces that λ n -2 m +1 = -1 from Lemma 2.3. Hence v 2 i = λ a ( i ) u i (1 ≤ i ≤ n ) where λ a ( i ) = λ 0 + λ a 1 i + · · · + λ n -2 m i a n -2 m -a n -2 m +1 i with λ h ∈ F q (0 ≤ h ≤ n -2 m ).

/negationslash

Conversely, let v 2 i = λ a ( i ) u i = 0 for any 1 ≤ i ≤ n and λ a ( i ) = λ 0 + λ a 1 i + · · · + λ n -2 m i a n -2 m -a n -2 m +1 i with λ h ∈ F q (0 ≤ h ≤ n -2 m ). Then

This completes the proof.

$$\begin{cases} \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \  \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \ \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \ \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \,\quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \,\ \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \quad \, \end{cases} \\ \vdots \, \end{cases}$$

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.01173v3-figure-e2d2abd2-b49b-4102-b934-652198c33a81.jpg)

Corollary 2.2. For 1 ≤ m ≤ /floorleft n +1 2 /floorright , the code GRS m ( - -→ → ∞ a , v , ) ⊥ = GRS n +1 -m ( - -→ → ∞ a , v , ) if and only if -u i = v 2 i for all i = 1 2 , , . . . , n . In particular, when n is odd and m = n +1 2 , GRS n +1 2 ( - -→ → a , v ) is MDS self-dual (see Lemma 2.2 of [31]).

## 3 Main Results

In this section, we present our constructions of MDS codes with Euclidean hulls of arbitrary dimensions utilizing (extended) GRS codes.

Firstly, we give the definition of almost self-dual code. It is a special case of self-orthogonal code.

Definition 1. Assume the length of the code C is odd. If C ⊆ C ⊥ and dim( C ⊥ ) = dim( C ) + 1 , we call C an almost self-dual code.

Now we construct MDS codes with Euclidean hulls of arbitrary dimensions via GRS codes.

Theorem 1. Assume 1 ≤ m ≤ /floorleft n 2 /floorright and q &gt; 3 . Suppose GRS m ( - -→ → a , v ) is self-orthogonal (i.e. GRS m ( - -→ → a , v ) ⊆ GRS m ( - -→ → a , v ) ⊥ ) with -→ a = ( a , a 1 2 , . . . , a n ) and -→ v = ( v , v 1 2 , . . . , v n ) . For any 0 ≤ l ≤ k ≤ m ≤ /floorleft n 2 /floorright , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .

Proof. From GRS m ( - -→ → ⊆ a , v ) GRS m ( - -→ → a , v ) ⊥ and Lemma 2.4,

/negationslash

$$v _ { i } ^ { 2 } = \lambda ( a _ { i } ) u _ { i } \neq 0 ( 1 \leq i \leq n ),$$

/negationslash where λ a ( i ) = λ 0 + λ a 1 i + . . . + λ n -2 m i a n -2 m with λ h ∈ F q (0 ≤ h ≤ n -2 m ). Denote by s := k -l , -→ a = ( a , a 1 2 , . . . , a n ) and -→ v ′ = ( αv , αv 1 2 , . . . , αv s , v s +1 , . . . , v n ), where α ∈ F ∗ q and α 2 = 1. For C = GRS k ( - -→ → a , v ′ ) and any

$$\overrightarrow { c } = ( \alpha v _ { 1 } f ( a _ { 1 } ), \dots, \alpha v _ { s } f ( a _ { s } ), v _ { s + 1 } f ( a _ { s + 1 } ), \dots, v _ { n } f ( a _ { n } ) ) \in H u l l ( C )$$

with deg( f ( x )) ≤ k -1, according to Lemma 2.1, there exists a polynomial g x ( ) ∈ F q [ x ] with deg( g x ( )) ≤ n -k -1 such that

$$( \alpha ^ { 2 } v _ { 1 } ^ { 2 } f ( a _ { 1 } ), \dots, \alpha ^ { 2 } v _ { s } ^ { 2 } f ( a _ { s } ), v _ { s + 1 } ^ { 2 } f ( a _ { s + 1 } ), \dots, v _ { n } ^ { 2 } f ( a _ { n } ) )$$

$$= ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ) ).$$

$$& ( \alpha ^ { 2 } v _ { 1 } ^ { 2 } f ( a _ { 1 } ), \dots, \alpha ^ { 2 } v _ { s } ^ { 2 } f ( a _ { s } ), v _ { s + 1 } ^ { 2 } f ( a _ { s + 1 } ), \dots, v _ { n } ^ { 2 } f ( a _ { n } ) ) \\ = & ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ) ).$$

Due to v 2 = λ a ( i ) u i (1 ≤ i ≤ n

$$\text{Due to } v _ { i } ^ { 2 } & = \lambda ( a _ { i } ) u _ { i } ( 1 \leq i \leq n ), \\ & \quad ( \alpha ^ { 2 } \lambda ( a _ { 1 } ) u _ { 1 } f ( a _ { 1 } ), \dots, \alpha ^ { 2 } \lambda ( a _ { s } ) u _ { s } f ( a _ { s } ), \lambda ( a _ { s + 1 } ) u _ { s + 1 } f ( a _ { s + 1 } ), \dots, \lambda ( a _ { n } ) u _ { n } f ( a _ { n } ) ) \\ & = & ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ) ).$$

When s + 1 ≤ i ≤ n , we get λ a ( i ) f ( a i ) = g a ( i ). Note that deg( λ x f ( ) ( x )) ≤ n -2 m + ( k -1) ≤ n -2 k + ( k -1) = n -k -1 and deg( g x ( )) ≤ n -k -1. It deduces that λ x f ( ) ( x ) = g x ( ) from n -s ≥ n -k . When 1 ≤ i ≤ s , it implies

$$\alpha ^ { 2 } \lambda ( a _ { i } ) u _ { i } f ( a _ { i } ) = u _ { i } g ( a _ { i } ) = u _ { i } \lambda ( a _ { i } ) f ( a _ { i } ).$$

/negationslash

We derive that f ( a i ) = 0 (1 ≤ i ≤ s ) by α 2 = 1 and λ a ( i ) u i = 0. So

/negationslash

$$f ( x ) = h ( x ) \prod _ { i = 1 } ^ { s } ( x - a _ { i } ), \\ \searrow \iota _ { 1 } \quad \iota _ { 2 } \quad \iota _ { 3 } \quad \iota _ { 4 } \quad \iota _ { 5 } \quad \iota _ { 6 } \quad \iota _ { 7 } \quad \iota _ { 8 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 } \quad \iota _ { 9 }$$

for some h x ( ) ∈ F q [ x ] with deg( h x ( )) ≤ k -1 -s . It follows that dim( Hull C ( )) ≤ k -s .

s

Conversely, put

f

(

x

) =

h x

(

)

(

x

-

a

i

), where h x

(

)

∈

F

q

[

x

]

and deg(

h x

(

))

≤

k

-

1

-

i

=1

) =

∏

λ x f

(

)

(

x

), which yields deg(

g x

(

))

≤

n

-

k

-

1.

Then

$$( \alpha ^ { 2 } \lambda ( a _ { 1 } ) u _ { 1 } f ( a _ { 1 } ), \dots, \alpha ^ { 2 } \lambda ( a _ { s } ) u _ { s } f ( a _ { s } ), \lambda ( a _ { s + 1 } ) u _ { s + 1 } f ( a _ { s + 1 } ), \dots, \lambda ( a _ { n } ) u _ { n } f ( a _ { n } ) )$$

$$= ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ) ).$$

According to Lemma 2.1,

$$( \alpha v _ { 1 } f ( a _ { 1 } ), \dots, \alpha v _ { s } f ( a _ { s } ), v _ { s + 1 } f ( a _ { s + 1 } ), \dots, v _ { n } f ( a _ { n } ) ) \in H u l l ( C ).$$

Therefore, dim( Hull C ( )) ≥ k -s .

As a result, dim( Hull C ( )) = k -s = . l

As a corollary, the following result can be deduced by choosing GRS m ( - -→ → a , v ) ⊥ = GRS n -m ( - -→ → a , v ).

Corollary 3.1. Assume 1 ≤ m ≤ /floorleft n 2 /floorright and q &gt; 3 . Suppose

$$\text{GRS} _ { m } ( \overrightarrow { a }, \overrightarrow { v } ) ^ { \perp } = \text{GRS} _ { n - m } ( \overrightarrow { a }, \overrightarrow { v } )$$

with -→ a = ( a , a 1 2 , . . . , a n ) and -→ v = ( v , v 1 2 , . . . , v n ) . For any 0 ≤ l ≤ k ≤ /floorleft n 2 /floorright , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .

Remark 3.1. Both Theorem 7 of [23] and Theorem 1(i) of [11] are special cases of Corollary 3.1.

The above result is on the constructions of MDS codes with Euclidean hulls of arbitrary dimensions utilizing GRS codes. Afterwards, we present constructions utilizing extended GRS codes.

Theorem 2. Assume 1 ≤ m ≤ /floorleft n +1 2 /floorright , q &gt; 3 and n &lt; q . Suppose GRS m ( - -→ → ∞ a , v , ) is self-orthogonal with -→ a = ( a , a 1 2 , . . . , a n ) and -→ v = ( v , v 1 2 , . . . , v n ) . For any 0 ≤ l ≤ k ≤ m ≤ /floorleft n +1 2 /floorright , there exists a q -ary [ n +1 , k ] MDS code C with dim( Hull C ( )) = l .

g x

(

s

.

Assume that

Proof. Since GRS m ( - -→ → ∞ a , v , ) is self-orthogonal and by Lemma 2.5,

/negationslash

$$v _ { i } ^ { 2 } = \lambda ( a _ { i } ) u _ { i } \neq 0 ( 1 \leq i \leq n ),$$

where λ a ( i ) = λ 0 + λ a 1 i + . . . + λ n -2 m i a n -2 m -a n -2 m +1 i with λ h ∈ F q (0 ≤ h ≤ n -2 m ). Put π x ( ) = ( x -b ) m k -with some b ∈ F q \{ a , . . . , a 1 n } . Denote by s := k -l . Choose

$$\overrightarrow { a } = ( a _ { 1 }, \dots, a _ { n } ) \text{ and } \overrightarrow { v } ^ { \prime } = ( \alpha v _ { 1 } \pi ( a _ { 1 } ), \alpha v _ { 2 } \pi ( a _ { 2 } ), \dots, \alpha v _ { s } \pi ( a _ { s } ), v _ { s + 1 } \pi ( a _ { s + 1 } ), \dots, v _ { n } \pi ( a _ { n } ) ),$$

/negationslash where α ∈ F ∗ q with α 2 = 1. Set C := GRS k ( - -→ → a , v ′ , ∞ ). For any

$$\overrightarrow { c } = ( \alpha v _ { 1 } \pi ( a _ { 1 } ) f ( a _ { 1 } ), \dots, \alpha v _ { s } \pi ( a _ { s } ) f ( a _ { s } ), v _ { s + 1 } \pi ( a _ { s + 1 } ) f ( a _ { s + 1 } ), \dots, v _ { n } \pi ( a _ { n } ) f ( a _ { n } ), f _ { k - 1 } ) \in H u l l ( C )$$

with deg( f ( x )) ≤ k -1, by Lemma 2.2, there exists a polynomial g x ( ) ∈ F q [ x ] with deg( g x ( )) ≤ n -k such that

$$( \alpha ^ { 2 } v _ { 1 } ^ { 2 } \pi ^ { 2 } ( a _ { 1 } ) f ( a _ { 1 } ), \dots, \alpha ^ { 2 } v _ { s } ^ { 2 } \pi ^ { 2 } ( a _ { s } ) f ( a _ { s } ), v _ { s + 1 } ^ { 2 } \pi ^ { 2 } ( a _ { s + 1 } ) f ( a _ { s + 1 } ), \dots, v _ { n } ^ { 2 } \pi ^ { 2 } ( a _ { n } ) f ( a _ { n } ), f _ { k - 1 } )$$

$$& ( \alpha ^ { z } v _ { 1 } ^ { z } \pi ^ { z } ( a _ { 1 } ) f ( a _ { 1 } ), \dots, \alpha ^ { z } v _ { s } ^ { z } \pi ^ { z } ( a _ { s } ) f ( a _ { s } ), v _ { s + 1 } ^ { z } \pi ^ { z } ( a _ { s + 1 } ) f ( a _ { s + 1 } ), \dots, v _ { n } ^ { z } \pi ^ { z } ( a _ { n } ) f ( a _ { n } ) \\ = & ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ), - g _ { n - k } ).$$

From v 2 i = λ a ( i ) u i , we derive

$$& ( \alpha ^ { 2 } \lambda ( a _ { 1 } ) u _ { 1 } \pi ^ { 2 } ( a _ { 1 } ) f ( a _ { 1 } ), \dots, \alpha ^ { 2 } \lambda ( a _ { s } ) u _ { s } \pi ^ { 2 } ( a _ { s } ) f ( a _ { s } ), \lambda ( a _ { s + 1 } ) u _ { s + 1 } \pi ^ { 2 } ( a _ { s + 1 } ) f ( a _ { s + 1 } ), \dots, \\ & \lambda ( a _ { n } ) u _ { n } \pi ^ { 2 } ( a _ { n } ) f ( a _ { n } ), f _ { k - 1 } ) = ( u _ { 1 } g ( a _ { 1 } ), \dots, u _ { s } g ( a _ { s } ), u _ { s + 1 } g ( a _ { s + 1 } ), \dots, u _ { n } g ( a _ { n } ), - g _ { n - k } ).$$

We claim that λ x π ( ) 2 ( x f ) ( x ) = g x ( ) in the following:

- · Case 1: -f k -1 = g n -k = 0. It follows from (8) that λ a ( i ) π 2 ( a i ) f ( a i ) = g a ( i ) for s +1 ≤ i ≤ n . Note that deg( λ x π ( ) 2 ( x f ) ( x )) ≤ n -2 m +1+2 m -2 k + k -2 = n -k -1 and deg( g x ( )) ≤ n -k -1. From n -s ≥ n -k , it follows that λ x π ( ) 2 ( x f ) ( x ) = g x ( ).

/negationslash

- · Case 2: -f k -1 = g n -k = 0. In this case, deg( λ x π ( ) 2 ( x f ) ( x )) = n -2 m +1+2 m -2 k + k -1 = n -k and deg( g x ( )) = n -k . Then deg( λ x π ( ) 2 ( x f ) ( x ) -g x ( )) ≤ n -k -1. From (8), λ a ( i ) π 2 ( a i ) f ( a i ) = g a ( i ) for s +1 ≤ i ≤ n . Since n -s ≥ n -k , then λ x π ( ) 2 ( x f ) ( x ) = g x ( ).

Comparing the beginning s coordinates on both sides of (8),

$$\alpha ^ { 2 } \lambda ( a _ { i } ) u _ { i } \pi ^ { 2 } ( a _ { i } ) f ( a _ { i } ) = u _ { i } g ( a _ { i } ) = u _ { i } \lambda ( a _ { i } ) \pi ^ { 2 } ( a _ { i } ) f ( a _ { i } ).$$

/negationslash

We derive that f ( a i ) = 0 (1 ≤ i ≤ s ) by α 2 = 1 and λ a ( i ) u π a i ( i ) = 0. So

/negationslash

$$f ( x ) = h ( x ) \prod _ { i = 1 } ^ { s } ( x - a _ { i } ), \\ \searrow \cdots \quad \sim \quad \left ( \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \int _ { i } \end{array}$$

for some h x ( ) ∈ F q [ x ] with deg( h x ( )) ≤ k -s -1. It follows that dim( Hull C ( )) ≤ k -s .

Conversely, set f ( x ) = h x ( ) s ∏ i =1 ( x -a i ), where h x ( ) ∈ F q [ x ] and deg( h x ( )) ≤ k -1 -s . Assume that g x ( ) = λ x π ( ) 2 ( x f ) ( x ), which implies deg( g x ( )) ≤ n -k . Then

( α λ a 2 ( 1 ) u π 1 2 ( a 1 ) f ( a 1 ) , . . . , α 2 λ a ( s ) u π s 2 ( a s ) f ( a s ) , λ ( a s +1 ) u s +1 π 2 ( a s +1 ) f ( a s +1 ) , . . . ,

λ a ( n ) u π n 2 ( a n ) f ( a n ) , f k -1 ) = ( u g a 1 ( 1 ) , . . . , u s g a ( s ) , u s +1 g a ( s +1 ) , . . . , u n g a ( n ) , -g n -k ) .

According to Lemma 2.2,

( αv π a 1 ( 1 ) f ( a 1 ) , . . . , αv s π a ( s ) f ( a s ) , v s +1 π a ( s +1 ) f ( a s +1 ) , . . . , v n π a ( n ) f ( a n ) , f k -1 ) ∈ Hull C ( ).

Therefore, dim( Hull C ( )) ≥ k -s .

Consequently, dim( Hull C ( )) = k -s = . l

As a corollary of this theorem, the following result can be derived directly by choosing self-dual code GRS n +1 2 ( - -→ → ∞ a , v , ) with n odd (self-dual code GRS n 2 ( - -→ → a , v ) with n even, respectively).

Corollary 3.2. (i). Assume n is odd, q &gt; 3 and n &lt; q . Suppose GRS n +1 2 ( - -→ → ∞ a , v , ) is self-dual with -→ a = ( a , a 1 2 , . . . , a n ) and -→ v = ( v , v 1 2 , . . . , v n ) . For any 0 ≤ l ≤ k ≤ n +1 2 , there exists a q -ary [ n +1 , k ] MDS code C with dim( Hull C ( )) = l .

(ii). Assume n is even and q &gt; 3 . Let GRS n 2 ( - -→ → a , v ) be self-dual with -→ a = ( a , a 1 2 , . . . , a n ) and -→ v = ( v , v 1 2 , . . . , v n ) . For any 1 ≤ k ≤ n 2 and 0 ≤ l ≤ k -1 , there exists a q -ary [ n +1 , k ] MDS code C with dim( Hull C ( )) = l .

Remark 3.2. As special cases of this result, Theorem 1(ii),(iii) and Theorem 2 of [11] can be deduced directly from Corollary 3.2.

The remaining case q = 3 can be depicted explicitly.

Remark 3.3. (i). The 3 -ary [2 , 1 2] , MDS code C with generator matrix where v , v 1 2 ∈ F ∗ 3 , has dim( Hull C ( )) = 0 .

$$G _ { 1 } = ( \ v _ { 1 } \ \ v _ { 2 } \ ) \\.$$

(ii). The 3 -ary [3 , 1 3] , MDS code C with generator matrix

$$& G ^ { \prime } _ { 1 } = ( \ v _ { 1 } \ \ v _ { 2 } \ \ v _ { 3 } \ ) \\ ^ { \prime } ) ) = 1.$$

where v , v 1 2 , v 3 ∈ F ∗ 3 , has dim( Hull C ( )) = 1 .

(iii). The 3 -ary [4 , 1 4] , MDS code C with generator matrix

$$G ^ { \prime \prime } _ { 1, \infty } = \left ( \ v _ { 1 } \ \ v _ { 2 } \ \ v _ { 3 } \ \ 1 \ \right ) \\ l l ( C ) \right ) = 0 \ a n d \ t h e \ 3 \text{-ary } [ 4, 2, 3 ] \ M D$$

where v , v 1 2 , v 3 ∈ F ∗ 3 , has dim( Hull C ( )) = 0 and the 3 -ary [4 , 2 3] , MDS code C with generator matrix

$$G _ { 2, \infty } ^ { \prime \prime } & = \left ( \begin{array} { c c c } v _ { 1 } & v _ { 2 } & v _ { 3 } & 0 \\ 0 & v _ { 2 } & - v _ { 3 } & 1 \end{array} \right ) \\ \nu \cdots \nu \cdots \neq \cdots \cdots \cdots \cdots \cdots \cdots$$

where v , v 1 2 , v 3 ∈ F ∗ 3 , has dim( Hull C ( )) = 2 . A straightforward calculation shows that there does not exist 3 -ary [4 , 2 3] , code C with dim( Hull C ( )) = 1 .

## 4 Examples

Each MDS self-orthogonal (extended) GRS code can be applied to construct MDS codes with arbitrary dimensions of hulls. In this section, applying Theorems 1 and 2, we give some concrete examples on (extended) GRS codes whose dimensions of hulls can be determined.

Example 4.1. Let q = r 2 , where r is an odd prime power. Suppose m | q -1 . For 1 ≤ t ≤ r +1 gcd( r +1 ,m ) , assume n = tm is even.

- (i). If q -1 m is even, then for any 1 ≤ k ≤ n 2 and 0 ≤ l ≤ k , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .
- (ii). If q -1 m is even, then for any 1 ≤ k ≤ n -1 2 and 0 ≤ l ≤ k -1 , there exists a q -ary [ n +1 , k ] MDS code C with dim( Hull C ( )) = l .
- (iii). For any 1 ≤ k ≤ n 2 and 0 ≤ l ≤ k , there exists a q -ary [ n + 1 , k ] MDS code C with dim( Hull C ( )) = l , except the case that t is even, m is even and r ≡ 1 (mod 4) .
- (iv). For any 1 ≤ k ≤ n +2 2 and 0 ≤ l ≤ k , there exists a q -ary [ n + 2 , k ] MDS code C with dim( Hull C ( )) = l , except the case that t is even, m is even and r ≡ 1 (mod 4) .

Proof. (i). Let α be a primitive m -th root of unity in F q and S = 〈 β 〉 be the cyclic group of order r +1. By the second fundamental theorem of group homomorphism,

$$S \Big / ( S \cap \langle \alpha \rangle ) \simeq ( S \times \langle \alpha \rangle ) \Big / \langle \alpha \rangle \leq \mathbb { F } _ { q } ^ { * } \Big / \langle \alpha \rangle. \\ e \, a \, \text{ set of cost representations of } ( S \times \langle \alpha \rangle ) \Big / \langle \alpha \rangle \text{ with } \{$$

/negationslash

Let B = { β µ 1 , . . . , β µ t } be a set of coset representatives of ( S ×〈 〉 α ) / 〈 α 〉 with 0 ≤ µ 1 &lt; · · · &lt; µ t &lt; r +1. Put µ = µ 1 + · · · + µ t and A = { αβ µ 1 , . . . , α m µ β 1 , αβ µ 2 , . . . , α m µ β 2 , . . . , αβ µ t , . . . , α m µ β t } . Denote by a c +( j -1) m := α β c µ j with 1 ≤ c ≤ m , 1 ≤ j ≤ t and -→ a = ( a , . . . , a 1 n ). Let i = c + ( j -1) m and λ = g r +1 2 · ( t -1) -mµ , where 1 ≤ i ≤ n and g is a generator of F ∗ q . Then by [12], we know λ · n ∏ z = i, z =1 ( a i -a z ) ∈

/negationslash

QR q . Set v 2 i = ( λ · n ∏ z = i, z =1 ( a i -a z ) ) -1 and -→ v = ( v , . . . , v 1 n ). Then GRS n 2 ( - -→ → a , v ) is MDS self-dual. According to Theorem 1, we complete the proof.

- (ii). With the same process of proof as (i) and Theorem 2, we can obtain the result.

/negationslash

/negationslash

- (iii). Similarly as (i), choose A = { αβ µ 1 , . . . , α m µ β 1 , αβ µ 2 , . . . , α m µ β 2 , . . . , αβ µ t , . . . , α m µ β t , 0 } . Denote by a c +( j -1) m := α β c µ j , a n +1 := 0 and -→ a = ( a , . . . , a 1 n , a n +1 ), where 1 ≤ c ≤ m and 1 ≤ j ≤ t . Let i = c + ( j -1) m (1 ≤ i ≤ n ). Then by [12], we have n +1 ∏ z = i, z =1 ( a i -a z ) ∈ QR q , for any 1 ≤ i ≤ n + 1, except the case that t is even, m is even and r ≡ 1 (mod4). Accordingly, for any 1 ≤ i ≤ n +1, we can set v 2 i = n ∏ z = i, z =1 ( a i -a z ) -1 and -→ v = ( v , . . . , v 1 n , v n +1 ). It follows that GRS n -1 2 ( - -→ → a , v ) is MDS almost self-dual. Due to Theorem 1, the result can be deduced.

/negationslash

- (iv). With the same process of proof as (iii), we let -→ a = ( a , . . . , a 1 n , a n +1 ) and -→ v = ( v , . . . , v 1 n , v n +1 ), where v 2 i = -n ∏ z = i, z =1 ( a i -a z ) -1 . Since GRS n +1 2 ( - -→ → ∞ a , v , ) is MDS self-dual and by Theorem 2, we obtain the result.

Remark 4.1. In (ii) and (iii), the length of the code is n +1 . However, they can not cover each other.

Example 4.2. Let q = r 2 , where r is an odd prime power. Suppose m | q -1 and 1 ≤ t ≤ r +1 2 gcd( r +1 ,m ) . Assume n = tm is odd.

- (i). For any 1 ≤ k ≤ n -1 2 and 0 ≤ l ≤ k , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .
- (ii). For any 1 ≤ k ≤ n +1 2 and 0 ≤ l ≤ k , there exists a q -ary [ n + 1 , k ] MDS code C with dim( Hull C ( )) = l .
- (iii). For any 1 ≤ k ≤ n +1 2 and 0 ≤ l ≤ k -1 , there exists a q -ary [ n + 2 , k ] MDS code C with dim( Hull C ( )) = l .

Proof. (i). Recall α and β in the proof of Example 4.1. Let B = { β µ 1 , . . . , β µ t } be a set of coset representatives of ( S × 〈 α 〉 ) / 〈 α 〉 with 0 ≤ µ 1 &lt; · · · &lt; µ t &lt; r + 1 and µ , . . . , µ 1 t are even. Denote by µ = µ 1 + · · · + µ t and A = { αβ µ 1 , . . . , α m µ β 1 , αβ µ 2 , . . . , α m µ β 2 , . . . , αβ µ t , . . . , α m µ β t } . Put a c +( j -1) m := α β c µ j with 1 ≤ c ≤ m , 1 ≤ j ≤ t and -→ a = ( a , . . . , a 1 n ). Let i = c +( j -1) m with 1 ≤ i ≤ n . Then by [12], we derive that

/negationslash

$$\prod _ { z \neq i, \ z = 1 } ^ { n } & ( a _ { i } - a _ { z } ) \in Q R _ { q }. \\ \mathring { z } = t.. \quad. \ \cdots \ \vdots \ \vdots + \cdots + \cdots + \cdots$$

/negationslash

Let v 2 i = n ∏ z = i, z =1 ( a i -a z ) -1 and -→ v = ( v , . . . , v 1 n ). It yields GRS n -1 2 ( - -→ → a , v ) is MDS almost self-dual. By Theorem 1, we finish the proof.

/negationslash

- (ii). With the same process as (i), let -→ a = ( a , . . . , a 1 n ) and we obtain n ∏ z = i, z =1 ( a i -a z ) ∈ QR q by [12].

/negationslash

Hence there exists v i ∈ F ∗ q so that v 2 i = -n ∏ z = i, z =1 ( a i -a z ) -1 . It is easy to see that GRS n +1 2 ( - -→ → ∞ a , v , ) is MDS self-dual. Then the result follows from Theorem 2.

$$( \text{iii} ). \text{ Choose } A = \{ \alpha \beta ^ { \mu _ { 1 } }, \dots, \alpha ^ { m } \beta ^ { \mu _ { 1 } }, \alpha \beta ^ { \mu _ { 2 } }, \dots, \alpha ^ { m } \beta ^ { \mu _ { 2 } }, \dots, \alpha \beta ^ { \mu _ { t } }, \dots, \alpha ^ { m } \beta ^ { \mu _ { t } }, 0 \}. \text{ Denote by}$$

$$\vec { a }$$

$$a _ { c + ( j - 1 ) m } \coloneqq \alpha ^ { c } \beta ^ { \mu _ { j } }, \, a _ { n + 1 } \coloneqq 0 \text{ and } \overrightarrow { a } = ( a _ { 1 }, \dots, a _ { n }, a _ { n + 1 } ),$$

/negationslash where 1 ≤ c ≤ m and 1 ≤ j ≤ t . Let i = c + ( j -1) m (1 ≤ i ≤ n ). Then by [12], we deduce that n +1 ∏ z = i, z =1 ( a i -a z ) ∈ QR q , for any 1 ≤ i ≤ n +1. Thus we let v 2 i = -n +1 ∏ z = i, z =1 ( a i -a z ) -1 (1 ≤ i ≤ n +1) and -→ v = ( v , . . . , v 1 n , v n +1 ). Then the result follows from that GRS n 2 ( - -→ → a , v ) is MDS self-dual and Theorem 2.

/negationslash

Example 4.3. Let q = p 2 s , where p is an odd prime and s is a positive integer. Assume that n = p 2 e with 1 ≤ e ≤ s .

- (i). For any 1 ≤ k ≤ n -1 2 and 0 ≤ l ≤ k , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .

(ii). For any 1 ≤ k ≤ n +1 2 and 0 ≤ l ≤ k , there exists a q -ary [ n + 1 , k ] MDS code C with dim( Hull C ( )) = l .

/negationslash

Proof. (i). Denote by r = p s . Let S = { α , α 1 2 , . . . , α p e } be an e -dimensional F p -linear subspace of F r with 1 ≤ e ≤ s . Choose β ∈ F q \ F r such that β r +1 = 1. Let α k,j = α β k + α j with 1 ≤ k, j ≤ p e . Denote by a k +( j -1) p e := α k,j and -→ a = ( a , . . . , a 1 n ). Let i = k 0 + ( j 0 -1) · p e with 1 ≤ i ≤ n . Then by [12], it follows that n ∏ z = i, z =1 ( a i -a z ) ∈ QR q . For any 1 ≤ i ≤ n , set v 2 i = n ∏ z = i, z =1 ( a i -a z ) -1 and -→ v = ( v , . . . , v 1 n ). It is easy to see that GRS n -1 2 ( - -→ → a , v ) is MDS almost self-dual. According to Theorem 1, we accomplish the proof.

/negationslash

/negationslash

/negationslash

(ii). With the same reason as (i), put -→ a = ( a , . . . , a 1 n ). We obtain n ∏ z = i, z =1 ( a i -a z ) ∈ QR q with 1 ≤ i ≤ n . Let v 2 i = -n ∏ z = i, z =1 ( a i -a z ) -1 and denote by -→ v = ( v , . . . , v 1 n ). We deduce that GRS n +1 2 ( - -→ → ∞ a , v , ) is MDS self-dual. According to Theorem 2, the result can be obtained.

From Theorem 6.1 in [32], when q ≡ 3 (mod 4) and n ≡ 2 (mod4), there does not exist self-dual code over F q with length n . However, self-orthogonal codes with q ≡ 3 (mod4) and n ≡ 2 (mod 4) may exist. So we can construct MDS codes with Euclidean hulls of assigned dimensions with q ≡ 3 (mod 4) and n ≡ 2 (mod4) by Theorem 1 in the following example.

Example 4.4. Let q ≡ 3 (mod4) be an odd prime power. Suppose odd t | q -1 and n = 2 t . For any 1 ≤ k ≤ n 2 -1 and 0 ≤ l ≤ k , there exists a q -ary [ n, k ] MDS code C with dim( Hull C ( )) = l .

/negationslash

Proof. Let α be a primitive t -th root of unity in F q . For any ω ∈ QR q , set

When 1 ≤ i ≤ t ,

$$\overrightarrow { a } = \left ( \alpha, \alpha ^ { 2 }, \dots, \alpha ^ { t }, \omega \alpha, \omega \alpha ^ { 2 }, \dots, \omega \alpha ^ { t } \right ).$$

/negationslash

$$u _ { i } = \prod _ { j = 1, j \neq i } ^ { t } ( \alpha ^ { i } - \alpha ^ { j } ) \cdot \prod _ { j = 1 } ^ { t } ( \alpha ^ { i } - \omega \alpha ^ { j } ) = t \alpha ^ { - i } \cdot ( 1 - \omega ^ { t } )$$

and

/negationslash

Choose λ x ( ) = t (1 -ω t ) x . For 1 ≤ i ≤ t ,

$$u _ { i + t } = \prod _ { j = 1, j \neq i } ^ { t } ( \omega \alpha ^ { i } - \omega \alpha ^ { j } ) \cdot \prod _ { j = 1 } ^ { t } ( \omega \alpha ^ { i } - \alpha ^ { j } ) = ( - \omega ^ { t - 1 } ) \cdot t \alpha ^ { - i } \cdot ( 1 - \omega ^ { t } ). \\ \text{se $\lambda(x)\,=t(1-\omega)^{t}\,x$. For $1<i<t$.}$$

$$\lambda ( \alpha ^ { i } ) u _ { i } = ( t \cdot ( 1 - \omega ^ { t } ) ) ^ { 2 } \in Q R _ { q }$$

and

$$\lambda ( \omega \alpha ^ { i } ) u _ { i + t } = ( - \omega ^ { t } ) \cdot ( t \cdot ( 1 - \omega ^ { t } ) ) ^ { 2 } \in Q R _ { q },$$

which follows from q ≡ 3 (mod 4) and t odd. By Lemma 2.4, there exists - ∈ → v F n q with nonzero entries such that GRS k ( - -→ → a , v ) is self-orthogonal. According to Theorem 1, we complete the proof.

## 5 Conclusion

Based on [11], [22] and [23], we propose a mechanism on the constructions of MDS codes with arbitrary dimensions of Euclidean hulls: if there exist self-orthogonal (extended) GRS codes, then we can construct (extended) GRS codes with arbitrary assigned dimensions of Euclidean hulls. In particular, MDS (almost) self-dual codes can be employed to construct such codes. In this sense, any known (extended) GRS (almost) self-dual code can be applied to find new (extended) GRS code with any dimension of hull. A more general question remains open: for an [ n, m ] MDS code C with dim ( Hull C ( )) = h , try to find [ n, k ] MDS code C ′ with any k ≤ m and any dim ( Hull C ( ′ )) = l ≤ min( h, k ). We invite readers to attack this open problem.

## Acknowledgements

The authors thank anonymous reviewers and editor for their suggestions and comments to improve the readability of this paper. This research is supported by National Natural Science Foundation of China

under Grant 11471008, Grant 11871025 and the self-determined research funds of CCNU from the colleges' basic research and operation of MOE(Grant No. CCNU18TS028).

## References

- [1] Assmus, E.F., Key, J.D.: Designs and Their Codes. Cambridge University Press, Cambridge Tracts in Mathematics 103 , Cambridge (1992)
- [2] Blaum, M., Roth, R.M.: On lowest density MDS codes. IEEE Trans. Inf. Theory, 45 (1), 46-59 (1999)
- [3] Brun, T., Devetak, I., Hsieh, M.H.: Correcting quantum errors with entanglement. Science, 314 436-439 (2006)
- [4] Chen, B., Liu, H.: New constructions of MDS codes with complementary duals. IEEE Trans. Inf. Theory, 64 (8), 5776-5782 (2018)
- [5] Carlet, C., Guilley, S.: Complementary dual codes for counter-measures to side-channel attacks. Coding Theory and Applications (CIM Series in Mathematical Sciences), E. R. Pinto Eds. Berlin, Germany: Springer Verlag, 3 97-105 (2014)
- [6] Carlet, C., Mesnager, S., Tang, C., Qi, Y.: Euclidean and Hermitian LCD MDS codes. Des. Codes Cryptogr., 86 (11), 2605-2618 (2018)
- [7] Carlet, C., Mesnager, S., Tang, C., Qi, Y., Pellikaan, R.: Linear codes over F q which are equivalent to LCD codes for q &gt; 3. IEEE Trans. Inf. Theory, 64 (4), 3010-3017 (2018)
- [8] Fang, W., Fu, F.: Two new classes of quantum MDS codes. Finite Fields and Their Appl., 53 , 85-98 (2018)
- [9] Fang, W., Fu, F.: Some new constructions of quantum MDS codes. IEEE Trans. Inf. Theory, DOI 10.1109/TIT.2019.2939114 (2019)
- [10] Fang, W., Fu, F.: New constructions of MDS Euclidean self-dual codes from GRS codes and extended GRS codes. IEEE Trans. Inf. Theory, 65 (9), 5574-5579 (2019)
- [11] Fang, W., Fu, F., Li, L., Zhu, S.: Euclidean and Hermitian hulls of MDS codes and their applications to EAQECCs. arXiv:1812.09019v3 [cs.IT] Jan. 2019

- [12] Fang, X., Lebed, K., Liu, H., Luo, J.: New MDS self-dual codes over finite fields of odd characteristic. arXiv:1811.02802v9 [cs.IT] Sep. 2019
- [13] Guenda, K., Jitman, S., Gulliver, T.A.: Constructions of good entanglement-assisted quantum error correcting codes. Des. Codes Cryptogr., 86 , 121-136 (2018)
- [14] Gulliver, T.A., Kim, J.L., Lee, Y.: New MDS or near-MDS self-dual codes. IEEE Trans. Inf. Theory, 54 (9), 4354-4360 (2008)
- [15] He, X., Xu, L., Chen, H.: New q -ary quantum MDS codes with distances bigger than q 2 . Quantum Inf. Process., 15 (7), 2745-2758 (2016)
- [16] Jin, L., Kan, H., Wen, J.: Quantum MDS codes with relatively large minimum distance from Hermitian self-orthogonal codes. Des. Codes Cryptogr., 84 (3), 463-471 (2017)
- [17] Jin, L., Ling, S., Luo, J., Xing, C.: Application of classical Hermitian self-orthogonal MDS codes to quantum MDS codes. IEEE Trans. Inf. Theory, 56 (9), 4735-4740 (2010)
- [18] Jin, L., Xing, C.: A construction of new quantum MDS codes. IEEE Trans. Inf. Theory, 60 (5), 2921-2925 (2014)
- [19] Jin, L., Xing, C.: New MDS self-dual codes from generalized Reed-Solomon codes. IEEE Trans. Inf. Theory, 63 (3), 1434-1438 (2017)
- [20] Lebed, K., Liu, H., Luo, J.: Construction of MDS self-dual codes over finite fields. Finite Fields and Their Appl., 59 , 199-207 (2019)
- [21] Li, Z., Xing, L., Wang, X.: Quantum generalized Reed-Solomon codes: unified framework for quantum MDS codes. Phys. Rev. A, 77 (1), 012308-1-012308-4 (2008)
- [22] Luo, G., Cao, X.: Two new families of entanglement-assisted quantum MDS codes from generalized Reed-Solomon codes. Quantum Inf. Process., 18: 89, https://doi.org/10.1007/s11128-019-2207-8 (2019)
- [23] Luo, G., Cao, X., Chen, X.: MDS codes with hulls of arbitrary dimensions and their quantum error correction. IEEE Trans. Inf. Theory, 65 (5), 2944-2952 (2019)
- [24] Li, C., Ding, C., Li, S.: LCD cyclic codes over finite fields. IEEE Trans. Inf. Theory, 63 (7), 4344-4356 (2017)

- [25] MacWilliams, F.J., Sloane, N.J.A.: The Theory of Error-Correcting Codes. The Netherlands: North Holland, Amsterdam (1977)
- [26] Shi, X., Yue, Q., Chang, Y.: Some quantum MDS codes with large minimum distance from generalized Reed-Solomon codes. Cryptogr. Commun., 10 (6), 1165-1182 (2018)
- [27] Shi, X., Yue, Q., Zhu, X.: Construction of some new quantum MDS codes. Finite Fields and Their Appl., 46 , 347-362 (2017)
- [28] Suh, C., Ramchandran, K.: Exact-repair MDS code construction using interference alignment. IEEE Trans. Inf. Theory, 57 (3), 1425-1442 (2011)
- [29] Tong, H., Wang, X.: New MDS Euclidean and Herimitian self-dual codes over finite fields. Advances in Pure Mathematics, 7 (5), 325-333 (2016)
- [30] Wilde, M.M., Brun, T.A.: Optimal entanglement formulas for entanglement-assisted quantum coding. Phys. Rev. A, 77 (6) (2008)
- [31] Yan, H.: A note on the construction of MDS self-dual codes. Cryptogr. Commun., 11 (2), 259-268 (2019)
- [32] Zhang, A., Feng, K.: An unified approach on constructing of MDS self-dual codes via Reed-Solomon codes. arXiv: 1905.06513v1 [cs.IT] May 2019
- [33] Zhang, G., Chen, B.: New quantum MDS codes. Int. J. Quantum Inf., 12 (4), 1450019-1-1450019-10 (2014)
- [34] Zhang, T., Ge, G.: Quantum MDS codes with large minimum distance. Des. Codes Cryptogr., 83 (3), 503-517 (2017)
Xiaolei Fang Meiqing Liu Jinquan Luo
On Euclidean Hulls of MDS Codes
In this paper, we propose a mechanism on the constructions of MDS codes with
arbitrary dimensions of Euclidean hulls. Precisely, we construct (extended)
generalized Reed-Solomon(GRS) codes with assigned dimensions of Euclidean hulls
from self-orthogonal GRS codes. It turns out that our constructions are more
general than previous works on Euclidean hulls of (extended) GRS codes.