# HG changeset patch
# User Peter Bruin <peter.bruin@math.uzh.ch>
# 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

b


8  8  ``EllipticCurvePoint_number_field`` and 
9  9  ``EllipticCurvePoint_finite_field`` provide further support for point 
10  10  on curves defined over number fields (including the rational field 
11   `\QQ`) and over finite fields. Although there is no special 
12   class for points over `\QQ`, there is currently greater 
13   functionality implemented over `\QQ` than over other number 
14   fields. 
 11  `\QQ`) and over finite fields. 
15  12  
16  13  The class ``EllipticCurvePoint``, which is based on 
17  14  ``SchemeMorphism_point_projective_ring``, currently has little extra 
… 
… 

1963  1960  A point on an elliptic curve over a number field. 
1964  1961  
1965  1962  Most of the functionality is derived from the parent class 
1966   ``EllipticCurvePoint_field``. In addition we have support for the 
1967   order of a point, and heights (currently only implemented over 
1968   `\QQ`). 
 1963  ``EllipticCurvePoint_field``. In addition we have support for 
 1964  orders, heights, reduction modulo primes, and elliptic logarithms. 
1969  1965  
1970  1966  EXAMPLES:: 
1971  1967  
… 
… 

2661  2657  Computes [ K_v : Q_v ] 
2662  2658  """ 
2663  2659  return 2  int(v.im_gens()[0] in rings.RR) 
2664   return sum(local_degree(v) * self.archimedian_local_height(v, prec) for v in K.places(prec=prec)) / K.degree() 
 2660  return sum(local_degree(v) * self.archimedian_local_height(v, prec) for v in K.places()) / K.degree() 
2665  2661  
2666  2662  from sage.rings.number_field.number_field import refine_embedding 
2667   vv = refine_embedding(v) # doubles precision 
2668  2663  if prec is None: 
2669   prec = vv.codomain().prec() 
 2664  prec = v.codomain().prec() 
 2665  vv = refine_embedding(v, 2*prec) # prec(vv) = max(2*prec, prec(v)) 
2670  2666  E = self.curve() 
2671  2667  b2, b4, b6, b8 = [vv(b) for b in E.b_invariants()] 
2672  2668  H = max(4, abs(b2), 2*abs(b4), 2*abs(b6), abs(b8)) 
2673   # The following comes from Silvermn Theorem 4.2. Silverman 
 2669  # The following comes from Silverman Theorem 4.2. Silverman 
2674  2670  # uses decimal precision d, so his term (5/3)d = 
2675  2671  # (5/3)*(log(2)/log(10))*prec = 0.5017*prec, which we round 
2676  2672  # up. The rest of the expression was wrongly transcribed in 
… 
… 

2719  2715  t = w/(zw) 
2720  2716  beta = not beta 
2721  2717  four_to_n >>= 2 
2722   return rings.RealField(v.codomain().prec())(lam + mu/4) 
 2718  return rings.RealField(prec)(lam + mu/4) 
2723  2719  
2724  2720  def nonarchimedian_local_height(self, v=None, prec=None, weighted=False, is_minimal=None): 
2725  2721  """ 