Next Article in Journal
Dual Graph Laplacian RPCA Method for Face Recognition Based on Anchor Points
Previous Article in Journal
Multi-Domain Digital Twin and Real-Time Performance Optimization for Marine Steam Turbines
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

On the Duality of Codes over Non-Unital Commutative Ring of Order p2

Department of Mathematics, College of Science, Qassim University, Buraydah 51452, Saudi Arabia
Symmetry 2025, 17(5), 690; https://doi.org/10.3390/sym17050690
Submission received: 19 March 2025 / Revised: 22 April 2025 / Accepted: 23 April 2025 / Published: 30 April 2025
(This article belongs to the Section Mathematics)

Abstract

This paper establishes an extended theoretical framework centered on the duality of codes constructed over a special class of non-unital, commutative, local rings of order p 2 , where p is a prime satisfying p 1 mod 4 or p 3 mod 4 . The work expands the traditional scope of coding theory by developing and adapting a generalized recursive approach to produce quasi-self-dual and self-dual codes within this algebraic setting. While the method for code generation is rooted in the classical build-up technique, the primary focus is on the duality properties of the resulting codes—especially how these properties manifest under different congruence conditions on p. Computational examples are provided to illustrate the effectiveness of the proposed methods.

1. Introduction

The recursive extension approach is a well-established and powerful technique in coding theory, particularly effective in constructing self-dual codes over fields and rings [1,2,3]. It typically begins with a self-dual code of length n and incrementally enlarges it to construct a self-dual code of length n + t , where t is small and fixed. This step-by-step process ensures that the extended code maintains the self-duality property. Although such strategies have been widely employed over commutative and unital rings, their adaptation to non-unital, commutative rings has also been examined, yielding promising results in works such as [4,5,6,7,8].
This work initiates a systematic study of self-dual and quasi-self-dual codes over the ring R, defined by two generators a and b, and governed by the following relations:
R =   < a , b | p a = p b = 0 , a 2 = b , a b = 0 > ,
where p is a prime number. This ring is commutative, non-unital, and of order p 2 , aligning with known classifications of such rings as detailed in [9]. While finite fields and rings have long been used as alphabets in coding theory—dating back to the 1940s and 1980s, respectively—recent advances have expanded these ideas to non-unital rings of small order, such as four and nine [4,6].
In this study, we investigate a generalization of a recursive method to develop quasi-self-dual (QSD) codes over a particular class of non-unital, commutative rings of order p 2 , where p is an odd prime satisfying either p 1 mod 4 or p 3 mod 4 . These congruence conditions on p give rise to rich algebraic structures that support the formulation of error-correcting codes with desirable properties. Within the scope of this work, QSD codes are defined as self-orthogonal codes of length n and size p 2 . As with other local rings of order p 2 , the residue and torsion codes play a fundamental role in the structure and characterization of Q S D codes.
This paper is structured as follows: Section 2 introduces the foundational definitions and notations. Section 3 explores dual codes over R in the case where p 1 mod 4 , while Section 4 focuses on the case p 3 mod 4 . In Section 5, we apply a recursive design approach to present computational examples of self-dual and quasi-self-dual codes over R. Finally, Section 6 concludes with a summary and an outlook on potential future research directions.

2. Codes over a Commutative Non-Unital Local Ring of Order p 2

