1 Introduction

The main motivation to study Hermitian self-orthogonal codes is their application to quantum error-correcting codes. The most prevalent and applicative quantum codes are qubit codes, in which the quantum state is encoded on n quantum particles with two-states. In this case, the quantum code is a subspace of \(({\mathbb C}^2)^{\otimes n}\). More generally, a quantum code is a subspace of \(({\mathbb C}^q)^{\otimes n}\). The parameter q is called the local dimension and corresponds to the number of states each quantum particle of the system has. A qubit is then referred to as a quqit.

A quantum code with minimum distance d is able to detect errors, which act non-trivially on the code space, on up to \(d-1\) of the quqits and correct errors on up to \(\frac{1}{2}(d-1)\) of the quqits. If the code encodes k logical quqits onto n quqits then we say the quantum code is an \([\![ n,k,d ]\!] _q\) code. It has dimension \(q^k\).

Suppose that \(q=p^h\) is a prime power and let \({\mathbb F}_q\) denote the finite field with q elements. A linear code C of length n over \({\mathbb F}_q\) is a subspace of \({\mathbb F}_q^n\). If the minimum weight of a non-zero element of C is d then the minimum (Hamming) distance between any two elements of C is d and we say that C is a \([n,k,d]_q\) code, where k is the dimension of the subspace C. If we do not wish to specify the minimum distance then we say that C is a \([n,k]_q\) code.

A canonical Hermitian form on \({\mathbb F}_{q^2}^n\) is given by

$$\begin{aligned} (u,v)_h=\sum _{i=1}^n u_iv_i^q. \end{aligned}$$

If C is a linear code over \({\mathbb F}_{q^2}\) then its Hermitian dual is defined as

$$\begin{aligned} C^{\perp _h}=\{ v \in {\mathbb F}_{q^2}^n \ | \ (u,v)_h=0, \ \mathrm {for} \ \mathrm {all} \ u \in C \}. \end{aligned}$$

The standard dual of C will be denoted by \(C^{\perp }\). Observe that \(v \in C^{\perp }\) if and only if \(v^q \in C^{\perp _h}\), so both of the dual codes have the same weight distribution.

One very common construction of quantum stabiliser codes relies on the following theorem from Ketkar et al. [7, Corollary19]. It is a generalisation from the qubit case of a construction introduced by Calderbank et al. [2, Theorem2].

Theorem 1

If there is a \([n,k]_{q^2}\) linear code C such that \(C \leqslant C^{\perp _h}\) then there exists an \( [\![ n,n-2k,d]\!] _q\) quantum code, where d is the minimum weight of the elements of \(C^{\perp _h} \setminus C\) if \(k \ne \frac{1}{2}n\) and d is the minimum weight of the non-zero elements of \(C^{\perp _h}=C\) if \(k=\frac{1}{2}n\).

If \(C \leqslant C^{\perp _h}\) then we say the linear code C is Hermitian self-orthogonal. Theorem 1 is our motivation to study Hermitian self-orthogonal codes. We can scale the i-th coordinate of all the elements of C by a non-zero scalar \(v_i\), without altering the parameters of the code. Such a scaling, together with a reordering of the coordinates, gives a code which is said to be linearly equivalent to C.

Thus, a linear code D is linearly equivalent to a linear code C over \({\mathbb F}_q\) if, after a suitable re-ordering of the coordinates, there exist non-zero \(\theta _i \in {\mathbb F}_q\) such that

$$\begin{aligned} D=\{ (\theta _1u_1,\ldots ,\theta _n u_n) \ | \ (u_1,\ldots ,u_n) \in C\}. \end{aligned}$$

A truncation of a code is a code obtained from C by deletion of coordinates. Observe that a truncation can reduce the dimension of the code but the dual minimum distance can only increase.

We will be interested in the following question: Given a linear \([n,k,d]_q\) code C, what truncations does C have which are linearly equivalent to Hermitian self-orthogonal codes?

