Trace function over GF(8)

44 views
Skip to first unread message

ArturZ

unread,
Apr 10, 2012, 7:40:47 AM4/10/12
to sage-s...@googlegroups.com
Hi,

I've 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)

I've got the following one (after substitution):

f(x,y)=[[(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)]+[[(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)]^2+[[(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)]^4

Let d=3 (for example).

Now, above function will looks like:

f(x,y)=[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^2+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^4 <--- I think that this function f is correct, am I right?

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

I'll be glad for any advices and help.

Regards,
Artur



Maarten Derickx

unread,
Apr 10, 2012, 1:20:15 PM4/10/12
to sage-s...@googlegroups.com
Dear Arthur,

In the other thread I gave a quite explicit example how to do such a thing only with less complicated formula's. All the techniques needed to solve the problem are given there. What problems are you running in to when trying to generalize my example to using more complicated formula's?

Did you by the way work trough some parts of http://www.sagemath.org/doc/tutorial/ ? And maybe http://docs.python.org/tutorial/ might also be usefull since valid python could should also be valid sage code.

Working trough such a tutorial is I guess essential for being able to solve your own problems in sage (there is no use typing in stuff as litterally told to you by others without understanding).

ArturZ

unread,
Apr 10, 2012, 2:08:50 PM4/10/12
to sage-s...@googlegroups.com
Hi,

I've problem with this function. When I'm trying to use Your idea I see some errors (for example: unsupported operand parent(s) for '/'). I know that there should be definition of this convention (1/0=0). When I was trying to do this without this assumption I saw divided by zeros errors (it is understandable). Next think: there is 1/2 power and I'm not sure if it is correct defined in my example (example: x=a^2, y=a, y/x=a^2+1, and now (a^2+1)^(1/2)).
Your example is quite nice and I understand it and everything is OK when I'm trying simple examples using this argumentation.

I think that I should read more about SAGE, like You suggested, and then maybe it will be clearer, I hope.

Regards,
Arthur

Maarten Derickx

unread,
Apr 10, 2012, 3:21:07 PM4/10/12
to sage-s...@googlegroups.com
You should use the function custom_divide instead(a,b) I wrote for you instead of y/x this will make sure the convention 1/0=0 gets followed. Also you should use x.nth_power(2) (or in this case even x.pth_power()) instead of x^(1/2). Then everything should work. If that doesn't help please post an executable piece of code so we can say what you do wrong.
Reply all
Reply to author
Forward
0 new messages