Hi:

I am trying to "define" a variable to be an element of GF(2). In
particular, suppose that I create GF(2^4) the following way:

K=GF(2)
S.<x> = K['x']
QR=S.quotient(1+x+x^4,'a')
a=FR.gen()

Now I am trying to compute the following:

(gamma0 + gamma1*a + gamma2*a^2 + gamma3*a^3)*(beta0 + beta1*a +
beta2*a^2 + beta3*a^3)

where gamma0,...,gamma3 and beta0,...,beta3 are symbols in GF(2).

Essentially I want sage to multiply sage to multiply the two
polynomials and then substitute the higher powers of a^i for their
representation in the quotient ring.

Said in different words, I would like to represent two symbolic
elements of GF(2^4) explicitly (in their GF(2) constituents) and have
sage compute what product of the two elements looks like.

I tried defining gamma0,...gamma3,beta0,..,beta3 as regular vars
(gamma0 = var('gamma0')) but I get a typeerror:

TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and
'Univariate Quotient Polynomial Ring in a over Finite Field of size 2
with modulus x^4 + x + 1'

not defining them also does not work.

Any ideas?

Thanks!!

Luis

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to