# Linear codes with arbitrary dimensional hull and pure LCD code.111
<EMAIL_ADDRESS>
Maouche Youcef

(1 Faculty of Mathematics, University of Science and Technology Houari
Boumediene,
Bab Ezzouar, Algiers, Algeria.
)

Abstract. In this paper, we introduce a general construction of linear codes
with small dimension hull from any non LCD codes. Furthermore, we show that
for any linear code $\mathcal{C}$ over $\mathbb{F}_{q}$ ($q>3$) with
$dim(Hull(\mathcal{C}))=h$ there exist an equivalent codes $\mathcal{C}_{j}$
with $dim(Hull(\mathcal{C}_{j}))=j$ for any integer $0\leq j\leq h$. We also
introduce the notion of pure LCD code; an LCD code and all its equivalent are
LCD; and construct an infinite family of pure LCD codes. In addition, we
introduce a general construction of linear codes with one dimension hull.

Keywords. LCD codes; Pure LCD codes; Hulls; Entanglement-assisted quantum
error correcting codes.

2010 Mathematics Subject Classification. Primary 94B15, 94B05; Secondary
11T71.

##  1 Introduction

The Euclidean hull of a linear code $\mathcal{C}$ is the intersection of
$\mathcal{C}$ and its Euclidean dual $C^{\perp}$. A linear code $\mathcal{C}$
is called $h$-dim hull if $dim(hull(C))=h$. With this definition, a linear
complementary dual (LCD) code is a $0$-dim hull code and an $[n,k]$ self-
orthogonal code is $k$-dim hull. LCD codes have been widely applied in data
storage, communications and cryptography [3, 4, 5, 6, 7, 10, 17, 18]. Massey
[12] gave the algebraic characterization of LCD codes, and showed that
asymptotically good LCD codes exist. In [6], the authors show that any linear
code over $\mathbb{F}_{q}\,(q>3)$ is equivalent to an Euclidean LCD code and
any linear code over $\mathbb{F}_{q^{2}}\,(q>2)$ is equivalent to a Hermitian
LCD code.

Linear code with small hull are also interesting due to its crucial role in
checking permutation equivalence of two linear codes and determining the
complexity of algorithms for computing the automorphism group of a linear code
[14, 11, 7]. In [11], the authors present some necessary and sufficient
conditions that a linear codes and cyclic codes have one-dimensional hull and
construct cyclic codes with one dimensional hull. In [7], Claude et al. employ
character sums in semi-primitive case to construct LCD codes and linear codes
with one-dimensional hull from cyclotomic fields and multiplicative subgroups
of finite fields. In [5], Hao prove that for a nonnegative integer $h$
satisfying $0\leq h\leq n-1$, a linear $[2n,n]$ self-dual code is equivalent
to a linear $h$-dimension hull code. Recently, there have been a lot of
research works on linear codes with small hulls and its application in
entanglementassisted quantum error-correcting codes (EAQECCs), the reader is
referred to [15, 8, 14].

The main goal of this manuscript is to extend the results in [7, 9] and
construct an arbitrary dimensional hull from an existing one. We show that for
any $[n,k,d]$ linear code over $\mathbb{F}_{q}$ $(q>3)$, with $h$ dimensional
hull there exist a monomial equivalent codes $\mathcal{C}_{j}$ to
$\mathcal{C}$ with $j$ dimensional hull for any $0\leq j\leq h$. More
precisely, we introduce a general construction of small dimensional hull codes
from any linear codes and arbitrary dimensional hulls from any self-orthogonal
code. Furthermore, we introduce pure LCD code and show that such codes are
very rare or do not exist over finite fields with characteristic $2$. In
addition, we construct an infinite family of pure LCD code over finite fields
with odd characteristics.

This paper is organized as follows. In Section 2, we give some preliminaries
on linear codes and necessary and sufficient conditions for such code to be
$h$ dimensional hull. In Section 3, we construct linear codes with small
dimensional hull from any linear code and arbitrary dimensional hull from
self-orthogonal codes. In Section 4, we introduce the notion of pure LCD codes
and give a general construction of linear codes with one-dimensional hull.

##  2 Preliminaries

Throughout this paper, let $\mathbb{F}_{q}$ be a finite field of order
$q=p^{m}$ where $p$ is prime and $m$ is a positive integer. The multiplicative
group of $\mathbb{F}_{q}$ is denoted by $\mathbb{F}_{q}^{*}$. An $[n,k,d]$
linear code $\mathcal{C}$ over $\mathbb{F}_{q}$ is a linear subspace of
$\mathbb{F}_{q}^{n}$ with dimension $k$ and minimum Hamming distance $d$. Let
$\mathbb{x}=(x_{0},x_{1},\cdots,x_{n-1})$,
$\mathbb{y}=(y_{0},y_{1},\cdots,y_{n-1})\in\mathbb{F}_{q}^{n}$, their inner
product is defined as usual

