# HG changeset patch
# User tobi@laptop
# Date 1218493730 7200
# Node ID 7031aadeb00417ce4adaeaa8382a454eff142fef
# Parent 7dea9cd05ceab9564683e7b9d624737beed0d050
applies on extra3.patch
fixes missing point problem.
diff r 7dea9cd05cea r 7031aadeb004 sage/schemes/elliptic_curves/ell_rational_field.py
a

b

class EllipticCurve_rational_field(Ellip 
3787  3787  set([2, 3, 4]) 
3788  3788  starting search of remaining points using coefficient bound 6 
3789  3789  xcoords of extra integral points: 
3790   set([2, 3, 4, 37, 8, 342, 11, 14, 816, 52, 21, 406, 93]) 
 3790  set([2, 3, 4, 37, 406, 8, 11, 14, 816, 52, 21, 342, 93]) 
3791  3791  Total number of integral points: 18 
3792  3792  
3793  3793  It is also possible to not specify mw_base, but then the 
… 
… 
class EllipticCurve_rational_field(Ellip 
3899  3899  xP = P[0] 
3900  3900  if xP.is_integral(): 
3901  3901  xs.add(xP) 
3902   
 3902  
3903  3903  def use_t(R): 
3904  3904  """ 
3905  3905  Helper function to record xcoords of a point +torsion if integral. 
… 
… 
class EllipticCurve_rational_field(Ellip 
3919  3919  # rational points if they are approximately integral 
3920  3920  
3921  3921  def is_approx_integral(P): 
3922   return (abs(P[0]P[0].round()))<0.001 and (abs(P[1]P[1].round()))<0.001 
 3922  return (abs(P[0]P[0].round()))<0.1 #one case was 0.09, so 0.001 was too small 
3923  3923  
3924  3924  RR = RealField() #(100) 
3925  3925  ER = self.change_ring(RR) 
… 
… 
class EllipticCurve_rational_field(Ellip 
3927  3927  for i in range(r): 
3928  3928  if abs(Rgens[i][1]mw_base[i][1])>abs((Rgens[i])[1]mw_base[i][1]): 
3929  3929  Rgens[i] = Rgens[i] 
3930   for ni in cartesian_product_iterator([range(N,N+1) for i in range(r1)]+[range(N+1)]): 
 3930  #for ni in cartesian_product_iterator([range(N,N+1) for i in range(r1)]+[range(N+1)]): ##opt1 
 3931  for mi in range(ceil(((2*H_q+1)**r)/2)): ##opt2 
 3932  ni = Z(mi).digits(base=2*H_q+1, padto=r, digits=range(H_q, H_q+1)) ##opt2 
3931  3933  RP=sum([ni[i]*Rgens[i] for i in range(r)],ER(0)) 
3932  3934  for T in tors_points: 
3933  3935  if is_approx_integral(RP+ER(T)): 
… 
… 
class EllipticCurve_rational_field(Ellip 
4094  4096  m = M.identity_matrix() 
4095  4097  for i in range(r): 
4096  4098  m[i, r] = R(c*mw_base_log[i]).round() 
4097   m[r,r] = max(1,R(c*w1).round()) #ensures that m isn't singular 
 4099  m[r,r] = max(Z(1),R(c*w1).round()) #ensures that m isn't singular 
4098  4100  
4099  4101  #LLL  implemented in sage  operates on rows not on columns 
4100  4102  m_LLL = m.LLL() 