Attachment 'egr.sage'

Download

   1 load '/home/jim/Desktop/intpts.sage' #Please insert the appropriate directory
   2 
   3 def ideal_sqrt(u,S = []):
   4     u_fact = u.prime_to_S_part(S).factor()
   5     if all([r[1]%2 == 0 for r in u_fact]):
   6         u_sqrt = [r[0]^(r[1]/2) for r in u_fact]
   7         return prod(u_sqrt)
   8     raise ValueError, str(u)+" is not an S-square"
   9 
  10 def K2_4(self):
  11    result = dict()
  12    for u in self.selmer_group([],2):
  13        C = self.class_group()
  14        C4 = [g for g in C if g.order() == 4]+[C(1)]
  15        for g in C4:
  16            if (not C(ideal_sqrt(self.ideal(u))) in result.keys()) and C(ideal_sqrt(self.ideal(u))) == g^2:
  17                result[u] = (C(ideal_sqrt(self.ideal(u)))/g^2).ideal().gen(0)
  18    return result
  19 
  20 def full_square_dict(D):
  21     Dnew = dict(D)
  22     result = dict()
  23     for k in Dnew.keys():
  24         result[k] = Dnew[k]
  25         del Dnew[k]
  26         for l in Dnew.keys():
  27             result[k*l] = result[k]*Dnew[l]
  28     return result
  29 
  30 def whole_group(gens, exponents):
  31    g = gens[0]; gens = gens[1:]
  32    e = exponents[0]; exponents = exponents[1:]
  33    res = g
  34    for k in range(e):
  35        if gens:
  36            for gg in whole_group(gens, exponents):
  37                yield res * gg
  38        else:
  39            yield res
  40        res *= g
  41 
  42 def egr(self):
  43     r"""
  44     Returns the Elliptic curves with j not equal to 0 or 1728 over self with everywhere good reduction, assuming Denis Simon's program simon_two_descent() returns a complete set of generators. The algorithm is one designed in Cremona and Lingham's paper 'Finding all elliptic curves with good reduction outside a given set of primes.'
  45     """
  46     sel24 = full_square_dict(K2_4(self))
  47     sel3 = whole_group(self.selmer_group(tuple([]),3),[3 for r in self.selmer_group(tuple([]),3)])
  48     sel2 = whole_group(self.selmer_group(tuple([]),2),[2 for r in self.selmer_group(tuple([]),2)])
  49     sel6_12 = {}
  50     primesabove = K.primes_above(6)
  51     ellist = []
  52     for a in sel24.keys():
  53         for b in sel3:
  54             sel6_12[(a^3)*(b^(-2))] = [sel24[a],b]
  55     for w in sel6_12.keys():
  56         Ew = EllipticCurve([0,1728*w])
  57         plist , clist = IntegralPointsMain(Ew,Ew.simon_two_descent()[2])
  58         for R in plist:
  59             j = R[0]^3/w
  60             if j != 0 and j != 1728 and j.is_integral():
  61                 E = EllipticCurve([-(R[0]/3)*sel6_12[w][0]^2 , (-2/27)*R[1]*sel6_12[w][0]^3])
  62                 for u in sel2:
  63                     if all([E.quadratic_twist(u).has_good_reduction(p) for p in primesabove]):
  64                         ellist += [E.quadratic_twist(u)]
  65     return ellist

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-07-01 20:57:23, 2.5 KB) [[attachment:egr.sage]]
  • [get | view] (2010-07-01 20:58:04, 17.4 KB) [[attachment:intpts.sage]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.