Hamming Code¶
Given an integer
and a field
, such that
,
the
code with length
,
dimension
and minimum distance
is called the Hamming Code of order
.
REFERENCES:
[R] Introduction to Coding Theory, Ron Roth, Cambridge University Press, 2006
-
class
sage.coding.hamming_code.HammingCode(base_field, order)¶ Bases:
sage.coding.linear_code.AbstractLinearCodeRepresentation of a Hamming code.
INPUT:
base_field– the base field over whichselfis defined.order– the order ofself.
EXAMPLES:
sage: C = codes.HammingCode(GF(7), 3) sage: C [57, 54] Hamming Code over Finite Field of size 7
-
minimum_distance()¶ Returns the minimum distance of
self. It is always 3 asselfis a Hamming Code.EXAMPLES:
sage: C = codes.HammingCode(GF(7), 3) sage: C.minimum_distance() 3
-
parity_check_matrix()¶ Returns a parity check matrix of
self.The construction of the parity check matrix in case
selfis not a binary code is not really well documented. Regarding the choice of projective geometry, one might check:EXAMPLES:
sage: C = codes.HammingCode(GF(3), 3) sage: C.parity_check_matrix() [1 0 1 1 0 1 0 1 1 1 0 1 1] [0 1 1 2 0 0 1 1 2 0 1 1 2] [0 0 0 0 1 1 1 1 1 2 2 2 2]
