Three-weight codes over rings and strongly walk regular graphs

We construct strongly walk-regular graphs as coset graphs of the duals of codes with three non-zero homogeneous weights over $\mathbb{Z}_{p^m},$ for $p$ a prime, and more generally over chain rings of depth $m$, and with a residue field of size $q$, a prime power. Infinite families of examples are built from Kerdock and generalized Teichm\"uller codes. As a byproduct, we give an alternative proof that the Kerdock code is nonlinear.


Introduction
Since the seminal article of Delsarte [12], there is a well-known interplay between two-weight codes and strongly regular graphs (SRG) via the coset graph of the dual code [2,3]. Strongly walk-regular graphs (SWRG) were introduced in [11] as a generalization of strongly regular graphs. Instead of a regularity condition bearing on paths of length 2, the notion of SWRG demands a regularity on paths of length s > 1. Specifically, a graph is s-SWRG if there are three integers (λ, µ, ν) such that the number of paths of length s between any two vertices x and y is • λ if x and y are connected; • µ if x and y are disconnected; This is reminiscent of strongly regular graph (SRG) a regular graph on ν vertices such that the number of paths of length 2 between any two vertices x and y is • λ if x and y are connected; • µ if x and y are disconnected; Note that, by definition, strongly regular graph are s-SWRG for all s > 1. In a previous paper [38], the authors connected together the two notions of triple sum sets (TSS) and SWRG over finite fields. In the present paper we extend this correspondence to a correspondence between TSS's over certain finite rings and SWRG's via the notions of syndrome graphs and homogeneous weights. This leads us to study the sum of the weights of three-weight codes. The first class of rings we consider is that of Z p m , for p a prime, when the homogeneous weight can described explicitly. Building on the study in [36], we give a sufficient condition to construct SWRGs from the dual code of a three-weight code. This condition bears on the sum of the three weights in question. In concrete examples, we focus on Z 4 -codes which have been studied extensively since [20]. The Gray map, which preserves MacWilliams duality, allows us to write the four Pless power moments for the binary image code, and to classify the relevant three-weight codes in short length. Further, a class of irreducible cyclic codes [41] related to the Kerdock code [20] gives an alternative proof of the nonlinearity of the binary Kerdock code. The second class of rings considered is that of chain rings of given depth and residue field. The p-ary three-weight codes introduced in [37], and the generalized Teichmüller codes of [25] provide infinite families of three-weight codes leading to SWRG's.
The material is organized as follows. The next section collects some prerequisite on, successively, homogeneous weights, triple sum sets, and coset graphs of codes over rings. Section 3 derives the main results. Section 4 focuses on Z 4 codes and gives examples in short lengths as well as an infinite family related to the Kerdock codes. Section 5 describes how the main results extend when the alphabet is a finite chain ring, and gives an infinite family related to generalized Teichmüller codes.

Homogeneous weight
For simplicity, let R be a finite commutative ring. A linear code C over R of length n is an R-submodule of the standard R-module R n . The dual code of C is defined as C ⊥ = {x ∈ R n x · C = 0}, where x · y = x 1 y 1 + · · · + x n y n denotes the standard inner product on R n . Definition 1. Let R be a finite ring. A function w : R → R is called a homogeneous weight, if w(0) = 0 and 1. if Rx = Ry then w(x) = w(y) for all x, y ∈ R; 2. there exists a real number γ = 0 such that y∈Rx w(y) = γ|Rx| for all x ∈ R \ {0}.
It is known from the work in [9,17,23] that a homogeneous weight exists for all finite commutative rings R, and is uniquely determined up to the normalization factor γ. In the sequel we will denote the homogeneous weight by w hom , assuming that γ has been fixed. As usual we extend w hom to a weight function on R n by The set R n then forms a metric space under the homogeneous distance d hom defined by d hom (x, y) = w hom (x − y). A code C ⊆ R n is called a (homogeneous) three-weight code with weights w 1 < w 2 < w 3 if every non-zero codeword has homogeneous weight w 1 , w 2 , or w 3 , and the three weights actually occur. If the code C is linear then on C × C the homogeneous distance takes only these three values and zero.
A matrix G ∈ R ℓ×n is called a generator matrix of the linear code C if the rows of G generate C as an R-module.
. The code C is called: 3. projective if Rg i = Rg j for any pair of distinct coordinates i, j ∈ {1, . . . , n}.
In other words, a code is regular if every column contains at least one unit element. We extend this notion also to a single column vector.
In the sequel we shall be interested mostly in the case R = Z p m , the ring of integers modulo a prime power p m . In this case the homogeneous weight is given by The chosen normalization constant is γ = (p − 1)p m−2 , which is the most convenient for our purposes. For m ≥ 2 the homogeneous weight is always an integer. Note that every code C over R = Z p m is proper, while there are some non-proper chain rings. Moreover, a code that is regular and projective iff the minimum distance d ⊥ of its dual code is at least (2p − 1) · p m−2 . 1 So, for p = m = 2 regular and projective is equivalent to d ⊥ ≥ 3.

