galois.FieldArray.null_space() Self

Computes the null space of the matrix $$\mathbf{A}$$.

Returns:

The null space basis matrix. The rows of the basis matrix are the basis vectors that span the null space. The number of rows of the basis matrix is the dimension of the null space.

Given an $$m \times n$$ matrix $$\mathbf{A}$$ over $$\mathrm{GF}(q)$$, the null space of $$\mathbf{A}$$ is the vector space $$\{\mathbf{x} \in \mathrm{GF}(q)^n\}$$ that annihilates the columns of $$\mathbf{A}$$, i.e. $$\mathbf{A}\mathbf{x} = \mathbf{0}$$.

The null space has properties $$\mathcal{N}(\mathbf{A}) = \mathcal{LN}(\mathbf{A}^T)$$ and $$\textrm{dim}(\mathcal{C}(\mathbf{A})) + \textrm{dim}(\mathcal{N}(\mathbf{A})) = n$$.

Examples

The null_space() method defines basis vectors (its rows) that span the null space of $$\mathbf{A}$$.

In : m, n = 3, 5

In : GF = galois.GF(31)

In : A = GF.Random((m, n)); A
Out:
GF([[21,  6,  4,  0, 26],
[13, 15, 14, 16, 13],
[18, 30, 15, 29, 12]], order=31)

In : N = A.null_space(); N
Out:
GF([[ 1,  0, 16, 14, 17],
[ 0,  1, 10, 15,  3]], order=31)


The null space is the set of vectors that sum the columns to 0.

In : A @ N.T
Out:
GF([[0, 0],
[0, 0],
[0, 0]], order=31)


The dimension of the column space and null space sum to $$n$$.

In : C = A.column_space(); C
Out:
GF([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]], order=31)

In : C.shape + N.shape == n
Out: True