1 Introduction

Links between linear codes, non-linear functions from cryptography, graphs and combinatorial designs have attracted the attention of many researchers [1, 2, 5, 10, 13, 14, 17, 18, 27, 28]. Exploring these links are fruitful to each subject so that results from one area can be applied into the others. This paper is devoted to explore such links between partial geometric designs, three-weight codes and a family of graphs with four distinct eigenvalues.

Let p be a prime and n be a positive integer. An [nkd] p-ary linear code C is a k-dimensional subspace of \(\mathbb {F}_p^n\) with Hamming distance d. Let \(A_i\) be number of codewords with Hamming weight \(i \ge 1\) and t be the number of non-zero \(A_i\)’s of C. Then, C is called a t-weight code. The construction of t-weight codes with small t value is an important research area due to their applications in the engineering problems such as communication, cryptography, data storage systems, and secret sharing schemes [12, 20, 29, 30, 32, 33].

Construction of many linear codes benefited from other areas of combinatorics including graph theory, cryptography and design theory. For example, binary two-weight and three-weight codes can be obtained from highly non-linear Boolean functions [16]. Highly non-linear Boolean functions such as bent, semi-bent and plateaued functions have provided suitable candidates that can be used in cryptosystems [6, 7, 9, 31]. Fourier spectrum of a Boolean function plays an important role in analyzing its properties. A Boolean function f from \(\mathbb {F}_2^n\) to \(\mathbb {F}_2\) with Fourier spectrum \( \{\pm 2^{n/2} \}\) is called a bent function. Plateaued functions are introduced as functions which either are bent or have a Fourier spectrum with three values 0 and \(\pm 2^t\) for some integer t. We will show that three-weight codes can be obtained from plateaued functions and their associated designs.

Almost bent functions are another family of functions that attract the attention of researchers in the field of cryptography. An almost bent function is a function f from \(\mathbb {F}_2^n\) into \(\mathbb {F}_2^n\) which achieves the highest possible nonlinearity. We will show that permutation almost bent functions can be used to construct partial geometric designs and three-weight codes.

In this paper, one of our interest lies in the link between ternary weakly bent functions and graphs. A function from \(\mathbb {F}_p^n\) to \(\mathbb {F}_p\) is called a p-ary bent function if Walsh coefficients have absolute value \(p^{\frac{n}{2}}\). A p-ary bent function is called a weakly regular bent function if the Walsh coefficients take just the values \(\mu p^{n/2} \zeta _p^i\) , where \(\zeta _p = e^{2\pi i/p}\) is a complex p-th root of unity and \(\mu \) is a complex number of absolute value 1. Tan et al. provided a characterisation of ternary weakly regular bent functions via strongly regular graphs when n is even [28]. It is natural to search for a characterisation of ternary weakly regular bent functions via graphs when n is odd. We will provide such a characterisation via certain graphs with four distinct eigenvalues. Our characterisation also provides a method to construct three-weight codes.

A (block) design is a pair \((P, \mathcal {B})\) consisting of a finite set P of points and a finite collection \(\mathcal {B}\) of nonempty subsets of P called blocks. It is often convenient to represent a combinatorial design with an incidence matrix. A point-block incidence matrix N of a block design \((P,\mathcal {B})\) with \(|P|=v\) and \(|\mathcal {B}|=b\) is a \(v \times b\) \(\{0,1\}\)-matrix such that the entry in row i and column j is 1 if the i-th point is incident to the j-th block. N can be viewed as a matrix over \(\mathbb {F}_p\), the columns of N span a code of length v. Difference set method can be used to construct designs and codes. For instance, two-weight and three-weight codes can be obtained from almost difference sets and difference sets [17]. For more information on designs, difference sets and codes, we refer the books [1] and [14].

In this paper, we will show that existence of certain partial geometric designs is equivalent to existence of some families of three-weight codes. The notion of partial geometric design is introduced by Bose, Shrikhande and Singhi [3]. This family of designs is also studied independently under the notion of \(1\frac{1}{2}\)-designs by Neumaier [22]. Links between directed strongly regular graphs, plateaued functions and partial geometric designs are examined in the references [4] and [26]. The author also studied partial geometric difference sets and families as a construction method of partial geometric designs [23, 25].

The organization of the paper is as follows. In the following section, we recall some results concerning partial geometric difference sets and main tools that will be needed later. In Sect. 3, we provide results concerning three-weight codes with non-zero weights \(w_1=w, w_2=w-m\) and \(w_3=w+m\) for some integer m and partial geometric designs. In Sect. 4, we introduce a family of graphs related to a family of three-weight codes and study its properties. We also provide a classification of Cayley graphs obtained from partial geometric difference sets and weakly regular bent functions from \(\mathbb {F}_3^n\) to \(\mathbb {F}_3\) when n is odd.

2 Preliminaries

Here we recall some basic facts about block designs, difference sets, group characters and group rings. We also set the notation that will be used throughout the paper.

2.1 Block designs

Designs and their algebraic properties can be classified by their incidence matrix. This is usually done by conveying the combinatorial properties of the given block design into a matrix equation. For example, a design \((P,\mathcal {B})\) is called a 1-design (or a tactical configuration) with parameters (vbkr) if its \(v \times b\) incidence matrix N satisfies the equations:

$$\begin{aligned} NJ=rJ~~ \text{ and }~~JN=kJ \end{aligned}$$
(1)

for some integer k and r where J denotes the all-ones matrix. Equation (1), implies that a 1-design with parameters (vbkr) is a block design with \(|P| = v\) and \(|\mathcal {B}| = b\) such that each block consists of k points and each point belongs to r blocks.

A well-studied example of 1-designs is known as 2-designs. A 1-design with parameters (vbkr) is called a 2-design (or \(2-(v,k,\lambda )\)-design) with parameters \((v,k,\lambda )\) if its incidence matrix N satisfies the equation:

$$\begin{aligned} NN^t = (r-\lambda )I +\lambda J \end{aligned}$$
(2)

where I denotes the identity matrix. Equation (2), combinatorially conveys that every pair of distinct points in a 2-design is contained in exactly \(\lambda \) blocks.

Another well-known family of 1-designs are studied under the notion of partial geometric designs. The incidence matrix N of a partial geometric design with parameters \((v,b,k,r; \alpha , \beta )\) satisfies

$$\begin{aligned} JN=kJ, \quad NJ=rJ,\quad NN^TN=(\beta -\alpha ) N+\alpha J \end{aligned}$$
(3)

for certain integers \(k,r,\alpha ,\) and \(\beta \).

Let s(xB) denote the number of flags (yC) such that \(y\in B\) and \(x \in C\).Footnote 1 Equation (3), combinatorially conveys that in a partial geometric design the number s(xB) depends only on whether (xB) is a flag or not. In other words, for given a partial geometric design with parameters \((v,b,k,r; \alpha , \beta )\):