Triple sum and s-sum sets
We extend the definition of triple sum sets given in [10] from finite fields to finite commutative rings R with a unit group R × . The set Ω ⊆ R k is a triple sum set (TSS) if it is stable by scalar multiplication by units ∈ R × and if there are integer constants σ 0 and σ 1 such that a non-zero h ∈ R k can be written as 1 The support of a dual codeword that is not excluded by the conditions regular and projective has cardinality at least three, so that the weight is strictly larger than 2(p − 1)p m−2 , i.e., at least This can generalized immediately to the notion of an s-sum set by replacing the

Syndrome graph
An eigenvalue of a graph Γ (i.e., an eigenvalue of its adjacency matrix) is called a restricted eigenvalue if there is a corresponding eigenvector which is not a multiple of the all-one vector 1. Note that for an η-regular connected graph, the restricted eigenvalues are simply the eigenvalues different from η. Definition 3. Let T be a finite abelian group and S ⊆ T a subset satisfying S = −S and 0 T / ∈ S. The corresponding Cayley graph C(T, S) has vertex set equal to T ; two vertices g, h ∈ T are adjacent in C(T, S) iff g − h ∈ S.
The conditions imposed on S ensure that C(T, S) is a simple graph. The graph C(T, S) is regular of degree |S|, and it is connected iff S generates the group T . We use the same idea as in [6] to associate with any linear code C over Z p m a certain Cayley graph, called the syndrome graph of C and denoted by Γ(C).
Let H = [h 1 | · · · | h n ] ∈ (Z p m ) ℓ×n be a parity-check matrix of C. The vertex set of Γ(C) is V = Hx; x ∈ (Z p m ) n , the column space of H, which is isomorphic to the dual code C ⊥ . The elements of V are called syndromes of C. Two syndromes Hx, Hy are adjacent in Γ(C) if they differ by a unit-multiple of a column of H : It is obvious that Γ(C) is the Cayley graph of V corresponding to the generating Since 0 / ∈ S and −S ⊆ S, Γ(C) is simple. Moreover, Γ(C) is regular of degree |S| = p m−1 (p − 1)n and has p mn |C| vertices. The latter follows from |C| C ⊥ = |(Z p m ) n | = p mn .
As defined, Γ(C) depends on the particular choice of H. The terminology "syndrome graph of C" is justified, however, since Γ(C) has another representation as a "coset graph" of C, which shows that its isomorphism type is determined by C. It is well-known that there is a one-to-one correspondence between syndromes of a code and its cosets [30], given by x + C → Hx. The condition in (1) can be restated as H(x − y − ue i ) = 0, where e i denotes the ith standard unit vector in (Z p m ) n . Thus Γ(C) is isomorphic to the graph whose vertices are the cosets of C and in which two vertices x + C, y + C are adjacent if their difference is a coset of the form ue i + C. This is the Cayley graph of the quotient group (Z p m ) n /C with generating set S * = {a + C; ∃i such that a i = u ∈ Z × p m and a j = 0 for j = i}. Now, we recall the relation between the weight distribution of a linear code over Z p m and the eigenvalues of the syndrome graph of its dual code. This extension of Lemma 3.4 in [6] was derived in [36] Theorem 4.1 and its proof is omitted here.
Theorem 1. Suppose that C is a regular, projective linear code over Z p m with homogeneous weights w i and corresponding weight distribution The coset graph with b loops Γ b C of a code C is obtained from Γ C by adding b loops around every vertex. The following result is immediate from the previous theorem. The proof is omitted.
Thus A i is the frequency of the homogeneous weight i in C ⊥ and the multiplicity of the eigenvalue b + n(p − 1)p m−1 − pi.

