Hello,

I try to perform calculations in GF(2^3); e.g. calculate (x^2+x)(x+1) = x^3 
+ 2x^2 + x = x^3 + x as polynomial coefficients are modulo-2. Using the 
irreducible polynomial x^3 + x + 1 I arrive at (x^2+x)(x+1) = 1.

I try to do the same in sympy


import sympy as sym
import sympy.polys as polys
import sympy.polys.galoistools as gft

F = polys.domains.FF(2)
# x^2 + x
a = [1, 1, 0]
# x + 1
b = [1, 1]

res = gft.gf_mul(a, b, 8, F)

sym.pprint(res)

but arrive at [1 mod 2, 0 mod 2, 1 mod 2, 0 mod 2] which I interpret as x^3 
+ x. So it seems that the reduction using the irreducible polynomial is not 
done - is there a way to do this last step in sympy?

Thanks & regards - Clemens

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/eea4971d-65c2-4b16-9fb9-703dcbb4f3d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to