$$\begin{aligned} s(x,B)=\left\{ \begin{array}{ll} \alpha &{} \text{ if } x\notin B,\\ \beta &{} \text{ if } x\in B, \\ \end{array}\right. \quad \forall (x, B)\in P\times \mathcal {B}. \end{aligned}$$

By examining the Eq. (2), one can conclude that a 2-\((v,k,\lambda )\)-design is a partial geometric design with parameters \(\displaystyle (v, b=\frac{vr}{k}, k, r=\frac{\lambda (v-1)}{k-1} ; \alpha =\lambda k, \beta =r+\lambda (k-1))\). Throughout this paper, we are only interested in the partial geometric designs with \(\alpha , \beta >0\) which are not \(2-\)designs, unless otherwise stated.

2.2 Difference sets

In this section, we will introduce the notion of difference sets, partial geometric difference sets and relative difference sets.

Let G be a finite group of order v written multiplicatively. Let S be a subset of G and

$$\begin{aligned} \Delta (S) :=[s_1s_2^{-1}:s_1,s_2\in S, s_1\ne s_2]. \end{aligned}$$

Definition 2.1

Let k and \(\lambda \) be integers such that \(v>k>2\). A \((v,k,\lambda )\)-difference set D is a k-subset of a group G such that every non-identity element of G appears in \(\Delta (D)\) exactly \(\lambda \) times.

Definition 2.2

Let G be a group of order mn containing a subgroup N of order n. An \((m, n, k, \lambda )\) relative difference set R in G relative to subgroup N is a k-subset of G such that each element in \(G\setminus N\) appears in \(\Delta (R)\) exactly \(\lambda \) times and \(\Delta (R)\) does not contain the elements of N.

Given a k-element subset S of a group G, for each element \(z\in G\), we define the multiplicity of z in \(\Delta (S)\) by

$$\begin{aligned} \delta (z):=\bigg |\big \{(s,t)\in S \times S :z=st^{-1}\big \}\bigg |. \end{aligned}$$

Definition 2.3

Let v and k be integers with \(v>k>2\). Let G be a group of order v. A k-subset S of G is called a partial geometric difference set in G with parameters \((v, k; \alpha ,\beta )\) if there exist constants \(\alpha \) and \(\beta \) such that, for each \(x\in G\),

$$\begin{aligned} \sum \limits _{y\in S}\delta (xy^{-1})=\left\{ \begin{array}{ll} \alpha &{} \text{ if } x\notin S,\\ \beta &{} \text{ if } x\in S\\ \end{array} \right. \end{aligned}$$

The notion of partial geometric difference sets is introduced by the author and studied also under the name of \(1\frac{1}{2}\)-difference sets. Let S be a subset of a group G. For any element \(g\in G\), we define the translate of S by g as \(S g:=\{xg :x\in S\}\). We define \(Dev(S):=[Sg :g \in G]\) to be the collection of all translates of S. Dev(S) is often called the development of S. If S is a partial geometric difference set with parameters \((v, k; \alpha ,\beta )\) in G, then (GDev(S)) is a partial geometric design with parameters \((v, b=v, k, r=k; \alpha ,\beta )\) [25].

2.3 Group characters and group ring

The group character values and group ring equations provide us with tools to investigate block designs which are obtained from difference set methods.

Let sG be a finite abelian group and let \(\mathbb {Z}G\) be the group ring of G. By the definition, \(\mathbb {Z}G\) is the ring of formal polynomials

where each denotes the indeterminate corresponding to g. We will use calligraphic letters to denote elements of \(\mathbb {Z}G\). The ring \(\mathbb {Z}G\) has the operation of addition and multiplication given by

For any element g in G and any nonempty subset S of G, the corresponding group ring elements and are called simple quantities in \(\mathbb {Z}G\). We denote by \(\mathcal {S}\), and denote the simple quantity for the set \(S^{-1}=\{s^{-1}: s\in S\}\) by \(\mathcal {S}^{-1}\), so that .

Let denote the simple quantity corresponding to the identity element (\(e_G\)) of G. It is easy to observe that a k-subset S of G is a \((v,k,\lambda )\)-difference set if and only if the equation

(4)

holds in the group ring \(\mathbb {Z}G\). Similarly one can obtain that S is a partial geometric difference set with parameters \((v,k;\alpha ,\beta )\) in G if and only if the equation

$$\begin{aligned} \mathcal {S}\mathcal {S}^{-1}\mathcal {S}=(\beta - \alpha )\mathcal {S}+\alpha \mathcal {G} \end{aligned}$$
(5)

holds in \(\mathbb {Z}G\).

A character \(\chi \) of a finite abelian group G is a homomorphism from G to the multiplicative group of the nonzero complex numbers. The character \(\chi \) of G such that \(\chi (g) = 1\) for every \(g \in G\), is called the principal character of G. We can reformulate the group ring equation by using characters of the group.The following result can be found in [25].

Lemma 2.4

A k-subset S of an abelian group G is a partial geometric difference set in G with parameters \((v,k;\alpha ,\beta )\) if and only if \(|\chi (S)|=\sqrt{\beta -\alpha }\) or \(\chi (S)=0\) for every non-principal character \(\chi \) of G.

3 Partial geometric difference sets from three-weight codes

Let p be a prime and let n be a positive integer. Let \(\mathbb {F}_p^n\) denote n-dimensional vector space over the finite field \(\mathbb {F}_p\). The dot product of two codewords \(x,y \in \mathbb {F}_p^n\) is given by \(\displaystyle x \cdot y =\sum _{i=1}^nx_iy_i\). The weight wt(x) of a codeword \(x \in \mathbb {F}_p^n\) is the number of non-zero entries. Distance between two codewords x and y is defined by \(d(x,y)=wt(x-y)\). The minimum distance of a code is the minimum weight among all non-zero codewords. An [nkd] code C over \(\mathbb {F}_p\) is a k-dimensional subspace of \(\mathbb {F}_p^n\) with minimum distance d. One of the objective of this paper is to explore the connections between the following code construction which is introduced by Ding and Niederreiter [15] and partial geometric designs.

Construction 3.1

Let \(S=\{s_1,s_2,\ldots , s_n\}\) be a set of n vectors of \(\mathbb {F}_p^k\). We will be interested in the following code construction.

$$\begin{aligned} C_S=\left\{ (x\cdot s_1, x\cdot s_2, \ldots , x\cdot s_n ) : x \in \mathbb {F}_p^k \right\} . \end{aligned}$$

Let x be a non-zero vector in \(\mathbb {F}_p^k\) and \(c_x=(x\cdot s_1, x\cdot s_2, \dots , x\cdot s_n )\). Then,

$$\begin{aligned} wt(c_x)=n-|\{i:x\cdot s_i=0, i=1,2,...,n \}|. \end{aligned}$$

Let G be the additive group of \(\mathbb {F}_{p}^k\) and \(\chi \) be non-principal character of G. Then, for u in \(\mathbb {F}_p^k\) the character \(\chi _u(v)\) is defined by \(\chi (u\cdot v)\) for all \(v \in \mathbb {F}_{p}^k\). One can observe that

$$\begin{aligned} \displaystyle wt(c_x)=\frac{(p-1)n-\sum _{i=1}^n\sum _{\begin{array}{c} \alpha \in \mathbb {F}_p^* \end{array}}\chi _x(\alpha s_i)}{p}. \end{aligned}$$
(6)

We may replace \(\mathbb {F}_p^k\) by \(\mathbb {F}_{p^k}\) and the dot product \(x \cdot y\) by the absolute trace function Tr(xy). In this case, our results will still hold.

Theorem 3.2

Let p be a prime and let mn and \(k>1\) be positive integers. Suppose S is a n-subset of G satisfying \(S=-S\), \(e_G \notin S\) and \(\frac{n}{p}\) is an integer. S is a partial geometric difference set with parameters \((p^k,n; \alpha , \beta )\) such that \(p^2m^2=\beta -\alpha \) if and only if \(C_S\) is a three-weight p-ary code with non-zero weights \(w_1=\frac{(p-1)n}{p},w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1)\).

Proof

First suppose S is a partial geometric difference set with parameters \((p^k,n; \alpha , \beta )\) such that \(p^2m^2=\beta -\alpha \) for some integer m. For any non-principal character \(\chi _x\)

$$\begin{aligned} \chi _x(S)=\sum _{s \in S}\chi _x(s) \end{aligned}$$

can only take values \(\pm pm\) and 0. Also note that

$$\begin{aligned} \begin{aligned} \chi _x(S)= \sum _{\begin{array}{c} s \in S\\ x\cdot s=0 \end{array}}\chi _x(s)+\sum _{\begin{array}{c} s \in S\\ x\cdot s=1 \end{array}}\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s). \end{aligned} \end{aligned}$$