Let R be a ring generated by a and b under certain relations as follows:
R = a , b | p a = p b = 0 , a 2 = b , a b = 0 .
Thus, R has a characteristic p and consists of p 2 elements. It can be expressed as e l m = l a + m b , where 0 l , m p . R is commutative without being multiplicative, according to its ring representation, and it contains an unique maximal ideal J b = e p m , where 0 m p . We can thus write R as
R = a u + b v | u , v F p .
The reduction map modulo J b is defined as σ : R R / J b F p by σ ( e l m ) = l , where 0 l p . This map is extended in a natural way into a map from R n to F p n
A linear R code  C of length n is defined as an R submodule of R n . It might be viewed as the R span of the rows in a matrix known as a generator matrix, where we assume that the rows are from C . There are two codes of length n associated with the code C . The residue code  r e s ( C ) is just σ C , and the torsion code  t o r ( C ) is u F p n | b u C .
It is simple to verify the claim that r e s ( C ) t o r ( C ) [6]. The dimensions of the residue and torsion codes are denoted by k 1 and k 1 + k 2 , respectively. This form of code, C , is called type { k 1 , k 2 } .
According to the first isomorphism theorem, C = r e s ( C ) t o r ( C ) = p 2 k 1 + k 2 .
The inner product of u = ( u 1 , , u n ) , v = ( v 1 , , v n ) R n is defined as follows:
( u , v ) = u 1 v 1 + + u n v n .
The module
C = v R n | ( u , v ) = 0 u C
is called the dual code C of the code C . If C = C , then the R-code C is said to be self-dual; moreover, C is self-orthogonal if C C . We follow here conventions and methods similar to those discussed in [10,11].
According to [6] terminology, an R code of length n that is self-orthogonal and of size p n is referred to as a quasi-self-dual (QSD) code upon switching from a characteristic value of two to p.
With an R code, C can be attached as an additive F p 2 n -code by the map ϕ : R F p 2
ϕ ( 0 ) = 0 , ϕ ( a ) = 1 / 2 , and ϕ ( b ) = v ,
for v F p 2 F p , such that ( v ) p v mod p . One can easily see that T r ( ϕ ( c ) ) = σ ( c ) for all c R n .
We shall simply substitute codes over F p for codes in the proofs to extend a few conclusions from [7,12] in Theorem 1.
Theorem 1. 
Let C be a linear code over R. Let k 1 + k 2 n , and let n and k 1 + k 2 be non-negative integers. Then, the following hold:
(i) 
All linear codes C over R of length n and type k 1 , k 2 are equal to standard form codes within the generator matrix.
a I k 1 a U V 0 b I k 2 b W ,
where V is a matrix with entries in R; U and W are matrices with entries in F p ; and I k 1 and I k 2 are identity matrices.
(ii) 
C = a res ( C ) + b tor ( C )
We indicate the code of length n over R with the generator matrix G by R k G if G is a k × n matrix over R [13].
Theorem 2. 
A linear code C of length n over R is self-orthogonal if and only if res ( C ) is a self-orthogonal code over F p .
Proof. 
Let u 1 , u 2 res ( C ) and v 1 , v 2 F p n . For any codewords of the form a u 1 + b v 1 and a u 2 + b v 2 in C, we compute the inner product:
( a u 1 + b v 1 ) · ( a u 2 + b v 2 ) = a 2 ( u 1 · u 2 ) + a b ( u 1 · v 2 + v 1 · u 2 ) + b 2 ( v 1 · v 2 ) .
Using the ring relations a 2 = b , a b = 0 , and b 2 = 0 , this simplifies to:
b ( u 1 · u 2 ) .
Therefore, the inner product of two codewords in C lies in the ideal generated by b and depends only on the dot product of their residue components. Consequently, C is self-orthogonal if and only if res ( C ) is self-orthogonal over F p . □
Next, we adapt the construction of quasi-self-dual codes in [12] such that they may be applied to an odd prime number p.
Theorem 3. 
If a code is linear C = a res ( C ) + b tor ( C ) of length n over the ring R, then C is quasi-self-dual if and only if the following conditions hold:
(i) 
res ( C ) is a self-orthogonal [ n , k 1 ] -code over F p .
(ii) 
tor ( C ) is an [ n , n k 1 ] -code over F p .
Proof. 
(i)
This follows directly from Theorem 2, which states that a code C over R is self-orthogonal if and only if its residue code res ( C ) is self-orthogonal over F p . Hence, if res ( C ) is self-orthogonal, then so is C .
(ii)
Since res ( C ) has dimension k 1 and tor ( C ) has dimension n k 1 , the total size of C is:
| C | = | res ( C ) | · | tor ( C ) | = p k 1 · p n k 1 = p n .
This confirms that C has the correct size to be quasi-self-dual.
The following result parallels Theorems 3 through 5 in [7].
Theorem 4. 
Let C be a linear code of length n over the ring R, expressed in the form C = a , res ( C ) + b , tor ( C ) . Then C is self-dual if and only if the following two conditions are satisfied:
  • The residue code res ( C ) is self-dual over F p ;
  • The torsion part satisfies tor ( C ) = F p n .
When these conditions hold, the code C admits the explicit decomposition:
C = a res ( C ) b F p n ,
and its cardinality is given by:
C = p 3 n 2 .

Additive Codes over F p 2

The additive code C of length n over F p 2 is an additive subgroup of F p 2 n . Thus, C is referred to as a ( n , p k ) code as it comprises p k code words for some integer 0 k 2 n . In the event that C has a minimum distance d, we write ( n , p k , d ) as the parameters of C . A generator matrix is a k × n generator matrix with entries from F p 2 whose rows span C that may be used to represent an additive code C over F p 2 . In other words, C is the F p span of its rows.
In F p 2 , let ω be a primitive element. Its order is r = p 2 1 , and its ω t 1 0 t r . Consequently, F p 2 = 0 , 1 , ω , ω 2 , , ω r 1 . The definition of the trace map T r : F p 2 F p is T r ( x ) = x + x p .

3. Results on Duality Codes over R of Order p 2 , with p as a Prime Number and p 1 mod 4