$\langle\mathbb{x},\mathbb{y}\rangle=x_{0}y_{0}+x_{1}y_{1}+\cdots+x_{n-1}y_{n-1}\in\mathbb{F}_{q}.$

Two vectors $\mathbb{x}$, $\mathbb{y}$ are called orthogonal if
$\langle\mathbb{x},\mathbb{y}\rangle=0$. For a linear code $\mathcal{C}$ over
$\mathbb{F}_{q}$, its dual code $\mathcal{C}^{\perp}$ is the set of vectors
orthogonal to every codeword of $\mathcal{C}$ under the inner product i.e.,

$\mathcal{C}^{\perp}=\\{\mathbb{x}\in\mathbb{F}_{q}^{n}\;\,|\;\,\langle\mathbb{x},\mathbb{y}\rangle=0,\;\,\;\forall\mathbb{y}\in\mathcal{C}\\}.$

A code $\mathcal{C}$ is called self-orthogonal if
$\mathcal{C}\subseteq\mathcal{C}^{\perp}$, and it is called self-dual if
$\mathcal{C}^{\perp}=\mathcal{C}$. The hull of a linear code $\mathcal{C}$ is
defined by

$\text{hull}(\mathcal{C})=\mathcal{C}\cap\mathcal{C}^{\perp}.$

A linear code $\mathcal{C}$ is called $h$-dim hull if $dim(hull(C))=h$. With
this definition, a linear complementary dual (LCD) code is a $0$-dim hull code
and $[n,k]$ self-orthogonal code is $k$-dim hull. For any
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}^{n}_{q}$ and permutation
$\sigma$ of $\\{1,2,\cdots,n\\}$, we define $\mathcal{C}_{\mathbb{a}}$ and
$\sigma(\mathcal{C})$ as the following linear codes

$\mathcal{C}_{\mathbb{a}}=\\{(a_{1}c_{1},\cdots,a_{n}c_{n})\;:\;(c_{1},\cdots,c_{n})\in\mathcal{C}\\},$

and

$\sigma(\mathcal{C})=\\{(c_{\sigma(1)},\cdots,c_{\sigma(n)})\;:\;(c_{1},\cdots,c_{n})\in\mathcal{C}\\}.$

Two codes $\mathcal{C}$ and $\mathcal{C}^{\prime}$ over $\mathbb{F}_{q}$ are
called monomial equivalent if
$\mathcal{C}^{\prime}=\sigma(\mathcal{C}_{\mathbb{a}})$ for some permutation
$\sigma$ of $\\{1,2,\cdots,n\\}$ and $\mathbb{a}\in(\mathbb{F}^{*}_{q})^{n}$.
Let $\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ be two codes over the same field
$\mathbb{F}_{q}$, and let $G_{1}$ be a generator matrix for $\mathcal{C}_{1}$.
Then $\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ are monomial equivalent if and
only if there is a monomial matrix $M$ (a square matrix with exactly one
nonzero entry in each row and column) so that $G_{1}M$ is a generator matrix
of $\mathcal{C}_{2}$.

Let $\mathcal{C}$ be an $[n,k]$ linear code. If $\mathcal{C}$ is the direct
sum of subspaces $U_{i}$ for $1\leq i\leq k$ which are mutually orthogonal,
then we shall say that $\mathcal{C}$ is the orthogonal sum of the $U_{i}$ and
use the symbol

$\mathcal{C}=U_{1}\perp\cdots\perp U_{k}.$

###### Theorem 2.1

Let $\mathcal{C}$ be an $[n,k]$ linear code over $\mathbb{F}_{q}$ where $q$ is
odd and $Hull(\mathcal{C})=h$. Then there exist code words
$\mathbb{c}_{1},\cdots,\mathbb{c}_{k}\in\mathcal{C}$ such that

$\mathcal{C}=<\mathbb{c}_{1}>\perp<\mathbb{c}_{2}>\perp\cdots\perp<\mathbb{c}_{k}>$

and $\mathcal{C}$ is LCD if and only if $\mathbb{c}_{i}^{2}\not=0$ for $1\leq
i\leq k$. Furthermore,

$Hull(\mathcal{C})=<\mathbb{c}_{j_{1}}>\perp<\mathbb{c}_{j_{2}}>\perp\cdots\perp<\mathbb{c}_{j_{l}}>\quad\mathbb{c}_{j_{r}}^{2}=0\;\>\forall
1\leq r\leq l.$

Proof. Following [1], we regard $\mathcal{C}$ with the inner product as a
subspace of finite geometry. Therefore, the proof follows from [[1], Theorem
3.7].

###### Corollary 2.2

Let $\mathcal{C}$ be an $[n,k]$ linear code over $\mathbb{F}_{q}$ with
$dim(Hull(\mathcal{C}))=h$ and $q$ is odd. There exists a generator matrix $G$
of $\mathcal{C}$ such that $GG^{T}$ is a diagonal matrix.

