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.Wed, 16 Mar 2011 13:55:35 +0100Prime ideals and "Point on Spectrum"https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/The spectrum of the ring of integers $\mathbb{Z}$ consists of the prime ideals, i.e. $Spec(\mathbb{Z}) = \cup_{p \space prime}p\mathbb{Z} \cup (0)$.
i1: S = Spec(ZZ)
i2: nZ = ZZ.ideal(6)
i3: S(nZ)
o3: Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
i4: nZ.is_prime()
o4: False
Obviously, nZ is not a prime ideal, as 6 is composite. Hence by definition, it is not in $Spec(\mathbb{Z})$. So what does "Point on Spectrum" means exactly in Sage?
ThanksTue, 15 Mar 2011 16:13:32 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/Answer by niles for <p>The spectrum of the ring of integers $\mathbb{Z}$ consists of the prime ideals, i.e. $Spec(\mathbb{Z}) = \cup_{p \space prime}p\mathbb{Z} \cup (0)$.</p>
<pre><code>i1: S = Spec(ZZ)
i2: nZ = ZZ.ideal(6)
i3: S(nZ)
o3: Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
i4: nZ.is_prime()
o4: False
</code></pre>
<p>Obviously, nZ is not a prime ideal, as 6 is composite. Hence by definition, it is not in $Spec(\mathbb{Z})$. So what does "Point on Spectrum" means exactly in Sage?</p>
<p>Thanks</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?answer=12193#post-id-12193Spec means the same thing in Sage that it does everywhere else. It's just that
`Spec` just doesn't check to see whether its input is a prime ideal: it relies on `SchemeTopologicalPoint_prime_ideal`: You can tell this because the `__call__` method of `sage.schemes.generic.spec.Spec` is simply
return point.SchemeTopologicalPoint_prime_ideal(self, x)
However `SchemeTopologicalPoint_prime_ideal` doesn't check to see whether the input ideal is prime either! It does allow an optional argument `check` which will perform the check, but this is disabled by default. Here is the code from `sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__`:
R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
So if you were calling `SchemeTopologicalPoint_prime_ideal` directly, you could pass `check=True` to have it check for you:
sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
Unfortunately, the `__call__` method of `Spec` doesn't take a `check` argument, and it doesn't pass its additional keyword arguments along using `**kwds`, so there isn't a way to have `Spec` check for you directly.
To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on [Trac](http://trac.sagemath.org/sage_trac/) for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to `Spec`.
Tue, 15 Mar 2011 16:42:53 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?answer=12193#post-id-12193Comment by niles for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21978#post-id-21978cool -- thanks!Wed, 16 Mar 2011 13:55:35 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21978#post-id-21978Comment by John Palmieri for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21985#post-id-21985If someone is filing a trac ticket about this, then I have two comments: first, note this problem: `Spec(IntegerModRing(9)).an_element()` has output `Point on Spectrum of Ring of integers modulo 9 defined by the Principal ideal (2) of Ring of integers modulo 9`. Second, http://trac.sagemath.org/sage_trac/ticket/10934 is somewhat related.Tue, 15 Mar 2011 17:08:03 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21985#post-id-21985Comment by Weaam for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21984#post-id-21984@niles It makes perfect sense now. Thank you.Tue, 15 Mar 2011 23:02:16 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21984#post-id-21984Comment by Weaam for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21983#post-id-21983@John Palmieri. I shouldn't fill a trac ticket then? Thanks for your efforts.Tue, 15 Mar 2011 23:15:56 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21983#post-id-21983Comment by Weaam for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21980#post-id-21980@niles -- Thanks again for your efforts. I filed the ticked (#10949).Wed, 16 Mar 2011 12:58:28 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21980#post-id-21980Comment by niles for <p>Spec means the same thing in Sage that it does everywhere else. It's just that
<code>Spec</code> just doesn't check to see whether its input is a prime ideal: it relies on <code>SchemeTopologicalPoint_prime_ideal</code>: You can tell this because the <code>__call__</code> method of <code>sage.schemes.generic.spec.Spec</code> is simply</p>
<pre><code> return point.SchemeTopologicalPoint_prime_ideal(self, x)
</code></pre>
<p>However <code>SchemeTopologicalPoint_prime_ideal</code> doesn't check to see whether the input ideal is prime either! It does allow an optional argument <code>check</code> which will perform the check, but this is disabled by default. Here is the code from <code>sage.schemes.generic.point.SchemeTopologicalPoint_prime_ideal.__init__</code>:</p>
<pre><code> R = S.coordinate_ring()
from sage.rings.ideal import Ideal
P = Ideal(R, P)
# ideally we would have check=True by default, but
# unfortunately is_prime() is only implemented in a small
# number of cases
if check and not P.is_prime():
raise ValueError, "The argument %s must be a prime ideal of %s"%(P, R)
SchemeTopologicalPoint.__init__(self, S)
self.__P = P
</code></pre>
<p>So if you were calling <code>SchemeTopologicalPoint_prime_ideal</code> directly, you could pass <code>check=True</code> to have it check for you:</p>
<pre><code>sage: S = Spec(ZZ)
sage: nZ = ZZ.ideal(6)
sage: from sage.schemes.generic.point import SchemeTopologicalPoint_prime_ideal as primept
sage: primept(S,nZ)
Point on Spectrum of Integer Ring defined by the Principal ideal (6) of Integer Ring
sage: primept(S,nZ,check=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
ValueError: The argument Principal ideal (6) of Integer Ring must be a prime ideal of Integer Ring
</code></pre>
<p>Unfortunately, the <code>__call__</code> method of <code>Spec</code> doesn't take a <code>check</code> argument, and it doesn't pass its additional keyword arguments along using <code>**kwds</code>, so there isn't a way to have <code>Spec</code> check for you directly.</p>
<p>To me, this all seems confusing, shoddy, and disappointing; you should file a ticket on <a href="http://trac.sagemath.org/sage_trac/">Trac</a> for this (if there isn't one already). If you're in a situation where you need this functionality, I would suggest adding a line of code to check whether the ideal is prime before you pass it to <code>Spec</code>.</p>
https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21981#post-id-21981@Weaam -- I think you should file the ticket. Whoever does, just report the link here when you do so we know about it.Wed, 16 Mar 2011 09:35:07 +0100https://ask.sagemath.org/question/8003/prime-ideals-and-point-on-spectrum/?comment=21981#post-id-21981