Hi,

I understand the idea of defining functions over GF(q) which You explained me very precisely. Now I have following problem:

I want to define the function:

`f(x,y)=Tr(x*g(y/x))`

, where `Tr(x)=x+x^2+x^4`

(`Tr:GF(8)-->GF(2)`

) and

```
x*g(y/x)=[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2).
```

Let (for example) d=3.

With convention that 1/0=0 (y/0=0), I want to see what values this function f receives. How can I do this in SAGE?

What I did (with Yours help):

```
def custom_divide(x,y):
if y==0:
return 0
return x/y
F.<a>=GF(8)
for a,b in F^2:
print "x: ",a,"y: ",b,"x/y: ",custom_divide(a,b)
F.<a>=GF(8)
for a,b in F^2:
print "x*y: ",a*b,"(x*y)^2: ",(a*b)^2,"(x*y)^(1/2): ",(a*b).nth_root(2)
```

I'm stopped here because I'm not sure how can I define such function f. Any help/advices will be highly appreciated.

I could write more details if something is not clear.

Best regards, Arczi