def lfuncEPhtml(L, fmt): """ Euler product as a formula and a table of local factors. """ texform_gen = "\[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 $p\\nmid " + str(L.level) + "$,\n" 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 $p \mid " + str(L.level) + "$, then $F_p$ is a polynomial of degree at most 3, " # ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most 3, " ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most " ans += str(L.degree - 1) + ". " # ans += "with $F_p(0) = 1$." factN = list(factor(L.level)) 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>" numfactors = len(L.localfactors) goodorbad = "bad" C = getDBConnection() 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, '$C_1$') else: eptable += group_display_knowl(this_gal_group[0][0], this_gal_group[0][1], C) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1], C) 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], C) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1], C) eptable += "</td>" eptable += "</tr>\n" # eptable += "<td>" + group_display_knowl(4,1,C) + "</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], C) for j in range(1, len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0], this_gal_group[j][1], C) 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(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 $p\\nmid " + str(L.level) + "$,\n" 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 $p \mid " + str(L.level) + "$, then $F_p$ is a polynomial of degree at most 3, " # ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most 3, " ans += "If " + pbadset + ", then $F_p$ is a polynomial of degree at most " ans += str(L.degree - 1) + ". " # ans += "with $F_p(0) = 1$." factN = list(factor(L.level)) 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>" numfactors = len(L.localfactors) goodorbad = "bad" C = getDBConnection() 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,'$C_1$') else: eptable += group_display_knowl(this_gal_group[0][0],this_gal_group[0][1],C) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1],C) 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],C) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1],C) eptable += "</td>" eptable += "</tr>\n" # eptable += "<td>" + group_display_knowl(4,1,C) + "</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],C) for j in range(1,len(thispolygal[1])): eptable += "$\\times$" eptable += group_display_knowl(this_gal_group[j][0],this_gal_group[j][1],C) 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)