# Structure of CSS and CSS-T Quantum Codes

Elena Berardini, Alessio Caminata, Alberto Ravagnani

► To cite this version:

Elena Berardini, Alessio Caminata, Alberto Ravagnani. Structure of CSS and CSS-T Quantum Codes. Designs, Codes and Cryptography, 2024, 10.1007/s10623-024-01415-9. hal-04590650

HAL Id: hal-04590650

https://hal.science/hal-04590650

Submitted on 28 May 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Structure of CSS and CSS-T Quantum Codes

Elena Berardini, Alessio Caminata, Alberto Ravagnani

► To cite this version:

Elena Berardini, Alessio Caminata, Alberto Ravagnani. Structure of CSS and CSS-T Quantum Codes. Designs, Codes and Cryptography, 2024, 92 (10), pp.2801-2823. 10.1007/s10623-024-01415-9. hal-04590650

HAL Id: hal-04590650

https://hal.science/hal-04590650v1

Submitted on 28 May 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
STRUCTURE OF CSS AND CSS-T QUANTUM CODES

ELENA BERARDINI, ALESSIO CAMINATA, AND ALBERTO RAVAGNANI

ABSTRACT. We investigate CSS and CSS-T quantum error-correcting codes from the point of view of their existence, rarity, and performance. We give a lower bound on the number of pairs of linear codes that give rise to a CSS code with good correction capability, showing that such pairs are easy to produce with a randomized construction. We then prove that CSS-T codes exhibit the opposite behaviour, showing also that, under very natural assumptions, their rate and relative distance cannot be simultaneously large. This partially answers an open question on the feasible parameters of CSS-T codes. We conclude with a simple construction of CSS-T codes from Hermitian curves. The paper also offers a concise introduction to CSS and CSS-T codes from the point of view of classical coding theory.

INTRODUCTION

Quantum computers are inherently susceptible to errors and disturbances. Quantum error
correction is a crucial aspect of quantum computing. It is about protecting quantum informa-
tion from errors due to decoherence and other forms of noise; see [8, 33] among many others.
Quantum error correction is currently a wide-open challenge.

In 1996, Calderbank and Shor [6], and independently Steane [27], proposed a class of quan-
tum codes, mostly known under the name of CSS codes, obtained by combining two classical
linear error-correcting codes. Since then, several articles have studied their construction and
obtained quantum codes using known families of linear codes, such as *Reed–Solomon* and
*BCH codes* [12, 18], *Reed–Muller codes* [25, 30], and *Algebraic Geometry codes* [14, 16, 17].

Quantum CSS codes are most often constructed by taking the two classical codes needed for
the construction to be a *self-orthogonal* code and its dual. On the other hand, this approach
is technically not required by the construction and, as we will argue in this paper, imposes
strong constraints.

Very recently, Rengaswamy et al. [22, 23] introduced a class of CSS codes, called *CSS-T codes*, specifically designed for universal fault-tolerant quantum computation. The properties of CSS-T codes are to date largely unexplored. An open question is about the existence of families of CSS-T codes whose rate and relative distance are both non-vanishing for large block length. This paper provides some partial answers.

In the rest of the introduction, we briefly summarize the contributions made by this paper
and point the reader to the relevant sections. In Section 1, we provide the necessary back-
ground material, which also gives us a chance to concisely present quantum error-correcting
codes from the point of view of classical coding theory. In Section 2, we study the parameters
of CSS codes and give a lower bound on the number of code pairs that give rise to a CSS code
with sufficiently large correction capability. In particular, we prove that over a large field,

*Key words and phrases.* Quantum error-correcting code, CSS code, CSS-T code, code parameters.
# STRUCTURE OF CSS AND CSS-T QUANTUM CODES

ELENA BERARDINI, ALESSIO CAMINATA, AND ALBERTO RAVAGNANI

**ABSTRACT.** We investigate CSS and CSS-T quantum error-correcting codes from the point of view of their existence, rarity, and performance. We give a lower bound on the number of pairs of linear codes that give rise to a CSS code with good correction capability, showing that such pairs are easy to produce with a randomized construction. We then prove that CSS-T codes exhibit the opposite behaviour, showing also that, under very natural assumptions, their rate and relative distance cannot be simultaneously large. This partially answers an open question on the feasible parameters of CSS-T codes. We conclude with a simple construction of CSS-T codes from Hermitian curves. The paper also offers a concise introduction to CSS and CSS-T codes from the point of view of classical coding theory.

## INTRODUCTION

Quantum computers are inherently susceptible to errors and disturbances. Quantum error correction is a crucial aspect of quantum computing. It is about protecting quantum information from errors due to decoherence and other forms of noise; see [8, 33] among many others. Quantum error correction is currently a wide-open challenge.

In 1996, Calderbank and Shor [6], and independently Steane [27], proposed a class of quantum codes, mostly known under the name of *CSS codes*, obtained by combining two classical linear error-correcting codes. Since then, several articles have studied their construction and obtained quantum codes using known families of linear codes, such as *Reed–Solomon* and *BCH codes* [12, 18], *Reed–Muller codes* [25, 30], and *Algebraic Geometry codes* [14, 16, 17].

Quantum CSS codes are most often constructed by taking the two classical codes needed for the construction to be a *self-orthogonal* code and its dual. On the other hand, this approach is technically not required by the construction and, as we will argue in this paper, imposes strong constraints.

Very recently, Rengaswamy *et al.* [22, 23] introduced a class of CSS codes, called *CSS-T codes*, specifically designed for universal fault-tolerant quantum computation. The properties of CSS-T codes are to date largely unexplored. An open question is about the existence of families of CSS-T codes whose rate and relative distance are both non-vanishing for large block length. This paper provides some partial answers.

In the rest of the introduction, we briefly summarize the contributions made by this paper and point the reader to the relevant sections. In Section 1, we provide the necessary background material, which also gives us a chance to concisely present quantum error-correcting codes from the point of view of classical coding theory. In Section 2, we study the parameters of CSS codes and give a lower bound on the number of code pairs that give rise to a CSS code with sufficiently large correction capability. In particular, we prove that over a large field,

<footnote>*Key words and phrases.* Quantum error-correcting code, CSS code, CSS-T code, code parameters.</footnote>
a randomized construction will produce a CSS code with good parameters (Corollary 2.13). This builds on preliminary results on this topic derived in [2].

Section 3 is devoted to CSS-T codes. We provide a convenient characterization using results on finite bilinear spaces and then apply this to derive bounds on their parameters (Theorem 3.7). In particular, we show that CSS-T codes cannot have large rate and relative distance simultaneously (Theorem 3.9). This makes some progress on an open question about the existence of asymptotically good families of CSS-T codes. Moreover, it proves that the construction proposed in [1] is optimal. Finally, in Section 4, we show how some simple examples of CSS-T codes can be constructed as evaluation codes from the Hermitian curve (Theorem 4.3). This construction is optimal with respect to the previously mentioned bounds on rate and relative distance.

**Acknowledgements.** The authors would like to thank Felice Manganiello for introducing them to CSS-T codes, Paolo Solinas for useful discussions on quantum channels, and Markus Grassl for pointing out some mistakes in an earlier version of this paper. We also thank the anonymous referees for the valuable comments and suggestions.

## 1. QUANTUM ERROR-CORRECTING CODES

In this section, we give a self-contained, very short introduction to the theory of quantum error-correcting codes. This also gives us the chance to establish the notation for the rest of the paper. We refer the reader to [3, 10, 19, 20, 24, 26] for more details.

1.1. **Qudits.** Let $q$ be the power of a prime $p$ and let $\mathbb{F}_q$ denote the finite field with $q$ elements. Let $\mathbb{C}$ denote the complex field, $\dagger$ the conjugate transpose of a matrix, and $I$ the $q \times q$ identity matrix over $\mathbb{C}$. Matrices and vectors will be denoted by uppercase and lowercase letters, respectively. The all-zero and all-one vectors are denoted by $\mathbf{0}$ and $\mathbf{1}$, respectively.

We denote by $b_0, \dots, b_{q-1}$ the elements of $\mathbb{F}_q$ and let $|b_0\rangle, |b_1\rangle, \dots, |b_{q-1}\rangle$ represent unit vectors in $\mathbb{C}^q$ as follows:

$$ |b_0\rangle = \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \\ 0 \end{pmatrix}, \quad |b_1\rangle = \begin{pmatrix} 0 \\ 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix}, \quad \dots \quad |b_{q-1}\rangle = \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{pmatrix}. $$

The symbol $|\cdot\rangle$ is read “ket”. Note that $|b_0\rangle, |b_1\rangle, \dots, |b_{q-1}\rangle$ are orthonormal unitary vectors. We can represent each vector $\alpha \in \mathbb{C}^q$ with respect to the previous basis

$$ (1) \qquad |\alpha\rangle := \sum_{i=0}^{q-1} \alpha_i |b_i\rangle, $$

where $\alpha_i \in \mathbb{C}$. We also introduce the following notation, called the “bra”:

$$ \langle \alpha | := \sum_{i=0}^{q-1} \overline{\alpha_i} |b_i|, $$
a randomized construction will produce a CSS code with good parameters (Corollary 2.13). This builds on preliminary results on this topic derived in [2].

Section 3 is devoted to CSS-T codes. We provide a convenient characterization using results on finite bilinear spaces and then apply this to derive bounds on their parameters (Theorem 3.7). In particular, we show that CSS-T codes cannot have large rate and relative distance simultaneously (Theorem 3.9). This makes some progress on an open question about the existence of asymptotically good families of CSS-T codes. Moreover, it proves that the construction proposed in [1] is optimal. Finally, in Section 4, we show how some simple examples of CSS-T codes can be constructed as evaluation codes from the Hermitian curve (Theorem 4.3). This construction is optimal with respect to the previously mentioned bounds on rate and relative distance.

**Acknowledgements.** The authors would like to thank Felice Manganiello for introducing them to CSS-T codes, Paolo Solinas for useful discussions on quantum channels, and Markus Grassl for pointing out some mistakes in an earlier version of this paper. We also thank the anonymous referees for the valuable comments and suggestions.

# 1. QUANTUM ERROR-CORRECTING CODES

In this section, we give a self-contained, very short introduction to the theory of quantum error-correcting codes. This also gives us the chance to establish the notation for the rest of the paper. We refer the reader to [3, 10, 19, 20, 24, 26] for more details.

## 1.1. Qudits.
Let $q$ be the power of a prime $p$ and let $\mathbb{F}_q$ denote the finite field with $q$ elements. Let $\mathbb{C}$ denote the complex field, $\dagger$ the conjugate transpose of a matrix, and $I$ the $q \times q$ identity matrix over $\mathbb{C}$. Matrices and vectors will be denoted by uppercase and lowercase letters, respectively. The all-zero and all-one vectors are denoted by $\mathbf{0}$ and $\mathbf{1}$, respectively.

We denote by $b_0, \dots, b_{q-1}$ the elements of $\mathbb{F}_q$ and let $|b_0\rangle, |b_1\rangle, \dots, |b_{q-1}\rangle$ represent unit vectors in $\mathbb{C}^q$ as follows:

$$ |b_0\rangle = \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \\ 0 \end{pmatrix}, \quad |b_1\rangle = \begin{pmatrix} 0 \\ 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix}, \quad \dots \quad |b_{q-1}\rangle = \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{pmatrix}. $$

The symbol $|\cdot\rangle$ is read “ket”. Note that $|b_0\rangle, |b_1\rangle, \dots, |b_{q-1}\rangle$ are orthonormal unitary vectors. We can represent each vector $\alpha \in \mathbb{C}^q$ with respect to the previous basis

$$ (1) \qquad |\alpha\rangle := \sum_{i=0}^{q-1} \alpha_i |b_i\rangle, $$

where $\alpha_i \in \mathbb{C}$. We also introduce the following notation, called the “bra”:

$$ \langle \alpha | := \sum_{i=0}^{q-1} \overline{\alpha_i} |b_i|, $$
where $\langle b_i |$ is the conjugate transpose of $|b_i \rangle$, i.e., $\langle b_i | = |b_i \rangle^\dagger$. Finally, we let $\mathcal{H}_q$ be the Hilbert space $\mathbb{C}^q$

$$ (2) \qquad \mathcal{H}_q := \left\{ \sum_{i=0}^{q-1} \alpha_i |b_i\rangle \mid \alpha_i \in \mathbb{C} \right\} $$

endowed with the scalar product

$$ \langle \alpha | \beta \rangle := \sum_{i=0}^{q-1} \bar{\alpha}_i \beta_i, $$

and the corresponding norm $|||\alpha||| := \sqrt{\langle\alpha|\alpha\rangle}$.

A qudit is an element of $\mathcal{H}_q$ of norm one. The coefficients $\alpha_i$'s in Equation (2) are called the probability amplitudes of $|\alpha\rangle$. From the point of view of quantum physics, this means that the particle represented by the qudit $|\alpha\rangle$ is in the state $|b_i\rangle$ with probability $|\alpha_i|^2$. For $q = 2$, an element of $\mathcal{H}_2$ of norm one is called a qubit.

We define the tensor product of $|\alpha\rangle$ and $|\beta\rangle$ as the usual tensor product of the associated vectors in $\mathbb{C}^q$. Note that the tensor product is associative but not commutative. For $|x_1\rangle, \dots, |x_n\rangle \in \mathcal{H}_q$, we let $|x_1 \dots x_n\rangle$ denote the tensor product $|x_1\rangle \otimes \dots \otimes |x_n\rangle$. We then set

$$ \mathcal{H}_q^{\otimes n} := \mathcal{H}_q \otimes \dots \otimes \mathcal{H}_q, $$

and sometimes omit $q$ when it does not need to be specified (we write simply $\mathcal{H}^n$). The space $\mathcal{H}^n$ is a $q^n$-dimensional Hilbert space. The elements of the form $|b\rangle$ with $b \in \mathbb{F}_q^n$ form a basis of $\mathcal{H}^n$, which is called the computational basis.

**Example 1.1.** $\mathcal{H}_3^2$ is spanned by $\{|00\rangle, |01\rangle, |02\rangle, |10\rangle, |11\rangle, |12\rangle, |20\rangle, |21\rangle, |22\rangle\}$. The kets in the basis we gave correspond to the nine vectors of the standard basis of $\mathbb{C}^9$, e.g.,

$$ |02\rangle := |0\rangle \otimes |2\rangle = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix}. $$

A system of $n$-qudits is represented as the tensor product of $n$ qudits. Thus a $n$-qudit is a vector of the form $|\alpha\rangle = \sum_{b \in \mathbb{F}_q^n} \alpha_b |b\rangle \in \mathcal{H}^n$ with $\sqrt{\sum_{b \in \mathbb{F}_q^n} |\alpha_b|^2} = 1$. It is important to notice that not every $n$-qudit can be written as a tensor product of $n$ qudits. Indeed, this is only possible when the qudits are independent, or *uncorrelated*. A correlation between two qudits is called an *entanglement*.

**Example 1.2.** The 2-qubits

$$ \frac{1}{\sqrt{2}}(|01\rangle + |10\rangle) \text{ and } \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle) $$

cannot be written as tensor products of two qubits. They are *entangled* qubits.
where $\langle b_i |$ is the conjugate transpose of $|b_i \rangle$, i.e., $\langle b_i | = |b_i \rangle^\dagger$. Finally, we let $\mathcal{H}_q$ be the Hilbert space $\mathbb{C}^q$

$$ (2) \qquad \mathcal{H}_q := \left\{ \sum_{i=0}^{q-1} \alpha_i |b_i\rangle \mid \alpha_i \in \mathbb{C} \right\} $$

endowed with the scalar product

$$ \langle \alpha | \beta \rangle := \sum_{i=0}^{q-1} \bar{\alpha}_i \beta_i, $$

and the corresponding norm $|||\alpha||| := \sqrt{\langle\alpha|\alpha\rangle}$.

A qudit is an element of $\mathcal{H}_q$ of norm one. The coefficients $\alpha_i$'s in Equation (2) are called the probability amplitudes of $|\alpha\rangle$. From the point of view of quantum physics, this means that the particle represented by the qudit $|\alpha\rangle$ is in the state $|b_i\rangle$ with probability $|\alpha_i|^2$. For $q = 2$, an element of $\mathcal{H}_2$ of norm one is called a qubit.

We define the tensor product of $|\alpha\rangle$ and $|\beta\rangle$ as the usual tensor product of the associated vectors in $\mathbb{C}^q$. Note that the tensor product is associative but not commutative. For $|x_1\rangle, \dots, |x_n\rangle \in \mathcal{H}_q$, we let $|x_1 \dots x_n\rangle$ denote the tensor product $|x_1\rangle \otimes \dots \otimes |x_n\rangle$. We then set

$$ \mathcal{H}_q^{\otimes n} := \mathcal{H}_q \otimes \dots \otimes \mathcal{H}_q, $$

and sometimes omit $q$ when it does not need to be specified (we write simply $\mathcal{H}^n$). The space $\mathcal{H}^n$ is a $q^n$-dimensional Hilbert space. The elements of the form $|b\rangle$ with $b \in \mathbb{F}_q^n$ form a basis of $\mathcal{H}^n$, which is called the computational basis.

**Example 1.1.** $\mathcal{H}_3^2$ is spanned by $\{|00\rangle, |01\rangle, |02\rangle, |10\rangle, |11\rangle, |12\rangle, |20\rangle, |21\rangle, |22\rangle\}$. The kets in the basis we gave correspond to the nine vectors of the standard basis of $\mathbb{C}^9$, e.g.,

$$ |02\rangle := |0\rangle \otimes |2\rangle = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix}. $$

A system of $n$-qudits is represented as the tensor product of $n$ qudits. Thus a $n$-qudit is a vector of the form $|\alpha\rangle = \sum_{b \in \mathbb{F}_q^n} \alpha_b |b\rangle \in \mathcal{H}^n$ with $\sqrt{\sum_{b \in \mathbb{F}_q^n} |\alpha_b|^2} = 1$. It is important to notice that not every $n$-qudit can be written as a tensor product of $n$ qudits. Indeed, this is only possible when the qudits are independent, or *uncorrelated*. A correlation between two qudits is called an *entanglement*.

**Example 1.2.** The 2-qubits

$$ \frac{1}{\sqrt{2}}(|01\rangle + |10\rangle) \text{ and } \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle) $$

cannot be written as tensor products of two qubits. They are *entangled* qubits.
1.2. **Quantum Errors and Quantum Codes.** The goal of this subsection is to introduce the possible errors that can occur in the quantum realm. For simplicity of exposition, we will start with the case of qubits. Quantum errors are better explained by using the language of density matrices.

**Definition 1.3** ([26, Postulate 5]). A complex 2 × 2 matrix $\rho$ is called a *density matrix* if the following properties hold:

* $\rho$ is a Hermitian (or self-adjoint) operator, i.e., $\rho = \rho^{\dagger}$,

* $\rho$ is positive semi-definite, i.e., $\langle\alpha|\rho|\alpha\rangle \ge 0$ for every $\alpha \in \mathbb{C}^2$,

* $\mathrm{Tr}(\rho) = 1$.

Given a qubit $|\alpha\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle$, we can represent it as a density matrix $\rho_\alpha$ in the following way:

$$ \rho_{\alpha} = |\alpha\rangle \langle\alpha| = \begin{pmatrix} |\alpha_0|^2 & \alpha_0 \overline{\alpha_1} \\ \overline{\alpha_0} \alpha_1 & |\alpha_1|^2 \end{pmatrix}. $$

Notice that not all density matrices $\rho$ are associated to a qubit $|\alpha\rangle$, that is $\rho = \rho_\alpha$. When this happens, we say that the density matrix is in *pure state*, otherwise, we say that $\rho$ is in *mixed state*. Alternatively, a density matrix in mixed state can be thought of as representing a set of qubits $|\alpha_i\rangle$ with associated probabilities $p_i$, such that $\sum_i p_i = 1$. The nature of a state of a density matrix $\rho$ is completely captured by $\rho^2$, in the following way [26, Proposition 2.25].

**Proposition 1.4.** *The density matrix $\rho$ represents a pure state if, and only if, $\rho = \rho^2$.*

Now, suppose that we send a density matrix $\rho_\alpha$ representing a qubit $|\alpha\rangle$ through a channel. Some errors may occur, but the received output is still a density matrix $\rho'$. This condition corresponds to the physical fact that under any circumstances we should be able to measure the output $\rho'$ and obtain the value 0 or 1 with some probabilities $p_1, p_2$ such that $p_1 + p_2 = 1$. However, the matrix $\rho'$ needs not to be in pure state anymore, but it may be in mixed state. Quantum errors are modeled as linear transformations [10]. In the literature, one often refers to them also as *gates* or *operators*.

