Thanks for the  reply!
Just one more question.
In general, if k is a finite field, what is k(i), where i is an
integer, suppose to be ?

The following example suggests k(i) will be the elements in the base
field as i varies.

sage: k.<a> = GF(9)
sage: for i in [0..8]:  print k(i)
....:
0
1
2
0
1
2
0
1
2


Shing

On Sep 22, 4:13 pm, Simon King <[email protected]> wrote:
> Hi Shing!
>
> Two possibilities:
>
>   sage: k.<a> = GF(9)
>   sage: t=a^2+1
>
> Now, you can learn about all possible methods for elements of k by
> doing
>   sage: t.<TAB>
> (you type t, dot, and hit the tab key).
> This will show you a list of possible methods.
>
> One of the methods is called int_repr:
>   sage: t.int_repr()
>   '5'
> So, it gives you a string, that you can easily transform into an
> integer: ZZ(t.int_repr()) for a Sage integer, int(t.int_repr()) for a
> Python integer.
>
> There is also log_to_int:
>   sage: t.log_to_int()
>   5
> Probably this last method is easier.
>
> The inverse way is
>   sage: k.fetch_int(5)
>   a + 2
> which is indeed the same as t:
>   sage: t
>   a + 2
>
> Cheers,
> Simon
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to