Extension field arithmetic
Code
p=(2^3)
F.<a>=GF(2^3);F.modulus();#F
R.<x>=F[];#R
K.<b>=F.extension(x^2+(a^2+a+1)*x+a^2);#K
R.<z>=PolynomialRing(K) ;#R
R1.<a1,b1,a2,b2>=PolynomialRing(K,4) ;#R1
var('R b z a')
f3=z + (a^2 + a)*b + a + 1
M= f3.operands();M
f=M[0];f
new4=f.coefficients(b);new4
M1=new4[0]
R=(M[1],M1[0]+M[1]);R
M2= M1[0]+M[1]
I have written the above code over extension field to separate out terms (a+1) and (a^2+a) , but the code is not working properly . following error is obtained
**AttributeError: 'PolynomialRing_field_with_category.element_class' object has no attribute 'operands',**
It is very hard to say, both mathematically and/or pythonically, what is the meaning of the message. Please write the code, so that a copy+paste reconstructs the problem. The post can be (hardly) understood: After some edit, the first lines of code are of the shape:
(Edit as follows: Copy, paste, mark, hit that button with 101 and 010.) And all this is never used again!
Then it can be compiled:
e.g.
And soon ...(more)
Running this code in the Sage cell does not give an error.