**Definition 1.5** ([10, Definition 2.1]). A quantum channel $\mathcal{E}$ is a linear transformation acting on density matrices:

$$ \mathcal{E}: \rho \mapsto \mathcal{E}(\rho) = \sum_i E_i \rho E_i^\dagger. $$

The $E_i$'s are called (*quantum*) error operators or *Krauss operators*.

We have infinitely many possible quantum errors. However, thanks to the linearity of the operators, it is sufficient to be able to correct the errors corresponding to the Pauli basis of the space of 2 × 2 matrices (see the discussion in [24, §2.2] and [10, §2.2]):

$$ I, \quad \sigma_x = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad \sigma_y = i \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, \quad \sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. $$

Besides the identity matrix, the Pauli matrices are sometimes written with the following alternative notation, which we will often use in the sequel:

(3) \qquad $X = \sigma_x, \quad Z = \sigma_z, \quad Y = XZ = -i\sigma_y.$

Precisely, they are referred to as:
1.2. **Quantum Errors and Quantum Codes.** The goal of this subsection is to introduce the possible errors that can occur in the quantum realm. For simplicity of exposition, we will start with the case of qubits. Quantum errors are better explained by using the language of density matrices.

**Definition 1.3** ([26, Postulate 5]). A complex 2 × 2 matrix $\rho$ is called a *density matrix* if the following properties hold:

* $\rho$ is a Hermitian (or self-adjoint) operator, i.e., $\rho = \rho^{\dagger}$,

* $\rho$ is positive semi-definite, i.e., $\langle\alpha|\rho|\alpha\rangle \ge 0$ for every $\alpha \in \mathbb{C}^2$,

* $\mathrm{Tr}(\rho) = 1$.

Given a qubit $|\alpha\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle$, we can represent it as a density matrix $\rho_\alpha$ in the following way:

$$ \rho_{\alpha} = |\alpha\rangle \langle\alpha| = \begin{pmatrix} |\alpha_0|^2 & \alpha_0 \overline{\alpha_1} \\ \overline{\alpha_0} \alpha_1 & |\alpha_1|^2 \end{pmatrix}. $$

Notice that not all density matrices $\rho$ are associated to a qubit $|\alpha\rangle$, that is $\rho = \rho_\alpha$. When this happens, we say that the density matrix is in *pure state*, otherwise, we say that $\rho$ is in *mixed state*. Alternatively, a density matrix in mixed state can be thought of as representing a set of qubits $|\alpha_i\rangle$ with associated probabilities $p_i$, such that $\sum_i p_i = 1$. The nature of a state of a density matrix $\rho$ is completely captured by $\rho^2$, in the following way [26, Proposition 2.25].

**Proposition 1.4.** *The density matrix $\rho$ represents a pure state if, and only if, $\rho = \rho^2$.*

Now, suppose that we send a density matrix $\rho_\alpha$ representing a qubit $|\alpha\rangle$ through a channel. Some errors may occur, but the received output is still a density matrix $\rho'$. This condition corresponds to the physical fact that under any circumstances we should be able to measure the output $\rho'$ and obtain the value 0 or 1 with some probabilities $p_1, p_2$ such that $p_1 + p_2 = 1$. However, the matrix $\rho'$ needs not to be in pure state anymore, but it may be in mixed state. Quantum errors are modeled as linear transformations [10]. In the literature, one often refers to them also as *gates* or *operators*.

**Definition 1.5** ([10, Definition 2.1]). A quantum channel $\mathcal{E}$ is a linear transformation acting on density matrices:

$$ \mathcal{E}: \rho \mapsto \mathcal{E}(\rho) = \sum_i E_i \rho E_i^\dagger. $$

The $E_i$'s are called (*quantum*) error operators or *Krauss operators*.

We have infinitely many possible quantum errors. However, thanks to the linearity of the operators, it is sufficient to be able to correct the errors corresponding to the Pauli basis of the space of 2 × 2 matrices (see the discussion in [24, §2.2] and [10, §2.2]):

$$ I, \quad \sigma_x = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad \sigma_y = i \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, \quad \sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. $$

Besides the identity matrix, the Pauli matrices are sometimes written with the following alternative notation, which we will often use in the sequel:

$$ (3) \qquad X = \sigma_x, \quad Z = \sigma_z, \quad Y = XZ = -i\sigma_y. $$

Precisely, they are referred to as:
* the X-error (bit flip): $\alpha_0|0\rangle + \alpha_1|1\rangle \rightarrow \alpha_0|1\rangle + \alpha_1|0\rangle$,

* the Z-error (phase flip): $\alpha_0|0\rangle + \alpha_1|1\rangle \rightarrow \alpha_0|0\rangle - \alpha_1|1\rangle$,

* the Y-error (phase and bit flip): $\alpha_0|0\rangle + \alpha_1|1\rangle \rightarrow \alpha_0|1\rangle - \alpha_1|0\rangle$.

Notice that the Pauli matrices do not commute.

**Remark 1.6.** Using the Pauli matrices as a basis of the space of $2 \times 2$ matrices, we can write any density matrix $\rho$ as

$$ \rho = \frac{1}{2}(I + x\sigma_x + y\sigma_y + z\sigma_z), $$

for some $x, y, z \in \mathbb{R}$. By Proposition 1.4, $\rho$ is in pure state, i.e., $\rho = \rho_\alpha$ for some qubit $|\alpha\rangle$, if and only if $\rho^2 = \rho$. In particular, this implies $\mathrm{Tr}(\rho^2) = 1$ which is equivalent to saying that $|(x, y, z)| = 1$. Therefore we can represent the qubit $|\alpha\rangle$ as an element of the real sphere $\{(x, y, z) \in \mathbb{R}^3 | x^2 + y^2 + z^2 = 1\}$.

**Example 1.7.** We fix the notation convention that quantum gates are applied from right to left. Let $|\alpha\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle$. Then

$$ XZ |\alpha\rangle = \alpha_0 |1\rangle - \alpha_1 |0\rangle \neq -\alpha_0 |1\rangle + \alpha_1 |0\rangle = ZX |\alpha\rangle. $$

**Example 1.8.** Another important qubit unitary operation is the Hadamard gate $H$, obtained by dividing the classical Hadamard matrix by its determinant. This results in a unitary matrix that acts on the computational basis as follows:

$$ H |0\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle), \quad H |1\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle). $$

Its matrix form is

$$ H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt{2}} (\sigma_x + \sigma_z). $$

The Hadamard gate is the inverse of itself: $HH^{-1} = I$. In fact, it can be interpreted as a linear change of basis on the space $\mathcal{H}$: from the computational basis $\{|0\rangle, |1\rangle\}$ to the basis $\{H|0\rangle, H|1\rangle\}$.

For quantum errors over $\mathcal{H}_q$ with $q = p^e > 2$ and $p$ a prime, the situation is very similar to the case $q = 2$. We can associate to a qudit $|\alpha\rangle$ a $q \times q$ density matrix $\rho_\alpha = |\alpha\rangle\langle\alpha|$ as before, and we can consider the errors corresponding to the higher-dimensional analogue of the Pauli matrices. The equivalent to the bit-flip error is the *dit-flip*. For each element $a \in \mathbb{F}_q$, this can be represented by a $q \times q$ matrix $X(a)$ sending $|\alpha\rangle$ to $|\alpha + a\rangle$. For the equivalent of the phase-flip error, the so-called *phase-shift*, we define $Z(b)$ to be a $q \times q$ diagonal matrix such that its $i$-th entry on the diagonal is $\zeta^{\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(ib)}$ for each $b \in \mathbb{F}_q$. Here $\zeta = e^{2\pi i/p} \in \mathbb{C}$ is a primitive $p$-th root of unity, and $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}$ is the usual *absolute trace* defined as follows:

$$ (4) \qquad \mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(\alpha) = \sum_{i=0}^{e-1} \alpha^{p^i}. $$

For any $a, b \in \mathbb{F}_q$, the unitary matrices $X(a)$ and $Z(b)$ are called the *Pauli matrices*. When the dependency on $a, b$ is not relevant, we shall denote them simply by $X$ and $Z$ respectively. Notice that over $\mathbb{F}_2$ they coincide with the Pauli matrices given in Equation (3). We refer the reader to [3, §5] for further details.
* the X-error (bit flip): $\alpha_0 |0\rangle + \alpha_1 |1\rangle \rightarrow \alpha_0 |1\rangle + \alpha_1 |0\rangle$,

* the Z-error (phase flip): $\alpha_0 |0\rangle + \alpha_1 |1\rangle \rightarrow \alpha_0 |0\rangle - \alpha_1 |1\rangle$,

* the Y-error (phase and bit flip): $\alpha_0 |0\rangle + \alpha_1 |1\rangle \rightarrow \alpha_0 |1\rangle - \alpha_1 |0\rangle$.

Notice that the Pauli matrices do not commute.

**Remark 1.6.** Using the Pauli matrices as a basis of the space of $2 \times 2$ matrices, we can write any density matrix $\rho$ as

$$ \rho = \frac{1}{2}(I + x\sigma_x + y\sigma_y + z\sigma_z), $$

for some $x, y, z \in \mathbb{R}$. By Proposition 1.4, $\rho$ is in pure state, i.e., $\rho = \rho_\alpha$ for some qubit $|\alpha\rangle$, if and only if $\rho^2 = \rho$. In particular, this implies $\mathrm{Tr}(\rho^2) = 1$ which is equivalent to saying that $|(x, y, z)| = 1$. Therefore we can represent the qubit $|\alpha\rangle$ as an element of the real sphere $\{(x, y, z) \in \mathbb{R}^3 | x^2 + y^2 + z^2 = 1\}$.

**Example 1.7.** We fix the notation convention that quantum gates are applied from right to left. Let $|\alpha\rangle = \alpha_0 |0\rangle + \alpha_1 |1\rangle$. Then

$$ XZ |\alpha\rangle = \alpha_0 |1\rangle - \alpha_1 |0\rangle \neq -\alpha_0 |1\rangle + \alpha_1 |0\rangle = ZX |\alpha\rangle. $$

**Example 1.8.** Another important qubit unitary operation is the Hadamard gate $H$, obtained by dividing the classical Hadamard matrix by its determinant. This results in a unitary matrix that acts on the computational basis as follows:

$$ H |0\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle), \quad H |1\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle). $$

Its matrix form is

$$ H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt{2}} (\sigma_x + \sigma_z). $$

The Hadamard gate is the inverse of itself: $HH^{-1} = I$. In fact, it can be interpreted as a linear change of basis on the space $\mathcal{H}$: from the computational basis $\{|0\rangle, |1\rangle\}$ to the basis $\{H |0\rangle, H |1\rangle\}$.

For quantum errors over $\mathcal{H}_q$ with $q = p^e > 2$ and $p$ a prime, the situation is very similar to the case $q = 2$. We can associate to a qudit $|\alpha\rangle$ a $q \times q$ density matrix $\rho_\alpha = |\alpha\rangle\langle\alpha|$ as before, and we can consider the errors corresponding to the higher-dimensional analogue of the Pauli matrices. The equivalent to the bit-flip error is the *dit-flip*. For each element $a \in \mathbb{F}_q$, this can be represented by a $q \times q$ matrix $X(a)$ sending $|\alpha\rangle$ to $|\alpha + a\rangle$. For the equivalent of the phase-flip error, the so-called *phase-shift*, we define $Z(b)$ to be a $q \times q$ diagonal matrix such that its $i$-th entry on the diagonal is $\zeta^{\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(ib)}$ for each $b \in \mathbb{F}_q$. Here $\zeta = e^{2\pi i/p} \in \mathbb{C}$ is a primitive $p$-th root of unity, and $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}$ is the usual *absolute trace* defined as follows:

$$ (4) \qquad \mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(\alpha) = \sum_{i=0}^{e-1} \alpha^{p^i}. $$

For any $a, b \in \mathbb{F}_q$, the unitary matrices $X(a)$ and $Z(b)$ are called the *Pauli matrices*. When the dependency on $a, b$ is not relevant, we shall denote them simply by $X$ and $Z$ respectively. Notice that over $\mathbb{F}_2$ they coincide with the Pauli matrices given in Equation (3). We refer the reader to [3, §5] for further details.
**Example 1.9.** For $q = 3$, the dit-flip errors are

$$X(0) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad X(1) = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}, \quad X(2) = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix},$$

while the phase-shift errors are

$$Z(0) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad Z(1) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \zeta & 0 \\ 0 & 0 & \zeta^2 \end{bmatrix}, \quad Z(2) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \zeta^2 & 0 \\ 0 & 0 & \zeta \end{bmatrix}.$$

**Example 1.10.** Let $\omega$ be a primitive $q$-th root of unity. The $q$-dimensional equivalent of the Hadamard gate introduced in Example 1.8 is the $q$-dimensional discrete Fourier transform matrix, which reads

$$H^{(q)} = \frac{1}{\sqrt{q}} \begin{bmatrix} 1 & 1 & 1 & \dots & 1 \\ 1 & \omega & \omega^2 & \dots & \omega^{q-1} \\ 1 & \omega^2 & \omega^4 & \dots & \omega^{2(q-1)} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & \omega^{q-1} & \omega^{2(q-1)} & \dots & \omega^{(q-1)(q-1)} \end{bmatrix}.$$

Notice that for $q$ a power of 2, we obtain the unitary $q$-dimensional Hadamard matrix. The matrix $H^{(q)}$ can be seen as a linear change of basis on the space $\mathcal{H}_q$.

As in the classical setting, the vast majority of the literature focuses on the case of *memoryless quantum channel*, meaning that the noise acts independently in each channel use. Therefore, we can represent the $q^n \times q^n$ matrices acting on $n$-qudits as $n$-tensors of $q \times q$ matrices. For $e, f \in \mathbb{F}_q^n$, with $e = (e_1, \dots, e_n)$ and $f = (f_1, \dots, f_n)$, we use the following notation:

$$(5) \qquad X^e Z^f = \bigotimes_{i=1}^n X(e_i) Z(f_i).$$

The qudits in a $n$-qudit are implicitly labeled in increasing order from 1 to $n$. Consequently, one can put indices on the unitary matrices to indicate which qudit they act on or assume by default that the $i$-th matrix acts on the $i$-th qudit.

**Example 1.11.** The 3-qubit $|010\rangle$ corresponds to $|0\rangle_1 \otimes |1\rangle_2 \otimes |0\rangle_3$. Writing

$$X_1 Z_2 I_3 |010\rangle = X Z I |010\rangle = -|110\rangle$$

means that the Pauli matrix $X$ acts on the first qubit, the Pauli matrix $Z$ acts on the second, while the third qubit is unchanged. The identity matrix at the end can be omitted, i.e., we can simply write $X_1 Z_2 |010\rangle$ or $X Z |010\rangle$.

**Definition 1.12** ([26, Definition 7.12]). An *encoding* is an injective and norm-preserving linear operator $\Phi: \mathcal{H}_q^{\otimes k} \to \mathcal{H}_q^{\otimes n}$. The space $\mathcal{H}_q^{\otimes n}$ is called the *quantum encoding space*, and the image of the encoding $Q = \text{Im}\Phi$ is called a *quantum error-correcting code* (QECC) of dimension $k$ and length $n$. For brevity, we say that $Q$ is a $[[n, k]]_q$-quantum code. The elements of $Q$ are called codewords.
**Example 1.9.** For $q = 3$, the dit-flip errors are

$$X(0) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad X(1) = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}, \quad X(2) = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix},$$

while the phase-shift errors are

$$Z(0) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad Z(1) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \zeta & 0 \\ 0 & 0 & \zeta^2 \end{bmatrix}, \quad Z(2) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \zeta^2 & 0 \\ 0 & 0 & \zeta \end{bmatrix}.$$

**Example 1.10.** Let $\omega$ be a primitive $q$-th root of unity. The $q$-dimensional equivalent of the Hadamard gate introduced in Example 1.8 is the $q$-dimensional discrete Fourier transform matrix, which reads

$$H^{(q)} = \frac{1}{\sqrt{q}} \begin{bmatrix} 1 & 1 & 1 & \dots & 1 \\ 1 & \omega & \omega^2 & \dots & \omega^{q-1} \\ 1 & \omega^2 & \omega^4 & \dots & \omega^{2(q-1)} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & \omega^{q-1} & \omega^{2(q-1)} & \dots & \omega^{(q-1)(q-1)} \end{bmatrix}.$$

Notice that for $q$ a power of 2, we obtain the unitary $q$-dimensional Hadamard matrix. The matrix $H^{(q)}$ can be seen as a linear change of basis on the space $\mathcal{H}_q$.

As in the classical setting, the vast majority of the literature focuses on the case of *memoryless quantum channel*, meaning that the noise acts independently in each channel use. Therefore, we can represent the $q^n \times q^n$ matrices acting on $n$-qudits as $n$-tensors of $q \times q$ matrices. For $e, f \in \mathbb{F}_q^n$, with $e = (e_1, \dots, e_n)$ and $f = (f_1, \dots, f_n)$, we use the following notation:

$$(5) \qquad X^e Z^f = \bigotimes_{i=1}^n X(e_i) Z(f_i).$$

The qudits in a $n$-qudit are implicitly labeled in increasing order from 1 to $n$. Consequently, one can put indices on the unitary matrices to indicate which qudit they act on or assume by default that the $i$-th matrix acts on the $i$-th qudit.

**Example 1.11.** The 3-qubit $|010\rangle$ corresponds to $|0\rangle_1 \otimes |1\rangle_2 \otimes |0\rangle_3$. Writing

$$X_1 Z_2 I_3 |010\rangle = X Z I |010\rangle = -|110\rangle$$

means that the Pauli matrix $X$ acts on the first qubit, the Pauli matrix $Z$ acts on the second, while the third qubit is unchanged. The identity matrix at the end can be omitted, i.e., we can simply write $X_1 Z_2 |010\rangle$ or $X Z |010\rangle$.

**Definition 1.12** ([26, Definition 7.12]). An encoding is an injective and norm-preserving linear operator $\Phi: \mathcal{H}_q^{\otimes k} \to \mathcal{H}_q^{\otimes n}$. The space $\mathcal{H}_q^{\otimes n}$ is called the quantum encoding space, and the image of the encoding $Q = \mathrm{Im}\Phi$ is called a quantum error-correcting code (QECC) of dimension $k$ and length $n$. For brevity, we say that $Q$ is a $[[n, k]]_q$-quantum code. The elements of $Q$ are called codewords.
**Example 1.13 (Steane code).** The Steane code was introduced in [27]. It is a $[[7, 1]]_2$-quantum code. The encoding is given by the linear map $\Phi: \mathcal{H}_2 \to \mathcal{H}_2^{\otimes 7}$ defined by

$$ \begin{aligned} |0\rangle &\mapsto \frac{1}{\sqrt{8}} ( |0000000\rangle + |1010101\rangle + |0110011\rangle + |1100110\rangle \\ &\qquad + |0001111\rangle + |1011010\rangle + |0111100\rangle + |1101001\rangle ), \\ |1\rangle &\mapsto \frac{1}{\sqrt{8}} ( |1111111\rangle + |0101010\rangle + |1001100\rangle + |0011001\rangle \\ &\qquad + |1110000\rangle + |0100101\rangle + |1000011\rangle + |0010110\rangle ). \end{aligned} $$

In contrast to the classical setting of linear codes with the Hamming distance, we do not have a general decoding procedure associated with a quantum error-correcting code. In fact, a quantum error-correcting code would be better specified by giving an encoding and a decoding algorithm [26, Definition 7.12]. In this paper, we are interested only in CSS codes and their variants, which have an associated known decoding algorithm [6]. In particular, we don't treat decoding in this paper.

## 2. CSS CODES: PARAMETERS AND RANDOMIZED CONSTRUCTIONS

CSS codes, named after Calderbank, Shor, and Steane, are a class of error-correcting quantum codes derived from a pair of classical linear codes. Their construction was introduced by Calderbank and Shor [6], and independently by Steane [27], in 1996. The two constructions are different but turn out to be equivalent. The original construction of CSS codes uses binary classical linear codes. However, it can be easily extended to codes over any finite field $\mathbb{F}_q$. In the sequel, we focus on this more general setting. CSS codes have been extensively studied since their introduction, and consequently, there is a rich literature about them. Besides the many constructions cited in the introduction to this paper, one can find an improved version of CSS codes in [29], a geometric interpretation of CSS codes (and more generally of stabilizer codes) in [3], and some new constructions of CSS quantum codes in [11].

