# HG changeset patch
# User Chris Wuthrich <christian.wuthrich@gmail.com>
# Date 1248212024 3600
# Node ID 4a4636b71907f37f27dc75c67032453551a5e02f
# Parent 92883ef75c3cbc86e49ec584b0975972a76969a4
trac 6455 : bug when twisting in an_padic
diff r 92883ef75c3c r 4a4636b71907 sage/schemes/elliptic_curves/sha_tate.py
a

b


35  35  Integer, 
36  36  RealField, 
37  37  RationalField, 
38   RIF) 
 38  RIF, 
 39  ZZ) 
39  40  from sage.misc.functional import log 
40  41  from math import sqrt 
41  42  from sage.misc.all import verbose 
42  43  import sage.rings.arith as arith 
43  44  
44  45  factor = arith.factor 
 46  valuation = arith.valuation 
45  47  Q = RationalField() 
46  48  
47  49  class Sha(SageObject): 
… 
… 

372  374  4 + O(5) 
373  375  sage: EllipticCurve('448c5').sha().an_padic(7,prec=4) # long time 
374  376  2 + 7 + O(7^3) 
 377  sage: E = EllipticCurve([19,34]) # trac 6455 
 378  sage: E.sha().an_padic(5) 
 379  1 + O(5) 
375  380  
376  381  """ 
377  382  try: 
… 
… 

391  396  # todo : here we should catch the rank computation 
392  397  r = self.E.rank() 
393  398  
394   if use_twists : 
 399  if use_twists and p > 2: 
395  400  Et, D = self.E.minimal_quadratic_twist() 
396   # We cannot use a nontrivial twist of the same conductor! 
397   # e.g. the minimal quadratic twist of '300b2' is '300a2' 
398   # (since that comes earlier in the database) 
399   if Et.conductor() == self.E.conductor(): 
400   Et = self.E 
401   D = 1 
 401  # trac 6455 : we have to assure that the twist back is allowed 
 402  D = ZZ(D) 
 403  if D % p == 0: 
 404  D = D/p 
 405  for ell in D.prime_divisors(): 
 406  if ell % 2 == 1: 
 407  if Et.conductor() % ell**2 == 0: 
 408  D = D/ell 
 409  ve = valuation(D,2) 
 410  de = (D/2**ve).abs() 
 411  if de % 4 == 3: 
 412  de = de 
 413  Et = self.E.quadratic_twist(de) 
 414  # now check individually if we can twist by 1 or 2 or 2 
 415  Nmin = Et.conductor() 
 416  Dmax = de 
 417  for DD in [4*de,8*de,8*de]: 
 418  Et = self.E.quadratic_twist(DD) 
 419  if Et.conductor() < Nmin and valuation(Et.conductor(),2) <= valuation(DD,2): 
 420  Nmin = Et.conductor() 
 421  Dmax = DD 
 422  D = Dmax 
 423  Et = self.E.quadratic_twist(D) 
402  424  lp = Et.padic_lseries(p) 
403  425  else : 
404  426  lp = self.E.padic_lseries(p) 
… 
… 

556  578  Traceback (most recent call last): 
557  579  ... 
558  580  ValueError: The modp Galois representation is not surjective. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound. 
 581  sage: e.sha().an_padic(7) # long time 
 582  7^2 + O(7^3) 
559  583  
560  584  sage: e = EllipticCurve('11a3') 
561  585  sage: e.sha().p_primary_bound(5) 
562  586  Traceback (most recent call last): 
563  587  ... 
564  588  ValueError: The modp Galois representation is not surjective. Current knowledge about Euler systems does not provide an upper bound in this case. Try an_padic for a conjectural bound. 
 589  sage: e.sha().an_padic(5) 
 590  1 + O(5^2) 
565  591  
566  592  """ 
567  593  