# On the Hull-Variation Problem of Equivalent Linear Codes

Hao Chen Hao Chen is with the College of Information Science and
Technology/Cyber Security, Jinan University, Guangzhou, Guangdong Province,
510632, China<EMAIL_ADDRESS>The research of Hao Chen was supported by
NSFC Grant 62032009.

###### Abstract

The intersection ${\bf C}\bigcap{\bf C}^{\perp}$ (${\bf C}\bigcap{\bf
C}^{\perp_{h}}$) of a linear code ${\bf C}$ and its Euclidean dual ${\bf
C}^{\perp}$ (Hermitian dual ${\bf C}^{\perp_{h}}$) is called the Euclidean
(Hermitian) hull of this code. It is natural to consider the hull-variation
problem when a linear code ${\bf C}$ is transformed to an equivalent code
${\bf v}\cdot{\bf C}$. In this paper we introduce the maximal hull dimension
as an invariant of a linear code with respect to the equivalent
transformations. Then some basic properties of the maximal hull dimension are
studied. We prove that for a nonnegative integer $h$ satisfying $0\leq h\leq
n-1$, a linear $[2n,n]_{q}$ self-dual code is equivalent to a linear
$h$-dimension hull code. On the opposite direction we prove that a linear LCD
code over ${\bf F}_{2^{s}}$ satisfying $d\geq 2$ and $d^{\perp}\geq 2$ is
equivalent to a linear one-dimension hull code under a weak condition. Several
new families of LCD negacyclic codes and LCD BCH codes over ${\bf F}_{3}$ are
also constructed. Our method can be applied to the generalized Reed-Solomon
codes and the generalized twisted Reed-Solomon codes to construct arbitrary
dimension hull MDS codes. Some new entanglement-assisted quantum error-
correction (EAQEC) codes including MDS and almost MDS EAQEC codes are
constructed. Many EAQEC codes over small fields are constructed from optimal
Hermitian self-dual codes.

Index terms: Hull-variation problem, Maximal hull dimension, Self-dual code,
LCD code, Linear $h$-dimension hull code, EAQEC code,

##  1 Introduction

The Hamming weight $wt_{H}({\bf a})$ of a vector ${\bf a}\in{\bf F}_{q}^{n}$
is the number of non-zero coordinate positions. The Hamming distance
$d_{H}({\bf a},{\bf b})=wt_{H}({\bf a}-{\bf b})$ between two vectors ${\bf a}$
and ${\bf b}$ is the Hamming weight of ${\bf a}-{\bf b}$, that is, the number
of coordinate positions where ${\bf a}$ and ${\bf b}$ are different. The
Hamming distance of a code ${\bf C}\subset{\bf F}_{q}^{n}$,

$d_{H}({\bf C})=\min_{{\bf a}\neq{\bf b}}\\{d_{H}({\bf a},{\bf b}):{\bf
a}\in{\bf C},{\bf b}\in{\bf C}\\},$

is the minimum of Hamming distances $d_{H}({\bf a},{\bf b})$ between any two
different codewords in ${\bf C}$. The shortening code of ${\bf C}$ at the
$i$-th coordinate position is the subcode of ${\bf C}$ consisting of codewords
in ${\bf C}$ whose $i$-th coordinate is zero. The minimum Hamming distance of
a linear code is its minimum Hamming weight. For a linear $[n,k,d_{H}]_{q}$
code, the Singleton bound asserts $d_{H}\leq n-k+1$. When the equality holds,
this code is an MDS code. The main conjecture of MDS codes claims that the
length of an MDS code over ${\bf F}_{q}$ is at most $q+1$, except some trivial
exceptional cases. In [2] the main conjecture of MDS codes was proved for
codes over prime fields. We refer to [51, 40] for the theory of Hamming error-
correcting codes.

Two codes ${\bf C}_{1}$ and ${\bf C}_{2}$ in ${\bf F}_{q}^{n}$ are equivalent
if and only if ${\bf C}_{2}$ can be obtained from ${\bf C}_{1}$ by a
permutation of coordinates and the multiplication of a Hamming weight $n$
vector ${\bf v}=(v_{1},v_{2},\ldots,v_{n})\in{\bf F}_{q}^{n}$ on coordinates,
where $v_{i}\neq 0$ for $i=1,\ldots,n$. That is

${\bf C}_{2}=\\{{\bf c}=(c_{1},\ldots
c_{n}):(c_{1},\ldots,c_{n})=(v_{1}x_{1},\ldots,v_{n}x_{n}),{\bf x}\in
Perm({\bf C}_{1})\\},$

where $Perm({\bf C}_{1})$ is the code obtained from ${\bf C}_{1}$ by a
coordinate permutation. Equivalent codes have the same parameters.

The Euclidean inner product on ${\bf F}_{q}^{n}$ is defined by

$<{\bf x},{\bf y}>=\Sigma_{i=1}^{n}x_{i}y_{i},$

where ${\bf x}=(x_{1},\ldots,x_{n})$ and ${\bf y}=(y_{1},\ldots,y_{n})$. The
Euclidean dual of a linear code ${\bf C}\subset{\bf F}_{q}^{n}$ is

${\bf C}^{\perp}=\\{{\bf c}\in{\bf F}_{q}^{n}:<{\bf c},{\bf y}>=0,\forall{\bf
y}\in{\bf C}\\}.$

The Hermitian inner product on ${\bf F}_{q^{2}}^{n}$ is defined by

$<{\bf x},{\bf y}>_{h}=\Sigma_{i=1}^{n}x_{i}y_{i}^{q},$

where ${\bf x}=(x_{1},\ldots,x_{n})$ and ${\bf y}=(y_{1},\ldots,y_{n})$ are
two vectors in ${\bf F}_{q^{2}}^{n}$. The Hermitian dual of a linear code
${\bf C}\subset{\bf F}_{q^{2}}^{n}$ is

${\bf C}^{\perp_{h}}=\\{{\bf c}\in{\bf F}_{q^{2}}^{n}:<{\bf c},{\bf
y}>_{h}=0,\forall{\bf y}\in{\bf C}\\}.$

It is clear ${\bf C}^{\perp_{h}}=({\bf C}^{\perp})^{q}$, where

${\bf C}^{q}=\\{(c_{1}^{q},\ldots,c_{n}^{q}):(c_{1},\ldots,c_{n})\in{\bf
C}\\}.$

The minimum distance of the Euclidean dual is called the dual distance and is
denoted by $d^{\perp}$. The minimum distance of the Hermitian dual is the same
as $d^{\perp}$. A linear code ${\bf C}\subset{\bf F}_{q}^{n}$ is linear
complementary dual (LCD) code, if ${\bf C}\bigcap{\bf C}^{\perp}=\\{{\bf
0}\\}$, self dual if ${\bf C}={\bf C}^{\perp}$, and self-orthogonal if ${\bf
C}\subset{\bf C}^{\perp}$. Similarly a linear code ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$ is called linear complementary Hermitian dual (Hermitian LCD)
if ${\bf C}\bigcap{\bf C}^{\perp_{h}}=\\{{\bf 0}\\}$, Hermitian self-dual if
${\bf C}={\bf C}^{\perp_{h}}$ and Hermitian self-orthogonal if ${\bf
C}\subset{\bf C}^{\perp_{h}}$. In general the linear code ${\bf C}\bigcap{\bf
C}^{\perp}$ is called the Euclidean hull of the linear code ${\bf
C}\subset{\bf F}_{q}$. The intersection ${\bf C}\bigcap{\bf C}^{\perp_{h}}$ is
called the Hermitian hull of the linear code ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$. It is obvious that an LCD code ${\bf C}\subset{\bf F}_{q}$
leads to a Hermitian LCD code ${\bf F}_{q^{2}}\otimes{\bf C}$.

We refer to [27, 28] for earlier results on self-dual codes over small fields
and [40] Chapter 9 and [59] for the theory of small length Euclidean and
Hermitian self-dual code classification. There have been a long-time interest
in coding theory to construct self-dual, Hermitian self-dual MDS codes, for
example, see [34, 37, 43, 45, 39, 65, 67, 56, 77, 36]. Obviously equivalent
codes have different dual codes as follows. Let ${\bf v}$ be a Hamming weight
$n$ vector ${\bf v}=(v_{1},v_{2},\ldots,v_{n})\in{\bf F}_{q}^{n}$, set ${\bf
v}\cdot{\bf C}=\\{(v_{1}c_{1},\ldots,v_{n}c_{n}):\forall{\bf
c}=(c_{1},\ldots,c_{n})\in{\bf C}\\}$. Then

$({\bf v}\cdot{\bf C})^{\perp}={\bf v}^{-1}\cdot{\bf C}^{\perp},$

where ${\bf v}^{-1}=(v_{1}^{-1},\ldots,v_{n}^{-1}).$ For a linear code ${\bf
C}\subset{\bf F}_{q^{2}}^{n}$ and a Hamming weight $n$ vector ${\bf v}\in{\bf
F}_{q^{2}}^{n}$, then

$({\bf v}\cdot{\bf C})^{\perp_{h}}={\bf v}^{-q}\cdot{\bf C}^{\perp_{h}},$

where ${\bf v}^{-q}=(v_{1}^{-q},\ldots,v_{n}^{-q})$. Notice that weight
distributions and generalized Hamming weights, see [71], of two equivalent
linear codes are the same, dual codes are not the same. Hence the motivation
of this paper is to consider the following natural hull-variation problem.

Hull-variation problem. When a linear code ${\bf C}$ is transformed to an
equivalent linear code ${\bf v}\cdot{\bf C}$, how its Euclidean or Hermitian
hull is changed?

The first motivation to consider the hull-variation problem is Sendrier’s
algorithm in [61] to determine all permutation-equivalences between two linear
codes. From our main result Theorem 3.1 and Theorem 4.1, it is always possible
to get an equivalent one-dimension hull linear code from a $h\geq 1$ dimension
hull linear code, and it only needs a weak condition to get an equivalent one-
dimension hull linear code from an LCD code over ${\bf F}_{2^{s}}$. Thus it
seems that our results can help to determine the self permutation-equivalences
of a linear code.

The second motivation to consider the hull-variation problem is from the
construction of entanglement-assisted quantum codes. Quantum error correction
codes (QECCs) are necessary for quantum information processing and quantum
computation. The quantum error correction using classical error-correcting
codes was proposed in [63, 68] and then the stabilizer Calderbank-Shor-Steane
(CSS) construction of QECC was proposed in [12, 69]. We refer to [22, 23, 24,
1, 52, 41, 42, 3] for constructions of QECCs from classical codes. In [11, 30]
entanglement-assisted quantum error correction (EAQEC) codes were proposed and
studied. It was proved that EAQEC codes can be constructed from the stabilizer
CSS construction. Comparing to an QECC, an EAQEC code has one more parameter
$c$ measuring the consumption of $c$ pre-shared copies of maximally entangled
states. An EAQEC $[[n,k-h,d,n-k-h]]_{q}$ code can be obtained from a linear
$[n,k,d]_{q}$ code with the $h$-dimension Euclidean hull. Similarly from a
linear $[n,k,d]_{q^{2}}$ code ${\bf C}\subset{\bf F}_{q^{2}}^{n}$ with the
$h$-dimension Hermitian hull, an EAQEC $[[n,k-h,d,n-k-h]]_{q}$ code can be
constructed, see [11]. The quantum Singleton bound asserts

$2d+k\leq n+c+2$

for an EAQEC $[[n,k,d,c]]_{q}$ code when $d\leq\frac{n+2}{2}$, see [11, 35].
In the above construction of EAQEC codes, the dimension $h$ of the hull of a
linear code is a key parameter to determine the dimension and the consumption
parameter of an EAQEC code, since the other parameters of codes are preserved
when a linear code is transformed to an equivalent linear code. This is an
important motivation to construct equivalent linear codes with various hull
dimensions, see [49, 32, 29, 26, 13]. An EAQEC code attaining the quantum
Singleton bound is called an MDS EAQEC code. The construction of MDS EAQEC
code with large ranges of four parameters has been addressed in [49, 32, 65,
66, 75]. An EAQEC code satisfying $2d+k=n+c$ and $d\leq\frac{n+2}{2}$ is
called almost MDS. Some almost MDS EAQEC codes have been given in [58]. In our
paper [25] it was proved that any QECC constructed from a Hermitian self-
orthogonal code of the dimension $k$ can be transformed to $k$ different EAQEC
codes with the same $n,d$ and $k$ different $c$ parameters.

LCD codes were introduced in 1964 by Massey in [53] using the name reversible
codes, and in his 1992 paper [54] using the name linear complementary dual
codes. The existence of an asymptotically good sequence of LCD codes was
proved in [54]. Based on the fundamental result proved in [18], it seems
reasonable to ask if one-dimension hull is a strong constraint on a linear
code. It is also natural to ask what parameter $[n,k,d]_{q}$ can be attainable
by a linear code with $h$-dimension hull for large or small fixed $h$. For a
fixed positive integer $h$, is there an asymptotically good sequence of linear
codes with the $h$-dimension hulls? On the opposite direction we can ask for a
linear Euclidean self-dual $[2n,n]_{q}$ code or a linear Hermitian self-dual
$[2n,n]_{q^{2}}$ code, is there an equivalent $h<n$ dimension hull code?