The main goal of this section is to study the density property of CSS codes (Subsection 2.2). We will show that under mild hypotheses any pair of linear codes give a quantum CSS code with large minimum distance (Theorem 2.12 and Corollary 2.13). In particular, good CSS codes can be obtained with a randomized construction. Before doing so, we will introduce CSS codes and their parameters in Subsection 2.1. For completeness, we will also briefly recall both the construction by Calderbank and Shor, and the one by Steane, and show their equivalence in the non-binary setting. We were not able to find a complete proof of this fact in the literature. This section builds on [2], which contains the mentioned density result.

Before diving into the CSS code construction, we establish the notation for classical linear codes. We work over a finite field $\mathbb{F}_q$, where $q$ is a power of prime $p$. A (linear) code $C$ is a linear subspace of $\mathbb{F}_q^n$, where $n$ is a positive integer. The vectors $c \in C$ are called codewords. The dimension of a code $C$ is its dimension as a linear subspace over $\mathbb{F}_q$. If a linear code $C_2$ is a subspace of a linear code $C_1$, we say that $C_2$ is a *subcode of* $C_1$.

The *support* of a vector $c \in \mathbb{F}_q^n$ is the set $\sigma(c) := \{i \in \{1, \dots, n\} | c_i \neq 0\}$. Its (Hamming) *weight* is $\text{wt}(c) := |\sigma(c)|$, i.e., the cardinality of the support of $c$. The *minimum distance* of
**Example 1.13 (Steane code).** The Steane code was introduced in [27]. It is a $[[7, 1]]_2$-quantum code. The encoding is given by the linear map $\Phi: \mathcal{H}_2 \to \mathcal{H}_2^{\otimes 7}$ defined by

$$ \begin{aligned} |0\rangle &\mapsto \frac{1}{\sqrt{8}} ( |0000000\rangle + |1010101\rangle + |0110011\rangle + |1100110\rangle \\ &\qquad + |0001111\rangle + |1011010\rangle + |0111100\rangle + |1101001\rangle ), \\ |1\rangle &\mapsto \frac{1}{\sqrt{8}} ( |1111111\rangle + |0101010\rangle + |1001100\rangle + |0011001\rangle \\ &\qquad + |1110000\rangle + |0100101\rangle + |1000011\rangle + |0010110\rangle ). \end{aligned} $$

In contrast to the classical setting of linear codes with the Hamming distance, we do not have a general decoding procedure associated with a quantum error-correcting code. In fact, a quantum error-correcting code would be better specified by giving an encoding and a decoding algorithm [26, Definition 7.12]. In this paper, we are interested only in CSS codes and their variants, which have an associated known decoding algorithm [6]. In particular, we don't treat decoding in this paper.

## 2. CSS CODES: PARAMETERS AND RANDOMIZED CONSTRUCTIONS

CSS codes, named after Calderbank, Shor, and Steane, are a class of error-correcting quantum codes derived from a pair of classical linear codes. Their construction was introduced by Calderbank and Shor [6], and independently by Steane [27], in 1996. The two constructions are different but turn out to be equivalent. The original construction of CSS codes uses binary classical linear codes. However, it can be easily extended to codes over any finite field $\mathbb{F}_q$. In the sequel, we focus on this more general setting. CSS codes have been extensively studied since their introduction, and consequently, there is a rich literature about them. Besides the many constructions cited in the introduction to this paper, one can find an improved version of CSS codes in [29], a geometric interpretation of CSS codes (and more generally of stabilizer codes) in [3], and some new constructions of CSS quantum codes in [11].

The main goal of this section is to study the density property of CSS codes (Subsection 2.2). We will show that under mild hypotheses any pair of linear codes give a quantum CSS code with large minimum distance (Theorem 2.12 and Corollary 2.13). In particular, good CSS codes can be obtained with a randomized construction. Before doing so, we will introduce CSS codes and their parameters in Subsection 2.1. For completeness, we will also briefly recall both the construction by Calderbank and Shor, and the one by Steane, and show their equivalence in the non-binary setting. We were not able to find a complete proof of this fact in the literature. This section builds on [2], which contains the mentioned density result.

Before diving into the CSS code construction, we establish the notation for classical linear codes. We work over a finite field $\mathbb{F}_q$, where $q$ is a power of prime $p$. A (linear) code $C$ is a linear subspace of $\mathbb{F}_q^n$, where $n$ is a positive integer. The vectors $c \in C$ are called codewords. The dimension of a code $C$ is its dimension as a linear subspace over $\mathbb{F}_q$. If a linear code $C_2$ is a subspace of a linear code $C_1$, we say that $C_2$ is a *subcode* of $C_1$.

The *support* of a vector $c \in \mathbb{F}_q^n$ is the set $\sigma(c) := \{i \in \{1, \dots, n\} | c_i \neq 0\}$. Its (Hamming) *weight* is $\text{wt}(c) := |\sigma(c)|$, i.e., the cardinality of the support of $c$. The *minimum distance* of
a code $C$ is defined as

$$d(C) = \min\{\mathrm{wt}(c) \mid c \in C, c \neq \mathbf{0}\},$$

where the zero code $\{\mathbf{0}\}$ has minimum distance $n+1$ by definition. The dual of $C$ is the code

$$C^{\perp} := \{x \in \mathbb{F}_{q}^{n} \mid \langle c, x \rangle = 0 \text{ for all } c \in C\},$$

where $\langle c, x \rangle$ denotes the inner product of the vectors $c$ and $x$. If $C$ has dimension $k$, then $C^{\perp}$ has dimension $n-k$. A code $C$ is said to be self-orthogonal if $C \subseteq C^{\perp}$, and self-dual if $C = C^{\perp}$.

**2.1. Parameters of CSS Codes.** Fix linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$. Let $\zeta = e^{2\pi i/p} \in \mathbb{C}$ be a primitive $p$-th root of unity and let $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p} = \mathrm{Tr}$ denote the absolute trace from $\mathbb{F}_q$ to its prime subfield $\mathbb{F}_p$ defined in Equation (4). For a vector $w \in \mathbb{F}_q^n$ we define a quantum state as follows

$$(6) \qquad |c_w\rangle := \frac{1}{\sqrt{|C_1|}} \sum_{c \in C_1} \zeta^{\mathrm{Tr}(\langle c, w \rangle)} |c\rangle.$$

Note that for any $w \in \mathbb{F}_q^n$, $|c_w\rangle$ has norm one and thus defines a qudit.

**Definition 2.1.** The (Calderbank and Shor) CSS quantum code associated with $C_1$ and $C_2$ is

$$Q^{\mathrm{CS}}(C_1, C_2) = \{|c_w\rangle \mid w \in C_2^{\perp}\}.$$

In the previous definition, we used the superscript CS to distinguish this construction from the one of Steane [27], which we are going to present now.

Let $w \in C_1$. We define a qudit as

$$(7) \qquad |w + C_2\rangle := \frac{1}{\sqrt{|C_2|}} \sum_{c \in C_2} |w + c\rangle,$$

where the $+$ in the ket denotes the usual coordinate-wise addition in $\mathbb{F}_q^n$.

**Definition 2.2.** The (Steane) CSS quantum code associated with $C_1$ and $C_2$ is

$$Q^{\mathrm{S}}(C_1, C_2) = \{|w + C_2\rangle \mid w \in C_1\}.$$

**Remark 2.3.** It is not difficult to prove that $w - w' \in C_2$ if and only if $|w + C_2\rangle = |w' + C_2\rangle$, and that $w - w' \in C_2$ if and only if the two cosets $w + C_2$ and $w' + C_2$ are equal. Hence, the natural index set for the qudits of the form $|w + C_2\rangle$ is the set of cosets $C_1/C_2$. Similarly, the natural index set for the qudits $|c_w\rangle$ is the set of cosets $C_2^{\perp}/C_1^{\perp}$.

As announced at the beginning of this section, the two definitions of CSS codes are equivalent, i.e., they differ by a locally unitary operator. Indeed, the two constructions give a different basis for the same quantum code. This was pointed out by Calderbank and Shor in the binary case [6]. Since we could not find a suitable reference for the general case, we present a proof for the analogous statement when $q > 2$.

**Proposition 2.4.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes, and let $C_1^{\perp}$ and $C_2^{\perp}$ denote their respective dual codes. Then, the codes $Q^{\mathrm{CS}}(C_1, C_2)$ and $Q^{\mathrm{S}}(C_2^{\perp}, C_1^{\perp})$ are equivalent.
a code $C$ is defined as

$$d(C) = \min\{\mathrm{wt}(c) \mid c \in C, c \neq \mathbf{0}\},$$

where the zero code $\{\mathbf{0}\}$ has minimum distance $n+1$ by definition. The dual of $C$ is the code

$$C^{\perp} := \{x \in \mathbb{F}_{q}^{n} \mid \langle c, x \rangle = 0 \text{ for all } c \in C\},$$

where $\langle c, x \rangle$ denotes the inner product of the vectors $c$ and $x$. If $C$ has dimension $k$, then $C^{\perp}$ has dimension $n-k$. A code $C$ is said to be self-orthogonal if $C \subseteq C^{\perp}$, and self-dual if $C = C^{\perp}$.

**2.1. Parameters of CSS Codes.** Fix linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$. Let $\zeta = e^{2\pi i/p} \in \mathbb{C}$ be a primitive $p$-th root of unity and let $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p} = \mathrm{Tr}$ denote the absolute trace from $\mathbb{F}_q$ to its prime subfield $\mathbb{F}_p$ defined in Equation (4). For a vector $w \in \mathbb{F}_q^n$ we define a quantum state as follows

$$(6) \qquad |c_w\rangle := \frac{1}{\sqrt{|C_1|}} \sum_{c \in C_1} \zeta^{\mathrm{Tr}(\langle c, w \rangle)} |c\rangle.$$

Note that for any $w \in \mathbb{F}_q^n$, $|c_w\rangle$ has norm one and thus defines a qudit.

**Definition 2.1.** The (Calderbank and Shor) CSS quantum code associated with $C_1$ and $C_2$ is

$$Q^{\mathrm{CS}}(C_1, C_2) = \{|c_w\rangle \mid w \in C_2^{\perp}\}.$$

In the previous definition, we used the superscript CS to distinguish this construction from the one of Steane [27], which we are going to present now.

Let $w \in C_1$. We define a qudit as

$$(7) \qquad |w + C_2\rangle := \frac{1}{\sqrt{|C_2|}} \sum_{c \in C_2} |w + c\rangle,$$

where the $+$ in the ket denotes the usual coordinate-wise addition in $\mathbb{F}_q^n$.

**Definition 2.2.** The (Steane) CSS quantum code associated with $C_1$ and $C_2$ is

$$Q^{\mathrm{S}}(C_1, C_2) = \{|w + C_2\rangle \mid w \in C_1\}.$$

**Remark 2.3.** It is not difficult to prove that $w - w' \in C_2$ if and only if $|w + C_2\rangle = |w' + C_2\rangle$, and that $w - w' \in C_2$ if and only if the two cosets $w + C_2$ and $w' + C_2$ are equal. Hence, the natural index set for the qudits of the form $|w + C_2\rangle$ is the set of cosets $C_1/C_2$. Similarly, the natural index set for the qudits $|c_w\rangle$ is the set of cosets $C_2^{\perp}/C_1^{\perp}$.

As announced at the beginning of this section, the two definitions of CSS codes are equivalent, i.e., they differ by a locally unitary operator. Indeed, the two constructions give a different basis for the same quantum code. This was pointed out by Calderbank and Shor in the binary case [6]. Since we could not find a suitable reference for the general case, we present a proof for the analogous statement when $q > 2$.

**Proposition 2.4.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes, and let $C_1^{\perp}$ and $C_2^{\perp}$ denote their respective dual codes. Then, the codes $Q^{\mathrm{CS}}(C_1, C_2)$ and $Q^{\mathrm{S}}(C_2^{\perp}, C_1^{\perp})$ are equivalent.
Proof. Let $w \in C_2^{\perp}$. With the same notation as before, consider an element of $Q^{\text{CS}}(C_1, C_2)$

$$|c_w\rangle = \frac{1}{\sqrt{|C_1|}} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, w \rangle)} |c\rangle.$$

The action of the unitary $q$-dimensional discrete Fourier transform matrix $H^{(q)}$ (see Example 1.8) on an element $|b\rangle$ of the standard basis of $\mathcal{H}_q$ is

$$H^{(q)} |b\rangle := \frac{1}{\sqrt{q}} \sum_{j=0}^{q-1} \zeta^{\text{Tr}(jb)} |j\rangle.$$

Applying this to $|c_w\rangle$ gives

$$|c'_w\rangle := H^{(q)} |c_w\rangle = \frac{1}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z \in \mathbb{F}_q^n} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, (w+z) \rangle)} |z\rangle.$$

Putting $z' = z + w$ in the previous equation gives

$$(8) \qquad |c'_w\rangle = \frac{1}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z' \in \mathbb{F}_q^n} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, z' \rangle)} |z' - w\rangle.$$

Recall that

$$\sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, z' \rangle)} = \begin{cases} |C_1| & \text{if } z' \in C_1^{\perp}, \\ 0 & \text{otherwise.} \end{cases}$$

Therefore Equation (8) can be rewritten as

$$(9) \qquad |c'_w\rangle = \frac{|C_1|}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z' \in C_1^{\perp}} |z' - w\rangle = \frac{1}{\sqrt{|C_1^{\perp}|}} \sum_{z' \in C_1^{\perp}} |-w + z'\rangle,$$

which is a codeword of $Q^S(C_2^{\perp}, C_1^{\perp})$, as defined in Equation (7). Since $Q^{\text{CS}}(C_1, C_2)$ and $Q^S(C_2^{\perp}, C_1^{\perp})$ have the same dimension, this concludes the proof. $\square$

From now on we will not distinguish between the two (equivalent) definitions of CSS codes. Given two linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ of dimension $k_1$ and $k_2$ respectively, we let $Q(C_1, C_2) = Q^{\text{CS}}(C_1, C_2)$ be the associated CSS code, which has parameters $\llbracket n, k_1 - k_2 \rrbracket_q$.

In order to discuss the quantum error correction capability of CSS codes, we first need to define the weight of an error as given in Equation (5) (see [26, Definition F. 63]).

**Definition 2.5.** For $e, f \in \mathbb{F}_q^n$, let $X^e Z^f = \bigotimes_{i=1}^n X(e_i) Z(f_i)$ be an error acting on a $n$-qudit. The weight of $X^e Z^f$ is defined as the number of tensor factors different from the identity, that is

$$\text{wt}(X^e Z^f) := \#\{i \in \{1, \dots, n\} \mid X(e_i) Z(f_i) \neq I\} = |\sigma(e) \cup \sigma(f)|.$$

Note that the number of $X$ errors (respectively, $Z$ errors) in $X^e Z^f$ equals $\text{wt}(e)$ (respectively, $\text{wt}(f)$).

The following result about the quantum error correction capability of $Q(C_1, C_2)$ holds.

**Theorem 2.6** ([6]). Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be two linear codes. Let $d_1$ and $d_2$ denote the minimum distance of $C_1$ and $C_2^{\perp}$, respectively. Then $Q(C_1, C_2)$ can correct any quantum error pattern $X^e Z^f$ for $\text{wt}(e) \le \lfloor \frac{d_1-1}{2} \rfloor$ and $\text{wt}(f) \le \lfloor \frac{d_2-1}{2} \rfloor$.
Proof. Let $w \in C_2^{\perp}$. With the same notation as before, consider an element of $Q^{\text{CS}}(C_1, C_2)$

$$|c_w\rangle = \frac{1}{\sqrt{|C_1|}} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, w \rangle)} |c\rangle.$$

The action of the unitary $q$-dimensional discrete Fourier transform matrix $H^{(q)}$ (see Example 1.8) on an element $|b\rangle$ of the standard basis of $\mathcal{H}_q$ is

$$H^{(q)} |b\rangle := \frac{1}{\sqrt{q}} \sum_{j=0}^{q-1} \zeta^{\text{Tr}(jb)} |j\rangle.$$

Applying this to $|c_w\rangle$ gives

$$|c'_w\rangle := H^{(q)} |c_w\rangle = \frac{1}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z \in \mathbb{F}_q^n} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, (w+z) \rangle)} |z\rangle.$$

Putting $z' = z + w$ in the previous equation gives

$$(8) \qquad |c'_w\rangle = \frac{1}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z' \in \mathbb{F}_q^n} \sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, z' \rangle)} |z' - w\rangle.$$

Recall that

$$\sum_{c \in C_1} \zeta^{\text{Tr}(\langle c, z' \rangle)} = \begin{cases} |C_1| & \text{if } z' \in C_1^{\perp}, \\ 0 & \text{otherwise.} \end{cases}$$

Therefore Equation (8) can be rewritten as

$$(9) \qquad |c'_w\rangle = \frac{|C_1|}{\sqrt{|C_1||\mathbb{F}_q^n|}} \sum_{z' \in C_1^{\perp}} |z' - w\rangle = \frac{1}{\sqrt{|C_1^{\perp}|}} \sum_{z' \in C_1^{\perp}} |-w + z'\rangle,$$

which is a codeword of $Q^S(C_2^{\perp}, C_1^{\perp})$, as defined in Equation (7). Since $Q^{\text{CS}}(C_1, C_2)$ and $Q^S(C_2^{\perp}, C_1^{\perp})$ have the same dimension, this concludes the proof. $\square$

From now on we will not distinguish between the two (equivalent) definitions of CSS codes. Given two linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ of dimension $k_1$ and $k_2$ respectively, we let $Q(C_1, C_2) = Q^{\text{CS}}(C_1, C_2)$ be the associated CSS code, which has parameters $\llbracket n, k_1 - k_2 \rrbracket_q$.

In order to discuss the quantum error correction capability of CSS codes, we first need to define the weight of an error as given in Equation (5) (see [26, Definition F. 63]).

**Definition 2.5.** For $e, f \in \mathbb{F}_q^n$, let $X^e Z^f = \bigotimes_{i=1}^n X(e_i) Z(f_i)$ be an error acting on a $n$-qudit. The weight of $X^e Z^f$ is defined as the number of tensor factors different from the identity, that is

$$\text{wt}(X^e Z^f) := \#\{i \in \{1, \dots, n\} \mid X(e_i) Z(f_i) \neq I\} = |\sigma(e) \cup \sigma(f)|.$$

Note that the number of $X$ errors (respectively, $Z$ errors) in $X^e Z^f$ equals $\text{wt}(e)$ (respectively, $\text{wt}(f)$).

The following result about the quantum error correction capability of $Q(C_1, C_2)$ holds.

**Theorem 2.6** ([6]). Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be two linear codes. Let $d_1$ and $d_2$ denote the minimum distance of $C_1$ and $C_2^{\perp}$, respectively. Then $Q(C_1, C_2)$ can correct any quantum error pattern $X^e Z^f$ for $\text{wt}(e) \le \lfloor \frac{d_1-1}{2} \rfloor$ and $\text{wt}(f) \le \lfloor \frac{d_2-1}{2} \rfloor$.
Given the fact that quantum errors can be modeled as a pattern of errors of type X and Z, the previous result shows that the minimum distances $d_1$ and $d_2^{\perp}$ are relevant parameters of $Q(C_1, C_2)$. In particular, if $d = \min\{d_1, d_2^{\perp}\}$, then $Q(C_1, C_2)$ can correct any error pattern of weight at most $\lfloor \frac{d-1}{2} \rfloor$. In this case, we say that $Q(C_1, C_2)$ is $\lfloor \frac{d-1}{2} \rfloor$-error correcting.

**Remark 2.7.** The parameters $d_1$ and $d_2^{\perp}$ play a symmetric role in the error correction capability of $Q(C_1, C_2)$. Indeed, we can correct $\lfloor(d_1 - 1)/2\rfloor$ errors of type X and $\lfloor(d_2^{\perp} - 1)/2\rfloor$ errors of type Z. On the other hand, the CSS code $Q(C_2^{\perp}, C_1^{\perp})$ is equivalent to $Q(C_1, C_2)$ by Proposition 2.4 and can correct $\lfloor(d_2^{\perp} - 1)/2\rfloor$ errors of type X and $\lfloor(d_1 - 1)/2\rfloor$ errors of type Z.