In this section, we study quasi-self-dual and self-dual codes over a ring R. We introduce a building-up method that serves as a powerful tool for generating codes of larger length while preserving their duality properties. Specifically, we extend the building-up technique previously developed for quasi-self-dual codes over commutative non-unital rings of order four [6], applying it to quasi-self-dual codes over commutative non-unital rings of order p 2 , where p is the power of an odd prime. To ensure the applicability of our construction, the element 1 must be a square in the non-unital ring of order p 2 .
Lemma 1. 
Let p be an odd prime; then, 1 is a square in F p 2 if and only if p 1 mod 4 .
Proof. 
It is known that 1 is a square in F p if ( 1 ) ϕ ( p 2 2 ) 1 mod 4 , where ϕ is Euler’s phi function. Equivalently, ( 1 ) p ( p 1 ) 2 1 mod 4 . Since p is odd, the result follows. □
Lemma 2. 
Let F q be a finite field of characteristic p. If p = 2 or p 1 ( mod 4 ) , then a self-dual code of length n exists over F q if and only if n 0 ( mod 2 ) .
Proof. 
We may assume that the code C appearing in the decomposition of C in [14] (Theorem 4.2) is a Euclidean self-dual code over F p of length n. Let n = 2 k . Consider the generator matrix 1 c , where c 2 = 1 ; this defines a Euclidean self-dual code of length 2 over F p . This matrix gives rise to a self-dual code C of length 2 over the ring. Consequently, a self-dual code of length n = 2 k over the ring can be constructed as the direct sum of k copies of C . □
Lemma 3. 
Using the notation introduced above, the following holds: If p = 2 or p 1 ( mod 4 ) , then a self-dual code of length n exists over R if and only if n 0 ( mod 2 ) .
Lemma 4. 
Let p be a power of an odd prime such that p = 2 or p 1 ( mod 4 ) . Then there exist elements t , s F p such that
t 2 + s 2 = 0 in F p .
We now present a theorem describing the recursive build-up method. Starting from an initial quasi-self-dual code of length n, this method constructs a new quasi-self-dual code of length n + 2 . The recursive build-up technique is particularly effective for generating quasi-self-dual codes of arbitrary large lengths over the ring R.
Theorem 5. 
Let C 0 be a quasi-self-dual code over R of length n with generator matrix G 0 = ( r i ) , where r i denotes the i-th row of G 0 for i = 1 , 2 , , m . Let u F p n and let α , γ R (not both zero) satisfy the relation t α + s γ = 0 . Define v i = ( u , r i ) for 1 i m .
Consider the set of m + 1 vectors given by:
α , 0 , s γ u , t v 1 , s v 1 , r 1 , , t v m , s v m , r m .
The row span of these vectors forms a quasi-self-dual code over R of length n + 2 if one of the following conditions holds:
(i) 
( u , u ) = 1 and α 2 + s 2 γ 2 = 0 ;
(ii) 
( u , u ) = 1 and α 2 s 2 γ 2 = 0 .
Proof. 
It suffices to show that the rows of G are orthogonal to one another. Let v 0 = ( α 0 s γ u ), which is the first row of G , and let v i = ( t ( u , r i ) s ( u , r i ) r i ), which is the i + 1 st row of G , for i = 1 , 2 , , m .
(i)
If ( u , u ) = 1 and α 2 + s 2 γ 2 = 0 , then
( v 0 , v 0 ) = α 2 + s 2 γ 2 ( u , u ) = α 2 + s 2 γ 2 = 0 ( v 0 , v i ) = t α ( u , r i ) + s γ ( u , r i ) = ( t α + s γ ) ( u , r i ) = 0 ( v i , v j ) = t 2 ( u , r i ) ( u , r j ) + s 2 ( u , r i ) ( u , r j ) + ( r i , r j ) = ( t 2 + s 2 ) ( u , r i ) ( u , r j ) = 0
for all i , j = 1 , 2 , , m .
(ii)
If ( u , u ) = 1 and α 2 s 2 γ 2 = 0 , then
( v 0 , v 0 ) = α 2 s 2 γ 2 ( u , x ) = α 2 s 2 γ 2 = 0 ( v 0 , v i ) = t α ( u , r i ) + s γ ( u , r i ) = ( t α + s γ ) ( u , r i ) = 0 ( v i , v j ) = t 2 ( u , r i ) ( u , r j ) + s 2 ( u , r i ) ( u , r j ) + ( r i , r j ) = ( t 2 + s 2 ) ( u , r i ) ( u , r j ) = 0
for all i , j = 1 , 2 , , m .
In both cases, the rows of G are orthogonal, thus proving that the resulting code C is self-orthogonal.
Furthermore, the size of C is given by: C = p 2 C 0 = p n + 2 .
This confirms that C is quasi-self-dual. Hence, the constructed code C , obtained by extending the quasi-self-dual code C 0 , is also quasi-self-dual. □
Theorem 6. 
Any quasi-self-dual code C of length n is obtained from some self-dual code C 0 of length n 2 (up to equivalence) by the construction in Theorem 5.
In the second type of construction, quasi-self-dual codes with two extra generators are also created.
Theorem 7. 
Let C 0 be a quasi-self-dual code over R of length n with a generator matrix G 0 = ( r i ) , where r i is the ith row of G 0 for i = 1 , 2 , , m . Let u F p n , σ J b and t , s , w , q F p , not all zero, such that t + w = 0 , and s + q = 0 . Write v i = ( u , r i ) for 1 i m . Then, the row span of the m + 2 vectors
σ , 0 , w σ u , ( 0 , σ , q σ u ) , ( t v 1 , s v 1 , r 1 ) , , ( t v m , s v m , r m )
is a quasi-self-dual code of length n + 2 .
Proof. 
Let v 0 = σ , 0 , w σ u , v 0 = 0 , σ , q σ u .
We see that ( v 0 , v 0 ) = w q σ 2 ( x , x ) = 0 , as σ 2 = 0 .
Now, let v i = t ( u , r i ) , s ( u , r i ) , r i for 1 i m . Then,
( v 0 , v i ) = t σ ( u , r i ) + w σ ( u , r i ) = σ ( t + w ) ( u , r i ) + ( u , r i ) = 0 .
( v 0 , v i ) = s σ ( u , r i ) + q σ ( u , r i ) = σ ( s + q ) ( u , r i ) + ( u , r i ) = 0 .
Also, for 1 j m ,
( v i , v j ) = t 2 ( u , r i ) ( u , r j ) + s 2 ( u , r i ) ( u , r j ) + ( r i , r j ) = ( t 2 + s 2 ) ( u , r i ) ( u , r j ) = 0 .
Thus, C is a self-orthogonal code. Furthermore, since C = p 2 C 0 = p n + 2 , C is quasi-self-dual. As a result, the code C that the build-up construction produced from the quasi-self-dual code C 0 is also quasi-self-dual. □
Corollary 1. 
The number of options for u determines how many codes are created from a given G 0 , with Theorem 7 producing p n codes.
Remark 1. 
The recursive construction techniques outlined in Theorems 5 and 7 are not applicable to the construction of self-dual codes over the ring R. This is due to the fact that the resulting code C does not attain the required cardinality of p 3 n 2 , which is a necessary condition for self-duality over R.
Now, we offer the building-up structure below and establish that it holds for all self-dual codes over R with p = 2 , or p 1 mod 4 . The ensuing theorem constructs self-dual codes with an additional generator and a two-fold length increase.
Theorem 8. 
Let C 0 be a self-dual code over R of length n with a generator matrix G 0 = ( r i ) , where r i is the ith row of G 0 for i = 1 , 2 , , m . Let u F p n , α , γ R , σ J b and t , s , q F p , not all zero, such that t α + s γ = 0 and q + s = 0 . Write v i = ( u , r i ) for 1 i m . Then, the row span of the following m + 2 vectors
α , 0 , s γ u , ( 0 , σ , q σ u ) , ( t v 1 , s v 1 , r 1 ) , , ( t v m , s v m , r m )
is a self-dual code of length n + 2 if
(i) 
( u , u ) = 1 , and α 2 + s 2 γ 2 = 0 ;
(ii) 
( u , u ) = 1 and α 2 s 2 γ 2 = 0 .
Proof. 
Following the reasoning in Theorem 5, it is sufficient to verify that the vector v 0 = 0 , σ , q σ u is orthogonal to itself and to each vector v i for i = 0 , 1 , , m . Specifically,
( v 0 , v 0 ) = σ 2 + q 2 σ 2 ( u , u ) = 0 , ( v 0 , v 0 ) = s γ q σ ( u , u ) = 0 , ( v 0 , v i ) = s σ ( u , r i ) + q σ ( u , r i ) = σ ( q + s ) ( u , r i ) + ( u , r i ) = 0 ,
given that σ J b . Hence, the code C is self-orthogonal.
Let C 0 ^ denote the subcode generated by the final m vectors. Define S D to be the F p -span of the set { y 1 , y 2 } , where y 1 = ( 1 , 0 , s u ) and y 2 = ( 0 , 1 , q u ) .
Observe that the torsion part of C can be expressed as
tor ( C ) = S D + tor ( C ^ 0 ) .
Since C 0 is self-dual, Theorem 4 ensures that tor ( C 0 ) = F p n . Moreover, by assumption, S D = p 2 , which implies that tor ( C ) = F p n + 2 .
It remains to verify that res ( C ) is self-dual. Given that C is self-orthogonal, it follows that res ( C ) is also self-orthogonal, i.e., res ( C ) res ( C ) .
From Theorem 4, we know that | C 0 | = p 3 n 2 . With two additional generators included in the matrix G , the total size of C becomes | C | = p ( p 2 ) | C 0 | = p 3 ( n + 2 ) 2 . Consequently, we deduce that | res ( C ) | = | res ( C ) | = p n + 2 2 , confirming that res ( C ) is indeed self-dual. □
Remark 2. 
The approach described in Theorem 8 is not applicable to quasi-self-dual codes over the ring R due to a mismatch in cardinality requirements; specifically, such codes do not possess the size p n , which is essential for the method to be valid.
Corollary 2. 
Let C = a res ( C ) + b tor ( C ) be a quasi-self-dual code over the ring R. Then, the minimum Hamming distance of C is equal to that of its torsion component, i.e.,
d ( C ) = d ( tor ( C ) ) .
Proof. 
Define d ( C a ) and d ( C b ) as the minimum distances of the residue part res ( C ) and the torsion part tor ( C ) , respectively. Due to the structure of C and the linearity of code operations, we observe that b tor ( C ) C and that res ( C ) tor ( C ) . This inclusion implies that the minimum distance of C cannot exceed that of tor ( C ) :
d ( C ) d ( C b ) .
To establish equality, consider any nonzero codeword q C . By Theorem 3, we can uniquely express q in the form q = a r + b s , with r res ( C ) and s tor ( C ) . We now consider three exhaustive cases:
  • If r 0 and s = 0 , then q = a r and w t ( q ) = w t ( r ) .
  • If r = 0 and s 0 , then q = b s and w t ( q ) = w t ( s ) .
  • If r 0 and s 0 , then q = a r + b s , and by the weight properties of R, we have
    w t ( q ) w t ( b s ) = w t ( s ) .