Proof. The proof is immediate from Theorem 2.1 by choosing an orthogonal basis
for $\mathcal{C}$.

######  Theorem 2.3 ([13])

If $G$ is a generator matrix for the $[n,k]$ linear code $\mathcal{C}$, then
$\mathcal{C}$ is an LCD code if and only if, the $k\times k$ matrix $GG^{T}$
is nonsingular.

The following proposition was proven in [8]. Theorem 2.1 and Corollary 2.2
give another proof for odd $q$, however, we give a third proof with a direct
approach.

######  Proposition 2.4 ([8])

Let $\mathcal{C}$ be an $[n,k,d]_{q}$ linear code with parity check matrix $H$
and generator matrix G. Then, $rank(HH^{T})$ and $rank(GG)$ are independent of
$H$ and $G$ so that

$rank(HH^{T})=n-k-dim(hull(C^{\perp}))=n-k-dim(hull(C)),$

and

$rank(GG^{T})=k-dim(hull(C^{\perp}))=k-dim(hull(C)).$

Proof. Since $Hull(C)=Hull(C^{\perp})$, the second equalities are obvious. We
have

$\displaystyle Hull(C)$ $\displaystyle=\left\\{x\in\mathbb{F}_{q}^{n}:x\in
C,x\in C^{\perp}\right\\}$ $\displaystyle=\left\\{x\in\mathbb{F}_{q}^{n}:x\in
C,xG^{T}=0\right\\}$
$\displaystyle=\left\\{yG:y\in\mathbb{F}_{q}^{k}\;\>|\;\>yGG^{T}=0\right\\}.$

Note that $\\#Hull(C)=\\#Ker(GG^{T})$, hence $dim(Hull(C))=null(GG^{T})$.
Therefore

$\displaystyle k$ $\displaystyle=rank(GG^{T})+nul(GG^{T})$
$\displaystyle=rank(GG^{T})+dim(Hull(C)).$

This completes the proof for the second statement. Since $G$ is a parity check
matrix of $C^{\perp}$, the first statement can be proven by a similar
argument.

The next theorem introduces a general construction of LCD code from any linear
code over $\mathbb{F}_{q}$ ($q>3$).

######  Theorem 2.5 ([5])

Let $q$ be a power of a prime with $q>3$ and $\mathcal{C}$ be an $[n,k,d]$
linear code over $\mathbb{F}_{q}$. Then, there exists
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}^{n}_{q}$ with $a_{j}\not=0$ for
any $1\leq j\leq n$ such that $\mathcal{C}_{\mathbb{a}}$ is an LCD code.

Let $M$ be an $k\times k$ matrix over $\mathbb{F}_{q}$ and $\mathbb{u}$ be a
vector in $\mathbb{F}_{q}^{k}$. Following [7], we denote by
$diag_{k}[\mathbb{u}]$ the diagonal $k\times k$ matrix whose elements on the
diagonal are $u_{1},\cdots,u_{k}$. Let $I=\\{i_{1},\cdots,i_{l}\\}$ be a
subset of $\\{1,\cdots,k\\}$, we define the submatrix $M_{I}$ of $M$ obtained
by deleting the $i_{1},\cdots,i_{j}$-th rows and columns of $M$. Denote
$M_{I}=1$ if $I=\\{1,2,\cdots,k\\}$ and $M_{\emptyset}=M$. The following
lemmas will be used in the sequel.

######  Lemma 2.6 ([5])

Let $M$ be a $k\times k$ matrix over $\mathbb{F}_{q}$ and $t$ an integer with
$0\leq t\leq k-1$. Suppose that $det(M_{I})=0$ holds for any subset $I$ of
$\\{1,2,\cdots,k\\}$ with $0\leq\\#I\leq t$. Then, for any $1\leq j\leq t+1$
and every word $\mathbb{u}\in\mathbb{F}_{q}^{k}$ of Hamming weight $j$,
denoting its support by $J$, we have:

$det(M+diag_{k}(\mathbb{u}))=\left(\prod_{i\in J}u_{i}\right)det(M_{I}).$

###### Lemma 2.7

Let $M$ be a non-singular $k\times k$ matrix over $\mathbb{F}_{q}$. For any
vector $\mathbb{u}\in\mathbb{F}_{q}^{k}/\\{0\\}$ with Hamming weight $j$ and
support $J$, we suppose that $det(M_{I})=0$ holds for any subset $I$ of $J$
with $1\leq\\#I<j$. Then

$det(M+diag_{k}(\mathbb{u}))=det(M)+\left(\prod\limits_{i\in
J}u_{i}\right)det(M_{J}).$

Proof. We prove this statement by induction on $j$. For any vector
$\mathbb{u}$ of Hamming weight $1$, denoting by $i_{1}$ the position of its
only nonzero coordinate, we have

$det(M+diag_{k}(\mathbb{u}))=det(M)+u_{i_{1}}det(M_{\\{i_{1}\\}}).$