**2.2. Density Properties of CSS Codes.** By Theorem 2.6, for any pair of codes $C_2 \subseteq C_1$ we can construct a quantum code $Q(C_1, C_2)$ which is (at least) $\lfloor \frac{d-1}{2} \rfloor$-error correcting, where $d = \min\{d_1, d_2^{\perp}\}$ and $d_1$ and $d_2^{\perp}$ denote the minimum distance of $C_1$ and $C_2^{\perp}$, respectively. In particular, if we choose $C_1 = C^{\perp}$ such that $C \subseteq C^{\perp}$, and we take $C_2 = C$, we obtain a CSS code $Q(C^{\perp}, C)$ which is $\lfloor \frac{d-1}{2} \rfloor$-error correcting, with $d = d_1 = d_2^{\perp}$ being the minimum distance of $C^{\perp}$. For this reason, self-orthogonal codes have been extensively studied in relation to quantum codes. However, a CSS code which is $\lfloor \frac{d-1}{2} \rfloor$-error correcting for some fixed integer $d$, can be constructed from any pair of codes $C_2 \subseteq C_1$ such that $d_1 \ge d$ and $d_2^{\perp} \ge d$.

The goal of this subsection is to estimate the number of pairs of classical linear codes $C_2 \subseteq C_1$ such that $Q(C_1, C_2)$ is a quantum $t$-error-correcting code, with $t = \lfloor \frac{d-1}{2} \rfloor$ for some fixed $d$. We will show that, under some mild conditions on $d$, and for $q$ large enough, the set of such pairs is dense. In particular, focusing on self-orthogonal linear codes is extremely restrictive.

We briefly recall some preliminary notations and results. Given a vector $x \in \mathbb{F}_q^n$, the ball of radius $r \in \mathbb{N}$ of center $x$ is the set $B(x, r) := \{y \in \mathbb{F}_q^n | d(x, y) \le r\} \subseteq \mathbb{F}_q^n$. We let

$$ (10) \qquad \mathbf{b}(r) = |B(x, r)| = \sum_{i=0}^{r} (q-1)^i \binom{n}{i}. $$

For positive integers $n \ge k$, their $q$-binomial coefficient is defined as

$$ \binom{n}{k}_q = \frac{(1-q^n)(1-q^{n-1})\dots(1-q^{n-k+1})}{(1-q^k)(1-q^{k-1})\dots(1-q)}, $$

which is the number of vector subspaces of dimension $k$ of a vector space of dimension $n$ over $\mathbb{F}_q$. We will repeatedly use the asymptotic estimate for the $q$-binomial coefficient as $q$ grows, that is,

$$ \binom{n}{k}_q \sim q^{k(n-k)} \quad \text{as } q \to \infty. $$

**Proposition 2.8** ([5, Theorem 5.1]). Let $C \subseteq \mathbb{F}_q^n$ be a linear code of dimension $k < n$ and let $h$ be an integer such that $k \le h \le n$. For an integer $2 \le d \le d(C)$, set

$$ \mathcal{F}(C)_{h,<d} := \{D \subseteq \mathbb{F}_q^n | C \subseteq D, \dim(D) = h \text{ and } d(D) < d\}. $$

Then

$$ |\mathcal{F}(C)_{h,<d}| \le \binom{n-h}{h-k}_q \frac{q^h - q^k}{(q-1)(q^n - q^k)} (\mathbf{b}(d-1) - 1). $$
Given the fact that quantum errors can be modeled as a pattern of errors of type X and Z, the previous result shows that the minimum distances $d_1$ and $d_2^{\perp}$ are relevant parameters of $Q(C_1, C_2)$. In particular, if $d = \min\{d_1, d_2^{\perp}\}$, then $Q(C_1, C_2)$ can correct any error pattern of weight at most $\lfloor \frac{d-1}{2} \rfloor$. In this case, we say that $Q(C_1, C_2)$ is $\lfloor \frac{d-1}{2} \rfloor$-error correcting.

**Remark 2.7.** The parameters $d_1$ and $d_2^{\perp}$ play a symmetric role in the error correction capability of $Q(C_1, C_2)$. Indeed, we can correct $\lfloor(d_1 - 1)/2\rfloor$ errors of type X and $\lfloor(d_2^{\perp} - 1)/2\rfloor$ errors of type Z. On the other hand, the CSS code $Q(C_2^{\perp}, C_1^{\perp})$ is equivalent to $Q(C_1, C_2)$ by Proposition 2.4 and can correct $\lfloor(d_2^{\perp} - 1)/2\rfloor$ errors of type X and $\lfloor(d_1 - 1)/2\rfloor$ errors of type Z.

**2.2. Density Properties of CSS Codes.** By Theorem 2.6, for any pair of codes $C_2 \subseteq C_1$ we can construct a quantum code $Q(C_1, C_2)$ which is (at least) $\lfloor \frac{d-1}{2} \rfloor$-error correcting, where $d = \min\{d_1, d_2^{\perp}\}$ and $d_1$ and $d_2^{\perp}$ denote the minimum distance of $C_1$ and $C_2^{\perp}$, respectively. In particular, if we choose $C_1 = C^{\perp}$ such that $C \subseteq C^{\perp}$, and we take $C_2 = C$, we obtain a CSS code $Q(C^{\perp}, C)$ which is $\lfloor \frac{d-1}{2} \rfloor$-error correcting, with $d = d_1 = d_2^{\perp}$ being the minimum distance of $C^{\perp}$. For this reason, self-orthogonal codes have been extensively studied in relation to quantum codes. However, a CSS code which is $\lfloor \frac{d-1}{2} \rfloor$-error correcting for some fixed integer $d$, can be constructed from any pair of codes $C_2 \subseteq C_1$ such that $d_1 \ge d$ and $d_2^{\perp} \ge d$.

The goal of this subsection is to estimate the number of pairs of classical linear codes $C_2 \subseteq C_1$ such that $Q(C_1, C_2)$ is a quantum t-error-correcting code, with $t = \lfloor \frac{d-1}{2} \rfloor$ for some fixed $d$. We will show that, under some mild conditions on $d$, and for $q$ large enough, the set of such pairs is dense. In particular, focusing on self-orthogonal linear codes is extremely restrictive.

We briefly recall some preliminary notations and results. Given a vector $x \in \mathbb{F}_q^n$, the ball of radius $r \in \mathbb{N}$ of center $x$ is the set $B(x, r) := \{y \in \mathbb{F}_q^n | d(x, y) \le r\} \subseteq \mathbb{F}_q^n$. We let

$$ (10) \qquad \mathbf{b}(r) = |B(x, r)| = \sum_{i=0}^{r} (q-1)^i \binom{n}{i}. $$

For positive integers $n \ge k$, their q-binomial coefficient is defined as

$$ \binom{n}{k}_q = \frac{(1-q^n)(1-q^{n-1})\dots(1-q^{n-k+1})}{(1-q^k)(1-q^{k-1})\dots(1-q)}, $$

which is the number of vector subspaces of dimension $k$ of a vector space of dimension $n$ over $\mathbb{F}_q$. We will repeatedly use the asymptotic estimate for the q-binomial coefficient as $q$ grows, that is,

$$ \binom{n}{k}_q \sim q^{k(n-k)} \quad \text{as } q \to \infty. $$

**Proposition 2.8** ([5, Theorem 5.1]). Let $C \subseteq \mathbb{F}_q^n$ be a linear code of dimension $k < n$ and let $h$ be an integer such that $k \le h \le n$. For an integer $2 \le d \le d(C)$, set

$$ \mathcal{F}(C)_{h,<d} := \{D \subseteq \mathbb{F}_q^n | C \subseteq D, \dim(D) = h \text{ and } d(D) < d\}. $$

Then

$$ |\mathcal{F}(C)_{h,<d}| \le \binom{n-h}{h-k}_q \frac{q^h - q^k}{(q-1)(q^n - q^k)} (\mathbf{b}(d-1) - 1). $$
In the following proposition, we show that two different pairs of linear codes give two different CSS codes. Thus, in order to count the number of CSS codes $Q(C_1, C_2)$ with prescribed parameters it is enough to count pairs of codes $(C_1, C_2)$.

**Proposition 2.9.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ and $C'_2 \subseteq C'_1 \subseteq \mathbb{F}_q^n$ be linear codes. Let $Q(C_1, C_2)$ and $Q(C'_1, C'_2)$ denote the two associated CSS codes. Then $Q(C_1, C_2) = Q(C'_1, C'_2)$ if and only if $C_1 = C'_1$ and $C_2 = C'_2$.

*Proof.* The backward direction is obvious, so we focus on proving the forward direction. Assume that for codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ and $C'_2 \subseteq C'_1 \subseteq \mathbb{F}_q^n$ we have $Q(C_1, C_2) = Q(C'_1, C'_2)$. Thus for every $|c_w\rangle \in Q(C_1, C_2)$ there is a unique quantum codeword $|c_{w'}\rangle \in Q(C'_1, C'_2)$ such that $|c_w\rangle = |c_{w'}\rangle$, that is

$$ (11) \qquad \frac{1}{\sqrt{|C_2|}} \sum_{c \in C_2} |w+c\rangle = \frac{1}{\sqrt{|C'_2|}} \sum_{c' \in C'_2} |w'+c'\rangle. $$

We have $|w+c_1\rangle = |w+c_2\rangle$ if and only if $c_1 = c_2$, thus the $|C_2|$ kets in both sum are all different and correspond to a standard basis vector, hence the sums in Equation (11) contain $|C_2|$ and $|C'_2|$ distinct orthogonal vectors, respectively. Hence every $|w+c\rangle$ is equal to exactly one $|w'+c'\rangle$, implying that every $w+c$ is equal to exactly one $w'+c'$. Moreover, the sums contain the same number of elements, hence $|C_2| = |C'_2|$.

We will first show that $C_1 = C'_1$. Assume by contradiction that $C_1 \neq C'_1$. Without loss of generality, we can assume that there exists an element $\bar{w} \in C_1 \setminus C'_1$. By hypothesis there exists $w' \in C'_1$ such that $|c_{\bar{w}}\rangle = |c_{w'}\rangle$, that is for any $c \in C_2$ there exists $c' \in C'_2$ such that $\bar{w} + c = w' + c'$. Then, take $c = \mathbf{0} \in C_2 \subseteq C_1$, so for some $c' \in C'_2$ we must have $\bar{w} = \bar{w} + \mathbf{0} = w' + c' \in C'_1$, a contradiction. Hence we must have $C_1 = C'_1$.

Now, let us show that $C_2 = C'_2$ holds too. We will prove this again by contradiction. Take $|c_w\rangle \in Q(C_1, C_2)$ and $|c_{w'}\rangle \in Q(C_1, C'_2)$ such that $|c_w\rangle = |c_{w'}\rangle$. Taking $c = \mathbf{0} \in C_2$ gives $|w+\mathbf{0}\rangle = |w'+c'\rangle$ for some $c' \in C'_2$, which then implies $w = w' + c'$ and hence $w - w' \in C'_2$. Since $|c_w\rangle = |c_{w'}\rangle$, for all $c \in C_2$ there exists $c' \in C'_2$ such that $|w+c\rangle = |w'+c'\rangle$, which entails $c' - c = w - w' \in C'_2$. Therefore, we also have $c = c' - (c' - c) \in C'_2$ and thus $C_2 \subseteq C'_2$, which together with $|C_2| = |C'_2|$ implies $C_2 = C'_2$. $\square$

We are now ready to establish the main result of this subsection. Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes. Let $d_1$ and $d_2^\perp$ denote the minimum distance of $C_1$ and $C_2^\perp$, respectively. If $d_1 \ge \alpha$ and $d_2^\perp \ge \beta$, for some integers $\alpha$ and $\beta$, then by Theorem 2.6 we know that the quantum code $Q(C_1, C_2)$ is $\lfloor \frac{d_1-1}{2} \rfloor$-error correcting with $d \ge \min\{\alpha, \beta\}$. Our goal is to estimate the cardinality of the set

$$ (12) \qquad S_{k_1,k_2}^{\alpha,\beta} := \{(C_1, C_2) \in S \mid d_1 \ge \alpha, d_2^\perp \ge \beta\}, $$

as a subset of

$$ (13) \qquad S_{k_1,k_2} := \{(C_1, C_2) \mid C_2 \subseteq C_1, \dim C_1 = k_1, \dim C_2 = k_2\}. $$
In the following proposition, we show that two different pairs of linear codes give two different CSS codes. Thus, in order to count the number of CSS codes $Q(C_1, C_2)$ with prescribed parameters it is enough to count pairs of codes $(C_1, C_2)$.

**Proposition 2.9.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ and $C'_2 \subseteq C'_1 \subseteq \mathbb{F}_q^n$ be linear codes. Let $Q(C_1, C_2)$ and $Q(C'_1, C'_2)$ denote the two associated CSS codes. Then $Q(C_1, C_2) = Q(C'_1, C'_2)$ if and only if $C_1 = C'_1$ and $C_2 = C'_2$.

*Proof.* The backward direction is obvious, so we focus on proving the forward direction. Assume that for codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ and $C'_2 \subseteq C'_1 \subseteq \mathbb{F}_q^n$ we have $Q(C_1, C_2) = Q(C'_1, C'_2)$. Thus for every $|c_w\rangle \in Q(C_1, C_2)$ there is a unique quantum codeword $|c_{w'}\rangle \in Q(C'_1, C'_2)$ such that $|c_w\rangle = |c_{w'}\rangle$, that is

$$ (11) \qquad \frac{1}{\sqrt{|C_2|}} \sum_{c \in C_2} |w+c\rangle = \frac{1}{\sqrt{|C'_2|}} \sum_{c' \in C'_2} |w'+c'\rangle. $$

We have $|w+c_1\rangle = |w+c_2\rangle$ if and only if $c_1 = c_2$, thus the $|C_2|$ kets in both sum are all different and correspond to a standard basis vector, hence the sums in Equation (11) contain $|C_2|$ and $|C'_2|$ distinct orthogonal vectors, respectively. Hence every $|w+c\rangle$ is equal to exactly one $|w'+c'\rangle$, implying that every $w+c$ is equal to exactly one $w'+c'$. Moreover, the sums contain the same number of elements, hence $|C_2| = |C'_2|$.

We will first show that $C_1 = C'_1$. Assume by contradiction that $C_1 \neq C'_1$. Without loss of generality, we can assume that there exists an element $\bar{w} \in C_1 \setminus C'_1$. By hypothesis there exists $w' \in C'_1$ such that $|c_{\bar{w}}\rangle = |c_{w'}\rangle$, that is for any $c \in C_2$ there exists $c' \in C'_2$ such that $\bar{w} + c = w' + c'$. Then, take $c = \mathbf{0} \in C_2 \subseteq C_1$, so for some $c' \in C'_2$ we must have $\bar{w} = \bar{w} + \mathbf{0} = w' + c' \in C'_1$, a contradiction. Hence we must have $C_1 = C'_1$.

Now, let us show that $C_2 = C'_2$ holds too. We will prove this again by contradiction. Take $|c_w\rangle \in Q(C_1, C_2)$ and $|c_{w'}\rangle \in Q(C_1, C'_2)$ such that $|c_w\rangle = |c_{w'}\rangle$. Taking $c = \mathbf{0} \in C_2$ gives $|w+\mathbf{0}\rangle = |w'+c'\rangle$ for some $c' \in C'_2$, which then implies $w = w' + c'$ and hence $w - w' \in C'_2$. Since $|c_w\rangle = |c_{w'}\rangle$, for all $c \in C_2$ there exists $c' \in C'_2$ such that $|w+c\rangle = |w'+c'\rangle$, which entails $c' - c = w - w' \in C'_2$. Therefore, we also have $c = c' - (c' - c) \in C'_2$ and thus $C_2 \subseteq C'_2$, which together with $|C_2| = |C'_2|$ implies $C_2 = C'_2$. $\square$

We are now ready to establish the main result of this subsection. Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes. Let $d_1$ and $d_2^\perp$ denote the minimum distance of $C_1$ and $C_2^\perp$, respectively. If $d_1 \ge \alpha$ and $d_2^\perp \ge \beta$, for some integers $\alpha$ and $\beta$, then by Theorem 2.6 we know that the quantum code $Q(C_1, C_2)$ is $\lfloor \frac{d_1-1}{2} \rfloor$-error correcting with $d \ge \min\{\alpha, \beta\}$. Our goal is to estimate the cardinality of the set

$$ (12) \qquad S_{k_1,k_2}^{\alpha,\beta} := \{(C_1, C_2) \in S \mid d_1 \ge \alpha, d_2^\perp \ge \beta\}, $$

as a subset of

$$ (13) \qquad S_{k_1,k_2} := \{(C_1, C_2) \mid C_2 \subseteq C_1, \dim C_1 = k_1, \dim C_2 = k_2\}. $$
The second set has cardinality $|S_{k_1,k_2}| = \binom{n}{k_1}_q \binom{k_1}{k_2}_q$. In order to estimate the size of $S_{k_1,k_2}^{\alpha,\beta}$ we introduce the following two auxiliary sets:

$$ \mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha} := \{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1, d(C_1) \ge \alpha\}, $$

$$ \mathcal{G}(C_1)_{k_2, \ge \beta} := \{C_2 \subseteq \mathbb{F}_q^n \mid C_2 \subseteq C_1, \dim(C_2) = k_2, d(C_2^{\perp}) \ge \beta\}. $$

**Lemma 2.10.** Let $k_1 \le n$ and $\alpha$ be integers. We have

$$ |\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}| \ge \binom{n}{k_1}_q \left[ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \right]. $$

*Proof.* Note that $\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}$ is the complement of

$$ \mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha} = \{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1, d(C_1) < \alpha\} $$

in the set $\{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1\}$ of dimension $\binom{n}{k_1}_q$. Applying Proposition 2.8 to the set $\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}$ gives

$$ (14) \qquad |\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}| \le \binom{n}{k_1}_q \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1). $$

Therefore we have

$$ |\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}| = \binom{n}{k_1}_q - |\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}| $$

and the statement follows using Equation (14).

<figure><img src="image_2.png" /></figure>

**Proposition 2.11.** Let $C_1 \subseteq \mathbb{F}_q^n$ be a linear code of parameters $[n, k_1, d_1]$ with $k_1 \le n$, and let $k_2 \le k_1$ and $\beta$ be integers. We have

$$ |\mathcal{G}(C_1)_{k_2, \ge \beta}| \ge \binom{k_1}{k_1-k_2}_q \left[ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})} (\mathbf{b}(\beta-1) - 1) \right]. $$

*Proof.* Let us denote by $C_1^{\perp}$ the dual code of $C_1$, which is of dimension $n - k_1$. Note that $\mathcal{G}(C_1)_{k_2, \ge \beta}$ can be rewritten as $\{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n - k_2, d(C_2^{\perp}) \ge \beta\}$. Now it is easy to see that $\mathcal{G}(C_1)_{k_2, \ge \beta}$ is the complement of

$$ \mathcal{F}(C_1^{\perp})_{n-k_2, < \beta} = \{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n - k_2, d(C_2^{\perp}) < \beta\} $$

in the set

$$ \mathcal{B} := \{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n - k_2\}, $$

which has cardinality $\binom{k_1}{k_1-k_2}_q$. Applying Proposition 2.8 to the set $\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}$ gives

$$ (15) \qquad |\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}| \le \binom{k_1}{k_1-k_2}_q \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})} (\mathbf{b}(\beta-1) - 1). $$

Finally,

$$ |\mathcal{G}(C_1)_{k_2, \ge \beta}| = |\mathcal{B}| - |\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}| $$

and the statement follows using Equation (15).

<figure><img src="image_3.png" /></figure>

Combining the two previous results, we finally obtain the bound we wanted.
The second set has cardinality $|S_{k_1,k_2}| = \binom{n}{k_1}_q \binom{k_1}{k_2}_q$. In order to estimate the size of $S_{k_1,k_2}^{\alpha,\beta}$ we introduce the following two auxiliary sets:

$$ \mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha} := \{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1, d(C_1) \ge \alpha\}, $$

$$ \mathcal{G}(C_1)_{k_2, \ge \beta} := \{C_2 \subseteq \mathbb{F}_q^n \mid C_2 \subseteq C_1, \dim(C_2) = k_2, d(C_2^{\perp}) \ge \beta\}. $$

**Lemma 2.10.** Let $k_1 \le n$ and $\alpha$ be integers. We have

$$ |\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}| \ge \binom{n}{k_1}_q \left[ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \right]. $$

*Proof.* Note that $\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}$ is the complement of

$$ \mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha} = \{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1, d(C_1) < \alpha\} $$

in the set $\{C_1 \subseteq \mathbb{F}_q^n \mid \dim(C_1) = k_1\}$ of dimension $\binom{n}{k_1}_q$. Applying Proposition 2.8 to the set $\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}$ gives

$$ (14) \qquad |\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}| \le \binom{n}{k_1}_q \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1). $$

Therefore we have

$$ |\mathcal{E}(\mathbb{F}_q^n)_{k_1, \ge \alpha}| = \binom{n}{k_1}_q - |\mathcal{F}(\mathbb{F}_q^n)_{k_1, < \alpha}| $$

