Sage: Ticket #6045: [with patch, positive review] Computation of Heegner points
https://trac.sagemath.org/ticket/6045
<p>
Adds Heegner point method to elliptic curves over Q. Also cleans up the modular parametrization code.
</p>
<p>
This ticket is almost certainly related: <a class="closed ticket" href="https://trac.sagemath.org/ticket/4849" title="enhancement: add functionality for computing Heegner points to Sage (closed: duplicate)">#4849</a>
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/6045
Trac 1.1.6robertwbSat, 16 May 2009 03:11:29 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:1
https://trac.sagemath.org/ticket/6045#comment:1
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, needs work] Computation of Heegner points</em>
</li>
</ul>
<p>
I just looked at this and realized I can't just lift_x, I need to pick the right one. That should be easy given I have it embedded into C.
</p>
TicketrobertwbSat, 06 Jun 2009 06:30:41 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:2
https://trac.sagemath.org/ticket/6045#comment:2
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs work] Computation of Heegner points</em> to <em>[with patch, needs review] Computation of Heegner points</em>
</li>
</ul>
<p>
Fixed the lifting issue, ready for review.
</p>
TicketncalexanSat, 06 Jun 2009 20:26:24 GMTmilestone changed
https://trac.sagemath.org/ticket/6045#comment:3
https://trac.sagemath.org/ticket/6045#comment:3
<ul>
<li><strong>milestone</strong>
changed from <em>sage-4.0.2</em> to <em>sage-4.0.1</em>
</li>
</ul>
<p>
This code isn't ready for primetime, even with the lifting issue fixed, because increasing the precision until algdep succeeds is a recipe for disaster. Maybe a bound on the number of precision increases?
</p>
TicketmvnguSat, 06 Jun 2009 22:33:53 GMTmilestone changed
https://trac.sagemath.org/ticket/6045#comment:4
https://trac.sagemath.org/ticket/6045#comment:4
<ul>
<li><strong>milestone</strong>
changed from <em>sage-4.0.1</em> to <em>sage-4.0.2</em>
</li>
</ul>
TicketrobertwbSat, 06 Jun 2009 23:05:06 GMT
https://trac.sagemath.org/ticket/6045#comment:5
https://trac.sagemath.org/ticket/6045#comment:5
<p>
There is a bound on how often it increases precision--in fact it's even one of the parameters (max_prec).
</p>
TicketncalexanSat, 06 Jun 2009 23:13:23 GMT
https://trac.sagemath.org/ticket/6045#comment:6
https://trac.sagemath.org/ticket/6045#comment:6
<p>
Sorry, totally asleep at the wheel. This looks good to me, but I'm not expert in the genus 1 case. Maybe was can be the final word?
</p>
TicketcremonaSun, 14 Jun 2009 17:32:35 GMT
https://trac.sagemath.org/ticket/6045#comment:7
https://trac.sagemath.org/ticket/6045#comment:7
<p>
I'm intending to try this and review it since I have implemented similar in C++ and in gp.
</p>
TicketcremonaSun, 14 Jun 2009 17:58:06 GMT
https://trac.sagemath.org/ticket/6045#comment:8
https://trac.sagemath.org/ticket/6045#comment:8
<p>
REVIEW: I applied this to 4.0.1, but got some doctest failures:
</p>
<pre class="wiki">sage -t "devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py"
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 5248:
sage: E._heegner_best_tau(-7)
Expected:
(sqrt(7)*I - 17)/74
Got:
1/74*sqrt(-7) - 17/74
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 5250:
sage: EllipticCurve('389a')._heegner_best_tau(-11)
Expected:
(sqrt(11)*I - 355)/778
Got:
1/778*sqrt(-11) - 355/778
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 5291:
sage: P = E.heegner_point(-40); P
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_115[5]>", line 1, in <module>
P = E.heegner_point(-Integer(40)); P###line 5291:
sage: P = E.heegner_point(-40); P
File "/home/john/sage-4.0.1/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 5335, in heegner_point
raise ValueError, "Not enough precision (%s) to get heegner point exactly, try passing a larger max_prec." % (prec)
ValueError: Not enough precision (2000) to get heegner point exactly, try passing a larger max_prec.
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 5301:
sage: f = algdep(P[0], 5); f
Expected:
x^5 + 2*x^4 + x^3 - x^2 - x - 1
Got:
x^5 - x^4 + x^3 + x^2 - 2*x + 1
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 6825:
sage: phi(CC.0)
Expected:
(-2.04158222510587 + 3.21664059900000e-29*I : -0.500000000000000 + 0.0906126752327350*I : 1.00000000000000)
Got:
(287826.309565255 : -1.54417490329940e8 : 1.00000000000000)
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3114:
sage: X,Y=E.modular_parametrization()
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[3]>", line 1, in <module>
X,Y=E.modular_parametrization()###line 3114:
sage: X,Y=E.modular_parametrization()
TypeError: iteration over non-sequence
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3115:
sage: X
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[4]>", line 1, in <module>
X###line 3115:
sage: X
NameError: name 'X' is not defined
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3117:
sage: Y
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[5]>", line 1, in <module>
Y###line 3117:
sage: Y
NameError: name 'Y' is not defined
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3122:
sage: q = X.parent().gen()
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[6]>", line 1, in <module>
q = X.parent().gen()###line 3122:
sage: q = X.parent().gen()
NameError: name 'X' is not defined
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3123:
sage: E.defining_polynomial()(X,Y,1) + O(q^11) == 0
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[7]>", line 1, in <module>
E.defining_polynomial()(X,Y,Integer(1)) + O(q**Integer(11)) == Integer(0)###line 3123:
sage: E.defining_polynomial()(X,Y,1) + O(q^11) == 0
NameError: name 'X' is not defined
**********************************************************************
File "/home/john/sage-4.0.1/devel/sage-tests/sage/schemes/elliptic_curves/ell_rational_field.py", line 3133:
sage: f/q == (X.derivative()/(2*Y+a1*X+a3))
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/home/john/sage-4.0.1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_70[11]>", line 1, in <module>
f/q == (X.derivative()/(Integer(2)*Y+a1*X+a3))###line 3133:
sage: f/q == (X.derivative()/(2*Y+a1*X+a3))
NameError: name 'X' is not defined
**********************************************************************
4 items had failures:
2 of 5 in __main__.example_114
2 of 11 in __main__.example_115
1 of 5 in __main__.example_137
6 of 12 in __main__.example_70
***Test Failed*** 11 failures.
For whitespace errors, see the file /home/john/sage-4.0.1/tmp/.doctest_ell_rational_field.py
[85.3 s]
exit code: 1024
</pre><p>
This is on a 32-bit machine -- possibly the problem?
</p>
<p>
Note -- I'm planning to implement a better weierstrass function, calling the pari library. In fact I already did that, got stuck on precision problems, then deleted that branch by mistake so it is back to square one.
</p>
<p>
Also, for recognising the points, what I have always done is compute all the conjugates (not quite all, I do one from each complex conjugate pair) and then add them up (on C mod the lattice) before applying Weierstrass. I have never tried to recognise the points as points defined over the Hilbert class field.
</p>
TicketcremonaMon, 15 Jun 2009 09:22:55 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:9
https://trac.sagemath.org/ticket/6045#comment:9
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, needs work] Computation of Heegner points</em>
</li>
</ul>
TicketrobertwbWed, 17 Jun 2009 06:19:28 GMT
https://trac.sagemath.org/ticket/6045#comment:10
https://trac.sagemath.org/ticket/6045#comment:10
<p>
Some of these are due to new symbolics printing differently, others may be due to different choices of root (it was developed on Sage < 4.0). I'll rebase and see what's up.
</p>
TicketrobertwbTue, 23 Jun 2009 08:57:14 GMTattachment set
https://trac.sagemath.org/ticket/6045
https://trac.sagemath.org/ticket/6045
<ul>
<li><strong>attachment</strong>
set to <em>6045-heegner.patch</em>
</li>
</ul>
TicketrobertwbTue, 23 Jun 2009 08:58:57 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:11
https://trac.sagemath.org/ticket/6045#comment:11
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs work] Computation of Heegner points</em> to <em>[with patch, needs review] Computation of Heegner points</em>
</li>
</ul>
<p>
OK, I fixed the patch. As well as the symbolics printing changes, I had moved some doctests around and got some of them associated with the wrong output. Based on 4.0.2, ready to be looked at again.
</p>
TicketcremonaTue, 23 Jun 2009 20:04:50 GMT
https://trac.sagemath.org/ticket/6045#comment:12
https://trac.sagemath.org/ticket/6045#comment:12
<p>
Robert, can I suggest that we first get <a class="closed ticket" href="https://trac.sagemath.org/ticket/6386" title="enhancement: [with new patch, with positive review] Implement elliptic exponential (closed: fixed)">#6386</a> approved (e.g. by you reviewing it) as then your step of going from z mod period lattice to E(CC) can be done much better than your explicit use of pari/gp? (I do use pari behind the scene of course). I think that might be better than reviewing this now and then patching it again later. john
</p>
TicketrobertwbThu, 25 Jun 2009 03:42:15 GMT
https://trac.sagemath.org/ticket/6045#comment:13
https://trac.sagemath.org/ticket/6045#comment:13
<p>
That's a clever way of getting someone to review your work :). Actually, I was planning on looking at your elliptic exponential function anyways, so I'll go review that (and modify this to use it, under the very safe assumption that it's good).
</p>
TicketcremonaThu, 25 Jun 2009 08:40:42 GMT
https://trac.sagemath.org/ticket/6045#comment:14
https://trac.sagemath.org/ticket/6045#comment:14
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/6045#comment:13" title="Comment 13">robertwb</a>:
</p>
<blockquote class="citation">
<p>
That's a clever way of getting someone to review your work :). Actually, I was planning on looking at your elliptic exponential function anyways, so I'll go review that (and modify this to use it, under the very safe assumption that it's good).
</p>
</blockquote>
<p>
I hoped you would not mind. It was seeing that code in your patch which spurred me to get mine working properly. It seems that for some of these wrapped functions (particularly the pari ones), there are two distinct layers: the basic wrapper (here in gen.pyx), use of which directly requires careful study of the pari manual; and a proper Sage function, well documented and *not* requiring any knowledge of the deeper library.
</p>
TicketrobertwbFri, 26 Jun 2009 04:47:44 GMT
https://trac.sagemath.org/ticket/6045#comment:15
https://trac.sagemath.org/ticket/6045#comment:15
<p>
Depends on <a class="closed ticket" href="https://trac.sagemath.org/ticket/6386" title="enhancement: [with new patch, with positive review] Implement elliptic exponential (closed: fixed)">#6386</a>.
</p>
TicketrobertwbFri, 26 Jun 2009 06:12:39 GMTattachment set
https://trac.sagemath.org/ticket/6045
https://trac.sagemath.org/ticket/6045
<ul>
<li><strong>attachment</strong>
set to <em>6045-heegner2.patch</em>
</li>
</ul>
<p>
apply on top of previous
</p>
TicketcremonaSun, 28 Jun 2009 16:29:33 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:16
https://trac.sagemath.org/ticket/6045#comment:16
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, with review, needs work] Computation of Heegner points</em>
</li>
</ul>
<p>
NB this requires <a class="closed ticket" href="https://trac.sagemath.org/ticket/6386" title="enhancement: [with new patch, with positive review] Implement elliptic exponential (closed: fixed)">#6386</a>. Applies fine to 4.1.alpha2 + the four patches there. Tests in ell_rational_field pass.
</p>
<p>
Modular param: type "and and" in a comment.
</p>
<p>
Heegner: typo "give" -> "given" in 2 or 3 places in docstrings. Why
do you reverse the order of summation of a_n/n? Can you sum the
series using an iterator for the an instead of forming the whole list?
</p>
<blockquote>
<p>
_heegner_forms_list: (this only depends on N and D so could perhaps be
factored out of the class to a stand-alone function).
</p>
</blockquote>
<p>
More seriously, this function is *wrong*! (Though in a way which does
not matter for the use which is made of it here so far.) The point is
this: To get a complete set of forms you need to choose *one* sqrt of
D mod 4*N and use the same b for all the forms. Otherwise the points
you get are not Galois conjugate. [Changing b to another sqrt amounts
to applying to the point in the upper half plane one of the
Atkin-Lehner involutions. This has two effects: firstly, it may
change the sign of the integral (depending on the A-L eigenvalue;
secondly, it maps \infty to another cusp, hence adds a torsion point
to the Heegner point. So instead of getting come conjugate point P
you get either P+T or -P+T with T torsion. The reason that this does
not make the rest of the code wrong here is that you only actually use
one of the forms (the one with smallest a to get best accuracy) and
then use algdep. But we should have code that could in principal
deliver a set of Galois conjugate points.
</p>
<p>
To get around this: try all the sqrt of D mod 4*N; for each, try to
find a complete set of forms with that same b. If that fails, either
look at another b, or choose a different lift of b from Z/2N to Z
(since larger b's will give more possible forms). I implemented this
in gp ages ago, so I have gp code which does this!
</p>
<p>
Future work: one useful application of Heegner points is to find
rational points on curves of rank 1. I have been doing this
successfully for years, and in 2005 work of Delaunay and Watkins made
it vastly more efficient. That excellent efficient version found its
way into Magma (thanks for Mark) and it would be good to get something
as good in Sage. The idea is to compute all the complex z (mod period
lattice L) for a complete set of forms, then take the trace by adding
those up (as complex numbers) before mapping to the curve, at which
point you only need to recognise the coordinates as rational numbers.
You can use the action of complex conjugation on the forms to halve
the number of evaluations (and in each pair can choose the smallest
a). The Delaunay-Watkins improvement allows to use even smaller a,
and I can explain further if asked!
</p>
<p>
Lastly: I tried 873b1 and D=-11, which works fine, though the point constructed has height 14.785 but the heegner_point_height function returns double that. This might need a different ticket.
</p>
TicketwasSun, 28 Jun 2009 21:43:29 GMT
https://trac.sagemath.org/ticket/6045#comment:17
https://trac.sagemath.org/ticket/6045#comment:17
<blockquote class="citation">
<p>
Lastly: I tried 873b1 and D=-11, which works fine, though the point constructed
has height 14.785 but the heegner_point_height function returns double that.
This might need a different ticket.
</p>
</blockquote>
<p>
Heegner points are naturally defined over K, and the height over K is *double* the height over Q. In general, if P in E(Q) and L is a number field, then <code>[L:Q]*h_Q(P) = h_L(P)</code>
</p>
TicketcremonaSun, 28 Jun 2009 21:50:58 GMT
https://trac.sagemath.org/ticket/6045#comment:18
https://trac.sagemath.org/ticket/6045#comment:18
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/6045#comment:17" title="Comment 17">was</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
Lastly: I tried 873b1 and D=-11, which works fine, though the point constructed
has height 14.785 but the heegner_point_height function returns double that.
This might need a different ticket.
</p>
</blockquote>
<p>
Heegner points are naturally defined over K, and the height over K is *double* the height over Q. In general, if P in E(Q) and L is a number field, then <code>[L:Q]*h_Q(P) = h_L(P)</code>
</p>
</blockquote>
<p>
OK, I stand corrected! I'm just used to computing rational Heegner points (via the trace) so that had not occurred to me.
</p>
TicketrobertwbMon, 29 Jun 2009 16:32:19 GMT
https://trac.sagemath.org/ticket/6045#comment:19
https://trac.sagemath.org/ticket/6045#comment:19
<p>
Thanks for the feedback--I'll take a look at <code>_heegner_forms_list</code>.
</p>
<p>
We're interested in computing Heegner points for rank >= 2 elliptic curves, and of course by the Gross-Zagier theorem their traces down to Q are always torsion. However, I agree it would be useful to have a "trace" option to trace it down (via summation in the lattice) as well.
</p>
TicketrobertwbWed, 01 Jul 2009 08:31:14 GMTattachment set
https://trac.sagemath.org/ticket/6045
https://trac.sagemath.org/ticket/6045
<ul>
<li><strong>attachment</strong>
set to <em>6045-heegner-fixes.patch</em>
</li>
</ul>
TicketrobertwbWed, 01 Jul 2009 08:50:03 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:20
https://trac.sagemath.org/ticket/6045#comment:20
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, with review, needs work] Computation of Heegner points</em> to <em>[with patch, needs review] Computation of Heegner points</em>
</li>
</ul>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/6045#comment:16" title="Comment 16">cremona</a>:
</p>
<blockquote class="citation">
<p>
Modular param: type "and and" in a comment.
</p>
</blockquote>
<p>
Not sure what you meant by this...
</p>
<blockquote class="citation">
<p>
Why do you reverse the order of summation of a_n/n?
</p>
</blockquote>
<p>
Because there's less rounding error by starting with the tail.
</p>
<pre class="wiki">sage: E = EllipticCurve('37a')
sage: tau = E._heegner_best_tau(-7, prec=100)
sage: r1 = sum([an/(m+1)*tau**(m+1) for m, an in enumerate(E.anlist(100))])
sage: r2 = sum(reversed([an/(m+1)*tau**(m+1) for m, an in enumerate(E.anlist(100))]))
sage: tau500 = E._heegner_best_tau(-7, prec=500)
sage: r = sum([an/(m+1)*tau500**(m+1) for m, an in enumerate(E.anlist(100))])
sage: (r1-r)
9.8607613152626475676466070660e-32 - 3.6977854932234928378674776498e-32*I
sage: (r2-r)
2.4651903288156618919116517665e-32*I
</pre><p>
Not that that's really much of a difference...
</p>
<blockquote class="citation">
<p>
Can you sum the series using an iterator for the an instead of forming the whole list?
</p>
</blockquote>
<p>
There's not a way to get the <code>a_n</code> as an iterator rather than a list. FYI, I do plan on optimizing this part a lot more.
</p>
<blockquote class="citation">
<blockquote>
<p>
_heegner_forms_list: (this only depends on N and D so could perhaps be
factored out of the class to a stand-alone function).
</p>
</blockquote>
</blockquote>
<p>
Perhaps, although I couldn't think of a better place to put it (one advantage of having it there is it's defined close to where it's used).
</p>
<blockquote class="citation">
<p>
More seriously, this function is *wrong*!
</p>
</blockquote>
<p>
I was thinking of this as the <code>H_N^D</code> rather than the <code>H_N^D(\beta)</code> from Mark Watkins "Some Remarks on Heegner Point Computations," though I see that it may not have been a complete set.
</p>
<p>
I not make it take the chosen square root as a parameter, and it returns all the forms associated to that square root. I'm actually not using this function right now (as I only want a single surd to recover the Heegner point over the Hilbert Class Field) but it will be valuable when implementing computation of the Heegner point traced down to Q (which we should definitely have n optimized version of in Sage).
</p>
TicketcremonaFri, 03 Jul 2009 11:54:16 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:21
https://trac.sagemath.org/ticket/6045#comment:21
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, needs work (a little)] Computation of Heegner points</em>
</li>
</ul>
<p>
Final review: Sorry about the first one, I meant to say that in the comment now in line 7026 "the the" should be "the".
</p>
<p>
One small thing I found:
</p>
<pre class="wiki">sage: E=EllipticCurve([1,0,0,-1,0])
sage: [E.heegner_point(D) for D in E.heegner_discriminants_list(3)]
...
/home/jec/sage-4.1.alpha3/local/lib/python2.6/site-packages/sage/schemes/elliptic_curves/ell_rational_field.pyc in _heegner_best_tau(self, D, prec)
5353 N = self.conductor()
5354 b = ZZ(Integers(4*N)(D).sqrt(extend=False) % (2*N))
-> 5355 return (-b + D.sqrt(prec=prec)) / (2*N)
5356
5357 def heegner_point(self, D, prec=None, max_prec=2000):
AttributeError: 'int' object has no attribute 'sqrt'
</pre><p>
The function _heegner_best_tau() needs to coerce D into ZZ before calling D.sqrt(). I think some other functions might do well to make D into a ZZ as well.
</p>
<p>
Otherwise I am happy.
</p>
TicketrobertwbSat, 04 Jul 2009 22:15:08 GMTattachment set
https://trac.sagemath.org/ticket/6045
https://trac.sagemath.org/ticket/6045
<ul>
<li><strong>attachment</strong>
set to <em>6045-heegner-more-fixes.patch</em>
</li>
</ul>
TicketrobertwbSat, 04 Jul 2009 22:15:38 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:22
https://trac.sagemath.org/ticket/6045#comment:22
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs work (a little)] Computation of Heegner points</em> to <em>[with patch, needs review] Computation of Heegner points</em>
</li>
</ul>
<p>
Apply all four patches.
</p>
TicketcremonaThu, 09 Jul 2009 11:53:50 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:23
https://trac.sagemath.org/ticket/6045#comment:23
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, with positive review] Computation of Heegner points</em>
</li>
</ul>
<p>
This looks ok now. I applied it to 4.1.alpha3 + patches from <a class="closed ticket" href="https://trac.sagemath.org/ticket/6386" title="enhancement: [with new patch, with positive review] Implement elliptic exponential (closed: fixed)">#6386</a>. Tests pass. Assuming that it's still ok with rc0 this can go in now.
</p>
TicketmvnguWed, 15 Jul 2009 18:42:25 GMTsummary changed; reviewer, author set
https://trac.sagemath.org/ticket/6045#comment:24
https://trac.sagemath.org/ticket/6045#comment:24
<ul>
<li><strong>reviewer</strong>
set to <em>John Cremona</em>
</li>
<li><strong>author</strong>
set to <em>Robert Bradshaw</em>
</li>
<li><strong>summary</strong>
changed from <em>[with patch, with positive review] Computation of Heegner points</em> to <em>[with patch, positive review] Computation of Heegner points</em>
</li>
</ul>
TicketmvnguThu, 16 Jul 2009 10:10:08 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:25
https://trac.sagemath.org/ticket/6045#comment:25
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, positive review] Computation of Heegner points</em> to <em>[with patch, needs work] Computation of Heegner points</em>
</li>
</ul>
<p>
I'm getting numerical noise when running all doctests:
</p>
<pre class="wiki">sage -t -long devel/sage-exp/sage/schemes/elliptic_curves/ell_rational_field.py
/scratch/mvngu/release/sage-4.1.1/local/lib/python/site-packages/sage/misc/misc.py:1901: DeprecationWarning: functions overriding warnings.showwarning() must support the 'line' argument
warn(message, DeprecationWarning, stacklevel=3)
**********************************************************************
File "/scratch/mvngu/release/sage-4.1.1/devel/sage-exp/sage/schemes/elliptic_curves/ell_rational_field.py", line 6989:
sage: phi((sqrt(7)*I - 17)/74, 53)
Expected:
(-3.37746093871080e-16 - 2.21824021705058e-16*I : 3.33066907387547e-16 + 2.21719344273286e-16*I : 1.00000000000000)
Got:
(-3.37704345632016e-16 - 2.21996076934245e-16*I : 3.33066907387547e-16 + 2.22044604925031e-16*I : 1.00000000000000)
**********************************************************************
1 items had failures:
1 of 11 in __main__.example_141
***Test Failed*** 1 failures.
For whitespace errors, see the file /scratch/mvngu/release/sage-4.1.1/tmp/.doctest_ell_rational_field.py
[257.8 s]
<SNIP>
----------------------------------------------------------------------
The following tests failed:
sage -t -long devel/sage-exp/sage/schemes/elliptic_curves/ell_rational_field.py # 1 doctests failed
----------------------------------------------------------------------
Total time for all tests: 504.7 seconds
</pre>
TicketrobertwbMon, 20 Jul 2009 15:16:11 GMTattachment set
https://trac.sagemath.org/ticket/6045
https://trac.sagemath.org/ticket/6045
<ul>
<li><strong>attachment</strong>
set to <em>6045-heegner-doctest-noise.patch</em>
</li>
</ul>
TicketrobertwbMon, 20 Jul 2009 15:16:36 GMTsummary changed
https://trac.sagemath.org/ticket/6045#comment:26
https://trac.sagemath.org/ticket/6045#comment:26
<ul>
<li><strong>summary</strong>
changed from <em>[with patch, needs work] Computation of Heegner points</em> to <em>[with patch, needs review] Computation of Heegner points</em>
</li>
</ul>
<p>
Noise issue fixed.
</p>
TicketmvnguMon, 20 Jul 2009 15:46:44 GMTreviewer, summary changed
https://trac.sagemath.org/ticket/6045#comment:27
https://trac.sagemath.org/ticket/6045#comment:27
<ul>
<li><strong>reviewer</strong>
changed from <em>John Cremona</em> to <em>John Cremona, Minh Van Nguyen</em>
</li>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Computation of Heegner points</em> to <em>[with patch, positive review] Computation of Heegner points</em>
</li>
</ul>
TicketmvnguMon, 20 Jul 2009 15:48:26 GMTstatus changed; resolution, merged set
https://trac.sagemath.org/ticket/6045#comment:28
https://trac.sagemath.org/ticket/6045#comment:28
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>merged</strong>
set to <em>sage-4.1.1.alpha0</em>
</li>
</ul>
TicketmvnguMon, 20 Jul 2009 15:52:58 GMT
https://trac.sagemath.org/ticket/6045#comment:29
https://trac.sagemath.org/ticket/6045#comment:29
<p>
Ticket <a class="closed ticket" href="https://trac.sagemath.org/ticket/4849" title="enhancement: add functionality for computing Heegner points to Sage (closed: duplicate)">#4849</a> has been closed as a duplicate of this ticket.
</p>
Ticket