# Generating (Z/nZ[x])/(x^N-1)

Hey Guys, i am absolutely new to sage but want to use it for some algebraic calculations. Therefore i must generate the Polynomial ring R=$(Z/nZ[x])/(x^N-1)$ to calcuate some inverses and products of some polynomials in R.

I hope it's not a too stupid question and apologize for bothering you guys with this but i still hope someone can give me an answer :).

(ofc for some given n and N)

edit retag close merge delete

Sort by ยป oldest newest most voted

You should have a look at the documentation.

sage: A = Zmod(4)
sage: P = PolynomialRing(A, 'x')
sage: x = P.gen()
sage: R = R.quotient(x^7 - 1)
sage: xbar = R.gen()
sage: xbar ** 7
1
sage: 4 * xbar
0


But note that computation of inverses does not work at all:

sage: 1 / xbar
Traceback (most recent call last):
...
NotImplementedError: The base ring (=Ring of integers modulo 4) is not a field

more

first of thanks. i dont know why haven't found that documentation... is there no possibility to compute inverses?

( 2015-10-08 09:19:13 -0500 )edit

Probably because Sage doesn't want to try to compute inverses when there is no guarantee there will be an inverse to a given element?

( 2015-10-09 05:40:35 -0500 )edit

is there another computer algebra system that tries it even though its not a field?

( 2015-10-09 09:33:47 -0500 )edit

Can you explain me what that "xbar" means?

( 2015-11-21 10:25:46 -0500 )edit

xbar is just the name of the variable given by @vdelecroix As you can see, it is defined as R.gen() which means that it is the generator or the quitient ring of P by x^7 - 1, more precisely, it is the image of x under the quotient map.

( 2015-11-21 10:46:13 -0500 )edit