Quasiperfect codes in the metric ^{1}^{1}1This work was partially supported by FAPESP, grants 2014/206028, 2013/259777 and CNPq, grant 312926/20138.
Abstract
We consider quasiperfect codes in over the metric, . Through a computational approach, we determine all radii for which there are linear quasiperfect codes for and . Moreover, we study codes with a certain degree of imperfection, a notion that generalizes the quasiperfect codes. Numerical results concerning the codes with the smallest degree of imperfection are presented.
———————————————————————
———————————————————————
keywords:Tilings, Lattices, Quasiperfect Codes, metric
1 Introduction
A collection of disjoint translates of a set is called a tiling of if the union of its elements is equal to . We consider here as the ball in with radius in the metric for . The set associated to the translations of such a tiling is also called a perfect code in the metric, . If, in addition, this set is an additive subgroup of , we call the corresponding tiling a lattice tiling, and the corresponding code a linear perfect code.
For , the existence of tilings by balls in the metric was investigated by Golomb and Welch in their seminal paper [Golomb]. The socalled GolombWelch conjecture states that there are no tilings of by for and radius . Although there have been many advances and partial results towards a proof of this conjecture it still remains open (see [Horak] for further references).
The existence of perfect codes in the metric, , with parameters , where is the dimension and is the packing radius, was investigated in [CNMAC2014, PerfectpLee]. It was shown that for and there are linear perfect codes only for the parameters and and and [PerfectpLee, Theorem 6.2 and 6.4]. It was also shown that for and integer there are no perfect (linear and nonlinear) codes in the metric if and [PerfectpLee, Theorem 7.2].
In view of the rarity of perfect codes in the metric, , we relax the condition of being perfect by considering quasiperfect codes in the metric for and by introducing the notion of degree of imperfection of a code. Quasiperfect codes in the Lee metric () have already been investigated in some papers. In [AIBdaiwiBose] it was presented quasiperfect codes in the Lee metric for dimension . In [Horak] the authors presented quasiperfect codes for and a few radii. Later, in [CamareroMartinez] the authors constructed a family of quasiperfect codes in the Lee metric of radius and arbitrarily large dimension.
When dealing with quasiperfect codes a natural question to be considered is the existane such codes for different and , , for a given radius. In this paper we give partial answers for this question in some dimensions. Some preliminary results of this work were presented in [CNMAC2014].
1.1 Organization
The paper is organized as follows. In Section 2 we establish our notation and present some preliminary results concerning codes and lattices. In Section 3 a polyomino associated to a ball in the metric is considered. In Section 4 the notion of degree of imperfection of a code in the metric is introduced. In Section 5 some families of lattices whose degree of imperfection is greater than are presented. Finally, in Section 6 an algorithm that searches for quasiperfect codes in dimensions and is presented and all quasiperfect codes in dimension and for are listed.
1.2 Relation to codes over finite alphabets
In the classical literature, codes are considered over finite alphabets, for instance as subgroups of , where is a field with elements, or as subgroups of , where is the ring of integers modulo .
Codes in can be “lifted” to codes in via the ary Construction A [SloaneLivro]. If the alphabet size is large enough, then perfect linear codes in in the Lee metric [PerfectpLee] induce perfect linear codes in in the metric, as shown in [PerfectpLee, Corollary 3.5]. Conversely, proofs of nonexistence of perfect codes in automatically imply the nonexistence of codes in under certain conditions (for more precise definitions see [PerfectpLee, Corollary 3.5]). This relation, that dates back to Golomb and Welch [Golomb] for the metric, motivates the study of codes over the alphabet . It also justifies the terminology “perfect” and “quasiperfect” codes (which, nonetheless, follows the terminology of [Horak, AIBdaiwiBose], etc.).
2 Codes in the metric
A linear code, to our purposes, is an additive subgroup of (or a lattice). We consider here full rank lattices in , that is, full rank additive subgroups of . A lattice always has a generator matrix , i.e., a full rank matrix such that . The determinant of a lattice is defined as for any generator matrix.
Recall that the distance between two points is defined as
(1) 
and
The minimum distance of a code in is defined as
The minimum distance of a lattice in the metric, , is the shortest nonzero vector in the metric.
Two lattices and in are congruence in the metric if can be obtained from by permutation of coordinates composed with sign changes.
3 Balls in the metric and associated polyominoes
In what follows will be used for the closed ball in centered at with radius , i.e., for and When we will denote for and
Let be the cardinality of the set . There is no closed form for when and .
By considering the union of unit cubes in centered at the points of , , a shape called a polyomino is produced. A tiling of by translates of corresponds to a tiling of by the associated polyominoes. We use the notation
(2) 
for the polyomino in the metric associated to . Some polyominoes are depicted in Figure 1.
When , and vary, the polyomino changes its shape. For we have squared polyominoes . In Proposition 3.1 we consider other special values for and (illustrated in Figure 2) and obtain the shape of the polyominoes associated to .
From now on let be the vector that has in the th entry and in the others, for .
Proposition 3.1.
For fixed radius and dimension , we can assert:

