# HG changeset patch
# User Peter Bruin
# Date 1358207832 -3600
# Node ID fa88a46f7c05080254d3a4a447119a43430a56d2
# Parent 585188935e75222c1ea0933bd18d5823f334fb31
#12509: fix two more precision issues
diff --git a/sage/schemes/elliptic_curves/ell_point.py b/sage/schemes/elliptic_curves/ell_point.py
--- a/sage/schemes/elliptic_curves/ell_point.py
+++ b/sage/schemes/elliptic_curves/ell_point.py
@@ -8,10 +8,7 @@
``EllipticCurvePoint_number_field`` and
``EllipticCurvePoint_finite_field`` provide further support for point
on curves defined over number fields (including the rational field
-`\QQ`) and over finite fields. Although there is no special
-class for points over `\QQ`, there is currently greater
-functionality implemented over `\QQ` than over other number
-fields.
+`\QQ`) and over finite fields.
The class ``EllipticCurvePoint``, which is based on
``SchemeMorphism_point_projective_ring``, currently has little extra
@@ -1963,9 +1960,8 @@
A point on an elliptic curve over a number field.
Most of the functionality is derived from the parent class
- ``EllipticCurvePoint_field``. In addition we have support for the
- order of a point, and heights (currently only implemented over
- `\QQ`).
+ ``EllipticCurvePoint_field``. In addition we have support for
+ orders, heights, reduction modulo primes, and elliptic logarithms.
EXAMPLES::
@@ -2661,16 +2657,16 @@
Computes [ K_v : Q_v ]
"""
return 2 - int(v.im_gens()[0] in rings.RR)
- return sum(local_degree(v) * self.archimedian_local_height(v, prec) for v in K.places(prec=prec)) / K.degree()
+ return sum(local_degree(v) * self.archimedian_local_height(v, prec) for v in K.places()) / K.degree()
from sage.rings.number_field.number_field import refine_embedding
- vv = refine_embedding(v) # doubles precision
if prec is None:
- prec = vv.codomain().prec()
+ prec = v.codomain().prec()
+ vv = refine_embedding(v, 2*prec) # prec(vv) = max(2*prec, prec(v))
E = self.curve()
b2, b4, b6, b8 = [vv(b) for b in E.b_invariants()]
H = max(4, abs(b2), 2*abs(b4), 2*abs(b6), abs(b8))
- # The following comes from Silvermn Theorem 4.2. Silverman
+ # The following comes from Silverman Theorem 4.2. Silverman
# uses decimal precision d, so his term (5/3)d =
# (5/3)*(log(2)/log(10))*prec = 0.5017*prec, which we round
# up. The rest of the expression was wrongly transcribed in
@@ -2719,7 +2715,7 @@
t = w/(z-w)
beta = not beta
four_to_n >>= 2
- return rings.RealField(v.codomain().prec())(lam + mu/4)
+ return rings.RealField(prec)(lam + mu/4)
def nonarchimedian_local_height(self, v=None, prec=None, weighted=False, is_minimal=None):
"""