Rank of matrix on Z2 field

Here is an example using Nemo; first define the field \mathbb{Z}_2:

using Nemo
Z2 = ResidueRing(ZZ, 2)

For purposes of the example, create a random base matrix, e.g.
X = rand([0,1], 4,5)
or define one:

X = [
 0  1  1  0  1
 1  0  1  1  0
 0  1  1  1  1
 0  1  1  0  1
]

then convert it into a Nemo object in the field (residue ring) \mathbb{Z}_2

A = matrix(Z2, X)

Then call rank:

julia> rank(A)
3
3 Likes