Ticket #12356: trac_12356-cm.patch

File trac_12356-cm.patch, 6.9 KB (added by cremona, 10 years ago)

Applies to 4.8

  • sage/schemes/elliptic_curves/cm.py

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1327494911 0
    # Node ID 7875da2fab033b139c1e7841e55731ab09bdfa87
    # Parent  6271462f5c80e090cd2b87fe3c509f6d1859c6fc
    #12356: correct list of class number two imaginary quadratic orders
    
    diff --git a/sage/schemes/elliptic_curves/cm.py b/sage/schemes/elliptic_curves/cm.py
    a b  
    175175    Over real quadratic fields there may be more::
    176176   
    177177        sage: cm_j_invariants(QuadraticField(5, 'a')) 
    178         [0, 54000, -12288000, 1728, 287496, -3375, 16581375, 8000, -32768, -884736, -884736000, -147197952000, -262537412640768000, 282880*a + 632000, -282880*a + 632000, 95178240*a + 212846400, -95178240*a + 212846400, 85995/2*a - 191025/2, -85995/2*a - 191025/2, 16554983445/2*a + 37018076625/2, -16554983445/2*a + 37018076625/2, 26378240*a - 58982400, -26378240*a - 58982400, 95673435586560*a - 213932305612800, -95673435586560*a - 213932305612800, 184068066743177379840*a - 411588709724712960000, -184068066743177379840*a - 411588709724712960000]
     178        [0, 54000, -12288000, 1728, 287496, -3375, 16581375, 8000, -32768, -884736, -884736000, -147197952000, -262537412640768000, 85995/2*a - 191025/2, -85995/2*a - 191025/2, 282880*a + 632000, -282880*a + 632000, 26378240*a - 58982400, -26378240*a - 58982400, 95178240*a + 212846400, -95178240*a + 212846400, 95673435586560*a - 213932305612800, -95673435586560*a - 213932305612800, 184068066743177379840*a - 411588709724712960000, -184068066743177379840*a - 411588709724712960000, 16554983445/2*a + 37018076625/2, -16554983445/2*a + 37018076625/2, 146329141248*a - 327201914880, -146329141248*a - 327201914880, 9845745509376*a + 22015749613248, -9845745509376*a + 22015749613248]
    179179
    180180    Over fields of higher degree this is not yet implemented::
    181181   
     
    222222    Over real quadratic fields there may be more::
    223223       
    224224        sage: cm_j_invariants_and_orders(QuadraticField(5,'a'))
    225         [(-3, 1, 0), (-3, 2, 54000), (-3, 3, -12288000), (-4, 1, 1728), (-4, 2, 287496), (-7, 1, -3375), (-7, 2, 16581375), (-8, 1, 8000), (-11, 1, -32768), (-19, 1, -884736), (-43, 1, -884736000), (-67, 1, -147197952000), (-163, 1, -262537412640768000), (-20, 1, 282880*a + 632000), (-20, 1, -282880*a + 632000), (-40, 1, 95178240*a + 212846400), (-40, 1, -95178240*a + 212846400), (-15, 1, 85995/2*a - 191025/2), (-15, 1, -85995/2*a - 191025/2), (-15, 2, 16554983445/2*a + 37018076625/2), (-15, 2, -16554983445/2*a + 37018076625/2), (-35, 1, 26378240*a - 58982400), (-35, 1, -26378240*a - 58982400), (-115, 1, 95673435586560*a - 213932305612800), (-115, 1, -95673435586560*a - 213932305612800), (-235, 1, 184068066743177379840*a - 411588709724712960000), (-235, 1, -184068066743177379840*a - 411588709724712960000)]
     225        [(-3, 1, 0), (-3, 2, 54000), (-3, 3, -12288000), (-4, 1, 1728), (-4, 2, 287496), (-7, 1, -3375), (-7, 2, 16581375), (-8, 1, 8000), (-11, 1, -32768), (-19, 1, -884736), (-43, 1, -884736000), (-67, 1, -147197952000), (-163, 1, -262537412640768000), (-15, 1, 85995/2*a - 191025/2), (-15, 1, -85995/2*a - 191025/2), (-20, 1, 282880*a + 632000), (-20, 1, -282880*a + 632000), (-35, 1, 26378240*a - 58982400), (-35, 1, -26378240*a - 58982400), (-40, 1, 95178240*a + 212846400), (-40, 1, -95178240*a + 212846400), (-115, 1, 95673435586560*a - 213932305612800), (-115, 1, -95673435586560*a - 213932305612800), (-235, 1, 184068066743177379840*a - 411588709724712960000), (-235, 1, -184068066743177379840*a - 411588709724712960000), (-15, 2, 16554983445/2*a + 37018076625/2), (-15, 2, -16554983445/2*a + 37018076625/2), (-3, 5, 146329141248*a - 327201914880), (-3, 5, -146329141248*a - 327201914880), (-4, 5, 9845745509376*a + 22015749613248), (-4, 5, -9845745509376*a + 22015749613248)]
    226226
    227227        sage: [(D,f) for D,f,j in cm_j_invariants_and_orders(QuadraticField(5,'a')) if j not in QQ]
    228         [(-20, 1), (-20, 1), (-40, 1), (-40, 1), (-15, 1), (-15, 1), (-15, 2), (-15, 2), (-35, 1), (-35, 1), (-115, 1), (-115, 1), (-235, 1), (-235, 1)]
     228        [(-15, 1), (-15, 1), (-20, 1), (-20, 1), (-35, 1), (-35, 1), (-40, 1), (-40, 1), (-115, 1), (-115, 1), (-235, 1), (-235, 1), (-15, 2), (-15, 2), (-3, 5), (-3, 5), (-4, 5), (-4, 5)]
    229229
    230230    Over fields of higher degree this is not yet implemented::
    231231   
     
    248248        return T
    249249
    250250    if K.degree()==2:
    251         # Below we use that the imaginary quadratic orders of class number 2 are the
    252         # maximal orders in Q(sqrt(-d)) for d in
     251        # Below we use that the imaginary quadratic orders of class
     252        # number 2 are the maximal orders in Q(sqrt(-d)) for d in
    253253        # [-5,-6,-10,-13,-15,-22,-35,-37,-51,-58,-91,-115,-123,-187,-235,-267,-403,-427]
    254         # and the order of index 2 in Q(sqrt(-15)). [Reference: many
    255         # places including J E Cremona, Abelian Varieties with Extra
    256         # Twist, Cusp Forms, and Elliptic Curves Over Imaginary
    257         # Quadratic Fields, Journal of the London Mathematical Society
    258         # 45 (1992) 402-416.]     
     254        # and 11 non-maximal orders. [Reference:
     255        # http://oeis.org/A014603 (A. Sutherland); note that in J E
     256        # Cremona, Abelian Varieties with Extra Twist, Cusp Forms, and
     257        # Elliptic Curves Over Imaginary Quadratic Fields, Journal of
     258        # the London Mathematical Society 45 (1992) 402-416, the
     259        # discriminant -72 is omitted in error.]
    259260
    260261        def data_for_discriminant(d):
    261             D = d if d%4 == 1 else 4*d
    262             for j in hilbert_class_polynomial(D).roots(K,multiplicities=False):
    263                 yield (Integer(D), Integer(1), j)
    264             # the only non-maximal order of class number 2 is for d == -15
    265             if d == -15:
    266                 for j in hilbert_class_polynomial(-60).roots(K,multiplicities=False):
    267                     yield (Integer(-15), Integer(2), j)
     262            D = d[0]; f = d[1]
     263            for j in hilbert_class_polynomial(D*f*f).roots(K,multiplicities=False):
     264                yield (Integer(D), Integer(f), j)
    268265
    269         # list the discriminants of class number 2:
    270         dlist = [-5,-6,-10,-13,-15,-22,-35,-37,-51,-58,-91,-115,-123,-187,-235,-267,-403,-427]
     266        # list the discriminants of class number 2: each pair (d,f)
     267        # represents the discriminant D=d*f^2 where d is a fundamental
     268        # discriminant and f>=1:
     269        dlist1 = [(d,1) for d in [-15,-20,-24,-35,-40,-51,-52,-88,-91,-115,-123,-148,-187,-232,-235,-267,-403,-427]]
     270        # assert len(dlist1)==18
     271        dlist2 = [(d,2) for d in [-8,-15]]
     272        dlist3 = [(d,3) for d in [-4,-8,-11]]
     273        dlist4 = [(d,4) for d in [-3,-4,-7]]
     274        dlist5 = [(d,5) for d in [-3,-4]]
     275        dlist7 = [(d,7) for d in [-3]]
     276        dlist = dlist1+dlist2+dlist3+dlist4+dlist5+dlist7
     277        # assert len(dlist)==29
    271278        return sum((list(data_for_discriminant(d)) for d in dlist), cm_j_invariants_and_orders(QQ))
    272279
    273280    raise NotImplementedError, "Enumeration of CM j-invariants over fields of degree %s not yet implemented"%K.degree()