Ask Your Question

How to index all elements of a finite field?

asked 2021-01-20 10:52:20 +0100

MKS gravatar image

updated 2021-01-20 10:53:33 +0100

I would like to assign an integer corresponding to element of a finite field $GF(p^m)$, where $p^m\in[ {13^2,3^5, 131,137,139,251}] $

 F.<x> = GF(3^5, impl='givaro')

THe elements of GF(3^5) are 0,1,2,x,x^2 etc, we would like to indexing each element such as $0-->0, 1-->1,2-->2,x-->3, x^2--4$ etc. Not only that, if I call any element for example if I call x^2 it should rerun 4 and conversely.

This process should work for the field order prime $p^m, m=1$ also. How can I do this?

edit retag flag offensive close merge delete


What is the logic behind this indexing? The more usual way is to associate $f(x)$ to $f(p) \in \mathbb{N}$, so $x^2$ corresponds to $9$ and $x+1$ corresponds to $4$.

rburing gravatar imagerburing ( 2021-01-20 13:32:46 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-01-20 13:32:44 +0100

eric_g gravatar image

updated 2021-01-20 13:33:25 +0100

If you don't have any privileged choice for the ordering of the elements, simply use list(F) to generate a list containing all elements of the finite field. For instance:

sage: F.<x> = GF(3^5, impl='givaro')                                                                
sage: LF = list(F)

The first 10 elements of the list LF are

sage: LF[:10]                                                                                       
 x + 2,
 x^2 + 2*x,
 x^3 + 2*x^2,
 x^4 + 2*x^3,
 2*x^4 + x + 2]

Accessing to element of index 5:

sage: LF[5]                                                                                         
x + 2

The reverse operation:

sage: LF.index(x + 2)                                                                               
edit flag offensive delete link more

answered 2021-01-20 13:38:07 +0100

rburing gravatar image

Using the more standard indexing:

sage: F.<x> = GF(3^5, impl='givaro')
sage: F.fetch_int(4)
x + 1
sage: (x+1).integer_representation()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-01-20 10:52:20 +0100

Seen: 51 times

Last updated: Jan 20