# 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])?

edit retag close merge delete

Sort by » oldest newest most voted You can use the 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)]

more