Question: Simplifying Polynomial Coefficients mod 2

I am trying to simplify the square of a parameterized polynomial mod 2. My parameters are intended to be either 0 or 1. How do I accomplish this?

For example:

 

alias(alpha = RootOf(x^4+x+1))

alpha

(1)

z := alpha^3*a[3]+alpha^2*a[2]+alpha*a[1]+a[0]``

a[3]*alpha^3+a[2]*alpha^2+a[1]*alpha+a[0]

(2)

z2 := collect(`mod`(Expand(z^2), 2), alpha)

a[3]^2*alpha^3+(a[1]^2+a[3]^2)*alpha^2+a[2]^2*alpha+a[0]^2+a[2]^2

(3)

``

``

 

Download Polynomial_Mod_2.mw

 

I would like to simplify the squared parameters modulo 2. a[3]^2=a[3], etc.

Any help would be appreciated. Elegant methods even more so!

Regards.

 

 

 

 

Please Wait...