If is integer and , then
and .

If is integer, and , then
where and .

If is not integer, and , then
where and

If is not integer, and , then
where and
Proof.
For the proof of (i) note that if is integer and , then . Hence, since if , then . The proof of Items (ii), (iii) and (iv) is very similar. ∎
4 Perfect and quasiperfect codes
It is well known that the packing radius of a code in the metric depends only on the minimum distance of the code and it is given by the formula In this case a code is called perfect if (or ) and for all with . A code is called quasiperfect if (or ) and .
For the metric, , two codes with same minimum distance may have different packing radii and thus the packing radius is not uniquely determined by the minimum distance (see [PerfectpLee, Remark 5.1]). Moreover, the packing radius in the metric for is not necessarily an integer number (as it can be seen next in Example 4.1).
In order to define the packing and the covering radii of in the metric for we first define the distance set of the metric in as
It follows that.
Example 4.1.
Consider the lattice generated by . The first elements of are , , , and . In this case, is the largest value of such that the balls centered at the points of with radius do not intercept each other and is the smallest value of such that the union of the balls centered at the points of with radius covers .
The packing radius of a code in the metric is the greatest such that holds for all . The packing radius of a code in the metric will be denoted by .
The covering radius of a code in the metric is the smallest such that . The covering radius of a code in the metric will be denoted by .
We denote by and , respectively, the real packing and covering radii of a lattice in (for the packing radius the balls centered at with radius do not intercept each other in and for the covering radius the union of the balls centered at the points of with radius covers ).
Example 4.2.
Consider the lattice generated by . We have that , , and .
We define the distance of two elements with as , where denotes the closed interval in and . We say that a lattice is imperfect if . When , that is , the lattice is called perfect. When the lattice is called quasiperfect.
In [PerfectpLee, Corollary 5.5] it was shown that if and , then the radius packing of a linear perfect code in the metric satisfies
(3) 
where denotes the supremum of the packing densities over all dimensional lattices in the metric.
We recall that the covering density of a lattice in the metric is given by , where is the Euclidean volume of the dimensional unitary sphere centered at the origin in the metric [VolumBall, p.321]. denotes the infimum of the covering densities over all dimensional lattices in the metric.
Proposition 4.3 give us some relations among packing and covering radii of a quasiperfect lattice and covering density for the lattice in .
Proposition 4.3.
Let and . The covering radius and the packing radius of a linear quasiperfect code in the metric satisfies
(4) 
and
(5) 
Proof.
The real and integer covering and packing radii satisfy where . Therefore, it follows that
Since the linear code is quasiperfect by hypothesis, it follows that and then
∎
Since neither the packing and covering density of any lattice cannot exceed the best possible density in dimension , these inequalities give a limitation on the packing radius of a quasiperfect code. A numerical comparison among these limitations, provided by (3), (4) and (5) is presented in Table 1. On the left table, the third and fourth columns represent bounds for the packing and covering densities of the perfect lattices with packing radius obtained from Inequalities (3) and (4), respectively. According to Inequality (4) we must test lattices with packing radius upper bounded by while inequality (3) shows the packing radius must be upper bounded by , otherwise we had packing and covering densities greatest and smallest that the maximum and minimum possible values ( e , e.g., [SloaneLivro]) in this dimension, respectively. On the right table, the third, fourth and fifth columns represent bounds for the packing and covering densities of the quasiperfect lattices with packing radius obtained from Inequalities (3), (4) and (5), respectively. From Inequality (4) the packing radius must be upper bounded by while Inequality (5) it must be upper bounded by . In this case Inequality (4) is more appropriated.
41  137  0.6418  1.1593 

45  145  0.6549  1.1914 
49  149  0.6667  1.2524 
50  161  0.6694  1.1805 
52  169  0.6747  1.1655 
829  2601  0.9064  1.0511 
832  2609  0.9066  1.0516 
833  2617  0.9066  1.0496 
841  2629  0.9071  1.0546 
842  2637  0.9071  1.0526 
72  225  0.716  1.195  1.3683 

73  233  0.7176  1.1685  1.3371 
74  241  0.7193  1.2143  1.3079 
80  249  0.7284  1.1889  1.3538 
81  253  0.7298  1.1835  1.3467 
193  601  0.8156  1.1197  1.2247 
194  609  0.8161  1.1158  1.2143 
196  613  0.8169  1.1139  1.2177 
197  621  0.8174  1.1155  1.2076 
200  633  0.8186  1.1048  1.2011 
The discrete packing density of a lattice in in the metric is given by . The discrete covering density of a lattice in is given by
Example 4.4.
Table 2 shows some parameters of all integer lattices with volume in the metric. Here , , and denote discrete packing density, packing density, discrete covering density and covering density of the lattice , respectively. In this case we have only one quasiperfect lattice up to congruence.
Lattice  

