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.Tue, 14 Jul 2020 13:43:47 +0200One point from infinity varietyhttps://ask.sagemath.org/question/52460/one-point-from-infinity-variety/ Given an ideal, I want to compute a non-zero point in the variety of that ideal. This can be done with `.variety()` if the ideal has 0-dimension. How can I get a non-zero point in the variety if the ideal is not 0-dimensional?
Example:
R.<x,y> = PolynomialRing(QQ)
I = R.ideal([x^2-y^2])
I.variety()
yields an error. How can I get a point like (1,1) which lies in the variety?
Thanks!Tue, 14 Jul 2020 10:00:35 +0200https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/Comment by FrédéricC for <p>Given an ideal, I want to compute a non-zero point in the variety of that ideal. This can be done with <code>.variety()</code> if the ideal has 0-dimension. How can I get a non-zero point in the variety if the ideal is not 0-dimensional?</p>
<p>Example:</p>
<pre><code>R.<x,y> = PolynomialRing(QQ)
I = R.ideal([x^2-y^2])
I.variety()
</code></pre>
<p>yields an error. How can I get a point like (1,1) which lies in the variety?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52463#post-id-52463Cut by hyperplanes until the dimension is zero.Tue, 14 Jul 2020 11:43:55 +0200https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52463#post-id-52463Comment by philipp7 for <p>Given an ideal, I want to compute a non-zero point in the variety of that ideal. This can be done with <code>.variety()</code> if the ideal has 0-dimension. How can I get a non-zero point in the variety if the ideal is not 0-dimensional?</p>
<p>Example:</p>
<pre><code>R.<x,y> = PolynomialRing(QQ)
I = R.ideal([x^2-y^2])
I.variety()
</code></pre>
<p>yields an error. How can I get a point like (1,1) which lies in the variety?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52466#post-id-52466Thank you! Two problems come into my mind with that approach: 1. If I intersect with hyperplanes I do not necessarily reduce the dimension by 1. Say I start with dimension 3, I might get the entire ring (so no solution at all) just by adding one hyperplane. 2. I am searching for elements in the variety which are (say) rational. By intersecting with a hyperplane I might get rid of possible rational solutions. However, I suppose mathematically this problem should be quite hard, as it is already very difficult to find rational points on some "easy" curves.Tue, 14 Jul 2020 13:41:08 +0200https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52466#post-id-52466Answer by Emmanuel Charpentier for <p>Given an ideal, I want to compute a non-zero point in the variety of that ideal. This can be done with <code>.variety()</code> if the ideal has 0-dimension. How can I get a non-zero point in the variety if the ideal is not 0-dimensional?</p>
<p>Example:</p>
<pre><code>R.<x,y> = PolynomialRing(QQ)
I = R.ideal([x^2-y^2])
I.variety()
</code></pre>
<p>yields an error. How can I get a point like (1,1) which lies in the variety?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?answer=52464#post-id-52464I *tink* that this is along the lines provided by FrédéricC :
sage: RR.<x,y>=PolynomialRing(QQ) ## R has some use already
sage: J=RR.ideal([x^2-y^2]) ## Similarly, I has an interesting use
sage: [J.random_element(u) for u in (1..5)]
[0,
-1/2*x^2 + 1/2*y^2,
-1/39*x^3 - 2/3*x^2*y + 1/39*x*y^2 + 2/3*y^3,
-x^3*y + x*y^3 - x^3 + x*y^2 + x^2 - y^2,
-4*x^2*y^3 + 4*y^5 + x^3 + 7/4*x^2*y - x*y^2 - 7/4*y^3 - x^2 + y^2]
HTH,Tue, 14 Jul 2020 13:02:39 +0200https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?answer=52464#post-id-52464Comment by philipp7 for <p>I <em>tink</em> that this is along the lines provided by FrédéricC :</p>
<pre><code>sage: RR.<x,y>=PolynomialRing(QQ) ## R has some use already
sage: J=RR.ideal([x^2-y^2]) ## Similarly, I has an interesting use
sage: [J.random_element(u) for u in (1..5)]
[0,
-1/2*x^2 + 1/2*y^2,
-1/39*x^3 - 2/3*x^2*y + 1/39*x*y^2 + 2/3*y^3,
-x^3*y + x*y^3 - x^3 + x*y^2 + x^2 - y^2,
-4*x^2*y^3 + 4*y^5 + x^3 + 7/4*x^2*y - x*y^2 - 7/4*y^3 - x^2 + y^2]
</code></pre>
<p>HTH,</p>
https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52467#post-id-52467Thank you. I am probably missing something here. How do I get a random point in the variety from some random polynomials in the ideal?Tue, 14 Jul 2020 13:43:47 +0200https://ask.sagemath.org/question/52460/one-point-from-infinity-variety/?comment=52467#post-id-52467