1 Introduction

The origins of Information Theory and Error Correcting Codes Theory are in the papers by Shannon [64] and Hamming [35], where they settled the theoretical foundations for such theories.

For a non empty finite set A, called alphabet, a code C of length n is simply a proper subset of \(A^n\) and an n-tuple \((a_0,a_1,\ldots , a_{n-1})\in C\) is called a word of the code C.

If \(A={\mathbb F}_q\) is a finite field with q elements, then a linear code C of length n is a proper subspace of \({\mathbb F}_q^n\). If \(\dim C=k\) (\(k<n\)), then the number of words in C is \(q^k\).

We shall call “cyclic shift” the linear map \(\pi : {\mathbb F}_q^n\longrightarrow {\mathbb F}_q^n\) such that \(\pi (a_0, a_1, \ldots , a_{n-1}) = (a_{n-1}, a_0, a_1, \ldots , a_{n-2})\).

A linear cyclic code is a linear code C that is invariant under the cyclic shift. This structure gives rise to fast-decoding algorithms, which is a considerable aspect regarding the conditions on communication.

Consider the quotient ring \(\displaystyle R_n = \frac{{\mathbb F}_q[x]}{<x^n-1>}\) and denote by [f(x)] the class of the polynomial f(x) in \(R_n\). There is a natural vector space isomorphism \(\varphi : {\mathbb F}_q^n \longrightarrow R_n\) given by

$$\begin{aligned} \varphi (a_0, a_1, \ldots , a_{n-1})= [a_0 + a_1 x+ \cdots + a_{n-1}x^{n-1}]. \end{aligned}$$

Linear cyclic codes are often realized as ideals in \(R_n\) and the cyclic shift is equivalent, via the isomorphism \(\varphi \), to the multiplication by the class of x in \(R_n\).

Group algebras may be defined in a more general setting, that is, for any group and over any field. However, we restrict the definitions and results below to finite groups and finite fields because this is the context for coding theory.

Let G be a finite group written multiplicatively and \({\mathbb F}_q\) a finite field. The group algebra of G over \({\mathbb F}_q\) is the set of all formal linear combinations

$$\begin{aligned} \alpha =\displaystyle \sum _{g \in G} \alpha _gg, \quad \text{ where } \quad \alpha _g \in {\mathbb F}_q. \end{aligned}$$

Given \(\alpha = \displaystyle \sum _{g \in G} \alpha _gg\) and \(\beta = \displaystyle \sum _{g \in G} \beta _gg\) we have

$$\begin{aligned} \alpha = \beta \Longleftrightarrow \alpha _g = \beta _g, \ \ \text{ for } \text{ all } g\in G. \end{aligned}$$

The support of an element \(\alpha \in {\mathbb F}_q G\) is the set of elements of G effectively appearing in \(\alpha \); i.e.,

$$\begin{aligned} {\text {supp}}(\alpha ) = \{ g\in G \;|\; a_g\ne 0 \}. \end{aligned}$$

We define

$$\begin{aligned} \left( \sum _{g \in G}\alpha _gg \right) + \left( \sum _{g \in G} \beta _gg \right)= & {} \sum _{g \in G}(\alpha _g + \beta _g ) g.\\ \left( \sum _{g \in G}\alpha _gg \right) \left( \sum _{h \in G} \beta _h h \right)= & {} \sum _{g,h \in G}(\alpha _g\beta _h)gh. \end{aligned}$$

For \(\lambda \) in \({\mathbb F}_q\), we define

$$\begin{aligned} \lambda \left( \sum _{g \in G}\alpha _gg \right) = \sum _{g \in G}(\lambda \alpha _g)g. \end{aligned}$$

It is easy to see that, with the operations above, \({\mathbb F}_q G\) is an algebra over the field \({\mathbb F}_q\).

The weight of an element \(\alpha =\sum _{g\in G} a_g g\in {\mathbb F}_q G\) is the number of elements in its support; i.e.

$$\begin{aligned} w(\alpha ) = |\{ g\;|\; a_g\ne 0 \}|. \end{aligned}$$

For an ideal I of \({\mathbb F}_q G\), we define the minimum weight of I as:

$$\begin{aligned} w(I) = min\{ w(\alpha )\;|\; \alpha \in I, \; \alpha \ne 0\}. \end{aligned}$$

Let \(C_n=\langle a\rangle \) denote a cyclic finite group of order n generated by an element a. MacWilliams [44] was the first one to consider cyclic codes as ideals of the group ring \({\mathbb F}_q C_n\) which is easily proved to be isomorphic to \(\frac{{\mathbb F}_q[x]}{<x^n-1>}.\) In \({\mathbb F}_q C_n\), the cyclic shift is equivalent to the multiplication of the elements of the code by a.

The following diagram helps us to understand the cyclic shift in these three different ways of considering a cyclic code.

$$\begin{aligned} \begin{array} {cccrccrc} &{} C\subset {\mathbb F}_q^n &{} \mathop {\longrightarrow }\limits ^{\varphi } &{} &{} R_n= \frac{{\mathbb F}_q[x]}{<x^n-1>} &{} \mathop {\longrightarrow }\limits ^{\cong } &{} &{} {\mathbb F}_q C_n={\mathbb F}_q <a> \\ \text{ cyclic } &{} &{} &{} &{} &{} &{} &{} \\ &{} \downarrow &{} &{} &{} [x] \; \downarrow &{} &{} &{} a \; \downarrow \\ \text{ shift } &{} &{} &{} &{} &{} &{} &{} \\ &{} C\subset {\mathbb F}_q^n &{} \mathop {\longrightarrow }\limits ^{\varphi } &{} &{} R_n=\frac{{\mathbb F}_q[x]}{<x^n-1>} &{} \mathop {\longrightarrow }\limits ^{\cong } &{} &{} {\mathbb F}_q C_n ={\mathbb F}_q <a> \end{array} \end{aligned}$$

Extending these ideas, Berman [9, 10] and, independently, MacWilliams [45] defined abelian codes as ideals in finite abelian group algebras and, more generally, a group (left) code was defined as an (left) ideal in a finite group algebra. Group codes were then studied using ring and character-theoretical results.

From now on, for a finite group G and a finite field \({\mathbb F}_q\), we treat ideals in a group algebra \({\mathbb F}_q G\) as codes. In this approach, the length of the code is the order of the group G and the dimension of a code I is its dimension as an \({\mathbb F}_q\)-subspace in \({\mathbb F}_q G\). Length, dimension and minimum weight are the three parameters that define a linear code.

A group code is called minimal if the corresponding ideal is minimal in the set of ideals of the group algebra. Keralev and Solé in [40] showed that many important codes can be realized as ideals in a group algebra, for example, the generalized Reed–Muller codes and generalized quadratic residue codes. These results are included in Section 9.1 of [39]. There is also a good treatment on the subject in [22].

A word of warning is necessary here, because the expression “group code” may also have some other meanings. For example, in Computer Science, sometimes group codes consist of n linear block codes which are subgroups of \(G^n\), where G is a finite abelian group, as in [12, 29].

Usually in the papers that present techniques to compute the idempotents that generate the codes, character theory is used in the context of polynomials, as it can be seen in [1, 2, 46, 11, 50, 56, 57]. Sometimes the expressions for the idempotents are not very “reader friendly”. Moreover, the character theory and polynomial approaches in the computation of idempotents did not fully explore the structure of the group underneath the group algebra that defines the underlying set for the codes.

Summarizing the work of Ferraz and Polcino Milies [28], in Sect. 2 we define the idempotents using subgroups of the group and establish the basic theorems that are used in this work. We emphasize that in [28], they gave simpler proofs for computing idempotents, dimension and minimum weight for minimal cyclic and abelian codes of length \(2^kp^n\), generalizing and comparing their results with the ones in [1, 2]. For full details of [28], see Luchetta [43].

In Sect. 3 we discuss some topics of non-abelian group codes, including some equivalence questions. In Sect. 4 we describe some results on codes of length \(2^n\), for a natural \(n\ge 1\) and in Sect. 5 we treat some aspects of equivalence of abelian codes. In Sect. 6 we summarize some results on cyclic and abelian codes of length \(p^nq^m\), for p and q distinct primes and \(n, m \ge 1\) and in Sect. 7 we explore some facts on codes over rings.

2 Subgroups and idempotents

