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.Sun, 21 Feb 2021 11:39:56 +0100Turning a closed subscheme into a pointhttps://ask.sagemath.org/question/55793/turning-a-closed-subscheme-into-a-point/I have two curves in a two-dimensional projective space. I compute the scheme theoretic-intersection, and then take the irreducible components. Each of these things really is an honest point in P2. How can I get from the closed subscheme form of these points to the actual coordinates?
Here's an example. I compute the intersection of the (projective closures of) y=0 and y=x^2-1. The result should be two points, namely [1,0,1] and [-1,0,1].
P2 = ProjectiveSpace(QQ,2,'x,y,z')
P2.inject_variables()
V1 = P2.subscheme(y)
V2 = P2.subscheme(y*z-x^2+z^2)
W = V1.intersection(V2)
[ p1, p2 ] = W.irreducible_components()
I can only get as far as p1 and p2, which Sage thinks of as
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
y,
x - z,
How to I turn it into a point in projective space, like P2([1,0,1])?
Sun, 21 Feb 2021 04:32:43 +0100https://ask.sagemath.org/question/55793/turning-a-closed-subscheme-into-a-point/Answer by rburing for <p>I have two curves in a two-dimensional projective space. I compute the scheme theoretic-intersection, and then take the irreducible components. Each of these things really is an honest point in P2. How can I get from the closed subscheme form of these points to the actual coordinates?</p>
<p>Here's an example. I compute the intersection of the (projective closures of) y=0 and y=x^2-1. The result should be two points, namely [1,0,1] and [-1,0,1]. </p>
<pre><code>P2 = ProjectiveSpace(QQ,2,'x,y,z')
P2.inject_variables()
V1 = P2.subscheme(y)
V2 = P2.subscheme(y*z-x^2+z^2)
W = V1.intersection(V2)
[ p1, p2 ] = W.irreducible_components()
</code></pre>
<p>I can only get as far as p1 and p2, which Sage thinks of as</p>
<pre><code>Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
y,
x - z,
</code></pre>
<p>How to I turn it into a point in projective space, like P2([1,0,1])?</p>
https://ask.sagemath.org/question/55793/turning-a-closed-subscheme-into-a-point/?answer=55794#post-id-55794You can use the [rational_points](https://doc.sagemath.org/html/en/reference/schemes/sage/schemes/generic/algebraic_scheme.html#sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme.rational_points) method:
sage: p1.rational_points()
[(1 : 0 : 1)]
sage: p2.rational_points()
[(-1 : 0 : 1)]
By the way, also for points defined over other fields:
sage: A.<x,y> = ProjectiveSpace(QQ,1)
sage: X = A.subscheme(x^2 - 2*y^2)
sage: X.rational_points(F=QQbar)
[(-1.414213562373095? : 1), (1.414213562373095? : 1)]Sun, 21 Feb 2021 11:39:56 +0100https://ask.sagemath.org/question/55793/turning-a-closed-subscheme-into-a-point/?answer=55794#post-id-55794