コード例 #1
0
 def _fc__unramfactor(self, content, det_4):
     chi = kronecker_character(-det_4)
     pfacs = prime_factors(det_4)
     fd = fundamental_discriminant(-det_4)
     l = [(p, valuation(content, p),
           (valuation(det_4, p) - valuation(fd, p)) / 2) for p in pfacs]
     return reduce(operator.mul,
                   [self._fc__unramfactor_at_p(p, ci, fi, chi)
                    for (p, ci, fi) in l])
コード例 #2
0
 def _fourier_coefficient_full_rank(self, mat):
     '''
     Assuming mat is a positive definite, half-integral matrix,
     it returns the Fourier coefficient of self at the matrix.
     We normalize the Siegel Eisenstein series so that the constant term is equal to 1.
     cf. S. Takemori, Siegel Eisenstein series of degree n and Lambda-adic Eisenstein series.
     '''
     n = self.degree
     k = self.weight
     _mat_det = self._mat_det_full_rank(mat)
     unramfac = reduce(operator.mul,
                       (siegel_series_polynomial(mat, p).subs(
                           {X: p ** (k - n - 1)})
                        for p in prime_factors(_mat_det)), ZZ(1))
     return self._product_of_l_part(mat) * unramfac
コード例 #3
0
ファイル: import_nf_data.py プロジェクト: AurelPage/lmfdb
def do_import(ll):
  global count
  print "Importing list of length %d" %(len(ll))
  for F in ll:
    count += 1
    coeffs, T, D, r1, h, clgp, extras, reg, fu, nogrh, subs, reduc, zk = F
    print "%d: %s"%(count, F)
    #pol = coeff_to_poly(coeffs)
    d = int(len(coeffs))-1
    D = ZZ(D)
    absD = abs(D)
    s, dstr = make_disc_key(D)
    # default for r1 is -1 if we should compute it
    sig = [int(r1), int((d-r1)/2)]
    data = {
        'degree': d,
        'disc_abs_key': dstr,
        'disc_sign': s,
        'coeffs': makels(coeffs),
        'signature': makels(sig)
    }
    # Default is that polynomials are polredabs'ed
    if reduc == 0:
        data['reduced'] = 0
    # See if we have it and build a label
    index=1
    is_new = True
    for field in fields.find({'degree': d,
                 'signature': data['signature'],
                 'disc_abs_key': dstr}):
      index +=1
      if field['coeffs'] == data['coeffs']:
        is_new = False
        break

    if is_new:
        print "new field"
        label = base_label(d,sig[0],absD,index)
        data['label'] = label
        data['ramps'] = [str(x) for x in prime_factors(D)]
        subs = [[makels(z[0]), z[1]] for z in subs]
        zk = [str(z) for z in zk]
        zk = [z.replace('x','a') for z in zk]
        data['zk'] = zk
        data['subs'] = subs
        dak = data['disc_abs_key']
        if len(dak)<19:
          dakhash=int(dak)
        else:
          dakhash = int(dak[0:19])
        data['dischash'] = dakhash *data['disc_sign']
        data['coeffhash'] = hashlib.md5(data['coeffs']).hexdigest()
############
        if h>0:
            data['class_number'] = h
            data['class_group'] = makels(clgp)
        if extras>0:
            data['reg'] = reg
            fu = [web_latex(PR(str(u))) for u in fu]
            data['units'] = fu
        if nogrh==0:
            data['used_grh'] = True
        #print "entering %s into database"%info
        if saving:
            data['galois'] = makeb(d, T)
            fields.save(data)
    else:
        print "field already in database"
コード例 #4
0
def do_import(ll):
    global count
    print "Importing list of length %d" % (len(ll))
    for F in ll:
        count += 1
        coeffs, T, D, r1, h, clgp, extras, reg, fu, nogrh, subs, reduc, zk = F
        print "%d: %s" % (count, F)
        #pol = coeff_to_poly(coeffs)
        d = int(len(coeffs)) - 1
        D = ZZ(D)
        absD = abs(D)
        s, dstr = make_disc_key(D)
        # default for r1 is -1 if we should compute it
        sig = [int(r1), int((d - r1) / 2)]
        data = {
            'degree': d,
            'disc_abs_key': dstr,
            'disc_sign': s,
            'coeffs': makels(coeffs),
            'signature': makels(sig)
        }
        # Default is that polynomials are polredabs'ed
        if reduc == 0:
            data['reduced'] = 0
        # See if we have it and build a label
        index = 1
        is_new = True
        for field in fields.find({
                'degree': d,
                'signature': data['signature'],
                'disc_abs_key': dstr
        }):
            index += 1
            if field['coeffs'] == data['coeffs']:
                is_new = False
                break

        if is_new:
            print "new field"
            label = base_label(d, sig[0], absD, index)
            data['label'] = label
            data['ramps'] = [str(x) for x in prime_factors(D)]
            subs = [[makels(z[0]), z[1]] for z in subs]
            zk = [str(z) for z in zk]
            zk = [z.replace('x', 'a') for z in zk]
            data['zk'] = zk
            data['subs'] = subs
            dak = data['disc_abs_key']
            if len(dak) < 19:
                dakhash = int(dak)
            else:
                dakhash = int(dak[0:19])
            data['dischash'] = dakhash * data['disc_sign']
            data['coeffhash'] = hashlib.md5(data['coeffs']).hexdigest()
            ############
            if h > 0:
                data['class_number'] = h
                data['class_group'] = makels(clgp)
            if extras > 0:
                data['reg'] = reg
                fu = [web_latex(PR(str(u))) for u in fu]
                data['units'] = fu
            if nogrh == 0:
                data['used_grh'] = True
            #print "entering %s into database"%info
            if saving:
                data['galois'] = makeb(d, T)
                fields.save(data)
        else:
            print "field already in database"