LCD codes have applications in data storage, communication and cryptography,
see [53, 10, 14]. Cyclic LCD codes were studied in a paper [73] of Yang and
Massey published in 1994. Sendrier proved that LCD codes meets the Gilbert-
Varshamov bound in 2004. The application of LCD codes in resisting the side-
channel attack proposed in [10, 14] have stimulated a lot of constructions of
LCD codes from cyclic codes and constacyclic codes, see [46, 47, 74],
algebraic geometry codes, see [55], Reed-Solomon codes, twisted Reed-Solomon
codes, see [44, 49, 32, 21, 6, 76] and J-affine variety codes, see [33]. LCD
codes were counted in [17, 74] and $\sigma$-LCD codes were introduced in [16].
Linear complementary pairs from constacyclic codes were studied in [15].
Finally in [18] it was proved that an arbitrary linear $[n,k,d]_{q}$ code over
a finite field ${\bf F}_{q}$ satisfying $q>3$ is equivalent to an LCD code,
and an arbitrary linear $[n,k,d]_{q^{2}}$ code over a finite filed ${\bf
F}_{q^{2}}$, $q>2$, is equivalent to a Hermitian LCD code. A new approach of
constructing LCD codes by extending linear codes was also presented in [18].
This is quite different to the self-dual codes, where the fundamental Gleason
theorem is a strong restriction on weight distributions of self-dual codes,
see [40] Chapter 9 and [59]. It is still interesting to construct new LCD
binary and ternary codes after the publication of the paper [18]. The above
result in [18] means that the hull-decreasing variation to zero has no
obstruction, which can be considered as a special case of the hull-variation
problem. The hull-variation problem of equivalent linear codes proposed in
this paper is motivated from the paper [18]. Moreover the hull-increasing
variation of equivalent linear codes is considered in this paper. There were
several recent papers [49, 32, 58, 65, 66] about the construction of MDS
linear codes with $h$-dimension hulls and their applications in EAQEC codes.
Cyclic codes with one-dimension hulls or $h$-dimension hulls were studied in
[48, 31, 57]. Some MDS codes with arbitrary dimension hulls were constructed
in [66, 49, 29, 39, 75, 64] for some restricted lengths.

In this paper we propose to study the hull-variation problem and introduce the
maximal Euclidean (or Hermitian) hull dimension as an invariant of a linear
code with respect to equivalent transformations. Some basic properties of
maximal Euclidean (Hermitian) hull dimensions are presented. We prove that for
a nonnegative integer $h$ satisfying $0\leq h\leq n-1$, a linear $[2n,n]_{q}$
self-dual code is equivalent to a linear $h$-dimension hull code. On the
opposite direction we prove that a linear LCD code over ${\bf F}_{2^{s}}$
satisfying $d\geq 2$ and $d^{\perp}\geq 2$ is equivalent to a linear one-
dimension hull code under a weak condition. Many LCD codes satisfy this
condition. Then it follows that for any fixed nonnegative integer $h$, there
is an asymptotically good sequence of linear codes over ${\bf F}_{q}$ with the
$h$-dimension hulls, when $q\geq 64$ and $q\neq 125$, whose asymptotically
parameters exceeds the Gilbert-Varshomov bound. Our result directly implies
the existence of many new entanglement-assisted quantum error correction codes
with various parameters, some new MDS and new almost MDS entanglement-assisted
quantum error correction codes. Several families of LCD negacyclic codes over
${\bf F}_{q}$ and several new families of LCD cyclic codes over ${\bf F}_{q}$,
where $q$ is odd and in particular $q=3$, are constructed. Finally we show
that our method can be used to construct arbitrary dimension hull MDS codes
from the generalized Reed-Solomon codes and the generalized twisted Reed-
Solomon codes over ${\bf F}_{2^{s}}$. Therefore we show that the hull-
decreasing variation from self-dual codes has no obstruction and the hull-
increasing variation from the dimension zero to the dimension one has a small
obstruction. We also show that hull-increasing variations of Reed-Solomon
codes and some twisted Reed-Solomon codes over ${\bf F}_{2^{s}}$ have no
obstruction. It is an interesting problem to find the exact obstruction of the
hull-increasing variation of equivalent linear codes.

##  2 Maximal hull dimensions

From the view of the hull-variation problem of equivalent linear codes, we can
define the following maximal hull equivalent code.

Definition 2.1. Let ${\bf C}\subset{\bf F}_{q}^{n}$ (${\bf C}\subset{\bf
F}_{q^{2}}^{n}$) be a linear $[n,k]_{q}$ ($[n,k]_{q^{2}}$) code, let ${\bf v}$
be a Hamming weight $n$ vector ${\bf v}\in{\bf F}_{q}^{n}$ (${\bf v}\in{\bf
F}_{q^{2}}^{n}$) such that $\dim_{{\bf F}_{q}}(({\bf v}\cdot{\bf
C})\bigcap({\bf v}\cdot{\bf C})^{\perp})$ ($\dim_{{\bf F}_{q^{2}}}(({\bf
v}\cdot{\bf C})\bigcap({\bf v}\cdot{\bf C})^{\perp_{h}})$) is maximal. Then we
call ${\bf v}\cdot{\bf C}$ a maximal Euclidean (Hermitian) hull equivalent
code and the dimension $\dim_{{\bf F}_{q}}(({\bf v}\cdot{\bf C})\bigcap({\bf
v}\cdot{\bf V})^{\perp})$ ($\dim_{{\bf F}_{q^{2}}}(({\bf v}\cdot{\bf
C})\bigcap({\bf v}\cdot{\bf C})^{\perp_{h}})$) the maximal Euclidean
(Hermitian) hull dimension $\max_{Ehull}({\bf C})$ ($\max_{Hhull}({\bf C})$).

It is clear that the maximal Euclidean hull dimension (or the maximal
Hermitian hull dimension) is an invariant of a linear code in ${\bf
F}_{q}^{n}$ (or in ${\bf F}_{q^{2}}^{n}$) with respect to the equivalent
transformations. When the code is equivalent to a self-orthogonal code, its
maximal hull dimension is its own dimension. When ${\bf C}\subset{\bf
F}_{q}^{2n}$ is an even length linear $[2n,n]_{q}$ code with the weight
distribution $\\{A_{0},\ldots,A_{2n}\\}$ not satisfying the MacWilliams
equation of a self-dual code, see [40], Chapter 7, (7.3),

$\Sigma_{j=0}^{2n-v}\displaystyle{2n-j\choose
v}A_{j}=q^{n-v}\Sigma_{j=0}^{v}\displaystyle{2n-j\choose 2n-v}A_{j},$

for $0\leq v\leq 2n$, where $A_{i}$ is the number of weight $i$ codewords in
${\bf C}$, it is obvious that the maximal Euclidean hull dimension can not be
$n$, since ${\bf C}$ can not be equivalent to a self-dual code. From this
invariant we have the following natural question.

When the maximal Euclidean (or Hermitian) hull dimension of a Euclidean (or
Hermitian) LCD code is $0$, we call it a rigid LCD code.

Maximal hull-variation problem. For a linear code ${\bf C}\subset{\bf
F}_{q}^{n}$ (or a linear code ${\bf C}\subset{\bf F}_{q^{2}}^{n}$), to find
the maximal Euclidean hull dimension $\max_{Ehull}({\bf C})$ (or the maximal
Hermitian hull dimension $\max_{Hhull}({\bf C})$).

The following two propositions are obvious.

Proposition 2.1. Let ${\bf C}\subset{\bf F}_{q}^{n}$ be a linear code then
$\max_{Ehull}({\bf C})\leq\dim({\bf C})$. Let ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$ be a linear code then $\max_{Hhull}({\bf C})\leq\dim({\bf
C})$. We have $\max_{Ehull}({\bf C})=\max_{Ehull}({\bf C}^{\perp})$ and
$\max_{Hhull}({\bf C})=\max_{Hhull}({\bf C}^{\perp_{h}})$. When ${\bf C}$ is
self-orthogonal then $\max_{Ehull}({\bf C})=\dim({\bf C})$ and
$\max_{Hhull}({\bf C})=\dim({\bf C})$.

Proposition 2.2. Let ${\bf C}\subset{\bf F}_{q}^{n}$ be a linear code of the
dimension $1$. Then $\max_{Ehull}({\bf C})=1$ when $d_{H}({\bf C})\geq 2$ and
$\max_{Ehull}({\bf C})=0$ when $d_{H}({\bf C})=1$. Let ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$ be a linear code of dimension $1$. Then $\max_{Hhull}({\bf
C})=1$ when $d_{H}({\bf C})\geq 2$ and $\max_{Hhull}({\bf C})=0$ when
$d_{H}({\bf C})=1$.

Then a dimension one linear LCD code is rigid if and only if its minimum
Hamming distance is $1$.

Let ${\bf C}_{1}\star{\bf C}_{2}$ be the componentwise product of two linear
codes ${\bf C}_{1}$ and ${\bf C}_{2}$ in ${\bf F}_{q}^{n}$. It is the linear
span in ${\bf F}_{q}^{n}$ of all vectors of the form
$(c_{1}c_{1}^{\prime},\ldots,c_{n}c_{n}^{\prime})$ where ${\bf
c}=(c_{1},\ldots,c_{n})\in{\bf C}_{1}$ and ${\bf
c}^{\prime}=(c_{1}^{\prime},\ldots,c_{n}^{\prime})\in{\bf C}_{2}$. This kind
of linear code was studied in [60] and played an important role in secure
multiparty computation, see [20]. When ${\bf C}_{1}={\bf C}_{2}$, this is
called the Schur square of this linear code. It is clear that the dimension of
the Schur square of a linear code is an invariant with respect to code
equivalence transformations. The dimension of the Schur square of a Reed-
Solomon code $RS(n,k)$ is $2k-1$, see [7] and references there in.

Theorem 2.1. Let $q=2^{s}$ be an even prime power and ${\bf C}\subset{\bf
F}_{q}^{n}$ be a linear $[n,k]_{q}$ code with its dimension
$k\leq\frac{n}{2}$. Let ${\bf C}_{1}\subset{\bf C}$ be a linear subcode of the
dimension $k_{1}$. If there is a Hamming weight $n$ vector in the dual of the
Schur square ${\bf C}_{1}\star{\bf C}_{1}$ of this linear subcode, then
$\max_{Ehull}({\bf C})\geq k_{1}$. Let $q$ be an arbitrary prime power and
${\bf C}\subset{\bf F}_{q^{2}}^{n}$ be a linear $[n,k]_{q^{2}}$ code. Let
${\bf C}_{1}\subset{\bf C}$ be a linear subcode of the dimension $k_{1}$. If
there is a Hamming weight $n$ vector in the subfield subcode $({\bf
C}_{1}\star{\bf C}_{1}^{q})^{\perp}\bigcap{\bf F}_{q}^{n}$ of the dual of the
componentwise product of ${\bf C}_{1}$ and ${\bf C}_{1}^{q}$, then
$\max_{Hhull}({\bf C})\geq k_{1}$.

Proof. We need to find $n$ nonzero elements $v_{1},\ldots,v_{n}$ such that
$c_{1}c_{1}^{\prime}v_{1}^{2}+\cdots+c_{n}c_{n}^{\prime}v_{n}^{2}=0$ for any
two codewords ${\bf c}=(c_{1},\ldots,c_{n})\in{\bf C}$ and ${\bf
c}^{\prime}=(c_{1},\ldots,c_{n}^{\prime})\in{\bf C}_{1}$. When $q=2^{s}$ is an
even prime power, then $v_{1}^{2},\ldots,v_{n}^{2}$ can be arbitrary nonzero
elements in ${\bf F}_{2^{s}}$, since each element in ${\bf F}_{2^{s}}$ is a
square. The conclusion follows directly. The conclusion for the maximal
Hermitian hull dimension can be proved similarly.

Let ${\bf C}=\\{({\bf x},{\bf x}):{\bf x}\in{\bf F}_{q}^{n}\\}$ be a linear
$[2n,n]_{q}$ code, where $q$ is an even prime power. It is clear that ${\bf
C}\star{\bf C}={\bf C}$, whose dual contains a Hamming weight $n$ codeword
since $-1=1$ is a square in ${\bf F}_{q}$, since $q$ is even. Then
$\max_{EHull}({\bf C})=n$. Similarly for the above code over ${\bf
F}_{q^{2}}$. ${\bf C}\star{\bf C}^{q}={\bf C}$, then $\max_{Hhull}({\bf
C})=n$. When ${\bf C}$ is a Reed-Solomon $[n,k]_{2^{s}}$ code with the
dimension $k<\frac{n}{2}$, then ${\bf C}\star{\bf C}$ is a Reed-Solomon
$[n,2k-1]_{2^{s}}$ code. From Theorem 2.1 $\max_{Ehull}({\bf C})=k$. This can
be generalized to algebraic-geometric codes as follows.

Let ${\bf X}$ be an absolutely irreducible, smooth genus $g$ curve defined
over ${\bf F}_{q}$. Let ${\bf P}=\\{P_{1},\ldots,P_{n}\\}$ be $n$ distinct
rational points of ${\bf X}$ over ${\bf F}_{q}$. Let ${\bf G}$ be a rational
effective divisor over ${\bf F}_{q}$ of degree $\deg({\bf G})$ satisfying
$2g-2<\deg({\bf G})<n$ and