Main Results
Let R k denote the set of all regular vectors in R k , i.e., If Ω ⊆ R k , we denote by C(Ω) the regular and projective code of length n = |Ω| |R|−1 obtained as the kernel of the k × n matrix H with columns the projectively nonequivalent nonzero elements of Ω. Thus H is the check matrix of C(Ω). To simplify notation, let Γ C(Ω) = Γ(Ω) and Γ b C(Ω) = Γ(Ω) b , where we also write Γ(Ω) 0 for Γ(Ω). The following result is immediate from the definitions in the introduction, and will be used repeatedly and implicitly in the rest of the paper.

Theorem 2. The following are equivalent
• Ω (resp Ω 0) is an s-sum set, Proof. Observe that Γ(Ω) is a Cayley graph on the group (R k , +) with generators the columns of H. Thus the definition of an s-sum set can be regarded as a statement on the number of paths of length s between 0 and a column h of H.
The following result comes from the well-known connection between SRGs and two-weight codes. It is described for codes over fields in [2,3], and for codes over rings in [5].
Theorem 3. If C(Ω) ⊥ is a two-weight code, then both Ω 0 and Ω are s-sum sets for all s > 1.
Proof. If C(Ω) ⊥ is a two-weight code, it is well-known that Γ(Ω) is an SRG [5]. The result follows by Theorem 2, and the observation, made in the introduction, that SRGs are s-SWRG for all s > 1.
The following result was observed in [19] Theorem III.6.

Theorem 4.
If Ω or Ω 0 is an s-sum sets, then C(Ω) ⊥ has at most three nonzero weights. Furthermore, if s is even, then C(Ω) ⊥ is an s-weight code.
We come to the coding-theoretic characterization of 3-sum sets which is contained for finite fields in [10, Th. 2.1]. The consideration of syndrome graphs with loops might seem artificial but is justified by the existence of several non-trivial examples, as evidenced by Section 4.
The relation with the 3-SWRG property and the eigenvalues of a connected regular graph was obtained in [11] Proposition 4.1: In our setting the formulas for the eigenvalues in Theorem 1 and Corollary 1 give: Theorem 6. Assume that C(Ω) ⊥ is of length n and has three nonzero weights w 1 < w 2 < w 3 . Let b be any non-negative integer.
• Ω is a TSS iff w 1 + w 2 + w 3 = 3n(p − 1)p m−2 ; • Ω 0 is a TSS iff Proof. For the first two cases we apply Theorem 2 to conclude the equivalence to Γ b C(Ω) being a 3-SWRG for b = 0 and b = 1, respectively. Combining Corollary 1 with Theorem 5 gives the third case, which contains the first two cases for b = 0 and b = 1, respectively.
Note that if m ≥ 2 and p = 3, then the second case of Theorem 6 is impossible. More generally, for the third case of Theorem 6 the assumptions m ≥ 2 and p = 3 imply that b has to be divisible by p. Then, the condition may be rewritten as Example 1: If p = m = 2 and n = 4, then the possible triples of weights in the first case of Theorem 6 are, with obvious notation, {345, 246, 156, 237, 147, 138}. We will see in Subsection 4.2 that none of these possibilities can be attained by a Z 4 -code and the smallest possible length for p = m = 2 and b = 0 is indeed n = 6. Proposition 4.3 in [11] gives an explicit diophantine equation bearing on the eigenvalues of Γ to be an s-SWRG: Theorem 7. Let Γ be a connected regular graph with four distinct eigenvalues k > θ 1 > θ 2 > θ 3 and s ≥ 3. Then Γ is an s-SWRG iff We remark that for s = 3 Equation (2) , Theorem 5 is contained as a special case. Similar as in the proof of Theorem 6, we can use the formulas for the eigenvalues in Theorem 1 and Corollary 1 to transfer [11,Proposition 4.3] to s-sum sets: Theorem 8. Assume that C(Ω) ⊥ is of length n and has three nonzero weights w 1 < w 2 < w 3 . Let b ≥ 0 and s ≥ 3 be integers.
• Note that w 2 = 12 = n in all cases. This can be partially explained by the fact that Equation (2) admits the solution θ 2 = 0, θ 1 = −θ 3 for all odd s. In other words, a graph Γ with these eigenvalues is an s-SWRG for all odd s > 1, cf. [11,Proposition 4.2]. Using Theorem 2 and Theorem 1 we can transfer this observation to a result that is new in the context of s-sum sets: Theorem 9. Assume that C(Ω) ⊥ is of length n and has three nonzero weights Then Ω is an s-sum set for all odd s > 1.
If we are not in the situation of Theorem 9, then any given code can yield an s-sum set for at most one value of s. There are other solutions of Equation (2), e.g.
)) for s = 5. However, the found solutions are nonintegral and no graph that is an s-SWRG and attains these eigenvalues is known, see [11, p. 808]. Since the eigenvalues corresponding to an s-sum set are integral, we state: At least for the special case p = m = 2, i.e., Z 4 -codes, Conjecture 1 seems to be true also for s = 3, see Conjecture 2 in Section 4. In [8] it has been shown that all s-sum sets of a special type also have to be 3-sum sets.