Thus, the statement is true for $j=1$. Assume the statement is true for any
vector $\mathbb{u}$ with Hamming weight $j=1,2,\cdots,s\leq k-1$. Let
$\mathbb{u}$ be any vector with Hamming weight $s+1$ and
$support(\mathbb{u})=\\{i_{1},i_{2},\cdots,i_{s+1}\\}=J$. Let
$\mathbb{u}^{\prime}$ be the vectors with
$support(\mathbb{u}^{\prime})=\\{i_{1},i_{2},\cdots,i_{s}\\}=J^{\prime}$. Then

$det(M+diag(\mathbb{u}))=det(M+diag_{k}(\mathbb{u}^{\prime}))+u_{i_{s+1}}det\left(M_{\\{i_{s+1}\\}}+diag_{k-1}(\mathbb{u}^{\prime})\right).$

Let $M^{\prime}=M_{\\{i_{s+1}\\}}$. Observe that for any subset $I$ of
$J^{\prime}$ with $0\leq\\#I\leq\\#J^{\prime}-1$ we have
$det(M^{\prime}_{I})=det(M_{I\cup{i_{1}}})=0$. Applying Lemma 2.6, we get

$\displaystyle det(M+diag(\mathbb{u}))$
$\displaystyle=det(M+diag_{k}(\mathbb{u}^{\prime}))+\left(\prod_{i\in
J}u_{i}\right)det\left(M_{J}\right).$

By induction assumption we have

$det(M+diag(\mathbb{u}^{\prime}))=det(M)+\left(\prod_{i\in
J^{\prime}}u_{i}\right)det\left(M_{J^{\prime}}\right)=det(M).$

This implies

$det(M+diag_{k}({\boldsymbol{u}}))=det(M)+\left(\prod\limits_{i\in
J}u_{i}\right)det(M_{J}).$

This completes the proof.

##  3 Arbitrary Hull dimension

In this Section, we construct linear codes with small dimensional hull from
any linear code and arbitrary dimensional hull from self-orthogonal codes. The
following lemmas are used in the sequel.

###### Lemma 3.1

Let $q$ be a prime power with $q>3$ and $\mathcal{C}$ be an $[n,k]$ linear
code over $\mathbb{F}_{q}$ with $dim(hull(\mathcal{C}))=h$ and a generator
matrix $G=[I_{k}:P]$. Let
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}_{q}^{n}$ with $a_{j}=1$ for any
$1\leq j\leq n$ except for one entry $a_{i}\not=0,1$ with $0\leq i\leq k$.
Then

$h-1\leq dim(Hull(\mathcal{C}_{\mathbb{a}}))\leq h+1.$

Proof. Let $G^{\prime}$ be a generator matrices of $\mathcal{C}_{\mathbb{a}}$
by multiplying $j$-th column of $G$ by $a_{j}$ for $j\in\\{1,2,\cdots,n\\}$.
Let $M=GG^{T}$ and $\mathbb{u}\in\mathbb{F}_{q}^{n}$ be a vector of length $n$
such that $u_{j}=a^{2}_{j}-1$ for $1\leq j\leq n$. Then $\mathbb{u}$ is a one
weight and

$rank(G^{\prime}{G^{\prime}}^{T})=rank(M+diag(\mathbb{u})).$

Since, $\mathbb{u}$ is a one weight vector then adding $diag(\mathbb{u})$
effect only one entry of $M$. Then the span of $M$ will increase or decrees by
a vector. Therefore

$rank(M)-1\leq rank({G^{\prime}}{G^{\prime}}^{T})\leq rank(M)+1.$

Applying Proposition 2.4, we get

$k-dim(Hull(\mathcal{C}))-1\leq k-dim(Hull(\mathcal{C}_{a}))\leq
k-dim(Hull(\mathcal{C}))+1.$

This implies

$h-1\leq dim(Hull(\mathcal{C}_{a}))\leq h+1.$

This complete the proof.

###### Lemma 3.2

Let $q$ be a prime power with $q>3$ and $\mathcal{C}$ be an $[n,k]$ linear
code over $\mathbb{F}_{q}$ with $h$-hull. Then there exist
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}_{q}^{n}$ with $a_{j}\not=0$ for
any $1\leq j\leq n$ such that $dim(Hull(\mathcal{C}_{\mathbb{a}}))=h-1$.

Proof. Without loss of generality we may assume that the generator matrix of
$\mathcal{C}$ is in standard form. From the proof of Theorem 2.5 [7], there
exist
$\mathbb{a}^{\prime}=(a_{1},\cdots,a_{k},1,\cdots,1)\in\mathbb{F}_{q}^{n}$
with $a_{j}\not=0$ for $0\leq j\leq k$ and
$dim(Hull(\mathcal{C}_{\mathbb{a}^{\prime}}))=0$. Let
$\mathbb{a}_{1}=(a_{1},1,\cdots,1)$ and
$\mathcal{C}_{1}=\mathcal{C}_{\mathbb{a}_{1}}$, then by Lemma 3.1

