def lfuncEPhtml(L,fmt): """ Euler product as a formula and a table of local factors. """ texform_gen = "\[L(s) = " # "\[L(A,s) = " texform_gen += "\prod_{p \\text{ prime}} F_p(p^{-s})^{-1} \]\n" pfactors = prime_divisors(L.level) if len(pfactors) == 1: #i.e., the conductor is prime pgoodset = "$p \\neq " + str(pfactors[0]) + "$" pbadset = "$p = " + str(pfactors[0]) + "$" else: badset = "\\{" + str(pfactors[0]) for j in range(1,len(pfactors)): badset += ",\\;" badset += str(pfactors[j]) badset += "\\}" pgoodset = "$p \\notin " + badset + "$" pbadset = "$p \\in " + badset + "$" ans = "" ans += texform_gen + "where, for " + pgoodset + ",\n" if L.degree == 4 and L.motivic_weight == 1: ans += "\[F_p(T) = 1 - a_p T + b_p T^2 - a_p p T^3 + p^2 T^4 \]" ans += "with $b_p = a_p^2 - a_{p^2}$. " elif L.degree == 2 and L.motivic_weight == 1: ans += "\[F_p(T) = 1 - a_p T + p T^2 .\]" else: ans += "\(F_p\) is a polynomial of degree " + str(L.degree) + ". " ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most " ans += str(L.degree - 1) + ". " bad_primes = [] for lf in L.bad_lfactors: bad_primes.append(lf[0]) eulerlim = 25 good_primes = [] for j in range(0, eulerlim): this_prime = Primes().unrank(j) if this_prime not in bad_primes: good_primes.append(this_prime) eptable = "<table id='eptable' class='ntdata euler'>\n" eptable += "<thead>" eptable += "<tr class='space'><th class='weight'></th><th class='weight'>$p$</th><th class='weight'>$F_p$</th>" if L.degree > 2: eptable += "<th class='weight galois'>$\Gal(F_p)$</th>" eptable += "</tr>\n" eptable += "</thead>" goodorbad = "bad" for lf in L.bad_lfactors: try: thispolygal = list_to_factored_poly_otherorder(lf[1], galois=True) eptable += ("<tr><td>" + goodorbad + "</td><td>" + str(lf[0]) + "</td><td>" + "$" + thispolygal[0] + "$" + "</td>") if L.degree > 2: eptable += "<td class='galois'>" this_gal_group = thispolygal[1] if this_gal_group[0]==[0,0]: pass # do nothing, because the local faco is 1 elif this_gal_group[0]==[1,1]: eptable += group_display_knowl(this_gal_group[0][0],this_gal_group[0][1],'$C_1$') else: eptable += group_display_knowl(this_gal_group[0][0],this_gal_group[0][1]) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" except IndexError: eptable += "<tr><td></td><td>" + str(j) + "</td><td>" + "not available" + "</td></tr>\n" goodorbad = "" goodorbad = "good" firsttime = " class='first'" good_primes1 = good_primes[:9] good_primes2 = good_primes[9:] for j in good_primes1: this_prime_index = prime_pi(j) - 1 thispolygal = list_to_factored_poly_otherorder(L.localfactors[this_prime_index],galois=True) eptable += ("<tr" + firsttime + "><td>" + goodorbad + "</td><td>" + str(j) + "</td><td>" + "$" + thispolygal[0] + "$" + "</td>") if L.degree > 2: eptable += "<td class='galois'>" this_gal_group = thispolygal[1] eptable += group_display_knowl(this_gal_group[0][0],this_gal_group[0][1]) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" # eptable += "<td>" + group_display_knowl(4,1) + "</td>" # eptable += "</tr>\n" goodorbad = "" firsttime = "" firsttime = " id='moreep'" for j in good_primes2: this_prime_index = prime_pi(j) - 1 thispolygal = list_to_factored_poly_otherorder(L.localfactors[this_prime_index],galois=True) eptable += ("<tr" + firsttime + " class='more nodisplay'" + "><td>" + goodorbad + "</td><td>" + str(j) + "</td><td>" + "$" + list_to_factored_poly_otherorder(L.localfactors[this_prime_index], galois=True)[0] + "$" + "</td>") if L.degree > 2: this_gal_group = thispolygal[1] eptable += "<td class='galois'>" eptable += group_display_knowl(this_gal_group[0][0],this_gal_group[0][1]) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" firsttime = "" eptable += "<tr class='less toggle'><td></td><td></td><td> <a onclick='" eptable += 'show_moreless("more"); return true' + "'" eptable += ' href="#moreep" ' eptable += ">show more</a></td></tr>\n" eptable += "<tr class='more toggle nodisplay'><td></td><td></td><td> <a onclick='" eptable += 'show_moreless("less"); return true' + "'" eptable += ' href="#eptable" ' eptable += ">show less</a></td></tr>\n" eptable += "</table>\n" ans += "\n" + eptable return(ans)
def lfuncEPhtml(L, fmt): """ Euler product as a formula and a table of local factors. """ texform_gen = "\[L(s) = " # "\[L(A,s) = " texform_gen += "\prod_{p \\text{ prime}} F_p(p^{-s})^{-1} \]\n" pfactors = prime_divisors(L.level) if len(pfactors) == 1: #i.e., the conductor is prime pgoodset = "$p \\neq " + str(pfactors[0]) + "$" pbadset = "$p = " + str(pfactors[0]) + "$" else: badset = "\\{" + str(pfactors[0]) for j in range(1, len(pfactors)): badset += ",\\;" badset += str(pfactors[j]) badset += "\\}" pgoodset = "$p \\notin " + badset + "$" pbadset = "$p \\in " + badset + "$" ans = "" ans += texform_gen + "where, for " + pgoodset + ",\n" if L.degree == 4 and L.motivic_weight == 1: ans += "\[F_p(T) = 1 - a_p T + b_p T^2 - a_p p T^3 + p^2 T^4 \]" ans += "with $b_p = a_p^2 - a_{p^2}$. " elif L.degree == 2 and L.motivic_weight == 1: ans += "\[F_p(T) = 1 - a_p T + p T^2 .\]" else: ans += "\(F_p\) is a polynomial of degree " + str(L.degree) + ". " ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most " ans += str(L.degree - 1) + ". " bad_primes = [] for lf in L.bad_lfactors: bad_primes.append(lf[0]) eulerlim = 25 good_primes = [] for j in range(0, eulerlim): this_prime = Primes().unrank(j) if this_prime not in bad_primes: good_primes.append(this_prime) eptable = "<table id='eptable' class='ntdata euler'>\n" eptable += "<thead>" eptable += "<tr class='space'><th class='weight'></th><th class='weight'>$p$</th><th class='weight'>$F_p$</th>" if L.degree > 2: eptable += "<th class='weight galois'>$\Gal(F_p)$</th>" eptable += "</tr>\n" eptable += "</thead>" goodorbad = "bad" for lf in L.bad_lfactors: try: thispolygal = list_to_factored_poly_otherorder(lf[1], galois=True) eptable += ("<tr><td>" + goodorbad + "</td><td>" + str(lf[0]) + "</td><td>" + "$" + thispolygal[0] + "$" + "</td>") if L.degree > 2: eptable += "<td class='galois'>" this_gal_group = thispolygal[1] if this_gal_group[0] == [0, 0]: pass # do nothing, because the local faco is 1 elif this_gal_group[0] == [1, 1]: eptable += group_display_knowl(this_gal_group[0][0], this_gal_group[0][1], '$C_1$') else: eptable += group_display_knowl(this_gal_group[0][0], this_gal_group[0][1]) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" except IndexError: eptable += "<tr><td></td><td>" + str( j) + "</td><td>" + "not available" + "</td></tr>\n" goodorbad = "" goodorbad = "good" firsttime = " class='first'" good_primes1 = good_primes[:9] good_primes2 = good_primes[9:] for j in good_primes1: this_prime_index = prime_pi(j) - 1 thispolygal = list_to_factored_poly_otherorder( L.localfactors[this_prime_index], galois=True) eptable += ("<tr" + firsttime + "><td>" + goodorbad + "</td><td>" + str(j) + "</td><td>" + "$" + thispolygal[0] + "$" + "</td>") if L.degree > 2: eptable += "<td class='galois'>" this_gal_group = thispolygal[1] eptable += group_display_knowl(this_gal_group[0][0], this_gal_group[0][1]) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" # eptable += "<td>" + group_display_knowl(4,1) + "</td>" # eptable += "</tr>\n" goodorbad = "" firsttime = "" firsttime = " id='moreep'" for j in good_primes2: this_prime_index = prime_pi(j) - 1 thispolygal = list_to_factored_poly_otherorder( L.localfactors[this_prime_index], galois=True) eptable += ("<tr" + firsttime + " class='more nodisplay'" + "><td>" + goodorbad + "</td><td>" + str(j) + "</td><td>" + "$" + list_to_factored_poly_otherorder( L.localfactors[this_prime_index], galois=True)[0] + "$" + "</td>") if L.degree > 2: this_gal_group = thispolygal[1] eptable += "<td class='galois'>" eptable += group_display_knowl(this_gal_group[0][0], this_gal_group[0][1]) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1]) eptable += "</td>" eptable += "</tr>\n" firsttime = "" eptable += "<tr class='less toggle'><td></td><td></td><td> <a onclick='" eptable += 'show_moreless("more"); return true' + "'" eptable += ' href="#moreep" ' eptable += ">show more</a></td></tr>\n" eptable += "<tr class='more toggle nodisplay'><td></td><td></td><td> <a onclick='" eptable += 'show_moreless("less"); return true' + "'" eptable += ' href="#eptable" ' eptable += ">show less</a></td></tr>\n" eptable += "</table>\n" ans += "\n" + eptable return (ans)
def render_hgm_webpage(args): data = None info = {} if 'label' in args: label = clean_input(args['label']) data = motivedb().find_one({'label': label}) if data is None: bread = get_bread([("Search error", url_for('.search'))]) info['err'] = "Motive " + label + " was not found in the database." info['label'] = label return search_input_error(info, bread) title = 'Hypergeometric Motive:' + label A = data['A'] B = data['B'] myfam = familydb().find_one({'A': A, 'B': B}) if myfam is None: det = 'data not computed' else: det = myfam['det'] det = [det[0],str(det[1])] d1 = det[1] d1 = re.sub(r'\s','', d1) d1 = re.sub(r'(.)\(', r'\1*(', d1) R = PolynomialRing(ZZ, 't') if det[1]=='': d2 = R(1) else: d2 = R(d1) det = d2(QQ(data['t']))*det[0] t = latex(QQ(data['t'])) typee = 'Orthogonal' if (data['weight'] % 2) == 1 and (data['degree'] % 2) == 0: typee = 'Symplectic' primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71] locinfo = data['locinfo'] for j in range(len(locinfo)): locinfo[j] = [primes[j]] + locinfo[j] #locinfo[j][2] = poly_with_factored_coeffs(locinfo[j][2], primes[j]) locinfo[j][2] = list_to_factored_poly_otherorder(locinfo[j][2], vari='x') hodge = string2list(data['hodge']) famhodge = string2list(data['famhodge']) prop2 = [ ('Degree', '\(%s\)' % data['degree']), ('Weight', '\(%s\)' % data['weight']), ('Hodge vector', '\(%s\)' % hodge), ('Conductor', '\(%s\)' % data['cond']), ] # Now add factorization of conductor Cond = ZZ(data['cond']) if not (Cond.abs().is_prime() or Cond == 1): data['cond'] = "%s=%s" % (str(Cond), factorint(data['cond'])) info.update({ 'A': A, 'B': B, 't': t, 'degree': data['degree'], 'weight': data['weight'], 'sign': data['sign'], 'sig': data['sig'], 'hodge': hodge, 'famhodge': famhodge, 'cond': data['cond'], 'req': data['req'], 'lcms': data['lcms'], 'type': typee, 'det': det, 'locinfo': locinfo }) AB_data, t_data = data["label"].split("_t") friends = [("Motive family "+AB_data.replace("_"," "), url_for(".by_family_label", label = AB_data))] friends.append(('L-function', url_for("l_functions.l_function_hgm_page", label=AB_data, t='t'+t_data))) # if rffriend != '': # friends.append(('Discriminant root field', rffriend)) bread = get_bread([(label, ' ')]) return render_template("hgm-show-motive.html", credit=HGM_credit, title=title, bread=bread, info=info, properties2=prop2, friends=friends, learnmore=learnmore_list())
def render_hgm_webpage(label): data = None info = {} data = db.hgm_motives.lookup(label) if data is None: abort(404, "Hypergeometric motive " + label + " was not found in the database.") title = 'Hypergeometric Motive:' + label A = data['A'] B = data['B'] det = db.hgm_families.lucky({'A': A, 'B': B}, 'det') if det is None: det = 'data not computed' else: det = [det[0],str(det[1])] d1 = det[1] d1 = re.sub(r'\s','', d1) d1 = re.sub(r'(.)\(', r'\1*(', d1) R = PolynomialRing(ZZ, 't') if det[1]=='': d2 = R(1) else: d2 = R(d1) det = d2(QQ(data['t']))*det[0] t = latex(QQ(data['t'])) typee = 'Orthogonal' if (data['weight'] % 2) == 1 and (data['degree'] % 2) == 0: typee = 'Symplectic' primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71] locinfo = data['locinfo'] for j in range(len(locinfo)): locinfo[j] = [primes[j]] + locinfo[j] #locinfo[j][2] = poly_with_factored_coeffs(locinfo[j][2], primes[j]) locinfo[j][2] = list_to_factored_poly_otherorder(locinfo[j][2], vari='x') hodge = data['hodge'] famhodge = data['famhodge'] prop2 = [ ('Degree', '\(%s\)' % data['degree']), ('Weight', '\(%s\)' % data['weight']), ('Hodge vector', '\(%s\)' % hodge), ('Conductor', '\(%s\)' % data['cond']), ] # Now add factorization of conductor Cond = ZZ(data['cond']) if not (Cond.abs().is_prime() or Cond == 1): data['cond'] = "%s=%s" % (str(Cond), factorint(data['cond'])) info.update({ 'A': A, 'B': B, 't': t, 'degree': data['degree'], 'weight': data['weight'], 'sign': data['sign'], 'sig': data['sig'], 'hodge': hodge, 'famhodge': famhodge, 'cond': data['cond'], 'req': data['req'], 'lcms': data['lcms'], 'type': typee, 'det': det, 'locinfo': locinfo }) AB_data, t_data = data["label"].split("_t") friends = [("Motive family "+AB_data.replace("_"," "), url_for(".by_family_label", label = AB_data))] friends.append(('L-function', url_for("l_functions.l_function_hgm_page", label=AB_data, t='t'+t_data))) # if rffriend != '': # friends.append(('Discriminant root field', rffriend)) bread = get_bread([(label, ' ')]) return render_template("hgm-show-motive.html", credit=HGM_credit, title=title, bread=bread, info=info, properties2=prop2, friends=friends, learnmore=learnmore_list())
def make_class(self): self.decompositioninfo = self.decomposition_display() self.basechangeinfo = self.basechange_display() self.formatted_polynomial = list_to_factored_poly_otherorder( self.polynomial, galois=False, vari='x')
def make_class(self): self.decompositioninfo = self.decomposition_display() self.basechangeinfo = self.basechange_display() self.formatted_polynomial = list_to_factored_poly_otherorder(self.polynomial,galois=False,vari = 'x')