# Some bounds on the cardinality of the b-symbol weight spectrum of codes

Hongwei Zhu, Shitao Li, Minjia Shi, Shu-Tao Xia, Patrick Solé

► To cite this version:

Hongwei Zhu, Shitao Li, Minjia Shi, Shu-Tao Xia, Patrick Solé. Some bounds on the cardinality of the b-symbol weight spectrum of codes. Discrete Mathematics, In press, 10.1016/j.disc.2025.114678. hal-05146896

HAL Id: hal-05146896

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

Submitted on 7 Jul 2025

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
# Some bounds on the cardinality of the *b*-symbol weight spectrum of codes

Hongwei Zhu*

Shitao Li†

Minjia Shi‡

Shu-Tao Xia§

Patrick Solé¶

## Abstract

The size of the Hamming distance spectrum of a code has received great attention in recent research. The main objective of this paper is to extend these significant theories to the *b*-symbol distance spectrum. We examine this question for various types of codes, including unrestricted codes, additive codes, linear codes, and cyclic codes, successively. For the first three cases, we determine the maximum size of the *b*-symbol distance spectra of these codes smoothly. For the case of cyclic codes, we introduce three approaches to characterize the upper bound for the cardinality of the *b*-symbol weight spectrum of cyclic codes, namely the period distribution approach, the primitive idempotent approach, and the *b*-symbol weight formula approach. As two by-products of this paper, the maximum number of symplectic weights of linear codes is determined, and a basic inequality among the parameters $[n, k, d_H(C)]_q$ of cyclic codes is provided.

**Keywords:** *b*-symbol distance spectrum, period distribution, primitive idempotent, *b*-symbol weight formula

**MSC(2010):** 94 B15, 94 B25, 05 E30

## 1 Introduction

One of the most important topics in coding theory is to characterize the parameters of codes with a given structure. The parameters of a code include its length, size, minimum

<footnote>*Hongwei Zhu is with the Tsinghua Shenzhen International Graduate School, Tsinghua University, Shenzhen 518055, China. E-mail: zhwgood66@163.com, hongweizhu@sz.tsinghua.edu.cn.</footnote>

<footnote>†Shitao Li is with the School of Mathematical Sciences, Anhui University, Hefei 230601, China. E-mail: lishitao0216@163.com.</footnote>

<footnote>‡Minjia Shi is with the Key Laboratory of Intelligent Computing and Signal Processing, Ministry of Education, School of Mathematical Sciences, Anhui University, Hefei 230601, China, and also with the State Key Laboratory of Information Security, Institute of Information Engineering, Chinese Academy of Sciences, Beijing 100093, China. E-mail: smjwcl.good@163.com.</footnote>

<footnote>§Shu-Tao Xia is with the Tsinghua Shenzhen International Graduate School, Tsinghua University, Shenzhen 518055, China. E-mail: xiast@sz.tsinghua.edu.cn.</footnote>

<footnote>¶Patrick Solé is with the Centrale Marseille, CNRS, I2M, Aix Marseille University, Marseille 13009, France, E-mail: sole@enst.fr.</footnote>
distance, cover radius, and so on. In 1973, Delsarte [16] introduced four fundamental parameters of an unrestricted code C: minimum distance $d(C)$, the number $s(C)$ of distinct distances of C, $d(C')$, and $s(C')$, where $C'$ is the MacWilliams transform of C. In the linear case, these four fundamental parameters are reduced to the minimum weight and the weight spectrum of the given code and of its dual code. Delsarte [16] pointed out the combinatorial significance of these four fundamental parameters and showed that they have close connection with orthogonal arrays and combinatorial designs. He also showed that $s(C)$ is intimately related to other parameters of the given C. For instance, it can estimate the size M of a code C as follows:

