Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your code is quite messy and does not match the problem description. Let me design one from scratch:

R.<X> = PolynomialRing(GF(2))
P = 1+X+X^2+X^3
S = R.quotient(P)
q = 2
print( [(S.gen()^(i*q)).lift() for i in (0..3)] )

Is this what you want?

Your code is quite messy and does not match the problem description. Let me design one from scratch:

R.<X> = PolynomialRing(GF(2))
P = 1+X+X^2+X^3
S = R.quotient(P)
q = 2
print( print('as elements of S:', [S.gen()^(i*q) for i in (0..3)] )
print('as elements of P:', [(S.gen()^(i*q)).lift() for i in (0..3)] )

Is this what you want?