B be sparse matrices with integer coefficients between
p prime. Which is the fastest way to compute their product mod p and obtain another sparse matrix? I'm mainly interested in
p = 2.
Mod[A.B, p] returns a sparse matrix, but it may not be "optimal" in the sense that elements that are non-zero in
A.B but zero in
Mod[A.B, p] are stored. The code
SparseArray[Mod[A.B, p]] yields the correct result, but there should be a much faster way.