$dim(Hull(\mathcal{C}_{1}))=h-1\quad\text{ or }\quad
dim(Hull(\mathcal{C}_{1}))\geq h.$

If $dim(Hull(\mathcal{C}_{1}))=h-1$, then the proof is completed. If
$dim(Hull(\mathcal{C}_{1}))\geq h$, let
$\mathbb{a}_{2}=(a_{1},a_{2},1,\cdots,1)$ and
$\mathcal{C}_{2}=\mathcal{C}_{1_{(1,a_{2},1\cdots)}}=\mathcal{C}_{\mathbb{a}_{2}}$.
Applying Lemma 3.1 again

$dim(Hull(\mathcal{C}_{2}))=h-1\quad\text{ or }\quad dim(Hull(C_{2}))\geq h$

and using the same argument again. If $dim(Hull(C_{\mathbb{a}_{i}}))\geq h$
for all $1\leq i\leq k$, where $\mathbb{a}_{1}=(a_{1},1,\cdots,1)$,
$\mathbb{a}_{2}=(a_{1},a_{2},1,\cdots,1),\>\cdots,\>\mathbb{a}_{k}=(a_{0},a_{1},\cdots,a_{k},1,\cdots,1)=a^{\prime}$
this will contradict the existence of $a^{\prime}$ with
$dim(Hull(\mathcal{C}_{a^{\prime}}))=0$. Therefore, there exist
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}_{q}^{n}$ with $a_{j}\not=0$ for
$1\leq j\leq n$ and $dim(Hull(C_{a}))=h-1$.

###### Theorem 3.3

Let $q$ be a power of a prime with $q>3$ and $\mathcal{C}$ be $[n,k,d]$-linear
code over $\mathbb{F}_{q}$ with $dim(Hull(\mathcal{C}))=h$. Then, there exists
$\mathcal{C}_{j}$ codes with the same parameters as $\mathcal{C}$ and

$dim(Hull(\mathcal{C}_{j}))=h$

for any $0\leq j\leq h$.

Proof. We prove this theorem by induction on $j$. Obviously, the statement
holds for $j=h$. Assume, by induction, that the statement holds for all
$h,h-1,\cdots,j$. Let $\mathcal{C}_{j}$ be an $[n,k,d]$ linear code with
$dim(Hull(\mathcal{C}_{j}))=j$. By Lemma 3.2 there exist a monomial equivalent
code $\mathcal{C}_{j-1}$ with $dim(Hull(C_{j-1}))=dim(Hull(C_{j}))-1=j-1$.
This completes the proof.

###### Corollary 3.4

Let $q$ be a power of a prime with $q>3$ and $\mathcal{C}$ be an $[n,k,d]$
self-orthogonal (self-dual) code over $\mathbb{F}_{q}$. Then, there exist
linear codes with the same parameters as $\mathcal{C}$ with arbitrary Hull.

######  Theorem 3.5 ([2, 16])

There exist long $q$-ary self-dual codes which meet the Gilbert-Varshamov
bound for odd $q$.

Combine Theorem 3.5 and Corollary 3.4 we get the following results.

###### Theorem 3.6

[9] Let $h$ be a fixed positive integer. There exist long $h$-hull codes which
meet the Gilbert-Varshamov bound.

Now we give a construction of maximal-entanglement EAQECCs from any linear
code over $\mathbb{F}_{q}$ with $q>3$. Our result significantly improve the
results in [7, 9].

######  Proposition 3.7 ([4])

Let $\mathcal{C}$ be a classical $[n,k,d]$ linear code over $\mathbb{F}_{q}$.
Then there exist $[[n,k-dim(Hull(C)),d;n-k-dim(Hull(C))]]$ EAQECCs over
$\mathbb{F}_{q}$. Further, if $\mathcal{C}$ is MDS then the EAQECCs is also
MDS.

###### Corollary 3.8

Let $\mathcal{C}$ be an $[n,k,d]$ linear code over $\mathbb{F}_{q}$ with $q>3$
and $dim(Hull(\mathcal{C}))=h$. Then there exist $[[n,k-l,d;n-k-l]]_{q}$
EAQECCs for any $1\leq l\leq h$.

###### Example 3.9

Let $\mathcal{C}$ be $[7,3,2]$ self-orthogonal linear code over
$\mathbb{F}_{5}$ with the following generator matrix

$G=\begin{pmatrix}1&0&0&0&0&2&0\\\ 0&1&0&2&2&0&4\\\
0&0&1&1&3&0&3\end{pmatrix}$

Let $a_{0}=(2,2,2,1,1,1,1)$, $a_{1}=(2,2,1,1,1,1,1)$ $a_{2}=(2,1,1,1,1,1,1)$
$a_{3}=(1,1,1,1,1,1,1)$. Then $\mathcal{C}_{a_{i}}$ are linear codes with the
same parameters as $\mathcal{C}$ and

