Ask Your Question
0

polynomials in finite field: extracting coefficients

asked 2016-06-24 17:35:16 +0100

fagui gravatar image

Hi i would like to go a bit deeper than this question

http://stackoverflow.com/questions/21...

F.<e> = GF(16)
p = e.minpoly()
p

x^4 + x + 1

R.<x> = PolynomialRing(F)
g=(x+e)*(x+e^14)
g in R

f=-((g(x)-g(e^2))/(x-e^2))*(1/g(e^2))
f in R
f

(e^3 + e^2 + e + 1)*x + e^3 + e

(1) it looks like f is not recognized as a polynomial as it was defined as a rational function which happened to simplify into a polynomial. As such, trying to use a method like f.list() or f.coeff() would cause an error

AttributeError: 'FractionFieldElement_1poly_field' object has no attribute 'degree'

(2) it happens that the coefficient for x is actually equal to e^12, and the constant coefficient is e^9 is there an option when working in GF(16) to display every element as a power of e instead of a linear combination of 1,e,e^2,e^3 ?

thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-24 17:52:17 +0100

tmonteil gravatar image

updated 2016-06-24 17:58:40 +0100

f is indeed a rational function, since it was defined as a fraction:

sage: f.parent()
Fraction Field of Univariate Polynomial Ring in x over Finite Field in e of size 2^4

You can convert it into a polynomial as follows:

sage: ff = R(f)
sage: ff
(e^3 + e^2 + e + 1)*x + e^3 + e
sage: ff.parent()
Univariate Polynomial Ring in x over Finite Field in e of size 2^4
sage: ff.list()
[e^3 + e, e^3 + e^2 + e + 1]

For your second question you can get the exponents you want using the rank method. However, i am not sure you can change the default representation easily.

sage: [c.rank() for c in ff.list()]
[9, 12]
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

Stats

Asked: 2016-06-24 17:35:16 +0100

Seen: 1,116 times

Last updated: Jun 24 '16