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
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