and the statement follows using Equation (14). □

**Proposition 2.11.** Let $C_1 \subseteq \mathbb{F}_q^n$ be a linear code of parameters $[n, k_1, d_1]$ with $k_1 \le n$, and let $k_2 \le k_1$ and $\beta$ be integers. We have

$$ |\mathcal{G}(C_1)_{k_2, \ge \beta}| \ge \binom{k_1}{k_1-k_2}_q \left[ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})} (\mathbf{b}(\beta-1) - 1) \right]. $$

*Proof.* Let us denote by $C_1^{\perp}$ the dual code of $C_1$, which is of dimension $n-k_1$. Note that $\mathcal{G}(C_1)_{k_2, \ge \beta}$ can be rewritten as $\{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n-k_2, d(C_2^{\perp}) \ge \beta\}$. Now it is easy to see that $\mathcal{G}(C_1)_{k_2, \ge \beta}$ is the complement of

$$ \mathcal{F}(C_1^{\perp})_{n-k_2, < \beta} = \{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n-k_2, d(C_2^{\perp}) < \beta\} $$

in the set

$$ \mathcal{B} := \{C_2^{\perp} \subseteq \mathbb{F}_q^n \mid C_1^{\perp} \subseteq C_2^{\perp}, \dim(C_2^{\perp}) = n-k_2\}, $$

which has cardinality $\binom{k_1}{k_1-k_2}_q$. Applying Proposition 2.8 to the set $\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}$ gives

$$ (15) \qquad |\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}| \le \binom{k_1}{k_1-k_2}_q \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})} (\mathbf{b}(\beta-1) - 1). $$

Finally,

$$ |\mathcal{G}(C_1)_{k_2, \ge \beta}| = |\mathcal{B}| - |\mathcal{F}(C_1^{\perp})_{n-k_2, < \beta}| $$

and the statement follows using Equation (15). □

Combining the two previous results, we finally obtain the bound we wanted.
**Theorem 2.12.** Let $S_{k_1,k_2}^{\alpha,\beta}$ and $S_{k_1,k_2}$ be the set defined in Equations (12) and (13), respectively. Then

$$ \frac{|S_{k_1,k_2}^{\alpha,\beta}|}{|S_{k_1,k_2}|} \geq \left[ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n - q^{n-k_1})} (\mathbf{b}(\beta-1) - 1) \right] \left[ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \right]. $$

*Proof.* Since

$$ |S_{k_1,k_2}| = \binom{n}{k_1}_q \binom{k_1}{k_2}_q, $$

the result follows by combining Lemma 2.10 and Proposition 2.11, using that

$$ |S_{k_1,k_2}^{\alpha,\beta}| = |\mathcal{E}(\mathbb{F}_q^n)_{k_1,\ge\alpha}| \cdot |\mathcal{G}(C_1)_{k_2,\ge\beta}|, $$

and that $\binom{k_1}{k_1-k_2}_q = \binom{k_1}{k_2}_q$.

□

As a corollary of the previous theorem, we obtain an asymptotic estimate on CSS codes with a fixed minimum distance. In other words, the density of the set $S_{k_1,k_2}^{\alpha,\beta}$ inside $S_{k_1,k_2}$.

**Corollary 2.13.** Let $n, k_1, k_2, \alpha, \beta$ be integers such that $k_2 \le k_1 \le n$. Suppose $k_2 \ge \beta - 1$. Then the set of pairs of linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ of dimensions $k_2$ and $k_1$ respectively such that $Q(C_1, C_2)$ is a $\lfloor \frac{d-1}{2} \rfloor$-error-correcting quantum code with $d \ge \min(\alpha, \beta)$ is dense for $q$ large.

*Proof.* The quantity $\frac{q^{k_1-1}}{(q-1)(q^n-1)}(\mathbf{b}(\alpha-1)-1)$ is a polynomial in $q$ with degree $k_1+\alpha-n-2$, which is negative by the Singleton bound. Therefore as $q$ grows we have

$$ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \to 1. $$

The quantity $\frac{q^{n-k_2}-q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})}(\mathbf{b}(\beta-1)-1)$ is a polynomial in $q$ of degree $-k_2+\beta-2$. Consequently, whenever $k_2 \ge \beta - 1$ we have

$$ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n - q^{n-k_1})} (\mathbf{b}(\beta - 1) - 1) \to 1 \text{ as } q \to \infty. $$

The statement follows.

□

**Remark 2.14.** We point out that the condition $k_2 \ge \beta - 1$ in Corollary 2.13 is necessary to have $d_2^\perp \ge \beta$. Indeed, we have

$$ 0 \le d_2^\perp - \beta \le -k_2^\perp + n + 1 - \beta = k_2 + 1 - \beta. $$

### 3. CSS-T CODES: CHARACTERISATIONS AND BOUNDS

In the previous sections, we have seen how errors affecting qudits can be represented using the group of tensors of $q \times q$ Pauli matrices, and that CSS codes allow to correct those errors. However, the group of Pauli matrices (or the Clifford group, its normalizer) is not a set of universal quantum gates, that is, it is not enough to approximate any operation that can be performed on a quantum computer. Indeed, universal quantum computation requires the implementation of a so-called non-Clifford gate, and a standard choice for this gate, is the transversal $T$ (Toffoli) gate [4]. Furthermore, it can be shown that a quantum computer using only operations from the Clifford group can be efficiently simulated on a
**Theorem 2.12.** Let $S_{k_1,k_2}^{\alpha,\beta}$ and $S_{k_1,k_2}$ be the set defined in Equations (12) and (13), respectively. Then

$$ \frac{|S_{k_1,k_2}^{\alpha,\beta}|}{|S_{k_1,k_2}|} \geq \left[ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n - q^{n-k_1})} (\mathbf{b}(\beta-1) - 1) \right] \left[ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \right]. $$

*Proof.* Since

$$ |S_{k_1,k_2}| = \binom{n}{k_1}_q \binom{k_1}{k_2}_q, $$

the result follows by combining Lemma 2.10 and Proposition 2.11, using that

$$ |S_{k_1,k_2}^{\alpha,\beta}| = |\mathcal{E}(\mathbb{F}_q^n)_{k_1,\ge\alpha}| \cdot |\mathcal{G}(C_1)_{k_2,\ge\beta}|, $$

and that $\binom{k_1}{k_1-k_2}_q = \binom{k_1}{k_2}_q$.

□

As a corollary of the previous theorem, we obtain an asymptotic estimate on CSS codes with a fixed minimum distance. In other words, the density of the set $S_{k_1,k_2}^{\alpha,\beta}$ inside $S_{k_1,k_2}$.

**Corollary 2.13.** Let $n, k_1, k_2, \alpha, \beta$ be integers such that $k_2 \le k_1 \le n$. Suppose $k_2 \ge \beta - 1$. Then the set of pairs of linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ of dimensions $k_2$ and $k_1$ respectively such that $Q(C_1, C_2)$ is a $\lfloor \frac{d-1}{2} \rfloor$-error-correcting quantum code with $d \ge \min(\alpha, \beta)$ is dense for $q$ large.

*Proof.* The quantity $\frac{q^{k_1-1}}{(q-1)(q^n-1)}(\mathbf{b}(\alpha-1)-1)$ is a polynomial in $q$ with degree $k_1+\alpha-n-2$, which is negative by the Singleton bound. Therefore as $q$ grows we have

$$ 1 - \frac{q^{k_1} - 1}{(q-1)(q^n-1)} (\mathbf{b}(\alpha-1) - 1) \to 1. $$

The quantity $\frac{q^{n-k_2}-q^{n-k_1}}{(q-1)(q^n-q^{n-k_1})}(\mathbf{b}(\beta-1)-1)$ is a polynomial in $q$ of degree $-k_2+\beta-2$. Consequently, whenever $k_2 \ge \beta - 1$ we have

$$ 1 - \frac{q^{n-k_2} - q^{n-k_1}}{(q-1)(q^n - q^{n-k_1})} (\mathbf{b}(\beta - 1) - 1) \to 1 \text{ as } q \to \infty. $$

The statement follows.

□

**Remark 2.14.** We point out that the condition $k_2 \ge \beta - 1$ in Corollary 2.13 is necessary to have $d_2^{\perp} \ge \beta$. Indeed, we have

$$ 0 \le d_2^{\perp} - \beta \le -k_2^{\perp} + n + 1 - \beta = k_2 + 1 - \beta. $$

### 3. CSS-T CODES: CHARACTERISATIONS AND BOUNDS

In the previous sections, we have seen how errors affecting qudits can be represented using the group of tensors of $q \times q$ Pauli matrices, and that CSS codes allow to correct those errors. However, the group of Pauli matrices (or the Clifford group, its normalizer) is not a set of universal quantum gates, that is, it is not enough to approximate any operation that can be performed on a quantum computer. Indeed, universal quantum computation requires the implementation of a so-called non-Clifford gate, and a standard choice for this gate, is the transversal $T$ (Toffoli) gate [4]. Furthermore, it can be shown that a quantum computer using only operations from the Clifford group can be efficiently simulated on a
classical computer [28]. Therefore, the implementation of a non-Clifford gate is a crucial aspect of quantum computing. In general, Clifford gates are easier to implement than $T$ gates, and while CSS codes admit a transversal implementation of the Clifford group, they don't always support the $T$ gate. To overcome this problem, Rengaswamy, Calderbank, Newman, and Pfister recently introduced in [22] a new class of quantum codes derived from the CSS construction, the CSS-T codes, that support the aforementioned transversal $T$ gate as an operator. CSS-T codes are again quantum codes constructed from a pair of classical linear codes that must satisfy some hypotheses (see Definition 3.1). Note that, although other quantum codes may support the $T$ gate, it has been proved that among non-degenerate stabilizer codes supporting the $T$ gate transversally, the CSS codes are the optimal ones [23]. This is why CSS-T codes are defined as a subfamily of CSS codes.

Few constructions of CSS-T codes are known so far (see [1] for CSS-T codes from Reed-Muller codes and [7] for CSS-T codes from cyclic and extended cyclic codes), and an open problem in this context, as stated in [22], is to find families of CSS-T codes with rate and relative distance both non-vanishing.

In this section, we focus our attention on CSS-T codes. First, we will generalise their original binary definition to any finite field, and give a characterisation of such codes (Theorem 3.7). Secondly, we will show that under very natural assumptions, the rate and relative distance of CSS-T codes cannot be simultaneously large (Theorem 3.9).

**3.1. q-ary CSS-T Codes.** We recall that $\sigma(x)$ denotes the support of the vector $x$ and $\text{wt}(x) = |\sigma(x)|$ its Hamming weight. We also set $[n] := \{1, \dots, n\}$. The following definition of binary CSS-T codes was introduced in [22, p.1].

**Definition 3.1 ([22]).** A CSS code $Q(C_1, C_2)$ is called a (binary) CSS-T code if the following hold:

(1) $C_2$ is an even code; i.e., $\text{wt}(x) \equiv 0 \bmod 2$ for all $x \in C_2$;

(2) for each $x \in C_2$, there exists a self-dual code in $C_1^{\perp}$ of dimension $\text{wt}(x)/2$ that is supported on $x$, i.e., there exists $C_x \subseteq C_1^{\perp}$ such that $|C_x| = 2^{\text{wt}(x)/2}$, $C_x = C_x^{\perp}$, where $\perp_x$ denotes the dual taken in $\mathbb{F}_q^{\text{wt}(x)}$, and for any $z \in C_x$ we have $\sigma(z) \subseteq \sigma(x)$.

As for the case of CSS codes, the definition of CSS-T code can be extended to non-binary linear codes. The notion of even code is sometimes extended to every finite field in the following way: $C \subseteq \mathbb{F}_q^n$ is a *even-like* code if for any $c \in C$ we have $\sum_{i=1}^n c_i \equiv 0 \bmod q$. However, in the present paper, we adopt the following definition.

**Definition 3.2.** A linear code $C \subseteq \mathbb{F}_q^n$ is even if all of its codewords have even weight.

**Remark 3.3.** For $S \subseteq [n]$ let

$$ \mathbb{F}_q^n(S) := \{y \in \mathbb{F}_q^n \mid \sigma(y) \subseteq S\}, $$

and set $\pi_S: \mathbb{F}_q^n \to \mathbb{F}_q^{|S|}$ to be the projection on the coordinates indexed by $S$. For the reader familiar with the *puncturing* and *shortening* constructions, we point out that $\pi_S(C) = \text{punct}(C, [n] - S)$, and $\pi_S(C \cap \mathbb{F}_q^n(S)) = \text{short}(C, [n] - S)$. The second condition in Definition 3.1 can be rephrased as follows:

(2) for any $x \in C_2$, $\pi_{\sigma(x)}(C_1^{\perp} \cap \mathbb{F}_2^n(\sigma(x)))$ contains a self-dual code.
classical computer [28]. Therefore, the implementation of a non-Clifford gate is a crucial aspect of quantum computing. In general, Clifford gates are easier to implement than $T$ gates, and while CSS codes admit a transversal implementation of the Clifford group, they don't always support the $T$ gate. To overcome this problem, Rengaswamy, Calderbank, Newman, and Pfister recently introduced in [22] a new class of quantum codes derived from the CSS construction, the CSS-T codes, that support the aforementioned transversal $T$ gate as an operator. CSS-T codes are again quantum codes constructed from a pair of classical linear codes that must satisfy some hypotheses (see Definition 3.1). Note that, although other quantum codes may support the $T$ gate, it has been proved that among non-degenerate stabilizer codes supporting the $T$ gate transversally, the CSS codes are the optimal ones [23]. This is why CSS-T codes are defined as a subfamily of CSS codes.

Few constructions of CSS-T codes are known so far (see [1] for CSS-T codes from Reed-Muller codes and [7] for CSS-T codes from cyclic and extended cyclic codes), and an open problem in this context, as stated in [22], is to find families of CSS-T codes with rate and relative distance both non-vanishing.

In this section, we focus our attention on CSS-T codes. First, we will generalise their original binary definition to any finite field, and give a characterisation of such codes (Theorem 3.7). Secondly, we will show that under very natural assumptions, the rate and relative distance of CSS-T codes cannot be simultaneously large (Theorem 3.9).

**3.1. $q$-ary CSS-T Codes.** We recall that $\sigma(x)$ denotes the support of the vector $x$ and $\mathrm{wt}(x) = |\sigma(x)|$ its Hamming weight. We also set $[n] := \{1, \dots, n\}$. The following definition of binary CSS-T codes was introduced in [22, p.1].

**Definition 3.1 ([22]).** A CSS code $Q(C_1, C_2)$ is called a (binary) CSS-T code if the following hold:

(1) $C_2$ is an even code; i.e., $\mathrm{wt}(x) \equiv 0 \mod 2$ for all $x \in C_2$;

(2) for each $x \in C_2$, there exists a self-dual code in $C_1^{\perp}$ of dimension $\mathrm{wt}(x)/2$ that is supported on $x$, i.e., there exists $C_x \subseteq C_1^{\perp}$ such that $|C_x| = 2^{\mathrm{wt}(x)/2}$, $C_x = C_x^{\perp}$, where $\perp_x$ denotes the dual taken in $\mathbb{F}_q^{\mathrm{wt}(x)}$, and for any $z \in C_x$ we have $\sigma(z) \subseteq \sigma(x)$.

As for the case of CSS codes, the definition of CSS-T code can be extended to non-binary linear codes. The notion of even code is sometimes extended to every finite field in the following way: $C \subseteq \mathbb{F}_q^n$ is a *even-like* code if for any $c \in C$ we have $\sum_{i=1}^n c_i \equiv 0 \mod q$. However, in the present paper, we adopt the following definition.

**Definition 3.2.** A linear code $C \subseteq \mathbb{F}_q^n$ is even if all of its codewords have even weight.

**Remark 3.3.** For $S \subseteq [n]$ let

$$ \mathbb{F}_q^n(S) := \{y \in \mathbb{F}_q^n \mid \sigma(y) \subseteq S\}, $$

and set $\pi_S: \mathbb{F}_q^n \to \mathbb{F}_q^{|S|}$ to be the projection on the coordinates indexed by $S$. For the reader familiar with the *puncturing* and *shortening* constructions, we point out that $\pi_S(C) = \mathrm{punct}(C, [n] - S)$, and $\pi_S(C \cap \mathbb{F}_q^n(S)) = \mathrm{short}(C, [n] - S)$. The second condition in Definition 3.1 can be rephrased as follows:

(2) for any $x \in C_2$, $\pi_{\sigma(x)}(C_1^{\perp} \cap \mathbb{F}_2^n(\sigma(x)))$ contains a self-dual code.
We are now ready to give the definition of $q$-ary CSS-T codes.

**Definition 3.4.** A CSS code $Q(C_1, C_2)$ from two linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ is a $q$-ary CSS-T code if:

(1) $C_2$ is an even code;,

(2) for any $x \in C_2$ we have that $\pi_{\sigma(x)}(C_1^{\perp} \cap \mathbb{F}_q^n(\sigma(x)))$ contains a self-dual code.

In contrast to the binary case, the first condition in the definition of $q$-ary CSS-T codes is not linear. Nevertheless, it is necessary to be able to fulfill the second one. We shall now focus on the second condition. In [1] the authors proved that a binary code $C$ contains a self-dual code if and only if its length is even and $C^{\perp}$ is self-orthogonal. We recall here their nice proof and generalise it to linear codes over $\mathbb{F}_q$ with $q$ a power of 2. Unfortunately, the proof cannot be generalised further to finite fields of odd characteristic. However, using different techniques, we are able to establish a similar characterisation over such fields; see Proposition 3.6 below.

**Proposition 3.5.** Let $q$ be a power of 2. A linear code $C \subseteq \mathbb{F}_q^n$ contains a self-dual code if and only if $n$ is even and $C^{\perp}$ is self-orthogonal, that is, $C^{\perp} \subseteq C$.

*Proof.* The requirement on $n$ is clearly necessary for the existence of a self-dual code. Suppose that $C$ contains a self-dual code $D$. By dualizing $D \subseteq C$ we get $C^{\perp} \subseteq D^{\perp} = D \subseteq C$. Therefore $C^{\perp}$ is self-orthogonal. Now let $C^{\perp}$ be self-orthogonal and let $n$ be even. Consider the set

$$ \mathcal{L} := \{D \subseteq C \mid C^{\perp} \subseteq D \text{ and } \dim D = n/2\}. $$

Let $k$ denote the dimension of $C$. By [5, Proposition 2.5] we have

$$ |\mathcal{L}| = \binom{k-(n-k)}{\frac{n}{2}-(n-k)}_q = \binom{2k-n}{k-\frac{n}{2}}_q = \prod_{i=0}^{k-\frac{n}{2}-1} \frac{q^{2k-n-i}-1}{q^{i+1}-1}. $$

Since $q$ is even, $|\mathcal{L}|$ is odd. Observe that if $D \in \mathcal{L}$, then $D^{\perp} \in \mathcal{L}$. Thus $\mathcal{L}$ must contain at least one code $D$ such that $D = D^{\perp}$, which concludes the proof. $\square$

We now turn to the case where $q$ is odd.

**Proposition 3.6.** Let $C \subseteq \mathbb{F}_q^n$ be a linear code of dimension $k \ge n/2$.

(1) If $q \equiv 1 \mod 4$, then $C$ contains a self-dual code if and only if $n$ is even and $C^{\perp}$ is self-orthogonal.

(2) If $q \equiv 3 \mod 4$, then $C$ contains a self-dual code if and only if $n \equiv 0 \mod 4$ and $C^{\perp}$ is self-orthogonal.

*Proof.* If $C \subseteq \mathbb{F}_q^n$ contains a self-dual code, say $A$, then $\dim(A) = n - \dim(A)$ implies that $n$ is even. Moreover, $C \supseteq A$ implies $C^{\perp} \subseteq A^{\perp} = A \subseteq C = (C^{\perp})^{\perp}$, hence $C^{\perp}$ is self-orthogonal. We study the two cases separately, using results on finite bilinear spaces revisited and extended in [9].

(1) Suppose $q \equiv 1 \mod 4$. If $C$ contains a self-dual code then we have already shown that $n$ is even and $C^{\perp}$ is self-orthogonal. Now suppose that $n$ is even and that $C^{\perp}$ is self-orthogonal. We want to prove that there exists $A$ self-orthogonal with $\dim(A) = n/2$
We are now ready to give the definition of q-ary CSS-T codes.

**Definition 3.4.** A CSS code $Q(C_1, C_2)$ from two linear codes $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ is a q-ary CSS-T code if:

(1) $C_2$ is an even code;,