In all three scenarios, the weight of any nonzero codeword in C is bounded below by the weight of a nonzero element in tor ( C ) . Thus,
d ( C ) d ( C b ) .
Combining both inequalities yields the conclusion:
d ( C ) = d ( C b ) ,
completing the proof. □
Corollary 3. 
For a self-dual code C over the ring R, expressed as C = a res ( C ) b F p n , the minimum Hamming distance satisfies d ( C ) = 1 .
Proof. 
The conclusion follows immediately from Corollary 2, noting that the minimum distance of the ambient space F p n is 1. □

4. Results on Duality Codes over R of Order p 2 , with p as a Prime Number and p 3 mod 4

In this section, we investigate quasi-self-dual and self-dual codes over a ring R. We introduce a building-up construction for generating these codes, extending the existing method developed for linear codes over non-unital commutative rings of order nine [5]. Our generalization applies to linear codes over commutative non-unital rings of order p 2 , where p is a prime number satisfying p 3 mod 4 .
Lemma 5. 
Let F q be a finite field of characteristic p. If p 3 ( mod 4 ) , then a self-dual code of length n exists over F q if and only if n 0 ( mod 4 ) .
Lemma 6. 
Using the notation introduced above, the following holds: If p 3 ( mod 4 ) , then a self-dual code of length n exists over R if and only if n 0 ( mod 4 ) .
Lemma 7. 
Let p be a prime such that p 3 ( mod 4 ) . Then there exist elements t , s , q F p such that
t 2 + s 2 + q 2 = 0 in F p .
The following theorem comprises the building-up constructions for quasi-self dual codes over R.
Theorem 9. 
Let C 0 be a quasi-self-dual code of length n over R with a generator matrix G 0 = ( r i ) , where r i is the i-th row of G 0 for 1 i m . If u F p n , σ J b and t , s , q , x 1 , x 2 , x 3 F p (not all zero), such that t + x 1 = 0 , s + x 2 = 0 and q + x 3 = 0 , then the code C with the generator matrix
( σ , 0 , 0 , x 1 σ u ) , ( 0 , σ , 0 , x 2 σ u ) , ( 0 , 0 , σ , x 3 σ u ) , ( t ( u , r 1 ) , s ( u , r 1 ) , q ( u , r 1 ) , r 1 ) ,
, ( t ( u , r m ) , s ( u , r m ) , q ( u , r m ) , r m ) ,
is quasi-self-dual of length n + 3 .
Proof. 
We first show that C is self-orthogonal. Define the vectors
v 0 = ( σ , 0 , 0 , x 1 σ u ) , v 0 = ( 0 , σ , 0 , x 2 σ u ) , v 0 = ( 0 , 0 , σ , x 3 σ u ) ,
and for 1 i m ,
v i = ( t ( u , r i ) , s ( u , r i ) , q ( u , r i ) , r i ) .
  • Since x 1 x 2 σ 2 ( u , u ) = 0 and σ J b , the first vector is orthogonal to itself. Similarly, the second and third generators are orthogonal to themselves.
  • The orthogonality between the first three generators and the last m vectors follows since
    σ t ( u , r i ) + x 1 σ ( u , r i ) = ( t + x 1 ) σ ( u , r i ) = 0 .
  • For 1 i , j m , we have
    t 2 ( ( u , r i ) , ( u , r j ) ) + s 2 ( ( u , r i ) , ( u , r j ) ) + q 2 ( ( u , r i ) , ( u , r j ) ) = ( t 2 + s 2 + q 2 ) ( ( u , r i ) , ( u , r j ) ) = 0 ,
    thus the last m vectors are orthogonal to themselves and each other, by the self-orthogonality of C 0 .
  • Finally, for any pair of vectors among the last m generators, the orthogonality condition
    t 2 ( u , r i ) ( u , r j ) + s 2 ( u , r i ) ( u , r j ) + q 2 ( u , r i ) ( u , r j ) = ( t 2 + s 2 + q 2 ) ( u , r i ) ( u , r j ) = 0
    holds, confirming mutual orthogonality.