In the special case that C is a k-dimensional Reed-Solomon code, the above question was answered by the authors in [1]. The code C has a truncation of length \(m \leqslant q^2\) which is linearly equivalent to a Hermitian self-orthogonal code if and only if there is a polynomial \(g(X) \in {\mathbb F}_{q^2}[X]\) of degree at most \((q-k)q-1\) with the property that \(g(x)+g(x)^q\), when evaluated at the elements \(x \in {\mathbb F}_{q^2}\), has precisely \(q^2+1-m\) zeros.

2 Hermitian self-orthogonal codes

Let C be a linear code of length n over \({\mathbb F}_{q^2}\). We have that C is linearly equivalent to a Hermitian self-orthogonal code if and only if there are non-zero \(\theta _i \in {\mathbb F}_{q^2}\) such that

$$\begin{aligned} \sum _{i=1}^n \theta _{i}^{q+1}u_{i}v_{i}^q=0, \end{aligned}$$

for all \(u,v \in C\). Note that \(\theta _{i}^{q+1}\) is an non-zero element of \({\mathbb F}_q\), so equivalently C is linearly equivalent to a Hermitian self-orthogonal code if and only if there are non-zero \(\lambda _i \in {\mathbb F}_{q}\) such that

$$\begin{aligned} \sum _{i=1}^n \lambda _{i} u_{i}v_{i}^q=0. \end{aligned}$$

For any linear code C over \({\mathbb F}_{q^2}\) of length n, Rains [8] defined the puncture code P(C) to be

$$\begin{aligned} P(C)=\{\lambda =(\lambda _{1},\ldots ,\lambda _n) \in {\mathbb F}_q^n \ | \ \sum _{{i}=1}^n \lambda _{i} u_{i}v_{i}^q=0, \ \mathrm {for} \ \mathrm {all} \ u,v \in C \}. \end{aligned}$$

Then, clearly we have the following theorem.

Theorem 2

There is a truncation of a linear code C over \({\mathbb F}_{q^2}\) of length n to a linear over \({\mathbb F}_{q^2}\) of length \(r \leqslant n\) which is linearly Hermitian self-orthogonal code if and only if there is an element of P(C) of weight r.

Thus, as emphasised in [6], the puncture code is an extremely useful tool in constructing Hermitian self-orthogonal codes. Observe that, the minimum distance of any quantum code, given by an element in the puncture code, will have minimum distance at least the minimum distance of \(C^{\perp }\), since any element in the dual of the shortened code will be an element of \(C^{\perp }\) if we replace the deleted coordinates with zeros.

Given a linear code C over \({\mathbb F}_{q^2}\) it is not obvious how one can efficiently compute the puncture code. Let \(\mathrm {G}=(g_{i\ell })\) be a generator matrix for C, i.e. a \(k \times n\) matrix whose row-span is C. A straightforward approach would be to construct a \({k+1 \atopwithdelims ()2} \times n\) matrix \(\mathrm {T}(\mathrm {G})=(t_{ij,\ell })\) over \({\mathbb F}_{q^2}\), where for \(\{i,j\} \subseteq \{1,\ldots ,k\}\) we define

