Lee distance

In coding theory, the Lee distance is a distance between two strings formula_1 and formula_2 of equal length "n" over the "q"-ary alphabet {0, 1, …, "q" − 1} of size "q" ≥ 2.
It is a metric, defined as
Considering the alphabet as the additive group Z"q", the Lee distance between two single letters formula_4 and formula_5 is the length of shortest path in the Cayley graph (which is circular since the group is cyclic) between them.
If formula_6 or formula_7 the Lee distance coincides with the Hamming distance, because both distances are 0 for two single equal symbols and 1 for two single non-equal symbols. For formula_8 this is not the case anymore, the Lee distance can become bigger than 1.
The metric space induced by the Lee distance is a discrete analog of the elliptic space.
Example.
If "q" = 6, then the Lee distance between 3140 and 2543 is 1 + 2 + 0 + 3 = 6.
History and application.
The Lee distance is named after C. Y. Lee. It is applied for phase modulation while the Hamming distance is used in case of orthogonal modulation.
The Berlekamp code is an example of code in the Lee metric. Other significant examples are the Preparata code and Kerdock code; these codes are non-linear when considered over a field, but are linear over a ring.
Also, there exists a Gray isometry (bijection preserving weight) between formula_9 with the Lee weight and formula_10 with the Hamming weight.