Ticket #9287: trac_9287.coverage_for_elliptic_curves_part2.patch

File trac_9287.coverage_for_elliptic_curves_part2.patch, 11.4 KB (added by wuthrich, 12 years ago)

also exported against 4.4.4.alpha0

• sage/schemes/elliptic_curves/ell_modular_symbols.py

# HG changeset patch
# User Chris Wuthrich <christian.wuthrich@gmail.com>
# Date 1277228716 -3600
# Node ID bb2469df969a7b4d23b9dda574776fd41f4d58fe
# Parent  c6dd5166f5dce35f2ec7f819051f75d2812807f8
trac 9287: doctest coverage for elliptic curves, part II

diff -r c6dd5166f5dc -r bb2469df969a sage/schemes/elliptic_curves/ell_modular_symbols.py
 a # -*- coding: utf-8 -*- r""" Modular symbols at0 = self(0) # print 'modular symbol evaluates to ',at0,' at 0' if at0 != 0 : l1 = self.__lalg(1) l1 = self.__lalg__(1) if at0 != l1: verbose('scale modular symbols by %s'%(l1/at0)) self._scaling = l1/at0 msn = ModularSymbolSage(self._E,sign = -1,normalize = "L_ratio") sc = msn._scaling if sc == 0 or self._use_eclib : # self.__scale_by_periods_only() self.__scale_by_periods_only__() else : self._scaling = sc else : l1 = self.__lalg(D) l1 = self.__lalg__(D) if at0 != l1: verbose('scale modular symbols by %s'%(l1/at0)) self._scaling = l1/at0 j += 1 if j == 9 and at0 == 0: # no more hope for a normalization # we do at least a scaling with the quotient of the periods self.__scale_by_periods_only() self.__scale_by_periods_only__() else : l1 = self.__lalg(D) l1 = self.__lalg__(D) if at0 != l1: verbose('scale modular symbols by %s'%(l1/at0)) self._scaling = l1/at0 def __lalg(self,D): def __lalg__(self,D): r""" For positive D, this function evaluates the quotient L(E_D,1)\cdot \sqrt(D)/\Omega_E where E_D is the twist of L(E_D,1)\cdot \sqrt(-D)/\Omega^{-}_E where \Omega^{-}_E is the least positive imaginary part of a non-real period of E. EXMAPLES:: sage: E = EllipticCurve('11a1') sage: m = E.modular_symbol(sign=+1) sage: m.__lalg__(1) 1/5 sage: m.__lalg__(3) 5/2 """ from sage.functions.all import sqrt # the computation of the L-value could take a lot of time, verbose('real approximation is %s'%q) return lv/8 * QQ(int(round(q))) def __scale_by_periods_only(self): def __scale_by_periods_only__(self): r""" If we fail to scale with _find_scaling_L_ratio, we drop here to try and find the scaling by the quotient of the periods to the X_0-optimal curve. The resulting _scaling is not guaranteed to be correct, but could well be. EXAMPLES:: sage: E = EllipticCurve('11a1') sage: m = E.modular_symbol(sign=+1) sage: m.__scale_by_periods_only__() Warning : Could not normalize the modular symbols, maybe all further results will be multiplied by -1, 2 or -2. sage: m._scaling 1 sage: E = EllipticCurve('11a3') sage: m = E.modular_symbol(sign=+1, use_eclib=True) sage: m.__scale_by_periods_only__() Warning : Could not normalize the modular symbols, maybe all further results will be multiplied by -1, 2 or -2. sage: m._scaling 1/5 """ # we only do this inside the cremona-tables. try :
• sage/schemes/elliptic_curves/ell_torsion.py

diff -r c6dd5166f5dc -r bb2469df969a sage/schemes/elliptic_curves/ell_torsion.py
 a # -*- coding: utf-8 -*- r""" Torsion subgroups of elliptic curves over number fields (including \QQ). Torsion Subgroup isomorphic to Multiplicative Abelian Group isomorphic to C5 associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in i with defining polynomial x^2 + 1 sage: type(T) sage: T == loads(dumps(T)) True """ self.__E = E self.__K = E.base_field() """ return "Torsion Subgroup isomorphic to %s associated to the %s" % (groups.AbelianGroup_class._repr_(self), self.__E) def __cmp__(self,other): r""" Compares two torsion groups by simply comparing the elliptic curves. EXAMPLES:: sage: E = EllipticCurve('37a1') sage: tor  = E.torsion_subgroup() sage: tor == tor True """ c = cmp(type(self), type(other)) if c: return c return cmp(self.__E, other.__E) def gen(self, i=0): """ Return the i'th torsion generator.
• sage/schemes/elliptic_curves/sha_tate.py