We recall that an element in the group algebra \({\mathbb F}_q G\) is called central if it commutes with every other element of the algebra. A non-zero central idempotent e is called primitive if it cannot be decomposed in the form \(e=e'+e''\), where \(e'\) and \(e''\) are both non-zero central idempotents such that \(e'e''=e''e'=0\). For , the group algebra \({\mathbb F}_q G\) is semisimple and the primitive central idempotents are the generators of the minimal two-sided ideals. Two idempotents \(e',e''\) are orthogonal if \(e'e''=e''e'=0\).

The primitive central idempotents of the rational group algebra \(\mathbb {Q}G\) were computed in [34, Theorem VII.1.4] in the case G abelian; in [37, Theorem 2.1] when G is nilpotent; in [53, Theorem 4.4] in a more general context and in [13, Theorem 7] an algorithm to compute the primitive idempotents is given.

In what follows, we shall establish a correspondence between primitive idempotents of \({\mathbb F}_q G\) and certain subgroups of an abelian group G.

Let G be a finite (abelian) group and \({\mathbb F}_q\) a field such that . Given a subgroup H of G, denote

$$\begin{aligned} \widehat{H} = \frac{1}{|H|}\sum _{h\in H}h \end{aligned}$$
(1)

which is an idempotent of \({\mathbb F}_q G\) and, for an element \(x\in G\), set \(\widehat{x} = \widehat{\langle x\rangle }\).

It is known that the idempotent \(\widehat{G}\) is always primitive (see [55, Proposition 3.6.7]).

Definition 2.1

Let G be an abelian group. A subgroup H of G is called a co-cyclic subgroup if the factor group \(G/H\ne \{ 1\}\) is cyclic.

We use the notation

$$\begin{aligned} {\mathcal {S}}_\mathrm {cc}(G)=\{H\, |\, H \text{ is } \text{ a } \text{ co-cyclic } \text{ subgroup } \text{ of } G\}. \end{aligned}$$

For a finite group G, denote by \({\text {exp}}(G)\) the exponent of G which is the smallest positive integer t such that \(g^t=1\), for all \(g\in G\). A group G is called a p -group if its exponent is a power of a given prime p. In particular, this means that the order of every element of G is itself a power of p.

Let G be a finite abelian p-group and \({\mathbb F}_q\) a finite field such that . For each co-cyclic subgroup H of G, we can construct an idempotent of \({\mathbb F}_q G\). In fact, we remark that, since G / H is a cyclic p-group, there exists a unique subgroup \(H^{\sharp }\) of G containing H such that \(|H^{\sharp }/H|=p\). Then \(e_H=\widehat{H} - \widehat{H^{\sharp }}\) is an idempotent and we consider the set

$$\begin{aligned} \{\widehat{G}\}\cup \{ e_H=\widehat{H} - \widehat{H^{\sharp }}\,|\,H\in {\mathcal {S}}_\mathrm {cc}(G)\}. \end{aligned}$$
(2)

We recall the following results that are used throughout this paper.

In the case of a rational abelian group algebra \(\mathbb {Q} G\), the set (2) is the set of all primitive central idempotents [34, Theorem 1.4].

Theorem 2.2

[28, Lemma 5] Let p be a prime integer and G a finite abelian group of exponent \(p^n\) and \({\mathbb F}_q\) a finite field with q elements such that . Then (2) is a set of pairwise orthogonal idempotents of \({\mathbb F}_q G\) whose sum is equal to 1, i.e.,

$$\begin{aligned} 1= \widehat{G}\,+\,\sum _{H\in {\mathcal {S}}_\mathrm {cc}(G)} e_H, \end{aligned}$$
(3)

where 1 also denotes the identity element in \({\mathbb F}_q G\).

In our next statement, we denote by \(U(\mathbb {Z}_{p^n})\) the set of invertible elements of the ring \(\mathbb {Z}_{p^n}\) of integers modulo \(p^n\); \(\bar{q}\) denotes the class of the integer q in \(\mathbb {Z}_{p^n}\) and, when it is invertible, \(o(\bar{q})\) denotes its multiplicative order; i.e., the least positive integer m such that \(\bar{q}^m=\bar{1}\).

Theorem 2.3

[28, Theorem 4.1] Under the same hypotheses of Theorem 2.2, the set (2) is the set of all primitive idempotents of \({\mathbb F}_q G\) if and only if \(o(\bar{q}) = \phi (p^n)\) in \(U(\mathbb {Z}_{p^n})\), where \(\phi \) denotes Euler’s totient function.

For positive integers r and m, we shall denote by \(\bar{r}\in \mathbb {Z}_m\) the image of r in the ring of integers modulo m. Then, for an element g in a group G, define \( \mathcal {G}_{g}=\{ g^r\,|\,\gcd (r, o(g))=1\}= \{ g^r\,|\, \bar{r}\in U(\mathbb {Z}_{o(g)}) \}\). The following theorem gives us conditions on the exponent e of the group G and the size q of the finite field that satisfy Theorem 2.3.

Corollary 2.4

[46, Teorema 7.10] Let \(\mathbb {F}_{q} \) be a finite field with q elements and G a finite abelian group with exponent e such that \({\text {gcd}}\left( q,|G|\right) =1\). Then \(C_{g}=\mathcal {G}_{g}\), for all \(g \in G\), if only if one of following conditions holds, where \(\phi \) denotes Euler’s totient function:

  1. (a)

    \(e=2\) and q is odd;

  2. (b)

    \(e=4\) and \(q \equiv 3 ({\text {mod}}\,\,4)\);

  3. (c)

    \(e=p^{n}\) and \(o(q)= \phi (p^{n})\) in \(U\left( \mathbb {Z}_{p^{n}}\right) \);

  4. (d)

    \(e=2p^{n}\) and \(o(q)= \phi (p^{n})\) in \(U\left( \mathbb {Z}_{2p^{n}}\right) \).

Theorem 2.5

[28, Lemma 3] Let \(G=\langle g\rangle \) be a cyclic group with order \(p^{n}\) and \(\mathbb {F}_{q} \) a finite field with q elements such that \(\overline{q}\) generates \(U\left( \mathbb {Z}_{p^{n}}\right) \). Consider

$$\begin{aligned} G=G_{0} \supset G_{1} \supset \cdots \supset G_{n}=\{1\} \end{aligned}$$

the descending chain of all subgroups of G. Then a complete set of primitive idempotents in \(\mathbb {F}_{q} G\) is:

$$\begin{aligned} e_{0}=\widehat{G}=\frac{1}{p^{n}} \sum _{g \in G}g \quad and \quad e_{i}=\widehat{G_i}-\widehat{G_{i-1}}, \text{ for } 1 \le i \le n, \end{aligned}$$
(4)

with \(G_i=<g^{p^i}>\), for \(1 \le i \le n\).

As the authors comment in [28], a straightforward computation shows that these are the same idempotents given in [2, Theorem 3.5], though there they are expressed in terms of cyclotomic cosets.

The idempotent generators of minimal ideals in the case of cyclic groups of order \(2p^n\) now follow easily from the previous results.

Theorem 2.6

[2, Theorem 2.6] Let \({\mathbb F}_q\) be a finite field with q elements and G a cyclic group of order \(2p^n\), p an odd prime, such that \(o(\bar{q}) = \phi (p^n)\) in \(U(\mathbb {Z}_{2p^n} )\). Write \(G = C \times A\), where A is the p-Sylow subgroup of G and \(C = \{ 1, t\}\) is its 2-Sylow subgroup. If \(e_i\), for \( 0\le i\le n\), denote the primitive idempotents of \({\mathbb F}_q A\), then the primitive idempotents of \({\mathbb F}_q G\) are

$$\begin{aligned} \frac{1+t}{2}\,e_i,\quad \frac{1-t}{2}\,e_i,\quad 0\le i\le n. \end{aligned}$$
(5)

More generally,

Theorem 2.7

[28, Theorem 4.2] Let p be an odd prime, A be an abelian p-group of exponent \(2p^r\) and \({\mathbb F}_q\) be a finite field with q elements such that \(o(q)= \phi (p^{r})\) in \(U\left( \mathbb {Z}_{2p^{r}}\right) \). Write \(A = E \times B\), where E is an elementary abelian 2-group and B a p-group. Then the primitive idempotents of \({\mathbb F}_q A\) are products of the form \(e\cdot f\), where e is a primitive idempotent of \({\mathbb F}_q E\) and f a primitive idempotent of \({\mathbb F}_q B\).

Section 5 of [28] is devoted to the computation of dimension and minimum weight of codes generated by the idempotents presented in previous theorems. For non-cyclic abelian groups, we may also apply the ideas above to construct idempotents. In [27], the following results are presented in details.

For a finite abelian group G, we write \(G=G_{p_1}\times \cdots \times G_{p_t}\), where \(G_{p_i}\) denotes the \(p_i\)-Sylow subgroup of G, for the distinct prime numbers \(p_1,\ldots , p_t\).

Lemma 2.8

[27, Lemma II.5] Let \(G=G_{p_1}\times \cdots \times G_{p_t}\) be a finite abelian group and \(H\in {\mathcal {S}}_\mathrm {cc}(G)\). Write \(H=H_{p_1}\times \cdots \times H_{p_t}\), where \(H_{p_i}\) is the \(p_i\)-Sylow subgroup of H. Then each subgroup \(H_{p_i}\) is co-cyclic in \(G_{p_i}\), \(1\le i\le t\).

With the notation above, for each \(H\in {\mathcal {S}}_\mathrm {cc}(G)\), define an idempotent \(e_H\in {\mathbb F}_q G\) as follows. For each \(1\le i\le t\), either \(H_{p_i}=G_{p_i}\) or there exists a unique subgroup \(H_{p_i}^{\sharp }\) such that \([H_{p_i}^{\sharp }:H_{p_i}]=p_i\). Thus, let \(e_{H_{p_i}}=\widehat{G_{p_i}}\) or \(e_{H_{p_i}}=\widehat{H_{p_i}}-\widehat{H_{p_i}^{\sharp }}\), respectively, and define

$$\begin{aligned} e_H = e_{H_{p_1}}e_{H_{p_2}}\cdots e_{H_{p_t}}. \end{aligned}$$
(6)

For any other \(K\in {\mathcal {S}}_\mathrm {cc}(G)\), with \(K\ne H\), we have \(K_{p_i}\ne H_{p_i}\), for some \(1\le i\le t\), and, by Theorem 2.2, \(e_{H_{p_i}}e_{K_{p_i}}=0\), hence \(e_He_K=0\). It is easy to see that \(\widehat{G} e_H =0\), for all \(H\in {\mathcal {S}}_\mathrm {cc}(G)\).

Thus, we have the following.

Proposition 2.9

[27, Proposition II.6] Let G be a finite abelian group and \({\mathbb F}_q\) a finite field such that . Then

$$\begin{aligned} {\mathcal {B}}=\{ e_H\,|\,H \in {\mathcal {S}}_\mathrm {cc}(G) \} \cup \{ \widehat{G} \} \end{aligned}$$
(7)

is a set of orthogonal idempotents of \({\mathbb F}_q G\), where \(e_H\) is defined as in (6).

A similar construction of idempotents for rational group algebras of abelian groups is given in [34, Section VII.1]. For the rational case, these idempotents are primitive while for finite fields this is usually not true.

Now, we extend Theorem 2.2 to finite abelian groups.

Lemma 2.10

[27, Lemma II.7] Let G be a finite abelian group and \({\mathbb F}_q\) a finite field such that . Then, in the group algebra \({\mathbb F}_q G\), we have

$$\begin{aligned} 1= \widehat{G}\,+\,\sum _{H\in {\mathcal {S}}_\mathrm {cc}(G)} e_H. \end{aligned}$$
(8)

The following lemma starts the discussion about the relation between idempotents and certain subgroups of the abelian group, which we elaborate in more details in Sect. 5.

Lemma 2.11

[27, Lemma II.8] Let G be a finite abelian group and \({\mathbb F}_q\) a finite field such that . For each primitive idempotent \(e\in {\mathbb F}_q G\), \(e\ne \widehat{G}\), there exists a unique \(H\in {\mathcal {S}}_\mathrm {cc}(G)\) such that \(e\cdot e_H = e\). Also, \(e\cdot e_K=0\), for any other \(K\in {\mathcal {S}}_\mathrm {cc}(G)\).

3 Non abelian codes

3.1 Dihedral and quaternion codes

As a natural way to proceed, Theorem 2.2 is used by Dutra [23, 25] to compute idempotents for non abelian group codes, particularly, for dihedral and quaternion groups.

For \(n\ge 1\), Dutra considered the semisimple group algebras \({\mathbb F}_qD_n\) of the dihedral groups \(D_n = \langle a, b\,|\,a^n=b^2=1,\,bab=a^{-1} \rangle \) over a finite field \({\mathbb F}_q\) and gave conditions under which the number of its simple components is minimum, that is, the same as for the rational group algebra \(\mathbb {Q} D_n\). These conditions are stated in the following theorem.

Theorem 3.1

[23, Teorema 2.2] Let \({\mathbb F}_q\) be a field with q elements and \(D_n\) the dihedral group with 2n elements such that \(\gcd (q, 2n) = 1\). Let \(p, p_1\) and \(p_2\) be distinct odd primes and \(m, m_1\) and \(m_2\) be positive integers. Then \( {\mathbb F}_q D_n\) and \(\mathbb {Q} D_n\) have the same number of simple components if and only if one of the following conditions occurs:

  1. (i)

    \(n = 2\) or 4 and q is odd.

  2. (ii)

    \(n = 2^m\), with \(m \ge 3\) and congruent to 3 or 5 modulo 8.

  3. (iii)

    \(n = p^m\) and the class \(\bar{q}\) generates the group of units \(U(\mathbb {Z}_{p^m})\).

  4. (iv)

    \(n = p^m\), the class \(\bar{q}\) generates the group \(U^2(\mathbb {Z}_{p^m})=\{ x^2\,|\, x\in U(\mathbb {Z}_{p^m})\}\) and \(-1\) is not a square modulo \(p^m\).

  5. (v)

    \(n = 2p^m\) and the class \(\bar{q}\) generates the group of units \(U(\mathbb {Z}_{p^m})\).

  6. (vi)

    \(n = 2p^m\), \(\bar{q}\) generates the group \(U^2(\mathbb {Z}_{p^m})=\{ x^2\,|\, x\in U(\mathbb {Z}_{p^m})\}\) and \(-1\) is not a square modulo \(p^m\).

  7. (vii)

    \(n = 4p^m\), 4 divides \(\phi (p^m)\) and the class \(\bar{q}\) generates the group \(U(\mathbb {Z}_{p^m})\).

  8. (viii)

    \(n = 4p^m\), 4 does not divide \(\phi (p^m)\), \(q\equiv 1 ({\text {mod }}4)\) and the class \(\bar{q}\) generates the group \(U(\mathbb {Z}_{p^m})\).

  9. (ix)

    \(n = 4p^m\), 4 does not divide \(\phi (p^m)\), \(q\equiv -1 ({\text {mod }} 4)\) and the class \(\bar{q}\) has order \(\phi (p^m)/2\).

  10. (x)

    \(n = p_1^{m_1} p_2^{m_2}\), with \(\gcd (\phi (p_1^{m_1}), \phi (p_2^{m_2} )) = 2\) and q or \(-q\) has order \(\phi (p_1^{m_1} p_2^{m_2})/2\) modulo \(p_1^{m_1} p_2^{m_2}\).

  11. (xi)

    \(n = 2 p_1^{m_1} p_2^{m_2}\), with \(\gcd (\phi (p_1^{m_1}), \phi (p_2^{m_2} )) = 2\) and q or \(-q\) has order \(\phi (p_1^{m_1} p_2^{m_2})/2\) modulo \(p_1^{m_1} p_2^{m_2}\).

Under such conditions, Dutra computed the set of minimal codes of \({\mathbb F}_qD_n\), their dimensions, minimum weights and bases for these codes as follows.

Theorem 3.2

[23, Proposição 3.1] Let q and n be integers related as in conditions (i) and (ii) of Theorem 3.1. If \(\mathcal {C} \) is a dihedral code of length 2n generated by the idempotent e, then \(\mathcal {C}\) has dimension and minimum weight described in Table 1.

Table 1 Minimal dihedral codes for \(n=2^m\)

Theorem 3.3

[23, Proposição 3.2] Let q and n be integers related as in conditions (iii) and (iv) of Theorem 3.1. If \(\mathcal {C} \) is a dihedral code of length 2n generated by the idempotent e, then \(\mathcal {C}\) has dimension and minimum weight described in Table 2.

Table 2 Minimal dihedral codes for \(n=p^m\)

Theorem 3.4

[23, Proposição 3.3] Let q and n be integers related as in conditions (v) to (ix) of Theorem 3.1. For \(n=p_1^{m_1}p_2^{m_2}\) with \(p_1=2, m_1=1\) or 2 and \(p_2\) an odd prime, if \(\mathcal {C} \) is a dihedral code of length 2n generated by the idempotent \(e_1e_2\), then \(\mathcal {C}\) has dimension and minimum weight described in Table 3, where \(1\le i\le m_1\) and \(1\le j\le m_2\).

Table 3 Minimal dihedral codes for \(n=2p_2^{m_2}\) or \(n=4p_2^{m_2}\)

Theorem 3.5

[23, Proposição 3.4] Let q and \(n=p_1^{m_1}p_2^{m_2}\), with \(p_1\) and \(p_2\) odd distinct prime numbers, integers related as in condition (x) of Theorem 3.1. If \(\mathcal {C} \) is a dihedral code of length 2n generated by the idempotent \(e_1e_2\), then \(\mathcal {C}\) has dimension and minimum weight described in Table 4, where \(1\le i\le m_1\) and \(1\le j\le m_2\).

Table 4 Minimal dihedral codes for \(n=p_1^{m_1} p_2^{m_2}\)

Theorem 3.6

[23, Proposição 3.5] Let q and \(n=2p_1^{m_1}p_2^{m_2}\), with \(p_1\) and \(p_2\) odd distinct prime numbers, integers related as in condition (xi) of Theorem 3.1. If \(\mathcal {C} \) is a dihedral code of length 2n generated by the idempotent \(e_0e_1e_2\), then \(\mathcal {C}\) has dimension and minimum weight described in Table 5, where \(1\le i\le m_1\) and \(1\le j\le m_2\).

Table 5 Minimal dihedral codes for \(n=2 p_1^{m_1} p_2^{m_2}\)

Similar results were obtained by Dutra [23, Capítulos 4 e 5] for group codes over the quaternion groups.

3.2 Metacyclic codes and equivalence questions

A group G is metacyclic if it contains a normal cyclic subgroup H such that G / H is also cyclic. It is easy to prove that a finite metacyclic group has the following presentation

$$\begin{aligned} G=\left\langle a,\,b\,|\, a^m=1,\,b^n=a^s,\, bab^{-1}=a^i\right\rangle , \end{aligned}$$
(9)

with a and b such that \(H=\langle a\rangle \) and \(G/H=\langle bH\rangle \), for \(m, n\in \mathbb {N}\) and \(1\le s, i\le m\) such that \(s|m,\;m|s(i-1),\, i<m, \,\gcd (i,m)=1\). For \(s=m\), we say that G is a split metacyclic group and, in this case, G is the semi-direct product \(G=\langle a\rangle \rtimes \langle b\rangle \).

Earlier approaches on non-abelian metacyclic codes include results obtained by Sabin [61] and Sabin and Lomonaco [62], where we also find the following definition of equivalence of codes.

Definition 3.7

Let G and H be two finite groups of the same order and \({\mathbb F}_q\) a field. A combinatorial equivalence is a vector space isomorphism \(\psi : {\mathbb F}_q G \longrightarrow {\mathbb F}_q H\) induced by a bijection \(\psi : G\longrightarrow H\).

Two codes \(C\subset {\mathbb F}_q G\) and \(\tilde{C}\subset {\mathbb F}_q H\) are said to be combinatorially equivalent if there exists a combinatorial equivalence \(\psi : {\mathbb F}_q G \longrightarrow {\mathbb F}_q H\) such that \(\psi (C)=\tilde{C}\).

For G a metacyclic finite group such that \(\gcd (q, |G|)=1\), Sabin and Lomonaco [62], by using group representation theory, proved that codes generated by central idempotents in \({\mathbb F}_q G\) are combinatorially equivalent to abelian codes. This motivated the search for left minimal codes in \({\mathbb F}_q G\).

Considering the group algebra of a non-abelian split metacyclic group G over a finite field \({\mathbb F}_q\), Assuena [3] found a necessary condition under which \({\mathbb F}_q G\) has the minimum number of simple components.

Theorem 3.8

[3, Teorema 2.1.16] Let G be a metacyclic group and \({\mathbb F}_q\) a finite field with q elements such that \(\gcd (q, |G|)=1\). If the number of simple components of the group algebra \({\mathbb F}_q G\) is minimal, then \(U(\mathbb {Z}_n)=\langle \bar{q}\rangle \) and \(U(\mathbb {Z}_m)=\langle \bar{i}\rangle \langle \bar{q}\rangle \).

Assuena [3] used the structure of the group to determine the minimal metacyclic codes for a non abelian split metacyclic group of order \(p^m\ell ^n\), with p and \(\ell \) odd prime numbers, under the conditions that \({\mathbb F}_q G\) is semisimple and the number of simple components of \({\mathbb F}_q G\) is minimum.

For \(D_{p^m}\), the dihedral group of order \(2p^m\), and \({\mathbb F}_q\) a finite field such that \(\gcd (q,2p^m)=1\), he constructs left minimal codes that are not combinatorially equivalent to abelian codes and also exhibits one case where a left minimal code is more efficient then the abelian ones of the same length, giving a positive answer to a conjecture of Sabin and Lomonaco [62].

Further studies on group codes are given in [11], where it is defined a (left) G -code as any linear (left) code of length n over a field \({\mathbb F}_q\) which is the image of a (left) ideal of a group algebra via an isomorphism \({\mathbb F}_q G\longrightarrow {\mathbb F}_q^n\) which maps the finite group G of order n to the standard basis of \({\mathbb F}_q^n\). Their ideas are used in [63] to study two-sided and abelian group ring codes and in [30], where García Pillado et al. first communicated an example of a non-abelian \(S_4\)-code over \({\mathbb F}_5\). The full proof of this computacional construction was given later in [31]. New examples of non-abelian G-codes are given in [32] and, particularly, using the group \(SL(2;{\mathbb F}_3)\) instead of the symmetric group, they prove, without using a computer for it, that there is a code over \({\mathbb F}_2\) of length 24, dimension 6 and minimal weight 10. This code has greater minimum distance than any abelian group code having the same length and dimension over \({\mathbb F}_2\), and, moreover, it has the greatest minimum weight among all binary linear codes with the same length and dimension.

In [24] Elia and García Pillado give an overview of the properties of ideal group codes defined as principal ideals in the group algebra of a finite group G over a finite field \({\mathbb F}_q\) and present their encoding and syndrome decoding. They also describe in detail a correction of a single error, using syndromes.

4 Cyclic codes of length \(2^m\)

Codes are usually considered over the binary field \({\mathbb F}_2\). For cyclic codes of length \(2^m\), with a natural \(m\ge 1\), over a field of odd size, the results obtained using a polynomial approach by Bakshi and Raka [4], Pruthi [59], Sharma et al. [67], Sharma et al. [66] or using the group algebra approach by Prado [58] are essentially the same. In  [58, Capítulo2] Prado states the general facts:

Theorem 4.1

[58, Lema 2.1.1] Let \(G=\langle a\rangle \) be a finite cyclic group of order \(2^m, m\ge 1\) and \({\mathbb F}_q\) a finite field of odd characteristic. Let

$$\begin{aligned} G=G_0 \supset G_1 \supset \cdots \supset G_m=\{ 1\} \end{aligned}$$

be the descending chain of all subgroups of G, with \(G_i = \langle a^{2^i}\rangle \) and \(|G_i|=2^{m-i}\). Then the elements \(e_0 = \widehat{G}\) and \(e_i=\widehat{G_i}-\widehat{G_{i-1}}\), with \(1\le i\le m\), form a set of orthogonal idempotents of \({\mathbb F}_q G\) such that \(e_0+e_1+\cdots +e_m=1\).

Theorem 4.2

[58, Lema 2.2.1] Under the same hypothesis of Theorem 4.1, let \(I_i={\mathbb F}_q G e_i\), with \(1\le i\le m\), be the ideals of \({\mathbb F}_q G\) generated by the idempotents \(e_i\) of Theorem 4.1. Then

$$\begin{aligned} {\text {dim}}(I_0)= & {} 1,\qquad d(I_0)=|G|=2^m \\ {\text {dim}}(I_i)= & {} 2^{i-1},\quad d(I_i)=|G|=2^{m-i+1}, \text{ for } 1\le i\le m. \end{aligned}$$

The notion of a visible code was given by Ward [74], where he defines a visible basis for a code as a basis where all its elements have the same weight. Prado also proved the following for codes of length \(2^m\).

Theorem 4.3

[58, Proposição 2.3.1] Under the same hypothesis of Theorem 4.1, for \(1\le i\le m\), the set

$$\begin{aligned} B_i = \{ e_i, ae_i, a^2e_i, \ldots , a^{2^{i-1}-1}e_i\} \end{aligned}$$

is a visible basis for the code \(I_i={\mathbb F}_q G e_i\).

In her thesis [58], Prado studied in details the minimal codes generated by primitive idempotents in \({\mathbb F}_q C_{2^m}\), with q odd. She considered four cases: \(q\equiv 1 ({\text {mod}} 8)\), \(q\equiv 3 ({\text {mod}} 8)\), \(q\equiv 5 ({\text {mod}} 8)\) and \(q\equiv 7 ({\text {mod}} 8)\). The order of \(q ({\text {mod}} 2^m)\), the number of simple components of \({\mathbb F}_q C_{2^m}\) and the computation of idempotents are different for each one of these cases. For \(q\equiv 3 ({\text {mod}} 8)\) and \(q\equiv 5 ({\text {mod}} 8)\) a complete discussion is presented in the thesis and the other cases are exemplified with particular examples. Here is the case \(q\equiv 3 ({\text {mod}} 8).\)

Theorem 4.4

[58, Proposição3.1.1] Let \({\mathbb F}_q\) be a field with q elements such that \(q\equiv 3 ({\text {mod}} 8)\) and \(G=\langle a\,|\, a^{2^m}=1\rangle \) be a cyclic group of order \(2^m\). The following elements of the group algebra \({\mathbb F}_q G\)

$$\begin{aligned} e_0= & {} \displaystyle \frac{1+a+a^2+\cdots + a^{2^m-1}}{2^m}\\ e_1= & {} \displaystyle \frac{1-a+a^2-\cdots - a^{2^m-1}}{2^m}\\ e_2= & {} \displaystyle \frac{1-a^2+a^4-\cdots - a^{2^m-2}}{2^{m-1}}\\ e_3= & {} (1-a^4)\displaystyle \frac{(1+a^{2^3}+\cdots + a^{2^m-2^3})(2+\alpha a + \alpha a^3)}{2^m} \\ e'_3= & {} (1-a^4)\displaystyle \frac{(1+a^{2^3}+\cdots + a^{2^m-2^3})(2-\alpha a - \alpha a^3)}{2^m}\\ e_4= & {} (1-a^8)\displaystyle \frac{(1+a^{2^4}+\cdots + a^{2^m-2^4})(2+\alpha a^2 + \alpha a^{3\cdot 2})}{2^{m-1}}\\ e'_4= & {} (1-a^8)\displaystyle \frac{(1+a^{2^4}+\cdots + a^{2^m-2^4})(2-\alpha a^2 - \alpha a^{3\cdot 2})}{2^{m-1}}\\&\qquad \qquad \qquad \quad \ldots ,\\ e_{m-1}= & {} (1-a^{2^{m-2}})\displaystyle \frac{(1+a^{2^m-1})(2+\alpha a^{2^{m-4}} + \alpha a^{3\cdot 2^{m-4}})}{2^{4}}\\ e'_{m-1}= & {} (1-a^{2^{m-2}})\displaystyle \frac{(1+a^{2^m-1})(2-\alpha a^{2^{m-4}} - \alpha a^{3\cdot 2^{m-4}})}{2^{4}}\\ e_{m}= & {} (1-a^{2^{m-1}})\displaystyle \frac{(2+\alpha a^{2^{m-3}} + \alpha a^{3\cdot 2^{m-3}})}{2^{3}}\\ e'_{m}= & {} (1-a^{2^{m-1}})\displaystyle \frac{(2-\alpha a^{2^{m-3}} - \alpha a^{3\cdot 2^{m-3}})}{2^{3}} \end{aligned}$$

form a complete set of primitive idempotents of \({\mathbb F}_q G\), with \(\alpha ^2=-2\) in \({\mathbb F}_q\).

In [58, Capítulo 4] Prado simplifies results of Poli [56] in order to obtain a clearer description of the principal nilpotent ideals of a group algebra of finite abelian groups in a modular case (i.e., when \({\text {char}} ({\mathbb F}_q)\) divides the order of the group G). She also exemplifies the process of lifting idempotents modulo a nilpotent ideal.

5 More on equivalence of abelian codes

The question of equivalence in Coding Theory has many approaches. In Sect. 3.2, we have defined combinatorial equivalence. In [50], we found the following for abelian codes. Here G stands for a finite abelian group and \({\mathbb F}_q \) is a finite field with q elements.

Definition 5.1

Two abelian codes \(\mathcal{I}_1\) and \(\mathcal{I}_2\) are G-equivalent if there exists an automorphism \(\theta \) of G whose linear extension to \({\mathbb F}_qG\) maps \(\mathcal{I}_1\) on \(\mathcal{I}_2\).

The following statements also appeared in [50].

Theorem A

[50, Theorem 3.6] Let G be a finite abelian group of odd order and exponent n and denote by \(\tau (n)\) the number of divisors of n. Then there exist precisely \(\tau (n)\) non G-equivalent minimal abelian codes in \({\mathbb F}_2 G\).

Theorem B

[50, Theorem 3.9] Let G be a finite abelian group of odd order. Then two minimal abelian codes in \({\mathbb F}_2 G\) are G-equivalent if and only if they have the same weight distribution.

Unfortunately both statements are not fully correct. The errors arise from the assumption, implicit in the last paragraph of [50, p. 167], that if e and f are primitive idempotents of \({\mathbb F}_2 C_m\) and \({\mathbb F}_2 C_n\), respectively, then ef is a primitive idempotent of \({\mathbb F}_2[C_m\times C_n]\). To the best of our knowledge, these results have not been used in a wrong way in the literature.

We first communicated the following counterexamples to both Theorems A and B in [26].

Proposition 5.2

[26, Proposition 3.1] Let p be an odd prime such that \(\bar{2}\) generates \(U(\mathbb {Z}_{p^2})\) and \(G=\langle a\rangle \times \langle b\rangle \) an abelian group, with \(o(a)=p^2\) and \(o(b)=p\). Then \({\mathbb F}_2G\) has four inequivalent minimal codes, namely, the ones generated by the idempotents \(e_0=\widehat{G}\), \(e_1= \widehat{b} - \widehat{\langle a^p\rangle \times \langle b\rangle } \), \(e_2= \widehat{a} - \widehat{G}\) and \(e_3= \widehat{\langle a^p\rangle \times \langle b\rangle } - \widehat{G}.\)

Also all minimal codes of \({\mathbb F}_2 G\) are described in Table 6 with their dimension and weight.

Moreover, the minimal inequivalent codes \(I_2\) and \(I_3\) have the same weight distribution.

Table 6 Minimal codes in \({\mathbb F}_2(C_{p^2}\times C_p)\)

In [26, Proposition 4.2] we showed that Theorem A holds in the special case of minimal codes in \({\mathbb F}_2(C_{p^n}\times C_{p^n})\) and, in [27, Theorem V.3], we generalize these result for G a direct product of \(m\ge 2\) copies of a cyclic group \( C_{p^n}\), as follows.

Proposition 5.3

[27, Proposition V.3] Let m and r be positive integers and p a prime number. If \(G=(C_{p^r})^{m}\) is a finite abelian p-group and \({\mathbb F}_q\) is a field of \( \mathrm{char}({\mathbb F}_q)\ne p\). Then a primitive idempotent of \({\mathbb F}_q G\), different from \(\widehat{G}\), is of the form \(\widehat{K}\cdot e_h\), where K is a subgroup of G isomorphic to \((C_{p^r})^{m-1}\) and \(e_h\) is a primitive idempotent of \({\mathbb F}_q\langle h\rangle \), where \(h\in G\) is such that \(G=\langle h\rangle \times K\) and \(\langle h\rangle \cong C_{p^r}\).

This result can be applied as follows.

Corollary 5.4

[27, Corollary V.4] Let m and r be positive integers, p a prime number, a finite abelian p-group \(G= (C_{p^r})^{m}\) and \({\mathbb F}_q\) a finite field with q elements such that \(o(\bar{q})=\phi (p^r)\) in \(U(\mathbb {Z}_{p^r})\). Then the minimal abelian codes in \({\mathbb F}_q G\) are as Table 7, where h and K are as in Proposition 5.3.

Table 7 Minimal codes in \({\mathbb F}_q (C_{p^r})^m\)

Consequently, the number of non G-equivalent minimal abelian codes is \(r+1=\tau (p^r)\).

Corollary 5.5

[27, Corollary V.5] Let \(n,m\ge 2\) be integers, \(G=(C_n)^{m}\) an abelian group and \({\mathbb F}_q\) a finite field such that \(\gcd ( q, n) = 1\). Then the primitive idempotents of \({\mathbb F}_qG\) are of the form \(\widehat{K}\cdot e_h\), where K is a subgroup of G isomorphic to \( (C_n)^{m-1}\), \(h\in G\) is such that \(G=K\times \langle h\rangle \) and \(e_h\) is a primitive idempotent of \({\mathbb F}_q\langle h\rangle \).

Theorem 5.6

[27, Theorem V.6] Let m be a positive integer and \(G=C^m\) a direct product of cyclic groups isomorphic to one another, of exponent n, and \({\mathbb F}_q\) a finite field such that . Then, the number of non G-equivalent minimal abelian codes is precisely \(\tau (n)\).

We fully discussed the G-equivalence of abelian codes and established in [27, Section III] a relation between the classes of equivalence of G-equivalent codes and some classes of isomorphisms of subgroups of G, as follows.

We say that two subgroups H and K of a group G are G-isomorphic if there exists an automorphism \(\psi \in \mathrm{Aut}(G)\) such that \(\psi (H)=K\).

Notice that isomorphic subgroups are not necessarily G-isomorphic. For example, for a prime p, if \(G=\langle a\rangle \times \langle b\rangle \) with \(o(a)=p^2\) and \(o(b)=p\), then \(\langle a^p\rangle \) and \(\langle b \rangle \) are isomorphic, as they are both cyclic groups of order p. However, they are not G-isomorphic, since \(\langle b\rangle \) is contained, as a subgroup of index p, only in \(\langle a^p\rangle \times \langle b\rangle \) while \(\langle a^p\rangle \) is contained in \(\langle a\rangle \) and in \(\langle a^ib\rangle \), for all \(1\le i\le p-1\). An automorphism of G carrying one to the other would preserve also inclusions.

We shall denote by \( \mathcal {P}({\mathbb F}_q G)\) the set of all primitive idempotents of \({\mathbb F}_q G\). Recall the notion of co-cyclic subgroup (Definition 2.1). Then, under the same hypotheses of Lemma 2.11, the following map is well-defined

$$\begin{aligned} \begin{array}{clc} \Phi \; : \;\mathcal {P}({\mathbb F}_q G) &{} \longrightarrow &{} {\mathcal {S}}_\mathrm {cc}(G) \cup \{G\}\\ e\ne \widehat{G} &{}\longmapsto &{} \Phi (e)=H_e,\\ \widehat{G} &{} \longmapsto &{} G \end{array} \end{aligned}$$
(10)

where \(H_e\) is the unique co-cyclic subgroup of G such that \(e\cdot e_{H_e}=e\).

Theorem 5.7

[27, Theorem II.9] Let G be a finite abelian group, \({\mathbb F}_q\) a finite field such that and \(H\in {\mathcal {S}}_\mathrm {cc}(G)\). Then \(e_H\) is the sum of all primitive idempotents \(e\in \mathcal {P}({\mathbb F}_q G) \) such that \(\Phi (e)=H\).

The study of the G-equivalence of ideals involves to know how the group of automorphisms \(\mathrm{Aut}(G)\) acts on the lattice of the subgroups of G and hence on the idempotents in the group algebra which arise from these subgroups. From now on, we use the same notation for an automorphism of the group G and its linear extension to the group algebra \({\mathbb F}_q G\). The following results from [27] relate subgroups in G and idempotents in \({\mathbb F}_qG\).

Lemma 5.8

[27, Lemma III.1] Let G be a finite abelian group, \(H\in {\mathcal {S}}_\mathrm {cc}(G)\) and \(e_H\) its corresponding idempotent defined as in (6). Then, for any \(\psi \in \mathrm{Aut}(G)\), we have \(\psi (e_H)=e_{\psi (H)}\) and \(\psi (\widehat{G})=\widehat{G}\).

For finite abelian groups, Propositions 5.95.10 and 5.11 below establish a correspondence between G-equivalent minimal ideals in \({\mathbb F}_q G\) and G-isomorphic subgroups of G.

Proposition 5.9

[27, Proposition III.2] Let G be a finite abelian group and \({\mathbb F}_q\) a finite field such that . If \(e,\,e'\in \mathcal {P}({\mathbb F}_q G)\) are such that \(\psi (e)=e'\), for some automorphism \(\psi \in \mathrm{Aut}(G)\) linearly extended to \({\mathbb F}_q G\), then

$$\begin{aligned} \psi (H_e)=H_{\psi (e)}=H_{e'}, \end{aligned}$$

i.e., \(H_e\) and \(H_{e'}\) are G-isomorphic.

We set \( {\mathcal {L}}\mathrm{Aut}(G) = \{ \psi \in \mathrm{Aut}(G)\,|\,\psi (H)=H, \text{ for } \text{ all } H\le G \}. \)

Proposition 5.10

[27, Proposition III.7] Let G be a finite field abelian group and \({\mathbb F}_q\) a finite field such that . If \(e',\,e''\in \mathcal {P}({\mathbb F}_q G)\) are both different from \(\widehat{G}\) and \(H_{e'}=H_{e''}\), then there exists an automorphism \(\psi \in \mathcal {L}\mathrm{Aut}(G)\) whose linear extension to \({\mathbb F}_q G\) maps \(e'\) to \(e''\).

The following is the converse of Proposition 5.9.

Proposition 5.11

[27, Proposition III.8] Let G be a finite abelian group and \({\mathbb F}_q\) a finite field such that . If \(e',\,e''\in \mathcal {P}({\mathbb F}_q G)\), both different from \(\widehat{G}\), are such that \(\psi (H_{e'})=H_{e''}\), for some \(\psi \in \mathrm{Aut}(G)\), then there exists an automorphism \(\theta \in \mathrm{Aut}(G)\) whose linear extension to \({\mathbb F}_q G\) maps \(e'\) to \(e''\), i.e., the ideals of \({\mathbb F}_q G\) generated by \(e'\) and \(e''\) are G-equivalent.

As an application of Propositions 5.9 and 5.11, in [27, Section IV] we consider the minimal codes in \({\mathbb F}_2(C_{p^n}\times C_{p})\), for an odd prime p and \(n\ge 3\). Its proof is similar to the proof of Proposition 5.2. This gives a whole family of counterexamples to Theorem A.

Proposition 5.12

[27, Theorem IV.3] Let \(n\ge 3\) be a positive integer and p an odd prime such that \(\bar{2}\) generates \(U(\mathbb {Z}_{p^n})\) and \(G=\langle a\rangle \times \langle b\rangle \) be an abelian group, with \(o(a)=p^n\) and \(o(b)=p\). Then the minimal codes of \({\mathbb F}_2 G\) are described in Table 8. Moreover, there are 2n inequivalent minimal codes in \({\mathbb F}_2(C_{p^n}\times C_p)\).

Table 8 Minimal codes in \({\mathbb F}_2(C_{p^n}\times C_p)\)

In the first column of Table 9 we give a complete list of representatives of classes of G-isomorphisms of subgroups of \(C_{p^n}\times C_{p}\) and, in the second column, we list the corresponding representatives of G-equivalent classes of minimal codes in the group algebra \(\mathbb {F}_2(C_{p^n} \times C_p)\).

Table 9 Subgroups and codes

6 Cyclic and abelian codes of length \(p^nq^m\)

6.1 Binary abelian codes

In [15], we considered finite abelian groups of type \(G=G_p\times G_q\), for distinct primes p and q such that \(G_p\) is a p-group, \(G_q\) is a q-group satisfying the following conditions which will allow us to use the results in  [28]:

$$\begin{aligned} (i)&\gcd (p-1,\,q-1 ) = 2, \nonumber \\ (ii)&\ \bar{2}\; \text{ generates } \text{ the } \text{ groups } \text{ of } \text{ units }\; U(\mathbb {Z}_{p^2}) \text{ and } \;U(\mathbb {Z}_{q^2}) \nonumber \\ (iii)&\gcd (p-1,q) = \gcd (p,q-1)=1. \end{aligned}$$
(11)

The hypothesis (i) above implies that at least one of the primes p and q is congruent to 3 (mod 4). In this section, to fix notations, we shall always assume that \(q\equiv 3 \ \) (mod 4). As a code (ideal) generated by a primitive idempotent is isomorphic to a field, condition (i) also helps us to have some control on the number of simple components that appear in the group algebra \({\mathbb F}_q (G_p\times G_q)\), because of the following elementary facts of Number Theory.

Lemma 6.1

Let \(\ell \) be a positive prime number and \(\,r,\,s\in \mathbb {N}^*\). Then

$$\begin{aligned} \,{\mathbb F}_{\ell ^r}\otimes _{{\mathbb F}_{\ell }} {\mathbb F}_{\ell ^s}\,\cong \,\gcd ( r,s)\cdot {\mathbb F}_{\ell ^{{\text {lcm}} (r,s)}}. \end{aligned}$$

Lemma 6.2

Let \(r,\,s\in {\mathbb N}\) be non-zero elements such that \(\gcd (r,s)=2\). Let \(u\in {\mathbb F}_{2^{r}}\,\) and \(v\in {\mathbb F}_{2^{s}}\,\) be elements satisfying the equation \(\,x^2+x+1=0\). Then

$$\begin{aligned} {\mathbb F}_{2^{r}}\otimes _{{\mathbb F}_{2}}\,{\mathbb F}_{2^{s}}\cong {\mathbb F}_{2^{\frac{rs}{2}}}\oplus \,{\mathbb F}_{2^{\frac{rs}{2}}} \end{aligned}$$
(12)

and \(\,e_1\,=\,(u\otimes v)\,+\,(u^2\otimes v^2)\,\) and \(\,e_2\,=\,(u\otimes v^2)\,+\,(u^2\otimes v)\,\) are the primitive idempotents generating to the simple components of (12).

Methods to determine idempotent generators for minimal cyclic codes were given in [5, 6, 70] using representation theory. We develop our results without appealing to representation theory, working inside the group algebra.

For two co-cyclic subgroups H of \(G_p\) and K of \(G_q\), consider the respective idempotents \(e_H =\widehat{H} -\widehat{H^*}\) in \({\mathbb F}_2 G_p\) and \(e_K = \widehat{K} -\widehat{K^*}\) in \({\mathbb F}_2 G_q\). Clearly \(\widehat{G_p}\cdot \widehat{G_q}=\widehat{G_p\times G_q}\) is a primitive idempotent of \({\mathbb F}_2 G={\mathbb F}_2 (G_p\times G_q)\).

It is ease to prove that idempotents of the form \(\widehat{G_p} \cdot e_K\) and \(e_H\cdot \widehat{G_q}\) are primitive in \({\mathbb F}_2 G\). We proved that each idempotent of the form \(e_H\cdot e_K\) decomposes as the sum of two primitive idempotents in \({\mathbb F}_2 G\), by the following argument. For \(e_H=\widehat{H}-\widehat{H^*}\), set \(a\in H^*{\setminus }H\) (hence aH is a generator of \(H^*/H\)). Set

$$\begin{aligned} u\,=\,\left\{ \begin{array}{ll} a^{2^0}\,+\,a^{2^2}\,+\,\cdots \,+\,a^{2^{p-3}}, &{}\quad \text{ if } \;p\equiv 1 ({\text {mod}} 4)\;\text{ or }\\ 1\,+\,a^{2^0}\,+\,a^{2^2}\,+\,\cdots \,+\,a^{2^{p-3}}, &{}\quad \text{ if } \;p\equiv 3 ({\text {mod}} 4) \end{array}\right. \end{aligned}$$
(13)

and

$$\begin{aligned} u'\,=\,\left\{ \begin{array}{ll} a^{2}\,+\,a^{2^3}\,+\,\cdots \,+\,a^{2^{p-2}}, &{}\quad \text{ if } \;p\equiv 1 ({\text {mod}} 4)\;\text{ or }\\ 1\,+\,a^{2}\,+\,a^{2^3}\,+\,\cdots \,+\,a^{2^{p-2}}, &{}\quad \text{ if } \;p\equiv 3 ({\text {mod}} 4) \end{array}\right. \end{aligned}$$
(14)

For \(e_K=\widehat{K}-\widehat{K^*}\), set \(b\in K^*{\setminus }K\) and define v and \(v'\) as in (13) and (14) replacing a by b. As \(\gcd (p^{r-1}(p-1),q^{s-1}(q-1))=2\) we can apply Lemma 6.2 to see that

$$\begin{aligned} e_1(H,K)= & {} u\widehat{H}\cdot v\widehat{K} \;+\; u'\widehat{H}\cdot v'\widehat{K} \text{ and }\\ e_2(H,K)= & {} u\widehat{H}\cdot v'\widehat{K} \;+\; u'\widehat{H}\cdot v\widehat{K} \end{aligned}$$

are primitive orthogonal idempotents such that \(e_1+e_2 = e_He_K\).

Hence, we have shown the following.

Theorem 6.3

[15, Theorem III.1] Let \(G_p\) and \(G_q\) be abelian p and q-groups, respectively satisfying the conditions in (11). For a group G, denote by S(G) the set of subgroups N of G such that \(G/N\ne 1\) is cyclic. Then the set of primitive idempotents in \({\mathbb F}_2 [G_p\times G_q]\) is:

$$\begin{aligned} \widehat{G_p} \cdot \widehat{G_q},&\\ \widehat{G_p}\cdot e_K,&K\in S(G_q),\\ e_H\cdot \widehat{G_q},&H\in S(G_p),\\ e_1(H,K), \ e_2(H,K),&H\in S(G_p), K\in S(G_q). \end{aligned}$$

Particularly, in [15, Section IV] we compute, for each minimal code of \(\,{\mathbb F}_2(C_p\times C_q)\), the generating primitive idempotent, its dimension and give explicitly a basis for it over \({\mathbb F}_2\). In [15, Theorem IV.7] we presented the results on minimum weight for these codes. In [15, Theorem V.1] we deal with the case \({\mathbb F}_2(C_{p^m}\times C_{q^n})\), for \(m\ge 2, n\ge 2\) and extend this technique for three primes as follows.

Theorem 6.4

[15, Theorem IV.10] Let \(\,p_1,\,p_2\,\) and \(\,p_3\,\) be three distinct positive odd prime numbers such that \(\,\gcd (p_i-1,\,p_j-1)=2\), for \(1\le i\ne j\le 3\), and \(\,\bar{2}\) generates the groups of units \(U(\mathbb {Z}_{p_i})\). Then the primitive idempotents of the group algebra \({\mathbb F}_2G\) for the finite abelian group \(\,G=C_{p_1}\times C_{p_2}\times C_{p_3}\), with \(C_{p_1}=<a>\), \(C_{p_2}=<b>\) and \(C_{p_2}=<c>\), are

$$\begin{aligned} e_0= & {} \hat{a}\hat{b}\hat{c}, e_1=\hat{a}\hat{b}(1-\hat{c}), e_2=\hat{a}(1-\hat{b})\hat{c}, e_3=(1-\hat{a})\hat{b}\hat{c},\\ e_4= & {} (uv+u^2v^2)\hat{c}, e_5=(u^2v+uv^2)\hat{c} e_6=(uw+u^2w^2)\hat{b},\\ e_7= & {} (u^2w+uw^2)\hat{b} e_8=(vw+v^2w^2)\hat{a}, e_9=(v^2w+vw^2)\hat{a}\\ e_{10}= & {} (1-\hat{a})(1-\hat{b})(1-\hat{c})+ u^2v^2w+uvw^2\\ e_{11}= & {} (1-\hat{a})(1-\hat{b})(1-\hat{c})+ u^2v^2w^2+uvw\\ e_{12}= & {} (1-\hat{a})(1-\hat{b})(1-\hat{c})+ u^2vw+uv^2w^2 and\\ e_{13}= & {} (1-\hat{a})(1-\hat{b})(1-\hat{c})+ uv^2w+u^2vw^2, \end{aligned}$$

where \(u=u(a),\, v=v(b),\, w=w(c)\) are defined as in (13).

Comparing and using both the group algebra techniques of [15, 28] with the polynomial techniques of [5], Bastos and Guerreiro [7, 8] improved the presentation of minimal idempotents of length \(p^nq\) given in [41], correcting some coefficients in their expressions.

6.2 Codes of length \(p^n\) also for non-cyclic abelian groups

Let \({\mathbb F}_q\) be a finite field with q elements and G a cyclic group of order \(p^n\) generated by a such that \(\gcd (q,p)=1\). Then the group algebra \({\mathbb F}_q G\) is semisimple and each of its ideals is a direct sum of minimal ones. Under the conditions (b) and (c) of Corollary 2.4, the minimal ideals (codes) are generated by the primitive idempotents given by Theorem 2.5.

In [48] Melo first considered all cyclic codes of \({\mathbb F}_q G\), that is, not only the minimals and computed dimension and minimum weights of these codes, using the following result.

Lemma 6.5

[25, Proposição 2.1] Under the hypothesis above and considering \(I_i\) the minimal ideal of \({\mathbb F}_q G\) generated by the primitive idempotent \(e_i\), as in (4), for \(1\le i\le n\), we have

$$\begin{aligned} d(I_i)=2|G_i|=2p^{n-i} \quad \text{ and } \quad {\text {dim}}_{{\mathbb F}_q}I_i=\phi (p^i)=p^i-p^{i-1}, \end{aligned}$$

and a basis for \(I_i\) is

$$\begin{aligned} \mathcal {B}_i=\{ a(1-b)\widehat{G_i}\,|\, a \in A, 1\ne b \in B \}, \end{aligned}$$

with A a transversal of \(G_{i}\) in \(G_{i-1}\) and B a transversal of \(G_i\) in G. For the minimal code \(I_0=({\mathbb F}_q G) e_0\), we have

$$\begin{aligned} w(I_0)=p^n \quad \text{ and } \quad {\text {dim}}_{{\mathbb F}_q}I_0= 1. \end{aligned}$$

Considering that the dimension of a direct sum of ideals is the sum of their dimensions, Melo [48, 49] focused her attention on computing minimum weight of the direct sum of minimal ideals as follows.

Theorem 6.6

Under the hypothesis of this section and of Lemma 6.5, we have:

  1. (i)

    [48, Lema 2.3] if \(0< i < j\), then \(w(I_i\oplus I_j) = 2|G_j|=2p^{n-j}\).

  2. (ii)

    [48, Lema 2.4] If \(1< j\), then \(w(I_0\oplus I_j) = 2|G_j|=2p^{n-j}\).

  3. (iii)

    [48, Lema 2.5] If \(I=I_0\oplus I_1\), then \(w(I) = |G_1|=p^{n-1}\).

  4. (iv)

    [48, Lema 2.6] If \(I=\bigoplus _{i=0}^{t} ({\mathbb F}_q G) e_i\), then \(I = ({\mathbb F}_q G) \widehat{G_t}\) and \(w(I) = |G_t|=p^{n-t}\).

  5. (v)

    [48, Lema 2.7] If \(I=\bigoplus _{k=0}^{t} ({\mathbb F}_q G) e_{i_k}\), with \(0\le i_1 < i_2 < \cdots < i_t\) and \( e_{i_1}+e_{i_2} + \cdots + e_{i_t}\ne e_{0}+e_{1} + \cdots + e_{t} \), then \(w(I) = 2|G_{i_t}|=2p^{n-i_t}\).

Melo [48, Seção 2.3] also considered the distribution of weights for these cyclic codes. Furthermore, in [48, Capítulo 3], she briefly compared cyclic and non-cyclic abelian codes of length \(p^2\), fully exploring some examples using GAP Wedderga package (www.gap-system.org/Packages/wedderga.html).

For the group \(G=C_p\times C_p=\langle a\rangle \times \langle b\rangle \) and \({\mathbb F}_q\) a finite field of q elements such that \(\bar{q}\) generates \(U(\mathbb {Z}_p)\), the idempotents of \({\mathbb F}_q G\) are

$$\begin{aligned} e_0=\widehat{G}, e_1=\widehat{a}-\widehat{G}, e_2=\widehat{b}-\widehat{G},f_i=\widehat{ab^i}-\widehat{G}, \text{ with } 1\le i\le p-1. \end{aligned}$$

Note that if H and K are any among the subgroups \(\langle a\rangle \), \(\langle b\rangle \),\(\langle ab^i\rangle \), with \(1\le i\le p-1\), then \(G=H\times K\). For the idempotents \(e=\widehat{H}-\widehat{G}\) and \(e=\widehat{K}-\widehat{G}\) associated to H and K, respectively, and considering the ideal \(I= ({\mathbb F}_q G) e \oplus ({\mathbb F}_q G) f\), Melo proved:

Theorem 6.7

[48, Teorema 3.2.1] The minimum weight of the ideal I is \(d(I)=2p-2\) and its dimension is \({\text {dim}}_{{\mathbb F}_q} I = 2p-2\).

6.3 Essential idempotents and one-weight cyclic codes

In [16], a special type of idempotent elements in the semisimple group algebra of a finite abelian group is considered, the so called essential idempotents. These idempotents were previously considered by Bakshi et al. in [6], where they were called non-degenerate, in the special case of group algebras of cyclic groups over finite fields.

Definition 6.8

In a semisimple group algebra \({\mathbb F}_q G\) of a finite group G, a primitive idempotent e is an essential idempotent if \(e\widehat{H}=0\), for every subgroup \(H \ne \{1\}\) in G. A minimal ideal of \({\mathbb F}_q G\) is called an essential ideal if it is generated by an essential idempotent.

The following is a characterization of essential idempotents.

Proposition 6.9

[16, Proposition 2.3] Let \(e\in {\mathbb F}_q G\) be a primitive central idempotent. Then e is essential if and only if the map \(\pi : G \longrightarrow Ge\) is a group isomorphism.

Corollary 6.10

[16, Corollary 2.4] If G is an abelian group and \({\mathbb F}_q G\) contains an essential idempotent, then G is cyclic.

For cyclic groups, Chalom et al. [16] proved the existence of a non-zero central idempotent which is the sum of all essential idempotents. They also give a criteria to determine essential idempotents using the well-known Galois descent method and, as a consequence, compute the number of these idempotents in \({\mathbb F}_q C_n\), for \(C_n\) a cyclic group of order n.

In [16, Section 3] they proved that the coefficients of the primitive idempotents of a semisimple group algebra \({\mathbb F}_q A\), for A a finite abelian group, can be easily computed as a concatenation of the coefficients of an essential idempotent in the group algebras of a cyclic factor of A. In terms of coding theory, this will imply that every minimal abelian code generated by a non essential idempotent is a repetition code: their elements can be written as repetitions of the coefficients of elements in a cyclic code generated by an essential idempotent. In particular, one application of this is to determine the weight distribution of all codes when the weight distributions of codes generated by essential idempotents are known.

Nascimento, in her Ph.D. Thesis [51], uses this notion of essential idempotents to state conditions for a cyclic code in \({\mathbb F}_q C_n\) to be a one-weight code. Besides, she describes precisely the form of the elements on such a code and determines the number of one-weight codes in \({\mathbb F}_q C_n\). She also constructs examples of two weight codes in \({\mathbb F}_q (C_n\times C_n)\) and gives conditions to ensure that a code is of constant weight in \({\mathbb F}_q A\), for A an abelian group. Her work simplifies many of the proofs given by Vega [72] for the same facts. In the literature there is also an interesting paper by Wood [78] on linear codes of constant weight.

7 Codes over rings

In the 1990’s many papers on cyclic codes over rings started to appear, motivated by the fact that good non linear binary codes were related to linear codes over \(\mathbb {Z}_4\) (see, for example, [17, 38, 54]). In 1996, the paper [36] by Hammons et al. won the best paper award for Information Theory of the IEEE-IT Society in the Symposium of IT—Whistler (Canadá). Wood [76] addressed the problem of duality for modules over finite chain rings and applied it to equivalence of codes and to the extension theorem of MacWilliams.

In [14] Carlderbank e Sloane determine the structure of cyclic codes over \(\mathbb {Z}_{p^m}\). Later on, in [38] Kanwar and López–Permouth did the same, but with different proofs. With the same techniques, Wan [73] extended the results from [38] to cyclic codes over Galois rings. Em 1999, Norton and Sălăgean–Mandache in [52] extended results of [14, 38] to cyclic codes over finite chain rings and later on, in 2004, Dinh and López–Permouth in [19] prove the same results in a different way.

Codes over rings were the main subject of the CIMPA Summer School in 2008 [71]. Further developments can be found in [18, 42, 47] and a small survey is in [33].

In [68, 69] Silva used group ring approach to characterize cyclic codes over chain rings, their duals and some conditions on self-dual codes, simplifying the proofs and improving results given in [19].

Let R be a finite commutative chain ring with unity such that \(\mid R \mid =q^k\), for a prime q. For M the maximal ideal of R, the quotient \(\overline{R}=\frac{R}{M}\) is a field and we work under the hypotesis that \(q\not \mid \mid G \mid \), for a finite cyclic group G. Under these conditions, the group ring RG is a principal ideal ring, as Silva proves in [68, Teorema 2.1.9], after characterizing all the ideals in RG. The following general fact is a basis for all Silva’s work.

Theorem 7.1

[68, Teorema 2.1.2] Let R be a local ring, with \(\mid R \mid =q^k\) and maximal ideal \(M=\left<a\right>\), and G a cyclic group of order n such that \(q \not \mid n\). If \(\{\overline{e}_0,\ldots ,\overline{e}_m\}\) is a full set of primitive orthogonal idempotents in \(\overline{R}G\), then \(\{e_0,\ldots ,e_m\}\) is a full set of primitive orthogonal idempotents in RG.

The next theorem characterizes all cyclic codes of length n over the local ring \(RG e_i\) (see [68, Corollary 11.31]), for R a chain ring and \(e_i\) a primitive orthogonal idempotent, translating results of [19] to the group ring setting. To simplify the notation we write \((RG)a^je_i\) as \(\langle a^je_i\rangle \).

Theorem 7.2

[68, Teorema 2.1.3] Let R be a commutative finite chain ring with unity, \(\mid R \mid =q^k\), \(M=\langle a\rangle \) the maximal ideal of R and t the nilpotency index o índice de nilpotência of a in R. Let \(G=C_n\) such that \(q\not \mid n\). If I is an ideal of \(RGe_i\), then I is of the form \(I=\langle a^{k_i} e_i\rangle \), with \(0\le k_i \le t\).

Corollary 7.3

[68, Corollary 2.1.4] Under the same hypothesis of Theorem 7.2, the ideal \(RGe_i\) is indecomposable in RG and the code \(\langle a^{t-1}e_i\rangle \) is minimal.

From this we have a characterization of all cyclic codes of length n over chain rings.

Theorem 7.4

Let R be a commutative finite chain ring with unity, \(\mid R \mid =q^k\), \(M=\langle a\rangle \) the maximal ideal of R and t the nilpotency index of a in R. Let \(G=\langle g_0\,/\,g_0^n=1\rangle \) be such that \(q\not \mid n\) and \(\{e_0,\ldots ,e_m\}\) be a full set of primitive orthogonal idempotents of RG. Then:

  1. (i)

    [68, Teorema 2.1.5] If I is an ideal of RG, then I is of the form \(I=I_0\oplus \cdots \oplus I_m\), with \(I_i=\langle a^{k_i} e_i\rangle \), for \(0\le k_i \le t\).

  2. (ii)

    [68, Teorema 2.1.8] The number of such codes of length n over R is \((t+1)^{m+1}\).

One important data in a code is its number of words. Next theorem gives this number for cyclic codes over finite chain rings. We have

$$\begin{aligned} RG=RGe_0\oplus \cdots \oplus RGe_m\simeq \frac{R[x]}{\langle x^n-1\rangle }\simeq \frac{R[x]}{\langle f_0 \rangle }\oplus \cdots \oplus \frac{R[x]}{\langle f_m \rangle }, \end{aligned}$$

where \(f_i\) are irreducible factors of \(x^n-1\) and, after reordering the indexes if necessary, we have \(RGe_i \simeq \frac{R[x]}{\langle f_i \rangle }\). Hence, \(\mid RGe_i \mid =\mid R \mid ^{w_i}\), for \(w_i=deg(f_i)\).

Theorem 7.5

[68, Teorema 2.1.7] Under the same hypothesis of Theorem 7.2, let C be a cyclic code of the form \(C=\langle a^{k_{i_1}}e_{i_1}\rangle \oplus \cdots \oplus \langle a^{k_{i_r}}e_{i_r}\rangle \) in RG. The the number of words in C is \(\mid C \mid = \mid \overline{R} \mid ^{{\sum _{s=1}^{r}}(t-k_{i_s})w_{i_s}}\).

Considering \(*:RG\longrightarrow RG\) the classical involution, Silva also gives a description of the dual cyclic codes in RG as follows.

Theorem 7.6

[68, Teorema 2.2.3] Under the same hypothesis of Theorem 7.4, the dual code of a cyclic code \(C=\langle a^{k_0}e_{0}\rangle \oplus \cdots \oplus \langle a^{k_{m}}e_{m}\rangle \), with \(0\le k_i\le t\), is \(C^{\perp }=\oplus \sum _{r=0}^{m}\langle a^{t-k_{r}}{e_{r}}^*\rangle \).

As in [19], Silva in [68, Section 2.2] states the conditions for the ring R under which the group ring RG admits self-dual codes.

Chapter 3 of [68] is dedicated to codes over chain rings of length \(p^n\), for a prime p, extending the results of Ferraz and Milies [28] and of Melo [48] to this context. Silva also proves in [68, Teorema 3.0.14] some facts about the size of such codes and computes minimum weight of these codes  [68, Teoremas 3.0.15 to 3.0.18], similarly to Theorem 6.6. He also discusses about free codes in RG in [68, Section 3.1] and about MDS codes of length \(p^n\) over R in [68, Section 3.2]. Finally, in [68, Chapter 4], Silva proves all such results for cyclic codes of length \(2p^n\) over finite chain rings.

There are also interesting discussion on equivalence of linear codes over rings in [20, 21, 75, 77].