58  0  0.5  12  12.0104  0.0417  0.0327  18.375  18.8823  
32  0  0.7071  8.4853  8.5147  0.0417  0.0654  9.375  9.4902  
14  1  1.118  5.3852  5.4271  0.2083  0.1636  4.0417  3.8554  
7  1.4142  1.5811  4  4.0139  0.375  0.3272  2.0417  2.1089  
4  2  2.0616  3.1623  3.3001  0.5417  0.5563  1.5417  1.4256  
1  2.2361  2.5495  2.8284  3.0641  0.875  0.8508  1.0417  1.229  
5  1.4142  2  3.1623  3.4004  0.375  0.5236  1.5417  1.5135  
4  2  2.1213  3.1623  3.5355  0.5417  0.589  1.5417  1.6362  
8  1.4142  1.5  4.1231  4.1552  0.375  0.2945  2.375  2.2601  
4  2  2.1213  3.1623  3.2596  0.5417  0.589  1.5417  1.3908  
4  2  2.2361  3.1623  3.3657  0.5417  0.6545  1.5417  1.4828  
10  1  1.4142  4.2426  4.3605  0.2083  0.2618  2.5417  2.4889  
18  0  1  6  6.0417  0.0417  0.1309  4.7083  4.7781  
19  0  1  6.0828  6.0828  0.0417  0.1309  5.0417  4.8433  
11  1  1.4142  4.4721  4.4721  0.2083  0.2618  2.875  2.618  
5  2  1.8028  3.6056  3.6336  0.5417  0.4254  1.875  1.7283  
4  2  2.2361  3.1623  3.1623  0.5417  0.6545  1.5417  1.309  
5  1.4142  2  3.1623  3.3333  0.375  0.5236  1.5417  1.4544  
8  1.4142  1.5  4.1231  4.272  0.375  0.2945  2.375  2.3889  
2  2.2361  2.5  3  3.125  0.875  0.8181  1.2083  1.2783  
6  1.4142  2  3.6056  3.6056  0.375  0.5236  1.875  1.7017 
5 Families of imperfect lattices in the metric
In this section we present some families of lattices in the metric and calculate their imperfection degrees and discrete packing densities. In some cases the imperfection degree ranges with the packing radius.
Proposition 5.1.
Let an integer and an integer such that . The lattice with basis is quasiperfect for and and imperfect for . It has discrete packing density .
Proof.
is not perfect because . If , then , and if and only if . If , then The last inequality follows from the fact implies and that is a concave upward function when and . Indeed, a convex combination of the image of and is greather than the image of , that is,
From Proposition 3.1, and since , the discrete packing density is . ∎
Example 5.2.
Proposition 5.3.
Let be an integer, and . The lattice with basis is imperfect. It has discrete packing density .
Proof.
By hypothesis Then . We also have since the ball is convex. Moreover, for has no integer solution. Hence, the radius covers the point . The formula for the packing density follows from Proposition 3.1 since . ∎
,  ,  ,  ,  ,  ,  ,  , ,  ,  , ,  , , 

Proposition 5.4.
If is not integer, , and , then the lattice with basis is quasiperfect. It has discrete packing density .
Proof.
The proof follows from the fact that the corners have norm smaller or equal to the norm of the points . The formula for the packing density follows from Proposition 3.1 since . ∎
Proposition 5.5.
If is not integer, , and , then the lattice with basis is imperfect. It has discrete packing density .
Proof.
The proof follows from the fact that the points have norm smaller or equal to the norm of and these points have norm smaller or equal to the norm of the point . The formula for the packing density follows from Proposition 3.1 since . ∎
Example 5.6.
The lattice with basis is imperfect in the metric for . The lattice with basis is associated to the same format of the polyominoes of Proposition 5.4 but it is quasiperfect in the metric for .
6 Computational Algorithm
In this section we present a pseudo code of an algorithm (Algorithm LABEL:algo_quasiperfect) that lists all perfect and quasiperfect linear codes in considering the metric, , until a certain given packing radius up to congruence.
In the cases that the minimum covering density is known we use Proposition 4.3 to bounding our search.
The algorithm is based on two tests where the first test is a variation of the next theorem.
Theorem 6.1.
[Diameter, Thm. 6] Let , such that . There is a lattice tiling of by translates of if and only if there is an Abelian group of order and a homomorphism such that the restriction of to is a bijection.
The first test, called here Injetivity Test, ensures that the balls of a certain radius centered at points of a lattice are disjoint. More precisely, the lattice is viewed as the kernel of an application (where is an abelian group with ). Suppose that the lattice is generated by a matrix and consider the adjoint matrix of . Up to group isomorphisms, we may assume that is the composition of two applications and , where and as the following diagram: