ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 16 Sep 2019 11:24:37 -0500Check whether point is on a projective varietyhttps://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/I have a projective variety X (defined via .subscheme(polynomials) on a projective space). I have a projective point P. How can I check whether my point is on my variety?
The obvious answer is to try X.point(P). This throws an error if it's not a point, and constructs a point on X otherwise. Is there something like this that will simply give me true or false, rather than an error? Mon, 16 Sep 2019 11:08:25 -0500https://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/Answer by rburing for <p>I have a projective variety X (defined via .subscheme(polynomials) on a projective space). I have a projective point P. How can I check whether my point is on my variety?</p>
<p>The obvious answer is to try X.point(P). This throws an error if it's not a point, and constructs a point on X otherwise. Is there something like this that will simply give me true or false, rather than an error? </p>
https://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/?answer=47939#post-id-47939Sure, you can take a point from the ambient projective space and do a membership test:
sage: PP.<x,y,z,w,u,v> = ProductProjectiveSpaces([3,1],QQ)
sage: W = PP.subscheme([y^2*z-x^3,z^2-w^2,u^3-v^3])
sage: PP.point([1,1,1,1,1,1]) in W
True
sage: PP.point([1,1,1,1,1,2]) in W
False
Internally this does a `try` - `except` block around `W.point(...)`.Mon, 16 Sep 2019 11:21:06 -0500https://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/?answer=47939#post-id-47939Comment by ConfusedMark for <p>Sure, you can take a point from the ambient projective space and do a membership test:</p>
<pre><code>sage: PP.<x,y,z,w,u,v> = ProductProjectiveSpaces([3,1],QQ)
sage: W = PP.subscheme([y^2*z-x^3,z^2-w^2,u^3-v^3])
sage: PP.point([1,1,1,1,1,1]) in W
True
sage: PP.point([1,1,1,1,1,2]) in W
False
</code></pre>
<p>Internally this does a <code>try</code> - <code>except</code> block around <code>W.point(...)</code>.</p>
https://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/?comment=47940#post-id-47940Thank you so much! Didn't even think to try that.Mon, 16 Sep 2019 11:24:37 -0500https://ask.sagemath.org/question/47938/check-whether-point-is-on-a-projective-variety/?comment=47940#post-id-47940