$dim(Hull(\mathcal{C}_{a_{i}}))=i,$

for $0\leq i\leq 3$.

##  4 One Dimensional Hull and Pure LCD code

In Section 3 we showed that for any $h$-hull linear code and any integer $j$
with $0<j\leq h$, there exist an equivalent code $\mathcal{C}_{j}$ with
$dim(Hull(\mathcal{C}_{j}))=j$. A natural question rise; is this operation
invertible? For any LCD code $\mathcal{C}$ with parameters $[n,k,d]$, does a
monomial equivalent code $\mathcal{C}_{1}$ to $\mathcal{C}$ with
$dim(Hull(\mathcal{C}))=1$ exist?. It turns out that, there exist linear codes
where all their monomial equivalent codes are LCD. We introduce the following
definition.

###### Definition 4.1

A linear code $\mathcal{C}$ is called  Pure LCD code if and only if all its
monomial equivalent codes are LCD. i.e

$dim(Hull(\mathcal{C}_{a}))=0,\quad\text{ for all
}\,\mathbb{a}\in{(\mathbb{F}_{q}^{*})^{n}}.$

###### Remark 4.2

Note that the hull of a linear code over a finite field $\mathbb{F}_{q}$ with
$q=2$ or $q=3$ is an invariant of equivalent codes. Therefore, a linear code
$\mathcal{C}$ over $\mathbb{F}_{q}$ ($q\in\\{2,3\\}$) is pure LCD if and only
if $\mathcal{C}$ is LCD.

The following example shows that pure LCD code over $\mathbb{F}_{q}$ ($q>3$)
does exist.

###### Example 4.3

Let $\mathcal{C}$ be the code over $\mathbb{F}_{5}$ with generator matrix

$G=\begin{pmatrix}1&0&0&0&0&4\\\ 0&1&0&2&4&0\\\ 0&0&1&0&0&3\end{pmatrix}.$

Using Magma we can check that all monomial equivalent codes to $\mathcal{C}$
are LCD codes. Hence, $\mathcal{C}$ is pure LCD code.

###### Theorem 4.4

Let $q$ be a prime power with $q>3$ and $\mathcal{C}$ be $[n,k,d]$ LCD code
over $\mathbb{F}_{q}$ with generator matrix $G=[I_{k}:P]$. Let $M=GG^{T}$.
Assume that there exist $1\leq i\leq k$ with $-det(M)/det(M_{\\{i\\}})+1$ is a
nonzero square, then $\mathcal{C}$ is not pure LCD code. Furthermore, let
$\mathbb{a}=(a_{1},\cdots,a_{n})$ with $a_{i}^{2}=-det(M)/det(M_{i})+1$ and
$a_{j}=1$ for all $1\leq j\leq n$ and $j\not=i$, then
$\mathcal{C}_{\mathbb{a}}$ is one dimensional hull.

Proof. Let $G^{\prime}$ be a generator matrix of $\mathcal{C}_{a}$ obtained
from $G$ by multiplying its $i$-th column by $a_{i}$. Then

$det(G^{\prime}{G^{\prime}}^{T})=det(M)+(a_{i}^{2}-1)det(M_{\\{i\\}})=0.$

Therefore, $\mathcal{C}_{a}$ is not LCD by Theorem 2.3. Furthermore

$rank(G^{\prime}{G^{\prime}}^{T})=rank(M+diag(0,\cdots,0,a_{i}^{2}-1,0,\cdots,0)).$

By Lemma 3.1, $rank({G^{\prime}}{G^{\prime}}^{T})=k$ or $=k-1$. Since
$det({G^{\prime}}{G^{\prime}}^{T})=0$ then
$rank({G^{\prime}}{G^{\prime}}^{T})=k-1$ and $\mathcal{C}_{a}$ is one
dimensional hull by Proposition 2.4.

###### Remark 4.5

Using a computer we check that most codes that are not pure LCD codes meet the
requirement of Theorem 4.4. Therefore, combining Theorem 3.3 and Theorem 4.4
is very efficient for constructing one-dimensional Hull codes from any linear
codes.

###### Lemma 4.6

Let $q=2^{t}$ with $t>1$ and $\mathcal{C}$ be $[n,k]$ linear code over
$\mathbb{F}_{q}$ with generator matrix $G=[I_{k}:P]$. Let $M=GG^{T}$. Assume
that there exist $\mathbb{u}\in\mathbb{F}_{q}^{n}$ with
$u_{i}\in\mathbb{F}_{q}/\\{1\\}$ and

$det(M+diag(\mathbb{u}))=0.$

Then $\mathcal{C}$ is not pure LCD code.