Z -codes
Here we consider Z 4 linear codes and assume that the reader is familiar with [20]. When we say that C is an [n, k] code, where k = (k 1 , k 2 ) is the shape, this means that C is a linear code over Z 4 of effective length n, which admits a generator matrix of the form where I k 1 and I k 2 denote the k 1 × k 1 and k 2 × k 2 identity matrices, respectively, A and D are 0, 1-matrices (Z 2 -matrices), and B is a Z 4 matrix. We assume that the stated generator matrix consists of n columns (and k 1 +k 2 rows), so that the condition effective length n is equivalent to the property that the generator matrix does not contain an all-zero vector 0 as a column. The code size, i.e., the number of codewords, is given by #C = 4 k 1 · 2 k 2 = 2 2k 1 +k 2 . For Z 4 -codes we note that the homogeneous weight coincides with the Lee weight.
We note the following compatibility between a Z 4 -code and its Gray image.
Proposition 1. If C is a Z 4 -code with three Lee weights satisfying the hypotheses of Theorem 6, then its binary image C G satisfies the hypotheses of Theorem 6.
Proof. As is well-known, the Hamming weights of C G are the Lee weights of C. If n is the length of C then C G is of length 2n. The third condition of Theorem 6 becomes with p = m = 2, which is the same with p = 2, m = 1 and length 2n.
By A i we denote the number of codewords of C of homogeneous weight i and by B i we denote the number of codewords of homogeneous weight i of its dual code C ⊥ . The cardinality of the dual code is #C ⊥ = 2 2n−2k 1 −k 2 . Since we assume that a corresponding generator matrix does not have a zero column, we have B 1 = 0 in our context. As mentioned at the end of Subsection 2.1, every Z 4 code has minimum dual distance d ⊥ ≥ 3 iff it is regular and projective. The numbers A i can be encoded in a weight enumerator of C: The corresponding MacWilliams identity is given by Hom C (X, Y ) = 1 #C ⊥ ·Hom C ⊥ (X+ Y, X −Y ), see e.g. [20]. Note that this formula equals the Hamming weight enumerator for a linear code over F 2 with cardinality #C = 2 k if we replace n by 2n and k by 2k 1 + k 2 . As mentioned in the introduction and used in the proof of Lemma 1, the same conclusion can be obtained via the Gray map. Thus, we can easily rewrite the classical MacWilliams identities [33] or the Pless power moments [34] for the Hamming weight over F 2 . Using A 0 = B 0 = 1 and B 1 = 0 the first four (Pless) power moments for the w hom are given by: i≥0 We remark, that the first three equations (including B 1 ) can also be found in [40,Theorem 3.1].
In this section we are interested in structural results for l-weight codes where l is small. Mostly we will restrict our attention to projective codes only. In some cases we will require additional constraints on the sum l i=1 w i of weights (that are motivated by strongly walk regular graphs, see e.g. [11] and see also [38], which studies the field case).

