def elliptic_curves(v, B=100, filename=None): from hmf import HilbertModularForms F = open(filename,'a') if filename else None for N in ideals_of_norm(v): H = HilbertModularForms(N) for i, E in enumerate(H.elliptic_curve_factors()): v = E.aplist(B) s = '%s\t%s\t%s\t%s'%(N.norm(), no_space(canonical_gen(N)), i, ' '.join([no_space(x) for x in v])) print s if F: F.write(s+'\n') F.flush()
def elliptic_curves(v, B=100, filename=None): from hmf import HilbertModularForms F = open(filename, 'a') if filename else None for N in ideals_of_norm(v): H = HilbertModularForms(N) for i, E in enumerate(H.elliptic_curve_factors()): v = E.aplist(B) s = '%s\t%s\t%s\t%s' % (N.norm(), no_space( canonical_gen(N)), i, ' '.join([no_space(x) for x in v])) print s if F: F.write(s + '\n') F.flush()
def test_hecke_invariance_of_new_subspace(Bmin=2, Bmax=300): from tables import ideals_of_bounded_norm from hmf import HilbertModularForms, next_prime_of_characteristic_coprime_to for N in ideals_of_bounded_norm(Bmax): if N.norm() < Bmin: continue print N.norm() H = HilbertModularForms(N) NS = H.new_subspace() p = next_prime_of_characteristic_coprime_to(F.ideal(1), N) q = next_prime_of_characteristic_coprime_to(p, N) print p, q T_p = NS.T(p) T_q = NS.T(q) assert T_p*T_q == T_q*T_p, "Hecke operators T_{%s} and T_{%s} at level %s (of norm %s) don't commute"%(p, q, N, N.norm())
def test_hecke_commutes(Bmin=2, Bmax=50): from tables import ideals_of_bounded_norm from hmf import HilbertModularForms, next_prime_of_characteristic_coprime_to for N in ideals_of_bounded_norm(Bmax): if N.norm() < Bmin: continue print N.norm() H = HilbertModularForms(N) p = next_prime_of_characteristic_coprime_to(F.ideal(1), N) q = next_prime_of_characteristic_coprime_to(p, N) print p, q T_p = H.T(p) T_q = H.T(q) assert T_p * T_q == T_q * T_p, "Hecke operators T_{%s} and T_{%s} at level %s (of norm %s) don't commute" % ( p, q, N, N.norm())
def f(N): set_random_seed(0) # to replicate any linear algebra issues? level = no_space(canonical_gen(N)).replace('*','').replace('-','_') F = open(os.path.join(dir,'%s.txt'%level),'w') H = HilbertModularForms(N) level = no_space(canonical_gen(N)) try: D = H.elliptic_curve_factors() F.write('count %s %s %s\n'%(N.norm(), level, len(D))) F.flush() for i, E in enumerate(D): v = E.aplist(B) s = '%s\t%s\t%s\t%s'%(N.norm(), level, i, ' '.join([no_space(x) for x in v])) print s F.write(s+'\n') F.flush() except Exception, msg: F.write('exception %s %s "%s"\n'%(N.norm(), level, msg))
def f(N): set_random_seed(0) # to replicate any linear algebra issues? level = no_space(canonical_gen(N)).replace('*', '').replace('-', '_') F = open(os.path.join(dir, '%s.txt' % level), 'w') H = HilbertModularForms(N) level = no_space(canonical_gen(N)) try: D = H.elliptic_curve_factors() F.write('count %s %s %s\n' % (N.norm(), level, len(D))) F.flush() for i, E in enumerate(D): v = E.aplist(B) s = '%s\t%s\t%s\t%s' % (N.norm(), level, i, ' '.join( [no_space(x) for x in v])) print s F.write(s + '\n') F.flush() except Exception, msg: F.write('exception %s %s "%s"\n' % (N.norm(), level, msg))