Hence,

$$\begin{aligned} (p-1)\chi _x(S)=\sum _{\begin{array}{c} s \in S \end{array}}\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s)=\sum _{i=1}^n\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s_i). \end{aligned}$$

Now by applying Eq. (6), we can get the equation

$$\begin{aligned} \displaystyle wt(c_x)=\frac{(p-1)(n-\chi _x(S))}{p}. \end{aligned}$$
(7)

The last equation implies that \(C_S\) is a three-weight code with non-zero weights

$$\begin{aligned} w_1= & {} \frac{(p-1)n}{p}, \\ w_2= & {} \frac{(p-1)(n-pm)}{p} \\ \end{aligned}$$

and

$$\begin{aligned} w_3=\frac{(p-1)(n+pm)}{p}. \end{aligned}$$

Now suppose \(C_S\) is a three-weight code with non-zero weights \(w_1=\frac{(p-1)n}{p}, w_2=w_1-m(p-1),\) and \(w_3=w_1+m(p-1)\). For a codeword \(c_x\) the following equation holds:

$$\begin{aligned} \sum _{i=1}^n\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s_i)=(p-1)n-pwt(c_x). \end{aligned}$$

Therefore, \(\chi _x(S)\) takes only the values \(\pm pm\) or 0. \(\square \)

Suppose S is a partial geometric difference set with parameters \((p^k,n=pr; \alpha , \beta )\) with \(S=-S\), \(e_G \notin S\) and no two elements of S are depended such that \(p^2m^2=\beta -\alpha \) for some integer m. In this case, note that the minimum weight of the dual code of \(C_S\) is at least 3. We will apply the well-known Pless power moments identities to get the weight distribution of \(C_S\).

$$\begin{aligned} \sum _{i=1}^3A_{w_i}&=p^k-1 \\ \quad \sum _{i=1}^3iA_{w_i}&=p^{k-1}(pn-n) \\ \quad \sum _{i=1}^3i^2A_{w_i}&=p^{k-2}((p-1)n(pn-n+1)) \end{aligned}$$

Hence, we will get

$$\begin{aligned} \begin{aligned} A_{w_1}&=-\frac{m^{2} p^{2} - m^{2} p - {\left( p^{2} - p\right) } r^{2} - {\left( m^{2} p^{2} - m^{2} p\right) } p^{k} + p^{k} r}{m^{2} p^{2} - m^{2} p}, \\ A_{w_2}&=-\frac{{\left( p^{2} - p\right) } r^{2} - {\left( m p^{2} - m p + p^{k}\right) } r}{2 \, {\left( m^{2} p^{2} - m^{2} p\right) }}, \\ A_{w_3}&=-\frac{{\left( p^{2} - p\right) } r^{2} + {\left( m p^{2} - m p + p^{k}\right) } r}{2 \, {\left( m^{2} p^{2} - m^{2} p\right) }}. \end{aligned} \end{aligned}$$
(8)

Corollary 3.3

Let p be a prime and let mt and \(k>1\) be positive integers. Suppose \(\Omega \) is a (pt)-subset of G satisfying \(e_G \notin \Omega \) and no two elements of \(\Omega \) are depended. \(C_{\Omega }\) is a three-weight code with non-zero weights \(w_1=(p-1)t,w_2=w_1-m\) and \(w_3=w_1+m\) if and only if \(S=\bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega \) is a partial geometric difference set with parameters \((p^k,pt(p-1); \alpha , \beta )\) such that \(p^2m^2=\beta -\alpha \).

The weight distribution of the code \(C_{\Omega }\) presented in Corollary 3.3, is provided in the following equations:

$$\begin{aligned} \begin{aligned} A_{w_1}=\frac{m^{2} p^{k + 1} - m^{2} p - {\left( p - 1\right) } p^{k} t + {\left( p^{3} - 2 \, p^{2} + p\right) } t^{2}}{m^{2} p}, \\ A_{w_2}=-\frac{{\left( p^{3} - 2 \, p^{2} + p\right) } t^{2} + {\left( m p^{2} - m p - {\left( p - 1\right) } p^{k}\right) } t}{2 \, m^{2} p}, \\ A_{w_3}=-\frac{{\left( p^{3} - 2 \, p^{2} + p\right) } t^{2} - {\left( m p^{2} - m p + {\left( p - 1\right) } p^{k}\right) } t}{2 \, m^{2} p}. \end{aligned} \end{aligned}$$
(9)

For \(S=\bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega \), the code \(C_S\) has the same weight distribution as the code \(C_{\Omega }\) with non-zero weights \(w_1=t(p-1)^2,w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1)\).

Theorem 3.4

Let p be a prime and let mn and \(k>1\) be positive integers. Suppose \(S=\Omega \cup \{e_G\} \) is a \((n+1)\)-subset of G with \(\frac{n+1}{p}\) is an integer and \(S=-S\). S is a partial geometric difference set with parameters \((p^k, n+1; \alpha , \beta )\) such that \(p^2m^2=\beta -\alpha \) if and only if \(C_\Omega \) is a three-weight p-ary code with non-zero weights \(w_1=\frac{(p-1)(n+1)}{p},w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1).\)