Theoretical results for Z 4 -codes with few weights
In this section we give only very few results that are of interest for the remaining part of this paper. For more information we refer the interested reader to e.g. [40,39], where one-Lee weight codes and projective two-Lee weight codes are studied. For every pair (k 1 , k 2 ) of non-negative integers there exists exactly one non-isomorphic 1-weight [n, (k 1 , k 2 )] code (for a unique length n depending on k 1 and k 2 ), see [7]. Lemma 1. Let C be an [n, (k 1 , k 2 )] code. By C 2 we denote the subcode of C spanned be the codewords of even weight. The cardinality of C 2 is either 2 2k 1 +k 2 −1 or 2 2k 1 +k 2 and all codewords of C 2 have an even weight.
Proof. Let E be the code consisting of codewords of C of even Lee weight. This code is linear as the dual of the code spanned by the all-2 vector, so that C 2 = E ∩ C. Thus C 2 is linear and its size depends on whether 2 · 1 ∈ C ⊥ or not.
We also call C 2 the even-weight subcode of C.
Lemma 2. Let C be an [n, (k 1 , k 2 )] code with t ≥ 2 different nonzero weights. Then, at most t − 1 weights can be odd.
Proof. Let c ∈ C be a codeword of odd weight, then 2c ∈ C is a codeword of even weight.
Proof. Solving the first three power moment equations (5)-(7) for A 1 , A 2 , and A 3 gives the first statement. Plugging into the fourth power moment equation (8) and solving for 3B 3 gives the last equation of the statement.
We remark that the integrality of B 3 implies that the product of the three weights w 1 w 2 w 3 is divisible by y/2 = 2 2k 1 −k 2 −2 . Now let us look at the first case of Theorem 6, which is w 1 + w 2 + w 3 = 3n in our situation. Our first observation is that the length n has to be even.
Note that t = 1 gives y = n + 1 or n = 1. In the first case we have A 1 = 0 and w 1 = 0 in the second, so that we can assume t ≥ 3. Solving the above equations for n gives So, we consider the diophantine equation where y is a power of 2 and all integers are positive. 2 In our situation we have t ≥ 3, so that y ≥ 64 = 2 6 , since x 2 would be negative for t ≥ 3 and y ≤ 32. Now let us set x = 2z and y = 2 r+1 , i.e., r ≥ 5. With this we can rewrite Equation (12) to Since t is odd, z has to be odd too. We conclude that either z − t or z + t has to be divisible by 2 r from the fact that the greatest common divisor of z − t and z + t divides 2t and r ≥ 5.
We remark that in the case where also C 2 is projective the proof can be shortened significantly since [4,Corollary 16] implies that 2t is a power of two. An example where Lemma 4 excludes parameters of a code is given by n = 29, 2k 1 + k 2 = 8, w = (24, 31, 32), and weight distribution 0 1 24 76 31 128 32 51 . Applying the MacWilliams transform gives B 0 = 1, B 1 = B 2 = 0, B 3 = 164, and indeed all B i are non-negative integers. Moreover, the number of even-weight codewords is 128, i.e., half the size of the code.
Next we show that under the assumption of Theorem 10 the length and the three weights all are divisible by large powers of 2 if the length is suitably large.

Proposition 2.
Let C be an [n, (k 1 , k 2 )] 3-weight code with d ⊥ ≥ 3 and weights satisfying w 1 + w 2 + w 3 = 3n and w 2 = n. For each positive integer r there exists an integer N(r) such that n ≥ N(r) implies that 2 r divides n and 2 r−1 divides all three weights w 1 , w 2 , w 3 .
Proof. Let t be a positive integer with w 1 = n − t and w 3 = n + t. With this (and y = 2 2k 1 +k 2 −1 ) the equations of Lemma 3 are equivalent to and Since A 3 − A 1 = n t the effective length n has to be divisible by t. From A 2 ∈ N we conclude that t 2 divides n(n − y). So, if p l divides t for some odd prime p, then p 2l has to divide n since y is a power of 2. As an abbreviation we set k = 2k 1 + k 2 . Now let us try to parameterize t = 2 u · v and n = 2 x · v 2 · z for odd positive integers v, z and non-negative integers u, x. Plugging in and simplifying gives where u ≤ x (t divides n) and x ≤ k − 1 (n ≤ 2 k − 1 since C is projective).