diff -r c6dd5166f5dc -r bb2469df969a sage/schemes/elliptic_curves/sha_tate.py
 a If E is an elliptic curve over a global field K, the Shafarevich-Tate group is the subgroup of elements in H^1(K,E) which map to zero under every global-to-local restriction map H^1(K,E) \to H^1(K_v,E), one for each place v of K. It is known to be a torsion group and the m-torsion is finite for all m>1. It is conjectured to be finite. of K. The group is usually denoted by the Russian letter Sha. Sha is known to be an abelian torsion group. It is conjectured that the Tate-Shafarevich group is finite for any elliptic curve over a global field. But it is not known in general. A theorem of Kolyvagin and Gross-Zagier using Heegner points shows that if the L-series of an elliptic curve E/\mathbb{Q} does not vanish at 1 or has a simple zero there, then Sha is finite. A theorem of Kato, together with theorems from Iwasawa theory, allow for certain primes p to show that the p-primary part of Sha is finite and gives an effective upper bound for it. The (p-adic) conjecture of Birch and Swinnerton-Dyer predicts the order of Sha from the leading term of the (p-adic) L-series of the elliptic curve. Sage can compute a few things about Sha. The commands an, an_numerical and an_padic compute the conjectural order of Sha as a real or p-adic number. With p_primary_bound one can find an upper bound of the size of the p-primary part of Sha. Finally, if the analytic rank is at most 1, then bound_kato and bound_kolyvagin find all primes for which we the theorems of Kato and Kolyvagin respectively do not prove the triviality the p-primary part of Sha. EXAMPLES:: sage: E = EllipticCurve('11a1') sage: S = E.sha() sage: S.bound_kato() [2, 3, 5] sage: S.bound_kolyvagin() ([2, 5], 1) sage: S.an_padic(7,3)  #long 1 + O(7^5) sage: S.an() 1 sage: S.an_numerical() 1.00000000000000 sage: E = EllipticCurve('389a') sage: S = E.sha(); S Shafarevich-Tate group for the Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field sage: S.an_numerical() 1.00000000000000 sage: S.p_primary_bound(5) #long 0 sage: S.an_padic(5)  #long 1 + O(5) sage: S.an_padic(5,prec=4) #long 1 + O(5^3) AUTHORS: If E is an elliptic curve over a global field K, the Shafarevich-Tate group is the subgroup of elements in H^1(K,E) which map to zero under every global-to-local restriction map H^1(K,E) \to H^1(K_v,E), one for each place v of K. of K. EXAMPLES:: sage: E = EllipticCurve('571a1') sage: S = E.sha() sage: S.bound_kato() [2, 3] sage: S.bound_kolyvagin() ([2], 1) sage: S.an_padic(7,3)  #long 4 + O(7^5) sage: S.an() 4 sage: S.an_numerical() 4.00000000000000 sage: E = EllipticCurve('389a') sage: E.sha() sage: S = E.sha(); S Shafarevich-Tate group for the Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field sage: S.an_numerical() 1.00000000000000 sage: S.p_primary_bound(5) #long 0 sage: S.an_padic(5)  #long 1 + O(5) sage: S.an_padic(5,prec=4) #long 1 + O(5^3) """ def __init__(self, E): r""" The Shafarevich-Tate group associated to an elliptic curve. INPUT: a elliptic curve over \mathbb{Q} EXAMPLES:: sage: E = EllipticCurve('11a1') sage: S = E.sha() sage: S Shafarevich-Tate group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field sage: S == loads(dumps(S)) True """ self.E = E def __cmp__(self,other): r""" Compares two Tate-Shafarevich groups by simply comparing the elliptic curves. EXAMPLES:: sage: E = EllipticCurve('37a1') sage: S = E.sha() sage: S == S True """ c = cmp(type(self), type(other)) if c: return c return cmp(self.E, other.E) def __repr__(self): r""" String representation of the Tats-Shafarevich group. EXAMPLES:: sage: E = EllipticCurve('11a1') sage: S = E.sha() sage: S.__repr__() 'Shafarevich-Tate group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field' """ return "Shafarevich-Tate group for the " + repr(self.E) ######################################################################## RuntimeError: Unable to compute the rank, hence generators, with certainty (lower bound=0, generators found=[]).  This could be because Sha(E/Q)[2] is nontrivial. Try increasing descent_second_limit then trying this command again. You can increase the descent_second_limit (in the above example, You can increase the descent_second_limit (in the above example, set to the default, 12) option to try again:: sage: E.sha().an(descent_second_limit=16) This returns the 2-rank, i.e. the \mathbb{F}_2-dimension of the 2-torsion part of Sha, provided we can determine the rank of E. EXAMPLE:: EXAMPLES:: sage: sh = EllipticCurve('571a1').sha() sage: sh.two_selmer_bound()