Ejemplo n.º 1
0
def MWShaInfo(E, HeightBound=None, test_saturation=False, verbose=False):
    r"""
    Interface to Magma's MordellWeilShaInformation function

    INPUT:

    - E : an elliptic curve defined over a number field (including Q)

    OUTPUT:

    a triple [rank_low_up, gens, sha_bound_dict] where

    - rank_bounds is a list of 2 integers [r1,r2] such r1 <= rank(E) <= r2

    - gens is a list of r1 independent points on E

    - sha_bound_dict is a dict with keys positive integers n, values rank bounds for Sha[n].

    EXAMPLE::

        sage: E = EllipticCurve('5077a1')
        sage: MWShaInfo(E)
        [[3, 3], [(2 : -1 : 1), (9/4 : -15/8 : 1), (-1 : 3 : 1)], {2: [0, 0]}]

    """
    K = E.base_field()

    def convert_point(P):
        return E([K(c.sage()) for c in P.Eltseq()])

    if verbose:
        print("calling magma...")
    from sage.all import magma
    if HeightBound is None:
        MWSI = magma(E).MordellWeilShaInformation(nvals=3)
    else:
        MWSI = magma(E).MordellWeilShaInformation(nvals=3,
                                                  HeightBound=HeightBound)
    if verbose:
        print("...done.")
    rank_bounds = MWSI[0].sage()
    gens = [convert_point(P) for P in MWSI[1]]
    sha_bound_dict = dict(MWSI[2].sage())
    if gens and test_saturation:
        if verbose:
            print("testing that Magma's generators are saturated...")
        newgens, index, newreg = E.saturation(gens, verbose)
        if index > 1:
            # Must print this even if not verbose!
            print(
                "Magma's generators for curve %s were not saturated!  index = %s"
                % (E.ainvs(), index))
            gens = newgens
        else:
            if verbose:
                print("... and they are!")
    return [rank_bounds, gens, sha_bound_dict]
Ejemplo n.º 2
0
def MWShaInfo(E, HeightBound=None, test_saturation=False, verbose=False):
    r"""
    Interface to Magma's MordellWeilShaInformation function

    INPUT:

    - E : an elliptic curve defined over a number field (including Q)

    OUTPUT:

    a triple [rank_low_up, gens, sha_bound_dict] where

    - rank_bounds is a list of 2 integers [r1,r2] such r1 <= rank(E) <= r2

    - gens is a list of r1 independent points on E

    - sha_bound_dict is a dict with keys positive integers n, values rank bounds for Sha[n].

    EXAMPLE::

        sage: E = EllipticCurve('5077a1')
        sage: MWShaInfo(E)
        [[3, 3], [(2 : -1 : 1), (9/4 : -15/8 : 1), (-1 : 3 : 1)], {2: [0, 0]}]

    """
    K = E.base_field()

    def convert_point(P):
        return E([K(c.sage()) for c in P.Eltseq()])
    if verbose:
        print("calling magma...")
    from sage.all import magma
    if HeightBound is None:
        MWSI = magma(E).MordellWeilShaInformation(nvals=3)
    else:
        MWSI = magma(E).MordellWeilShaInformation(nvals=3, HeightBound=HeightBound)
    if verbose:
        print("...done.")
    rank_bounds = MWSI[0].sage()
    gens = [convert_point(P) for P in MWSI[1]]
    sha_bound_dict = dict(MWSI[2].sage())
    if gens and test_saturation:
        if verbose:
            print("testing that Magma's generators are saturated...")
        newgens, index, newreg = E.saturation(gens, verbose)
        if index > 1:
            # Must print this even if not verbose!
            print("Magma's generators for curve %s were not saturated!  index = %s" % (E.ainvs(), index))
            gens = newgens
        else:
            if verbose:
                print("... and they are!")
    return [rank_bounds, gens, sha_bound_dict]
Ejemplo n.º 3
0
 def __init__(self, X, prec, bound=0, molin_neurohr=False, periods=""):
     self.X = X
     self.g = magma.Genus(self.X)
     self.F = magma.BaseRing(self.X)
     self.prec = magma(prec)
     self.bound = magma(bound)
     self.molin_neurohr = magma(molin_neurohr)
     self._eqsCC_ = magma.EmbedCurveEquations(self.X, self.prec)
     self._eqsF_ = magma.DefiningEquations(self.X)
     if periods:
         self._P_ = periods
     else:
         self._P_ = self.period_matrix()
     self._calculate_geometric_representation_()
Ejemplo n.º 4
0
 def optimize_representations(self):
     self._calculate_dictionary_()
     for dict_pair in self._dict_['entries']:
         structure = dict_pair['structure']
         rep = magma(
             [gen['tangent'] for gen in structure['representation']])
         optrep = Optimize_Representation(rep)
         for i in range(len(optrep)):
             structure['representation'][i]['tangent'] = optrep[i + 1]
Ejemplo n.º 5
0
 def representations(self):
     self._calculate_dictionary_()
     list_to_fill = []
     for dict_pair in self._dict_['entries']:
         dict_to_fill = dict()
         dict_to_fill['field'] = dict_pair['field']['magma']
         dict_to_fill['representation'] = magma([
             gen['tangent']
             for gen in dict_pair['structure']['representation']
         ])
         list_to_fill.append(dict_to_fill)
     return list_to_fill
Ejemplo n.º 6
0
 def __init__(self, Endo, K="geometric"):
     self.X = Endo.X
     self.g = Endo.g
     self.F = Endo.F
     self._P_ = Endo._P_
     self._geo_rep_list_ = Endo._geo_rep_list_
     if K == "geometric":
         self.field = Endo.endomorphism_field()
     elif K == "base":
         self.field = self.F
     else:
         self.field = magma(K)
     self._list_ = magma.EndomorphismStructure(self._geo_rep_list_,
                                               self.field, self.F)
     self._desc_ = desc_structure(self._list_)
     self._index_dict_ = index_dictionary()
Ejemplo n.º 7
0
def mPlaneCurve(f):
    return magma.PlaneCurve(magma(f))
Ejemplo n.º 8
0
def mHyperellipticCurve(f, h):
    return magma.HyperellipticCurve(magma(f), magma(h))
Ejemplo n.º 9
0
 def representation(self):
     self._calculate_dictionary_()
     return magma([gen['tangent'] for gen in self._dict_['representation']])
Ejemplo n.º 10
0
def mPlaneCurve(f, prec):
    return magma.PlaneCurveExtra(magma(f), magma(prec))
Ejemplo n.º 11
0
def mHyperellipticCurve(f, h, prec):
    return magma.HyperellipticCurveExtra(magma(f), magma(h), magma(prec))