$support({\bf G})\bigcap{\bf P}=\emptyset.$

Let ${\bf L}({\bf G})$ be the function space associated with the divisor ${\bf
G}$. The algebraic-geometric code associated with ${\bf G}$, ${\bf
P}=\\{P_{1},\ldots,P_{n}\\}$ is defined by

${\bf C}({\bf P},{\bf G},{\bf X})={\bf C}(P_{1},\ldots,P_{n},{\bf G},{\bf
X})=\\{(f(P_{1}),\ldots,f(P_{n})):f\in{\bf L}({\bf G})\\}.$

The dimension of this code is

$k=\deg({\bf G})-g+1$

follows from the Riemann-Roch Theorem. The minimum Hamming distance is

$d_{H}\geq n-\deg({\bf G}).$

Let ${\bf G}=\Sigma m_{i}Q_{i}$, $m_{i}\geq 0$ be an effective divisor, if
${\bf G}_{1}=\Sigma m_{i}^{\prime}Q_{i}$ is another effective divisor
satisfying $m_{i}^{\prime}\leq m_{i}$ we say ${\bf G}_{1}\leq{\bf G}$. It is
obvious that

${\bf C}(P_{1},\ldots,P_{n},{\bf G}_{1},{\bf X})\subset{\bf
C}(P_{1},\ldots,P_{n},{\bf G},{\bf X})$

is a linear subcode. The Reed-Solomon codes are just the algebraic-geometric
codes over the genus $0$ curve. One achievement of the theory of algebraic-
geometric codes is the sequence of algebraic-geometric codes over ${\bf
F}_{q^{2}}$ satisfying the Tsfasman-Vládut-Zink bound

$R+\delta\geq 1-\frac{1}{q-1},$

which is exceeding the Gilbert-Varshamov bound when $q\geq 7$. We refer to
[40] Chapter 13 and [51] Chapter 10 for the detail.

Theorem 2.2. Let ${\bf C}(P_{1},\ldots,P_{n},{\bf G},{\bf X})$ be an
algebraic-geometric code defined over ${\bf F}_{2^{s}}$. Let ${\bf
G}_{1}\leq{\bf G}$ be an effective divisor satisfying

$2g-2<\deg({\bf G}_{1})\leq g-1+\lfloor\frac{n}{2}\rfloor.$

Then this algebraic-geometric code ${\bf C}(P_{1},\ldots,P_{n},{\bf G},{\bf
X})$ has its maximal Euclidean hull dimension at least $k_{1}=\dim({\bf
C}(P_{1},\ldots,P_{n},{\bf G}_{1},{\bf X})=\deg({\bf G}_{1})-g+1$.

Proof. Its Schur square is in the algebraic-geometric code ${\bf
C}(P_{1},\ldots,P_{n},\\\ 2{\bf G}_{1},{\bf X})$. The conclusion follows
immediately.

##  3 The hull-decreasing variation from self-dual or Hermitian self-dual
codes

Let ${\bf A}=(a_{ij})_{1\leq i,j\leq n}$ be an $n\times n$ matrix with entries
$a_{ij}\in{\bf F}_{q^{2}}$, then the conjugate matrix is
${\bf\bar{A}}=(a_{ij}^{q})_{1\leq i,j\leq n}$. The following result is well-
known, see [18].

Proposition 3.1. Let $({\bf I}_{n},{\bf P})$ be a generator matrix of a linear
self-dual $[2n,n]_{q}$ code ${\bf C}\subset{\bf F}_{q}^{n}$. Then ${\bf
P}\cdot{\bf P}^{\tau}=-{\bf I}_{n}$. Therefore ${\bf P}$ is a non-singular
$n\times n$ matrix. Let $({\bf I}_{n},{\bf A})$ be a generator matrix of a
linear Hermitian self-dual $[2n,n]_{q^{2}}$ code ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$. Then ${\bf A}\cdot{\bf\bar{A}}^{\tau}=-{\bf I}_{n}$.
Therefore ${\bf A}$ is a non-singular $n\times n$ matrix.

The main result of this Section is as follows.

Theorem 3.1. Let $q\geq 3$ be a prime power. Let $n$ be a positive integer and
$h$ be a nonnegative integer satisfying $0\leq h<n$. Let ${\bf C}\subset{\bf
F}_{q}^{n}$ be a linear self-dual $[2n,n]_{q}$ code. Then there is a Hamming
weight $n$ vector ${\bf v}\in{\bf F}_{q}$ such that the linear code ${\bf
v}\cdot{\bf C}$ has the $h$-dimension hull. Let ${\bf C}\subset{\bf
F}_{q^{2}}^{n}$ be a linear Hermitian self-dual $[2n,n]_{q^{2}}$ code. Then
there is a Hamming weight $n$ vector ${\bf v}\in{\bf F}_{q^{2}}$ such that the
linear code ${\bf v}\cdot{\bf C}$ has the $h$-dimension Hermitian hull.

Proof. We choose a generator matrix $({\bf I}_{n},{\bf P})$ of the linear
self-dual $[2n,n]_{q}$ code ${\bf C}\subset{\bf F}_{q}^{n}$. Set ${\bf
v}=(\lambda_{1},\ldots,\lambda_{n-h},1,\ldots,1)$, where
$\lambda_{1},\ldots,\lambda_{n-h}$ are $n-h$ nonzero elements in ${\bf F}_{q}$
such that all $\lambda_{1}^{2},\ldots,\lambda_{n-h}^{2}$ are not $1$. Then a
generator matrix of ${\bf v}\cdot{\bf C}$ is of the following form $({\bf
D_{\lambda}},{\bf P})$, where ${\bf D_{\lambda}}$ is a $n\times n$ diagonal
non-singular matrix of the following form.

$\left(\begin{array}[]{ccccccccccccc}\lambda_{1}&0&0&\cdots&\cdots&\cdots&\cdots&0\\\
0&\lambda_{2}&0&\cdots&\cdots&\cdots&\cdots&0\\\
\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\\
0&0&0&\cdots&\lambda_{n-h}&0&\cdots&0\\\ 0&0&0&\cdots&0&1&\cdots&0\\\
0&0&0&\cdots&0&0&\cdots&1\\\ \end{array}\right)$

The dual is ${\bf v}^{-1}\cdot{\bf C}$ with the generator matrix $({\bf
D_{\lambda}}^{-1},{\bf P})$. It is clear that the last $h$ rows of these two
generator matrices are the same. Thus the dimension of the hull $({\bf
v}\cdot{\bf C})\bigcap({\bf v}\cdot{\bf C})^{\perp}$ is at least $h$. Let
${\bf C}_{1}$ be the $n-h$ dimension subcode of ${\bf v}\cdot{\bf C}$
generated by the first $n-h$ rows of the above generator matrix. We now prove
that the dimension of the hull is exactly $h$. Otherwise the natural mapping

$({\bf v}\cdot{\bf C})\bigcap({\bf v}\cdot{\bf C})^{\perp}\longrightarrow({\bf
v}\cdot{\bf C})/{\bf C}_{1}$

is not injective and there is a nonzero ${\bf c}\in({\bf v}\cdot{\bf
C})\bigcap({\bf v}\cdot{\bf C})^{\perp}$ such that ${\bf c}\subset{\bf
C}_{1}$. Then we have a nonzero vector ${\bf x}\in{\bf F}_{q}^{n}$ such that
its last $h$ coordinates are zero and a nonzero vector in ${\bf y}\in{\bf
F}_{q}^{n}$, satisfying ${\bf x}\cdot({\bf D_{\lambda}},{\bf P})={\bf y}({\bf
D_{\lambda}}^{-1},{\bf P})$. From the reading of the first $n$ coordinates of
this codeword, the last $h$ coordinates of ${\bf y}$ are zero. Let ${\bf
P}^{\prime}$ be the $(n-h)\times n$ sub-matrix of ${\bf P}$ consisting of its
first $n-h$ rows. This is a rank $n-h$ matrix since ${\bf P}$ is nonsingular.
Then we have ${\bf x}\cdot{\bf P}^{\prime}={\bf y}\cdot{\bf P}^{\prime}$ from
the reading of the last $n$ coordinates of this codeword. Therefore ${\bf
x}={\bf y}$ since ${\bf P}^{\prime}$ is a full-rank matrix. From the reading
of the first $n-h$ coordinates, we have $\lambda_{i}^{2}=1$. This is a
contradiction. The conclusion about the Euclidean hull is proved. The
conclusion about the Hermitian hull can be proved similarly.

The similar result was proved in Theorem 7 of [50] from the physical
motivation of the entanglement-assisted quantum code.

There is a length $2n$ self-dual MDS generalized Reed-Solomon code over ${\bf
F}_{2^{s}}$ from the classical result in [34, 37]. Therefore from Theorem 3.1,
for any even length $2n\leq 2^{s}$, there is an equivalent $h$-dimension hull
$[2n,n]_{2^{s}}$ MDS code for a nonnegative integer $0\leq h<n$. When $q$ is
an odd prime power, self-dual MDS codes with the various lengths have been
constructed, see [43, 77, 65]. Therefore from Theorem 3.1, there are
equivalent arbitrary dimension hull MDS codes for all these self-dual MDS
codes presented in [43, 77, 65] and references therein. Some of them are new
comparing with the constructions in [49, 29]. For Hermitian self-dual codes,
only few small length Hermitian self-dual GRS codes have been constructed in
[56, 36]. From Theorem 3.1 there are equivalent arbitrary dimension Hermitian
hull GRS codes. On the other hand some self-dual MDS twisted Reed-Solomon
codes were constructed in [76]. From Theorem 3.1 arbitrary dimension hull
generalized twisted Reed-Solomon codes can be constructed. These arbitrary
dimension hull generalized twisted Reed-Solomon codes are new and can be
compared with codes constructed in Subsection 6.2.

For asymptotically good linear $h$-dimension codes, we have the following
result immediately from Theorem 3.1 and the main results in [4, 70].

Corollary 3.1. Let $q$ be a prime power satisfying $q\geq 64$ and $q\neq 125$,
and $h$ be a fixed non-negative integer. Then there is an asymptotically good
sequences of linear $h$-dimension hull codes exceeding the Gilbert-Varshamov
bound.

The above result is a generalization of previous results in [54, 18].

##  4 The hull-increasing variation from LCD codes

Set ${\bf v}=(\lambda,1,\ldots,1)\in{\bf F}_{q}^{n}$, $\lambda\in{\bf F}_{q}$
is a nonzero element. For a code ${\bf C}\subset{\bf F}_{q}^{n}$, we call the
code ${\bf v}\cdot{\bf C}$ the $\lambda$-disturbing code of ${\bf C}$. It is
clear that the dual of a $\lambda$-disturbing code of ${\bf C}$ is a
$\lambda^{-1}$-disturbing code of the dual ${\bf C}^{\perp}$. The Hermitian
dual of the $\lambda$-disturbing code of ${\bf C}$ is the
$\lambda^{-q}$-disturbing code of the Hermitian dual ${\bf C}^{\perp_{h}}$.

Theorem 4.1. Let $q$ be an even prime power satisfying $q\geq 4$. Let ${\bf
C}\subset{\bf F}_{q}^{n}$ be a linear LCD $[n,k,d]_{q}$ code with the minimum
Hamming distance $d\geq 2$ and its dual distance $d^{\perp}\geq 2$. Suppose
that the shortening codes of both ${\bf C}$ and ${\bf C}^{\perp}$ at one
coordinate position are LCD codes. Then there is a $\lambda$-disturbing code
of ${\bf C}$ which has the one-dimension Euclidean hull.

Proof. Let ${\bf C}\subset{\bf F}_{q}^{n}$ be an LCD code of the dimension
$k$. First of all we assume that the generator matrices of ${\bf C}$ and ${\bf
C}^{\perp}$ are of the following forms,

$\left(\begin{array}[]{cccccc}1&{\bf a}\\\ 0&{\bf G}_{1}\\\
\end{array}\right)$

where ${\bf a}\in{\bf F}_{q}^{n-1}$ and ${\bf G}_{1}$ is a $(k-1)\times(n-1)$
matrix over ${\bf F}_{q}$,

$\left(\begin{array}[]{cccccc}c&{\bf b}\\\ 0&{\bf G}_{2}\\\
\end{array}\right)$

where $c$ is a constant, ${\bf b}\in{\bf F}_{q}^{n-1}$ and ${\bf G}_{2}$ is a
$(n-k-1)\times(n-1)$ matrix over ${\bf F}_{q}$. Let ${\bf A}$ be the first row
of the above generator matrix of ${\bf C}$ and ${\bf B}$ be the first row of
the above generator matrix of ${\bf C}^{\perp}$. Let ${\bf a}\in{\bf
F}_{q}^{n-1}$ be the vector of the last $n-1$ coordinates of ${\bf A}$ and
${\bf b}\in{\bf F}_{q}^{n-1}$ be the vector of the last $n-1$ coordinates of
${\bf B}$. There is a linear subcode ${\bf C}_{2}\subset{\bf C}$ of the
dimension $k-1$ generated by the $(k-1)\times n$ matrix $({\bf 0},{\bf
G}_{1})$, and a linear subcode ${\bf C}_{3}\subset{\bf C}^{\perp}$ of the
dimension $n-k-1$ generated by the $(n-k-1)\times n$ matrix $({\bf 0},{\bf
G}_{2})$. These two codes are the shortening codes of ${\bf C}$ and ${\bf
C}^{\perp}$ at the first coordinate position. It is obvious that we have ${\bf
C}_{2}\subset{\bf C}$ and ${\bf C}_{3}\subset{\bf C}^{\perp}$. Thus ${\bf
C}_{2}\bigcap{\bf C}_{3}=\\{{\bf 0}\\}$ since ${\bf C}$ is an LCD code.

The constant $c$ is not zero since the the minimum Hamming distance of ${\bf
C}$ is at least $2$. It is easy to verify that the dual code of ${\bf C}_{2}$
is the code generated by ${\bf b}$ and ${\bf C}_{3}$, and the dual code of
${\bf C}_{3}$ is generated by ${\bf a}$ and ${\bf C}_{2}$. Since we assume
that both ${\bf C}_{2}$ and ${\bf C}_{3}$ are LCD codes, then $n-1$ vectors,
${\bf a}$, $k-1$ rows of the matrix ${\bf G}_{1}$, and $n-k-1$ rows of ${\bf
G}_{2}$ in ${\bf F}_{q}^{n-1}$ are linearly independent, since ${\bf
C}\bigcap{\bf C}_{3}={\bf 0}$. Similarly $n-1$ vectors, $k-1$ rows of the
matrix ${\bf G}_{1}$, ${\bf b}$ and the $n-k-1$ rows of ${\bf G}_{2}$ in ${\bf
F}_{q}^{n-1}$ are linearly independent, since ${\bf C}_{2}\bigcap{\bf
C}^{\perp}={\bf 0}$.

We will prove that there is a nonzero constant $\lambda\in{\bf F}_{q}$ such
that the $\lambda$-disturbing of ${\bf C}$ is a linear one-dimension hull
code. Set ${\bf C}_{1}={\bf v}\cdot{\bf C}$, then ${\bf C}_{1}^{\perp}={\bf
v}^{-1}\cdot{\bf C}^{\perp}$ is a $\lambda^{-1}$-disturbing code of the dual
${\bf C}^{\perp}$. It is clear that ${\bf C}_{2}$ is a subcode of ${\bf
C}_{1}$ and ${\bf C}_{3}$ is a subcode of ${\bf C}_{1}^{\perp}$. To prove the
conclusion of Theorem 4.1 we first prove the follow Lemma 4.1.

Lemma 4.1. For any nonzero constant $\lambda$, the dimension of the hull of
${\bf C}_{1}$ is at most $1$.

Proof. The natural linear mapping ${\bf C}_{1}\bigcap{\bf
C}_{1}^{\perp}\longrightarrow{\bf C}_{1}/{\bf C}_{2}\oplus{\bf
C}_{1}^{\perp}/{\bf C}_{3}$ is injective. Hence the dimension of the hull of
${\bf C}_{1}$ is at most $2$. On other hand if the dimension of the hull of
${\bf C}_{1}$ is $2$, the natural linear mapping ${\bf C}_{1}\bigcap{\bf
C}_{1}^{\perp}\longrightarrow{\bf C}_{1}/{\bf C}_{2}$ has a one-dimension
kernel. Then there exists a nonzero codeword ${\bf x}$ of ${\bf
C}_{2}\subset{\bf C}$ which is also in ${\bf C}_{1}^{\perp}$. Then ${\bf x}$
is in ${\bf C}^{\perp}$. This is a contradiction.

Now we need to prove that for a suitable $\lambda$, there is a nonzero vector
in the intersection ${\bf C}_{1}\bigcap{\bf C}_{1}^{\perp}$. The generator
matrix of ${\bf C}_{1}$ is of the following form,

$\left(\begin{array}[]{cccccc}\lambda&{\bf a}\\\ 0&{\bf G}_{1}\\\
\end{array}\right)$

and the generator matrix of ${\bf C}_{1}^{\perp}$ is of the following form,

$\left(\begin{array}[]{cccccc}\lambda^{-1}c&{\bf b}\\\ 0&{\bf G}_{2}\\\
\end{array}\right)$

Let ${\bf A}_{1}$ be the first row of the above generator matrix of ${\bf
C}_{1}$ and ${\bf B}_{1}$ be the first row of the above generator matrix of
${\bf C}_{1}^{\perp}$. Then we have

${\bf A}_{1}={\bf A}+(\lambda-1){\bf e},$

and

${\bf B}_{1}={\bf B}+c(\frac{1}{\lambda}-1){\bf e},$

where ${\bf e}=(1,0,\ldots,0)\in{\bf F}_{q}^{n}$. We need to find $u_{1}$ and
$u_{2}$ in ${\bf F}_{q}$ satisfying

$u_{1}{\bf A}_{1}+{\bf c}_{1}=u_{2}{\bf B}_{1}+{\bf c}_{2},$

where ${\bf c}_{1}\in{\bf C}_{2}$ and ${\bf c}_{2}\in{\bf C}_{2}$ and at least
one of $u_{1}$ and $u_{2}$ is not zero. Here the constant $c$ is not zero,
since $d\geq 2$ is assumed.

The code ${\bf C}$ is an LCD code then ${\bf C}\oplus{\bf C}^{\perp}={\bf
F}_{q}^{n}$. There exist $w_{1}$ and $w_{2}$ in ${\bf F}_{q}$, and ${\bf
c}_{1}^{\prime}\in{\bf C}_{2}$ and ${\bf c}_{2}^{\prime}\in{\bf C}_{3}$ such
that

${\bf e}=w_{1}{\bf A}+w_{2}{\bf B}+{\bf c}_{1}^{\prime}+{\bf c}_{2}^{\prime}.$

Therefore we have $w_{1}+w_{2}c=1$. If $w_{1}$ or $w_{2}$ is zero, we show
that the required nonzero codeword in ${\bf C}_{1}\bigcap{\bf C}_{1}^{\perp}$
can be found as follows. If $w_{2}=0$, then $w_{1}$ is not $1$, otherwise the
$n-1$ vectors in ${\bf F}_{q}^{n-1}$, ${\bf a}$, the $k-1$ rows of ${\bf
G}_{1}$, and $n-k-1$ rows of ${\bf G}_{2}$ are linear dependent. This is a
contradiction. Thus from the vector $(w_{1}-1,{\bf a})\in{\bf F}_{q}^{n}$ with
$w_{1}-1\neq 0$ the required nonzero codeword in ${\bf C}_{1}\bigcap{\bf
C}_{1}^{\perp}$ can be constructed by setting $\lambda=w_{1}-1$. Similarly if
$w_{1}=0$, then $w_{2}c\neq 1$, otherwise the $n-1$ vectors in ${\bf
F}_{q}^{n-1}$, the $k-1$ rows of ${\bf G}_{1}$, ${\bf b}$ and $n-k-1$ rows of
${\bf G}_{2}$ are linearly dependent. This is a contradiction. The required
nonzero codeword in ${\bf C}_{1}\bigcap{\bf C}_{1}^{\perp}$ can be constructed
by setting $\lambda^{-1}=w_{2}c-1$. Therefore from now on we assume $w_{1}\neq
0,1$, and $w_{2}c\neq 0,1$.

We need to find a $\lambda$ satisfying the following equation

$w_{1}(\lambda-1)+w_{2}c(\lambda^{-1}-1)=-1.$

Set $w_{2}c=s$, then $s$ and $1-s$ is not zero. The above equation is
equivalent to

$(s-1)\lambda^{2}=s.$

Since $q$ is an even prime power, then each nonzero element in ${\bf F}_{q}$
is a square. The conclusion is proved.

Notice that the requirement $d^{\perp}\geq 2$ and $d\geq 2$ can be verified
quickly. This is equivalent that in both the generator matrix and the parity
check matrix of this code, there is no zero column. Then from Theorem 4.1 some
constructed BCH LCD codes and MDS LCD codes over the finite field ${\bf
F}_{q}$ in [46, 47], where $q$ is even, can be transformed to equivalent one-
dimension hull codes by $\lambda$-disturbing codes.

##  5 Ternary LCD cyclic and negacyclic codes

After the fundamental results proved in [18] it is still interesting to
construct binary and ternary LCD codes. We refer to [33] on this topic. From
the view of the hull-variation problem of cyclic codes we construct some
ternary LCD cyclic and negacyclic codes from the previously constructed LCD
cyclic codes in [47, 46]. Though it was proved in [18] that any linear
$[n,k,d]_{q}$ code is equivalent to an LCD code when $q>3$, it is still
interesting to see what parameters can be realized by binary and ternary LCD
codes. It is also interesting to classify binary and ternary LCD BCH codes,
LCD cyclic and LCD negacyclic codes.

A code ${\bf C}\subset{\bf F}_{q}^{n}$ is called cyclic if
$(c_{0},c_{1},\ldots,c_{n-1})\in{\bf C}$, then $(c_{n-1},c_{0},\ldots,\\\
c_{n-2})\in{\bf C}$. A codeword ${\bf c}$ in a cyclic code is identified with
a polynomial ${\bf c}(x)=c_{0}+c_{1}x+\cdots+c_{n-1}x^{n-1}\in{\bf
F}_{q}[x]/(x^{n}-1)$. Every cyclic code is a principal ideal in the ring ${\bf
F}_{q}[x]/(x^{n}-1)$ and then generated by a factor of $x^{n}-1$. The code
with the generator polynomial ${\bf
g}(x)=g_{0}+g_{1}x+\cdots+g_{n-k}x^{n-k}\in{\bf F}_{q}[x]$ is denoted by ${\bf
C}_{{\bf g}}$. The dimension of the cyclic code ${\bf C}_{{\bf g}}$ generated
by ${\bf g}(x)$ is $n-\deg({\bf g}(x))=k$. One generator matrix of ${\bf
C}_{{\bf g}}$ is of the following form.

$\left(\begin{array}[]{cccccccccccccccccccccc}g_{0}&g_{1}&g_{2}&\cdots&\cdots&g_{n-k}&0&\cdots&\cdots&\cdots&\cdots&0\\\
0&g_{0}&g_{1}&g_{2}&\cdots&\cdots&g_{n-k}&0&\cdots&\cdots&\cdots&0\\\
\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\cdots&\cdots\\\
0&\cdots&\cdots&\cdots&0&g_{0}&g_{1}&g_{2}&0&0&\cdots&g_{n-k}\\\
\end{array}\right)$

The dual code of a cyclic code ${\bf C}_{{\bf g}}$ is a cyclic code with the
generator polynomial ${\bf g}^{\perp}=\frac{x^{k}{\bf h}(x^{-1})}{{\bf
h}(0)}$, where ${\bf h}(x)=\frac{x^{n}-1}{{\bf g}(x)}$. Therefore the root of
${\bf g}^{\perp}$ is of the form $\frac{1}{\beta}$ if $\beta$ is not a root of
${\bf g}(x)$, where $\beta$ is an $n$-th root of $1$ in some extension field
of ${\bf F}_{q}$, see [40] Chapter 4.

Let ${\bf F}_{q}$ be a finite field and $\lambda\in{\bf F}_{q}$ be a nonzero
constant. Then a linear code ${\bf C}\subset{\bf F}_{q}^{n}$ is called
$\lambda$-cyclic if $(c_{0},c_{1},\ldots,c_{n-1})\in{\bf C}$, then $(\lambda
c_{n-1},c_{0},\ldots,\\\ c_{n-2})\in{\bf C}$. A codeword ${\bf c}$ is
identified with a polynomial ${\bf
c}(x)=c_{0}+c_{1}x+\cdots+c_{n-1}x^{n-1}\in{\bf F}_{q}[x]/(x^{n}-\lambda)$.
Every $\lambda$-cyclic code is generated by a factor of $x^{n}-\lambda$. The
dimension of the $\lambda$-cyclic code ${\bf C}_{{\bf g}}$ generated by ${\bf
g}(x)=g_{0}+g_{1}x+\cdots+g_{n-k}x^{n-k}\in{\bf F}_{q}[x]$ is $n-\deg({\bf
g}(x))=k$. The dual of a $\lambda$-cyclic code is a $\lambda^{-1}$-cyclic code
generated by ${\bf g}^{\perp}=\frac{x^{k}{\bf h}(x^{-1})}{{\bf h}(0)}$, where
${\bf h}(x)=\frac{x^{n}-\lambda}{{\bf g}(x)}$. It is well- known that if
$\lambda^{2}\neq 1$, then a $\lambda$-cyclic code is LCD. When $q$ is an odd
prime power and $\lambda=-1$, a $(-1)$-cyclic code is called negacyclic.
Though many LCD cyclic BCH codes were constructed in [47, 46] and it was
proved that any linear $[n,k,d]_{q}$ code is equivalent to an LCD code when
$q>3$. No previous known family of ternary negacyclic LCD codes has been
constructed.

Let $q$ be a prime power, and $n$ be a positive integer satisfying
$\gcd(n,q)=1$. Let $m$ be the smallest positive integer such that $q^{m}\equiv
1$ $mod$ $n$. Let $\alpha$ be a primitive element of the extension field ${\bf
F}_{q^{m}}$. Then $\beta=\alpha^{\frac{q^{m}-1}{n}}$ is a primitive $n$-th
root of unity. Let ${\bf m}_{i}(x)$ be the minimal polynomial of $\beta^{i}$
over ${\bf F}_{q}$. For a given designed distance $\delta\geq 2$, we set

${\bf g}_{q,n,\delta,b}(x)=lcm({\bf m}_{b}(x),{\bf m}_{b+1}(x),\ldots,{\bf
m}_{b+\delta-2}(x)),$

where $lcm$ is the least common multiple of polynomials in ${\bf F}_{q}[x]$.
The cyclic code ${\bf C}_{q,n,\delta,b}$ generated by ${\bf
g}_{q,n,b,\delta}(x)$ is called Bose-Chaudhuri-Hocquenghem (BCH) code
introduced in [8, 9, 38]. It was proved in [8, 9, 38] the minimum Hamming
distance is larger than or equal to the designed distance. The BCH codes have
been studied for many years and served as basic examples of good linear error-
correcting codes. Parameters of many LCD BCH codes have been determined in
[47, 46]. From the following result, odd length cyclic codes over ${\bf
F}_{q}$, where $q$ is an odd prime power, in Theorem 13 of [46] can be
transformed to negacyclic codes immediately.

Theorem 5.1. Let $q$ be an odd prime power and ${\bf C}\subset{\bf F}_{q}^{n}$
be a cyclic LCD code with the odd length $n$. Suppose that ${\bf C}$ is
generated by a factor ${\bf g}(x)$ of $x^{n}-1$. Then we have a negacyclic LCD
code ${\bf C}^{\prime}$ generated by $g(-x)$.

Proof. Since ${\bf g}(x)$ is a factor of $x^{n}-1$, then ${\bf g}(-x)$ is a
factor of $(-x)^{n}-1=-(x^{n}+1)$. The dual of the negacyclic code ${\bf
C}_{{\bf g}(-x)}$ is generated by ${\bf g}^{\perp}(-x)$. Let ${\bf
v}=(1,-1,\ldots,-1,1)\in{\bf F}_{q}^{n}$ be a Hamming weight $n$ vector. It is
clear that ${\bf v}^{-1}={\bf v}$. Then the negacyclc code ${\bf C}_{{\bf
g}(-x)}$ generated by $g(-x)$ is just ${\bf v}\cdot{\bf C}$ and its dual is
${\bf v}^{-1}\cdot{\bf C}^{\perp}={\bf v}\cdot{\bf C}^{\perp}$. Since ${\bf
C}$ is an LCD code then ${\bf C}\bigcap{\bf C}^{\perp}=\\{{\bf 0}\\}$. Thus we
have

${\bf v}\cdot{\bf C}\bigcap{\bf v}\cdot{\bf C}^{\perp}={\bf v}\cdot{\bf
C}\bigcap({\bf v}\cdot{\bf C})^{\perp}=\\{{\bf 0}\\}.$

The conclusion is proved.

From the following Corollaries several families of new ternary LCD negacyclic
and LCD cyclic codes are constructed.

Corollary 5.1. Let $q$ be an odd prime power and $n$ be an odd positive
integer. For any odd positive integer $t$ satisfying $1\leq t\leq n-2$ we have
a negacyclic LCD code with the same parameters as the that of the BCH code
${\bf C}_{q,n,t+2,\frac{n-t}{2}}$.

Proof. The conclusion follows from Theorem 13 in [46].

From a similar argument we have the following result.

Corollary 5.2. Let $q$ be an odd prime power, $n$ be an even number, and ${\bf
C}\subset{\bf F}_{q}^{n}$ be a cyclic LCD code with the even length $n$.
Suppose that ${\bf C}$ is generated by a factor ${\bf g}(x)$ of $x^{n}-1$.
Then we have a cyclic LCD code ${\bf C}^{\prime}$ generated by $g(-x)$.

From Corollary 5.2 several families of constructed LCD BCH codes in [47] can
be transformed to new families of LCD BCH codes. For example when $q=3$ and
the length $n$ is even, if ${\bf C}_{q,n,\delta,b}$ is an LCD BCH code
constructed in [47], then ${\bf C}_{q,n,\delta,b+\frac{n}{2}}$ is also an LCD
BCH code.

The above variable transformation can be replaced by
$x\longrightarrow\eta\cdot x$, where $\eta\in{\bf F}_{q}$ is a nonzero element
satisfying $\eta^{n}=\pm 1$.

Proposition 5.1. If ${\bf C}\subset{\bf F}_{q}^{n}$ is a cyclic code generated
by degree $k$ polynomial ${\bf g}(x)$, and $\eta$ is an element in ${\bf
F}_{q}$ such that $\eta^{n}=1$. Set ${\bf
v}=(1,\eta,\eta^{2},\ldots,\eta^{n-1})$. Then ${\bf v}\cdot{\bf C}$ is an
equivalent cyclic code generated by ${\bf g}(\eta x)$. If $\eta^{n}=-1$, ${\bf
v}\cdot{\bf C}$ is a negacyclic code generated by ${\bf g}(\eta x)$. The dual
code of ${\bf v}\cdot{\bf C}$ is generated by

$\frac{(\eta x)^{k}{\bf h}(\eta^{-1}x^{-1})}{{\bf h}(0)},$

where ${\bf h}(x)=\frac{x^{n}-1}{{\bf g}(x)}$.

Proof. If $(c_{0},c_{1},\ldots,c_{n-2},c_{n-1})\in{\bf C}$, then
$(c_{n-1},\eta c_{1},\ldots,\eta^{n-1}c_{n-2})\in{\bf v}\cdot{\bf C}$. we need
to check if $(\eta^{n-1}c_{n-1},c_{0},\eta c_{1},\ldots,\eta^{n-2}c_{n-2})$ is
also in ${\bf v}\cdot{\bf C}$. It is obvious

$\eta\cdot(\eta^{n-1}c_{n-1},c_{0},\eta
c_{1},\ldots,\eta^{n-2}c_{n-2})=(c_{n-1},\eta
c_{0},\ldots,\eta^{n-1}c_{n-2}).$

The conclusion follows. The other conclusion can be proved similarly.

Then the hull-variation problem can be restricted to equivalent cyclic or
negacyclic codes. It is interesting to consider the hull-variation problem of
cyclic codes with respect to the equivalent transformations in Proposition
5.1.

##  6 Arbitrary dimension hull MDS codes

Let ${\bf C}_{1}$ be a linear $[n,k,d]_{q}$ code. If its dual (or Hermitian
dual) ${\bf C}_{1}^{\perp}$ is of the form ${\bf x}\cdot{\bf C}_{2}$, where
${\bf x}=(x_{1},\ldots,x_{n})$ is a Hamming weight $n$ vector in ${\bf
F}_{q}^{n}$ and both codes ${\bf C}_{1}$ and ${\bf C}_{2}$ are in the same
family of algebraic codes, then the dual of ${\bf v}\cdot{\bf C}_{1}$ is ${\bf
v}^{-1}\cdot{\bf x}\cdot{\bf C}_{2}$, where ${\bf
v}=(v_{1},\ldots,v_{n})\in{\bf F}_{q}^{n}$ is a Hamming weight $n$ vector. The
problem to determine the dimension of the hull $({\bf v}\cdot{\bf
C}_{1})\bigcap({\bf v}\cdot{\bf C}_{1})^{\perp}$ is equivalent to determine
the dimension of ${\bf C}_{1}\bigcap{\bf v}^{-2}\cdot{\bf x}\cdot{\bf C}_{2}$.
When $q$ is an even prime power, $v_{1}^{2},\ldots,v_{2}^{2}$ can be arbitrary
nonzero elements in ${\bf F}_{q}$. Then this is equivalent to determine the
dimension of ${\bf C}_{1}\bigcap{\bf u}\cdot{\bf C}_{2}$, where ${\bf
u}=(u_{1},\ldots,u_{n})$ is an arbitrary Hamming weight $n$ vector in ${\bf
F}_{q}^{n}$.

###  6.1 Generalized Reed-Solomon codes

The following result was frequently used in [41, 43, 29] to determine the dual
of the generalized Reed-Solomon codes, we refer to Theorem 5.3.3, page 176 of
[40].

Lemma 6.1 (Theorem 5.3.3 in [40]). Let $a_{1},\ldots,a_{n}\in{\bf F}_{q}$ be
$n$ distinct elements. We consider the following $(n-1)\times n$ Vandermonde
matrix ${\bf V}(a_{1},\ldots,a_{n})$

$\left(\begin{array}[]{ccccccccc}1&1&1&\cdots&\cdots&1\\\
a_{1}&a_{2}&a_{3}&\cdots&\cdots&a_{n}\\\
a_{1}^{2}&a_{2}^{2}&a_{3}^{2}&\cdots&\cdots&a_{n}^{2}\\\
\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\\
a_{1}^{n-2}&a_{2}^{n-2}&a_{3}^{n-2}&\cdots&\cdots&a_{n}^{n-2}\\\
\end{array}\right)$

Then the system of linear equations ${\bf V}(a_{1},\ldots,a_{n})\cdot{\bf
x}^{\tau}={\bf 0}$, where ${\bf x}\in{\bf F}_{q}^{n}$, has a nonzero solution
${\bf x}$ such that each coordinate of ${\bf x}$ is not zero.

Let ${\bf F}_{q}$ be an arbitrary finite field, $P_{1},\ldots,P_{n}$ be $n\leq
q$ elements in ${\bf F}_{q}$. A Reed-Solomon code $RS(n,k)$ is defined by

$RS(n,k)=\\{(f(P_{1}),\ldots,f(P_{n})):f\in{\bf F}_{q}[x],\deg(f)\leq k-1\\}.$

This is a linear $[n,k,n-k+1]_{q}$ MDS codes from the fact that a degree
$\deg(f)\leq k-1$ polynomial has at most $k-1$ roots. From Lemma 6.1 the dual
of $RS(n,k)$ is $RS(n,k)^{\perp}={\bf x}\cdot RS(n,n-k)$, where ${\bf x}$ is a
solution of the system of linear equation in Lemma 6.1. This Hamming weight
$n$ vector ${\bf x}$ can be calculated explicitly, see [41, 43]. In some
papers following the idea of [41, 43] the explicit calculation of coordinates
of ${\bf x}$ is needed, see [49, 29, 77]. We show that for generalized Reed-
Solomon codes over finite fields of the even characteristic, this is actually
not necessary. Notice that for the generalized Reed-Solomon code ${\bf v}\cdot
RS(n,k)$, the Euclid dual is ${\bf v}^{-1}\cdot{\bf x}\cdot RS(n,n-k)$. Then
it is equivalent to calculate the dimension of $RS(n,k)\bigcap{\bf
v}^{-2}\cdot{\bf x}\cdot RS(n,n-k)$.

When $q$ is an even prime power, if we need to construct a generalized Reed-
Solomon code with $h$ dimension Euclid hull, it is equivalent to find a
suitable Hamming weight $n$ vector ${\bf u}\in{\bf F}_{q}^{n}$ such that

$\dim_{{\bf F}_{q}}(RS(n,k)\bigcap{\bf u}\cdot RS(n,n-k))=h,$

where ${\bf u}={\bf v}^{-2}\cdot{\bf x}$ can be an arbitrary Hamming weight
$n$ vector in ${\bf F}_{q}^{n}$, since each element in ${\bf F}_{q}$ is a
square. Thus for codes over finite fields with the even characteristic, the
adjustment of ${\bf v}$ makes ${\bf v}^{-2}\cdot{\bf x}$ arbitrary. In
particular this implies that for any even code length $n\leq q$, a self-dual
generalized Reed-Solomon code can be constructed immediately. This recovers
the classical result in [34, 37].

Similarly we take a Hamming weight $n$ vector of the form

${\bf u}=(1,\ldots,1,\lambda,\ldots,\lambda)$

with $\max\\{k+1,n-k+1\\}$ coordinates equal to $1$ and
$n-\max\\{k+1,n-k+1\\}$ coordinates equal to $\lambda\neq 1$. Then
$RS(n,k)\bigcap{\bf u}\cdot RS(n,n-k)=\\{{\bf 0}\\}$, since there are no
nonzero polynomials ${\bf g}_{1}$ and ${\bf g}_{2}$ with degree $\deg({\bf
g}_{i})\leq\max\\{k-1,n-k-1\\}$, $i=1,2$, such that they have at least
$\max\\{k+1,n-k+1\\}$ same coordinate but not the same. Then the following
result recovers one construction in [44] immediately. These kinds of codes
have been covered in [18].

Proposition 6.1. Let $q$ be an even prime power. Let $n$ be a positive integer
satisfying $n\leq q$ and $k$ be a positive integer satisfying $1\leq k\leq
n-2$. Then an explicit LCD MDS generalized Reed Solomon $[n,k,n-k+1]_{q}$ code
is constructed.

The same method gives the following conclusion of length $n\leq q-1$ arbitrary
dimension hull MDS generalized Reed-Solomon codes over ${\bf F}_{2^{s}}$.

Theorem 6.1. Let $q$ be an even prime power. Let $n$ and $k$ be two positive
integers satisfying $k<n\leq q-1$. Then for any non-negative integer $0\leq
l\leq\min\\{k,n-k\\}$, we can construct a generalized Reed-Solomon code with
the $l$-dimension hull. Therefore generalized Reed-Solomon codes with
arbitrary dimension hull of arbitrary length $n\leq q-1$ can be constructed
explicitly.

Proof. Let $\alpha_{1},\ldots,\alpha_{n}$ be $n\leq q-1$ nonzero distinct
elements of ${\bf F}_{q}$. We can assume $k\leq n-k$. For any $l\leq k$, we
take the Hamming weight $n$ vector ${\bf
u}=(\alpha_{1}^{k-l},\ldots,\alpha_{n}^{k-l})$. Then the codewords of the code
${\bf u}\cdot RS(n,n-k)$ are the evaluations of polynomials ${\bf
f}(x)=a_{0}x^{k-l}+a_{1}x^{k-l+1}+\cdots+a_{n-k-1}x^{n-l-1}$,
$a_{0},\ldots,a_{n-k-1}\in{\bf F}_{q}$, at $\alpha_{1},\ldots,\alpha_{n}$. Now
we calculate the dimension of $\dim(RS(n,k)\bigcap{\bf u}\cdot RS(n,n-k))$. An
element in the intersection corresponds to ${\bf
g}=g_{0}+g_{1}x+\cdots+g_{k-1}x^{k-1}$ and ${\bf f}$ of the above form
satisfying that their evaluations at $n$ elements
$\alpha_{1},\ldots,\alpha_{n}$ are the same. Since the degrees of these two
polynomials are less than or equal to $n-1$. Then ${\bf g}$ and ${\bf f}$ are
the same polynomial. The only possible ${\bf f}$ has to be the form
$a_{0}x^{k-l}+a_{1}x^{k-l+1}+\cdots+a_{l-1}x^{k-1}$, where
$a_{0},\ldots,a_{l-1}\in{\bf F}_{q}$. The conclusion is proved.

In previous papers [49, 29] arbitrary dimension Euclidean hull $q$-ary
generalized Reed-Solomon codes for odd and even prime power $q$ with specific
lengths were constructed. Our above simple construction is much stronger than
their codes when $q$ is an even prime power and solve this problem for almost
all lengths.

Corollary 6.1. Let ${\bf C}\subset{\bf F}_{2^{s}}^{n}$ be a length $n\leq
2^{s}-1$ Reed-Solomon $[n,k]_{2^{s}}$ code, then the maximal Euclidean hull
dimension $\max_{Ehull}({\bf C})=\min\\{k,n-k\\}$.

The above result is actually a special case of Theorem 2.2.

###  6.2 Generalized twisted Reed-Solomon codes

We consider twisted Reed-Solomon codes introduced in [5, 7]. For a twisted
Reed-Solomon code ${\bf C}_{{\bf\alpha},{\bf t},{\bf h},{\bf\eta}}^{n,k}$
evaluated at a subgroup of the multiplicative group ${\bf F}_{q}^{*}$, the
dual is equivalent to another twisted Reed-Solomon code ${\bf
C}_{{\bf\alpha},k-{\bf h},n-k-{\bf t},-{\bf\eta}}^{n,n-k}$. If $q=2^{s}$, then
for suitable ${\bf h},{\bf t}$ and ${\bf\eta}$, from our method as above, it
is easy to get a self-dual twisted Reed-Solomon code. Some of them are MDS,
this recovers some self-dual MDS codes from twisted Reed-Solomon codes
constructed in [76].

In Subsection 6.2 we construct almost arbitrary dimension hull code from the
following simple twisted Reed-Solomon codes over the finite field ${\bf
F}_{q}$, $q$ is an even prime power, see [5, 7]. Let $n$ and $k$ be two
positive integers satisfying $n\leq q-1$ and $k\leq n-1$. Let
$\alpha_{1},\ldots,\alpha_{n}$ be $n$ distinct elements in the finite field
${\bf F}_{q}$ such that ${\bf\alpha}=\\{\alpha_{1},\ldots,\alpha_{n}\\}$ is a
multiplicative subgroup of ${\bf F}_{q}^{*}$. Let $\eta$ be a nonzero element
of ${\bf F}_{q}$. Set ${\bf g}_{0}=1+\eta x^{k}$, ${\bf g}_{1}=x$, …, ${\bf
g}_{k-1}=x^{k-1}$. Let ${\bf P}(\eta,k)$ be the linear span over ${\bf F}_{q}$
by ${\bf g}_{0},\ldots,{\bf g}_{k-1}$. The linear code ${\bf
C}_{{\bf\alpha},\eta,k}$ is the evaluation code of these polynomials in ${\bf
P}(\eta,k)$ at the above $n$ distinct elements of the subgroup ${\bf\alpha}$.
The dimension of the Schur square of ${\bf C}_{{\bf\alpha},\eta,k}$ is at
least $2k$. Thus this code is not equivalent to a Reed-Solomon code when
$2k\leq n$, even when it is MDS, see [7].

Set ${\bf h}_{0}=1$, ${\bf h}_{1}=x$, …, ${\bf h}_{n-k-1}=x^{n-k-1}-\eta
x^{n-1}$. Let ${\bf P}(-\eta,n-k)^{\perp}$ be the linear span over ${\bf
F}_{q}$ by ${\bf h}_{0},\ldots,{\bf h}_{n-k-1}$. Let ${\bf
C}_{{\bf\alpha},-\eta,n-k}$ be the linear code which is the evaluation code of
these polynomials in ${\bf P}(-\eta,n-k)^{\perp}$ at the above $n$ distinct
elements of the subgroup ${\bf\alpha}$.

Proposition 6.2 (or see Theorem 5 in [7]). The dual code of ${\bf
C}_{{\bf\alpha},\eta,k}$ is of the form ${\bf x}\cdot{\bf
C}_{{\bf\alpha},-\eta,n-k}$, where ${\bf x}\in{\bf F}_{q}^{n}$ is a Hamming
weight $n$ vector as in Lemma 6.1.

Proof. First of all ${\bf C}_{{\bf\alpha},\eta,k}\subset RS(n,k+1)$, then
${\bf x}\cdot RS(n,n-k-2)\subset{\bf C}_{{\bf\alpha},\eta,k}^{\perp}$. We only
need to prove that the products of ${\bf h}_{n-k-1}$ and ${\bf
g}_{0},\ldots,{\bf g}_{k-1}$ contain no terms $x^{v}$ satisfying $v\geq n-1$.
Because ${\bf\alpha}=\\{\alpha_{1},\alpha_{2},\ldots,\alpha_{n}\\}$ is a
multiplicative subgroup of ${\bf F}_{q}^{*}$, then $x^{n}=1$ for each element
in this subgroup. Hence $(1+\eta x^{k})(x^{n-k-1}-\eta
x^{n-1})=x^{n-k-1}-\eta^{2}x^{k-1}$, and $h_{n-k-1}x^{i}=x^{n-k-1+i}-\eta
x^{i-1}$ for $i=1,\ldots,k-1$, when evaluated at elements of this subgroup
${\bf\alpha}=\\{\alpha_{1},\ldots,\alpha_{n}\\}$. The conclusion follows
immediately.

Proposition 6.3 (or see Theorem 1 of [7]). If $\eta$ is not in the subgroup
${\bf\alpha}$, then ${\bf C}_{{\bf\alpha},\eta,k}$ is an MDS code.

Proof We only need to verify that any nonzero polynomial in ${\bf P}(\eta,k)$
has at most $k-1$ roots in the subgroup ${\bf\alpha}$. The polynomial in ${\bf
P}(\eta,k)$ is of the form $a_{0}\eta
x^{k}+a_{k-1}x^{k-1}+\cdots+a_{1}x+a_{0}$, then for any $k$ roots
$\alpha_{i_{1}}\ldots,\alpha_{i_{k}}$ in ${\bf\alpha}$, we have
$\prod_{j=1}^{k}\alpha_{i_{j}}=\pm\frac{a_{0}}{a_{0}\eta}$. This is a
contradiction.

Thus we have some MDS codes which are not equivalent to Reed-Solomon codes,
with almost arbitrary dimension hull.

Theorem 6.2. Let $q$ be an even prime power, $n$ be a positive integer
satisfying $n|q-1$ and $k$ be a positive integer satisfying
$k\leq\frac{n}{2}$. Then for any non-negative integer $1\leq l\leq k-2$, there
is a generalized twisted Reed-Solomon code as above with the $l$-dimension
hull. Therefore generalized twisted Reed-Solomon codes as above with the
$l$-dimension hulls, of the length $n|q-1$ can be constructed explicitly.

Proof. For integer $l\leq k$, we take the Hamming weight $n$ vector ${\bf
u}=(\alpha_{1}^{k-l},\ldots,\alpha_{n}^{k-l})$. Then the codewords of the code
${\bf u}\cdot{\bf C}_{{\bf\alpha},-\eta,n-k}$ is the evaluations of
polynomials ${\bf
f}(x)=a_{0}x^{k-l}+a_{1}x^{k-l+1}+\cdots+a_{n-k-2}x^{n-l-2}+a_{n-k-1}(x^{n-l-1}-\eta
x^{n+k-l-1})$, $a_{0},\ldots,a_{n-k-1}\in{\bf F}_{q}$. Since this polynomial
is evaluated at the subgroup ${\bf\alpha}=\\{\alpha_{1},\ldots,\alpha_{n}\\}$,
then ${\bf
f}(x)=a_{0}x^{k-l}+a_{1}x^{k-l+1}+\cdots+a_{n-k-2}x^{n-l-2}+a_{n-k-1}(x^{n-l-1}-\eta
x^{k-l-1})$.

Now we calculate the dimension $\dim({\bf C}_{{\bf\alpha},\eta,k}\bigcap{\bf
u}\cdot{\bf C}_{{\alpha},-\eta,n-k})$. An element in the intersection
corresponds to ${\bf b}=b_{0}(1+\eta x^{k})+b_{1}x+\cdots+b_{k-1}x^{k-1}$ and
${\bf f}$ of the above form satisfying that their evaluations at $n$ elements
$\alpha_{1},\ldots,\alpha_{n}$ are the same. Because the degrees of these two
polynomials are less than or equal to $n-1$. Then ${\bf b}$ and ${\bf f}$ are
the same polynomial. If $b_{0}$ is not zero, then there is a nonzero constant
in ${\bf f}$. This is impossible since $k-l-1\geq 1$. If $a_{n-k-1}\neq 0$,
there is a nonzero term $x^{n-l-1}$ in ${\bf b}$, this is impossible since
$k<n-l-1$. The only possible ${\bf f}$ has to be the form
$a_{0}x^{k-l}+a_{1}x^{k-l+1}+\cdots+a_{l-1}x^{k-1}$, where
$a_{0},\ldots,a_{l-1}\in{\bf F}_{q}$. The conclusion is proved.

Corollary 6.2. Let ${\bf C}\subset{\bf F}_{2^{s}}^{n}$ be a length $n|q-1$
twisted Reed-Solomon code as above. Then the maximal Euclidean hull dimension
is $\max_{Ehull}({\bf C})\geq\min\\{k-2,n-k-2\\}$.

##  7 Application to entanglement-assisted quantum codes

We recall the CSS construction of entanglement-assisted quantum codes from
linear codes with the $h$ dimension hull, see [11].

CSS construction of entanglement-assisted quantum codes. Let ${\bf
C}\subset{\bf F}_{q^{2}}^{n}$ be a linear $[n,k,d]_{q^{2}}$ code with the
$h$-dimensional Hermitian hull. Then an EAQEC $[[n,k-h,d,n-k-h]]_{q}$ code and
an EAQEC $[[n,n-k-h,d^{\perp},k-h]]_{q}$ code can be constructed. When
$d\leq\frac{n+2}{2}$ or $d^{\perp}\leq\frac{n+2}{2}$ and the code is MDS, then
the constructed code is an MDS EAQEC code.

We present applications to EAQEC codes from the above CSS construction. The
following result is direct from Theorem 3.1, Theorem 4.1 and the CSS
construction.

Corollary 7.1. 1) Let $q$ be a prime power and $h$ be a positive integer
satisfying $0\leq h\leq n$. If there exists a linear self-dual $[2n,n,d]_{q}$
code, then an EAQEC $[[2n,n-h,d,n-h]]_{q}$ code can be constructed.
2) Let $q$ be a prime power and $h$ be a positive integer satisfying $0\leq
h\leq n$. If there is a Hermitian self-dual $[2n,n,d]_{q^{2}}$ code, then we
can construct an EAQEC $[[2n,n-h,d,n-h]]_{q}$ code.
3) Let $s$ be a positive integer satisfying $s\geq 2$. If there is an LCD
$[n,k,d]_{2^{s}}$ code ${\bf C}$ satisfying $d\geq 2$ and $d^{\perp}\geq 2$.
Moreover the both shortening codes of ${\bf C}$ and ${\bf C}^{\perp}$ at a
coordinate position are LCD. Then we can construct an EAQEC
$[[n,k-1,d,n-k-1]]_{2^{s}}$ code.

From the optimal Hermitian self-dual codes constructed in [67] we give the
following tables of EAQEC codes over small fields ${\bf F}_{2},{\bf
F}_{3},{\bf F}_{4}$ and ${\bf F}_{5}$ from Corollary 7.1. The dimension upper
bounds in the quantum Singleton bound are also listed to show that these EAQEC
codes are good. In previous papers [58, 49, 32, 26, 29] on construction of
EAQEC codes, there is no EAQEC code over small fields presented. Thus we list
these codes for the convenience of the practical quantum error correction.

Table 1:  $q^{2}=4$, $q=2$ EAQEC parameters | h | Singleton
---|---|---
$[[6,3-h,4,3-h]]_{2}$ | $0\leq h\leq 3$ | $3-h$
$[[8,4-h,4,4-h]]_{2}$ | $0\leq h\leq 4$ | $6-h$
$[[10,5-h,4,5-h]]_{2}$ | $0\leq h\leq 5$ | $9-h$
$[[12,6-h,4,6-h]]_{2}$ | $0\leq h\leq 6$ | $12-h$
$[[14,7-h,6,7-h]]_{2}$ | $0\leq h\leq 7$ | $11-h$
$[[16,8-h,6,8-h]]_{2}$ | $0\leq h\leq 8$ | $14-h$
$[[18,9-h,8,9-h]]_{2}$ | $0\leq h\leq 9$ | $13-h$
$[[22,11-h,8,11-h]]_{2}$ | $0\leq h\leq 11$ | $19-h$
$[[24,12-h,8,12-h]]_{2}$ | $0\leq h\leq 12$ | $22-h$
$[[26,13-h,8,13-h]]_{2}$ | $0\leq h\leq 13$ | $25-h$
$[[28,14-h,8,14-h]]_{2}$ | $0\leq h\leq 14$ | $28-h$
$[[30,15-h,8,15-h]]_{2}$ | $0\leq h\leq 15$ | $31-h$
$[[34,17-h,10,17-h]]_{2}$ | $0\leq h\leq 17$ | $33-h$
Table 2:  $q^{2}=9$, $q=3$ EAQEC parameters | h | Singleton
---|---|---
$[[6,3-h,4,3-h]]_{3}$ | $0\leq h\leq 3$ | $3-h$
$[[8,4-h,4,4-h]]_{3}$ | $0\leq h\leq 4$ | $6-h$
$[[10,5-h,6,5-h]]_{3}$ | $0\leq h\leq 5$ | $5-h$
$[[12,6-h,6,6-h]]_{3}$ | $0\leq h\leq 6$ | $8-h$
$[[14,7-h,6,7-h]]_{3}$ | $0\leq h\leq 7$ | $11-h$
$[[16,8-h,7,8-h]]_{3}$ | $0\leq h\leq 8$ | $12-h$
$[[18,9-h,7,9-h]]_{3}$ | $0\leq h\leq 9$ | $15-h$
$[[20,10-h,8,10-h]]_{3}$ | $0\leq h\leq 10$ | $16-h$
$[[22,11-h,8,11-h]]_{3}$ | $0\leq h\leq 11$ | $19-h$
$[[24,12-h,9,12-h]]_{3}$ | $0\leq h\leq 12$ | $20-h$
$[[26,13-h,9,13-h]]_{3}$ | $0\leq h\leq 13$ | $23-h$
$[[28,14-h,10,14-h]]_{3}$ | $0\leq h\leq 14$ | $22-h$
Table 3:  $q^{2}=16$, $q=4$ EAQEC parameters | h | Singleton
---|---|---
$[[6,3-h,4,3-h]]_{4}$ | $0\leq h\leq 3$ | $3-h$
$[[8,4-h,4,4-h]]_{4}$ | $0\leq h\leq 4$ | $6-h$
$[[10,5-h,6,5-h]]_{4}$ | $0\leq h\leq 5$ | $5-h$
$[[12,6-h,6,6-h]]_{4}$ | $0\leq h\leq 6$ | $8-h$
$[[14,7-h,7,7-h]]_{4}$ | $0\leq h\leq 7$ | $9-h$
$[[16,8-h,7,8-h]]_{4}$ | $0\leq h\leq 8$ | $12-h$
$[[18,9-h,8,9-h]]_{4}$ | $0\leq h\leq 9$ | $13-h$
$[[20,10-h,8,10-h]]_{4}$ | $0\leq h\leq 10$ | $16-h$
$[[22,11-h,9,11-h]]_{4}$ | $0\leq h\leq 11$ | $17-h$
$[[24,12-h,9,12-h]]_{4}$ | $0\leq h\leq 12$ | $20-h$
$[[26,13-h,10,13-h]]_{4}$ | $0\leq h\leq 13$ | $21-h$
$[[28,14-h,11,14-h]]_{4}$ | $0\leq h\leq 14$ | $22-h$
Table 4:  $q^{2}=25$, $q=5$ EAQEC parameters | h | Singleton
---|---|---
$[[6,3-h,4,3-h]]_{5}$ | $0\leq h\leq 3$ | $3-h$
$[[8,4-h,5,4-h]]_{5}$ | $0\leq h\leq 4$ | $4-h$
$[[10,5-h,6,5-h]]_{5}$ | $0\leq h\leq 5$ | $5-h$
$[[12,6-h,6,6-h]]_{5}$ | $0\leq h\leq 6$ | $8-h$
$[[14,7-h,7,7-h]]_{5}$ | $0\leq h\leq 7$ | $9-h$
$[[18,9-h,8,9-h]]_{5}$ | $0\leq h\leq 9$ | $13-h$
$[[22,11-h,9,11-h]]_{5}$ | $0\leq h\leq 11$ | $17-h$
$[[24,12-h,10,12-h]]_{5}$ | $0\leq h\leq 12$ | $18-h$
$[[26,13-h,10,13-h]]_{5}$ | $0\leq h\leq 13$ | $21-h$
$[[28,14-h,11,14-h]]_{5}$ | $0\leq h\leq 14$ | $22-h$
Table 5:  $q^{2}=49,64,81,121,169$, $q=7,8,9,11,13$ EAQEC parameters | h | Singleton
---|---|---
$[[10,5-h,6,5-h]]_{q}$ | $0\leq h\leq 5$ | $5-h$
$[[12,6-h,7,6-h]]_{q}$ | $0\leq h\leq 6$ | $6-h$
$[[14,7-h,7,7-h]]_{q}$ | $0\leq h\leq 7$ | $9-h$
$[[16,9-h,8,9-h]]_{q}$ | $0\leq h\leq 8$ | $10-h$
$[[18,9-h,9,9-h]]_{q}$ | $0\leq h\leq 9$ | $11-h$
Table 6:  $q^{2}=256,289,361$, $q=16,17,19$ EAQEC parameters | h | Singleton
---|---|---
$[[10,5-h,6,5-h]]_{q}$ | $0\leq h\leq 5$ | $5-h$
$[[12,6-h,7,6-h]]_{q}$ | $0\leq h\leq 6$ | $6-h$
$[[14,7-h,8,7-h]]_{q}$ | $0\leq h\leq 7$ | $7-h$
$[[16,9-h,8,9-h]]_{q}$ | $0\leq h\leq 8$ | $10-h$
$[[18,9-h,9,9-h]]_{q}$ | $0\leq h\leq 9$ | $11-h$

There are many constructions of MDS EAQEC code and almost MDS EAQEC codes in
[58, 49, 32, 26]. We have the following result.

Corollary 7.2. Let $q$ be an even prime power satisfying $q\geq 4$, $n$,
$k\leq\frac{n}{2}$ and $h$ be three positive integers satisfying $n\leq q-1$,
$0\leq h\leq k$. Then an MDS EAQEC $[[n,n-k-h,k+1,k-h]]_{q}$ code can be
constructed.

Proof. The result follows from Theorem 6.1 immediately.

Notice that from Theorem 3.1 for all lengths $n\leq q-1$, the parameter $c$
can be arbitrary in the range $0\leq c\leq k$. The only restriction on $k$ is
$k\leq n-1$. Hence these MDS EAQEC codes in Corollary 7.2 are new comparing to
the constructions in [49, 29, 32, 13]. The parameters of EAQEC codes
constructed in Corollary 7.2 are flexible than previous codes constructed in
[49, 29, 32, 13]. Moreover these MDS codes can be constructed from almost
arbitrary dimension hull generalized twisted Reed-Solomon codes in Theorem 6.2
when the length $n$ satisfies $n|q-1$.

From elliptic curve codes defined over the finite field ${\bf F}_{2^{s}}$, for
any even length $4\leq n\leq 2^{s}+\lfloor 2^{\frac{s}{2}+1}\rfloor-2$, self-
dual near MDS (then almost MDS) codes were constructed in [45]. From Theorem
3.1 we have the following new family of almost MDS EAQEC codes. Actually
arbitrary dimension hull near MDS codes can be obtained from these self-dual
near MDS codes in [45] when $q$ is an even prime power, from Theorem 3.1 of
this paper.

