Ask Your Question

Evaluating discriminant of a polynomial in Z_n[x]/<x^r-1>

asked 2016-06-22 01:10:18 -0600

vishb gravatar image

updated 2016-06-22 01:10:51 -0600

Consider the following code

R = PolynomialRing(Zn,'x')
F = R.quotient((x**r)-1)

Clearly f will be a polynomial in xbar , I want to consider this polynomial as a polynomial in $ \mathbb{Z}[x] $ and evaluate its discriminant.

I tried "f.polynomial()" but it is not working. Any suggestions ?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2016-06-22 01:44:18 -0600

B r u n o gravatar image

updated 2016-06-22 12:01:28 -0600

The method you are looking for is called lift:

sage: g = f.lift()
sage: g
7*x^9 + 9*x^8 + 9*x^7 + 7*x^6 + 8*x^5 + 8*x^4 + 8*x + 8
sage: g.parent()
Univariate Polynomial Ring in x over Ring of integers modulo 14
sage: g.discriminant()

As a side comment: I created Zn = Zmod(14). If you want to work in a finite field with p elements, you should better use K = GF(p) than Zn = Zmod(p) since you are telling Sage that K is a field.

EDIT: If you want the polynomial over $\mathbb{Z}$, you can do the following:

sage: h = g.change_ring(ZZ)
sage: h.discriminant()
edit flag offensive delete link more


Nice answer. Note that this gives a polynomial over Zn, and its discriminant is computed modulo n.

slelievre gravatar imageslelievre ( 2016-06-22 02:09:58 -0600 )edit

Thanks a lot ! Can you kindly help me with this question also.

vishb gravatar imagevishb ( 2016-06-22 02:51:52 -0600 )edit

answered 2016-06-22 02:02:40 -0600

Your friend here is the list method, which will give you the coefficients of f as a polynomial in xbar.

Then you will be able to take its discriminant.

Let us illustrate this step by step.

To begin with, for reference, here is the Sage version used below.

sage: version()
'SageMath version 7.2, Release Date: 2016-05-15'

Let us set some values for n and r so that the code works and others can try it out.

sage: n = 13
sage: r = 7

Now define Zn, R, F, y, f as you did.

sage: Zn = Zmod(n)
sage: R = PolynomialRing(Zn, 'x')
sage: F = R.quotient(x**r-1)
sage: y = F(x+1)
sage: f = F(y**n)

We get:

sage: f
xbar^6 + 1

Get the coefficients:

sage: f.list()
[1, 0, 0, 0, 0, 0, 1]

Define the ring of polynomials over ZZ:

sage: Zx = PolynomialRing(ZZ, 'x')

The polynomial corresponding to f:

sage: ff = Zx(f.list())
sage: ff
x^6 + 1

The discriminant of this polynomial:

sage: ff.discriminant()
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-22 01:10:18 -0600

Seen: 69 times

Last updated: Jun 22 '16