(2) for any $x \in C_2$ we have that $\pi_{\sigma(x)}(C_1^{\perp} \cap \mathbb{F}_q^n(\sigma(x)))$ contains a self-dual code.

In contrast to the binary case, the first condition in the definition of q-ary CSS-T codes is not linear. Nevertheless, it is necessary to be able to fulfill the second one. We shall now focus on the second condition. In [1] the authors proved that a binary code C contains a self-dual code if and only if its length is even and $C^{\perp}$ is self-orthogonal. We recall here their nice proof and generalise it to linear codes over $\mathbb{F}_q$ with q a power of 2. Unfortunately, the proof cannot be generalised further to finite fields of odd characteristic. However, using different techniques, we are able to establish a similar characterisation over such fields; see Proposition 3.6 below.

**Proposition 3.5.** Let $q$ be a power of 2. A linear code $C \subseteq \mathbb{F}_q^n$ contains a self-dual code if and only if $n$ is even and $C^{\perp}$ is self-orthogonal, that is, $C^{\perp} \subseteq C$.

*Proof.* The requirement on $n$ is clearly necessary for the existence of a self-dual code. Suppose that $C$ contains a self-dual code $D$. By dualizing $D \subseteq C$ we get $C^{\perp} \subseteq D^{\perp} = D \subseteq C$. Therefore $C^{\perp}$ is self-orthogonal. Now let $C^{\perp}$ be self-orthogonal and let $n$ be even. Consider the set

$$ \mathcal{L} := \{D \subseteq C \mid C^{\perp} \subseteq D \text{ and } \dim D = n/2\}. $$

Let $k$ denote the dimension of $C$. By [5, Proposition 2.5] we have

$$ |\mathcal{L}| = \binom{k-(n-k)}{\frac{n}{2}-(n-k)}_q = \binom{2k-n}{k-\frac{n}{2}}_q = \prod_{i=0}^{k-\frac{n}{2}-1} \frac{q^{2k-n-i}-1}{q^{i+1}-1}. $$

Since $q$ is even, $|\mathcal{L}|$ is odd. Observe that if $D \in \mathcal{L}$, then $D^{\perp} \in \mathcal{L}$. Thus $\mathcal{L}$ must contain at least one code $D$ such that $D = D^{\perp}$, which concludes the proof. $\square$

We now turn to the case where $q$ is odd.

**Proposition 3.6.** Let $C \subseteq \mathbb{F}_q^n$ be a linear code of dimension $k \ge n/2$.

(1) If $q \equiv 1 \mod 4$, then $C$ contains a self-dual code if and only if $n$ is even and $C^{\perp}$ is self-orthogonal.

(2) If $q \equiv 3 \mod 4$, then $C$ contains a self-dual code if and only if $n \equiv 0 \mod 4$ and $C^{\perp}$ is self-orthogonal.

*Proof.* If $C \subseteq \mathbb{F}_q^n$ contains a self-dual code, say $A$, then $\dim(A) = n - \dim(A)$ implies that $n$ is even. Moreover, $C \supseteq A$ implies $C^{\perp} \subseteq A^{\perp} = A \subseteq C = (C^{\perp})^{\perp}$, hence $C^{\perp}$ is self-orthogonal. We study the two cases separately, using results on finite bilinear spaces revisited and extended in [9].

(1) Suppose $q \equiv 1 \mod 4$. If $C$ contains a self-dual code then we have already shown that $n$ is even and $C^{\perp}$ is self-orthogonal. Now suppose that $n$ is even and that $C^{\perp}$ is self-orthogonal. We want to prove that there exists $A$ self-orthogonal with $\dim(A) = n/2$
and $\mathbb{F}_q^n \supseteq A \supseteq C^\perp$. If $k = n/2$ then $C$ is self-dual, and the statement follows. So, let us consider the case $k > n/2$. By [9, Proposition 2.9], such a space exists if and only if there exists a subspace $A' \subseteq C/C^\perp$ of dimension $n/2 - (n-k) = k - n/2$ that is self-orthogonal with respect to the non-degenerate symmetric bilinear form induced by the standard inner product on the quotient $C/C^\perp$. Since $q \equiv 1 \pmod 4$, $(\mathbb{F}_q^n, \cdot)$ has type (H); see [9, Proposition 3.2]. Since $k > n/2$ by assumption, we have $n-k \neq n/2$ and therefore by the second part of [9, Proposition 2.9], the induced bilinear space $C/C^\perp$ also has type (H). In particular, by [9, Definition 2.8] and the definition of Witt index, it contains a self-orthogonal subspace of dimension $\dim(C/C^\perp)/2 = k - n/2$, as desired.

(2) Suppose $q \equiv 3 \pmod 4$. If $C$ contains a self-dual code then we have already shown that $n$ is even and $C^\perp$ is self-orthogonal. We need to show that $n \equiv 0 \pmod 4$ as well. If $k = n/2$ then this follows from [19, §2.4.3]. Hence, let us suppose $k > n/2$. As in the previous part of the proof $C$ containing a self-dual code implies the existence of a self-dual code in the quotient bilinear space $C/C^\perp$. Since $q \equiv 3 \pmod 4$, $n$ is even, and $k > n/2$, by [9, Propositions 2.9 and 3.2], the latter space has type (H) if $n \equiv 0 \pmod 4$ and type (E) if $n \equiv 2 \pmod 4$. By [9, Definition 2.8] and the definition of Witt index, the existence of a self-dual code is only possible when the type is (H), which then gives $n \equiv 0 \pmod 4$. The same argument shows that if $n \equiv 0 \pmod 4$ and $C^\perp$ is self-orthogonal, then $C$ contains a self-dual code. $\square$

Thanks to Proposition 3.6 we can provide the following characterisation of CSS-T codes.

**Theorem 3.7.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes and let $C_2$ be even.

(1) If $q$ is even or $q \equiv 1 \pmod 4$, then $Q(C_1, C_2)$ is a CSS-T code if and only if for any $x \in C_2$ we have

$$\pi_{\sigma(x)}(C_1) \subseteq \pi_{\sigma(x)}(C_1)^{\perp x}.$$

(2) If $q \equiv 3 \pmod 4$, then $Q(C_1, C_2)$ is a CSS-T code if and only if for any $x \in C_2$ we have

$$\pi_{\sigma(x)}(C_1) \subseteq \pi_{\sigma(x)}(C_1)^{\perp x} \quad \text{and} \quad \frac{\mathrm{wt}(x)}{2} \equiv 0 \pmod 2.$$

*Proof.* Let us fix $x \in C_2$. We know from Propositions 3.5 and 3.6 that when $q$ is even or $q \equiv 1 \pmod 4$ then $\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x)))$ contains a self-dual code if and only if its length is even and $(\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x}$ is self-orthogonal, and that when $q \equiv 3 \pmod 4$ we furthermore need the condition $\frac{\mathrm{wt}(x)}{2} \equiv 0 \pmod 2$. Since $C_2$ is an even code we have that $\mathrm{wt}(x)$ is even. Observe that $(\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x} = \pi_{\sigma(x)}((C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^\perp$. From [15, Theorem 1.5.7 (i)] we know that

$$(\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x} = \pi_{\sigma(x)}(C_1),$$

which concludes the proof. $\square$

3.2. **Rate and Relative Distances of CSS-T Codes.** As we have already mentioned, in [22] the authors pose the open problem about the existence of families of CSS-T codes with non-vanishing asymptotic rate and asymptotic relative distance. In this subsection, we focus our attention on these parameters. We start by recalling a well-known property of punctured codes (cf. [21, Proposition 2.1.4]).
and $\mathbb{F}_q^n \supseteq A \supseteq C^\perp$. If $k = n/2$ then $C$ is self-dual, and the statement follows. So, let us consider the case $k > n/2$. By [9, Proposition 2.9], such a space exists if and only if there exists a subspace $A' \subseteq C/C^\perp$ of dimension $n/2 - (n-k) = k - n/2$ that is self-orthogonal with respect to the non-degenerate symmetric bilinear form induced by the standard inner product on the quotient $C/C^\perp$. Since $q \equiv 1 \mod 4$, $(\mathbb{F}_q^n, \cdot)$ has type (H); see [9, Proposition 3.2]. Since $k > n/2$ by assumption, we have $n-k \neq n/2$ and therefore by the second part of [9, Proposition 2.9], the induced bilinear space $C/C^\perp$ also has type (H). In particular, by [9, Definition 2.8] and the definition of Witt index, it contains a self-orthogonal subspace of dimension $\dim(C/C^\perp)/2 = k - n/2$, as desired.

(2) Suppose $q \equiv 3 \mod 4$. If $C$ contains a self-dual code then we have already shown that $n$ is even and $C^\perp$ is self-orthogonal. We need to show that $n \equiv 0 \mod 4$ as well. If $k = n/2$ then this follows from [19, §2.4.3]. Hence, let us suppose $k > n/2$. As in the previous part of the proof $C$ containing a self-dual code implies the existence of a self-dual code in the quotient bilinear space $C/C^\perp$. Since $q \equiv 3 \mod 4$, $n$ is even, and $k > n/2$, by [9, Propositions 2.9 and 3.2], the latter space has type (H) if $n \equiv 0 \mod 4$ and type (E) if $n \equiv 2 \mod 4$. By [9, Definition 2.8] and the definition of Witt index, the existence of a self-dual code is only possible when the type is (H), which then gives $n \equiv 0 \mod 4$. The same argument shows that if $n \equiv 0 \mod 4$ and $C^\perp$ is self-orthogonal, then $C$ contains a self-dual code. $\square$

Thanks to Proposition 3.6 we can provide the following characterisation of CSS-T codes.

**Theorem 3.7.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be linear codes and let $C_2$ be even.

(1) If $q$ is even or $q \equiv 1 \mod 4$, then $Q(C_1, C_2)$ is a CSS-T code if and only if for any $x \in C_2$ we have

$$ \pi_{\sigma(x)}(C_1) \subseteq \pi_{\sigma(x)}(C_1)^{\perp x}. $$

(2) If $q \equiv 3 \mod 4$, then $Q(C_1, C_2)$ is a CSS-T code if and only if for any $x \in C_2$ we have

$$ \pi_{\sigma(x)}(C_1) \subseteq \pi_{\sigma(x)}(C_1)^{\perp x} \quad \text{and} \quad \frac{\mathrm{wt}(x)}{2} \equiv 0 \mod 2. $$

*Proof.* Let us fix $x \in C_2$. We know from Propositions 3.5 and 3.6 that when $q$ is even or $q \equiv 1 \mod 4$ then $\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x)))$ contains a self-dual code if and only if its length is even and $(\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x}$ is self-orthogonal, and that when $q \equiv 3 \mod 4$ we furthermore need the condition $\frac{\mathrm{wt}(x)}{2} \equiv 0 \mod 2$. Since $C_2$ is an even code we have that $\mathrm{wt}(x)$ is even. Observe that $(\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x} = \pi_{\sigma(x)}((C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp}$. From [15, Theorem 1.5.7 (i)] we know that

$$ (\pi_{\sigma(x)}(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))))^{\perp x} = \pi_{\sigma(x)}(C_1), $$

which concludes the proof. $\square$

3.2. **Rate and Relative Distances of CSS-T Codes.** As we have already mentioned, in [22] the authors pose the open problem about the existence of families of CSS-T codes with non-vanishing asymptotic rate and asymptotic relative distance. In this subsection, we focus our attention on these parameters. We start by recalling a well-known property of punctured codes (cf. [21, Proposition 2.1.4]).
**Proposition 3.8.** Let C be a $[n, k, d]$ code. Let I be a subset of $\{1, \dots, n\}$ of size r. Then, if $n - r < d$, $\pi_I(C)$ is a $[r, k, \ge d - (n - r)]$ code.

In the sequel we follow the notation of the previous subsections and also set

$$R = \frac{k_1 - k_2}{n}, \quad \delta_1 = \frac{d_1}{n}, \quad \delta_2^{\perp} = \frac{d_2^{\perp}}{n}, \quad \delta = \min(\delta_1, \delta_2^{\perp}).$$

Since $d_2^{\perp} \ge \min(d_1, d_2^{\perp})$, we have $\delta \le \delta_2^{\perp}$.

**Theorem 3.9.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be such that $Q(C_1, C_2)$ is a CSS-T code. Then the following facts hold.

(1) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) \ge n - k_2 + 1$, then

$$R + \frac{\delta_2^{\perp}}{2} \le \frac{1}{2}.$$

In particular, $R + \delta/2 \le 1/2$.

(2) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) > n - d_1$, then

$$R + \delta_2^{\perp} \le \frac{1}{2} + \frac{1}{n}.$$

In particular, $R + \delta \le 1/2 + 1/n$.

(3) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) = n - d_1$, then

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{2}{n}.$$

In particular, $R + 3\delta/2 \le 1/2 + 2/n$.

*Proof.* (1) By Proposition 3.6 since $Q(C_1, C_2)$ is a CSS-T code, for any $x \in C_2$ the code $\pi_{\sigma(x)}(C_1)$, which has length $\mathrm{wt}(x)$, is self-orthogonal. Therefore, we must have $k_x := \dim \pi_{\sigma(x)}(C_1) \le \mathrm{wt}(x)/2 \le n/2$. Clearly we have $k_x = k_1 - \dim (\ker \pi_{\sigma(x)} \cap C_1) \ge k_1 - \dim (\ker \pi_{\sigma(x)}) = k_1 - (n - \mathrm{wt}(x))$, which rewrites as

$$k_1 \le k_x + n - \mathrm{wt}(x) \le n - \frac{\mathrm{wt}(x)}{2}.$$

By our assumptions, there exists at least one codeword $x \in C_2$ such that $\mathrm{wt}(x) \ge n - k_2 + 1$. This implies $k_1 \le (n + k_2 - 1)/2$ and thus we have

$$k_1 - k_2 \le \frac{n - k_2 - 1}{2}.$$

By the Singleton bound we also have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. These bounds together give

$$k_1 - k_2 \le \frac{n - d_2^{\perp}}{2}.$$

We conclude by dividing both terms by n.

(2) By assumption, we have $\mathrm{wt}(x) > n - d_1$, therefore there exist a positive integer $\lambda$ such that $\mathrm{wt}(x) = n - d_1 + \lambda$. Since $n - \mathrm{wt}(x) < d_1$, by Proposition 3.8, $\pi_{\sigma(x)}(C_1)$ has dimension $k_1$. By Proposition 3.6 since $Q(C_1, C_2)$ is a CSS-T code, the code $\pi_{\sigma(x)}(C_1)$, which has length $\mathrm{wt}(x)$, is self-orthogonal. Therefore, we must have $k_1 \le \mathrm{wt}(x)/2$.
**Proposition 3.8.** Let C be a $[n, k, d]$ code. Let I be a subset of $\{1, \dots, n\}$ of size r. Then, if $n - r < d$, $\pi_I(C)$ is a $[r, k, \ge d - (n - r)]$ code.

In the sequel we follow the notation of the previous subsections and also set

$$R = \frac{k_1 - k_2}{n}, \quad \delta_1 = \frac{d_1}{n}, \quad \delta_2^{\perp} = \frac{d_2^{\perp}}{n}, \quad \delta = \min(\delta_1, \delta_2^{\perp}).$$

Since $d_2^{\perp} \ge \min(d_1, d_2^{\perp})$, we have $\delta \le \delta_2^{\perp}$.

**Theorem 3.9.** Let $C_2 \subseteq C_1 \subseteq \mathbb{F}_q^n$ be such that $Q(C_1, C_2)$ is a CSS-T code. Then the following facts hold.

(1) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) \ge n - k_2 + 1$, then

$$R + \frac{\delta_2^{\perp}}{2} \le \frac{1}{2}.$$

In particular, $R + \delta/2 \le 1/2$.

(2) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) > n - d_1$, then

$$R + \delta_2^{\perp} \le \frac{1}{2} + \frac{1}{n}.$$

In particular, $R + \delta \le 1/2 + 1/n$.

(3) If there exists a codeword $x \in C_2$ such that $\mathrm{wt}(x) = n - d_1$, then

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{2}{n}.$$

In particular, $R + 3\delta/2 \le 1/2 + 2/n$.

*Proof.* (1) By Proposition 3.6 since $Q(C_1, C_2)$ is a CSS-T code, for any $x \in C_2$ the code $\pi_{\sigma(x)}(C_1)$, which has length $\mathrm{wt}(x)$, is self-orthogonal. Therefore, we must have $k_x := \dim \pi_{\sigma(x)}(C_1) \le \mathrm{wt}(x)/2 \le n/2$. Clearly we have $k_x = k_1 - \dim (\ker \pi_{\sigma(x)} \cap C_1) \ge k_1 - \dim (\ker \pi_{\sigma(x)}) = k_1 - (n - \mathrm{wt}(x))$, which rewrites as

$$k_1 \le k_x + n - \mathrm{wt}(x) \le n - \frac{\mathrm{wt}(x)}{2}.$$

By our assumptions, there exists at least one codeword $x \in C_2$ such that $\mathrm{wt}(x) \ge n - k_2 + 1$. This implies $k_1 \le (n + k_2 - 1)/2$ and thus we have

$$k_1 - k_2 \le \frac{n - k_2 - 1}{2}.$$

By the Singleton bound we also have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. These bounds together give

$$k_1 - k_2 \le \frac{n - d_2^{\perp}}{2}.$$

We conclude by dividing both terms by $n$.

(2) By assumption, we have $\mathrm{wt}(x) > n - d_1$, therefore there exist a positive integer $\lambda$ such that $\mathrm{wt}(x) = n - d_1 + \lambda$. Since $n - \mathrm{wt}(x) < d_1$, by Proposition 3.8, $\pi_{\sigma(x)}(C_1)$ has dimension $k_1$. By Proposition 3.6 since $Q(C_1, C_2)$ is a CSS-T code, the code $\pi_{\sigma(x)}(C_1)$, which has length $\mathrm{wt}(x)$, is self-orthogonal. Therefore, we must have $k_1 \le \mathrm{wt}(x)/2$.
Furthermore, we have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. In sum, this gives

$$k_1 - k_2 \le \frac{n - d_1 + \lambda}{2} - d_2^{\perp} + 1.$$

Since $\lambda$ is necessarily strictly smaller than $d_1$, we have

$$k_1 - k_2 \le \frac{n}{2} - d_2^{\perp} + 1.$$

Dividing by $n$ we get the result.

(3) Since $\mathrm{wt}(x) = n - d_1$, we have that $\pi_{\sigma(x)}(C_1)$ has dimension $k_1 - 1$ or $k_1$. In the first case, using Proposition 3.6 we know that

$$k_1 - 1 \le \frac{\mathrm{wt}(x)}{2} - 1 = \frac{n - d_1}{2} - 1.$$

Moreover by the Singleton bound we also have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. Thus, we obtain

$$k_1 - k_2 \le \frac{n - d_1}{2} - d_2^{\perp} + 2.$$

Dividing by $n$ we get

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{2}{n}.$$

In the second case, we can perform exactly the same reasoning, using now that $k_1 \le \mathrm{wt}(x)/2 = (n - d_1)/2$. Therefore we conclude

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{1}{n} \le \frac{1}{2} + \frac{2}{n},$$

as desired.

<figure><img src="image_4.png" /></figure>