Proof

First suppose S is a partial geometric difference set with parameters \((p^k,n+1; \alpha , \beta )\) such that \(p^2m^2=\beta -\alpha \) for some integer m. For any non-principal character \(\chi _x\)

$$\begin{aligned} (p-1)(\chi _x(S)-1)=\sum _{\begin{array}{c} s \in \Omega \end{array}}\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s) \end{aligned}$$

Now by applying Eq. (6), we can get the equation

$$\begin{aligned} \displaystyle wt(c_x)=\frac{(p-1)(n-\chi _x(S)+1)}{p}. \end{aligned}$$
(10)

The last equation implies that \(C_{\Omega }\) is a three-weight code with non-zero weights

$$\begin{aligned} w_1= & {} \frac{(p-1)(n+1)}{p},\\ w_2= & {} \frac{(p-1)(n-pm+1)}{p} \end{aligned}$$

and

$$\begin{aligned} w_3=\frac{(p-1)(n+pm+1)}{p}. \end{aligned}$$

Now suppose \(C_{\Omega }\) is a three-weight code with non-zero weights \(w_1=\frac{(p-1)(n+1)}{p},w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1)\). For a codeword \(c_x\) the following equation holds:

$$\begin{aligned} \sum _{i=1}^n\sum _{\begin{array}{c} \gamma \in \mathbb {F}_p^* \end{array}}\chi _x(\gamma s_i)=(p-1)n-pwt(c_x). \end{aligned}$$

Therefore, \(\chi _x(S)\) takes only the values \(\pm pm\) or 0. \(\square \)

If no two vectors in \(\Omega \) are dependent then the weight distribution of the code \(C_{\Omega }\) is provided in the following equations:

$$\begin{aligned} \begin{aligned} A_{w_1}=-\frac{m^{2} p^{3} - m^{2} p^{2} + n^{2} - {\left( m^{2} p^{3} - m^{2} p^{2} - n - p + 1\right) } p^{k} - {\left( n^{2} + 2 \, n + 1\right) } p + 2 \, n + 1}{m^{2} p^{3} - m^{2} p^{2}}, \\ A_{w_2}=-\frac{{\left( m n + m\right) } p^{2} - n^{2} - {\left( m p^{2} - {\left( m - 1\right) } p + n - 1\right) } p^{k} - {\left( {\left( m - 2\right) } n - n^{2} + m - 1\right) } p - 2 \, n - 1}{2 \, {\left( m^{2} p^{3} - m^{2} p^{2}\right) }}, \\ A_{w_3}=\frac{{\left( m n + m\right) } p^{2} + n^{2} - {\left( m p^{2} - {\left( m + 1\right) } p - n + 1\right) } p^{k} - {\left( {\left( m + 2\right) } n + n^{2} + m + 1\right) } p + 2 \, n + 1}{2 \, {\left( m^{2} p^{3} - m^{2} p^{2}\right) }}. \end{aligned} \end{aligned}$$
(11)

Corollary 3.5

Let p be a prime and let mr and \(k>1\) be positive integers. Let \(\Omega \) be a r-subset of G such that \(e_G \notin \Omega \), \(t=\frac{r(p-1)+1}{p}\) is an integer and no two elements of \(\Omega \) are depended. \(C_{\Omega }\) is a three-weight p-ary code with non-zero weights \(w_1=t,w_2=w_1-m,\) and \(w_3=w_1+m\) if and only if \(S=\left( \bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega \right) \bigcup \{e_G\}\) is a partial geometric difference set with parameters \(\left( p^k,r(p-1)+1; \alpha , \beta \right) \) with \(p^2m^2=\beta -\alpha \).

The weight distribution of the code \(C_{\Omega }\) presented in Corollary 3.5, is given in the following equations:

$$\begin{aligned} \begin{aligned} A_{w_1}=\frac{m^{2} p^{k + 1} - m^{2} p + p t^{2} - p^{k} t}{m^{2} p}, \\ A_{w_2}=-\frac{p t^{2} - m p^{k} + {\left( m p - p^{k}\right) } t}{2 \, m^{2} p}, \\ A_{w_3}=-\frac{p t^{2} + m p^{k} - {\left( m p + p^{k}\right) } t}{2 \, m^{2} p}. \end{aligned} \end{aligned}$$
(12)

Let \(S=\bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega \). The code \(C_S\) has the same weight distribution as the code \(C_{\Omega }\) with non-zero weights \(w_1=(p-1)t,w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1)\).

Example 3.6

Let p be an odd prime and \(k>1\) be an odd integer and

$$\begin{aligned} S =\left\{ x \in \mathbb {F}_{p^k}^*: Tr(x^2) = 0\right\} . \end{aligned}$$

\(C_S\) is a three-weight code of length \(p^{k-1}-1\) with non-zero weights \(w_1=(p-1)p^{k-2},w_2=(p-1)\left( p^{k-2}-p^{\frac{k-3}{2}}\right) ,\) and \(w_3=(p-1)\left( p^{k-2}+p^{\frac{k-3}{2}}\right) .\) Let \(\Omega \) be the largest subset of \(\mathbb {F}_{p^k}^*\) satisfying \(x/y \notin \mathbb {F}_{p}^*\) for any \(x,y \in \Omega \). Then,

$$\begin{aligned} S=\bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega . \end{aligned}$$

The code \(C_{\Omega }\) is a three-weight code of length \(\frac{p^{k-1}-1}{p-1}\) with non-zero weights \(w_1=p^{k-2},w_2=p^{k-2}-p^{\frac{k-3}{2}},\) and \(w_3=p^{k-2}+p^{\frac{k-3}{2}}.\) This family of three-weight codes were first observed in the work of [19]. Since \(x/y \notin \mathbb {F}_{p}^*\) for any \(x,y \in \Omega \), no two elements of \(\Omega \) are depended. By applying Eq. (12), the weight distribution of the code \(C_S\) and \(C_{\Omega }\) can be calculated as

$$\begin{aligned} A_{w_1}= & {} p^{k-1}-1, \\ \displaystyle A_{w_2}= & {} \frac{p-1}{2}\left( p^{k-1}-p^{\frac{k-1}{2}}\right) , \\ \displaystyle A_{w_3}= & {} \frac{p-1}{2}\left( p^{k-1}+p^{\frac{k-1}{2}}\right) . \end{aligned}$$

Corollary 3.5 implies that the set \(D=\left( \bigcup _{\gamma \in \mathbb {F}_p^* } \gamma \Omega \right) \bigcup \{e_G\}\) is a partial geometric difference set with parameters \(\left( p^k,p^{k-1}; \alpha , \beta \right) \) such that \(p^{k-1}=\beta -\alpha \). By applying the principal character to Eq. (5), we can get the following equation:

$$\begin{aligned} p^{3k-3}=p^{2k-2}+\alpha p^k. \end{aligned}$$

Hence,

$$\begin{aligned} \alpha =p^{2k-3}-p^{k-2} \end{aligned}$$

and

$$\begin{aligned} \beta =p^{2k-3}-p^{k-2}+p^{k-1}. \end{aligned}$$

3.1 Some families of binary three-weight codes

In this section, we provide some examples of binary three-weight codes. One of our construction is associated with the plateaued functions and the other construction is obtained from almost bent functions.

Let V be the \((s+1)\)-dimensional vector space over \(\mathbb {F}_2\) and G be the additive group of V. Let us denote the identity element of \(e_G\) by \(\mathbf 0 \). Let f be a function from V to \(\mathbb {F}_2\) and F be the function \((-1)^f\) from V to the set \(\{-1,1\}\). The Fourier transform of F is defined by

$$\begin{aligned} \widehat{F}(x)=\sum _{y \in V_{s+1}}(-1)^{x\cdot y}F(x) \end{aligned}$$

for all \(a \in V\). We are interested in the set \(Spec=\left\{ \widehat{F}(x): x\in V \right\} \) of distinct values which we will call the Fourier spectrum of F.

Definition 3.7

f is called a plateaued function if the Fourier spectrum of \(F=(-1)^f\) is \(\{0,\pm 2^t\}\) for some integer \(t \ge \frac{s+1}{2}\).

In the work of [26], the author showed that the existence of a plateaued function f from V to \(\mathbb {F}_2\) with Fourier spectrum \(\{0,\pm 2^t\}\) is equivalent to existence of a partial geometric difference set in G with parameters \(\left( v=2^{s+1},k;\alpha ,\beta \right) \) satisfying \(\beta -\alpha =2^{2t-2}\) and \(k\in \{2^s,2^s\pm 2^{t-1}\}\).

Corollary 3.8

Let f be a plateaued function from V to \(\mathbb {F}_2\) satisfying \(f(\mathbf 0 )=1\). Let \(S=\{x \in V: f(x)=0\}.\) The code \(C_S\) is a three-weight code whose non-zero weights are provided in the Table 1.

Example 3.9

Let \(s+1\) be an odd integer. A plateaued function f with Fourier spectrum of \(\{0,\pm 2^{\frac{s+2}{2}}\}\) is called a semi-bent function. Let f be a semi-bent function satisfying \(f(\mathbf 0 )=1\) and \(\widehat{F}(\mathbf 0 )=0\). By applying the Corollary 3.8, we observe that the code \(C_S\) is a three-weight binary code with non-zero weights \(w_1=2^{s-1}, 2^{s-1}-2^{\frac{s-2}{2}}\) and \(2^{s-1}+2^{\frac{s+2}{2}}\). The weight distribution of this code can be obtained by applying the Eq. (8). Hence we get

$$\begin{aligned} A_{w_1}= & {} 2^s-1, \\ A_{w_2}= & {} 2^{s - 1} - 2^{\frac{s-2}{2}} \end{aligned}$$

and

$$\begin{aligned} A_{w_3}=2^{s - 1} + 2^{\frac{s-2}{2}}. \end{aligned}$$

Our results on three-weight codes and semi-bent functions coincide with the results of Ding [16].

Table 1 Non-zero weights of the code \(C_S\)

Next we introduce functions of our second interest. Let \(f: \mathbb {F}_2^s \rightarrow \mathbb {F}_2^s\) be any function. The Walsh transform \(W_f:\mathbb {F}_2^s \times \mathbb {F}_2^s \rightarrow \mathbb {R}\) defined by

$$\begin{aligned} W_f(a,b)=\sum _{x\in \mathbb {F}_2^s}(-1)^{a\cdot x}(-1)^{b\cdot f(x)}. \end{aligned}$$

Definition 3.10

A function f from \(\mathbb {F}_2^s\) to \(\mathbb {F}_2^s\) is called an almost bent if \(W_f(a,b)\in \left\{ \pm 2^{\frac{s+1}{2}},0\right\} \) for all \((a,b)\ne (0,0)\).

The following characterisation is provided in [11]. A function f is almost bent if and only if the system of equations

$$\begin{aligned} x + y + z&= a \\ f (x) + f (y) + f (z)&= b \end{aligned}$$

has \(2^s -2\) or \(3 \cdot 2^s -2\) solutions (xyz) for every (ab). If so, then the system has \(3 \cdot 2^s- 2\) solutions if \(b = f (a)\), and \(2^s-2\) solutions otherwise.

Next, we will provide a link between partial geometric designs and almost bent functions.

Theorem 3.11

Let f be a permutation on \(\mathbb {F}_2^s\). \(S=\left\{ (x,f(x)): x \in \mathbb {F}_2^s \right\} \) is a partial geometric difference set with parameters \(\left( v=2^{2s}, k=2^s; \alpha ,\beta \right) \) satisfying \(\beta -\alpha =2^{s+1}\) in the additive group of \(\mathbb {F}_2^{s}\times \mathbb {F}_2^{s}\) if and only if f is an almost bent function.

Proof

Suppose \(S=\{(x,f(x)): x \in \mathbb {F}_2^s \}\) is an partial geometric difference set with parameters \(v=2^{2s}\) and \(k=2^s\) and \(\beta -\alpha =2^{s+1}\) in the additive group of \(\mathbb {F}_2^{s}\times \mathbb {F}_2^{s}\). For any non-principal character \(\chi \) of \(\mathbb {F}_2^{s}\times \mathbb {F}_2^{s}\) we have either \(\chi (S)=\pm \sqrt{\beta -\alpha }\) or \(\chi (S)=0\). Here, any non-principal character \(\chi \) can be written as a product of characters \(\theta _a\) and \(\theta _b\) of the additive group of \(\mathbb {F}_2^{s}\) for some \(a,b \in \mathbb {F}_2^{s}\). Note that if one of a or b is \(\mathbf 0 \) then \(\chi (S)=0\). Note also that if both a and b are non-zero vectors

$$\begin{aligned} \begin{aligned} \chi (S)&= \sum _{x\in \mathbb {F}_2^{s} }\theta _a(x)\theta _b(f(x)) \\&=\sum _{x\in \mathbb {F}_2^{s} }(-1)^{a\cdot x}(-1)^{b\cdot f(x)} \\&=W_f(a,b) \end{aligned} \end{aligned}$$

Therefore, f is an almost bent function. Now assume f is an almost bent function. Thus,

$$\begin{aligned}&|\{((x,f(x)),(y,f(y)),(z,f(z)))\in S\times S \times S: (a,b)\\&\quad =(x+y+z,f(x)+f(y)+f(z))\}| \end{aligned}$$