Therefore, C is self-orthogonal. Moreover, since
C = p 3 C 0 = p n + 3 ,
it follows that C is quasi-self-dual. □
The following theorem comprises the building-up constructions for quasi-self-dual codes over R with four extra lengths:
Theorem 10. 
Let C 0 be a quasi-self-dual code over R of length n with a generator matrix G 0 = ( r i ) , where r i is the ith row of G 0 for i = 1 , 2 , , m . Let u 1 , u 2 F p n , such that ( u 1 , u 2 ) = 0 and ( u i , u i ) = 1 for i = 1 , 2 . For 1 i m , define x i = ( u 1 , r i ) and y i = ( u 2 , r i ) . If α , β R J b , such that 1 t 2 = 0 , then the code C with the generator matrix
( α , 0 , 0 , 0 , t α u 1 ) , ( 0 , β , 0 , 0 , t β u 2 ) , ( t x 1 , t y 1 , s x 1 q y 1 , q x 1 + s y 1 , r 1 ) ,
, ( t x m , t y m , s x m q y m , q x m + s y m , r m ) ,
is quasi-self-dual of length n + 4 .
Proof. 
  • First, we show that C is self-orthogonal. Since α 2 + t 2 α 2 ( u 1 , u 1 ) = α 2 ( 1 t 2 ) = 0 , the first generator is orthogonal to itself. Similarly, the second generator is orthogonal to itself.
  • The relation t 2 α β ( u 1 , u 2 ) = 0 confirms that the first generator is orthogonal to the second generator.
  • The identity t α x i t α x i = 0 shows that the first (or second) generator is orthogonal to each of the last m generators.
  • Finally, the orthogonality among the last m generators follows from the computation:
    t 2 ( x i , x j ) + t 2 ( y i , y j ) + s 2 ( x i , x j ) + s q ( x i , y j ) + s q ( x j , y i ) + q 2 ( y i , y j ) + q 2 ( x i , x j ) s q ( x i , y j ) s q ( x j , y i ) + s 2 ( y i , y j ) = 0 ,
    which holds by the self-orthogonality of C 0 .