Proof. Let $\mathbb{a}=(a_{1},\cdots,a_{n})$ where $a_{i}^{2}-1=u_{i}$ for all
$1\leq i\leq n$. Then $M+diag(\mathbb{u})$ is a generator matrix of
$\mathcal{C}_{\mathbb{a}}$. The rest of the proof follows from Proposition 2.4
and the fact that all non-zero element of $\mathbb{F}_{q}$ are square.

In [9], the author present a week condition on the existence of pure LCD code
over $\mathbb{F}_{2^{t}}$. In the next theorem we give another conditions and
one conjecture.

###### Theorem 4.7

Let $q=2^{t}$ with $t>1$ and let $\mathcal{C}$ be $[n,k,d]$ linear code over
$\mathbb{F}_{q}$. Assume one of the following conditions holds

  * •

$det(M_{j})\not=0$ and $det(M_{j})\not=det(M)$ for some integer $1\leq j\leq
k$.

  * •

There exist a subsets $J\subseteq\\{1,\cdots,n\\}$ with $det(M_{J})\not=0$ and
$det(M_{I})=0$ for any subset $I$ of $J$ with $1\leq I<\\#J$.

Then, $\mathcal{C}$ is not pure LCD code and there exists
$\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}^{n}_{q}$ with $a_{j}\not=0$ for
any $1\leq j\leq n$ such that $\mathcal{C}_{a}$ is one dimensional hull.

Proof. If $\mathcal{C}$ is not an LCD code, the result holds from Theorem 3.3.
We assume that $\mathcal{C}$ is LCD code and let $G=[I_{k}:P]$ be its
generator matrix. Let $M={G}{G}^{T}$, then $det(M)\not=0$.

  * Case 1: If $det(M_{j})\not=0$ and $det(M_{j})\not=det(M)$ for some integer $1\leq j\leq k$. The results holds from Theorem 4.4 and the fact that all element of $\mathbb{F}_{q}$ are squares.

  * Case 2: Note that, there exist a subsets $J\subseteq\\{1,\cdots,n\\}$ with $det(M_{J})\not=0$ and $det(M_{I})=0$ for any subset $I$ of $J$ with $1\leq I<\\#J$. Let $\mathbb{u}=(u_{1},\cdots,u_{n})$ with $u_{i}=0$ for $i\not\in J$. Using Lemma 2.6 we get

$\displaystyle det(M+diag(\mathbb{u}))$
$\displaystyle=det(M)+\left(\prod_{i\in J}u_{i}\right)det(M_{J})$
$\displaystyle=det(M)+u_{j_{1}}u_{j_{2}}\left(\prod_{i\in
J\setminus\\{j_{1},j_{2}\\}}u_{i}\right)det(M_{J}).$

By choosing $u_{j}\in\mathbb{F}_{q}\setminus\\{0,1\\}$ for $j\in
J\setminus\\{j_{1},j_{2}\\}$ and

$u_{j_{1}}=\begin{cases}u_{j_{2}}^{-1}&\text{ if }\left(\prod_{i\in
J/\\{j_{1},j_{2}\\}}u_{i}\right)\frac{det(M_{J})}{det(M)}=1,\\\
\left(\prod_{i\in
J/\\{j_{1},j_{2}\\}}u_{i}\right)^{2}\left(\frac{det(M_{J})}{det(M)}\right)^{2}&\text{
otherwise}.\end{cases}$

Because $u_{i}\not=1$ for all $1\leq i\leq n$ and $det(M+diag(\mathbb{u}))=0$,
the result holds from Lemma 4.6 and Theorem 3.3.

###### Remark 4.8

Theorem 4.7, give very powerful restriction on the existence of pure LCD code
over $\mathbb{F}_{2^{t}}$. In fact, linear $[n,k]$ codes with generator matrix
$GG^{T}=I_{k}$ are the only codes we found that escape this two condition and
its not difficult to prove such codes are not pure LCD code. Therefore we
introduce the following conjecture.

###### Conjecture 4.1

Let $q=2^{t}$ with $t>1$ and $\mathcal{C}$ be an $[n,k]$ linear code over
$\mathbb{F}_{q}$. Then $\mathcal{C}$ is not pure LCD code.

In the following theorem we shows that there exist infinitely many pure LCD
codes.

###### Theorem 4.9

Let $q$ be an odd prime power. Let $\mathcal{C}$ be an $[n,k]_{q}$ linear code
with the generator matrix $G=[I_{k}:I_{k}]$. If $-1$ is not a square in
$\mathbb{F}_{q}$ then $\mathcal{C}$ is pure LCD code.

Proof. Let $\mathbb{a}=(a_{1},\cdots,a_{n})\in\mathbb{F}_{q}$ with
$a_{j}\not=0$ for any $1\leq j\leq n$. Let $G^{\prime}$ be the generator
matrix of $\mathcal{C}_{\mathbb{a}}$ obtained from $G$ by multiplying its
$j$-th column by $a_{j}$ for $j\in\left\\{1,2,\cdots,n\right\\}$. Then

${G^{\prime}}{G^{\prime}}^{T}=\begin{pmatrix}\begin{matrix}a_{1}^{2}+a_{k+1}^{2}&\\\
&a_{2}^{2}+a_{k+2}^{2}\end{matrix}&&\makebox(0.0,0.0)[]{\text{\huge 0}}\\\
\makebox(0.0,0.0)[]{\text{\huge 0}}&&\begin{matrix}\ddots&\\\
&a_{k}^{2}+a_{2k}^{2}\end{matrix}\end{pmatrix}.$

Since, $-1$ is not a square in $\mathbb{F}_{q}$ then $a_{i}^{2}+a_{i+k}^{2}=0$
if and only if $a_{i}=0$ and $a_{i+k}=0$. Hence
$rank({G^{\prime}}{G^{\prime}}^{T})=k$. Therefore, by Proposition 2.4

$dim(Hull(\mathcal{C}_{a}))=0.$

This completes the proof.

## Concluding remarks

In this paper, we presented a general construction of linear code with a small
dimensional hull from any linear codes. We showed that for any linear code
with $h$-hull dimension, there exists an equivalent code with $h$-hull for any
$0\leq j\leq c$. In particular, for any $[n,k,d]$ self-orthogonal code there
exists a code with the same parameters and with an arbitrary dimensional hull.
We also introduce the notion of pure LCD code. Furthermore, we give sufficient
conditions for the existence of one dimensional $[n,k,d]$ code from another
code with the same parameters.

Finally, we present a family of pure LCD codes over finite fields with odd
characteristics and very week conditions for the existence of pure LCD code
over finite fields with even characteristics and rise a conjecture for this
case. An interesting extension to this work would be to give a necessary and
sufficient condition for the existence of pure LCD code over finite fields
with odd characteristics.

## References

  * [1] Artin, E.: Geometric Algebra (Interscience Tracts in Pure and Applied Mathematics No. 3), Interscience, New York, 1957.
  * [2] Bassa A., Stichtenoth H., Self-dual codes better than the GilbertVarshamov bound, Des., Codes and Cryptogr. 87, 173-182, (2019).
  * [3] Boonniyom, K., Jitman, S.: Complementary dual subfield linear codes over finite fields. [Online]. Available: https://arxiv.org/abs/1605.06827 (2016).
  * [4] Brun T., Devetak I., Hsieh M.H.: Correcting quantum errors with entanglement. Science 314, 436-439 (2006).
  * [5] Carlet, C., Mesnager, S., Tang, C., Qi, Y., Pellikaan, R.: Linear codes over $\mathbb{F}_{q}$ are equivalent to LCD codes for $q>3$. IEEE Trans. Inf. Theory 64(4), 3010-3017 (2018).
  * [6] Carlet, C., Mesnager, S., Tang, C., Qi, Y., Pellikaan, R.: Linear codes over $\mathbb{F}_{q}$ are equivalent to LCD codes for $q>3$. IEEE Transactions on Information Theory, 64(4), 3010-3017 (2018).
  * [7] Carlet, C., Li, C., Mesnager, S.: Linear codes with small hulls in semi-primitive case. Des. Codes Cryptogr, (87), 3063-3075 (2019).
  * [8] Guenda, K., Jitman, S., Gulliver, T.A.: Constructions of good entanglement assisted quantum error correcting codes. Des. Codes Cryptogr. 86, 121-136 (2018).
  * [9] Chen, H. On the Hull-Variation Problem of Equivalent Linear Codes. IEEE Trans. Inf. Theory 69(5), 2911-2922 (2023).
  * [10] Jin L.: Construction of MDS codes with complementary duals. IEEE Trans. Inf. Theory 63(5), 2843–2847 (2017).
  * [11] Li, C., Zeng, P.: Constructions of linear codes with one-dimensional hull, IEEE Trans. Inf. Theory, 65(3), 1668-1676 (2019).
  * [12] Massey, J. L.: Linear codes with complementary duals. Discrete Mathematics, 106, 337-342 (1992).
  * [13] Massey J.L.: Linear codes with complementary duals. Discret. Math. 106(107), 337-342 (1992).
  * [14] Sendrier N.: On the dimension of the hull. SIAM J. Discret. Math. 10(2), 282–293 (1997).
  * [15] Sok, L.: MDS linear codes with one-dimensional hull. Cryptography and Communications, 14(5), 949-971 (2022).
  * [16] Stichtenoth H., Transative and self-dual codes attaining the TsafasmanVladut-Zink bound, IEEE Trans. Inf. Theory, 52(5), 2218-2224, (2006).
  * [17] Yan H., Liu H., Li C., Yang S.: Parameters of LCD BCH codes with two lengths. Adv. Math. Commun. 12(3), 579–594 (2018). 39\.
  * [18] Yang X., Massey J.L.: The condition for a cyclic code to have a complementary dual. Discret. Math. 126(1-3), 391-393 (1994).