Processing math: 100%
Ask Your Question
0

How to index all elements of a finite field?

asked 4 years ago

MKS gravatar image

updated 4 years ago

I would like to assign an integer corresponding to element of a finite field GF(pm), where pm[132,35,131,137,139,251]
MWE:

 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,x24 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 pm,m=1 also. How can I do this?

Preview: (hide)

Comments

What is the logic behind this indexing? The more usual way is to associate f(x) to f(p)N, so x2 corresponds to 9 and x+1 corresponds to 4.

rburing gravatar imagerburing ( 4 years ago )

2 Answers

Sort by » oldest newest most voted
0

answered 4 years ago

eric_g gravatar image

updated 4 years ago

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]                                                                                       
[0,
 x,
 x^2,
 x^3,
 x^4,
 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)                                                                               
5
Preview: (hide)
link
0

answered 4 years ago

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()
4
Preview: (hide)
link

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

Stats

Asked: 4 years ago

Seen: 836 times

Last updated: Jan 20 '21