示例#1
0
 def value(self, z, embedding=0):
     if self.prec == 0:
         return 0
     else:
         q = exp(2 * CC.pi() * CC(0, 1) * z)
         return sum(
             self.coefficient_embedding(n, embedding) * q**n
             for n in range(self.prec))
示例#2
0
def check_ap2_slow(rec):
    # Check a_{p^2} = a_p^2 - chi(p) for primes up to 31
    ls = rec['lfunction_label'].split('.')
    level, weight, chi = map(int, [ls[0], ls[1], ls[-2]])
    char = DirichletGroup_conrey(level, CC)[chi]
    Z = rec['an_normalized[0:1000]']
    for p in prime_range(31+1):
        if level % p != 0:
            # a_{p^2} = a_p^2 - chi(p)
            charval = CC(2*char.logvalue(int(p)) * CC.pi()*CC.gens()[0]).exp()
        else:
            charval = 0
        if  (CC(*Z[p**2 - 1]) - (CC(*Z[p-1])**2 - charval)).abs() > 1e-11:
            return False
    return True
示例#3
0
def check_ap2_slow(rec):
    # Check a_{p^2} = a_p^2 - chi(p) for primes up to 31
    ls = rec['lfunction_label'].split('.')
    level, weight, chi = map(int, [ls[0], ls[1], ls[-2]])
    char = DirichletGroup_conrey(level, CC)[chi]
    Z = rec['an_normalized[0:1000]']
    for p in prime_range(31+1):
        if level % p != 0:
            # a_{p^2} = a_p^2 - chi(p)
            charval = CC(2*char.logvalue(int(p)) * CC.pi()*CC.gens()[0]).exp()
        else:
            charval = 0
        if  (CC(*Z[p**2 - 1]) - (CC(*Z[p-1])**2 - charval)).abs() > 1e-11:
            return False
    return True
示例#4
0
 def check_ap2_slow(self, rec, verbose=False):
     """
     Check a_{p^2} = a_p^2 - chi(p) for primes up to 31
     """
     ls = rec['label'].split('.')
     level, weight, chi = map(int, [ls[0], ls[1], ls[-2]])
     char = DirichletGroup_conrey(level, CC)[chi]
     Z = rec['an_normalized']
     for p in prime_range(31+1):
         if level % p != 0:
             # a_{p^2} = a_p^2 - chi(p)
             charval = CC(2*char.logvalue(int(p)) * CC.pi()*CC.gens()[0]).exp()
         else:
             charval = 0
         if (CC(*Z[p**2 - 1]) - (CC(*Z[p-1])**2 - charval)).abs() > 1e-13:
             if verbose:
                 print "ap2 failure", p, CC(*Z[p**2 - 1]), CC(*Z[p-1])**2 - charval
             return False
     return True
示例#5
0
 def value(self, z, embedding=0):
     if self.prec == 0:
         return 0
     else:
         q = exp(2*CC.pi()*CC(0,1)*z)
         return sum(self.coefficient_embedding(n,embedding)*q**n for n in range(self.prec))
示例#6
0
def gaussum(n, N, prec=53):
    CC = ComplexField(prec)
    return sum(CC(exp(2 * CC.pi() * CC(0, 1) * n * m ** 2 / N)) for m in range(N))
示例#7
0
def gaussum(n, N, prec=53):
    CC = ComplexField(prec)
    return sum(
        CC(exp(2 * CC.pi() * CC(0, 1) * n * m**2 / N)) for m in range(N))