# Units in a quotient of a polynomial ring

How can I do calculations in a quotient ring using sage? For example, I would like to find all the units (or at least count the number of units) in this quotient ring. Z_4[x]/(x^4+1, 2+2x). (Here Z_4 is the ring of integers mod 4.) Is that possible? I could not find any useful documentation for quotients of polynomial rings that are not a PID. Any help would be greatly appreciated. Thank you.

edit retag close merge delete

Sort by » oldest newest most voted

I think the following is self-explanatory:

sage: Z_4 = IntegerModRing(4)
sage: Z_4
Ring of integers modulo 4
sage: P.<x> = PolynomialRing(Z_4)
sage: P
Univariate Polynomial Ring in x over Ring of integers modulo 4
sage: I = P.ideal(x^4+1, 2+2*x)
sage: I
Ideal (x^4 + 1, 2*x + 2) of Univariate Polynomial Ring in x over Ring of integers modulo 4
sage: R = P.quotient(I)
sage: R
Quotient of Univariate Polynomial Ring in x over Ring of integers modulo 4 by the ideal (x^4 + 1, 2*x + 2)


The problem afterwards is that Sage is does not know much about R, for example, even if R is finite, you can not iterate over it:

sage: R.list()
NotImplementedError: object does not support iteration


It does not even knows that R is finite:

sage: R.is_finite()
NotImplementedError:


Nor whether some elements are units:

sage: a = R.an_element()
sage: a
xbar
sage: a.is_unit()
NotImplementedError:


But you are welcome to join and help fill to the gap !

EDIT What makes me fear however is the following:

sage: 2*xbar+2 == 0
False
sage: (2*xbar+2 ).is_zero()
NotImplementedError:


We should definitely prevent Sage answering random things when it does not know.

more

Thank you for your help. That is exactly the problem I have been facing. I am able to input the ring but unable to make sage do any useful calculations with it. So in a way it is useless. I am trying to find a way around this problem but I don't see how to this yet.