def galois_rep_from_path(p): if p[0]=='EllipticCurve': # create the sage elliptic curve then create Galois rep object ainvs = db.ec_curves.lucky({'lmfdb_label':p[2]+"."+p[3]+p[4]}, 'ainvs') E = EllipticCurve(ainvs) return GaloisRepresentation(E) elif (p[0]=='Character' and p[1]=='Dirichlet'): dirichletArgs = {'type':'Dirichlet', 'modulus':int(p[2]), 'number':int(p[3])} chi = WebDirichletCharacter(**dirichletArgs) return GaloisRepresentation(chi) elif (p[0]=='ModularForm'): level = int(p[4]) weight = int(p[5]) conrey_label = p[6] # this should be zero; TODO check this is the case hecke_orbit = p[7] # this is a, b, c, etc.; chooses the galois orbit embedding = p[8] # this is the embedding of that galois orbit label = convert_newformlabel_from_conrey(str(level)+"."+str(weight)+"."+str(conrey_label)+"."+hecke_orbit) form = WebNewform(label) return GaloisRepresentation([form, ZZ(embedding)]) elif (p[0]=='ArtinRepresentation'): dim = p[1] conductor = p[2] index = p[3] rho = ArtinRepresentation(dim, conductor, index) return GaloisRepresentation(rho) else: return
def make_webchar(args): modulus = int(args['modulus']) if modulus < 10000: return WebDBDirichletCharacter(**args) elif modulus < 100000: return WebDirichletCharacter(**args) else: return WebSmallDirichletCharacter(**args)
def dc_calc(calc, modulus, number): val = request.args.get("val", []) args = {'type': 'Dirichlet', 'modulus': modulus, 'number': number} if not val: return flask.abort(404) try: if calc == 'value': return WebDirichletCharacter(**args).value(val) if calc == 'gauss': return WebDirichletCharacter(**args).gauss_sum(val) elif calc == 'jacobi': return WebDirichletCharacter(**args).jacobi_sum(val) elif calc == 'kloosterman': return WebDirichletCharacter(**args).kloosterman_sum(val) else: return flask.abort(404) except Warning, e: return "<span style='color:gray;'>%s</span>" % e
def line(n): l = [] count = 0 q = n while count < limit: if modn_exponent(q) % n == 0: G = DirichletGroup_conrey(q) for chi in G: j = chi.number() c = WebDirichletCharacter(modulus = q, number = j) if chi.multiplicative_order() == n: l.append((q, j, chi.is_primitive(), chi.multiplicative_order(), c.symbol)) count += 1 if count == limit: break q += 1 return l
def line(N): l = [] if N%4 == 2: return l count = 0 q = N while count < limit: if q % N == 0: G = DirichletGroup_conrey(q) for chi in G: j = chi.number() c = WebDirichletCharacter(modulus = q, number = j) if chi.conductor() == q: l.append((q, j, chi.is_primitive(), chi.multiplicative_order(), c.symbol)) count += 1 if count == limit: break q += N return l