Corollary 7.3. Let $n$ be an even positive integer satisfying $4\leq n\leq
2^{s}+\lfloor 2^{\frac{s}{2}+1}\rfloor-2$. We can construct an almost MDS
EAQEC $[[n,\frac{n}{2}-h,\geq\frac{n}{2},\frac{n}{2}-h]]_{2^{s}}$ code for any
nonnegative integer $h$ satisfying $0\leq h\leq\frac{n}{2}$.

Comparing with the almost MDS EAQEC codes constructed in [58] from elliptic
curves, these codes are new.

##  8 Conclusion

We proposed to study the hull-variation problem and introduced the maximal
Euclidean (or Hermitian) hull dimension as an invariant of a linear code with
respect to equivalent transformations. Some basic properties of maximal
Euclidean (Hermitian) hull dimensions were given. It was proved that a length
$n$ (Euclidean or Hermitian) self-dual code is equivalent to a linear
$h$-dimension hull code for all possible $h$ satisfying $0\leq
h\leq\frac{n}{2}$. We proved that a linear LCD code with the minimum Hamming
distance $d\geq 2$ and the dual distance $d^{\perp}\geq 2$ has an equivalent
linear one-dimension hull code under a weak condition, where $q$ is an even
prime power satisfying $q\geq 4$. Then it follows that for any fixed
nonnegative integer $h$, there is an asymptotically good sequence of linear
$h$-dimension hull codes over ${\bf F}_{q}$ better than the Gilbert-Varshamov
bound. We also showed that this method gives many new arbitrary dimension hull
generalized Reed-Solomon codes over ${\bf F}_{2^{s}}$ with arbitrary length
$n\leq q-1$. Arbitrary dimension hull generalized twisted Reed-Solomon codes
over ${\bf F}_{2^{s}}$ with the length $n|q-1$ were also constructed. Applying
our results to entanglement-assisted quantum error correction codes some new
MDS and new almost MDS EAQEC codes were constructed. Many EAQEC codes over
small fields were constructed from optimal Hermitian self-dual codes. The
hull-increasing variation problem of general linear codes is still interesting
to understand further.

Acknowledgement. The author thanks Professor Chunming Tang, Professor Chengju
Li and Dr. Gaojun Luo for helpful discussion on the hull-variation problem.
The author thanks the Associate Editor and four reviewers sincerely for their
helpful comments that improved the presentation of this paper.

