Skip to content

komm.PolarCode

Polar (Arıkan) code. Let $\mu \geq 1$ be an integer, and $\mathcal{F}$ (called the frozen bit indices) be a subset of $[0 : 2^\mu)$. Define $\mathcal{A} = [0 : 2^\mu) \setminus \mathcal{F}$ (called the active bit indices). The polar code with parameters $(\mu, \mathcal{F})$ is the linear block code whose generator matrix is obtained by selecting the rows of the matrix $$ G_{2^\mu} = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix} ^ {\otimes \mu}, $$ corresponding to the active bit indices, where $\otimes$ denotes the Kronecker product. The resulting code has the following parameters:

  • Length: $n = 2^{\mu}$
  • Dimension: $k = |\mathcal{A}|$
  • Redundancy: $m = |\mathcal{F}|$

For more details, see EC Zoo: Polar code.

Notes
  • For $\mathcal{F} = \{ i : \mathrm{w}(i) < \mu - \rho \}$ it reduces to the Reed–Muller code with parameters $(\rho, \mu)$, where $\mathrm{w}(i)$ is the number of ones in the binary representation of $i$.

Parameters:

  • mu (int) –

    The parameter $\mu$ of the code.

  • frozen (ArrayLike) –

    The frozen bit indices $\mathcal{F}$ of the code. Must be a 1D-array.

Tables:

Examples:

>>> code = komm.PolarCode(4, [0, 1, 2, 3, 4, 8])
>>> (code.length, code.dimension, code.redundancy)
(16, 10, 6)
>>> code.generator_matrix
array([[1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       [1, 0, 1, 0, 1, 0, 1, 0, 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, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
       [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0],
       [1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
       [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0],
       [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0],
       [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
>>> code.minimum_distance()
4