Classification of 3-weights Z 4 -codes with d ⊥ ≥ 3 and short length
Having Theorem 6 in mind we aim to classify 3-weights Z 4 -codes with d ⊥ ≥ 3 and short length. Optimal linear codes over Z 4 with length n ≤ 7 were classified in [42].  Without the restriction to optimal codes, all linear codes over Z 4 with length n ≤ 10 and 2K 1 +k 2 ≤ 8 where classified in [15] for the homogeneous weight. The corresponding tables at http://www.algorithm.uni-bayreuth.de/en/research/Coding_Theory/Canonical contain the complete counts for n ≤ 10. E.g. for n = 10 and (k 1 , k 2 ) = 10 there are exactly 8 848 026 non-isomorphic codes. For each given n our approach is to loop over all 1 ≤ w 1 < w 2 < w 3 ≤ 2n such that A 1 , A 2 , A 3 , B 3 , as specified in Lemma 3, are integers with A 1 , A 2 , A 3 ≥ 1 and B 3 ≥ 0. Since 2 2k 1 +k 2 −2 has to divide w 1 w 2 w 3 , which is due to B 3 ∈ N, we obtain a finite list of possibilities for each length n. Note that d ⊥ ≥ 3 implies k 1 ≥ 1. With respect to Theorem 6 we consider all remaining tuples where w 1 + w 2 + w 3 ≥ 3n and w 1 + w 2 + w 3 ≡ 0 (mod 3). In Table 1 we list the parameters that can be attained by a Z 4 codes and refer to a corresponding generator matrix. As abbreviations we use w = (w 1 , w 2 , w 3 ), S = w 1 + w 2 + w 3 , and A = (A 1 , A 2 , A 3 ). The parameters of computationally excluded parameters are listed in Table 2 and Table 3. For the latter we perform an exhaustive search using the given restrictions on the weights w i , the length n, and the shape (k 1 , k 2 ). G

Cyclic Kerdock code
The Kerdock code K of length 2 s with s ≥ 3 odd over Z 4 can be expressed as where j denotes the all-one vector. The code Q is a free code of size 4 s with weight spectrum 2 s , 2 s ± 2 s−1

.
By puncturing on the first coordinate we obtain a cyclic code of length n = 2 s − 1 that was used in [41] to generate low correlation quadriphase sequences. This code is called K − in [20] and has the same weights as K. It can be shown to be projective by the same type of arguments as in [20, §3.3]. The sum of these weights being 3 · 2 s = 3(n + 1), we see that, by Theorem 6 with b = 2, the syndrome graph of K − with a double loop at each vertex is a 3-SWRG. It can be easily checked that the parameters of K − go in line with our results the previous subsection We observe that the binary images have a length congruent to 2 (mod 4), which is enough to show they are not linear [27]. This is an alternative proof that Kerdock codes cannot be linear. The classical proof builds on the fact that the Preparata code, or any code with the same weight distribution is nonlinear [16].

Extension to chain rings
In this section, we briefly indicate how the preceding work extends when replacing Z m p by a finite chain ring R of depth r ≥ 2, say, and residue field F q , for some prime power q. Recall that such a ring is a local ring whose lattice of ideals form a chain of length r. In particular, the maximal ideal is principal, generated by an element γ, a nilpotent element of nilpotency index r [35,Chap. 3]. An example is Z m p , when r = m, and q = p. The definition of the homogeneous weight becomes The definition of the syndrome graph in Subsection 2.3 to this generalized situation only needs the obvious modifications. Also the proof of [36,Theorem 4.1] can be generalized to conclude the connection between coset graph eigenvalues and weights: Theorem 11. Suppose that C is a regular, projective linear code over R with homogeneous weights w i and corresponding weight distribution A i = |{x ∈ C; w hom (x) = w i }|. Then the eigenvalues of Γ(C ⊥ ) are n(q − 1)q r−1 − qw i with multiplicity A i .
In particular, for the coset graph with loops, we have the following result.