## References

  * [1] S. A. Aly, A. Klappenecker and P. K. Sarvepalli, On quantum and classical BCH codes, IEEE Trans. Inf. Theory, vol. 53, no. 3, pp. 1183-1188, 2007.
  * [2] S. Ball, On large subsets of a finite vector space in which every subset of basis size is a basis, J. EMS, vol. 14, pp. 733-748, 2012.
  * [3] S. Ball, Some constructions of quantum MDS codes, Des., Codes and Cryptogra. vol. 89, pp. 811-821, 2021.
  * [4] A. Bassa and H. Stichtenoth, Self-dual codes better than the Gilbert-Varshamov bound, Des., Codes and Cryptogr., vol. 87, pp. 173-182, 2019.
  * [5] P. Beelen, S. Puchsinger and J. Nielsen, Twisted Reed-Solomon codes, Proc Int. Symp. Inf. Theory, 2017.
  * [6] P. Beelen and L. Jin, Explicit MDS codes with complementary duals, IEEE Trans. Inf. Theory, vol. 64, no. 11, pp. 7188-7193, 2018.
  * [7] P. Beelen, S. Puchinger and J. Rosenkilde, Twisted Reed-Solomon codes, IEEE Trans. Inf. Theory, vol. 68, no. 5, pp. 3047-3061, 2022.
  * [8] R. C. Bose and D. K. Ray-Chaudhuri, On a class of error-correcting binary group codes, Inform. and Control, vol. 3, pp. 68-79, 1960.
  * [9] R. C. Bose and D. K. Ray-Chaudhuri, Further results on error-correcting binary group codes, Inform. and Control, vol. 3, pp. 279-290, 1960.
  * [10] J. Bringer, C. Carlet, H. Chabanne, S. Guilley, and H. Maghrebi, Orthogonal direct sum masking: A smartcard friendly computation paradigmin a code, with Builtin protection against side-channel and fault attack, Proc. WISTP, vol. 850, pp. 40-56, 2014.
  * [11] T. Brun, I. Devetak and Min-Hsiu Hsieh, Correcting quantum errors with entanglemnent, Science, vol. 304 (5798), pp. 436-439, 2006.
  * [12] A. Calderbank and P. W. Shor, Good quantum error-correcting codes exist, Phys. Rev. A, Gen. Phys., vol. 54, no. 2, pp. 1098-1105, 1996.
  * [13] M. Cao, MDS codes with Galois hulls of arbitrary dimensions and the related entanglement-assisted quantum error correction, IEEE Trans. Inf. Theory, vol. 67, no. 12, pp. 7964-7984, 2021.
  * [14] C. Carlet and S. Guilley, Complementary dual codes for countermeasures to side-channel attacks, Adv. Math. Commun., vol. 10, no. 1, pp. 131-150, 2016.
  * [15] C. Carlet, C. Güneri, F. Özbudak, B. Özkaya and P. Solé, On linear complementay pairs of codes, IEEE Trans. Inf. Theory, vol. 64, no. 10, pp. 6583-6589, 2018.
  * [16] C. Carlet, S. Mesnager, C. Tang and Y. Qi, On $\sigma$-LCD codes, IEEE Trans. Inf. Theory, vol. 65, no. 3, pp. 1694-1704, 2019.
  * [17] C. Carlet, S. Mesnager, C. Tang and Y. Qi, New chactrization and parametrization of LCD codes, IEEE Trans. Inf. Theory, vol. 65, no. 1, pp. 39-49, 2019.
  * [18] C. Carlet, S. Mesnager, C. Tang, Y. Qi and R. Pellikaan, Linear codes over ${\bf F}_{q}$ are equivalent to LCD code for $q>3$, IEEE Trans. Inf. Theory, vol. 64, no. 8, pp. 5776-5782, 2018.
  * [19] C. Carlet, C. Li and S. Mesnager, Linear codes with small hulls in semiprimitive cases, Des., Codes Cryptogr., vol 87, pp. 3063-3075, 2019.
  * [20] I. Cascudo, H. Chen, R. Cramer and C. Xing, Asymptically good ideal linear secret sharing with strong multiplication over any fixed finite field, Crypto 2009, S. Halevi, Ed., Berlin, Germany, LNCS 5677, pp. 466-486, 2009.
  * [21] B. Chen and H. Liu, New constructions of MDS codes with complementay duals, IEEE Trans. Inf. Theory, vol. 64, no. 8, pp. 5776-5782, 2018.
  * [22] H. Chen, Some good quantum error-correcting codes from algebraic geometric codes, IEEE Trans. Inf. Theory, vol. 47, no. 5, pp. 2059-2061, 2001.
  * [23] H. Chen, C. Xing and S. Ling, Asymptotically good quantum codes exceeding the Ashikhmin-Litsyn-Tsafasman bound, IEEE Trans. Inf. Theory, vol. 47, no. 5, pp. 2055-2058, 2001.
  * [24] H. Chen, C. Xing and S. Ling, Quantum codes from concatenated algebraic geometric codes, IEEE Trans. Inf. Theory, vol. 51, no. 8, pp. 2915-2920, 2005.
  * [25] H. Chen, New MDS entanglement-assisted quatum codes from Hermitian self-orthogonal codes, arXiv:2206.13995v2, 2022.
  * [26] X. Chen, S. Zhu, W. Jiang and G. Luo, A new family of EAQMDS codes constructed from constacyclic codes, Des., Codes and Cryptogr., vol. 89, pp. 2179-2193, 2021.
  * [27] J. H. Conway, V. Pless and N. J. A. Sloane, Self-dual codes over $GF(3)$ and $GF(4)$ of length not exceeding $16$, IEEE Trans. Inf. Theory, vol. 25, no. 3, pp. 312-322, 1979.
  * [28] J. H. Conway and N. J. A. Sloane, A new upper bound on the minimal distance of self-dual codes. IEEE Trans. Inf. Theory vol. 36, pp. 1319-1333, 1990.
  * [29] W. Fang, F. Fu, L. Li and S. Zhu, Euclidean and Hermitian hulls of MDS codes and their application to quantum codes, IEEE Trans. Inf. Theory vol. 66. no. 6, pp. 3527-3537, 2020.
  * [30] D. Fattal, T. S. Cubitt, Y. Yamamoto, S. Bravyi and I. L. Chuang, Entanglement in the stablizer formalism, arXiv:quant-ph/04-6168, 2004.
  * [31] C. Gan, C. Li, S. Mesnager and H. Qian, On hulls of some primitive BCH codes and self-orthogonal codes, IEEE Trans. Inf. Theory, vol. 67, no. 10, pp. 6442-6455, 2021.
  * [32] Y. Gao, Q. Yue, X. Huang and J. Zeng, Hulls of generalized Reed-Solomon codes via Goppa codes and their applications to quamtum codes, IEEE Trans. Inf. Theory, vol. 67, no. 10, pp. 6619-6626, 2021.
  * [33] C. Galindo, O. Geil, F. Hernando and D. Ruano, New binary and ternary LCD codes, IEEE Trans. Inf. Theory, vol. 65, no. 2, pp. 1008-1016, 2019.
  * [34] M. Grassl and T. A. Gulliver, On self-dual MDS codes, Proc. Int. Symp. Inf. Theory, pp. 1954-1957, 2008.
  * [35] M. Grassl, F. Huber and A, Winiter, Entropic proofs of Singleton bounds for quantum error-correcting codes, IEEE Trans. Inf. Theory, vol. 68, no. 6, pp. 3942-3950, 2021.
  * [36] G. Guo and R. Li, Hermitian self-dual GRS and entended GRS codes, IEEE Commun. Lett., vol. 25, no. 4, pp. 1062-1065, 2021.
  * [37] T. A. Gulliver, J-L. Kim and Y. Lee, New MDS or near MDS codes, IEEE Trans. Inf. Theory, vol. 54, no. 9, pp. 4354-4360, 2008.
  * [38] A. Hocquenghem, Codes correcteurs d’erreurs, Chiffres (Paris), vol. 2, pp. 147-156, 1959.
  * [39] D. Huang, Q. Yue, Y. Niu and X. Li, MDS or NMDS self-dual codes from twisted generalized Reed-Solomon codes, Des., Codes and Cryptogra., vol. 89, pp. 2195-2209, 2022.
  * [40] W. C. Huffman and V. Pless, Fundamentals of error-correcting codes, Cambridge University Press, Cambridge, U. K., 2003.
  * [41] L. Jin, S. Ling, J. Luo and C. Xing, Application of classical Hermitian self-orthogonal MDS codes to quantum MDS codes, IEEE Trans. Inf. Theory, vol. 56, no. 9, pp. 4735-4740, 2010.
  * [42] L. Jin and C. Xing, Euclid and Hermitian self-orthogonal algebraic geometric codes and their applications to quantum codes, IEEE Trans. Inf. Theory, vol. 58, no. 8, pp. 5484-5489, 2012.
  * [43] L. Jin and C. Xing, New MDS self-dual codes from generalized Reed-Solomon codes, IEEE Trans. Inf. Theory, vol. 63, no. 3, pp. 14-34-1438, 2017.
  * [44] L. Jin, Construction of MDS codes with complementary duals, IEEE Trans. Inf. Theory, vol. 63, no. 5, pp. 2843-2847, 2017.
  * [45] L. Jin and H. Kan, Self-dual near MDS codes from elliptic curves, IEEE Trans. Inf. Theory, vol. 65, no. 4, pp. 2166-2170, 2019.
  * [46] C. Li, C. Ding and S. Liu, LCD cyclic codes over finite fields, IEEE Trans. Inf. Theory, vol. 63, no. 7, pp. 4344-4356, 2017.
  * [47] S. Li, C. Li, C. Ding and H. Liu, Two families of LCD BCH codes, IEEE Trans. Inf. Theory, vol. 63, no. 9, pp. 5699-5717, 2017.
  * [48] C. Li and P. Zeng, Constructions of linear codes with one-dimension hull, IEEE Trans. Inf. Theory, vol. 65, no. 3, pp. 1668-1676, 2018.
  * [49] G. Luo, X. Cao and X. Chen, MDS codes with hulls of arbitray dimensions and their quantum error correction, IEEE Trans. Inf. Theory, vol. 65, no. 5, pp. 2944-2952, 2019.
  * [50] G. Luo, M. F. Ezerman, M. Grassl and S. Ling, How much entanglement does a quantum code need? arXiv4395197, 2022.
  * [51] J. H. van Lint, Introduction to the coding theory, GTM 86, Third and Expanded Edition, Springer, Berlin, 1999.
  * [52] A. Klappenecker and P. K. Sarvepalli, Clifford code constructions of operators quantum error correcting codes, IEEE Trans. Inf. Theory, vol. 54, no. 12, pp. 5760-5765, 2008.
  * [53] J. L. Massey, Reversible codes, Inf. Control, vol. 7, no. 3, pp. 369-380, 1964.
  * [54] J. L. Massey, Linear codes with complementary duals, Disc. Math., vol. 106-107, pp. 337-342, 1992.
  * [55] S. Mesnager, C. Tang and Y. Qi, Complementary dual algebaric geometry codes, IEEE Trans. Inf. Theory, vol. 64, no. 4, pp. 2390-2397, 2018.
  * [56] Y. Niu, Q. Yue, Y. Wu and L. Hu, Hermitian self-dual, MDS and generalized Reed-Solomon codes, IEEE Commun. Lett., vol. 23, no. 5, pp. 781-784, 2019.
  * [57] L. Qian, X. Cao and S. Mesnager, Linear codes with one-dimension hull associated with Gaussian sum, Cryptogr. Commun., vol. 13, pp. 225-243, 2021.
  * [58] F. R. F. Pereira, R. Pellikaan, G. G. La Guardia and F. Marcos, Entanglement-assisted quantum codes from algebraic geometry codes, IEEE Trans. Inf. Theory, vol. 67, no. 11, pp. 7110-7120, 2021.
  * [59] E. M. Rains and N. J. A. Sloane, Self-dual codes, In ”Handbook of Coding Theory”, eds, V. Pless and W. C. Huffman, pp. 177-294, Elsevier, Amsterdam, 1998.
  * [60] H. Randriambololona, An upper bound of Singleton type of compnentwise products of linear codes, IEEE Trans. Inf. Theory, vol. 46, no. 12, pp. 7936-7939, 2013.
  * [61] N. Sendrier, Finding the permutation between equivalent linear codes, IEEE Trans. Inf. Theory, vol. 46, no. 4, pp. 1193-1203, 2000.
  * [62] N. Sendrier, Linear codes with complementary duals meet the Gilbert-Varshamov bound, Discrte Math., vol. 285, no. 1, pp. 345-347, 2004.
  * [63] P. W. Shor, Scheme for redcuing decoherence in quantum memory, Phys. Rev. A, vol. 52, pp. R2493-2496, 1995.
  * [64] H. Singh and K. C. Meena, Multi-twisted Reed-Solomon codes with small dimension hull, arXiv:2201.13108, 2022.
  * [65] Lin Sok, Explicit constructions of MDS slef-dual codes, IEEE Trans. Inf. Theory, vol. 66, no. 6, pp. 3603-3615, 2020.
  * [66] Lin Sok, A new construction of linear codes with one-dimension hull, Des., Codes Cryptogr., online version, 2022.
  * [67] Lin Sok and C. Yang, Constructions of optimal Hermitian self-dual codes from unitary matrices, Finite Fields Appli., vol. 79, 102000, 2022.
  * [68] A. M. Steane, Mutiple particle interference and quantum error correction, Proc. Roy. Soc. London, vol. 452, pp. 2551-2577, 1996.
  * [69] A. M. Steane, Error-correcting codes in quantum theory, Phys. Rev. Lett., vol. 77, no. 5, pp. 793-797, 1996.
  * [70] H. Stichtenoth, Transative and self-dual codes attaining the Tsafasman-Vládut-Zink bound, IEEE Trans. Inf. Theory, vol. 52, no. 5, pp. 2218-2224, 2006.
  * [71] V. K. Wei, Generalized Hamming weights of linear codes, IEEE Trans. Inf. Theory, vol. 37, pp. 1412-1418, 1991.
  * [72] Y. Yang and W. Cai, On self-dual constacyclic codes over finite fields, Des., Codes Cryptogr., vol. 74, no. 2, pp. 355-364, 2015.
  * [73] X. Yang and J. L. Massey, The condition for a cyclic code has a complementary dual, Disc. Math., vol. 126, no. 3, pp. 391-393, 1994.
  * [74] Y. Wu and Q. Yue, Factorization of binomial polynomials and enumeration of LCD and self-dual constacyclic codes, IEEE Trans. Inf. Theory, vol. 65, no. 3, pp. 1740-1751, 2019.
  * [75] Y. Wu, Twisted Reed-Solomon codes with one dimension hull, IEEE Commun. Lett., vol. 25, no. 2, pp. 383-386, 2021.
  * [76] Y. Wu, J. Y. Hyun and Y. Lee, New LCD MDS codes of non-Reed-Solomon type, IEEE Trans. Inf. Theory, vol. 67, no. 8, pp. 5069-5078, 2021.
  * [77] A. Zhang and K. Feng, A unified approch to construct MDS self-dual codes via Reed-Soloon code, IEEE Trans. Inf. Theory, vol. 66, no. 6, pp. 3650-3656, 2020.