galois.generator_to_parity_check_matrix

galois.generator_to_parity_check_matrix(G)

Converts the generator matrix \(\mathbf{G}\) of a linear \([n, k]\) code into its parity-check matrix \(\mathbf{H}\).

The generator and parity-check matrices satisfy the equations \(\mathbf{G}\mathbf{H}^T = \mathbf{0}\).

Parameters

G (galois.FieldArray) – The \((k, n)\) generator matrix \(\mathbf{G}\) in systematic form \(\mathbf{G} = [\mathbf{I}_{k,k}\ |\ \mathbf{P}_{k,n-k}]\).

Returns

The \((n-k, n)\) parity-check matrix \(\mathbf{H} = [-\mathbf{P}_{k,n-k}^T\ |\ \mathbf{I}_{n-k,n-k}]\).

Return type

galois.FieldArray