1 | initial version |
Actually, if you want to factor over a different base ring, you need to make the object you're trying to factor an element of that base ring. For example,
sage: factor(x^2+1)
x^2 + 1
sage: R.<x> = CC[]
sage: factor(x^2+1)
(x - I) * (x + I)
sage: R.<x> = IntegerModRing(5)[]
sage: factor(x^2+1)
(x + 2) * (x + 3)
Unfortunately, if you do it with IntegerModRing(25)
, we get a NotImplementedError
.
sage: R.<x> = IntegerModRing(25)[]
sage: factor(x^2+1)
Traceback (most recent call last)
...
NotImplementedError: factorization of polynomials over rings with composite characteristic is not implemented