is \(3 \cdot 2^s-2\) when \((a,b) \in S\), \(2^s-2\) otherwise. This implies S is a partial geometric difference set with parameters \(v=2^{2s}\) and \(k=2^s\) and \(\beta -\alpha =2^{s+1}\) in \(\mathbb {F}_2^{s}\times \mathbb {F}_2^{s}\). \(\square \)

Corollary 3.12

Let s be a positive odd integer and f be an almost bent function from \(\mathbb {F}_2^s\) to \(\mathbb {F}_2^s\) which is a permutation on \(\mathbb {F}_2^s\) satisfying \(f(\mathbf 0 )=\mathbf 0 \). Let \(\Omega \) be the set \(\left\{ (x,f(x)): x \in \mathbb {F}_2^s \right\} \setminus \left\{ (\mathbf 0 ,\mathbf 0 )\right\} \). Then, \(C_{\Omega }\) is a three-weight code with non-zero weights \(w_1=2^{s-1}, w_2=2^{s-1}-2^{\frac{s-1}{2}}\) and \(w_3=2^{s-1}+2^{\frac{s-1}{2}}.\)

Example 3.13

Let s be a positive odd integer. It was first observed in [8], that permutations \(f(x)=x^{2^{i}+1}\) of \(\mathbb {F}_{2^s}\) is almost bent for any i such that i is co-prime with s. For example, let \(s=5\) and \(f(x)=x^3\). The set \(S=\left\{ (x,x^3): x \in \mathbb {F}_{2^5} \right\} \) is a partial geometric difference set in the additive group G of \(\mathbb {F}_{2^5}\times \mathbb {F}_{2^5}\) with parameters \(v=2^{10}, k=2^5\) \(\beta -\alpha =2^6\). By Corollary 3.12, the code \(C_{\Omega }\) is a three-weight code of length 31 with non-zero weights \(w_1=16, w_2=12\) and \(w_3=20\). By applying Eq. (11), we can get the weight distribution of the code \(C_{\Omega }\) as \(A_{w_1}=527, A_{w_2}=310\) and \(A_{w_3}=186\).

4 Graphs associated with partial geometric designs

In this section, we are interested in the graphs associated with the three-weight codes and partial geometric difference sets (which are not difference sets) presented in the previous section.

An undirected graph is an ordered pair \(\Gamma = (V, E)\), comprising a set V of vertices together with a set E of edges, which are 2-element subsets of V. A graph is said to be connected if there is a path from a vertex to any other vertex. The adjacency matrix A of \(\Gamma \) is the square matrix of order |V|, whose entries are \(a_{ij}=1\) or 0 according as the i-th vertex and j-th vertex are adjacent or not. A graph is k-regular if there is a positive integer k such hat the adjacency matrix satisfies the equations

$$\begin{aligned} AJ=JA=kJ. \end{aligned}$$

In this section, we are interested in k-regular connected graphs.

Let S be a partial geometric difference set with parameters \((v, k; \alpha , \beta )\) in an additive group G satisfying \(S=-S\) and \(e_G \notin S\), Cayley graph of G with respect to the set S, denoted Cay(GS), is the graph with vertex set G where the vertices v and w are adjacent if and only if \(w-v \in S\). The following equation holds in the group ring:

$$\begin{aligned} \mathcal {S}^3=(\beta -\alpha )\mathcal {S}+\alpha \mathcal {G}. \end{aligned}$$
(13)

The coefficient of g in \(\mathcal {S}^3\) counts the number of paths of length 3 from \(e_G\) to g in Cay(GS). Thus, the number of paths of length 3 between two vertices depends only on whether the vertices are adjacent or not. Equation (13), implies that the adjacency matrix A of Cay(GS) satisfies the equation:

$$\begin{aligned} A^3= (\beta -\alpha )A+\alpha J. \end{aligned}$$
(14)

Here, note that if adjacency matrix of an undirected graph satisfies the Eq. (14), then there exists a partial geometric design with \(v=b\). This is done by considering the adjacency matrix of the graph \(\Gamma =(V,E)\) as the incidence matrix of a design. The set of points P of the design is the set of vertices V and \(\mathcal {B}=\{B_x: x \in V \}\) where \(B_x=\{y: a_{xy}=1\}\). In the reference number [24], the author, Nowak and Song search for such graphs to generate new examples of partial geometric designs. Their search revealed that certain three-class association schemes are good sources of these graphs. Next we will introduce the certain graphs that are associated with three-weight codes and ternary weakly regular bent functions.

Definition 4.1

A k-regular undirected graph with v vertices is called a \((v,k; \alpha , \beta )\)-graph if its adjacency matrix satisfies the equation

$$\begin{aligned} A^3= (\beta -\alpha )A+\alpha J \end{aligned}$$

for some integers \(\beta>\alpha >0.\)

We note that notion of \((v,k; \alpha , \beta )\)-graphs are a natural generalization of strongly regular graphs.

Proposition 4.2

Let \(\Gamma \) be a \((v,k; \alpha , \beta )\)-graph. Parameters \(k, \alpha \) and \(\beta \) satisfy the equation

$$\begin{aligned}\beta -\alpha < k^2.\end{aligned}$$

Lemma 4.3

Let A be the adjacency matrix of \((v,k; \alpha , \beta )\). Then, the matrix \(A^2\) has eigenvalues \(k^2\), \(\beta -\alpha \) and 0, with multiplicities 1, \(\displaystyle \frac{vk-k^2}{\beta -\alpha }\) and \(\displaystyle v-1-\frac{vk-k^2}{\beta -\alpha }\), respectively.

Proof

Since A satisfies the Eq. (14), the following equation holds:

$$\begin{aligned} A^2A^2=(\beta -\alpha )A^2+\alpha kJ. \end{aligned}$$

Note that \(A^2\) is a symmetric matrix and commutes the all-ones matrix J. Thus, the eigenvalues of \(A^2\) are \(k^2\), \(\beta -\alpha \) and 0. Let \(m_1\), \(m_2\) and \(m_3\) be the multiplicities of eigenvalues \(k^2\), \(\beta -\alpha \) and 0, respectively. Then, it is clear that \(m_1=1\). Since \(\text{ trace }(A^2)=vk\), we have

$$\begin{aligned} vk=1\cdot k^2+m_2 \cdot (\beta -\alpha ). \end{aligned}$$

Hence, \(\displaystyle m_2=\frac{vk-k^2}{\beta -\alpha }\) and \(\displaystyle m_3=v-1-\frac{vk-k^2}{\beta -\alpha }\). \(\square \)

Corollary 4.4

If \(\Gamma \) is a \((v,k,\alpha ,\beta )\)-graph which is neither a strongly regular graph nor a complete graph, then \(\Gamma \) has 4 distinct eigenvalues.

Proof

