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.Mon, 01 Jun 2020 22:49:28 +0200Get point coordinates of curve over number fieldhttps://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/Suppose I have equation of curve `C`:
curve
# => y^2 + (x^2 + x)*y + x
curve.parent()
# => Univariate Polynomial Ring in y over Rational function field in x over Rational Field
and I know that there is a point with `x` value is a root of another equation (i.e. element of corresponding Number Field):
equation
# => x^3 + x^2 - 2*x - 9/2
equation.parent()
# => Univariate Polynomial Ring in x over Rational Field
is x-coordinate of some point of `C`.
How to properly get y-coordinate of `C` in `x`?
It is not as easy as it seems because of conversion problems.
My workaround is as following:
FF.<z> = NumberField(equation)
P.<x,y> = QQ[]
u = P(curve).subs(x=z)
P.<y> = FF[]
return z, P(u).roots()[0][0]
and it doesn't seem right.
Are there more elegant way of doing it?
P.S. `curve` is constructed as follows:
F = FunctionField(QQ, 'x')
x = F.gen()
R.<y> = F[]
curve = y^2 + (x^2 + x)*y + x;
But it was done in another place so I have no direct access to `x` and `y` from above code.Mon, 01 Jun 2020 14:56:20 +0200https://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/Comment by tmonteil for <p>Suppose I have equation of curve <code>C</code>:</p>
<pre><code>curve
# => y^2 + (x^2 + x)*y + x
curve.parent()
# => Univariate Polynomial Ring in y over Rational function field in x over Rational Field
</code></pre>
<p>and I know that there is a point with <code>x</code> value is a root of another equation (i.e. element of corresponding Number Field): </p>
<pre><code>equation
# => x^3 + x^2 - 2*x - 9/2
equation.parent()
# => Univariate Polynomial Ring in x over Rational Field
</code></pre>
<p>is x-coordinate of some point of <code>C</code>.</p>
<p>How to properly get y-coordinate of <code>C</code> in <code>x</code>?</p>
<p>It is not as easy as it seems because of conversion problems.</p>
<p>My workaround is as following:</p>
<pre><code>FF.<z> = NumberField(equation)
P.<x,y> = QQ[]
u = P(curve).subs(x=z)
P.<y> = FF[]
return z, P(u).roots()[0][0]
</code></pre>
<p>and it doesn't seem right.</p>
<p>Are there more elegant way of doing it?</p>
<p>P.S. <code>curve</code> is constructed as follows:</p>
<pre><code> F = FunctionField(QQ, 'x')
x = F.gen()
R.<y> = F[]
curve = y^2 + (x^2 + x)*y + x;
</code></pre>
<p>But it was done in another place so I have no direct access to <code>x</code> and <code>y</code> from above code.</p>
https://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/?comment=51677#post-id-51677Could you please provide the construction of `curve` ?Mon, 01 Jun 2020 15:46:03 +0200https://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/?comment=51677#post-id-51677Comment by petRUShka for <p>Suppose I have equation of curve <code>C</code>:</p>
<pre><code>curve
# => y^2 + (x^2 + x)*y + x
curve.parent()
# => Univariate Polynomial Ring in y over Rational function field in x over Rational Field
</code></pre>
<p>and I know that there is a point with <code>x</code> value is a root of another equation (i.e. element of corresponding Number Field): </p>
<pre><code>equation
# => x^3 + x^2 - 2*x - 9/2
equation.parent()
# => Univariate Polynomial Ring in x over Rational Field
</code></pre>
<p>is x-coordinate of some point of <code>C</code>.</p>
<p>How to properly get y-coordinate of <code>C</code> in <code>x</code>?</p>
<p>It is not as easy as it seems because of conversion problems.</p>
<p>My workaround is as following:</p>
<pre><code>FF.<z> = NumberField(equation)
P.<x,y> = QQ[]
u = P(curve).subs(x=z)
P.<y> = FF[]
return z, P(u).roots()[0][0]
</code></pre>
<p>and it doesn't seem right.</p>
<p>Are there more elegant way of doing it?</p>
<p>P.S. <code>curve</code> is constructed as follows:</p>
<pre><code> F = FunctionField(QQ, 'x')
x = F.gen()
R.<y> = F[]
curve = y^2 + (x^2 + x)*y + x;
</code></pre>
<p>But it was done in another place so I have no direct access to <code>x</code> and <code>y</code> from above code.</p>
https://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/?comment=51685#post-id-51685@tmonteil, I've added P.S. with detailsMon, 01 Jun 2020 22:49:28 +0200https://ask.sagemath.org/question/51672/get-point-coordinates-of-curve-over-number-field/?comment=51685#post-id-51685