Example #1
0
def egros_from_1728_over_K(K, S):
    r"""

    INPUT:
        - ``K`` : a number field
        - ``S`` : a list of primes of ``K``

    OUTPUT:

        A list with all elliptic curves over ``K`` with good reduction outside ``S`` and `j`-invariant equal to 1728.

    REFERENCE:
        J. E. Cremona and M. P. Lingham. Finding All Elliptic Curves with Good Reduction Outside a Given Set of Primes.
        Experimental Mathematics, 16(3):303-312, 2007.

    EXAMPLE::

        sage:

    """
    if K == QQ:
        from sage.schemes.elliptic_curves.ell_egros import egros_from_j_1728
        return egros_from_j_1728(S)

    Sprime = copy(S)

    #we add suitable primes above 2
    for p in K.primes_above(2):
        if (K(2)).valuation(p) % 2 == 1 and p not in Sprime:
            Sprime.append(p)

    SprimenotS = [p for p in Sprime if p not in S]

    selmergens, orders = K.selmer_group(Sprime, 4, orders=True)

    curves = []

    if len(SprimenotS) == 0:
        for v in cartesian_product_iterator([xrange(b) for b in orders]):
            w = prod([g**i for g, i in zip(selmergens, v)])
            E = EllipticCurve([w, 0])
            if has_good_reduction_outside_S_over_K(E, S):
                curves.append(E)
        return curves

    for v in cartesian_product_iterator([xrange(b) for b in orders]):
        w = prod([g**i for g, i in zip(selmergens, v)])
        if len([1 for p in SprimenotS
                if w.valuation(p) % 4 == 2]) == len(SprimenotS):
            E = EllipticCurve([w, 0])
            if has_good_reduction_outside_S_over_K(E, S):
                curves.append(E)
    return curves
def egros_from_1728_over_K(K,S):
    r"""

    INPUT:
        - ``K`` : a number field
        - ``S`` : a list of primes of ``K``

    OUTPUT:

        A list with all elliptic curves over ``K`` with good reduction outside ``S`` and `j`-invariant equal to 1728.

    REFERENCE:
        J. E. Cremona and M. P. Lingham. Finding All Elliptic Curves with Good Reduction Outside a Given Set of Primes.
        Experimental Mathematics, 16(3):303-312, 2007.

    EXAMPLE::

        sage:

    """
    if K == QQ:
        from sage.schemes.elliptic_curves.ell_egros import egros_from_j_1728
        return egros_from_j_1728(S)

    Sprime = copy(S)

    #we add suitable primes above 2
    for p in K.primes_above(2):
        if (K(2)).valuation(p)%2 == 1 and p not in Sprime:
            Sprime.append(p)

    SprimenotS = [p for p in Sprime if p not in S]

    selmergens,orders = K.selmer_group(Sprime,4,orders=True)

    curves = []

    if len(SprimenotS) == 0:
        for v in cartesian_product_iterator([xrange(b) for b in orders]):
            w = prod([g**i for g,i in zip(selmergens,v)])
            E = EllipticCurve([w,0])
            if has_good_reduction_outside_S_over_K(E,S):
                curves.append(E)
        return curves


    for v in cartesian_product_iterator([xrange(b) for b in orders]):
        w = prod([g**i for g,i in zip(selmergens,v)])
        if len([1 for p in SprimenotS if w.valuation(p)%4 == 2]) == len(SprimenotS):
            E = EllipticCurve([w,0])
            if has_good_reduction_outside_S_over_K(E,S):
                curves.append(E)
    return curves
def testegros(SQ):

    from sage.schemes.elliptic_curves.ell_egros import egros_from_j_1728

    SK = K.primes_above(prod(SQ))
    # print 'SK',SK
    curvesK = [E.change_ring(QQ).minimal_model() for E in egros_from_1728_over_K(K, SK)]
    curvesQ = [E for E in egros_from_j_1728(SQ)]

    print "number over K", len(curvesK)
    print "number over Q", len(curvesQ)

    # return curvesK,curvesQ
    if len(curvesK) != len(curvesQ):
        raise ValueError("They have found different number of curves")
    for E in curvesK:
        if E not in curvesQ:
            print "I find this not in both", E

    return curvesK, curvesQ
Example #4
0
def testegros(SQ):

    from sage.schemes.elliptic_curves.ell_egros import egros_from_j_1728
    SK = K.primes_above(prod(SQ))
    # print 'SK',SK
    curvesK = [
        E.change_ring(QQ).minimal_model()
        for E in egros_from_1728_over_K(K, SK)
    ]
    curvesQ = [E for E in egros_from_j_1728(SQ)]

    print 'number over K', len(curvesK)
    print 'number over Q', len(curvesQ)

    # return curvesK,curvesQ
    if len(curvesK) != len(curvesQ):
        raise ValueError('They have found different number of curves')
    for E in curvesK:
        if E not in curvesQ:
            print 'I find this not in both', E

    return curvesK, curvesQ