Ask Your Question

polynomials in finite field: extracting coefficients

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

fagui gravatar image

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

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

x^4 + x + 1

R.<x> = PolynomialRing(F)
g in R

f in R

(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 ?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

tmonteil gravatar image

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

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


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

Seen: 1,032 times

Last updated: Jun 24 '16