galois.FieldArray.column_space() Self

Computes the column space of the matrix A.

Returns:

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

Notes

Given an m×n matrix A over GF(q), the column space of A is the vector space {xGF(q)m} defined by all linear combinations of the columns of A. The column space has at most dimension min(m,n).

The column space has properties C(A)=R(AT) and dim(C(A))+dim(N(A))=n.

Examples

The column_space() method defines basis vectors (its rows) that span the column space of A.

In [1]: m, n = 3, 5

In [2]: GF = galois.GF(31)

In [3]: A = GF.Random((m, n)); A
Out[3]: 
GF([[16, 27, 24, 24, 23],
    [ 5,  9,  2,  3, 21],
    [12, 10, 16,  1, 13]], order=31)

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

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

In [5]: N = A.null_space(); N
Out[5]: 
GF([[ 1,  0, 21, 19, 29],
    [ 0,  1, 16,  0,  1]], order=31)

In [6]: C.shape[0] + N.shape[0] == n
Out[6]: True