Corollary 2.
If C is an R-code, of minimum distance at least three, with dual weight Thus A i is the frequency of the homogeneous weight i in C ⊥ and the multiplicity of the eigenvalue b + n(q − 1)q r−1 − qi.
From there, upon observing that Theorem 2 is valid for any finite commutative ring, the main condition for the existence of a TSS becomes Theorem 12. Assume that C(Ω) ⊥ is of length n and has three nonzero weights w 1 < w 2 < w 3 . Let b be any integer.

5.1
Trace codes over chain rings Consider the chain ring F p + uF p , with u 2 = 0. This is a chain ring with r = 2 and q = p. where L = Q + uF m p , Q is the set of squares of F p m , and R = F p m + uF p m . Note that, since m is even, we have F × p ⊆ Q. This implies that these codes are replications by a factor p − 1 of projective codes P (m, p) say of length n = p 2m −p m 2(p−1) . These latter codes have weights and so satisfy the relation for the weight of the Gray map in [37], normalized by a factor 2. This shows, by the first condition of Theorem 12, that the coset graph Γ C is a 3-SWRG, or, equivalently, that the Ω such that C(Ω) = C is a TSS.
From the length we get 2 s q k = n(q − 1). Thus, the sum of the weights is S = 3·2 s q k q r−2 = 3(n(q −1)+2 s )q r−2 = 3 q (b+n(q −1)q r−1 ) for b = 2 s q r−1 . By Theorem 12 we see that the coset graph with b loops on each vertices is a 3-SWRG.
We remark that in [28] and [25], more projective three-weight-codes over Galois rings are found, among them the dualized extended Kerdock codesK * k+1 and the dualized generalized Teichmüller codes T * q,k,s . However, they are either not regular or the sum of the weights does not satisfy the divisibility conditions needed in the context of this paper.

5.3
Classification of 3-weights codes over F 2 + uF 2 with d ⊥ ≥ 3 and short length In a similar manner as what we did over Z 4 , we classify 3-weight codes with dual weight d ⊥ ≥ 3 over the other proper chain ring of order 4, which is the ring R = F 2 + uF 2 of dual numbers over F 2 . The Gray image of such a code is always a linear binary code, and a linear binary code is the Gray image of an R-linear code if and only if it has a fixed-point free automorphism of order 2 [22]. We classify the codes in the same range of parameters as in the Z 4 -case, that is n ≤ 10, S ≥ 3n and S ≡ 0 mod 3. Since the MacWilliams identities for R-linear codes are the same as for Z 4 -linear codes (and up to doubling the length, the same as the MacWillimans identities for the linear Gray image), we can start with the same list of feasable parameters we computed for Z 4 -linear codes.
The feasable parameters, together with the weight distribution and the value S − 3n ≥ 0, are listed in Table 4. The column (k 1 , k 2 ) lists the shapes of the realizable codes. An entry "−" indicates that no R-linear code with the given parameters does exist.
A list of suitable generator matrices for the realizable parameters is given in Table 5.
We remark that we found further examples of R-linear three-weight codes with d ⊥ ≥ 3, S − 3n ≥ 0 and 3 | S. Their parameters are displayed in Table 6 6 Conclusion and open problems In this work we have generalized from fields to rings the constructions of SWRGs from [38]. The rings considered here are Z m p , and more generally finite chain rings. The weight playing the role of the Hamming in this generalization is the homogeneous weight. This weight can defined in general over finite Frobenius rings. It would be of theoretical interest to consider three-weight codes over those rings.
We have classified short length three-weight Z 4 -codes leading to SWRGs. To undertake such a classification for higher lengths and other rings is a challenging open problem, both theoretically and computationally. The polynomial analogues of Z m p , namely the rings F p [x]/(x m ), are worth considering.