$$\begin{aligned} t_{ij,\ell }=\left\{ \begin{array}{l@{\quad }l} g_{i\ell }g_{j\ell }^q &{} i<j, \\ g_{i\ell }^{q+1} &{} i=j. \end{array} \right. \end{aligned}$$
(1)

Lemma 3

The puncture code P(C) is the intersection of the right-kernel of \(\mathrm {T}(\mathrm {G})\) with \({\mathbb F}_q^n\).

Proof

For any \(u,v \in C\),

$$\begin{aligned} u_{\ell }=\sum _{i=1}^k a_ig_{i\ell } \ \ \mathrm {and}\ \ v_{\ell }=\sum _{j=1}^k b_j g_{j\ell } \end{aligned}$$

for some \((a_1,\ldots ,a_k) \in {\mathbb F}_q^k\) and \((b_1,\ldots ,b_k) \in {\mathbb F}_q^k\).

Since

$$\begin{aligned} \sum _{{\ell }=1}^n \lambda _{\ell } u_{\ell }v_{\ell }^q =\sum _{i=1}^k \sum _{j=1}^k a_i b_j ^q \sum _{{\ell }=1}^n \lambda _{\ell } g_{i\ell } g_{j\ell }^q, \end{aligned}$$

we have that \(\lambda =(\lambda _1,\ldots ,\lambda _n)\) is in the right-kernel of \(\mathrm {T}(\mathrm {G})\) if and only if

$$\begin{aligned} \sum _{{\ell }=1}^n \lambda _{\ell } u_{\ell }v_{\ell }^q=0, \end{aligned}$$

for all \(u,v \in C\). \(\square \)

Thus, the puncture code P(C) can then be found by extracting the elements in the right-kernel of \(\mathrm {T}(\mathrm {G})\) all of whose coordinates are elements of \({\mathbb F}_q\). However, this quickly becomes unfeasible computationally for larger parameters.

Our first aim, which we will deal with now, is to construct a parity check matrix for P(C), i.e. a matrix over \({\mathbb F}_q\) whose right-kernel is P(C). This allows one to determine, given a linear code C over \({\mathbb F}_{q^2}\), all truncations of C which are linearly equivalent to a Hermitian self-orthogonal code, provided that the dimension of P(C) is not too large.

Let \(e \in {\mathbb F}_{q^2} \setminus {\mathbb F}_q\).

Let \(\mathrm {M}(\mathrm {G})=(m_{ij,\ell })\) be a \(k^2 \times n\) matrix where, for \(i,j \in \{1,\ldots ,k\}\), we define

$$\begin{aligned} m_{ij,\ell }=\left\{ \begin{array}{ll} e g_{i\ell }g_{j\ell }^q+e^q g_{i\ell }^qg_{j\ell } &{} i<j \\ g_{i\ell }g_{j\ell }^q+ g_{i\ell }^qg_{j\ell } &{} i>j \\ g_{i\ell }^{q+1} &{} i=j \end{array} \right. . \end{aligned}$$

Theorem 4

The matrix \(\mathrm {M}(\mathrm {G})\) is a parity check matrix for P(C). i.e. \(\mathrm {M}(\mathrm {G})\) is defined over \({\mathbb F}_{q}\) and its right-kernel is P(C).

Proof

Observe first that all the entries in the matrix \(\mathrm {M}(\mathrm {G})\) are in \({\mathbb F}_{q}\).

Suppose that \(\lambda =(\lambda _1,\ldots ,\lambda _n)\) is in the right-kernel of \(\mathrm {M}(\mathrm {G})\). Hence, for all \(i,j \in \{1,\ldots ,k\}\) with \(i<j\),

$$\begin{aligned} \sum _{\ell =1}^n \lambda _{\ell }( e g_{i\ell }g_{j\ell }^q+e^q g_{i\ell }^qg_{j\ell })=0 \end{aligned}$$

and

$$\begin{aligned} \sum _{\ell =1}^n \lambda _{\ell } (g_{j\ell }g_{i\ell }^q+ g_{j\ell }^qg_{i\ell })=0. \end{aligned}$$

Multiplying the latter equation by \(e^q\) and subtracting the former implies

$$\begin{aligned} (e^q-e)\sum _{\ell =1}^n \lambda _{\ell } g_{i\ell } g_{j\ell }^q=0. \end{aligned}$$

Since \(\lambda =(\lambda _1,\ldots ,\lambda _n)\) is in the right-kernel of \(\mathrm {M}(\mathrm {G})\) we also have that

$$\begin{aligned} \sum _{\ell =1}^n \lambda _{\ell } g_{i\ell }^{q+1}=0. \end{aligned}$$

Hence, \(\lambda \) is in the right-kernel of \(\mathrm {T}(\mathrm {G})\).

Since it is also in \({\mathbb F}_q^n\), by Lemma 3, \(\lambda \in P(C)\).

Suppose that \(\lambda =(\lambda _1,\ldots ,\lambda _n) \in P(C)\). Then, for all \(i,j \in \{1,\ldots ,k\}\),

$$\begin{aligned} \sum _{\ell =1}^n \lambda _{\ell } g_{i\ell } g_{j\ell }^q=0. \end{aligned}$$

This implies that \(\lambda \) is in the right-kernel of \(\mathrm {M}(\mathrm {G})\). \(\square \)

Example 5

Theorem 4 can allow us to efficiently calculate the puncture code of a linear code. Then for each codeword of weight r in the puncture code, by Theorem 2, we can construct a quantum error correcting code of length r. For example, let C be the linear \([43,7]_4\) code, which is dual to the cyclic linear \([43,36,5]_4\) code, constructed from the divisor of \(x^{43}-1\),

$$\begin{aligned} x^7 + e x^5 + x^4 + x^3 + e^2x^2 + 1, \end{aligned}$$

where e is a primitive element of \({\mathbb F}_4\).

By Theorem 4, we can calculate the puncture code from the \(49 \times 43\) matrix \(\mathrm {M}\) over \({\mathbb F}_2\), which turns out to have rank 29. The puncture code P(C) has weights \(14+2j\) for all \(j \in \{0,1,2,3,4,5,6,7,8\}\).

The truncations to codes of length 14 give a \([14,7,6]_4\) code which is equal to its Hermitian dual. By Theorem 1, this implies the existence of a \([\![14,0,6]\!]_2\) quantum code.

The truncations to codes of length \(18+2j\) give a \([18+2j,7]_4\) code with dual minimum distance 5, which by Theorem 1 implies the existence of a \([\![18+2j,4+2j,5]\!]_2\) quantum code, for all \(j \in \{0,1,2,3,4,5,6\}\).

These codes equal the best known qubit error-correcting codes, according to Grassl [5].

Example 6

Consider the dual C to the cyclic linear \([51,42,6]_4\) code, constructed from the divisor of \(x^{51}-1\),

$$\begin{aligned} x^9 + e^2x^8 + ex^6 + x^5 + e^2x^4 + e^2x^2 + e^2x + 1. \end{aligned}$$

The dimension of the puncture code P(C) is 10. The puncture code P(C) has codewords of weight \(18+2j\), for all \(j \in \{0,2,3,4,6,7,8\}\), which implies that it truncates to codes equivalent to Hermitian self-orthogonal codes of length \(18+2j\). One can check these are \([18+2j,9]_4\) codes with dual minimum distance 6. By Theorem 1, this implies the existence of a \([\![18+2j,2j,6]\!]_2\) quantum code, for all \(j \in \{0,2,3,4,6,7,8\}\).

Example 7

Consider C the \([15,5]_9\) code with generator matrix

$$\begin{aligned} \mathrm {G}= \left( \begin{array}{ccccccccccccccc} 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0 \\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0 \\ e^7&{}\quad e^6&{}\quad e^5&{}\quad e^4&{}\quad 1&{}\quad e&{}\quad e^3&{}\quad e^5&{}\quad e^4&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0 \\ e^3&{}\quad e&{}\quad e^4&{}\quad e^5&{}\quad 1&{}\quad e^6&{}\quad e^7&{}\quad e^4&{}\quad e^5&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0 \\ e^6&{}\quad e^7&{}\quad e^5&{}\quad e^2&{}\quad e^4&{}\quad e^2&{}\quad e^6&{}\quad e^7&{}\quad e^3&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1 \end{array} \right) \end{aligned}$$

The dual code \(C^{\perp }\) is a linear \([15,10,5]_9\) code. The dimension of the puncture code P(C) is 2 and has codewords of weight 9, 12 and 15. This implies that it truncates to codes equivalent to Hermitian self-orthogonal codes of length 9, 12 and 15 and one can check that these codes are a \([9,4]_9\), a \([12,5]_9\) and a \([15,5]_9\) codes all with dual minimum distance 5. By Theorem 1, this implies the existence of a \([\![9,1,5]\!]_3\), a \([\![12,2,5]\!]_3\) and a \([\![15,5,5]\!]_3\) code. The former of these attains the quantum Singleton bound, proved by Rains in [8], which states that

$$\begin{aligned} k\leqslant n-2(d-1). \end{aligned}$$

It was proven in [1] that a \([9,4,6]_9\) MDS code does not come from a truncation of a generalised Reed-Solomon code. The only \([9,4,6]_9\) code which is not the truncation of a generalised Reed-Solomon code is the projection of Glynn’s \([10,5,6]_9\) MDS code, see [4].

3 The geometry of Hermitian self-orthogonal codes

Let \(\mathrm {PG}(k-1,q)\) denote the \((k-1)\)-dimensional projective space over \({\mathbb F}_q\).

A Hermitian form is given by

$$\begin{aligned} H(X)=\sum _{1 \leqslant i<j \leqslant k} (h_{ij}X_iX_j^q+ h_{ij}^qX_i^qX_j)+\sum _{i=1}^k h_{ii}^{q+1} X_i^{q+1}. \end{aligned}$$

for some \(h_{ij} \in {\mathbb F}_{q^2}\).

The set of Hermitian forms is a \(k^2\)-dimensional vector space over \({\mathbb F}_q\).

Let \(\mathrm {G}=(g_{i\ell })\) be a \(k \times n\) generator matrix for a linear code C whose dual minimum distance is at least three. Let \(\mathcal {X}\) be the set of columns of \(\mathrm {G}\) considered as points of \(\mathrm {PG}(k-1,q)\). Observe that the condition that the dual code of C has minimum distance at least three ensures that \(\mathcal X\) is a set (and not a multi-set). Such a code is often called a projective code. Observe that the set \(\mathcal {X}\) is the same for all codes linearly equivalent to C. Let \(\mathrm {HF}(\mathcal X)\) be the subspace of Hermitian forms that are zero on \(\mathcal X\).

Lemma 8

The dimension of the left kernel of the matrix \(\mathrm {M}(\mathrm {G})\) is equal to \(\dim \mathrm {HF}(\mathcal X)\).

Proof

Let \(x \in \mathcal X\) and consider a vector v in the left kernel of \(\mathrm {M}(\mathrm {G})\).

Observe that the coordinates of v are indexed by \(i,j \in \{1,\ldots ,k\}\).

Since x is a column of \(\mathrm {G}\),

$$\begin{aligned} \sum _{i,j=0}^k v_{ij} (e x_{i}x_{j}^q+e^q x_{i}^q x_{j}) + v_{ji}( x_{i}x_{j}^q+ x_{i}^qx_{j} )+ \sum _{i=1}^k v_{ii}x_{i}^{q+1}=0. \end{aligned}$$

Thus, defining

$$\begin{aligned} h_{ij}=ev_{ij}+v_{ji} \ \ \mathrm {and} \ \ h_{ii}^{q+1}=v_{ii}, \end{aligned}$$

we have that

$$\begin{aligned} H(x)=0. \end{aligned}$$

Letting v run over a basis for the left kernel of \(\mathrm {M}(\mathrm {G})\), we obtain a set of linearly independent Hermitian forms. Indeed, let B be a basis for the left kernel of \(\mathrm {M}(\mathrm {G})\). Suppose there are \(\lambda _v \in {\mathbb F}_q\), for \(v \in B\), not all zero, such that, for all \(i,j \in \{1,\ldots ,k\}\),

$$\begin{aligned} \sum _{v \in B} \lambda _v(ev_{ij}+v_{ji})=0, \ \ \sum _{v \in B} \lambda _v v_{ii}=0. \end{aligned}$$

Since \(e \in {\mathbb F}_{q^2} \setminus {\mathbb F}_q\), this implies

$$\begin{aligned} \sum _{v \in B} \lambda _v v_{ij}=0, \end{aligned}$$

for all \(i,j \in \{1,\ldots ,k\}\), contradicting the fact that B is a basis.

Vice-versa, if \(H(x)=0\) for some Hermitian form H, then we obtain \(v_{ij}\) by solving

$$\begin{aligned} h_{ij}=ev_{ij}+v_{ji} \ \ \mathrm {and} \ \ h_{ij}^q=e^qv_{ij}+v_{ji}, \end{aligned}$$

where \(v_{ij},v_{ji} \in {\mathbb F}_q\), and \(v_{ii}=h_{ii}^{q+1}\). Letting H run over a basis for \(\mathrm {HF}(\mathcal X)\), we obtain a set of linearly independent vectors in the left kernel of the matrix \(\mathrm {M}(\mathrm {G})\). \(\square \)

The previous lemma allows us to calculate the dimension of the puncture code in terms of the dimension of the space of Hermitian forms which are zero on \(\mathcal X\). In the following \(\mathcal X\) is obtained, as before, as the set of columns of a generator matrix for C, viewed as points of \(\mathrm {PG}(k-1,q)\). Note, that the statement that \(\mathcal X\) imposes r conditions on the space of Hermitian forms is to say that the co-dimension of \(\mathrm {HF}(\mathcal X)\) is r.

Theorem 9

The set \(\mathcal X\) imposes \(n-\dim P(C)\) conditions on the space of Hermitian forms and

$$\begin{aligned} \dim P(C)=n-k^2+\dim \mathrm {HF}(\mathcal X). \end{aligned}$$

Proof

By Lemma 8,

$$\begin{aligned} \dim \mathrm {HF}(\mathcal X)=\dim \mathrm {left} \, \mathrm {kernel}\ \mathrm {M}(\mathrm {G})=k^2-\mathrm {rank}\; \mathrm {M}(\mathrm {G}). \end{aligned}$$

By Theorem 4,

$$\begin{aligned} n-\mathrm {rank}\; \mathrm {M}(\mathrm {G}))=\dim P(C), \end{aligned}$$

which proves the second statement. For the first statement, observe that \(\dim \mathrm {HF}(\mathcal X)= k^2-r\), where r is the number of conditions imposed by \(\mathcal X\) on the space of Hermitian forms. \(\square \)

Note that in the following statements the truncation may be the code itself.

Theorem 10

The set of points \(\mathcal X\) imposes \(|\mathcal X|\) conditions on the space of Hermitian forms if and only if no truncation of C is equivalent to a Hermitian self-orthogonal code.

Proof

Theorem 9 implies that the set of points \(\mathcal X\) imposes n conditions on the space of Hermitian forms if and only if \(\dim P(C)=0\) which, by Theorem 2, is if and only if no truncation of C is equivalent to a Hermitian self-orthogonal code. \(\square \)

Thus, from Theorem 10, we deduce that to find codes contained in their Hermitian dual it is necessary and sufficient to find a set of points \(\mathcal X\) which does not impose \(|\mathcal X|\) conditions on the space of Hermitian forms.

Theorem 11

The set of points \(\mathcal X\) imposes less than \(|\mathcal X|\) conditions on the space of Hermitian forms if and only if some truncation of C is linearly equivalent to a Hermitian self-orthogonal code.

Theorem 11 has some immediate consequences.

Theorem 12

A linear \([n,k]_{q^2}\) code for which \(n>k^2\) has a truncation which is linearly equivalent to Hermitian self-orthogonal code.

Proof

Since n is larger than the dimension of the space of Hermitian forms, \(\mathcal X\) cannot impose n conditions on the space of Hermitian forms. Hence, Theorem 11 implies the statement.

Example 13

Let e be a primitive element of \({\mathbb F}_9\), where \(e^2=e+1\). Let D be the cyclic linear \([73,66,6]_9\) code, constructed from the divisor of \(x^{73}-1\),

$$\begin{aligned} x^7 + e x^6 + e^6x^5 + e^3x^4 + e^7x^3 + e^2x^2 +e^5x+ 2. \end{aligned}$$

Let C be the [60, 7] code obtained from \(D^{\perp }\) be deleting coordinates 61–73. The dimension of the puncture code P(C) is 11. The puncture code P(C) has codewords of weight \(\{26,27,\ldots ,55\}\) which implies the existence of a \([\![n,n-14, 6]\!]_3\) quantum codes, for all \(n \in \{26,27,\ldots ,55\}\).

The previous theorem and following theorem are the main results of this paper.

Theorem 14

A linear \([n,k]_{q^2}\) code C of length n over \({\mathbb F}_{q^2}\) which has no truncations which are linearly equivalent to a Hermitian self-orthogonal code can be extended to \(C'\), a \([n+1,k]_{q^2}\) code which does have a truncation to a code which is linearly equivalent to a Hermitian self-orthogonal code, if and only if \(\mathcal X\) imposes n conditions on the space of Hermitian forms and the set of common zeros of \(\mathrm {HF}(\mathcal X)\) is larger than \(|\mathcal X|\).

Proof

(\(\Rightarrow \)) Let \(\mathcal X'\) be the set of columns of a generator matrix for \(C'\) obtained by extending the matrix \(\mathrm {G}\). By Theorem 9, both \(\mathcal X\) and \(\mathcal X'\) impose n conditions on the space of Hermitian forms. Hence,

$$\begin{aligned} \mathrm {HF}(\mathcal X)=\mathrm {HF}(\mathcal X') \end{aligned}$$

which implies that the set of common zeros of \(\mathrm {HF}(\mathcal X)\) contains \(\mathcal X'\).

(\(\Leftarrow \)) Let \(\mathcal X'=\mathcal X \cup \{x\}\) be a subset of the set of common zeros of \(\mathrm {HF}(\mathcal X)\). Let \(C'\) be the code with generator matrix whose columns are the elements of \(\mathcal X'\). Then \(\mathcal X'\) imposes n conditions on the space of Hermitian forms, so Theorem 9 implies that \(\dim P(C')=1\). Thus, \(C'\) extends C to a \([n+1,k]_{q^2}\) code which has a truncation to a code which is linearly equivalent to a Hermitian self-orthogonal code. \(\square \)

Theorem 14 indicates that to extend a linear code C to a Hermitian self-orthogonal code, we should calculate the set of common zeros of the Hermitian forms which are zero on the columns of a generator matrix for C.

Example 15

The \([13,7]_4\) code generated by the matrix

$$\begin{aligned} \mathrm {G}= \left( \begin{array}{ccccccccccccc} 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad e&{}\quad 0&{}\quad e^2&{}\quad e&{}\quad e \\ 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e&{}\quad e&{}\quad e&{}\quad 0&{}\quad e^2 \\ 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad e&{}\quad e^2&{}\quad 1&{}\quad 0 \\ 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e&{}\quad 1&{}\quad 0&{}\quad e&{}\quad 0&{}\quad e^2 \\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e^2&{}\quad e^2&{}\quad e&{}\quad e&{}\quad 0 \\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad e^2&{}\quad e^2&{}\quad e&{}\quad 1&{}\quad e^2&{}\quad e \\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad e^2&{}\quad e&{}\quad e^2 \end{array} \right) \end{aligned}$$

has dual minimum distance 6. As before, let \(\mathcal X\) be the 13 points which are the columns of the matrix \(\mathrm {G}\). The dimension of \(\mathrm {HF}(\mathcal X)\) is 36, so \(\mathcal X\) imposes 13 conditions on the space of Hermitian forms. Theorem 9 implies that \(\dim P(C)=0\), so C has no truncations which are linearly equivalent to Hermitian self-orthogonal codes. However, there are 14 points which are common zeros of the zeros of \(\mathrm {HF}(\mathcal X)\), the points of \(\mathcal X\) and the point

$$\begin{aligned} (0,e,0,1,e,1,1). \end{aligned}$$

Thus, Theorem 14 implies that the \([14,7]_4\) code, with generator matrix

$$\begin{aligned} \left( \begin{array}{cccccccccccccc} 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad e&{}\quad 0&{}\quad e^2&{}\quad e&{}\quad e &{}\quad 0 \\ 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e&{}\quad e&{}\quad e&{}\quad 0&{}\quad e^2 &{}\quad e\\ 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad e&{}\quad e^2&{}\quad 1&{}\quad 0 &{}\quad 0\\ 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e&{}\quad 1&{}\quad 0&{}\quad e&{}\quad 0&{}\quad e^2 &{}\quad 1\\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad e^2&{}\quad e^2&{}\quad e&{}\quad e&{}\quad 0 &{}\quad e\\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad e^2&{}\quad e^2&{}\quad e&{}\quad 1&{}\quad e^2&{}\quad e &{}\quad 1\\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad e^2&{}\quad e&{}\quad e^2 &{}\quad 1\\ \end{array} \right) \end{aligned}$$

has a truncation which is Hermitian self-orthogonal. Indeed, one can check that the code itself is Hermitian self-orthogonal. Thus, from this code we can construct, by Theorem 1, a \([\![14,0,6]\!]_2\) code.

4 Conclusions and further work

In conclusion, we give a summary of the main results.

Suppose that \(C^{\perp }\) is a \([n,n-k,d]_{q^2}\), where \(d \geqslant 3\).

If \(n >k^2\) then we have shown that there are truncations of C which are linearly equivalent to Hermitian self-orthogonal codes.

If \(n\leqslant k^2\) and \(\dim P(C)>0\) then there are truncations of C which are linearly equivalent to Hermitian self-orthogonal codes.

If \(n\leqslant k^2\) and \(\dim P(C)=0\) and there are points which are not in \(\mathcal X\) but are zeros of the forms in \(\mathrm {HF}(\mathcal X)\) then we can extend C to a \([n+1,k]_{q^2}\) which does have truncations which are linearly equivalent to Hermitian self-orthogonal codes.

Finally, if \(n\leqslant k^2\) and \(\dim P(C)=0\) and there are no points which are zeros of the forms in \(\mathrm {HF}(\mathcal X)\) but which are not in \(\mathcal X\) then C has no extension to a \([n+1,k]_{q^2}\) which has truncations that are linearly equivalent to Hermitian self-orthogonal codes. In this case we can extend C trying to maintain the dual minimum distance. This will reduce the dimension of \(\mathrm {HF}(\mathcal X)\) by one, which then creates the possibility that there are points which are not in \(\mathcal X\) but are zeros of the forms in \(\mathrm {HF}(\mathcal X)\). Indeed we can try and find extensions of C so that this is the case.

In all of the above we can construct a \([\![r,r-2k',d]\!]_q\) code from a truncation of length r, for some \(k' \leqslant k\).

It should be able to extend these methods to make use of the following recent result of Galindo and Hernando [3, Theorem 1.2], which is an extension of Theorem 1.

There is also the possibility to extend these methods to self-orthogonal codes, i.e. \(C \leqslant C^{\perp }\). This will work well in the case that the characteristic is even, since \(\lambda ^{q+1}\) is replaced by \(\lambda ^2\) and all elements in a field of even characteristic have a square root. The role of the Hermitian form is then replaced by a quadratic form.