komm.ReedMullerCode
Reed–Muller code. It is a linear block code defined by two integers $\rho$ and $\mu$, which must satisfy $0 \leq \rho < \mu$. See references for more details. The resulting code is denoted by $\mathrm{RM}(\rho, \mu)$, and has the following parameters:
- Length: $n = 2^{\mu}$
- Dimension: $k = 1 + {\mu \choose 1} + \cdots + {\mu \choose \rho}$
- Redundancy: $m = 1 + {\mu \choose 1} + \cdots + {\mu \choose \mu - \rho - 1}$
- Minimum distance: $d = 2^{\mu - \rho}$
For more details, see LC04, Sec. 4.3.
Notes
- For $\rho = 0$ it reduces to a repetition code.
- For $\rho = 1$ it reduces to a lengthened simplex code.
- For $\rho = \mu - 2$ it reduces to an extended Hamming code.
- For $\rho = \mu - 1$ it reduces to a single parity-check code.
Attributes:
-
rho
(int
) –The parameter $\rho$ of the code.
-
mu
(int
) –The parameter $\mu$ of the code.
The parameters must satisfy $0 \leq \rho < \mu$.
Examples:
>>> code = komm.ReedMullerCode(1, 5)
>>> (code.length, code.dimension, code.redundancy)
(32, 6, 26)
>>> code.generator_matrix
array([[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
[0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1],
[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
>>> code.minimum_distance()
16
reed_partitions
cached
The Reed partitions of the code. See LC04, Sec. 4.3.
Examples:
>>> code = komm.ReedMullerCode(2, 4)
>>> reed_partitions = code.reed_partitions()
>>> reed_partitions[1]
array([[ 0, 1, 4, 5],
[ 2, 3, 6, 7],
[ 8, 9, 12, 13],
[10, 11, 14, 15]])
>>> reed_partitions[8]
array([[ 0, 4],
[ 1, 5],
[ 2, 6],
[ 3, 7],
[ 8, 12],
[ 9, 13],
[10, 14],
[11, 15]])