Beispiel #1
0
def check_ideal_labels(field_label='2.2.5.1', min_norm=0, max_norm=None, fix=False, verbose=False):
    r""" Go through all curves with the given field label, assumed totally
    real, check whether the ideal label agrees with the level_label of
    the associated Hilbert Modular Form.
    """
    hmfs = conn.hmfs
    forms = hmfs.forms
    fields = hmfs.fields
    query = {}
    query['field_label'] = field_label
    query['conductor_norm'] = {'$gte' : int(min_norm)}
    if max_norm:
        query['conductor_norm']['$lte'] = int(max_norm)
    else:
        max_norm = 'infinity'
    cursor = nfcurves.find(query)
    nfound = 0
    nnotfound = 0
    K = HilbertNumberField(field_label)
    # NB We used to have 20 in the next line but that is insufficient
    # to distinguish the a_p for forms 2.2.12.1-150.1-a and
    # 2.2.12.1-150.1-b !
    primes = [P['ideal'] for P in K.primes_iter(30)]
    remap = {} # remap[old_label] = new_label

    for ec in cursor:
        fix_needed = False
        cond_label = ec['conductor_label']
        if cond_label in remap:
            new_cond_label = remap[cond_label]
            fix_needed=(cond_label!=new_cond_label)
            if not fix_needed:
                if verbose:
                    print("conductor label %s ok" % cond_label)
        else:
            conductor = make_conductor(ec,K)
            level = K.ideal(cond_label)
            new_cond_label = K.ideal_label(conductor)
            remap[cond_label] = new_cond_label
            fix_needed=(cond_label!=new_cond_label)

        if fix_needed:
            print("conductor label for curve %s is wrong, should be %s not %s" % (ec['label'],new_cond_label, cond_label))
            if fix:
                iso = ec['iso_label']
                num = str(ec['number'])
                newlabeldata = {}
                newlabeldata['conductor_label'] = new_cond_label
                newlabeldata['short_class_label'] = '-'.join([new_cond_label,iso])
                newlabeldata['short_label'] = ''.join([newlabeldata['short_class_label'],num])
                newlabeldata['class_label'] = '-'.join([field_label,
                                                        newlabeldata['short_class_label']])
                newlabeldata['label'] = '-'.join([field_label,
                                                  newlabeldata['short_label']])
                nfcurves.update({'_id': ec['_id']}, {"$set": newlabeldata}, upsert=True)
        else:
            if verbose:
                print("conductor label %s ok" % cond_label)

    return dict([(k,remap[k]) for k in remap if not k==remap[k]])
Beispiel #2
0
def check_ideal_labels(field_label='2.2.5.1', min_norm=0, max_norm=None, fix=False, verbose=False):
    r""" Go through all curves with the given field label, assumed totally
    real, check whether the ideal label agrees with the level_label of
    the associated Hilbert Modular Form.
    """
    hmfs = conn.hmfs
    forms = hmfs.forms
    fields = hmfs.fields
    query = {}
    query['field_label'] = field_label
    query['conductor_norm'] = {'$gte': int(min_norm)}
    if max_norm:
        query['conductor_norm']['$lte'] = int(max_norm)
    else:
        max_norm = 'infinity'
    cursor = nfcurves.find(query)
    nfound = 0
    nnotfound = 0
    K = HilbertNumberField(field_label)
    # NB We used to have 20 in the next line but that is insufficient
    # to distinguish the a_p for forms 2.2.12.1-150.1-a and
    # 2.2.12.1-150.1-b !
    primes = [P['ideal'] for P in K.primes_iter(30)]
    remap = {}  # remap[old_label] = new_label

    for ec in cursor:
        fix_needed = False
        cond_label = ec['conductor_label']
        if cond_label in remap:
            new_cond_label = remap[cond_label]
            fix_needed = (cond_label != new_cond_label)
            if not fix_needed:
                if verbose:
                    print("conductor label %s ok" % cond_label)
        else:
            conductor = make_conductor(ec, K)
            level = K.ideal(cond_label)
            new_cond_label = K.ideal_label(conductor)
            remap[cond_label] = new_cond_label
            fix_needed = (cond_label != new_cond_label)

        if fix_needed:
            print("conductor label for curve %s is wrong, should be %s not %s" % (ec['label'], new_cond_label, cond_label))
            if fix:
                iso = ec['iso_label']
                num = str(ec['number'])
                newlabeldata = {}
                newlabeldata['conductor_label'] = new_cond_label
                newlabeldata['short_class_label'] = '-'.join([new_cond_label, iso])
                newlabeldata['short_label'] = ''.join([newlabeldata['short_class_label'], num])
                newlabeldata['class_label'] = '-'.join([field_label,
                                                        newlabeldata['short_class_label']])
                newlabeldata['label'] = '-'.join([field_label,
                                                  newlabeldata['short_label']])
                nfcurves.update({'_id': ec['_id']}, {"$set": newlabeldata}, upsert=True)
        else:
            if verbose:
                print("conductor label %s ok" % cond_label)

    return dict([(k, remap[k]) for k in remap if not k == remap[k]])
Beispiel #3
0
    def create_from_data_string(self, label_or_field, L):
        """Takes an input line L from a raw data file and constructs the
        associated HMF object with given base field.

        String sample:
        <[31, 31, w + 12], "a", [-3, -2, 2, 4, -4, ...]>,
        """
        data = self.dbdata = {}
        if isinstance(label_or_field, str):
            label = label_or_field
            data['field_label'] = label
            F = HilbertNumberField(label)
            if not F:
                raise ValueError("No Hilbert number field with label %s is in the database" % label)
        elif label_or_field == None:
            raise ValueError("Must specify a valid field label")
        else: # we were passed a HilbertNumberField already
            F = label_or_field
            data['field_label'] = F.label
        #print("data['field_label'] = %s" % data['field_label'])

        # The level

        i = L.find('[')
        j = L.find(']')
        data['level_ideal'] = L[i:j+1]
        #print("data['level_ideal'] = %s" % data['level_ideal'])
        N, n, alpha = data['level_ideal'][1:-1].split(',')
        data['level_norm'] = int(N)
        #print("data['level_norm'] = %s" % data['level_norm'])
        level = F.ideal_from_str(data['level_ideal'])[2]
        #print("level = %s" % level)
        data['level_label'] = F.ideal_label(level)
        #print("data['level_label'] = %s" % data['level_label'])

        # The weight

        data['parallel_weight'] = int(2)
        data['weight'] = str([data['parallel_weight']] * F.degree())
        weight = [2] * F.degree()

        # The label

        i = L.find('"')
        j = L.find('"', i+1)
        data['label_suffix'] = L[i+1:j].replace(" ","")

        data['label'] = construct_full_label(data['field_label'],
                                             weight,
                                             data['level_label'],
                                             data['label_suffix'])
        data['short_label'] = '-'.join([data['level_label'], data['label_suffix']])
        #print("data['label'] = %s" % data['label'] )
        #print("data['short_label'] = %s" % data['short_label'] )

        # The hecke polynomial and degree

        if 'x' in L:
            # non-rational
            i = L.find("x")
            j = L.find(i+1,",")
            data['hecke_polynomial'] = pol = L[i:j]
            data['dimension'] = int(1)
            x = polygen(QQ)
            hpol = x.parent()(str(pol))
            data['dimension'] = int(hpol.degree())
        else:
            # rational
            data['hecke_polynomial'] = 'x'
            data['dimension'] = int(1)

        i = L.rfind("[")
        j = L.rfind("]")
        data['hecke_eigenvalues'] = L[i+1:j].replace(" ","").split(",")
        data['hecke_eigenvalues'] = [unicode(s) for s in data['hecke_eigenvalues']]
        #print("hecke_eigenvalues = %s..." % data['hecke_eigenvalues'][:20])

        # Find (some of the) AL-eigenvalues

        BP = level.prime_factors()
        BP_indices = [F.prime_index(P) for P in BP]
        print("BP_indices = %s" % BP_indices)
        BP_exponents = [level.valuation(P) for P in BP]
        #print("BP_exponents = %s" % BP_exponents)
        AL_eigs = [int(data['hecke_eigenvalues'][k]) for k in BP_indices]
        #print("AL_eigs      = %s" % AL_eigs)
        if not all([(e==1 and eig in [-1,1]) or (eig==0)
                    for e,eig in zip(BP_exponents,AL_eigs)]):
            print("Some bad AL-eigenvalues found")
        # NB the following will put 0 for the eigenvalue for primes
        # whose quare divides the level; this will need fixing later.
        data['AL_eigenvalues'] = [[F.primes[k],data['hecke_eigenvalues'][k]] for k in BP_indices]

        data['is_CM'] = '?'
        data['is_base_change'] = '?'