问题
I'm working on transformation polynomial systems over GF(2^N) to GF(2). In a process of transformation I need to do lots of modulo 2 computations like summing and multiplying matrices.
So is there way to sum and multiply matrices using modulo 2 arithmetics in Sympy?
回答1:
I've had luck with sympy's trunc() function:
from sympy import *
var('x:z')
y=25*x+12
z=trunc(y,2) # z=x
来源:https://stackoverflow.com/questions/21660852/modulo-2-arithmetics-in-sympy