Let A be the adjacency matrix of \(\Gamma \). The eigenvalues \(k^2\), \(\beta -\alpha \) and 0 of the matrix \(A^2\) must be the squares of eigenvalues of A. Hence, possible eigenvalues of A are \(\pm k\), \(\pm \sqrt{\beta -\alpha }\) and 0. Since \(\beta -\alpha <k^2\) and \(\beta >0\), \(\Gamma \) cannot be a bipartite graph. Thus \(-k\) is not an eigenvalue of \(\Gamma \). Also note that since \(\Gamma \) is not a strongly regular graph or a complete graph, it cannot have 2 or 3 distinct eigenvalues. This completes the proof. \(\square \)

Corollary 4.5

Let p be a prime and let mn and \(k>1\) be positive integers. Let G be the additive group of \(\mathbb {F}_p^n\). Suppose S is a k-subset of G satisfying \(S=-S\), \(e_G \notin S\) . If \(C_S\) is a three-weight p-ary code with non-zero weights \(w_1=\frac{(p-1)k}{p},w_2=w_1-m(p-1)\) and \(w_3=w_1+m(p-1)\) then Cay(GS) is a \((p^n,k; \alpha ,\beta )\)-graph with 4 distinct eigenvalues.

Proof

Let \(G=\{v_1, v_2, \ldots , v_{p^n}\}\) and A be the adjacency matrix of Cay(GS). For each \(w \in G\) let \(\chi _w\) be the associated group character. We define a vector \(\left( X_w \right) _i = \chi _w(v_i)\). Then,

$$\begin{aligned} (AX_w)_j=\sum _i a_{ij} \chi _w(v_i)=\sum _{v_j-v_i \in S} \chi _w(v_i)= \sum _{s \in S} \chi _w(s+v_j)=\left( \sum _{s \in S} \chi _w(s)\right) \left( X_w \right) _j . \end{aligned}$$

Therefore, we have the complete set of eigenvectors associated with eigenvalues \(k, \sqrt{\beta - \alpha }, 0\) and \(-\sqrt{\beta - \alpha }\). \(\square \)

Proposition 4.6

Let \(\Gamma \) be a connected k-regular graph with v vertices. If \(\Gamma \) has 4 distinct eigenvalues k, \(\pm \sqrt{\beta -\alpha }\) and 0 for some integers \(\beta>\alpha >0\), then \(\Gamma \) is a \((v,k,\alpha ,\beta )\)-graph.

Proof

Let A be the adjacency matrix of \(\Gamma \). Define

$$\begin{aligned} \displaystyle M=\frac{A\left( A^2-(\beta -\alpha )I\right) }{k\left( k^2-\beta +\alpha \right) }. \end{aligned}$$

Observe that eigenvalues of M are either 0 or 1 , sum of entries in each row of M is 1 and rank of M is 1. Hence, \(M=\frac{1}{v}J\). This implies \(A^3\) is a linear combination of A and J. \(\square \)

4.1 A construction from ternary bent functions

For a prime p, we define a primitive complex p-th root of unity \(\zeta _p=e^{\frac{2\pi }{p}}\). Let f be a function from the field \(\mathbb {F}_{p^{n}}\) to \(\mathbb {F}_p\). The Walsh transform of f is defined as follows:

$$\begin{aligned} \displaystyle W_f(\mu )=\sum _{x\in \mathbb {F}_{p^{n}}} \zeta _p^{f(x)+Tr(\mu x)},~~~\mu \in \mathbb {F}_{p^{n}} \end{aligned}$$

where Tr is the absolute trace function from \(\mathbb {F}_{p^{n}}\) to \(\mathbb {F}_p\). A function from \(\mathbb {F}_{p^{n}}\) to \(\mathbb {F}_p\) is called a p-ary bent function if every Walsh coefficient has magnitude \(p^{\frac{n}{2}}\).

Lemma 4.7

Let f be a function from the field \(\mathbb {F}_{p^{n}}\) to \(\mathbb {F}_{p^{n}}\). \(R=\{(x,f(x)): x\in \mathbb {F}_{p^{n}} \}\) is a \((p^n,p,p^n,p^{n -1})\)-relative difference set in \(H=\mathbb {F}_{p^{n}}\times \mathbb {F}_{p}\) if and only if f is p-ary bent.

Remark 4.8

Any non-principal character \(\chi \) of the additive group of \(\mathbb {F}_{p^{n}}\times \mathbb {F}_p\) satisfies \(|\chi (R)|^2=p^n\) or 0. This observation reveals that the relative difference set R in the above lemma is a partial geometric difference set.

One can obtain a p-ary bent function in the form of \(f(x)=Tr(\gamma P(x))\) from a planar function P and \(\gamma \ne 0\). A function P from \(\mathbb {F}_{p^{n}}\) to \(\mathbb {F}_p\) is called planar if all mappings \(x\mapsto P(x+a)-P(x)\) are bijective for all \(a\ne 0\). It is established in the work of Feng and Luo that the following holds for f:

$$\begin{aligned} W_f(\mu )=\epsilon _{\gamma ,\mu }\sqrt{p^{*}}^{n}, ~~~ \epsilon _{\gamma ,\mu }\in W^{+} \cup W^{-}, ~~~ \epsilon _{\gamma ,0} \cdot \epsilon _{\gamma ,\mu } \in W^{+}. \end{aligned}$$

where \(\epsilon _{\gamma ,0} \in \{\pm 1\}\), \(W^{+}=\left\{ \zeta _p^i: 0\le i \le p-1\right\} \) and \(W^{-}=\left\{ -\zeta _p^i: 0\le i \le p-1\right\} \) [21].

Let G be the additive group of \(\mathbb {F}_{3^{2s+1}}\) for \(s\ge 1\) and \(D_i=\{x: f(x)=i\}\) for \(i=0,1,2\). Suppose also that \(f(x)=f(-x)\) and \(f(0)=0\). Our goal is to show that Cayley graphs generated by the sets \(D_1\) and \(D_2\) are \((v,k;\alpha ,\beta )\)-graphs. Hence, we will conclude that \(D_1\) and \(D_2\) are partial geometric difference sets in G.

Lemma 4.9

\(Cay(G,D_1)\) and \(Cay(G,D_2)\) are \(\Big (v=3^{2s+1}, k=3^{2s}+\epsilon _{\gamma ,0}\cdot 3^s; \alpha =\left( 3^{2s-1}+\epsilon _{\gamma ,0}\cdot 3^{s-1}\right) \left( 3^{2s}+2\epsilon _{\gamma ,0}\cdot 3^s \right) ,\beta =\alpha +3^{2s}\Big )\)-graph and \(\Big (v=3^{2s+1}, k=3^{2s}-\epsilon _{\gamma ,0}\cdot 3^s; \alpha =\left( 3^{2s-1}-\epsilon _{\gamma ,0}\cdot 3^{s-1}\right) \left( 3^{2s}-2\epsilon _{\gamma ,0}\cdot 3^s \right) ,\beta =\alpha +3^{2s}\Big )\)-graph, respectively.

Proof

