I am trying to do basic 101 manipulation with SageMath
F = GF(3); F
Finite Field of size 3
R.<x> = F[] ; R
Univariate Polynomial Ring in x over Finite Field of size 3
F2 = F.extension(x^2+1,'u');F2
Finite Field in u of size 3^2
for i,x in enumerate(F2): print("{} {}".format(i, x))
0 0
1 u + 2
2 u
3 2*u + 2
4 2
5 2*u + 1
6 2*u
7 u + 1
8 1
Now i would just like to do simple arithmetic and check for example that $u^2+1 = 0$ But i get an error. I cannot find the right syntax.
u^2+1
--------------------------------------------------------------------------- NameError Traceback (most recent call last) in () ----> 1 u**Integer(2)+Integer(1)
NameError: name 'u' is not defined
Try naming the variable $u$ by using .<u> in your definition of F2, like this.
If you don't care what the minimal polynomial of your primitive element of $\mathbb F_9$ is, you could also do this.