**Remark 3.10.** A recent paper [1] proposes a construction of CSS-T codes from binary Reed-Muller codes with asymptotic rate 1/2 and vanishing asymptotic relative distance. If we consider Reed-Muller codes $C_1 = \mathrm{RM}(r', m)$ and $C_2 = \mathrm{RM}(r, m)$ with $r' > r$, then since the codeword $1 \in C_2$, the bound (1) of Theorem 3.9 applies to $Q(C_1, C_2)$. In particular, this means that binary CSS-T codes from binary Reed-Muller codes cannot have rate bigger than 1/2, and when they have rate exactly equal to 1/2 they must have zero minimum distance. Therefore our bound shows that the construction in [1] is optimal.

**Remark 3.11.** Consider the code $Q(C^{\perp}, C)$ where $C$ is a (strictly) self-orthogonal code, that is $C \subsetneq C^{\perp}$. If $Q(C^{\perp}, C)$ is a CSS-T code, then the assumption $\mathrm{wt}(x) > n - d_1$ is never satisfied. Indeed, we have seen that if $Q(C_1, C_2)$ is a CSS-T code, then the existence of a codeword $x \in C_2$ such that $\mathrm{wt}(x) > n - d_1$ implies $k_1 \le \frac{n}{2}$. However, for $C$ to be (strictly) self-orthogonal we must have $k_1 > \frac{n}{2}$.

The results of Theorem 3.9 show that the parameters $R$ and $\delta$ of a CSS-T code $Q(C_1, C_2)$ must satisfy certain bounds if the code $C_2$ contains a codeword of a certain weight. In the following proposition, we show that the existence condition in point (1) of the theorem is likely satisfied for a linear code over $\mathbb{F}_q$ for large $q$.

**Proposition 3.12.** Let $k, n, \omega$ be positive integers such that $k < n$ and $\omega > n - k + 1$. For any prime power $q$, consider the set

$$\mathcal{L}_q = \{C \subseteq \mathbb{F}_q^n \mid \dim C = k, \exists x \in C \text{ with } \mathrm{wt}(x) = \omega\}.$$
Furthermore, we have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. In sum, this gives

$$k_1 - k_2 \le \frac{n - d_1 + \lambda}{2} - d_2^{\perp} + 1.$$

Since $\lambda$ is necessarily strictly smaller than $d_1$, we have

$$k_1 - k_2 \le \frac{n}{2} - d_2^{\perp} + 1.$$

Dividing by $n$ we get the result.

(3) Since $\mathrm{wt}(x) = n - d_1$, we have that $\pi_{\sigma(x)}(C_1)$ has dimension $k_1 - 1$ or $k_1$. In the first case, using Proposition 3.6 we know that

$$k_1 - 1 \le \frac{\mathrm{wt}(x)}{2} - 1 = \frac{n - d_1}{2} - 1.$$

Moreover by the Singleton bound we also have $d_2^{\perp} - 1 \le n - k_2^{\perp} = k_2$. Thus, we obtain

$$k_1 - k_2 \le \frac{n - d_1}{2} - d_2^{\perp} + 2.$$

Dividing by $n$ we get

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{2}{n}.$$

In the second case, we can perform exactly the same reasoning, using now that $k_1 \le \mathrm{wt}(x)/2 = (n - d_1)/2$. Therefore we conclude

$$R + \frac{\delta_1}{2} + \delta_2^{\perp} \le \frac{1}{2} + \frac{1}{n} \le \frac{1}{2} + \frac{2}{n},$$

as desired.

□

**Remark 3.10.** A recent paper [1] proposes a construction of CSS-T codes from binary Reed-Muller codes with asymptotic rate 1/2 and vanishing asymptotic relative distance. If we consider Reed-Muller codes $C_1 = \mathrm{RM}(r', m)$ and $C_2 = \mathrm{RM}(r, m)$ with $r' > r$, then since the codeword $1 \in C_2$, the bound (1) of Theorem 3.9 applies to $Q(C_1, C_2)$. In particular, this means that binary CSS-T codes from binary Reed-Muller codes cannot have rate bigger than 1/2, and when they have rate exactly equal to 1/2 they must have zero minimum distance. Therefore our bound shows that the construction in [1] is optimal.

**Remark 3.11.** Consider the code $Q(C^{\perp}, C)$ where $C$ is a (strictly) self-orthogonal code, that is $C \subsetneq C^{\perp}$. If $Q(C^{\perp}, C)$ is a CSS-T code, then the assumption $\mathrm{wt}(x) > n - d_1$ is never satisfied. Indeed, we have seen that if $Q(C_1, C_2)$ is a CSS-T code, then the existence of a codeword $x \in C_2$ such that $\mathrm{wt}(x) > n - d_1$ implies $k_1 \le \frac{n}{2}$. However, for $C$ to be (strictly) self-orthogonal we must have $k_1 > \frac{n}{2}$.

The results of Theorem 3.9 show that the parameters $R$ and $\delta$ of a CSS-T code $Q(C_1, C_2)$ must satisfy certain bounds if the code $C_2$ contains a codeword of a certain weight. In the following proposition, we show that the existence condition in point (1) of the theorem is likely satisfied for a linear code over $\mathbb{F}_q$ for large $q$.

**Proposition 3.12.** Let $k, n, \omega$ be positive integers such that $k < n$ and $\omega > n - k + 1$. For any prime power $q$, consider the set

$$\mathcal{L}_q = \{C \subseteq \mathbb{F}_q^n \mid \dim C = k, \exists x \in C \text{ with } \mathrm{wt}(x) = \omega\}.$$
Then, for $q \to \infty$ we have

$$ \frac{|\mathcal{L}_q|}{\binom{n}{k}_q} \to 1. $$

*Proof.* The set $\mathcal{L}_q$ is the set of $q$-ary linear codes of length $n$ and dimension $k$ that contain a codeword of weight $\omega$. Since $\binom{n}{k}_q$ is the number of $[n, k]_q$ linear codes, we have $|\mathcal{L}_q| \le \binom{n}{k}_q \sim q^{(n-k)k}$. We show that, asymptotically, also $|\mathcal{L}_q|$ grows as $q^{(n-k)k}$.

We consider a bipartite graph with on the one side the set $K$ of vectors $v \in \mathbb{F}_q^n$ that have weight exactly $\omega$, and on the other side the set of $[n, k]_q$ linear codes. We connect each code to the vectors it contains. Let us set $\beta = \frac{|K|-1}{q-1} = \binom{n}{\omega}(q-1)^{\omega-1}$. In this setting, we can apply [13, Theorem 3.8] and obtain

$$ |\mathcal{L}_q| \ge \frac{\beta \binom{n-1}{k-1}_q}{1 + (\beta - 1) \frac{q^{k-1}-1}{q^{n-1}-1}}. $$

Asymptotically, for $q \to \infty$, the numerator grows as $\binom{n}{\omega}q^{\omega-1+(k-1)(n-k)}$. Regarding the denominator, since $(\beta-1)\frac{q^{k-1}-1}{q^{n-1}-1} \sim \binom{n}{\omega}q^{\omega-1+k-n}$ as $q \to \infty$, the right summand of the denominator is bigger than 1 as soon as $\omega-1+k-n > 0$. Therefore, under our assumption on $\omega$, for $q \to \infty$ we have

$$ |\mathcal{L}_q| \ge q^{(n-k)k} \sim \binom{n}{k}_q, $$

which concludes the proof. $\square$

**Remark 3.13.** We can construct a CSS-T code attaining the first bound of Theorem 3.9 whenever there exists a self-dual code with a codeword of full support of even weight, in the following way. Let $C_1 \subseteq \mathbb{F}_q^n$ be a self-dual code, and let $x \in C_1$ be an even weight codeword of full support, i.e., $x_i \ne 0$ for all $i = 1, \dots, n$. Take $C_2 = \langle x \rangle$. Then we have $C_2 \subset C_1$, $C_2$ is even, and $d_2^\perp = 2$. The first two statements are trivial, and the third one easily follows by observing that by the Singleton bound one has $d_2^\perp \le 2$, and that since $x$ has full support $C_2^\perp$ does not contain words of weight 1. Moreover, since $x$ has full support and $C_1 = C_1^\perp$, we have that $\pi_\sigma(x)(C_1^\perp \cap \mathbb{F}_q^n(\sigma(x))) = C_1^\perp = C_1$ contains a self-dual code. Therefore, by Definition 3.4, $Q(C_1, C_2)$ is a CSS-T code. Its rate satisfies

$$ R = \frac{k_1 - 1}{n} = \frac{n-2}{2n} = \frac{1}{2} - \frac{1}{n}. $$

Therefore, we have

$$ R + \frac{\delta_2^\perp}{2} = \frac{1}{2} - \frac{1}{n} + \frac{1}{n} = \frac{1}{2}. $$

## 4. A CONSTRUCTION OF CSS-T CODES FROM THE HERMITIAN CURVE

In this last section, we show a simple construction of CSS-T codes using the Hermitian curve. This construction is optimal with respect to the asymptotic bound (1) of Theorem 3.9. We will use standard notations and results on AG codes. We refer the reader to [31, 32] for more details and proofs.

From now on, we let $q$ be a power of 2 and we consider the Hermitian curve $C$ defined over $\mathbb{F}_{q^2}$ by the equation

$$ y^q + y = x^{q+1}. $$
Then, for $q \to \infty$ we have

$$ \frac{|\mathcal{L}_q|}{\binom{n}{k}_q} \to 1. $$

*Proof.* The set $\mathcal{L}_q$ is the set of $q$-ary linear codes of length $n$ and dimension $k$ that contain a codeword of weight $\omega$. Since $\binom{n}{k}_q$ is the number of $[n, k]_q$ linear codes, we have $|\mathcal{L}_q| \le \binom{n}{k}_q \sim q^{(n-k)k}$. We show that, asymptotically, also $|\mathcal{L}_q|$ grows as $q^{(n-k)k}$.

We consider a bipartite graph with on the one side the set $K$ of vectors $v \in \mathbb{F}_q^n$ that have weight exactly $\omega$, and on the other side the set of $[n, k]_q$ linear codes. We connect each code to the vectors it contains. Let us set $\beta = \frac{|K|-1}{q-1} = \binom{n}{\omega}(q-1)^{\omega-1}$. In this setting, we can apply [13, Theorem 3.8] and obtain

$$ |\mathcal{L}_q| \ge \frac{\beta \binom{n-1}{k-1}_q}{1 + (\beta - 1) \frac{q^{k-1}-1}{q^{n-1}-1}}. $$

Asymptotically, for $q \to \infty$, the numerator grows as $\binom{n}{\omega}q^{\omega-1+(k-1)(n-k)}$. Regarding the denominator, since $(\beta - 1) \frac{q^{k-1}-1}{q^{n-1}-1} \sim \binom{n}{\omega}q^{\omega-1+k-n}$ as $q \to \infty$, the right summand of the denominator is bigger than 1 as soon as $\omega - 1 + k - n > 0$. Therefore, under our assumption on $\omega$, for $q \to \infty$ we have

$$ |\mathcal{L}_q| \ge q^{(n-k)k} \sim \binom{n}{k}_q, $$

which concludes the proof. $\square$

**Remark 3.13.** We can construct a CSS-T code attaining the first bound of Theorem 3.9 whenever there exists a self-dual code with a codeword of full support of even weight, in the following way. Let $C_1 \subseteq \mathbb{F}_q^n$ be a self-dual code, and let $x \in C_1$ be an even weight codeword of full support, i.e., $x_i \ne 0$ for all $i = 1, \dots, n$. Take $C_2 = \langle x \rangle$. Then we have $C_2 \subset C_1$, $C_2$ is even, and $d_2^{\perp} = 2$. The first two statements are trivial, and the third one easily follows by observing that by the Singleton bound one has $d_2^{\perp} \le 2$, and that since $x$ has full support $C_2^{\perp}$ does not contain words of weight 1. Moreover, since $x$ has full support and $C_1 = C_1^{\perp}$, we have that $\pi_{\sigma}(x)(C_1^{\perp} \cap \mathbb{F}_q^n(\sigma(x))) = C_1^{\perp} = C_1$ contains a self-dual code. Therefore, by Definition 3.4, $Q(C_1, C_2)$ is a CSS-T code. Its rate satisfies

$$ R = \frac{k_1 - 1}{n} = \frac{n-2}{2n} = \frac{1}{2} - \frac{1}{n}. $$

Therefore, we have

$$ R + \frac{\delta_2^{\perp}}{2} = \frac{1}{2} - \frac{1}{n} + \frac{1}{n} = \frac{1}{2}. $$

### 4. A CONSTRUCTION OF CSS-T CODES FROM THE HERMITIAN CURVE

In this last section, we show a simple construction of CSS-T codes using the Hermitian curve. This construction is optimal with respect to the asymptotic bound (1) of Theorem 3.9. We will use standard notations and results on AG codes. We refer the reader to [31, 32] for more details and proofs.

From now on, we let $q$ be a power of 2 and we consider the Hermitian curve $C$ defined over $\mathbb{F}_{q^2}$ by the equation

$$ y^q + y = x^{q+1}. $$
By Plücker's formula, $\mathcal{C}$ has genus $g = \frac{1}{2}q(q-1)$. It has a unique point at infinity, which we denote by $P_\infty$, and $n = q^3$ affine points over $\mathbb{F}_{q^2}$. In particular, the $q^3$ affine points are characterized as follows [32, Lemma 6.4.4]: for any $\alpha \in \mathbb{F}_{q^2}$, there exist $q$ elements $\beta \in \mathbb{F}_{q^2}$ such that $P_{\alpha,\beta} = (\alpha, \beta)$ is an affine point of $\mathcal{C}$.

We will consider one-point codes on $\mathcal{C}$ of the form

$$C(mP_{\infty}, D) := \{ev_D(f) = (f(P_1), \dots, f(P_n)) \in \mathbb{F}_q^n \mid f \in L(mP_{\infty})\},$$

where $m > 0$ is an integer, $D = \sum_{P \in \mathcal{C}(\mathbb{F}_{q^2}) \setminus \{P_\infty\}} P$ is the sum of all affine points of $\mathcal{C}$, and $L(mP_\infty)$ is the Riemann-Roch space of rational functions $f$ on $\mathcal{C}$ such that $\text{div}f + mP_\infty \ge 0$.

**Lemma 4.1.** Let $C_1$ be the code $C(mP_\infty, D)$ on $\mathcal{C}$. The subcode $C_2 \subseteq C_1$ constructed by evaluating the functions in $L := \langle x^i : 0 \le i \le m/q \rangle$ at the points of $D$ is even. Furthermore, it is the largest subcode of $C_1$ that is even.

*Proof.* Without loss of generality, we can reorder the $q^3$ rational points in the support of $D$ in $q^2$ sets of cardinality $q$, each made of points with the same first coordinate. Take $f \in L$. Then, the coordinates of the codeword $ev_D(f)$ can be divided into $q^2$ sets of cardinality $q$, the $q$ coordinates in each set being the same. In particular, one coordinate in a set is zero if and only if the other $q-1$ coordinates in the same set are zero. Since $q$ is even, this shows that the weight of $ev_D(f)$ is even. Now, let us prove that $L$ is the maximal subset of $L(mP_\infty)$ giving an even code. First, let us remark that the bound $i \le m/q$ cannot be enlarged [32, Lemma 6.4.4(e)]. Secondly, there is only one point on $\mathcal{C}$ with $y=0$, thus the function $y$ and its powers lead to codewords of odd weight. Finally, we consider functions of the form $x^i y^j$, for $i, j \in \mathbb{N}$. Without loss of generality, let us consider $xy$. Fix $x=1$, then there are at least two elements $y_1$ and $y_2$ such that $(1, y_1)$ and $(1, y_2)$ are points on $\mathcal{C}$. Let $z$ be the generator of the extension $\mathbb{F}_{q^2}/\mathbb{F}_q$. Then there exists a choice of integers $j_i$ such that $y_1 = \sum_{i=0}^{m/q} z^{j_i}$, that is $(1, y_1)$ is a zero of the function $f = \sum_{i=0}^{m/q} z^{j_i} x^i + xy \in \langle xy, x^i : 0 \le i \le m/q \rangle$, and any $(1, y)$ with $y \ne y_1$ is not a zero of $f$. In a similar way, if $(\alpha, \beta_1)$ is a root of $f$, then there is no other $\beta_i$ such that $(\alpha, \beta_i)$ is a root of $f$. Therefore, the weight of $ev_D(f)$ is odd. This concludes the proof. $\square$

**Lemma 4.2.** Let $C_2$ be the linear code from Lemma 4.1. Then its dual code $C_2^\perp$ has minimum distance $d_2^\perp = 2$.

*Proof.* From the reasoning in the proof of Lemma 4.1, we see that every codeword $c \in C_2$ has $q^2$ coordinates repeated $q$ times. More specifically, let $i \ne j$ be two positions where $c_i = c_j$. Then, for any other codeword $c' \in C_2$ we have $c'_i = c'_j$. Therefore, since we are working in characteristic 2, the codeword $e_i + e_j$, where $e_i$ denotes the $i$-th vector of the standard basis, belongs to $C_2^\perp$, and thus we have $d_2^\perp \le 2$. Since $1 \in C_2$ we also have $d_2^\perp > 1$, which concludes the proof. $\square$

By Lemma 4.2, the maximal dimension even subcode $C_2$ of $C(mP_\infty, D)$ has the same dual minimum distance of the code generated by the one vector $1$, and of course bigger dimension. This justifies why in the following, we will consider $C_2 = \langle 1 \rangle$ for constructing Hermitian CSS-T codes.
By Plücker's formula, $\mathcal{C}$ has genus $g = \frac{1}{2}q(q-1)$. It has a unique point at infinity, which we denote by $P_\infty$, and $n = q^3$ affine points over $\mathbb{F}_{q^2}$. In particular, the $q^3$ affine points are characterized as follows [32, Lemma 6.4.4]: for any $\alpha \in \mathbb{F}_{q^2}$, there exist $q$ elements $\beta \in \mathbb{F}_{q^2}$ such that $P_{\alpha,\beta} = (\alpha, \beta)$ is an affine point of $\mathcal{C}$.

We will consider one-point codes on $\mathcal{C}$ of the form

$$C(mP_{\infty}, D) := \{ev_D(f) = (f(P_1), \dots, f(P_n)) \in \mathbb{F}_q^n \mid f \in L(mP_{\infty})\},$$

where $m > 0$ is an integer, $D = \sum_{P \in \mathcal{C}(\mathbb{F}_{q^2}) \setminus \{P_\infty\}} P$ is the sum of all affine points of $\mathcal{C}$, and $L(mP_\infty)$ is the Riemann-Roch space of rational functions $f$ on $\mathcal{C}$ such that $\text{div}f + mP_\infty \ge 0$.

**Lemma 4.1.** Let $C_1$ be the code $C(mP_\infty, D)$ on $\mathcal{C}$. The subcode $C_2 \subseteq C_1$ constructed by evaluating the functions in $L := \langle x^i : 0 \le i \le m/q \rangle$ at the points of $D$ is even. Furthermore, it is the largest subcode of $C_1$ that is even.

*Proof.* Without loss of generality, we can reorder the $q^3$ rational points in the support of $D$ in $q^2$ sets of cardinality $q$, each made of points with the same first coordinate. Take $f \in L$. Then, the coordinates of the codeword $ev_D(f)$ can be divided into $q^2$ sets of cardinality $q$, the $q$ coordinates in each set being the same. In particular, one coordinate in a set is zero if and only if the other $q-1$ coordinates in the same set are zero. Since $q$ is even, this shows that the weight of $ev_D(f)$ is even. Now, let us prove that $L$ is the maximal subset of $L(mP_\infty)$ giving an even code. First, let us remark that the bound $i \le m/q$ cannot be enlarged [32, Lemma 6.4.4(e)]. Secondly, there is only one point on $\mathcal{C}$ with $y = 0$, thus the function $y$ and its powers lead to codewords of odd weight. Finally, we consider functions of the form $x^i y^j$, for $i, j \in \mathbb{N}$. Without loss of generality, let us consider $xy$. Fix $x = 1$, then there are at least two elements $y_1$ and $y_2$ such that $(1, y_1)$ and $(1, y_2)$ are points on $\mathcal{C}$. Let $z$ be the generator of the extension $\mathbb{F}_{q^2}/\mathbb{F}_q$. Then there exists a choice of integers $j_i$ such that $y_1 = \sum_{i=0}^{m/q} z^{j_i}$, that is $(1, y_1)$ is a zero of the function $f = \sum_{i=0}^{m/q} z^{j_i} x^i + xy \in \langle xy, x^i : 0 \le i \le m/q \rangle$, and any $(1, y)$ with $y \ne y_1$ is not a zero of $f$. In a similar way, if $(\alpha, \beta_1)$ is a root of $f$, then there is no other $\beta_i$ such that $(\alpha, \beta_i)$ is a root of $f$. Therefore, the weight of $ev_D(f)$ is odd. This concludes the proof. $\square$

**Lemma 4.2.** Let $C_2$ be the linear code from Lemma 4.1. Then its dual code $C_2^\perp$ has minimum distance $d_2^\perp = 2$.

*Proof.* From the reasoning in the proof of Lemma 4.1, we see that every codeword $c \in C_2$ has $q^2$ coordinates repeated $q$ times. More specifically, let $i \ne j$ be two positions where $c_i = c_j$. Then, for any other codeword $c' \in C_2$ we have $c'_i = c'_j$. Therefore, since we are working in characteristic 2, the codeword $e_i + e_j$, where $e_i$ denotes the $i$-th vector of the standard basis, belongs to $C_2^\perp$, and thus we have $d_2^\perp \le 2$. Since $1 \in C_2$ we also have $d_2^\perp > 1$, which concludes the proof. $\square$

By Lemma 4.2, the maximal dimension even subcode $C_2$ of $C(mP_\infty, D)$ has the same dual minimum distance of the code generated by the one vector $1$, and of course bigger dimension. This justifies why in the following, we will consider $C_2 = \langle 1 \rangle$ for constructing Hermitian CSS-T codes.
**Theorem 4.3.** Let $q$ be a power of $2$ and consider the Hermitian curve $C$ of genus $g = \frac{1}{2}q(q-1)$ defined over $\mathbb{F}_{q^2}$. Set $q^2 - q - 1 \le m \le (q^3 + q^2 - q - 2)/2$ and let $D = \sum_{P \in C(\mathbb{F}_{q^2}) \setminus \{P_\infty\}} P$. Let $C_1 = C(mP_\infty, D)$ and let $C_2 = \langle \mathbf{1} \rangle$. Then, the quantum code $Q(C_1, C_2)$ is a $[[q^3, m-g]]_q$ CSS-T code. In particular, for $m = (q^3 + q^2 - q - 2)/2$, the rate and relative distance of $Q(C_1, C_2)$ attain bound (1) of Theorem 3.9.

*Proof.* The dimension $k_1$ of $C_1$ is easily computed via the Riemann–Roch theorem and is $k_1 = m - g + 1$. By construction $C_2 \subseteq C_1$, thus $Q(C_1, C_2)$ is a CSS code. Its dimension is $k_1 - k_2 = m - g$ and the minimum distances are given by $d_1 \ge q^3 - m$ and $d_2^\perp = 2$. By construction, $C_2$ is an even code and for any $x \in C_2$, we have $\pi_{\sigma(x)}(C_1) = C_1$. Since $2m \le n+2g-2$, $C_1$ is self-orthogonal [32, Proposition 8.3.2]. Its length is even by construction. Hence, by Proposition 3.7, $Q(C_1, C_2)$ is a CSS-T code. The last statement follows by a simple calculation. $\square$

**Example 4.4.** Following Theorem 4.3, we can obtain explicitly the parameters of CSS-T codes from the Hermitian curve once $q$ is fixed. For instance, for $q = 2$ we get a $[[8, 3]]_2$ CSS-T code, and for $q = 4$ we have a $[[64, 31]]_4$ CSS-T code.

## CONCLUSIONS

In this paper, we investigated CSS and CSS-T codes for quantum error correction. We described the typical behaviour of a CSS and of a CSS-T code with respect to correction capability, showing that, over a large field, a uniformly random CSS code has good distance properties, while a CSS-T code hasn't. We also established bounds on the parameters of a CSS-T code, evaluating the performance of previous constructions. We then provided a simple construction of CSS-T codes from Hermitian curves. The paper also offers a concise introduction to quantum error correction from the point of view of classical coding theory.

## 5. DECLARATIONS

**Ethical Approval.** This declaration is not applicable.

**Funding.** E. Berardini was supported by the EU Horizon 2020 research and innovation programme under the MSCA grant 899987 until April 2023, and by the grant ANR-21-CE39-0009-BARRACUDA of the French National Research Agency. A. Caminata is supported by the Italian PRIN2020 grant 2020355B8Y "Squarefree Gröbner degenerations, special varieties and related topics", by the Italian PRIN2022 grant 2022J4HRR "Mathematical Primitives for Post Quantum Digital Signatures", by the INdAM-GNSAGA grant "New theoretical perspectives via Gröbner bases", by the MUR Excellence Department Project awarded to Dipartimento di Matematica, Università di Genova, CUP D33C23001110001, and by the European Union within the program NextGenerationEU. A. Ravagnani is supported by the Dutch Research Council through grants VI.Vidi.203.045 and OCENW.KLEIN.539, by the Royal Academy of Arts and Sciences of the Netherlands, and by the Horizon Europe MSCA-DN grant "EN-CODE".

**Availability of data and materials.** This declaration is not applicable.
**Theorem 4.3.** Let $q$ be a power of $2$ and consider the Hermitian curve $C$ of genus $g = \frac{1}{2}q(q-1)$ defined over $\mathbb{F}_{q^2}$. Set $q^2 - q - 1 \le m \le (q^3 + q^2 - q - 2)/2$ and let $D = \sum_{P \in C(\mathbb{F}_{q^2}) \setminus \{P_\infty\}} P$. Let $C_1 = C(mP_\infty, D)$ and let $C_2 = \langle \mathbf{1} \rangle$. Then, the quantum code $Q(C_1, C_2)$ is a $[[q^3, m-g]]_q$ CSS-T code. In particular, for $m = (q^3 + q^2 - q - 2)/2$, the rate and relative distance of $Q(C_1, C_2)$ attain bound (1) of Theorem 3.9.

*Proof*. The dimension $k_1$ of $C_1$ is easily computed via the Riemann–Roch theorem and is $k_1 = m - g + 1$. By construction $C_2 \subseteq C_1$, thus $Q(C_1, C_2)$ is a CSS code. Its dimension is $k_1 - k_2 = m - g$ and the minimum distances are given by $d_1 \ge q^3 - m$ and $d_2^\perp = 2$. By construction, $C_2$ is an even code and for any $x \in C_2$, we have $\pi_{\sigma(x)}(C_1) = C_1$. Since $2m \le n+2g-2$, $C_1$ is self-orthogonal [32, Proposition 8.3.2]. Its length is even by construction. Hence, by Proposition 3.7, $Q(C_1, C_2)$ is a CSS-T code. The last statement follows by a simple calculation. $\square$

**Example 4.4.** Following Theorem 4.3, we can obtain explicitly the parameters of CSS-T codes from the Hermitian curve once $q$ is fixed. For instance, for $q = 2$ we get a $[[8, 3]]_2$ CSS-T code, and for $q = 4$ we have a $[[64, 31]]_4$ CSS-T code.

## CONCLUSIONS

In this paper, we investigated CSS and CSS-T codes for quantum error correction. We described the typical behaviour of a CSS and of a CSS-T code with respect to correction capability, showing that, over a large field, a uniformly random CSS code has good distance properties, while a CSS-T code hasn't. We also established bounds on the parameters of a CSS-T code, evaluating the performance of previous constructions. We then provided a simple construction of CSS-T codes from Hermitian curves. The paper also offers a concise introduction to quantum error correction from the point of view of classical coding theory.

## 5. DECLARATIONS

**Ethical Approval.** This declaration is not applicable.

**Funding.** E. Berardini was supported by the EU Horizon 2020 research and innovation programme under the MSCA grant 899987 until April 2023, and by the grant ANR-21-CE39-0009-BARRACUDA of the French National Research Agency. A. Caminata is supported by the Italian PRIN2020 grant 2020355B8Y "Squarefree Gröbner degenerations, special varieties and related topics", by the Italian PRIN2022 grant 2022J4HRR "Mathematical Primitives for Post Quantum Digital Signatures", by the INdAM-GNSAGA grant "New theoretical perspectives via Gröbner bases", by the MUR Excellence Department Project awarded to Dipartimento di Matematica, Università di Genova, CUP D33C23001110001, and by the European Union within the program NextGenerationEU. A. Ravagnani is supported by the Dutch Research Council through grants VI.Vidi.203.045 and OCENW.KLEIN.539, by the Royal Academy of Arts and Sciences of the Netherlands, and by the Horizon Europe MSCA-DN grant "EN-CODE".

**Availability of data and materials.** This declaration is not applicable.
REFERENCES

[1] E. ANDRADE, J. BOLKEMA, T. DEXTER, H. EGGERS, V. LUONGO, F. MANGANIELLO, AND L. SZRAMOWSKI, *CSS-T codes from Reed-Muller codes for Quantum Fault Tolerance*, arXiv preprint arXiv:2305.06423, (2023).

[2] L. BACHORÍKOVÁ, *Hamming-metric codes for quantum channels*, M.Sc. thesis, Eindhoven University of Technology, the Netherlands, (2022).

[3] S. BALL, A. CENTELLES, AND F. HUBER, *Quantum error-correcting codes and their geometries*, Annales de l'Institut Henri Poincaré D, 10 (2023), pp. 337-405.

[4] P. O. BOYKIN, T. MOR, M. PULVER, V. ROYCHOWDHURY, AND F. VATAN, *On universal and fault-tolerant quantum computing: a novel basis and a new constructive proof of universality for Shor's basis*, in 40th Annual Symposium on Foundations of Computer Science (Cat. No. 99CB37039), IEEE, 1999, pp. 486-494.

[5] E. BYRNE AND A. RAVAGNANI, *Partition-balanced families of codes and asymptotic enumeration in coding theory*, Journal of Combinatorial Theory, Series A, 171 (2020), pp. 105-169.

[6] A. R. CALDERBANK AND P. W. SHOR, *Good quantum error-correcting codes exist*, Physical Review A, 54 (1996), pp. 1098-1105.

[7] E. CAMPS-MORENO, H. H. LÓPEZ, G. L. MATTHEWS, D. RUANO, R. SAN-JOSÉ, AND I. SOPRUNOV, *The poset of binary css-t quantum codes and cyclic codes*, arXiv preprint arXiv:2312.17518, (2023).

[8] J. CHIAVERINI ET AL., *Realization of quantum error correction*, Nature, 432 (2004).

[9] H. GLUESING-LUERSSEN AND A. RAVAGNANI, *ℓ-Complementary Subspaces and Codes in Finite Bilinear Spaces*, IEEE Transactions on Information Theory, 70 (2024), pp. 2443-2455.

[10] M. GRASSL, *Algebraic quantum codes: linking quantum mechanics and discrete mathematics*, International Journal of Computer Mathematics: Computer Systems Theory, 6 (2021), pp. 243-259.

[11] ——, *New quantum codes from CSS codes*, Quantum Information Processing, 22 (2023), p. 86.

[12] M. GRASSL, W. GEISELMANN, AND T. BETH, *Quantum Reed-Solomon codes*, in Applied Algebra, Algebraic Algorithms and Error-Correcting Codes: 13th International Symposium, AAECC-13 Honolulu, Hawaii, USA, November 15-19, 1999 Proceedings 13, Springer, 1999, pp. 231-244.

[13] A. GRUICA AND A. RAVAGNANI, *Common complements of linear subspaces and the sparseness of MRD codes*, SIAM Journal on Applied Algebra and Geometry, 6 (2022), pp. 79-110.

[14] F. HERNANDO, G. MCGUIRE, F. MONSERRAT, AND J. J. MOYANO-FERNÁNDEZ, *Quantum codes from a new construction of self-orthogonal algebraic geometry codes*, Quantum Inf. Process., 19 (2020), pp. Paper No. 117, 25.

[15] W. C. HUFFMAN AND V. PLESS, *Fundamentals of error-correcting codes*, Cambridge university press, 2010.

[16] L. JIN AND C. XING, *Euclidean and Hermitian self-orthogonal Algebraic Geometry codes and their application to quantum codes*, IEEE Transactions on information theory, 58 (2011), pp. 5484-5489.

[17] J.-L. KIM AND G. L. MATTHEWS, *Quantum error-correcting codes from algebraic curves*, in Advances in Algebraic Geometry codes, World Scientific, 2008, pp. 419-444.

[18] G. G. LA GUARDIA, *On the construction of nonbinary quantum BCH codes*, IEEE Transactions on Information Theory, 60 (2014), pp. 1528-1535.

[19] G. NEBE, E. M. RAINS, AND N. J. A. SLOANE, *Self-dual codes and invariant theory*, vol. 17, Springer, 2006.

[20] M. A. NIELSEN AND I. L. CHUANG, *Quantum computation and quantum information*, Cambridge University Press, Cambridge, 2000.

[21] R. PELLIKAAN, X.-W. WU, S. BULYGIN, AND R. JURRIUS, *Codes, cryptology and curves with computer algebra*, Cambridge University Press, Cambridge, 2018.

[22] N. RENGASWAMY, R. CALDERBANK, M. NEWMAN, AND H. D. PFISTER, *Classical coding problem from transversal T-gates*, in 2020 IEEE International Symposium on Information Theory (ISIT), IEEE, 2020, pp. 1891-1896.

[23] ——, *On optimality of CSS codes for transversal T*, IEEE Journal on Selected Areas in Information Theory, 1 (2020), pp. 499-514.
REFERENCES

[1] E. ANDRADE, J. BOLKEMA, T. DEXTER, H. EGGERS, V. LUONGO, F. MANGANIELLO, AND L. SZRAMOWSKI, *CSS-T codes from Reed-Muller codes for Quantum Fault Tolerance*, arXiv preprint arXiv:2305.06423, (2023).

[2] L. BACHORÍKOVÁ, *Hamming-metric codes for quantum channels*, M.Sc. thesis, Eindhoven University of Technology, the Netherlands, (2022).

[3] S. BALL, A. CENTELLES, AND F. HUBER, *Quantum error-correcting codes and their geometries*, Annales de l'Institut Henri Poincaré D, 10 (2023), pp. 337-405.

[4] P. O. BOYKIN, T. MOR, M. PULVER, V. ROYCHOWDHURY, AND F. VATAN, *On universal and fault-tolerant quantum computing: a novel basis and a new constructive proof of universality for Shor's basis*, in 40th Annual Symposium on Foundations of Computer Science (Cat. No. 99CB37039), IEEE, 1999, pp. 486-494.

[5] E. BYRNE AND A. RAVAGNANI, *Partition-balanced families of codes and asymptotic enumeration in coding theory*, Journal of Combinatorial Theory, Series A, 171 (2020), pp. 105-169.

[6] A. R. CALDERBANK AND P. W. SHOR, *Good quantum error-correcting codes exist*, Physical Review A, 54 (1996), pp. 1098-1105.

[7] E. CAMPS-MORENO, H. H. LÓPEZ, G. L. MATTHEWS, D. RUANO, R. SAN-JOSÉ, AND I. SOPRUNOV, *The poset of binary css-t quantum codes and cyclic codes*, arXiv preprint arXiv:2312.17518, (2023).

[8] J. CHIAVERINI ET AL., *Realization of quantum error correction*, Nature, 432 (2004).

[9] H. GLUESING-LUERSSEN AND A. RAVAGNANI, *ℓ-Complementary Subspaces and Codes in Finite Bilinear Spaces*, IEEE Transactions on Information Theory, 70 (2024), pp. 2443-2455.

[10] M. GRASSL, *Algebraic quantum codes: linking quantum mechanics and discrete mathematics*, International Journal of Computer Mathematics: Computer Systems Theory, 6 (2021), pp. 243-259.

[11] ——, *New quantum codes from CSS codes*, Quantum Information Processing, 22 (2023), p. 86.

[12] M. GRASSL, W. GEISELMANN, AND T. BETH, *Quantum Reed-Solomon codes*, in Applied Algebra, Algebraic Algorithms and Error-Correcting Codes: 13th International Symposium, AAECC-13 Honolulu, Hawaii, USA, November 15-19, 1999 Proceedings 13, Springer, 1999, pp. 231-244.

[13] A. GRUICA AND A. RAVAGNANI, *Common complements of linear subspaces and the sparseness of MRD codes*, SIAM Journal on Applied Algebra and Geometry, 6 (2022), pp. 79-110.

[14] F. HERNANDO, G. MCGUIRE, F. MONSERRAT, AND J. J. MOYANO-FERNÁNDEZ, *Quantum codes from a new construction of self-orthogonal algebraic geometry codes*, Quantum Inf. Process., 19 (2020), pp. Paper No. 117, 25.

[15] W. C. HUFFMAN AND V. PLESS, *Fundamentals of error-correcting codes*, Cambridge university press, 2010.

[16] L. JIN AND C. XING, *Euclidean and Hermitian self-orthogonal Algebraic Geometry codes and their application to quantum codes*, IEEE Transactions on information theory, 58 (2011), pp. 5484-5489.

[17] J.-L. KIM AND G. L. MATTHEWS, *Quantum error-correcting codes from algebraic curves*, in Advances in Algebraic Geometry codes, World Scientific, 2008, pp. 419-444.

[18] G. G. LA GUARDIA, *On the construction of nonbinary quantum BCH codes*, IEEE Transactions on Information Theory, 60 (2014), pp. 1528-1535.

[19] G. NEBE, E. M. RAINS, AND N. J. A. SLOANE, *Self-dual codes and invariant theory*, vol. 17, Springer, 2006.

[20] M. A. NIELSEN AND I. L. CHUANG, *Quantum computation and quantum information*, Cambridge University Press, Cambridge, 2000.

[21] R. PELLIKAAN, X.-W. WU, S. BULYGIN, AND R. JURRIUS, *Codes, cryptology and curves with computer algebra*, Cambridge University Press, Cambridge, 2018.

[22] N. RENGASWAMY, R. CALDERBANK, M. NEWMAN, AND H. D. PFISTER, *Classical coding problem from transversal T-gates*, in 2020 IEEE International Symposium on Information Theory (ISIT), IEEE, 2020, pp. 1891-1896.

[23] ——, *On optimality of CSS codes for transversal T*, IEEE Journal on Selected Areas in Information Theory, 1 (2020), pp. 499-514.
[24] J. ROFFE, *Quantum error correction: an introductory guide*, Contemporary Physics, 60 (2019), pp. 226-245.

[25] P. K. SARVEPALLI AND A. KLAPPENECKER, *Nonbinary quantum Reed-Muller codes*, in Proceedings. International Symposium on Information Theory, 2005. ISIT 2005., IEEE, 2005, pp. 1023-1027.

[26] W. SCHERER, *Mathematics of quantum computing*, Springer, 2019.

[27] A. STEANE, *Multiple-particle interference and quantum error correction*, Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 452 (1996), pp. 2551-2577.

[28] A. M. STEANE, *Efficient fault-tolerant quantum computing*, Nature, 399 (1999), pp. 124-126.

[29] ——, *Enlargement of Calderbank-Shor-Steane quantum codes*, IEEE Transactions on Information Theory, 45 (1999), pp. 2492-2495.

[30] ——, *Quantum Reed-Muller codes*, IEEE Transactions on Information Theory, 45 (1999), pp. 1701-1703.

[31] S. A. STEPANOV, *Codes on algebraic curves*, Kluwer Academic/Plenum Publishers, New York, 1999.

[32] H. STICHTENOTH, *Algebraic function fields and codes*, vol. 254, Springer Science & Business Media, 2009.

[33] W. G. UNRUH, *Maintaining coherence in quantum computers*, Physical Review A, 51 (1995).

CNRS; IMB, UNIVERSITÉ DE BORDEAUX, 351 COURS DE LA LIBÉRATION, 33405 TALENCE, FRANCE
*Email address: elena.berardini@math.u-bordeaux.fr*

DIPARTIMENTO DI MATEMATICA, DIPARTIMENTO DI ECCELLENZA 2023-2027, UNIVERSITÀ DI GENOVA, VIA DODECANESO 35, 16146, GENOVA, ITALY
*Email address: alessio.caminata@unige.it*

EINDHOVEN UNIVERSITY OF TECHNOLOGY, THE NETHERLANDS
*Email address: a.ravagnani@tue.nl*
[24] J. ROFFE, *Quantum error correction: an introductory guide*, Contemporary Physics, 60 (2019), pp. 226-245.

[25] P. K. SARVEPALLI AND A. KLAPPENECKER, *Nonbinary quantum Reed-Muller codes*, in Proceedings. International Symposium on Information Theory, 2005. ISIT 2005., IEEE, 2005, pp. 1023-1027.

[26] W. SCHERER, *Mathematics of quantum computing*, Springer, 2019.

[27] A. STEANE, *Multiple-particle interference and quantum error correction*, Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 452 (1996), pp. 2551-2577.

[28] A. M. STEANE, *Efficient fault-tolerant quantum computing*, Nature, 399 (1999), pp. 124-126.

[29] ——, *Enlargement of Calderbank-Shor-Steane quantum codes*, IEEE Transactions on Information Theory, 45 (1999), pp. 2492-2495.

[30] ——, *Quantum Reed-Muller codes*, IEEE Transactions on Information Theory, 45 (1999), pp. 1701-1703.

[31] S. A. STEPANOV, *Codes on algebraic curves*, Kluwer Academic/Plenum Publishers, New York, 1999.

[32] H. STICHTENOTH, *Algebraic function fields and codes*, vol. 254, Springer Science & Business Media, 2009.

[33] W. G. UNRUH, *Maintaining coherence in quantum computers*, Physical Review A, 51 (1995).

CNRS; IMB, UNIVERSITÉ DE BORDEAUX, 351 COURS DE LA LIBÉRATION, 33405 TALENCE, FRANCE
*Email address: elena.berardini@math.u-bordeaux.fr*

DIPARTIMENTO DI MATEMATICA, DIPARTIMENTO DI ECCELLENZA 2023-2027, UNIVERSITÀ DI GENOVA, VIA DODECANESO 35, 16146, GENOVA, ITALY
*Email address: alessio.caminata@unige.it*

EINDHOVEN UNIVERSITY OF TECHNOLOGY, THE NETHERLANDS
*Email address: a.ravagnani@tue.nl*