First by Lemma 4.7 we have that \(R=\{(x,f(x)): x\in \mathbb {F}_{3^{2s+1}}\}\) is a relative difference set in \(H=\mathbb {F}_{3^{2s+1}}\times \mathbb {F}_{3}\). Let \(\chi _\mu \) be a character of the additive group of \(\mathbb {F}_{3^{2s+1}}\) and \(\nu \) be the character of \(\mathbb {F}_{3}\) that maps 1 to \(\zeta _3\). Thus, we have that

$$\begin{aligned} (\chi _{\mu },\nu )(R)=W_f(\mu )=\chi _{\mu }(D_0)+\chi _{\mu }(D_1)\zeta _3+\chi _{\mu }(D_0)\zeta _3^2. \end{aligned}$$

This implies

$$\begin{aligned} W_f(0)=\left( 3^{2s+1}-|D_1|-2|D_2|\right) +\left( |D_1|-|D_2|\right) \zeta _3. \end{aligned}$$

We also have that \(W_f(0)=i\sqrt{3}3^s\) or \(W_f(0)=-i\sqrt{3}3^s\). Therefore, we have two systems of equations,

$$\begin{aligned} {\left\{ \begin{array}{ll} \frac{3|D_2|}{2}+\frac{3|D_1|}{2}=3^{2s+1}\\ -\frac{|D_2|}{2}+\frac{|D_1|}{2}=3^{s} \end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} {\left\{ \begin{array}{ll} \frac{3|D_2|}{2}+\frac{3|D_1|}{2}=3^{2s+1}\\ \frac{|D_2|}{2}-\frac{|D_1|}{2}=3^{s}. \end{array}\right. } \end{aligned}$$

The solutions of these systems are

$$\begin{aligned} |D_1|=3^{2s}+3^s,~~~|D_2|=3^{2s}-3^s \end{aligned}$$

and

$$\begin{aligned} |D_1|=3^{2s}-3^s,~~~|D_2|=3^{2s}+3^s. \end{aligned}$$

We note that \(|(\chi _{\mu },\nu )(R)|^2=3^{2s+1}\) and \(\overline{\chi _{\mu }(D_i^{-1})}=\chi _{\mu }(D_i)\). Hence,

$$\begin{aligned} \chi _{\mu }(D_1)^2+\chi _{\mu }(D_2)^2+\chi _{\mu }(D_1)\chi _{\mu }(D_2)=3^{2s}. \end{aligned}$$

Since only integer solutions of the equation

$$\begin{aligned} x^2+y^2+xy=3^{2s} \end{aligned}$$

are \((\pm 3^s,0)\), \((0,\pm 3^s)\) and \((\pm 3^s,\mp 3^s)\), \((\chi _{\mu }(D_1),\chi _{\mu }(D_2))\) can only take values \((\pm 3^s,0)\), \((0,\pm 3^s)\) and \((\pm 3^s,\mp 3^s)\). This allows us to conclude that

$$\begin{aligned} (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (3^s,0):\quad \quad W_f(\mu )=-i\sqrt{3}3^s\zeta _3^2 \\ (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (0,-3^s):\quad \quad W_f(\mu )=-i\sqrt{3}3^s\zeta _3 \\ (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (-3^s,3^s):\quad \quad W_f(\mu )=-i\sqrt{3}3^s \\ (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (-3^s,0):\quad \quad W_f(\mu )=i\sqrt{3}3^s\zeta _3^2 \\ (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (0,3^s):\quad \quad W_f(\mu )=i\sqrt{3}3^s\zeta _3 \\ (\chi _{\mu }(D_1),\chi _{\mu }(D_2))= & {} (3^s,-3^s):\quad \quad W_f(\mu )=i\sqrt{3}3^s. \end{aligned}$$

We also know that \(W_f(\mu )=i\epsilon _{\gamma ,\mu }\sqrt{3}3^s\). If \(\epsilon _{\gamma ,0}=-1\) then \(\epsilon _{\gamma ,\mu } \in W^{-}\). Thus, in the case \(\epsilon _{\gamma ,0}=-1\), \(\chi _{\mu }(D_1)\) and \(\chi _{\mu }(D_2)\) can only take values \(\pm 3^s\) and 0. We also note that \(|D_1|=3^{2s}-3^s\) and \(|D_2|=3^{2s}+3^s\). Similar idea works for the case \(\epsilon _{\gamma ,0}=1\). This completes the proof. \(\square \)

Lemma 4.10

Disjoint union of the graphs \(Cay(G,D_1)\) and \(Cay(G,D_2)\) is a \(\big (v=3^{2s+1},k=2\cdot 3^{2s},\alpha =2\left( 4\cdot 3^{4s-1}-3^{2s-1}\big ), \beta =\alpha +3^{2s}\right) \)-graph.

Proof

We want to show that \(\chi _{\mu }((D_1+D_2))^2\) takes only the values \(3^{2s}\) and 0. We consider the case \(\epsilon _{\gamma ,0}=-1\) but similar calculations work for the case \(\epsilon _{\gamma ,0}=1\) too. First observe that

$$\begin{aligned} \chi _{\mu }((D_1+D_2))^2=\chi _{\mu }(D_1)^2+\chi _{\mu }(D_2)^2+2\chi _{\mu }(D_1)\chi _{\mu }(D_2). \end{aligned}$$

Since we have \((\chi _{\mu }(D_1),\chi _{\mu }(D_2))=(3^s,0)\), \((\chi _{\mu }(D_1),\chi _{\mu }(D_2))=(0,-3^s)\) and \((\chi _{\mu }(D_1),\chi _{\mu }(D_2))=(-3^s, 3^s)\), \(\chi _{\mu }((D_1+D_2))\) takes only the values \(\pm 3^s\) and 0. \(\square \)

Corollary 4.11

\(Cay(G,D_0\setminus \{0\})\) has 4 distinct eigenvalues namely \(3^s\), \(-1\), \(3^s-1\) and \(-3^s-1\).

In the work of Tan et al. [28], a link between strongly regular graphs obtained from Cayley graphs in the additive group of \(\mathbb {F}_{3^{2s}}\) and weakly regular ternary bent functions is established. Our result is a natural extension in odd dimension and provides a link between these functions and \((v,k; \alpha , \beta )\)-graphs.

It is reported that weakly regular bent functions can be used in the construction process of three-weight codes in the reference [29]. Our characterisation of ternary weakly regular bent functions also yields a similar construction of three-weight codes. For example, \(D_0= \Omega \bigcup \{0\}\) is a partial geometric difference set such that for any non-principal character \(\chi \), \(\chi (S)\) takes only the values \(\pm 3^s\) and 0. Hence by Theorem 3.4, the code \(C_{\Omega }\) is a ternary three-weight code with non-zero weights \(w_1=2\cdot 3^{2s-1}\), \(w_2=2\cdot \left( 3^{2s-1}-3^{s-1}\right) \) and \(w_3=2\cdot \left( 3^{2s-1}+3^{s-1}\right) .\)