Thus, C is a self-orthogonal code.
Furthermore, since
C = ( p 2 ) 2 C 0 = p n + 4 ,
the code C is quasi-self-dual. □
The following section provides a construction method of order four for self-dual codes withfour generators.
Theorem 11. 
Let C 0 be a self-dual code over R of length n with a generator matrix G 0 = ( r i ) , where r i is the ith row of G 0 for i = 1 , 2 , , m . Let u 1 , u 2 F p n , such that ( u 1 , u 2 ) = 0 and ( u i , u i ) = 1 for i = 1 , 2 . For 1 i m , define x i = ( u 1 , r i ) and y i = ( u 2 , r i ) . If α , β R J b , such that 1 t 2 = 0 , and by letting σ J b , the code C with the generator matrix
( α , 0 , 0 , 0 , t α u 1 ) , ( 0 , β , 0 , 0 , t β u 2 ) , ( 0 , 0 , σ , 0 , σ ( s u 1 + q u 2 ) , ( 0 , 0 , 0 , σ , σ ( q u 1 s u 2 ) ,
( t x 1 , t y 1 , s x 1 q y 1 , q x 1 + s y 1 , r 1 ) , , ( t x m , t y m , s x m q y m , q x m + s y m , r m ) ,
is self-dual of length n + 4 .
Proof. 
The self-orthogonality of the code C follows by analogy with the argument presented in Theorem 10, where the inner product structure over R ensures that each codeword satisfies the self-orthogonality condition. Moreover, the self-duality of C follows similarly to Theorem 8, where the decomposition C = a res ( C ) b F p n + 4 is established, along with verification of the size condition | C | = p 3 ( n + 4 ) 2 . □

5. Numerical Results and Examples

In this section, we demonstrate the application of the theories and constructions developed in the previous sections through several illustrative examples. The focus is on generating quasi-self-dual and self-dual codes over a commutative non-unital ring of order p 2 . Special attention is given to constructing codes of various lengths and types, while analyzing how parameters such as the choice of vectors and generator matrices influence the structure and weight distributions of the resulting codes. These examples not only showcase the versatility and effectiveness of the proposed methods but also provide a deeper insight into the process of constructing and analyzing quasi-self-dual codes. For a broader understanding of the general principles of coding theory that underpin these constructions, we refer the reader to [15,16].
All computations were performed using the computer algebra system [17].
Example 1. 
Let p = 17 and the ring R be defined by the relations
R = a , b | 17 a = 17 b = 0 , a 2 = b , a b = 0 .
We begin with a quasi-self-dual code of length 4, denoted as a ( 4 , 17 4 , 2 ) -type code, characterized by the following generator matrix:
G 1 = e 11 e 44 e 11 e 44 0 e ( 17 ) ( 2 ) e ( 17 ) ( 1 ) e ( 17 ) ( 1 ) e ( 17 ) ( 2 ) e ( 17 ) ( 1 ) e ( 17 ) ( 1 ) 0 .
The corresponding Hamming weight enumerator is x 4 + 96 x 2 y 2 + 960 x y 3 + 82 , 464 y 4 . Using Theorem 5, we extend this code to quasi-self-dual codes of length 6. The generator matrix for the new code is
G 1 , 1 = e 44 0 e 11 e 22 e 22 e 33 e 52 e 11 e 11 e 44 e 11 e 44 e 51 0 0 e ( 17 ) ( 2 ) e ( 17 ) ( 1 ) e ( 17 ) ( 1 ) e 51 0 e ( 17 ) ( 2 ) e ( 17 ) ( 1 ) e ( 17 ) ( 1 ) 0 .
The Hamming weight enumerator for this code is
x 6 + 320 x 3 y 3 + 3360 x 2 y 4 + 493 , 440 x y 5 + 23 , 640 , 448 y 6 .
Example 2. 
(Quasi-self-dual codes over the ring I 5 )
Let p = 5 and define the ring R by the relations
R = a , b | 5 a = 5 b = 0 , a 2 = b , a b = 0 .
We begin with a quasi-self-dual code of length 3, a ( 3 , 5 3 , 2 ) -type code. The generator matrix is
G 1 = e 15 e 25 e 53 e 51 e 51 0 .
The Hamming weight enumerator for this code is x 3 + 32 x y 2 + 92 y 3 Applying Theorem 5(i), we extend this code to a quasi-self-dual code of length 5. The new generator matrix is
G 1 , 1 = e 22 0 e 33 e 11 e 11 e 52 e 53 e 15 e 25 e 53 e 51 e 54 e 51 e 51 0 .
The weight distribution is [<0, 1>, <2, 12>, <3, 64>, <4, 456>, <5, 2592>].
Additionally, by applying Theorem 5(ii) with a different vector u = ( 2 , 1 , 2 ) , we obtain another quasi-self-dual code of length 5 with a different weight distribution: [<0, 1>, <2, 8>, <3, 36>, <4, 524>, <5, 2556>].
From the previous example, we have the following remark:
Remark 3. 
If two quasi-self-dual R-codes are monomially equivalent, they have the same residue code. However, the contrary is not true, as demonstrated by the example above.
Example 3. 
Let p = 13 and R be the ring defined by the relations
R = a , b | 13 a = 13 b = 0 , a 2 = b , a b = 0 .
The generator matrix for the base code of length 4 is
G 3 = e ( 13 ) ( 1 ) 0 0 0 0 e ( 13 ) ( 1 ) 0 0 0 0 e ( 13 ) ( 1 ) 0 0 0 0 e ( 13 ) ( 1 ) .
By applying Theorem 7 and selecting parameters, we extend this code to length 6. The new generator matrix is
G 3 , 1 = e ( 13 ) ( 1 ) 0 0 e ( 13 ) ( 2 ) e ( 13 ) ( 1 ) e ( 13 ) ( 2 ) 0 e ( 13 ) ( 1 ) 0 e ( 13 ) ( 1 ) e ( 13 ) ( 8 ) e ( 13 ) ( 1 ) 0 0 e ( 13 ) ( 1 ) 0 0 0 e ( 13 ) ( 11 ) e ( 13 ) ( 10 ) 0 e ( 13 ) ( 1 ) 0 0 e ( 13 ) ( 12 ) e ( 13 ) ( 5 ) 0 0 e ( 13 ) ( 1 ) 0 e ( 13 ) ( 11 ) e ( 13 ) ( 10 ) 0 0 0 e ( 13 ) ( 1 ) .
The corresponding weight distribution is
[ < 0 , 1 > , < 1 , 72 > , < 2 , 2160 > , < 3 , 34560 > , < 4 , 311040 > , < 5 , 1492992 > , < 6 , 2985984 > ] .
Example 4 
(Self-Dual Code of Length 4 to Length 6).
Let p = 2 and R = a , b | 2 a = 2 b = 0 , a 2 = b , a b = 0 . Moreover, by using Theorem 7, we have
G = e 21 0 e 21 u 0 e 21 e 21 u ( u , r 1 ) ( u , r 1 ) r 1 ( u , r m ) ( u , r m ) r m ,
using Theorem 3, we construct quasi-self-dual codes with a length of 6 from a ( 4 , 2 4 , 1 ) code of type 1 , 2 with a generator matrix
G 3 = e 12 e 21 e 12 e 21 0 e 21 e 21 0 e 21 0 0 e 21 ,
and weight distribution [ < 0 , 1 > , < 2 , 8 > , < 3 , 4 > , < 4 , 3 > ] .
Using G 3 as the base generator matrix and u = ( 1 , 0 , 1 , 0 ) , we obtain a quasi-self-dual ( 6 , 2 6 , 1 ) code of type 1 , 4 with a generator matrix
G 3 , 1 = e 21 0 e 21 0 e 21 0 0 e 21 e 21 0 e 21 0 0 0 e 12 e 21 e 12 e 21 e 21 e 21 0 e 21 e 21 0 e 21 e 21 e 21 0 0 e 21 ,
and weight distribution
[ < 0 , 1 > , < 1 , 2 > , < 2 , 9 > , < 3 , 20 > , < 4 , 19 > , < 5 , 10 > , < 6 , 3 > ] .
Using G 3 , 1 with u = ( 1 , 1 , 1 , 0 , 1 , 1 ) , we obtain a quasi-self-dual ( 8 , 2 8 , 1 ) code of type 1 , 6 with a generator matrix
G 3 , 1 , 1 = e 21 0 e 21 e 21 e 21 0 e 21 e 21 0 e 21 e 21 e 21 e 21 0 e 21 e 21 e 21 e 21 e 21 0 e 21 0 e 21 0 e 21 e 21 0 e 21 e 21 0 e 21 0 e 21 e 21 0 0 e 12 e 21 e 12 e 21 e 21 e 21 e 21 e 21 0 e 21 e 21 0 0 0 e 21 e 21 e 21 0 0 e 21 ,
and weight distribution
[ < 0 , 1 > , < 1 , 2 > , < 2 , 18 > , < 3 , 42 > , < 4 , 60 > , < 5 , 70 > , < 6 , 46 > , < 7 , 14 > , < 8 , 3 > ] .
Example 5. 
Consider the case where p = 5 . Starting with a self-dual code of length 2 over the ring R, with parameters ( 2 , 5 3 , 1 ) and type 1 , 1 , we define its generator matrix as follows:
G 2 = e 15 e 25 0 e 51 .
This code yields the Hamming weight enumerator: x 2 + 8 x y + 116 y 2 .
Using part ( i ) of Theorem 8, we have
G = e 22 0 e 11 u 0 e 51 4 e 51 u 2 ( u , r 1 ) ( u , r 1 ) r 1 2 ( u , r m ) ( u , r m ) r m ,
with u = ( 0 , 4 ) , we obtain a self-dual ( 4 , 5 6 , 1 ) code with a generator matrix
G 2 , 2 = e 22 0 0 e 44 0 e 51 0 e 54 e 15 e 35 e 15 e 25 e 53 e 54 0 e 51 ,
and Hamming weight enumerators
x 4 + 16 x 3 y + 296 x 2 y 2 + 1856 x y 3 + 13 , 456 y 4 .
Using part ( i i ) of Theorem 8, we have
G = e 11 0 2 e 22 u 0 e 51 3 e 51 u ( u , r 1 ) 2 ( u , r 1 ) r 1 ( u , r m ) 2 ( u , r m ) r m .
with u = ( 3 , 0 ) , we obtain a self-dual ( 4 , 5 6 , 2 ) code with a generator matrix
G 2 , 2 = e 22 0 0 e 44 0 e 51 0 e 54 e 15 e 35 e 15 e 25 e 53 e 54 0 e 51 ,
which also exhibits the same Hamming weight enumerator:
x 4 + 16 x 3 y + 296 x 2 y 2 + 1856 x y 3 + 13456 y 4 .
From the previous example, we have the following lemma:
Lemma 8. 
In the case of two self-dual codes ( C and C ´ ) over R, they may be considered monomially equivalent only if their residue codes match.

6. Conclusions

This study focused on generating duality codes over a non-unital commutative ring R of order p 2 , specifically examining the cases where p 1 ( mod 4 ) and p 3 ( mod 4 ) , with p being an odd prime. By analyzing these two distinct scenarios, we explored the unique algebraic structures that arise in each case and their implications for the design and properties of duality codes.
The results provide valuable insights into how the congruence condition on p influences the construction of such codes, offering a deeper understanding of their potential applications in areas such as cryptography, coding theory, and secure communications. Our comparative analysis further highlights the versatility of duality codes over non-unital rings and lays a foundation for future advancements in the field.
For future research, the proposed building-up method could be extended to other classes of finite rings, including non-commutative or higher-order rings. Investigating the performance of the constructed codes under various channel models or within practical cryptographic protocols would also be a worthwhile direction. Furthermore, developing efficient encoding and decoding algorithms, as well as exploring connections with other algebraic structures (such as modules or lattices), presents a promising avenue for further study.

Funding

This research was supported by the Deanship of Graduate Studies and Scientific Research at Qassim University (Grant No. QU-APC-2025).

Data Availability Statement

Data can be made available upon request from the corresponding author.

Acknowledgments

The Researcher would like to thank the Deanship of Graduate Studies and Scientific Research at Qassim University for financial support (QU-APC-2025).

Conflicts of Interest

The author declares no conflicts of interest.

References

  1. Han, S.; Lee, H.; Lee, Y. Construction of self-dual codes over F2 + uF2. Bull. Korean Math. Soc. 2012, 49, 135–143. [Google Scholar] [CrossRef]
  2. Kim, J.-L.; Lee, Y. Euclidean and hermitian self-dual MDS codes over large finite fields. J. Comb. Theory Ser. 2004, 105, 79–95. [Google Scholar] [CrossRef]
  3. Kim, J.-L.; Lee, Y. An efficient construction of self-dual codes. Bull. Korean Math Soc. 2015, 52, 915–923. [Google Scholar] [CrossRef]
  4. Alahmadi, A.; Alihia, T.; Betty, R.A.; Galvez, L.; Solé, P. The build-up construction for codes over a commutative non-unitary ring of order 9. Mathematics 2024, 12, 860. [Google Scholar] [CrossRef]
  5. Alahmadi, A.; Alihia, T.; Solé, P. The build up construction for codes over a non-commutative non-unitary ring of order 9. AIMS Math. 2024, 9, 18278–18307. [Google Scholar] [CrossRef]
  6. Alahmadi, A.; Alkathiry, A.; Altassan, A.; Bonnecaze, A.; Shoaib, H.; Solé, P. The build-up construction over a commutative non-unital ring. Des. Codes Cryptogr. 2022, 90, 3003–3010. [Google Scholar] [CrossRef]
  7. Alahmadi, A.; Melaibari, A.; Solé, P. Duality of codes over non-unital rings of order four. IEEE Access 2023, 11, 53120–53133. [Google Scholar] [CrossRef]
  8. Alahmadi, A.; Alshuhail, A.; Solé, P. The mass formula for self-orthogonal and self-dual codes over a non-unitary commutative ring. AIMS Math. 2023, 8, 24367–24378. [Google Scholar] [CrossRef]
  9. Fine, B. Classification of finite rings of order p2. Math. Mag. 1993, 66, 248–252. [Google Scholar] [CrossRef]
  10. Rains, E.M.; Sloane, N.J.A. Self-dual codes. In Handbook of Coding Theory; Elsevier: Amsterdam, The Netherlands, 1998. [Google Scholar]
  11. Shi, M.; Alahmadi, A.; Solé, P. Codes and Rings: Theory and Practice; Elsevier: Amsterdam, The Netherlands; Academic Press: New York, NY, USA, 2017. [Google Scholar]
  12. Alahmadi, A.; Altassan, A.; Basaffar, W.; Bonnecaze, A.; Shoaib, H.; Solé, P. Quasi type IV codes over a non-unital ring. Appl. Algebra Eng. Commun. Comput. 2021, 32, 217–228. [Google Scholar] [CrossRef]
  13. Ling, S.; Xing, C. Coding Theory: A First Course; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
  14. Ling, S.; Solé, P. On the algebraic structure of quasi-cyclic codes I. Finite fields. IEEE Trans. Inform. Theory 2001, 47, 2751–2760. [Google Scholar] [CrossRef]
  15. MacWilliams, F.J.; Sloane, N.J.A. The Theory of Error-Correcting Codes; North-Holland Mathematical Library; Elsevier: Amsterdam, The Netherlands, 1977. [Google Scholar]
  16. Hufman, W.C.; Pless, V. Fundamentals of Error-Correcting Codes; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar]
  17. Bosma, W.; Cannon, J.; Playoust, C. The Magma algebra system. I. The user language. J. Symb. Comput. 1997, 24, 235–265. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alihia, T. On the Duality of Codes over Non-Unital Commutative Ring of Order p2. Symmetry 2025, 17, 690. https://doi.org/10.3390/sym17050690

AMA Style

Alihia T. On the Duality of Codes over Non-Unital Commutative Ring of Order p2. Symmetry. 2025; 17(5):690. https://doi.org/10.3390/sym17050690

Chicago/Turabian Style

Alihia, Tamador. 2025. "On the Duality of Codes over Non-Unital Commutative Ring of Order p2" Symmetry 17, no. 5: 690. https://doi.org/10.3390/sym17050690

APA Style

Alihia, T. (2025). On the Duality of Codes over Non-Unital Commutative Ring of Order p2. Symmetry, 17(5), 690. https://doi.org/10.3390/sym17050690

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop