Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Polynomial arithmetic modulo prime powers

asked 12 years ago

Robert Pollack gravatar image

I'm trying to do some operations with polynomials over Z/pnZ and I'm stuck on some basic things:

1) Is it possible in SAGE to long divide two polynomials in Z/pnZ[x]?

2) Is it possible in SAGE to factor a polynomial in Z/pnZ[x]?

Am I missing something about the basic functionality of (1)? Is this really something that I need to program myself??

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

calc314 gravatar image

updated 12 years ago

Here is what I've found. You can define the coefficients in the ring R=Integer(9). Then, define the polynomial ring K.<x>=R[]. After that, you can do calculations in the polynomial ring and can find the quotient and remainder. That handles the long division. See below.

sage: R=Integers(9)
sage: list(R)

[0, 1, 2, 3, 4, 5, 6, 7, 8]

sage: K.<x>=R[]
sage: p1=x^4-3*x
sage: print p1

x^4 + 6*x

sage: p2=x^2+5
sage: p1*p2

x^6 + 5*x^4 + 6*x^3 + 3*x

sage: p1.quo_rem(p2)

(x^2 + 4, 6*x + 7)

sage: (x^2+4)*p2+(6*x+7)

x^4 + 6*x

In terms of factoring, I get an error, since Z/pnZ[x] is not an unique factorization domain, n>1.

sage: p1.factor()

Traceback (most recent call last):
...
NotImplementedError: factorization of polynomials over rings with composite characteristic is not implemented

So this won't work for pn with p prime and n>1. However, it will work nicely for just prime p.

Preview: (hide)
link

Comments

One more note...since Z/9Z is not an integral domain, `quo_rem` won't always work. For example, `(x^2).quo_rem(3*x)` does not work in the polynomial ring set up above.

calc314 gravatar imagecalc314 ( 12 years ago )

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: 12 years ago

Seen: 2,253 times

Last updated: Jul 20 '12