Ask Your Question

polynomials in finite field: extracting coefficients

asked 2016-06-24 10:35:16 -0600

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 10:52:17 -0600

tmonteil gravatar image

updated 2016-06-24 10:58:40 -0600

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 10:35:16 -0600

Seen: 55 times

Last updated: Jun 24 '16