$$q^n / \sum_{j=0}^{s'(C)} \binom{n}{j} (q-1)^j \le M \le \sum_{j=0}^{s(C)} \binom{n}{j} (q-1)^j, \quad (1)$$

where n denotes the length of C and q denotes the size of the alphabet. It was also shown in the same paper [16] that the covering radius of C is less than or equal to $s(C')$.

Based on these properties, it is always an interesting topic to study the four fundamental parameters of a code. Since the beginning of coding theory, most scholars tended to focus on the minimum distance of a code, but often ignored the other two parameters due to their difficulty. Recently, there has been an increasing interest in these two parameters of codes. Ezerman et al. [23] determined the weight spectrum of linear maximum distance separable (MDS) codes with parameters given by the MDS conjecture. Alderson [1] developed this result to general MDS codes including non-linear MDS codes. However, it is very hard to determine the exact value of $s(C)$ for a general code C. A simpler objective is to give some bounds on the exact value of $s(C)$. For this topic, Shi et al. [39] showed the maximum value of $s(C)$ is $\frac{M(M-1)}{2}$ when C is an unrestricted code with size M. For a linear $[n, k]_q$ code C, the authors in the same paper [39] provided an upper bound on $s(C)$, namely $s(C) \le \frac{q^{k-1}}{q-1}$, and showed that this bound is achievable for $q = 2$ or $k = 2$. They also conjectured that this bound is achievable for general linear codes. Subsequently, this conjecture was proven in [3] by two different methods. The work of [3] and [39] also raises a derivative problem, which is the existence of maximum weight spectrum codes [2].

If the linear code C is given some interesting structures, how will the size of the weight spectrum of C change? For this problem, Shi et al. [40,41] obtained some lower and upper bounds on the size of the weight spectrum of cyclic codes and quasi-cyclic codes. Chen and Zhang [15] proposed a tight upper bound on the size of the weight spectrum of cyclic codes by utilizing the automorphism group of cyclic codes. Chen et al. [12] further refined the results of [15] by using a larger automorphism group of cyclic codes than the group used in [15]. Very recently, the methods in [12, 15] respectively extended to quasi-cyclic codes [33] and constacyclic codes [52]. Luo et al. [37] established two sharp upper bounds on the size of the weight spectrum of a linear code with prescribed automorphism. Note that the aforementioned works are all conducted under the Hamming metric. Chen et al. in [12] mentioned the following open problem:

**Problem 1.** It would be interesting to find tight upper bounds on the number of symbol-pair weights of cyclic codes.
SOME BOUNDS ON THE CARDINALITY OF THE *b*-SYMBOL WEIGHT SPECTRUM OF CODES

The main objective of this paper is to solve aforementioned problem, but we are no
longer limited to symbol-pair weight and cyclic codes. Instead, we replace them with
$b$-symbol weight and general codes respectively. It is not difficult to imagine that this will
be more difficult but also more interesting.

The *b*-symbol metric is a generalization of the Hamming metric, introduced by Cassuto and Blaum [8, 9] and motivated by certain types of computer memories. Despite being proposed only a decade ago, extensive research has been conducted on the *b*-symbol metric. For instance, bounds on parameters of codes [8–10, 14, 22], algebraic constructions [10], asymptotic performance [10], the *b*-symbol weight distributions of cyclic codes [42, 45, 53], and decoding [50, 51] have all been explored under the *b*-symbol metric. Notably, recent works on *b*-symbol MDS codes [11, 18, 19, 31] have demonstrated the advantages of the *b*-symbol metric over the Hamming metric, especially in encoding information with low redundancy. Additionally, Shi *et al.* [43] investigated the connections between the *b*-symbol metric and the *r*-th generalized Hamming metric. Liu and Pan studied the generalized *b*-symbol weight in [35, 36], which can be viewed as a fusion of the *r*-th generalized Hamming weight and *b*-symbol weight.

In this paper, we explore the size of the *b*-symbol weight spectra of unrestricted codes, additive codes, linear codes, and cyclic codes in sequence. For the first three cases, we determine the maximum size of the *b*-symbol distance spectra of these codes smoothly. When the research object is cyclic codes, some upper bounds on the *b*-symbol weight spectrum of cyclic codes are provided by using nice algebraic structures of cyclic codes and unifying the two approaches presented in [15, 41]. We also demonstrate that the approaches [15, 41] are equally effective for studying the *b*-symbol weight spectrum of cyclic codes. Additionally, we propose a third approach for investigating the *b*-symbol weight spectrum of cyclic codes, which involves analyzing the *b*-symbol weight of cyclic codewords. Through a performance analysis of the three approaches, we have found that the upper bounds provided by the first and second approaches are equivalent, while those given by the third approach are more accurate but have limited applicability. As two by-products of this paper, we answer how many symplectic weights can a linear code have at most (Corollary 13), and provide a fundamental lower bound on the minimum Hamming distance of cyclic codes (Theorem 20). To the best of our knowledge, this lower bound has not been previously established. Although this lower bound is straightforward to derive, it holds significant importance. Previous studies on the minimum Hamming distance of cyclic codes have primarily relied on their defining sets, whereas the lower bound given by Theorem 20 is independent of defining sets.

The remainder of the paper is organized as follows: In Section II, we introduce the research strategy of this paper along with some notation and definitions. Section III delves into the study of the *b*-symbol weight spectrum of unrestricted codes. Section IV addresses the case of additive codes. We also examine the size of the symplectic weight spectrum of linear codes in Section IV, as the symplectic metric is closely related to additive codes. Section V focuses on exploring the *b*-symbol weight spectrum of linear codes. In Section VI, we further delve into the *b*-symbol weight spectrum of cyclic codes. Finally, Section VII concludes the paper. We have included some technical but significant results in the appendix to illustrate the advantages of the period distribution approach.
# 2 Preliminaries

Our research strategy unfolds as follows: We initially explore codes with the weakest constraints, followed by codes with more constraints. In other words, we present the bounds on the cardinality of the *b*-symbol weight spectrum in the sequence of unrestricted codes, additive codes, linear codes, and cyclic codes. Their hierarchical relationship is depicted in Figure 1. Among these, we are particularly interested in the *b*-symbol weight spectrum of cyclic codes. It's important to note that the cyclic codes discussed in this paper are all linear codes.

<figure><img src="image_2.png" /><figcaption>Figure 1: The Venn diagram of these codes</figcaption></figure>

## 2.1 Some notation fixed throughout this paper

We begin by introducing some notation and definitions:

* For any finite set $A$, $|A|$ denotes the cardinality of $A$, and $A^*$ represents $A$ without the element 0.

* Let $m$ and $s$ be positive integers, and $p$ be a prime. We define $q := p^s$ and $Q := q^m$.

* $\mathbb{Z}_n = \{0, 1, 2, \dots, n-1\}$ denotes the ring of integers modulo $n$.

* $\mathbb{F}_q$ denotes the finite field with $q$ elements, and $\mathbb{F}_q^n$ represents the vector space of all $n$-tuples over the finite field $\mathbb{F}_q$.

* $[i]$ denotes the set $\{1, 2, \dots, i\}$.

* $C$, $\mathfrak{C}$, and $\mathcal{C}$ denote the unrestricted code, the additive code, and the linear code, respectively.

* $\alpha$ denotes a primitive element of $\mathbb{F}_q$.

* $M_a(x)$ denotes the minimal polynomial of $a \in \mathbb{F}_q$ over $\mathbb{F}_q$.

* $\text{Tr}_{Q/q}$ denotes the relative trace function from $\mathbb{F}_q$ to $\mathbb{F}_q$.

* $C_i$ denotes the $q$-cyclotomic coset modulo $n$ containing $i$.
* Γ is the set of all coset leaders of the q-cyclotomic cosets modulo n.

* Let $\bar{a}$ denote a sequence.

* Let Aut($\mathcal{C}$) denote the automorphism group of $\mathcal{C}$.

* $\mu(\cdot)$ denotes the Möbius function.

* $\phi(\cdot)$ denotes Euler's totient function.

## 2.2 The Hamming metric and the b-symbol metric

The research objects in this paper fall into four categories:

* Unrestricted code with parameters $(n, M)_q$: An unrestricted code $C$ of length $n$ over $\mathbb{F}_q$ is a subset of $\mathbb{F}_q^n$, where $M = |C|$.

* Additive code with parameters $(n, q^{k_0})_{q^t}$: An additive code $\mathcal{C}$ of length $n$ over $\mathbb{F}_{q^t}$ is a subset of $\mathbb{F}_{q^t}^n$ closed under $\mathbb{F}_q$-linear vector addition, where $q^{k_0} = |\mathcal{C}|$ and $0 \le k_0 \le tn$. So $\mathcal{C}$ is an $\mathbb{F}_q$-linear subgroup of $\mathbb{F}_{q^t}^n$.

* Linear code with parameters $[n, k]_q$: A linear code $\mathcal{C}$ of length $n$ over $\mathbb{F}_q$ is a $k$-dimensional vector subspace of $\mathbb{F}_q^n$.

* Cyclic code with parameters $[n, k]_q$: Cyclic codes are a very important subclass of linear codes, and their specific definition and algebraic properties will be introduced in detail in Section 6.

The Hamming weight $w_H(\mathbf{x})$ of a vector $\mathbf{x}$ is defined as the number of non-zero coordinates in $\mathbf{x}$. The Hamming distance $d_H(\mathbf{x}, \mathbf{y})$ between two vectors $\mathbf{x}$ and $\mathbf{y}$ is defined as the number of coordinates in which $\mathbf{x}$ and $\mathbf{y}$ differ. For a code $C$, we define the Hamming distance spectrum and the Hamming weight spectrum of $C$ as $\mathbf{D}_H(C) = \{d_H(\mathbf{c}, \mathbf{c}') | \mathbf{c}, \mathbf{c}' \in C \text{ and } \mathbf{c} \neq \mathbf{c}'\}$ and $\mathbf{W}_H(C) = \{w_H(\mathbf{c}) | \mathbf{c} \in C \setminus \{\mathbf{0}\}\}$, respectively.

The b-symbol metric is a generalization of the Hamming metric. Its definition is as follows: Let $b$ be a positive integer with $1 \le b \le n$. The b-symbol weight $w_b(\mathbf{x})$ is the Hamming weight of $\pi_b(\mathbf{x})$, where $\pi_b(\mathbf{x}) \in (\mathbb{F}_q^b)^n$ and

$$ \pi_b(\mathbf{x}) = ((x_0, \dots, x_{b-1}), (x_1, \dots, x_b), \dots, (x_{n-1}, \dots, x_{b+n-2(\text{mod } n)})) $$

The b-symbol distance $d_b(\mathbf{x}, \mathbf{y})$ is the Hamming weight of $\pi_b(\mathbf{x}-\mathbf{y})$. When $b=1$, $w_1(\mathbf{x}) = w_H(\mathbf{x})$ and $d_1(\mathbf{x}, \mathbf{y}) = d_H(\mathbf{x}, \mathbf{y})$. Similarly, we define the b-symbol distance spectrum and the b-symbol weight spectrum of a code $C$ as $\mathbf{D}_b(C) = \{d_b(\mathbf{c}, \mathbf{c}') | \mathbf{c}, \mathbf{c}' \in C \text{ and } \mathbf{c} \neq \mathbf{c}'\}$ and $\mathbf{W}_b(C) = \{w_b(\mathbf{c}) | \mathbf{c} \in C \setminus \{\mathbf{0}\}\}$, respectively.

## 2.3 Group action and automorphism group

Assume that a finite group acts on a finite set $A$. For each $a \in A$, $Ga = \{ga | g \in G\}$ is called an orbit of this group action containing $a$ ($G$-orbit for short). The set of all orbits of $G$ on $A$ is denoted as $G\backslash A = \{Ga | a \in A\}$. A monomial matrix is a square matrix with exactly one nonzero entry in each row and column. A monomial matrix $M$ can be written either in the form $DP$ or $PD$, where $P$ is a permutation matrix and $D$ is an invertible
diagonal matrix. The automorphism group Aut($\mathcal{C}$) of a $q$-ary linear code $\mathcal{C}$ of length $n$ is the set consisting of all $n \times n$ monomial matrices $A$ over $\mathbb{F}_q$ such that $\mathcal{C}A = \mathcal{C}$.

Let $G$ be a subgroup of Aut($\mathcal{C}$). It can be observed that the number of orbits belonging to Aut($\mathcal{C}$) on $\mathcal{C}^*$ is not greater than the number of orbits belonging to $G$ on $\mathcal{C}^*$.

Set $\tau$ and $\sigma_a$ be two $\mathbb{F}_q$-linear maps on $\frac{\mathbb{F}_q[x]}{(x^n-1)}$, respectively:

$$ \tau: \frac{\mathbb{F}_q[x]}{(x^n-1)} \to \frac{\mathbb{F}_q[x]}{(x^n-1)} \\ \sum_{i=0}^{n-1} a_i x^i \mapsto \tau \left( \sum_{i=0}^{n-1} a_i x^i \right) = \sum_{i=0}^{n-1} a_i x^{i+1} (\text{mod } x^n - 1), $$

$$ \sigma_a: \frac{\mathbb{F}_q[x]}{(x^n-1)} \to \frac{\mathbb{F}_q[x]}{(x^n-1)} \\ \sum_{i=0}^{n-1} a_i x^i \mapsto \sigma_a \left( \sum_{i=0}^{n-1} a_i x^i \right) = \sum_{i=0}^{n-1} a_i a_i x^i (\text{mod } x^n - 1). $$

It is not difficult to check that for any cyclic code $\mathcal{C}$, the group $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$ is a subgroup of Aut($\mathcal{C}$).

## 2.4 Some basics about periodic sequences

We introduce the definition of runs in sequences in the following. For $\lambda \in \mathbb{F}_q$ and $\eta, \xi \in \mathbb{F}_q \setminus \{\lambda\}$, if $\eta, \underbrace{\lambda, \dots, \lambda}_{m}, \xi$ appears in the sequence $\bar{a}$, then we say that $\underbrace{\lambda, \dots, \lambda}_{m}$ is a run of $\lambda$'s of length $m$. In particular, we set $\mathbf{0}_i = (\alpha, \underbrace{0, \dots, 0}_{i}, \beta)$, where $\alpha, \beta \in \mathbb{F}_q^*$ since it plays a key role in computing the $b$-symbol weight of a vector later on. We generalize the definition of runs in sequences to the definition of runs in vectors. For any vector $\mathbf{a} = (a_0, a_1, \dots, a_{n-1}) \in \mathbb{F}_q^n$, we define a circumferential vector $\text{cir}(\mathbf{a})$ as follows:

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

In fact, $\text{cir}(\mathbf{a})$ can be regarded as a periodic sequence with a period of $n$, so we can call $(a, \dots, a)$ in $\text{cir}(\mathbf{a})$ that appears $m$ consecutive times as a run of $a$ in the vector with length $m$. Let $\Psi(\mathbf{a}, \mathbf{0}_i)$ denote the number of occurrences of $\mathbf{0}_i$ on the circumferential vector $\text{cir}(\mathbf{a})$.

**Definition 2.** The $\mathbf{0}$'s run distribution of $\mathbf{a}$ is defined by $\{\Psi(\mathbf{a}, \mathbf{0}_1), \Psi(\mathbf{a}, \mathbf{0}_2), \dots, \Psi(\mathbf{a}, \mathbf{0}_n)\}$.
For any vector $\mathbf{a} = (a_0, a_1, \dots, a_{n-1}) \in \mathbb{F}_q^n$, by the definition of b-symbol weight, then $w_b(\mathbf{a}) = n - |\{i| a_i = a_{i+1} = \dots = a_{i+b-1} = 0, 0 \le i \le n-1\}|$. If the 0's run distribution of $\mathbf{a}$ is given, we have the following formula to calculate the b-symbol weight of $\mathbf{a}$.

**Lemma 3.** [43] For any vector $\mathbf{a} = (a_0, a_1, \dots, a_{n-1}) \in \mathbb{F}_q^n$, we have

$$w_b(\mathbf{a}) = n - \sum_{i=b}^{n-1} (i - b + 1) \cdot \Psi(\mathbf{a}, \mathbf{0}_i). \qquad (2)$$

**Example 4.** Let $\mathbf{a} = (01001000100)$. Then the 0's run distribution of $\mathbf{a}$ is $\{\Psi(\mathbf{a}, \mathbf{0}_2) = 1, \Psi(\mathbf{a}, \mathbf{0}_3) = 2, \Psi(\mathbf{a}, \mathbf{0}_i) = 0, i \neq 2, 3\}$. The b-symbol weight of $\mathbf{a}$ is

$$w_b(\mathbf{a}) = \begin{cases} 11 - (2 + 3) = 3, & b = 1; \\ 11 - (1 + 2) = 6, & b = 2; \\ 11 - (1) = 9, & b = 3; \\ 11, & b = 4. \end{cases}$$

Assume that $\mathbf{c}$ is a codeword of $C$. Let $\vartheta(\mathbf{c})$ be the maximum 0's run length of $\mathbf{c}$ and $\theta = \max\{\vartheta(\mathbf{c})|\mathbf{c} \in C\setminus\{\mathbf{0}\}\}$. The parameter $\theta$ is called the maximum 0's run length of $C$. A partition of $C\setminus\{\mathbf{0}\}$ associated with $\theta$ can be expressed as follows: $C\setminus\{\mathbf{0}\} = \bigsqcup_{i=0}^{\theta} C(i)$, where $C(i) = \{\mathbf{c}|\mathbf{c} \in C\setminus\{\mathbf{0}\} \text{ and } \vartheta(\mathbf{c}) = i\}$ and $\bigsqcup$ is a disjoint union.

## 3 Unrestricted codes

In this section, our focus is on determining the maximum number of b-symbol distances that an unrestricted code can have. Let $\Sigma$ be a finite alphabet. We will begin by establishing a fundamental bound for $|\mathbf{D}_b(C)|$.

**Proposition 5.** Let $C$ be an unrestricted code with parameters $(n, M)$ over $\Sigma$. Then

$$M \le \sum_{j=0}^{|\mathbf{D}_b(C)|} \binom{n}{j} (|\Sigma|^b - 1)^j. \qquad (3)$$

*Proof.* Following the approach of the proof in [16] for Inequality (1), we can readily derive the desired result. It's important to highlight that at this juncture, the distance between any two codewords of $C$ is considered to be the b-symbol distance rather than the Hamming distance. $\square$

Let $G_1$ be the set consisting of all unrestricted codes with size $M$ over $\Sigma$. We define $N(M, b)$ and $N(n, M, b)$ as follows:

* $N(M, b) := \max\{|\mathbf{D}_b(C)| | C \in G_1\}$.

* $N(n, M, b) := \max\{|\mathbf{D}_b(C)| | C \in G_1 \text{ of length } n\}$.

Note that we focus on $N(M, b)$ and $N(n, M, b)$ instead of $N(M, |\Sigma|, b)$ and $N(n, M, |\Sigma|, b)$ because the alphabet size $\Sigma$ does not affect these combinatorial functions.
**Theorem 6.** For all integers $M \ge 2$, we have

$$N(M, b) = \binom{M}{2}.$$

*Proof.* We just need to construct an unrestricted code $C$ with $|\mathbf{D}_b(C)| = \binom{M}{2}$ because $|\mathbf{D}_b(C)| \le \binom{M}{2}$ is obvious. According to [39, Theorem 6], there exists an unrestricted code $C$ with $|\mathbf{D}_1(C)| = \binom{M}{2}$. Let $C' = \{f(\mathbf{c})|\mathbf{c} = (c_0, c_1, \dots, c_{n-1}) \in C\}$, where

$$f(\mathbf{c}) = (c_0, \underbrace{0, \dots, 0}_{b-1}, c_1, \underbrace{0, \dots, 0}_{b-1}, \dots, c_{n-1}, \underbrace{0, \dots, 0}_{b-1}).$$

Assume that $\mathbf{D}_1(C) = \{d_{i,j}|1 \le i < j \le M\}$. Then we have $\mathbf{D}_b(C') = \{b \cdot d_{i,j}|1 \le i < j \le M\}$. The size of $\mathbf{D}_b(C')$ equals $\binom{M}{2}$ since $b \cdot d_{i_1,j_1} \ne b \cdot d_{i_2,j_2}$ with $(i_1, j_1) \ne (i_2, j_2)$. Therefore, we obtain the desired result. $\square$

If there are no constraints on the length $n$, we can append consecutive zeros to ensure that the $b$-symbol distance between any two codewords in $C$ is distinct. To facilitate the proof of the subsequent results, we introduce the definition of difference sets with Singer parameters and Golomb ruler below [4, 17].

**Definition 7.** A difference set in an abelian group $A$ is said to have Singer parameters if their parameters are of the form $(\frac{l^{m-1}}{l-1}, \frac{l^{m-1}-1}{l-1}, \frac{l^{m-2}-1}{l-1})$ or $(\frac{l^{m-1}}{l-1}, l^{m-1}, l^{m-2}(l-1))$, where $m$ and $l$ are positive integers.

The first class of difference sets with Singer parameters were discovered by Singer in 1938, and are described in the following theorem.

**Theorem 8.** [44] Let $m \ge 3$ be a positive integer. Let $\alpha$ be a generator of $\mathbb{F}_q^*$. Put $n = \frac{Q-1}{q-1}$. Define $D = \{0 \le i \le n|\mathrm{Tr}_{Q/q}(\alpha^i) = 0\} \subset \mathbb{Z}_n$. Then $D$ is a difference set in $(\mathbb{Z}_n, +)$ with parameters $(\frac{Q-1}{q-1}, \frac{q^{m-1}-1}{q-1}, \frac{q^{m-2}-1}{q-1})$.

With the help of Theorem 8, we can obtain the following result.

**Theorem 9.** For all positive integers $M$, $b$ and all nonnegative integers $m$, we have $N(M, b) = N(n_0(M, b)+m, M, b)$ where $n_0(M, b)$ is a function about $M$ and $b$. Moreover, $n_0(M, b) \le 2b\binom{M}{2} + b$ if $M-1$ is a prime power.

*Proof.* The first claim is obvious. Assume that $M = q+1$, where $q$ is a prime power. By Theorem 8, there exists a Singer difference set $S = \{a_1, a_2, \dots, a_{q+1}\}$ with parameters $(q^2+q+1, q+1, 1)$. Let $C = \{\mathbf{c}_i|1 \le i \le q+1\}$, where

$$\mathbf{c}_i = (\underbrace{1 \underbrace{00\cdots0}_{b-1}}_{a_i}, \underbrace{1 \underbrace{00\cdots0}_{b-1}}_{a_i}, \dots, \underbrace{1 \underbrace{00\cdots0}_{b-1}}_{a_i}, \underbrace{00\cdots0}_{b \cdot (q^2+q+1)-b \cdot a_i}) \text{ with } 1 \le i \le q+1.$$

According to the definition of $b$-symbol distance, we obtain the $b$-symbol distance spectrum $\mathbf{D}_b(C) = \{b \cdot |a_i - a_j||1 \le i \ne j \le q+1\}$ and $|\mathbf{D}_b(C)| = \binom{q+1}{2}$. Therefore, $b(q^2+q+1) = 2b\binom{q+1}{2} + b$ is an upper bound for $n_0(q+1, b)$. $\square$
Indeed, $n_0(M, b)$ represents the minimum length $n$ for which $N(n, M, b) = N(M, b)$. The value of $N(M, b)$ exhibits an intriguing connection with another significant combinatorial concept, known as the Golomb ruler.

**Definition 10.** A Golomb ruler $GR(M, v)$ is a set of $M$ integers

$$ \{a_1, a_2, \dots, a_M\} \subseteq \{0, 1, \dots, v\} $$

whose pairwise differences in absolute value take $\binom{M}{2}$ distinct values exactly once. By convention, we assume that the sequence $i \mapsto a_i$ is increasing and $a_1 = 0, a_M = v$.

The function $G(M)$, denoting the length of an optimal Golomb ruler, represents the smallest possible length of a ruler with $M$ marks. As a consequence, we can establish an upper bound for $n_0(M, b)$.

**Proposition 11.** Let notations be as above. Then $n_0(M, b) \le b \cdot G(M)$.

*Proof.* The inequality $n_0(M, 1) \le G(M)$ follows directly from the definition of $G(M)$. By mimicking the proof of Theorem 9, we obtain the desired result. $\square$

# 4 Additive codes

In this section, we investigate the number of $b$-symbol distances that an additive code with parameters $(n, q^{k_0})q^t$ can have. Let $G_2$ denote the set comprising all additive codes with size $|\mathcal{C}| = q^{k_0}$ over $\mathbb{F}q^t$. We define $A(q^{k_0}, q^t, b)$ as follows:

$$ A(q^{k_0}, q^t, b) := \max \{ |\mathbf{D}_b(\mathcal{C})| | \mathcal{C} \in G_2 \}. $$

**Theorem 12.** Let $\mathcal{C}$ be an additive code with parameters $(n, q^{k_0})_{q^t}$, then we have $A(q^{k_0}, q^t, b) = \frac{q^{k_0-1}}{q-1}$.

*Proof.* Since $\mathcal{C}$ is an $\mathbb{F}_q$-linear code, by mimicking the construction of [3], we obtain $A(q^{k_0}, q^t, 1) = \frac{q^{k_0-1}}{q-1}$. For $a \in \mathbb{F}_q^*$ and $\mathbf{c} = (c_0, c_1, \dots, c_{n-1}) \in \mathcal{C}$, one has $w_b(\mathbf{c}) = w_b(a \cdot \mathbf{c})$ since $\mathbf{c}$ and $a \cdot \mathbf{c}$ have the same $0$'s run distribution. Then

$$ A(q^{k_0}, q^t, b) \le \frac{q^{k_0} - 1}{q-1} = A(q^{k_0}, q^t, 1). $$

Let $\mathcal{C}$ be an additive code such that $\mathcal{C}$ has $\frac{q^{k_0-1}}{q-1}$ nonzero Hamming weights. For any $\mathbf{c} = (c_0, c_1, \dots, c_{n-1}) \in \mathcal{C}$, define

$$ f(\mathbf{c}) = (c_0, \underbrace{00\cdots0}_{b-1}, c_1, \underbrace{00\cdots0}_{b-1}, \dots, \underbrace{00\cdots0}_{b-1}, c_{n-1}, \underbrace{00\cdots0}_{b-1}). $$

Let $\mathcal{C}' = \{f(\mathbf{c}) | \mathbf{c} \in \mathcal{C}\}$. It is easy to verify that $\mathcal{C}'$ is an additive code over $\mathbb{F}_q$ with $\frac{q^{k_0-1}}{q-1}$ nonzero $b$-symbol weights. This implies that $A(q^{k_0}, q^t, b) \ge \frac{q^{k_0-1}}{q-1}$. The result holds. $\square$
Given the numerous similarities between additive codes and linear codes, we will focus our detailed study on linear codes. Indeed, examining the b-symbol weight of a linear code is equivalent to analyzing the Hamming weight of an additive code, for the following reasons. Set **a** := (a₁, a₂, ..., aₙ). Let **φ** be a map from (Fqᵇ)ⁿ to (Fqᵇ)ⁿ as follows.

$$ \phi : (\mathbb{F}_q^b)^n \longrightarrow (\mathbb{F}_{q^b})^n \\ \pi_b(\mathbf{a}) \longmapsto \phi(\pi_b(\mathbf{a})) = \left( \sum_{i=1}^{b-1} \omega^{b-1} a_i, \sum_{i=1}^{b-1} \omega^{b-1} a_{i+1}, \dots, \sum_{i=1}^{b-1} \omega^{b-1} a_{b+i} \right), \quad (4) $$

where the indices are taken modulo *n*, and *ω* is a primitive element of Fqᵇ. Therefore, the b-symbol weight spectrum of a linear code *C* with parameters [*n*, *k*]q is equivalent to the Hamming weight spectrum of the additive code *φ*(*C*) with parameters (*n*, *q*^k)qᵇ, where *φ*(*C*) is an Fq-linear subgroup of Fqⁿ. As a by-product, Theorem 12 reveals the maximum number of symplectic weights that a linear code can have. Before that, we introduce the definition of symplectic metric as follows: For any vector **x** = (*x*₁, *x*₂, ..., *x*₂ₙ) and **y** = (*y*₁, *y*₂, ..., *y*₂ₙ) ∈ Fq²ⁿ, the symplectic weight of **x** is defined by *w*<sub>sym</sub>(*x*) = |{*i*|(*x*<sub>*i*</sub>, *x*<sub>*i*+*i*</sub>)} ≠ {0, 0}, 1 ≤ *i* ≤ *n*}|. The minimum symplectic distance of a linear code *C* is *d*<sub>sym</sub>(*C*) = min{*w*<sub>sym</sub>(*x* − **y**)|**x**, **y** ∈ *C* and **x** ≠ **y***}. The symplectic metric has garnered significant attention from scholars due to its close relationship with the construction of quantum codes [7, 32].

**Corollary 13.** Let L<sup>sym</sup>(*k*, *q*) be the maximum number of nonzero symplectic weights a linear code of dimension *k* over Fq may have. Then L<sup>sym</sup>(*k*, *q*) = q<sup>*k*−1</sup>⁄q<sup>*k*−1</sup>.

*Proof.* Let $\phi'$ be a map from $\mathbb{F}_q^{2n}$ to $\mathbb{F}_{q^2}^n$ as follows.

$$ \phi' : \mathbb{F}_q^{2n} \longrightarrow \mathbb{F}_{q^2}^n \\ (x_1, x_2, \dots, x_{2n}) \longmapsto (x_1 + w'x_{n+1}, \dots, x_n + w'x_{2n}), \quad (5) $$

where ⟨w'⟩ = Fq*<sup>2</sup>*. Therefore, the symplectic weight spectrum of a linear code with parameters [*2n*, *k*]q is the same as the Hamming weight spectrum of an additive code with parameters (*n*, *q*^k)q<sup>2</sup>. From Theorem 12, we have L<sup>sym</sup>(*k*, *q*) = A(*q*<sup>*k*</sup>, *q*<sup>2</sup>, 1) = q<sup>*k*−1</sup>⁄q<sup>*k*−1</sup>. This completes the proof. □

# 5 Linear codes

The b-symbol distance spectrum D<sub>b</sub>(*C*) and the b-symbol weight spectrum W<sub>b</sub>(*C*) coincide when *C* is linear. In this section, we investigate the inquiry regarding the maximum number of nonzero b-symbol weights a linear code can possess. Let *L*(*k*, *q*, *b*) denote the maximum number of nonzero b-symbol weights that a code of dimension *k* over Fq may possess. An [*n*, *k*]q code *C* is called a maximum b-symbol weight spectrum code (MbSW code) if *C* has *L*(*k*, *q*, *b*) nonzero b-symbol weights. The subsequent result demonstrates that *L*(*k*, *q*, *b*) remains independent of *b* when there is no restriction on the length *n* of *C*.
**Theorem 14.** For all prime powers $q$, and all integers $k \ge 1$, we have $L(k, q, b) = \frac{q^{k-1}}{q-1}$.

*Proof.* Since all nonzero multiples of a given codeword share the same distribution of **0**'s run, we have $L(k, q, b) \le \frac{q^{k-1}}{q-1}$. By emulating the proof of Theorem 12, linear codes can be constructed with precisely $\frac{q^{k-1}}{q-1}$ nonzero $b$-symbol weights. Hence the result holds. $\square$

Let $L(n, k, q, b)$ represent the maximum number of nonzero $b$-symbol weights of a code $\mathcal{C}$ with parameters $[n, k]$ over $\mathbb{F}_q$. From Theorem 14, it's evident that when the length $n$ is added, we obtain $L(n, k, q, b) = L(k, q, b)$. Let $l_0(k, q, b)$ denote the smallest integer such that $L(l_0(k, q, b), k, q, b) = L(k, q, b)$. Then, we have

**Proposition 15.** Let notations be as above. Then $l_0(k, q, b) \ge \lfloor \frac{bq}{2} \cdot \frac{q^{k-1}}{q-1} \rfloor$.

*Proof.* The desired result follows from Theorem 14 and [3, Lemma 5.1]. $\square$

When $n < l_0(k, q, b)$, the function $L(n, k, q, b)$ depends on the maximum **0**'s run $\theta$ of $\mathcal{C}$. A similar combinatorial function $L(n, k, q, b, \theta)$ can be defined as follows: the maximum size of $W_b(\mathcal{C})$, where $\mathcal{C}$ is a linear code with parameters $n, k, q$, and $\theta$.

Recall that $\mathcal{C}(i) = \{\mathbf{c}|\mathbf{c} \in \mathcal{C}^* \text{ and } \vartheta(\mathbf{c}) = i\}$, then we have the following results.

**Lemma 16.** For any positive integers $n, b$ and $m$, we have:

(1) $W_{b+m}(\mathcal{C}(b)) = \{n\}$;

(2) $W_b(\mathcal{C}(b)) \subseteq \{n - \lfloor \frac{n}{b+1} \rfloor, n - \lfloor \frac{n}{b+1} \rfloor + 1, \dots, n - 1\}$;

(3) $W_b(\mathcal{C}(b+m)) \subseteq \{n - (m+1) \cdot \lfloor \frac{n}{b+m+1} \rfloor, n - (m+1) \cdot \lfloor \frac{n}{b+m+1} \rfloor + 1, \dots, n - (m+1)\}$;

(4) $1 \le |W_b(\mathcal{C})| \le n + 1 - b \cdot \lfloor \frac{n}{\theta+1} \rfloor$.

*Proof.* The first statement is trivial and omitted. For any codeword $\mathbf{c} \in \mathcal{C}(b)$, we have $1 \le \Psi(\mathbf{0}_b) \le \lfloor \frac{n}{b+1} \rfloor$. It follows from Lemma 3 that $n - \lfloor \frac{n}{b+1} \rfloor \le w_b(\mathbf{c}) \le n - 1$. Hence, the second claim holds. A similar argument is used in the third statement. The last statement follows from the first three statements. $\square$

When $b > \theta$, $L(n, k, q, b, \theta) = L(n, k, q, b+m_0, \theta) = 1$ for any positive integer $m_0$. Hence we need to focus on the case $b \le \theta$. The subsequent results establish the monotonicity of the function $L(n, k, q, b, \theta)$ with respect to parameters $n, k$, and $q$.

**Theorem 17.** For all positive integers $n, b, k, \theta$, and all prime powers $q$, we have:

(1) $L(n, k, q, b, \theta) \le L(n+1, k, q, b, \theta)$;

(2) $L(n, k, q, b, \theta) \le L(n, k+1, q, b, \theta)$;

(3) $L(n, k, q, b, \theta) \le L(n, k, q^m, b, \theta)$.

(4) $L(n, 1, q, b, \theta) = 1$;

(5) $L(n, n, q, b, n-1) = n - b + 1$;

(6) $L(n, k, q, b, \theta) \le n + 1 - b \cdot \lfloor \frac{n}{\theta+1} \rfloor$.
*Proof.* The first four statements are obvious. If $n = k$, then $C$ has to be a universe code with parameters $[n, n, 1]_q$, and $\theta = n - 1$. By the definition of $b$-symbol metric, we have $L(n, n, q, b, n - 1) = n - b + 1$. The last statement follows from the fourth statement of Lemma 16. □

From the proof of Theorem 17, we observe that the parameter $\theta$ relies on the dimension $k$, the length $n$, and the algebraic structure of $C$. For instance, in the case of cyclic codes, we have $\theta = k - 1$. We will delve into the specifics of cyclic codes in Section 6 and elaborate on why $\theta = k - 1$ when $C$ is cyclic. From the perspective of the automorphism group of linear codes, Chen and Zhang [15] provided an upper bound on the cardinality of the Hamming weight spectrum of linear codes. However, their result may not hold true if the Hamming metric is replaced with the $b$-symbol metric. Under the $b$-symbol metric, more restrictive conditions for the subgroup $G$ are required.

**Proposition 18.** Let $C$ be a linear code of length $n$ over $\mathbb{F}_q$ with $l$ nonzero $b$-symbol weights and let Aut($C$) be the automorphism group of $C$. Assume that $G$ is a subgroup of Aut($C$) such that for any $c \in C$ and $A \in G$, $c$ and $cA$ have the same 0's run distribution. If the number of orbits of $G$ on $C^*$ is equal to $s$, then $l \le s$. Moreover, the equality holds if and only if for any two nonzero codewords $c_1, c_2 \in C$ with the same $b$-symbol weight, there exists an automorphism $A \in G$ such that $c_1A = c_2$.

*Proof.* Since $G$ always preserves the 0's run weight distribution of the codewords in $C$ without alteration, it can be deduced from Lemma 3 that codewords belonging to the same orbit in $C$ possess the same $b$-symbol weight. The proof of the second claim aligns with [15, Proposition II.2], hence we omit it here. □

# 6 Cyclic codes

In this section, we assume that $\gcd(n, q) = 1$ and focus on the bounds of $b$-symbol weight spectrum of cyclic codes. Firstly, we recall some knowledge related to cyclic codes.

**Definition 19.** A $q$-ary linear code $C$ of length $n$ is called cyclic if $C$ remains invariant under the cyclic shift $\tau$, defined as:

$$ \tau(c_0, c_1, \dots, c_{n-1}) = (c_{n-1}, c_0, \dots, c_{n-2}) \in C, $$

where $(c_0, c_1, \dots, c_{n-1}) \in C$.

By associating a vector $(c_0, c_1, \dots, c_{n-1}) \in \mathbb{F}_q^n$ with $\sum_{i=0}^{n-1} c_0 x^i \in \mathbb{F}_q[x] / (x^{n-1})$, a linear code $C$ of length $n$ over $\mathbb{F}_q$ corresponds to a subset of the residue class $\mathbb{F}_q[x] / (x^{n-1})$. The linear code $C$ is cyclic if and only if the corresponding subset in $\mathbb{F}_q[x] / (x^{n-1})$ forms an ideal of the ring $\mathbb{F}_q[x] / (x^{n-1})$. It is well-known that every ideal of $\mathbb{F}_q[x] / (x^{n-1})$ is principal. To distinguish the principal ideal $(f(x))$ of $\mathbb{F}_q[x]$ from that ideal in $\mathbb{F}_q[x] / (x^{n-1})$, we use the notation $\langle f(x) \rangle$ for the principal ideal of $\mathbb{F}_q[x] / (x^{n-1})$ generated by $f(x)$. Let $C = \langle g(x) \rangle$ be a cyclic code, where $g(x)$ is monic and has
the least degree. Let $h(x) = \frac{x^n-1}{g(x)}$. Then $g(x)$ and $h(x)$ are referred to as the generator polynomial and check polynomial, respectively. The dual code, denoted by $\mathcal{C}^{\perp}$, of $\mathcal{C}$ has generator polynomial $h^{*}(x)$, which is the reciprocal of $h(x)$, normalized to be monic.

When $\mathcal{C}$ is cyclic, every nonzero codeword in $\mathcal{C}$ is generated by a recursion of degree $k$, and therefore, it has at most $k-1$ consecutive zeroes. In other words, $\theta = k-1$ if $\mathcal{C}$ is cyclic. Consequently, we obtain the following fundamental inequalities concerning the three critical parameters $n, k$, and $d_H(\mathcal{C})$ of cyclic codes, which are independent of any information other than the cyclic structure.

**Theorem 20.** Let $\mathcal{C}$ be a cyclic code with parameters $[n, k, d_H(\mathcal{C})]$ over $\mathbb{F}_q$. Then $d_H(\mathcal{C}) \ge \lfloor \frac{n}{k} \rfloor$.

*Proof.* Assume that $n = kt + t_0$, where $t$ and $t_0$ are non-negative integers, and $0 \le t_0 \le k-1$. Since the maximum $0$'s run length $\theta$ of a cyclic code equals $k-1$, for any nonzero codeword $\mathbf{c} \in \mathcal{C}$, $w_H(\mathbf{c})$ at least $t$. The codeword with Hamming weight $t$ is of the form

$$ \mathbf{c} = (\mathbf{0}_{k-1}, a_1, \mathbf{0}_{k-1}, a_2, \dots, \mathbf{0}_{k-1}, a_t, \mathbf{0}_{t_0}). $$

Therefore, we obtain the desired result.

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

*Remark 21.* Reference [27] is a thesis focusing on lower bounds for the minimum Hamming distance of cyclic codes. To our surprise, although the result of Theorem 20 is fundamental, it has not been previously provided to the best of our knowledge. Existing results on lower bounds for the minimum Hamming distance of cyclic codes $\mathcal{C}$ (such as the BCH Bound [5,6,28], Hartmann-Tzeng Bound [26], etc.) are predicated on their defining sets. The lower bound presented in Theorem 20 solely relies on the length $n$ and the dimension $k$. In other words, compared to the BCH bound and Hartmann-Tzeng bound, the lower bound offered by Theorem 20 necessitates less information about the cyclic code $\mathcal{C}$. However, this bound is relatively loose as a trade-off.

The maximum length of $0$'s runs in cyclic codes can also aid in characterizing the magnitude of the $b$-symbol weight spectrum of cyclic codes.

**Theorem 22.** Let $\mathcal{C}$ be a cyclic code with parameters $[n, k]_q$. Then

$$ 1 \le |W_b(\mathcal{C})| \le n + 1 - b \cdot \lfloor \frac{n}{k} \rfloor. $$

*Proof.* Combining Lemma 16 with the fact that the maximum length of $0$'s runs in $\mathcal{C}$ equals $k-1$, we derive the desired result.

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

When $\mathcal{C}$ is cyclic, the maximum length of $0$'s runs, denoted as $\theta$, equals $k-1$. If $b \ge k$, then $W_b(\mathcal{C}) = \{n\}$. Hence, our focus lies on the case where $b < k$. It's important to note that we do not need to consider the parameter $\theta$ again when $\mathcal{C}$ is cyclic. We can define a combinatorial function $\Gamma(n, k, q, b)$ derived from $L(n, k, q, b, \theta)$ as:

* $\Gamma(n, k, q, b)$ : the maximum size of $W_b(\mathcal{C})$, where $\mathcal{C}$ is a cyclic code with parameters $[n, k]_q$.
The following proposition gives some bounds on the function $\Gamma(n, k, q, b)$.

**Proposition 23.** For any positive $n, k, b$, and all prime power $b$, we have the following:

(1) $\Gamma(n, n, q, b) = n - b + 1$;

(2) $\Gamma(n, 1, q, b) = 1$;

(3) $\Gamma(2^{k_0} - 1, k_0, 2, b) = 1$ for any prime $k_0$;

(4) $\Gamma(n, k, q, b) \geq k - b + 1$.

*Proof.* The first two statements are self-evident. If $k_0$ is prime, then the cyclic code with parameters $[2^{k_0} - 1, k_0]_2$ will either be the binary simplex code $S_{k_0}$ or replicated versions of $S_{k'_0}$ for $k_0$ being a proper divisor of $k'_0$. According to Remark 4 in [43], $S_{k_0}$ is a single $b$-symbol weight code. Hence, the third statement holds.

By the monotonicity of $\Gamma(n, k, q, b)$ with respect to $n$, we have

$$ \Gamma(n, k, q, b) \geq \Gamma(k, k, q, b) = k - b + 1. $$

Thus, we complete the proof. $\square$

The subsequent result demonstrates an interesting relationship between $\Gamma(n, k, q, b)$ and $L(k, q)$:

**Theorem 24.** Let $\mathcal{C}$ be a cyclic code with parameters $[n, k]$ over $\mathbb{F}_q$. If $\gcd(n, q - 1) = 1$ and there exists a codeword $\mathbf{c}$ in $\mathcal{C}$ such that $\mathrm{per}(\mathbf{c}) = n$, then

$$ \Gamma(n, k, q, b) \leq L(k, q) + 1 - b \cdot \left\lfloor \frac{L(k, q)}{k} \right\rfloor. $$

*Proof.* Since $\mathrm{per}(\mathbf{c}) = n$, then $|\{\tau^i(\mathbf{c})|0 \leq i \leq n-1\}| = n$. Assume that there exists an element $\beta \in \mathbb{F}_q^* \setminus \{1\}$ and an integer $i$ with $1 \leq i \leq n-1$ such that $\beta \cdot \mathbf{c} = \tau^i(\mathbf{c})$. According to [41, Lemma 1], then $\beta$ belongs to the unique cyclic subgroup of $\mathbb{F}_q^*$ of order $\gcd(\mathrm{per}(\mathbf{c}), q-1) = 1$, contradicting our assumptions that $\beta \in \mathbb{F}_q^* \setminus \{1\}$ and $1 \leq i \leq n-1$. Then we have

$$ |\{\alpha \cdot \tau^i(\mathbf{c})|0 \leq i \leq n-1 \text{ and } \alpha \in \mathbb{F}_q^*\}| = n(q-1). $$

Since the number of nonzero codewords in $\mathcal{C}$ is $q^k - 1$, $n \leq \frac{q^{k-1}}{q-1}$. Using the third statement of Proposition 23 and the fact that $L(k, q) = \frac{q^{k-1}}{q-1}$, we have

$$ \Gamma(n, k, q, b) \leq \Gamma\left(\frac{q^k - 1}{q - 1}, k, q, b\right) \leq L(k, q) + 1 - b \cdot \left\lfloor \frac{L(k, q)}{k} \right\rfloor. $$

This completes the proof. $\square$

To accurately determine the bounds of the $b$-symbol weight spectrum of cyclic codes, it is crucial to have relevant information about cyclic codes in advance. We can derive the bounds of the $b$-symbol weight spectrum of cyclic codes from the following three perspectives:
* Obtain the bounds of the b-symbol weight spectrum of cyclic codes from its period distribution;

* Obtain the bounds of the b-symbol weight spectrum of cyclic codes from its primitive idempotents;

* Obtain the bounds of the b-symbol weight spectrum from the b-symbol weight calculation formula of c, where c is a codeword of cyclic codes.

We refer to these approaches as the period distribution approach, the primitive idempotent approach, and the b-symbol weight formula approach.

## 6.1 The period distribution approach

For a polynomial $f(x)$ over $\mathbb{F}_q$, the period (or order) of $f(x)$ is the least positive integer $t$ such that $f(x)|(x^t - 1)$, denoted by $per(f) = t$.

For a vector $c$ in $\mathbb{F}_q^n$, it can be extended by repetition into a bi-infinite periodic sequence $\bar{c} = (c_1, c_2, \dots)$. If there exists the smallest positive integer $t$ such that $c_{i+t} = c_i$ for all integers $i$, then $t$ is called the period of $c$, denoted by $per(c) = t$. Let $\{B_1, B_2, \dots, B_n\}$ be the period distribution of $C$, where $B_i$ is the number of nonzero codewords of period $i$ with $1 \le i < n$. It's worth noting that the period mentioned in this context refers to the least period. The following lemma, derived from [41], is quite useful.

**Lemma 25.** [41] If $C$ is an $[n, k]_q$ cyclic code, then

$$|W_1(C)| \le \sum_{t|n} \frac{B_t}{\text{lcm}(t, q-1)} \le 1 + \sum_{1<t|n} \frac{B_t}{\text{lcm}(t, q-1)} \quad (6)$$

For convenience, let $\Delta = n + 1 - b \cdot \lfloor \frac{n}{k} \rfloor$. The upper bound provided by Lemma 25 relies on the period distribution of cyclic codes. The subsequent result is contingent on the check polynomial $h(x)$ and necessitates the condition $gcd(n, q) = 1$.

**Theorem 26.** If $C$ is an $[n, k]_q$ cyclic code with check polynomial $h(x)$. Assume that $gcd(n, q) = 1$. The factorization of $h(x)$ is

$$h(x) = \prod_{i=1}^{m} h_i(x),$$

where $h_i(x)$ are irreducible factors of $h(x)$ over $\mathbb{F}_q$ with $1 \le i \le m$. Assume $\deg(h_i(x)) = s_i$ and $per(h_i(x)) = t_i$. Then we have

$$|W_b(C)| \left\{ \begin{array}{ll} = 1, & \text{if } b \ge k; \\ \le \min \left\{ \Delta, \sum_{b<t|n} \frac{\sum_{j|t} \mu(\frac{t}{j}) \cdot q^{\sum t_i |j| s_i}}{\text{lcm}(t,q-1)} \right\}, & \text{if } t_i > b \text{ for all } i; \\ \le \min \left\{ \Delta, 1 + \sum_{b<t|n} \frac{\sum_{j|t} \mu(\frac{t}{j}) \cdot q^{\sum t_i |j| s_i}}{\text{lcm}(t,q-1)} \right\}, & \text{otherwise;} \end{array} \right. \quad (7)$$

where $\mu(\cdot)$ denotes the Möbius function.
Proof. If $\mathbf{c}$ is a nonzero codeword of $\mathcal{C}$, then $\mathbf{c}$, $\alpha\mathbf{c}$, and $\tau^i(\mathbf{c})$ have the same $0$'s run distribution for any $\alpha \in \mathbb{F}_q^*$ and positive integer $i$. In [41] the authors proved the inequality (6) by the same idea. Then we obtain directly

$$|W_b(\mathcal{C})| \le \sum_{t|n} \frac{B_t}{\operatorname{lcm}(t, q-1)}. \qquad (8)$$

Let $\{\Psi(\mathbf{0}_i)|1 \le i \le n\}$ be the $0$'s run distribution of a codeword $\mathbf{c}$. If the $per(\mathbf{c}) \le b$, then $\Psi(\mathbf{0}_i) = 0$ for all $i \ge b$. Using Lemma 3, we have $w_b(\mathbf{c}) = n$. If there exists $t_i \le b$, then Inequality (8) can be further reduced to

$$|W_b(\mathcal{C})| \le 1 + \sum_{b<t|n} \frac{B_t}{\operatorname{lcm}(t, q-1)}.$$

If all $t_i > b$, we have

$$|W_b(\mathcal{C})| \le \sum_{b<t|n} \frac{B_t}{\operatorname{lcm}(t, q-1)}.$$

If $n$ is coprime to $q$, the formula of $B_t$ was given in [25] says

$$B_t = \sum_{j|t} \mu\left(\frac{t}{j}\right) \cdot q^{\sum_{t_i|j} s_i} \text{ with } 1 < t.$$

Combining Theorem 22 and the value of $B_t$, we get the desired result. $\square$

If $\mathcal{C}$ is an irreducible cyclic code, then a nice upper bound of $W_b(\mathcal{C})$ is given in the following.

**Corollary 27.** Assume that $\gcd(n, q) = 1$. Let $\mathcal{C}$ be an irreducible cyclic code with parameters $[n, k]_q$ and $h(x)$ be the parity-check polynomial of $\mathcal{C}$. Then

$$|W_b(\mathcal{C})| = \begin{cases} = 1, & \text{if } per(h(x)) \le b; \\ \le \min \left\{ \Delta, \frac{q^k-1}{\operatorname{lcm}(per(h(x)), q-1)} \right\}, & \text{if } per(h(x)) > b. \end{cases}$$

*Proof.* The period distribution of $\mathcal{C}$ is

$$\{B_{per(h(x))} = q^k - 1 \text{ and } B_i = 0 \text{ with } i \ne per(h(x))\}.$$

Therefore, we get the desired result. $\square$

The period distributions of several well-known cyclic codes are either determined or easily calculated. For simplicity, we provide the bounds of the $b$-symbol weight spectrum size of some special types of cyclic codes in the Appendix. These results rely on a wealth of known information on the period distributions of cyclic codes.
## 6.2 The primitive idempotent approach

An element $e$ of $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ satisfying $e^2 = e$ is called an idempotent. When $\gcd(n, q) = 1$, the ring $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ is semi-simple. Then each cyclic code in $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ contains a unique idempotent that generates the ideal. This idempotent is called the generating idempotent of the cyclic code. The irreducible cyclic codes (or minimal cyclic codes) of length $n$ over $\mathbb{F}_q$ are viewed as minimal ideals of the semi-simple algebra $\frac{\mathbb{F}_q[x]}{(x^n-1)}$. Every cyclic code of length $n$ over $\mathbb{F}_q$ is a direct sum of some irreducible cyclic codes. The polynomial $x^n - 1$ can be factored into a unique product of monic irreducible polynomials in $\frac{\mathbb{F}_q[x]}{(x^n-1)}$, i.e.,

$$x^n - 1 = \prod_{i=1}^{s} f_i(x), \qquad (9)$$

where $f_i(x)$ is irreducible over $\mathbb{F}_q$ for $1 \le i \le s$. Set $\hat{f}_i(x) = \frac{x^{n-1}}{f_i(x)}$. The generating idempotent of $\langle \hat{f}_i(x) \rangle$ is denoted by $\hat{e}_i(x)$. The idempotents $\hat{e}_i(x)$ for $1 \le i \le s$ are called the primitive idempotents of $\frac{\mathbb{F}_q[x]}{(x^n-1)}$. Every irreducible cyclic code of length $n$ over $\mathbb{F}_q$ is generated by a primitive idempotent of $\frac{\mathbb{F}_q[x]}{(x^n-1)}$. The irreducible cyclic codes can also be described using the trace function.

Let $f(x)$ be an irreducible factor of $x^n - 1$ over $\mathbb{F}_q$. Suppose $f(x)$ has degree $m$, and let $\gamma$ be a root of $f(x)$. Then the set

$$C(Q, \gamma) = \left\{ \sum_{i=0}^{n-1} \mathrm{Tr}_{Q/q}(\xi \gamma^i) x^i \mid \xi \in \mathbb{F}_Q \right\} \qquad (10)$$

represents the $[n, m]_q$ irreducible cyclic code with non-zeroes $\{\gamma^{-q^i} | 0 \le i < m\}$. Moreover, if we set $n = \frac{Q-1}{N}$, where $N$ is an integer dividing $Q-1$, and recall that $\alpha$ is a primitive element of $\mathbb{F}_Q$, letting $\theta = \alpha^N$, then the set

$$C(Q, \theta) = \{\mathbf{c}(\beta) = (\mathrm{Tr}_{Q/q}(\beta), \mathrm{Tr}_{Q/q}(\beta\theta), \dots, \mathrm{Tr}_{Q/q}(\beta)\theta^{n-1}) \mid \beta \in \mathbb{F}_Q\} \qquad (11)$$

also represents an irreducible cyclic code with parameters $[n, m_0]_q$, where $m_0$ is the multiplicative order of $q$ modulo $n$, and $m_0$ divides $m$.

**Definition 28.** The $q$-cyclotomic coset of $s$ modulo $q^k - 1$ is defined to be the set

$$C_s = \{s, sq, \dots, sq^{r-1}\} (\mathrm{mod} \ q^k - 1),$$

where $r$ is the smallest positive integer such that $sq^r \equiv s(\mathrm{mod} \ q^k - 1)$. Let $C_i^{(k,Q)} = \alpha^i \langle \alpha^k \rangle$ for $i \in \mathbb{Z}_k$, where $\langle \alpha^k \rangle$ denotes the subgroup of $\mathbb{F}_Q^*$ generated by $\alpha^k$. The cosets $C_i^{(k,Q)}$ are called the cyclotomic classes of order $k$ in $\mathbb{F}_Q$.

The set $C_s$ partitions the ring $\mathbb{Z}_{q^k-1}$ of integers into disjoint sets. There is a one-to-one correspondence between the primitive idempotents of $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ and the $q$-cyclotomic cosets
modulo $n$. Assume that $\zeta$ is a primitive $n$-th root of unity in $\mathbb{F}_q$. Then the ring $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ has $n$ primitive idempotents given by

$$e_i = \frac{1}{n} = \sum_{j=0}^{n-1} \zeta^{-ij}x^j \quad \text{for } 0 \le i \le n-1.$$

Moreover, the ring $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ has $s+1$ primitive idempotents given by

$$\varepsilon_t = \sum_{j \in C_t} e_j \quad \text{for } 0 \le t \le s.$$

The ring $\frac{\mathbb{F}_q[x]}{(x^n-1)}$ can be factored into a direct sum of the minimal ideals $\frac{\mathbb{F}_q[x]}{(x^n-1)}\varepsilon_t$ for $0 \le t \le s$ as follows:

$$\frac{\mathbb{F}_q[x]}{(x^n - 1)} = \bigoplus_{i=0}^{s} \frac{\mathbb{F}_q[x]}{(x^n - 1)} \varepsilon_i.$$

The minimal ideal $\frac{\mathbb{F}_q[x]}{(x^n-1)}\varepsilon_t$ has the check polynomial $\prod_{j \in C_i}(x - \zeta^j)$ since it can be viewed as an irreducible cyclic code. For more details on primitive idempotents and cyclic codes, please refer to [13] and Chapter 3 and Chapter 4 of [29].

Considering that a cyclic code without multiple roots can always be decomposed into the direct sum of some irreducible cyclic codes, we initially focus on the case of irreducible cyclic codes. The subsequent lemma is quite useful as it aids us in obtaining bounds on the b-symbol weight spectrum size of irreducible cyclic codes.

**Lemma 29.** For any cyclic code $C$ over $\mathbb{F}_q$, the group $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$ acting on $C$ never changes its 0's run distribution.

*Proof.* For any $c \in C$ and $f \in \langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$, we have $f(c) \in C$, and the two codewords $c$ and $f(c)$ have the same run distribution of 0. Therefore, the group $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$ acting on $C$ preserves its 0's run distribution. $\square$

**Theorem 30.** Let $C$ be an $[n, k]$ irreducible cyclic code over $\mathbb{F}_q$. Suppose that $C$ is generated by $\varepsilon_t$, where the primitive idempotent $\varepsilon_t$ corresponds to the $q$-cyclotomic coset $\{i_t, i_tq, \dots, i_tq^{k-1}\}$. Then

$$|W_b(C)| = \begin{cases} = 1, & \text{if } \frac{n}{\gcd(n, i_t)} \le b; \\ \le \min \left\{ \Delta, \frac{\gcd(n, (q-1)i_t)(q^k-1)}{n(q-1)} \right\}, & \text{if } \frac{n}{\gcd(n, i_t)} > b. \end{cases}$$

*Proof.* Since the primitive idempotent $\varepsilon_t$ corresponds to the $q$-cyclotomic coset $\{i_t, i_tq, \dots, i_tq^{k-1}\}$, the check polynomial $h(x)$ of $C$ has the form

$$h(x) = \prod_{j=0}^{k-1} (x - \zeta^{i_t q^j}),$$
where $\zeta$ is a primitive $n$-th root of unity. Then the period of $h(x)$ equals $\frac{n}{\gcd(n, i_{t_1})}$. If the period of $h(x) \le b$, then for any nonzero codeword $c \in C$, there must be no $0$ in $c$ with a length of $\ge b$. In this case, the $b$-symbol weight of each nonzero codeword is $n$.

If the period of $h(x) > b$, from Proposition 18, we know that the number of orbits of the group $\langle \tau, \{\sigma_a|a \in \mathbb{F}_q^*\} \rangle$ serves as a nice upper bound of $|W_b(C)|$. By combining this with Proposition 23, we derive the desired result. $\square$

In the case of general cyclic codes, we can decompose them into a series of irreducible cyclic codes. However, since Chen and Zhang [15] have already obtained the upper bound on $W_H(C)$ using the decomposition technique, we do not introduce this technique in this paper. Interested readers can refer to [15, 29] for more information on this technique.

**Theorem 31.** Let $\mathcal{R}_n = \frac{\mathbb{F}_q[x]}{(x^n-1)}$ and let $C$ be a cyclic code of length $n$ over $\mathbb{F}_q$. Suppose that

$$ \mathcal{C} = \bigoplus_{i=1}^{v} \mathcal{R}_n e_{t_i}, $$

where $0 \le t_1 < t_2 < \dots < t_v \le s$, and that the primitive idempotent $e_{t_j}$ corresponds to the $q$-cyclotomic coset $\{i_{t_j}, i_{t_j}q, \dots, i_{t_j}q^{k_{t_j}-1}\}$ for each $1 \le j \le v$. Then we have the following.

* If $\frac{n}{\gcd(n, i_{t_1})} > b$ for all $l$, then we have

$$ |W_b(C)| \le \min \left\{ \Delta, \sum_{\substack{j_1, j_2, \dots, j_u \\ \{j_1, j_2, \dots, j_u\} \subset [v] \\ 1 \le j_1 < j_2 < \dots < j_u \le v}} \frac{\gcd(n, i_{t_{j_1}}, i_{t_{j_2}}, \dots, i_{t_{j_u}}) \cdot \prod_{l=1}^{u} (q^{k_{t_{j_l}}}-1)}{n(q-1)} \cdot \right. \\ \left. \gcd\left(q-1, \frac{n}{\gcd(n, i_{t_{j_1}})}, \dots, \frac{n}{\gcd(n, i_{t_{j_u}})}\right) \right\} $$

* Otherwise, we have

$$ |W_b(C)| \le \min \left\{ \Delta, 1 + \sum_{\substack{j_1, j_2, \dots, j_u \\ \text{satisfies Condition I}}} \frac{\gcd(n, i_{t_{j_1}}, i_{t_{j_2}}, \dots, i_{t_{j_u}}) \cdot \prod_{l=1}^{u} (q^{k_{t_{j_l}}}-1)}{n(q-1)} \cdot \right. \\ \left. \gcd\left(q-1, \frac{n}{\gcd(n, i_{t_{j_1}})}, \dots, \frac{n}{\gcd(n, i_{t_{j_u}})}\right) \right\} $$

where **Condition I** is that $\{j_1, j_2, \dots, j_u\} \subset [v]$, $1 \le j_1 < j_2 < \dots < j_u \le v$ and $\frac{n}{\gcd(n, i_{t_1})} > b$.

*Proof.* Similar to the proof of Theorem 26, combined with the result of Theorem 31 regarding the number of the orbits of $\langle \tau, \{\sigma_a|a \in \mathbb{F}_q^*\} \rangle$ on $\mathcal{C}^*$, we can easily obtain the expected result. It is worth noting that Condition I is designed to eliminate the codewords that do not have $0$ with length exceeding $b-1$. The $b$-symbol weight of these excluded codewords is $n$, so we need to add another $1$. $\square$
## 6.3 The b-symbol weight formula approach

In this subsection, we introduce how to calculate the b-symbol weight of an irreducible cyclic code. This will significantly contribute to improving the upper bound of $w_b(C)$, where $C$ refers to an irreducible cyclic code $C(Q, \theta)$ in the form of (11). Before proceeding, we need to introduce two related definitions.

**Definition 32.** An additive character of $\mathbb{F}_q$ is a nonzero function $\chi$ from $\mathbb{F}_q$ to the set of complex numbers such that $\chi(x + y) = \chi(x)\chi(y)$ for any $(x, y) \in \mathbb{F}_q^2$. For each $b \in \mathbb{F}_q$, the function

$$ \chi_b(c) = e^{2\pi i \sqrt{-1} \mathrm{Tr}_{q/p}(bc)/p}, \quad \text{for all } c \in \mathbb{F}_q $$

defines an additive character of $\mathbb{F}_q$. $\chi_1$ is called the canonical additive character of $\mathbb{F}_q$. The Gaussian periods are defined by

$$ \eta_i^{(k,Q)} = \sum_{x \in C_i^{(k,Q)}} \chi_1(x), \quad i \in \{0, 1, \dots, k-1\}. $$

We adopt the definition of (11) instead of (10) to describe irreducible cyclic codes, as Ding and Yang [21] used the definition of (11) to provide the Hamming weight calculation formula for the codewords of irreducible cyclic codes, which depends on the values of some Gaussian periods. Zhu et al. [54] further provided a formula for calculating the b-symbol weight of the codewords of irreducible cyclic codes based on [21]. Before introducing this calculation formula, we need to provide a definition of the set $U(b, i, N_1)$.

**Definition 33.** Let $N_1 = \gcd(\frac{Q-1}{q-1}, N)$. Define $U(b, i, N_1)$ be the set

$$ U(b, i, N_1) = \left\{ (u_1, \dots, u_b) \left| \sum_{j=1}^{b} u_j \theta^{j-1} \in C_i^{(N_1, Q)} \text{ and } (u_1, \dots, u_b) \in \mathbb{F}_q^b \setminus \{0\} \right. \right\}, $$

where $\theta = \alpha^N$.

According to the definition of $C(Q, \theta)$, it is an irreducible cyclic code with parameters $[n, m_0]$. Zhu et al. [54] provided the b-symbol weight formula of irreducible cyclic codes.

**Theorem 34.** [54] Let $1 \le b \le m_0 - 1$, and let $c(\beta)$ be a codeword of the irreducible cyclic code $C(Q, \theta)$ as in (11). Let $N_1 = \gcd(\frac{Q-1}{q-1}, N)$. If $0 \ne \beta \in C_i^{(N_1, Q)}$, then the b-symbol weight of $c(\beta)$ is

$$ w_b(c(\beta)) = \frac{(q^b - 1)(Q - 1)}{q^b N} - \frac{N_1}{q^b N} \sum_{j=0}^{N_1-1} \#U(b, j, N_1) \eta_{i+j \pmod{N_1}}^{(N_1, Q)}. $$

At this juncture, this calculation formula relies on the values of two invariants: one is the value of the Gaussian period, and the other is the cardinality of the set $U(b, i, N_1)$. By scrutinizing the calculation formula provided in Theorem 45, we can derive the upper bound on the cardinality of the b-symbol weight spectrum of irreducible cyclic codes.
**Theorem 35.** Let $\mathcal{C}(Q, \theta)$ be an irreducible cyclic code defined as in (11). Then we have

$$|W_b(\mathcal{C}(Q, \theta))| \begin{cases} = 1, & \text{if } b \ge m_0; \\ \le \min \{\Delta, \gcd\left(\frac{Q-1}{q-1}, N\right)\}, & \text{if } 1 \le b \le m_0 - 1. \end{cases}$$

Moreover, $\mathcal{C}(Q, \theta)$ is an irreducible cyclic code with at most $\gcd(\frac{Q-1}{q-1}, N)$ b-symbol weights.

*Proof.* Let $\mathbf{c}(\beta_1)$ and $\mathbf{c}(\beta_2)$ be two nonzero codewords in $\mathcal{C}(Q, \theta)$. From Theorem 34, $w_b(\mathbf{c}(\beta_1)) = w_b(\mathbf{c}(\beta_2))$ if $\beta_1$ and $\beta_2$ belong to the same cyclotomic class $C_i^{(N_1,Q)}$, where $N_1 = \gcd(\frac{Q-1}{q-1}, N)$. Therefore, the cardinality of $W_b(\mathcal{C}, (Q, \theta))$ must not exceed the minimum value between $\Delta$ and $\gcd(\frac{Q-1}{q-1}, N)$. $\square$

For reducible cyclic codes, calculating the Hamming weight of their nonzero codewords becomes quite complex. It's evident that computing the b-symbol weight of nonzero codewords in reducible cyclic codes will be even more challenging. The difficulty of this task can be understood from [55]. As is well-known, Kasami codes represent a class of reducible cyclic codes with the simplest structure. Zhu and Shi [55] studied the b-symbol weight distribution of Kasami codes. It's apparent that even for the simplest reducible cyclic codes, extremely complex calculation formulas are required for their nonzero codewords. We encourage interested readers to explore the determination of the b-symbol weight distribution of reducible cyclic codes.

## 6.4 Performance analysis of three approaches

The above three approaches have the following characteristics:

* The period distributions approach: (1) There are existing results on the period distribution of cyclic codes that can be leveraged to reduce computational complexity; (2) Suitable for reducible cyclic codes; (3) The results obtained by the period distributions approach and the primitive idempotent approach are equivalent.

* The primitive idempotent approach: The proposed upper bound can be applied to reducible cyclic codes.

* The b-symbol weight formula approach: It is more accurate than the period distributions approach and the primitive idempotent approach, but it is difficult to apply to the case of reducible cyclic codes.

**Proposition 36.** *The upper bounds provided by the period distributions approach and the primitive idempotent approach are identical.*

*Proof.* Both approaches rely on determining the number of orbits of the group $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$ on $\mathcal{C}^*$. Therefore, the upper bounds obtained by the two approaches are equivalent, although they may be expressed differently due to the use of different mathematical symbols.
Considering that reducible cyclic codes can always be decomposed into a series of irreducible cyclic codes, we only need to verify that the results given by Corollary 27 and Theorem 30 are the same. This is equivalent to proving that the equation

$$ \frac{q^k - 1}{\text{lcm}(\text{per}(h(x)), q - 1)} = \frac{\text{gcd}(n, (q-1)i_t)(q^k - 1)}{n(q-1)} $$

holds. Since $\text{per}(h(x)) = \frac{n}{\text{gcd}(n, i_t)}$, we have

$$ \frac{q^k - 1}{\text{lcm}(\text{per}(h(x)), q - 1)} = \frac{q^k - 1}{\text{lcm}\left(\frac{n}{\text{gcd}(n, i_t)}, q - 1\right)} = \frac{q^k - 1}{n(q - 1) \cdot \frac{1}{\text{gcd}(n, (q-1)i_t)}} $$

This completes the proof. □

The reasons for the significant difference on the result forms between Theorem 26 and Theorem 31 are twofold:

(i) The parameters selection for the two approaches are different. The period distributions approach needs to determine the period of each $h_i(x)$; while the primitive idempotent approach selects the corresponding $i_{t_j}$. At this point, the correspondence between $\text{per}(h(x))$ and $i_{t_j}$ is $\text{per}(h(x)) = \frac{q^{k_{t_j}-1}}{\text{gcd}(q^{k_{t_j}-1}, i_{t_j})}$.

(ii) The second reason for the differences is the different selection of auxiliary functions. In Theorem 26, we can see that the Möbius function $\mu(x)$ was selected as an auxiliary function in its results; In Theorem 31, we can find that the Euler's totient function $\phi(x)$ was selected as an auxiliary function in its result (we can see the Euler's totient function as an auxiliary function in the mathematical derivation of [15]). The Euler's totient function and the Möbius function have the following relationship:

$$ \phi(n) = \sum_{i|n} \mu(i) \frac{n}{i}. $$

We note that Chen et al. [12] further improved the upper bound given in [15] by expanding subgroup $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\} \rangle$ to $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\}, \mu_q \rangle$, where $\mu_a$ is a ring automorphism of $\frac{\mathbb{F}_q[x]}{(x^n-1)}$, which is defined as follows:

$$ \mu_q : \frac{\mathbb{F}_q[x]}{(x^n - 1)} \rightarrow \frac{\mathbb{F}_q[x]}{(x^n - 1)} \\ \sum_{i=0}^{n-1} a_i x^i \mapsto \mu_q \left( \sum_{i=0}^{n-1} a_i x^i \right) = \sum_{i=0}^{n-1} a_i x^{qi} (\text{mod } x^n - 1). $$

However, the subgroup $\langle \tau, \{\sigma_a | a \in \mathbb{F}_q^*\}, \mu_q \rangle$ proposed in [12] is not suitable for studying the b-symbol weight spectrum. This is because for a nonzero vector $c$, $\mu_q$ may alter the 0's run distribution of c.
# 7 Conclusion and future works

In this paper, our contributions are as follows:

(1) We studied the b-symbol distance spectrum of the unrestricted codes and established an interesting connection with the run of zero in periodic sequences. When $C$ is unrestricted, we also proved that $D_b(C)$ is closely related to the difference sets with Singer parameters and Golomb ruler (Theorem 9 and Proposition 11).

(2) When the research object is cyclic codes, we propose three approaches to give the upper bound of the b-symbol weight spectrum for cyclic codes. When $b = 1$, the upper bound of the Hamming weight spectrum for irreducible cyclic codes given by the b-symbol weight formula approach will be better than the upper bound given by [12, 15].

(3) The upper bound of the b-symbol weight spectrum for many classical cyclic codes, such as RS codes, BCH codes, etc., is given using the period distributions approach, and these results are presented in the appendix.

(4) As two by-products of this paper, we answer how many symplectic weights can a linear code have at most (Corollary 13), and provide a basic inequality among the parameters $[n, k, d_H(C)]_q$ of cyclic codes (Theorem 20).

The future works of this topic will focus on the following points:

* Research on the construction of MbSW codes and the shortest length of MbSW codes.

* Try to give the b-symbol weight calculation formula for general cyclic codes. We may be able to derive inspiration from [20, 24, 30, 38, 46–49, 53] to provide the b-symbol weight calculation formula for reducible cyclic codes.

* Consider the size of the b-symbol distance spectrum or b-symbol weight spectrum of codes $C$ over $\mathbb{Z}_4$.

# Appendix

We further give some upper bounds on the size of $W_b(C)$ of some cyclic codes by using these known (or easily computed) period distributions.

## The cyclic codes with prime length $n$

If $C$ is a cyclic code with prime length $n$, then a nice upper bound of $W_b(C)$ is given in the following.

**Corollary 37.** Assume that $n$ is prime. Let $C$ be a cyclic code with parameters $[n, k]_q$ and $h(x)$ be the parity-check polynomial of $C$. Assume that $\text{per}(h(x)) > b$. Then we have

$$|W_b(C)| \le \begin{cases} \Delta, & n|q-1; \\ \min\left\{\Delta, 1 + \frac{q^k-q}{n(q-1)}\right\}, & x-1|h(x) \text{ and } n \nmid q-1; \\ \min\left\{\Delta, \frac{q^k-1}{n(q-1)}\right\}, & x-1 \nmid h(x) \text{ and } n \nmid q-1. \end{cases}$$
Proof. When $n$ is prime, the period distribution of $\mathcal{C}$ is

$$ \begin{cases} B_1 = q-1, B_i = 0, 2 \le i \le n-1, B_n = q^k - q & \text{if } x-1|h(x); \\ B_i = 0, 1 \le i \le n-1, B_n = q^k - 1 & \text{if } x-1 \nmid h(x). \end{cases} $$

If $n|q-1$, we have $|W_b(\mathcal{C})| \le \min\{\Delta, \frac{q^{k-1}}{q-1}\} = \Delta$ since $\Gamma(k, q, b) \le L(k, q, b) = \frac{q^{k-1}}{q-1}$. According to Inequality (8), we obtain the desired result. $\square$

## The dual of cyclic codes with two zeroes

Recall that $h(x)$ denotes the parity-check polynomial of $\mathcal{C}$. If $h(x)$ has only two irreducible factors, the period distribution of $\mathcal{C}$ is easy to compute after a brief discussion. So we omit the proof of the following result.

**Corollary 38.** Assume $\gcd(n, q) = 1$. Let $\mathcal{C}$ be a cyclic code with parameters $[n, k]_q$. Let $h(x) = h_1(x)h_2(x)$ where $h_1(x)$ and $h_2(x)$ are irreducible over $\mathbb{F}_q$, $\deg(h_i(x)) = s_i$ and $\text{per}(h_i(x)) = t_i$ with $1 \le i \le 2$. If $\min\{t_1, t_2\} > b$, then

$$ |W_b(\mathcal{C})| \le \begin{cases} \min\left\{\Delta, \frac{q^{k-1}}{\text{lcm}(t_1, q-1)}\right\}, & \text{if } t_1 = t_2; \\ \min\left\{\Delta, \frac{q^{s_1-1}}{\text{lcm}(t_1, q-1)} + \frac{q^{s_2-1}}{\text{lcm}(t_2, q-1)} + \frac{q^k - q^{s_1 - q^{s_2} + 1}}{\text{lcm}(\text{lcm}(t_1, t_2), q-1)}\right\}, & \text{if } \gcd(t_1, t_2) \in \{t_1, t_2\}; \\ \min\left\{\Delta, \frac{q^{s_1-1}}{\text{lcm}(t_1, q-1)} + \frac{q^k - q^{s_1}}{\text{lcm}(t_2, q-1)}\right\}, & \text{if } t_1|t_2. \end{cases} $$

## BCH codes

Let $\delta$ be an integer with $2 \le \delta \le n$. A BCH code $\mathcal{C}$ over $\mathbb{F}_q$ of length $n$ and designed distance $\delta$ is a cyclic code with defining set

$$ T = C_b \cup C_{b+1} \cup \cdots \cup C_{b+\delta-2}, $$

where $C_i$ denotes the $q$-cyclotomic coset modulo $n$ containing $i$. The period distribution of BCH codes is given in [34] in some cases. Combining the results in [34], we get the following result directly.

**Corollary 39.** Let $\mathcal{C}$ be a narrow-sense BCH code with length $n = q^m - 1$ and designed distance $\delta$. We have the following.

$$ |W_b(\mathcal{C})| \le \min \left\{ \Delta, \sum_{b<t|n} \frac{\sum_{j|t} \mu\left(\frac{t}{j}\right) A_i}{\text{lcm}(t, q-1)} \right\}, $$

where the value of $A_i$ is as follows:

(1) If $2 \le \delta < q+1$, then

$$ A_i = \begin{cases} q^{n-(\delta-1)m}, & i = n; \\ q^{\frac{n}{2}-\lfloor \frac{\delta-1}{2} \rfloor m}, & i = \frac{n}{2}; \\ A_{\frac{sn}{j}} = q^{\frac{n}{j}-\lfloor \frac{\delta-1}{j} \rfloor m}, & i = \frac{n}{j} \text{ for some } j \in [\delta-1]\setminus\{1, 2\} \\ q^{\gcd(n,i)}, & \text{where } 1 \le s \le j-1 \text{ and } \gcd(s,j) = 1; \\ \end{cases} $$
$$
(2) \text{ If } q+1 \le \delta \le \begin{cases} q^{\frac{m+1}{2}}, & \text{if } m \equiv 1 \pmod 2; \\ q^{\frac{m}{2}}+2, & \text{if } m \equiv 0 \pmod 2, \end{cases} \text{ then}
$$

$$
A_i = \begin{cases}
q^{n-((\delta-1)-\lfloor\frac{\delta-1}{q}\rfloor)m}, & \text{if } i=n; \\
A_{\frac{sn}{j}} = q^{\frac{n}{j}} - \left(\lfloor\frac{\delta-1}{j}\rfloor - \lfloor\frac{\delta-1}{qj}\rfloor\right)m, & \text{$i=\frac{n}{j}$ for some $j \in [\delta-1]$,} \\
q^{\gcd(n,i)}, & \text{otherwise.}
\end{cases}
$$

$$
(3) \text{ If } q^{\frac{m}{2}} + 2 \le \delta \le 2q^{\frac{m}{2}}, \text{ then}
$$

$$
A_i = \begin{cases}
q^{n-\left(\delta - \frac{3}{2} - \lfloor \frac{\delta-1}{q} \rfloor\right)m}, & i = n; \\
A_{\frac{sn}{j}} = q^{\frac{j}{n} - \left(\lfloor \frac{\delta-1}{j} \rfloor - \lfloor \frac{\delta-1}{qj} \rfloor\right)m}, & i = n, j \in [\delta-1] \setminus \{1\}, \gcd(s, j) = 1, \\
1 \le s \le j-1, (q^{\frac{r}{2}} + 1) \nmid j; \\
A_{\frac{sn}{j'}} = q^{\frac{n}{j'} - \frac{m}{2}}, & r = \frac{n}{j'}, j' \in [\delta-1], \gcd(s, j') = 1, \\
1 \le s \le j' - 1, (q^{\frac{m}{2}} + 1) \mid j'; \\
q^{\gcd(n, i)}, & \text{otherwise.}
\end{cases}
$$

Reed-Solomon codes

A Reed-Solomon code, abbreviated RS code, is a BCH code of length $n = q - 1$. By virtue of the period distribution of the RS code, we obtain the following result.

**Corollary 40.** Let $\mathcal{C}$ be a Reed-Solomon code with parameters $[q-1, k]_q$. Then

$$
|W_b(\mathcal{C})| \le \min \left\{ \Delta, 1 + \sum_{b<t|q-1} \frac{\sum_{j|t} \mu\left(\frac{t}{j}\right) q^{1+\frac{(k-1)\gcd(q-1,j)}{q-1}}}{q-1} \right\}.
$$

*Proof.* The period distribution of Reed-Solomon code is

$$
B_t = \sum_{j|t} \mu\left(\frac{t}{j}\right) q^{1+\frac{(k-1)\gcd(q-1,j)}{q-1}},
$$

which is given in [25], and $lcm(t, q - 1) = q - 1$, then we obtain the desired result. $\square$

From Corollary 37 to Corollary 40, we can see that the period distributions approach
has significant advantages over the primitive idempotent approach, thanks to the existing
results on the period distribution of cyclic codes.

**Acknowledgement**

This research is supported by Natural Science Foundation of China (12071001, 62171248).
References

[1] T. L. Alderson, On the weights of general MDS codes, IEEE Trans. Inf. Theory, **66**(9), (2020), 5414–5418.

[2] T. L. Alderson, A note on full weight spectrum codes, Trans. Combinatorics, **8**(3), (2019), 15-22.

[3] T. L. Alderson, A. Neri, Maximum weight spectrum codes, Adv. Math. Commun., **13**(1), (2019), 101–119.

[4] T. Beth, D. Jungnickel, H. Lenz, *Design theory*. BI-Institut, Mannheim, Wien, Zurich (1985).

[5] R. Bose, D. Ray-Chaudhuri, On a class of error correcting binary group codes, Inf. Control, **3**, (1960), 68–79.

[6] R. Bose, D. Ray-Chaudhuri, Further results on error correcting binary group codes, Inf. Control, **3**, (1960), 279–290.

[7] A. R. Calderbank, E. M. Rains, P. Shor, N. J. Sloane, Quantum error correction via codes over GF(4), IEEE Trans. Inf. Theory, **44**(4), (1998), 1369–1387.

[8] Y. Cassuto, M. Blaum, Codes for symbol-pair read channels, In: Proc. IEEE Int. Symp. Inf. Theory, Austin, TX, USA, (2010), 988–992.

[9] Y. Cassuto, M. Blaum, Codes for symbol-pair read channels, IEEE Trans. Inf. Theory, **57**(12), (2011), 8011–8020.

[10] Y. Cassuto, S. Litsyn, Symbol-pair codes: algebraic constructions and asymptotic bounds, In: Proc. IEEE Int. Symp. Inf. Theory, St. Petersburg, Russia, (2011), 2348–2352.

[11] Y. M. Chee, L. Ji, H. M. Kiah, C. Wang, J. Yin, Maximum distance separable codes for symbol pair read channels, IEEE Trans. Inf. Theory, **59**(11), (2013), 7259–7267.

[12] B. Chen, Y. Fu, H. Liu, Improved upper bounds of the nonzero weights of cyclic codes, arXiv:2305.14687v1.

[13] B. Chen, H. Liu, G. Zhang, Some minimal cyclic codes over finite field, Discrete Math., **331**, (2014), 142–150.

[14] B. Chen, L. Lin, H. Liu, Constacyclic symbol-pair codes: lower bounds and optimal constructions, IEEE Trans. Inf. Theory, **63**(12), (2017), 7661–7666.

[15] B. Chen, G. Zhang, A tight upper bound on the number of nonzero weights of a cyclic code, IEEE Trans. Inf. Theory, **69**(2), (2023), 995–1004.
[16] P. Delsarte, Four fundamentals parameters of a code and their combinatorial significance, Inf. Control, **23**, (1973), 1617–1619.

[17] A. Dimitiromanolakis, *Analysis of the Golomb ruler and the sidon problems, and determination of large, near-optimal Golomb rulers*, Department of Electronic and Computer Engineering Technical University of Crete, June 2002, http://www.cs.toronto.edu/apostol/golomb/main.pdf

[18] B. Ding, G. Ge, J. Zhang, T. Zhang, Y. Zhang, New constructions of MDS symbol-pair codes, Des. Codes Cryptogr., **86**(4), (2018), 841–859.

[19] B. Ding, T. Zhang, G. Ge, Maximum distance separable codes for *b*-symbol read channels, Finite Fields Appl., **49**, (2018), 180–197.

[20] C. Ding, Y. Liu, C. Ma, L. Zeng, The weight distributions of the duals of cyclic codes with two zeroes, IEEE Trans. Inf. Theory, **57**(12), (2011), 8000–8006.

[21] C. Ding, J. Yang, Hamming weights in irreducible cyclic codes, Discr. Math., **313**(4), (2013), 434–446.

[22] O. Elishco, R. Gabrys, E. Yaakobi, Bounds and constructions of codes over symbol-pair read channels, IEEE Trans. Inf. Theory, **66**(3), (2020), 1385–1395.

[23] M. F. Ezerman, M. Grassl, P. Solé, The weights in MDS codes, IEEE Trans. Inf. Theory, **57**(1), (2011), 392–396.

[24] T. Feng, K. Momihara, Evaluation of the weight distribution of a class of cyclic codes based on index 2 Gauss sums, IEEE Trans. Inf. Theory, **59**(9), (2013), 5980–5984.

[25] F. Fu, S. Shen, New calculation formula for period distribution of cyclic codes, J. China Institute Commun., **17**(2), (1996), 1–6.

[26] C. Hartmann, K. Tzeng, Generalizations of the BCH bound, Inf. Control, **20**, (1972), 489–498.

[27] E. Hendradi, Lower bound on the minimum distance of cyclic codes, 31, Aug (2007). https://research.tue.nl/en/studentThesis/lower-bound-on-the-minimum-distance-of-cyclic-codes

[28] A. Hocquenghem, Codes correcteurs d'erreurs, Chiffres, **2**, (1959), 147–156.

[29] W. C. Huffman, V. Pless, Fundamentals of error-correcting codes, Cambridge, U.K., Cambridge Univ. Press, 2003.

[30] T. Kasami, Weight distribution formula for some class of cyclic codes, Technical Report R-285(AD632574), Coordinated Science Laboratory, University of Illinois, Urbana, IL, (1996).
[31] X. Kai, S. Zhu, P. Li, A construction of new MDS symbol-pair codes, IEEE Trans. Inf. Theory, **61**(11), (2015), 5828-5834.

[32] A. Ketkar, A. Klappenecker, S. Kumar, P. K. Sarvepalli, Nonbinary stabilizer codes over finite fields, IEEE Trans. Inf. Theory, **52**(11), (2006), 4892-4914.

[33] X. Li, M. Shi, S. Ling, A tight upper bound on the number of non-zero weights of a quasi-cyclic code, (2023), arXiv:2211.03392.

[34] Q. Liao, Q. Huang, The period distributions for the *q*-ary BCH code and its dual code, Advances in Math. (China), **46**(1), (2007), 73-81.

[35] H. Liu, X. Pan, Generalized pair weights of linear codes and linear isomorphisms preserving pair weights, IEEE Trans. Inf. Theory, **68**(1), (2022), 105-117.

[36] H. Liu, X. Pan, Generalized *b*-symbol weights of linear codes and *b*-symbol MDS codes, IEEE Trans. Inf. Theory, **69**(4), (2023), 2311-2323.

[37] G. Luo, X. Cao, M. F. Ezerman, S. Ling, On the weights of linear codes with prescribed automorphisms, IEEE Trans. Inf. Theory, (2023), doi: 10.1109/TIT.2023.3347701.

[38] C. Ma, L. Zeng, Y. Liu, D. Feng, C. Ding, The weight enumerator of a class of cyclic codes, IEEE Trans. Inf. Theory, **57**(1), (2011), 397-402.

[39] M. Shi, H. Zhu, P. Solé, G.D. Cohen, How many weights can a linear code have? Des., Codes Cryptogr. **87**(1), (2019), 87-95.

[40] M. Shi, A. Neri, P. Solé, How many weights can a quasi-cyclic code have? IEEE Trans. Inf. Theory, **66**(11), (2020), 6855-6862.

[41] M. Shi, X. Li, A. Neri, P. Solé, How many weights can a cyclic code have? IEEE Trans. Inf. Theory, **66**(3), (2020), 1449-1459.

[42] M. Shi, F. Özbudak, P. Solé, Geometric approach to *b*-symbol Hamming weights of cyclic codes, IEEE Trans. Inf. Theory, **67**(6), (2021), 3735-3751.

[43] M. Shi, H. Zhu, T. Helleseth, The connections among Hamming metric, *b*-symbol metric, and *r*-th generalized Hamming metric, IEEE Trans. Inf. Theory, **69**(4), (2023), 2485-2493.

[44] J. Singer, J. A theorem in finite projective geometry and some applications to number theory, Trans. Amer. Math. Soc. **43**, (1938), 377-385.

[45] Z. Sun, S. Zhu, L. Wang, The symbol-pair distance distribution of a class of repeated-root cyclic codes over $\mathbb{F}_{p^m}$, Cryptogr. Commun., **10**(4), (2018), 643-653.

[46] B. Wang, C. Tang, Y. Qi, Y. Yang, M. Xu, The weight distributions of cyclic codes and elliptic curves, IEEE Trans. Inf. Theory, **58**(12), (2012), 7253-7259.
[47] M. Xiong, The weight distributions of a class of cyclic codes, Finite Fields Appl., **18**, (2012), 933–945.

[48] M. Xiong, The weight distributions of a class of cyclic codes II, Des. Codes Cryptogr., **72**(3), (2014), 511–528.

[49] M. Xiong, The weight distributions of a class of cyclic codes III, Finite Fields Appl., **21**, (2013), 84–96.

[50] E. Yaakobi, J. Bruck, P. H. Siegel, Decoding of cyclic codes over symbol-pair read channels, In: Proc. IEEE Int. Symp. Inf. Theory, Cambridge, MA, USA, (2012), 2891–2895.

[51] E. Yaakobi, J. Bruck, P. H. Siegel, Constructions and decoding of cyclic codes over $b$-symbol real channels, IEEE Trans. Inf. Theory, **62**(4), (2016), 1541–1551.

[52] H. Zhang, X. Cao, A tight upper bound on the number of nonzero weights of a constacyclic code, Finite Fields Appl., **93**, (2024), 102312.

[53] H. Zhu, M. Shi, F. Özbudak, Complete $b$-symbol weight distribution of some irreducible cyclic codes, Des. Codes Cryptogr., **90**(5), (2022), 1113–1125.

[54] H. Zhu, M. Shi, The complete $b$-symbol weight distribution of irreducible cyclic codes and related consequences, arXiv: 2203.11567v1.

[55] H. Zhu, M. Shi, The $b$-symbol weight hierarchy of the Kasami codes, Discrete Mathematics, 2023, 347(2): 113774.