ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 30 Aug 2014 17:56:11 +0200Units in a quotient of a polynomial ringhttps://ask.sagemath.org/question/24004/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. Sat, 30 Aug 2014 16:47:58 +0200https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/Answer by tmonteil for <p>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. </p>
https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?answer=24005#post-id-24005I 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.
Sat, 30 Aug 2014 17:13:31 +0200https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?answer=24005#post-id-24005Comment by Chebolu for <p>I think the following is self-explanatory:</p>
<pre><code>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)
</code></pre>
<p>The problem afterwards is that Sage is does not know much about <code>R</code>, for example, even if <code>R</code> is finite, you can not iterate over it:</p>
<pre><code>sage: R.list()
NotImplementedError: object does not support iteration
</code></pre>
<p>It does not even knows that <code>R</code> is finite:</p>
<pre><code>sage: R.is_finite()
NotImplementedError:
</code></pre>
<p>Nor whether some elements are units:</p>
<pre><code>sage: a = R.an_element()
sage: a
xbar
sage: a.is_unit()
NotImplementedError:
</code></pre>
<p>But you are welcome to join and help fill to the gap !</p>
<p><strong>EDIT</strong> What makes me fear however is the following:</p>
<pre><code>sage: 2*xbar+2 == 0
False
sage: (2*xbar+2 ).is_zero()
NotImplementedError:
</code></pre>
<p>We should definitely prevent Sage answering random things when it does not know.</p>
https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?comment=24008#post-id-24008Thank 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.Sat, 30 Aug 2014 17:32:36 +0200https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?comment=24008#post-id-24008Comment by tmonteil for <p>I think the following is self-explanatory:</p>
<pre><code>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)
</code></pre>
<p>The problem afterwards is that Sage is does not know much about <code>R</code>, for example, even if <code>R</code> is finite, you can not iterate over it:</p>
<pre><code>sage: R.list()
NotImplementedError: object does not support iteration
</code></pre>
<p>It does not even knows that <code>R</code> is finite:</p>
<pre><code>sage: R.is_finite()
NotImplementedError:
</code></pre>
<p>Nor whether some elements are units:</p>
<pre><code>sage: a = R.an_element()
sage: a
xbar
sage: a.is_unit()
NotImplementedError:
</code></pre>
<p>But you are welcome to join and help fill to the gap !</p>
<p><strong>EDIT</strong> What makes me fear however is the following:</p>
<pre><code>sage: 2*xbar+2 == 0
False
sage: (2*xbar+2 ).is_zero()
NotImplementedError:
</code></pre>
<p>We should definitely prevent Sage answering random things when it does not know.</p>
https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?comment=24009#post-id-24009Ok very good. Once you know about this, please do not hesitate to share your investigations so that we will be able to include those in Sage.Sat, 30 Aug 2014 17:56:11 +0200https://ask.sagemath.org/question/24004/units-in-a-quotient-of-a-polynomial-ring/?comment=24009#post-id-24009