I want to perform matrix multiplication over the GF(2) field. (in other words, '+' maps to XOR, and '×' maps to AND)
I usually do matrix multiplication in the Real field followed by a mod(2) operation.
A simple python example:
import numpy as np
np.random.seed(0)
A = np.random.randint(0, 2, size=(100, 200)) # binary matrix
B = np.random.randint(0, 2, size=(200, 300)) # binary matrix
C = np.mod(np.matmul(A, B), 2) # binary matrix
I have tried TensorFlow as well. It seems to be faster than NumPy for me.
When we consider large binary matrices, is there a faster way for this?
Maybe a python or c/c++ library is required.
Any help is highly appreciated.
Thanks