def get_factor_over_nf(curve, prime_ideal, prime_number, conductor, accuracy): """ Returns the inverse of the factor corresponding to the given prime ideal in the Euler product expansion of the L-function at prime_ideal. Unless the accuracy doesn't need this expansion, and then returns 1 in power series ring. """ P = PowerSeriesRing(ZZ, 'T') T = P.gen() q = prime_ideal.norm() inertial_deg = Integer(q).ord(prime_number) if inertial_deg > accuracy: return P(1) if prime_ideal.divides(conductor): a = curve.local_data(prime_ideal).bad_reduction_type() L = 1 - a * (T**inertial_deg) else: discriminant = curve.discriminant() if prime_ideal.divides(discriminant): a = q + 1 - curve.local_minimal_model(prime_ideal).reduction( prime_ideal).count_points() else: a = q + 1 - curve.reduction(prime_ideal).count_points() L = 1 - a * (T**inertial_deg) + q * (T**(2 * inertial_deg)) return L
def _dimension_Gamma0_3_psi_3(wt): r""" Return the dimensions of subspaces of Siegel modular forms $Gamma0(3)$ with character $\psi_3$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) B = 1 / (1 - x**1) / (1 - x**3) / (1 - x**4) / (1 - x**3) H_all_odd = B H_all_even = B * x**14 # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all_even[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all_odd[wt] return (a, tbi, tbi, 0, tbi)
def test_tensprod_121_chi(): C121=[1,2,-1,2,1,-2,2,0,-2,2,0,-2,-4,4,-1,-4,2,-4,0,2,-2,0,\ -1,0,-4,-8,5,4,0,-2,7,-8,0,4,2,-4,3,0,4,0,8,-4,6,0,-2,-2,\ 8,4,-3,-8,-2,-8,-6,10,0,0,0,0,5,-2,-12,14,-4,-8,-4,0,-7,4,\ 1,4,-3,0,-4,6,4,0,0,8,10,-4,1,16,6,-4,2,12,0,0,15,-4,-8,\ -2,-7,16,0,8,-7,-6,0,-8,-2,-4,-16,0,-2,-12,-18,10,-10,0,-3,\ -8,9,0,-1,0,8,10,4,0,0,-24,-8,14,-9,-8,-8,0,-6,-8,18,0,0,\ -14,5,0,-7,2,-10,4,-8,-6,0,8,0,-8,3,6,10,8,-2,0,-4,0,7,8,\ -7,20,6,-8,-2,2,4,16,0,12,12,0,3,4,0,12,6,0,-8,0,-5,30,\ -15,-4,7,-16,12,0,3,-14,0,16,10,0,17,8,-4,-14,4,-6,2,0,0,0] chi=[1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,\ 1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,\ -1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,\ 1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,\ 1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,\ 1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,\ -1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,\ -1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,\ -1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1] ANS=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\ -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\ 2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\ 1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\ -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\ 9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\ 5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\ 20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\ -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0] R = PowerSeriesRing(ZZ, "T") T = R.gens()[0] assert ANS == tensor_get_an_deg1(C121, chi, [[11, 1 - T]]) assert ANS == tensor_get_an(C121, chi, 2, 1, [[11, 1 - T, 1 - T]]) assert get_euler_factor(ANS, 2) == (1 + 2 * T + 2 * T**2 + O(T**8)) assert get_euler_factor(ANS, 3) == (1 + T + 3 * T**2 + O(T**5)) assert get_euler_factor(ANS, 5) == (1 - T + 5 * T**2 + O(T**4))
def _dimension_Sp4Z(wt_range): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$. OUTPUT ("Total", "Eisenstein", "Klingen", "Maass", "Interesting") """ headers = ['Total', 'Eisenstein', 'Klingen', 'Maass', 'Interesting'] R = PowerSeriesRing(ZZ, default_prec = wt_range[-1] + 1, names = ('x',)) (x,) = R._first_ngens(1) H_all = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12) H_Kl = x ** 12 / (1 - x ** 4) / (1 - x ** 6) H_MS = (x ** 10 + x ** 12) / (1 - x ** 4) / (1 - x ** 6) dct = dict((k, { 'Total': H_all[k], 'Eisenstein': 1 if k >= 4 else 0, 'Klingen': H_Kl[k], 'Maass': H_MS[k], 'Interesting': H_all[k]-(1 if k >= 4 else 0)-H_Kl[k]-H_MS[k] } if is_even(k) else { 'Total': H_all[k-35], 'Eisenstein': 0, 'Klingen': 0, 'Maass': 0, 'Interesting': H_all[k-35] } ) for k in wt_range) return headers, dct
def __dimension_Sp6Z(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(6,Z)$. OUTPUT ("Total", "Miyawaki-Type-1", "Miyawaki-Type-2 (conjectured)", "Interesting") Remember, Miywaki type 2 is ONLY CONJECTURED!! """ if not is_even(wt): return (0, 0, 0, 0) R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) S = PowerSeriesRing(ZZ, default_prec=max(2 * wt - 1,1), names=('y',)) (y,) = S._first_ngens(1) H_all = 1 / ((1 - x ** 4) * (1 - x ** 12) ** 2 * (1 - x ** 14) * (1 - x ** 18) * (1 - x ** 20) * (1 - x ** 30)) * ( 1 + x ** 6 + x ** 10 + x ** 12 + 3 * x ** 16 + 2 * x ** 18 + 2 * x ** 20 + 5 * x ** 22 + 4 * x ** 24 + 5 * x ** 26 + 7 * x ** 28 + 6 * x ** 30 + 9 * x ** 32 + 10 * x ** 34 + 10 * x ** 36 + 12 * x ** 38 + 14 * x ** 40 + 15 * x ** 42 + 16 * x ** 44 + 18 * x ** 46 + 18 * x ** 48 + 19 * x ** 50 + 21 * x ** 52 + 19 * x ** 54 + 21 * x ** 56 + 21 * x ** 58 + 19 * x ** 60 + 21 * x ** 62 + 19 * x ** 64 + 18 * x ** 66 + 18 * x ** 68 + 16 * x ** 70 + 15 * x ** 72 + 14 * x ** 74 + 12 * x ** 76 + 10 * x ** 78 + 10 * x ** 80 + 9 * x ** 82 + 6 * x ** 84 + 7 * x ** 86 + 5 * x ** 88 + 4 * x ** 90 + 5 * x ** 92 + 2 * x ** 94 + 2 * x ** 96 + 3 * x ** 98 + x ** 102 + x ** 104 + x ** 108 + x ** 114) H_noncusp = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12) H_E = y ** 12 / (1 - y ** 4) / (1 - y ** 6) H_Miyawaki1 = H_E[wt] * H_E[2 * wt - 4] H_Miyawaki2 = H_E[wt - 2] * H_E[2 * wt - 2] a, b, c, d = H_all[wt], H_noncusp[wt], H_Miyawaki1, H_Miyawaki2 return (a, c, d, a - b - c - d)
def _dimension_Gamma0_3_psi_3(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(3)$ with character $\psi_3$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) B = 1 / (1 - x ** 1) / (1 - x ** 3) / (1 - x ** 4) / (1 - x ** 3) H_all_odd = B H_all_even = B * x ** 14 # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all_even[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all_odd[wt] return (a, tbi, tbi, 0, tbi)
def test_tensprod_121_chi(): C121=[1,2,-1,2,1,-2,2,0,-2,2,0,-2,-4,4,-1,-4,2,-4,0,2,-2,0,\ -1,0,-4,-8,5,4,0,-2,7,-8,0,4,2,-4,3,0,4,0,8,-4,6,0,-2,-2,\ 8,4,-3,-8,-2,-8,-6,10,0,0,0,0,5,-2,-12,14,-4,-8,-4,0,-7,4,\ 1,4,-3,0,-4,6,4,0,0,8,10,-4,1,16,6,-4,2,12,0,0,15,-4,-8,\ -2,-7,16,0,8,-7,-6,0,-8,-2,-4,-16,0,-2,-12,-18,10,-10,0,-3,\ -8,9,0,-1,0,8,10,4,0,0,-24,-8,14,-9,-8,-8,0,-6,-8,18,0,0,\ -14,5,0,-7,2,-10,4,-8,-6,0,8,0,-8,3,6,10,8,-2,0,-4,0,7,8,\ -7,20,6,-8,-2,2,4,16,0,12,12,0,3,4,0,12,6,0,-8,0,-5,30,\ -15,-4,7,-16,12,0,3,-14,0,16,10,0,17,8,-4,-14,4,-6,2,0,0,0] chi=[1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,\ 1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,\ -1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,\ 1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,\ 1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,\ 1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,\ -1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,\ -1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,\ -1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1] ANS=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\ -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\ 2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\ 1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\ -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\ 9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\ 5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\ 20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\ -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0] R = PowerSeriesRing(ZZ, "T") T = R.gens()[0] assert ANS==tensor_get_an_deg1(C121,chi,[[11,1-T]]) assert ANS==tensor_get_an(C121,chi,2,1,[[11,1-T,1-T]]) assert get_euler_factor(ANS,2)==(1+2*T+2*T**2+O(T**8)) assert get_euler_factor(ANS,3)==(1+T+3*T**2+O(T**5)) assert get_euler_factor(ANS,5)==(1-T+5*T**2+O(T**4))
def _dimension_Sp4Z(wt_range): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$. OUTPUT ("Total", "Eisenstein", "Klingen", "Maass", "Interesting") """ headers = ['Total', 'Eisenstein', 'Klingen', 'Maass', 'Interesting'] R = PowerSeriesRing(ZZ, default_prec=wt_range[-1] + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12) H_Kl = x**12 / (1 - x**4) / (1 - x**6) H_MS = (x**10 + x**12) / (1 - x**4) / (1 - x**6) dct = dict( (k, { 'Total': H_all[k], 'Eisenstein': 1 if k >= 4 else 0, 'Klingen': H_Kl[k], 'Maass': H_MS[k], 'Interesting': H_all[k] - (1 if k >= 4 else 0) - H_Kl[k] - H_MS[k] } if is_even(k) else { 'Total': H_all[k - 35], 'Eisenstein': 0, 'Klingen': 0, 'Maass': 0, 'Interesting': H_all[k - 35] }) for k in wt_range) return headers, dct
def test_tensprod_11a_17a(): C11=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\ -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\ 2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\ 1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\ -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\ 9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\ 5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\ 20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\ -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0] C17=[1,-1,0,-1,-2,0,4,3,-3,2,0,0,-2,-4,0,-1,1,3,-4,2,0,0,4,\ 0,-1,2,0,-4,6,0,4,-5,0,-1,-8,3,-2,4,0,-6,-6,0,4,0,6,-4,0,\ 0,9,1,0,2,6,0,0,12,0,-6,-12,0,-10,-4,-12,7,4,0,4,-1,0,8,\ -4,-9,-6,2,0,4,0,0,12,2,9,6,-4,0,-2,-4,0,0,10,-6,-8,-4,0,\ 0,8,0,2,-9,0,1,-10,0,8,-6,0,-6,8,0,6,0,0,-4,-14,0,-8,-6,\ 6,12,4,0,-11,10,0,-4,12,12,8,3,0,-4,16,0,-16,-4,0,3,-6,0,\ -8,8,0,4,0,3,-12,6,0,2,-10,0,-16,-12,-3,0,-8,0,-2,-12,0,10,\ 16,-9,24,6,0,4,-4,0,-9,2,12,-4,22,0,-4,0,0,-10,12,-6,-2,8,\ 0,12,4,0,0,0,0,-8,-16,0,2,-2,0,-9,-18,0,-20,-3] ANS=[1,2,0,2,-2,0,-8,8,15,-4,0,0,-8,-16,0,12,-2,30,0,-4,0,0,\ -4,0,29,-16,0,-16,0,0,28,-8,0,-4,16,30,-6,0,0,-16,48,0,-24,\ 0,-30,-8,0,0,22,58,0,-16,-36,0,0,-64,0,0,-60,0,-120,56,-120,\ -8,16,0,-28,-4,0,32,12,120,-24,-12,0,0,0,0,-120,-24,144,96,\ 24,0,4,-48,0,0,150,-60,64,-8,0,0,0,0,-14,44,0,58,-20,0,-128,\ -64,0,-72,144,0,60,0,0,-96,-126,0,8,0,-120,-120,16,0,-11,-240,\ 0,56,-158,-240,64,-32,0,32,-288,0,0,-56,0,-16,42,0,-80,32,0,\ 24,0,180,0,-48,0,-12,100,0,-32,0,-30,0,-56,0,14,-240,0,16,32,\ 288,96,96,0,48,48,0,142,8,0,-48,-132,0,-232,0,0,300,-180,-60,\ -14,128,0,-32,12,0,0,0,0,0,-272,0,8,-28,0,44,36,0,0,232] R = PowerSeriesRing(ZZ, "T") T = R.gens()[0] B11=[11,1-T,1+11*T**2] B17=[17,1+2*T+17*T**2,1-T] assert ANS==tensor_get_an_no_deg1(C11,C17,2,2,[B11,B17])
def test_tensprod_11a_17a(): C11=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\ -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\ 2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\ 1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\ -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\ 9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\ 5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\ 20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\ -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0] C17=[1,-1,0,-1,-2,0,4,3,-3,2,0,0,-2,-4,0,-1,1,3,-4,2,0,0,4,\ 0,-1,2,0,-4,6,0,4,-5,0,-1,-8,3,-2,4,0,-6,-6,0,4,0,6,-4,0,\ 0,9,1,0,2,6,0,0,12,0,-6,-12,0,-10,-4,-12,7,4,0,4,-1,0,8,\ -4,-9,-6,2,0,4,0,0,12,2,9,6,-4,0,-2,-4,0,0,10,-6,-8,-4,0,\ 0,8,0,2,-9,0,1,-10,0,8,-6,0,-6,8,0,6,0,0,-4,-14,0,-8,-6,\ 6,12,4,0,-11,10,0,-4,12,12,8,3,0,-4,16,0,-16,-4,0,3,-6,0,\ -8,8,0,4,0,3,-12,6,0,2,-10,0,-16,-12,-3,0,-8,0,-2,-12,0,10,\ 16,-9,24,6,0,4,-4,0,-9,2,12,-4,22,0,-4,0,0,-10,12,-6,-2,8,\ 0,12,4,0,0,0,0,-8,-16,0,2,-2,0,-9,-18,0,-20,-3] ANS=[1,2,0,2,-2,0,-8,8,15,-4,0,0,-8,-16,0,12,-2,30,0,-4,0,0,\ -4,0,29,-16,0,-16,0,0,28,-8,0,-4,16,30,-6,0,0,-16,48,0,-24,\ 0,-30,-8,0,0,22,58,0,-16,-36,0,0,-64,0,0,-60,0,-120,56,-120,\ -8,16,0,-28,-4,0,32,12,120,-24,-12,0,0,0,0,-120,-24,144,96,\ 24,0,4,-48,0,0,150,-60,64,-8,0,0,0,0,-14,44,0,58,-20,0,-128,\ -64,0,-72,144,0,60,0,0,-96,-126,0,8,0,-120,-120,16,0,-11,-240,\ 0,56,-158,-240,64,-32,0,32,-288,0,0,-56,0,-16,42,0,-80,32,0,\ 24,0,180,0,-48,0,-12,100,0,-32,0,-30,0,-56,0,14,-240,0,16,32,\ 288,96,96,0,48,48,0,142,8,0,-48,-132,0,-232,0,0,300,-180,-60,\ -14,128,0,-32,12,0,0,0,0,0,-272,0,8,-28,0,44,36,0,0,232] R = PowerSeriesRing(ZZ, "T") T = R.gens()[0] B11 = [11, 1 - T, 1 + 11 * T**2] B17 = [17, 1 + 2 * T + 17 * T**2, 1 - T] assert ANS == tensor_get_an_no_deg1(C11, C17, 2, 2, [B11, B17])
def set_from_coefficients(self, coeffs): QR = PowerSeriesRing(QQ,name='q',order='neglex') q = QR.gen() res = 0*q**0 for n, c in coeffs.iteritems(): res += c*q**n res = res.add_bigoh(len(coeffs.keys())+1) self.set_value(res)
def set_from_coefficients(self, coeffs): if not len(coeffs) == 0: QR = PowerSeriesRing(coeffs.values()[0].parent(),name='q',order='neglex') q = QR.gen() res = 0*q**0 for n, c in coeffs.iteritems(): res += c*q**n res = res.add_bigoh(len(coeffs.keys())+1) self.set_value(res)
def euler_p_factor(root_list, PREC): ''' computes the coefficients of the pth Euler factor expanded as a geometric series ax^n is the Dirichlet series coefficient p^(-ns) ''' PREC = floor(PREC) # return satake_list R = PowerSeriesRing(CF, 'x') x = R.gen() ep = ~R.prod([1 - a * x for a in root_list]) return ep.O(PREC + 1)
def hilbert_series_using_dimension_formula(i, prec=10): ''' This assumes dimension formula is true for weight (2, k) where k > 2 and the dimesion for (1, k) k > 2 is zero. If one believes magma, the assumption for (2, k) can be checked for some cases. And the assumption for (1, k) can be checked by the construction. ''' ps = PowerSeriesRing(QQ, names='t', default_prec=prec + 1) t = ps.gen() return (sum(dimension_cuspforms_sqrt5(a, a + 2 * i) * t**a for a in range(2, prec + 1)) + O(t**(prec + 1)))
def hilbert_series_using_cand_wts(i, parity, prec=None): wts = load_cand_wts(i, parity) if prec is None: prec = max(wts[0]) ps = PowerSeriesRing(QQ, names='t', default_prec=prec + 1) t = ps.gen() num = sum(t**a for a in wts[0]) if len(wts) > 1: num -= sum(t**a for a in wts[1]) dnm = (1 - t**2) * (1 - t**4) * (1 - t**6) return num / dnm
def hilbert_series_maybe(j, parity=None, prec=30): ''' Returns a hilbert series which is equal to sum_{k > 0} M_{k, j}(Gamma_{2}) t^k modulo a polynomial of degree < 5. ''' R = PowerSeriesRing(QQ, names="t", default_prec=prec) t = R.gen() dnm = R(t_dnm()) nm = hilbert_series_num_maybe(j, parity=parity) return (nm + O(t ** prec)) / dnm
def zeta_function(self, var_name='T'): r""" Return the Zeta function of the curve. For any scheme `X` of finite type over `\mathbb{Z}`, the **arithmetic zeta funtion** of `X` is defined as the product .. MATH:: \zeta(X,s) := \prod_x \frac{1}{1-N(x)^{-s}}, where `x` runs over over all closed points of `X` and `N(x)` denotes the cardinality of the residue field of `x`. If `X` is a smooth projective curve over a field with `q` elements, then `\zeta(X,s) = Z(X,q^{-s})`, where `Z(X,T)` is a rational function in `T` of the form .. MATH:: Z(X,T) = \frac{P(T)}{(1-T)(1-qT)}, for a polynomial `P` of degree `2g`, with some extra properties reflecting the Weil conjectures. See: - Hartshorn, *Algebraic Geometry*, Appendix C, Section 1. Note that that this makes only sense if the constant base field of self is finite, and that `Z(X,T)` depends on the choice of the constant base field (unlike the function `\zeta(X,s)`!). """ if hasattr(self,"_zeta_function"): return self._zeta_function K = self._constant_base_field q = K.order() g = self.genus() S = PowerSeriesRing(ZZ, var_name, g+1) N = self.count_points(g) Z_series = S(1) for k in range(1,g+1): Z_series *= (1-S.gen()**k)**(-N[k]) P = (Z_series*(1-S.gen())*(1-q*S.gen())).polynomial() c = range(2*g+1) for k in range(g+1): c[k] = P[k] for k in range(g+1,2*g+1): c[k] = c[2*g-k]*q**(k-g) R = P.parent() zeta = R(c)/(1-R.gen())/(1-q*R.gen()) self._zeta_function = zeta return zeta
def t_delete_terms_of_small_degrees(f): ''' f is a polynomial of t. Returns a polynomial g which is congruent to f modulo t_dnm so that g/t_dnm does not have terms with degree < 4. ''' R = PowerSeriesRing(QQ, names="t") S = PolynomialRing(QQ, names="t") t = R.gen() dnm = R(t_dnm()) g = R(f / dnm) + O(t ** 4) a = S(sum([t ** i * g[i] for i in range(4)])) return f - t_dnm() * a
def _dimension_Gamma0_4(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(4)$. OUTPUT ("Total",) REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, 'x') x = R.gen().O(wt + 1) H_all = (1 + x**4) * (1 + x**11) / (1 - x**2)**3 / (1 - x**6) return (H_all[wt], )
def _dimension_Gamma0_4(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(4)$. OUTPUT ("Total",) REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = (1 + x**4)(1 + x**11) / (1 - x**2)**3 / (1 - x**6) return (H_all[wt], )
def _dimension_Gamma0_4(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(4)$. OUTPUT ("Total",) REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all = (1 + x ** 4)(1 + x ** 11) / (1 - x ** 2) ** 3 / (1 - x ** 6) return (H_all[wt],)
def _dimension_Gamma0_3(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(3)$. OUTPUT ("Total") REMARK Only total dimension implemented. """ R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all = (1 + 2 * x ** 4 + x ** 6 + x ** 15 * (1 + 2 * x ** 2 + x ** 6)) / (1 - x ** 2) / (1 - x ** 4) / (1 - x ** 6) ** 2 return (H_all[wt],)
def _dimension_Gamma0_3(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(3)$. OUTPUT ("Total") REMARK Only total dimension implemented. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = (1 + 2 * x**4 + x**6 + x**15 * (1 + 2 * x**2 + x**6)) / (1 - x**2) / (1 - x**4) / (1 - x**6)**2 return (H_all[wt], )
def _dimension_Gamma0_3(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma0(3)$. OUTPUT ("Total") REMARK Only total dimension implemented. """ R = PowerSeriesRing(ZZ, 'x') x = R.gen().O(wt + 1) H_all = (1 + 2 * x**4 + x**6 + x**15 * (1 + 2 * x**2 + x**6)) / (1 - x**2) / (1 - x**4) / (1 - x**6)**2 return (H_all[wt], )
def x5_jacobi_pwsr(prec): mx = int(ceil(sqrt(8 * prec) / QQ(2)) + 1) mn = int(floor(-(sqrt(8 * prec) - 1) / QQ(2))) mx1 = int(ceil((sqrt(8 * prec + 1) - 1) / QQ(2)) + 1) mn1 = int(floor((-sqrt(8 * prec + 1) - 1) / QQ(2))) R = LaurentPolynomialRing(QQ, names="t") t = R.gens()[0] S = PowerSeriesRing(R, names="q1") q1 = S.gens()[0] eta_3 = sum([QQ(-1) ** n * (2 * n + 1) * q1 ** (n * (n + 1) // 2) for n in range(mn1, mx1)]) + bigO(q1 ** (prec + 1)) theta = sum([QQ(-1) ** n * q1 ** (((2 * n + 1) ** 2 - 1) // 8) * t ** (n + 1) for n in range(mn, mx)]) # ct = qexp_eta(ZZ[['q1']], prec + 1) return theta * eta_3 ** 3 * QQ(8) ** (-1)
def rings1(): """ Return an iterator over random rings. Return a list of pairs (f, desc), where f is a function that outputs a random ring that takes a ring and possibly some other data as constructor. RINGS: - polynomial ring in one variable over a rings0() ring. - polynomial ring over a rings1() ring. - multivariate polynomials - power series rings in one variable over a rings0() ring. EXAMPLES:: sage: import sage.rings.tests sage: type(sage.rings.tests.rings0()) <... 'list'> """ v = rings0() X = random_rings(level=0) from sage.all import (PolynomialRing, PowerSeriesRing, LaurentPolynomialRing, ZZ) v = [(lambda: PolynomialRing(next(X), names='x'), 'univariate polynomial ring over level 0 ring'), (lambda: PowerSeriesRing(next(X), names='x'), 'univariate power series ring over level 0 ring'), (lambda: LaurentPolynomialRing(next(X), names='x'), 'univariate Laurent polynomial ring over level 0 ring'), (lambda: PolynomialRing(next(X), abs(ZZ.random_element(x=2, y=10)), names='x'), 'multivariate polynomial ring in between 2 and 10 variables over a level 0 ring')] return v
def __init__(self, weight, lattice, character, prec=10): self._k = weight self._L = lattice self._h = character self._prec = prec # _feparent: this is the ambient space in which the Fourier expansion of self lives # we have to think about this... self._feparent = PowerSeriesRing(QQbar, 'q,z')
def _dimension_Sp4Z(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$. OUTPUT ("Total", "Eisenstein", "Klingen", "Maass", "Interesting") """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12) H_Kl = x ** 12 / (1 - x ** 4) / (1 - x ** 6) H_MS = (x ** 10 + x ** 12) / (1 - x ** 4) / (1 - x ** 6) if is_even(wt): a, b, c, d = H_all[wt], 1 if wt >= 4 else 0, H_Kl[wt], H_MS[wt] return (a, b, c, d, a - b - c - d) else: a = H_all[wt - 35] return (a, 0, 0, 0, a)
def _dimension_Sp4Z(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$. OUTPUT ("Total", "Eisenstein", "Klingen", "Maass", "Interesting") """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12) H_Kl = x**12 / (1 - x**4) / (1 - x**6) H_MS = (x**10 + x**12) / (1 - x**4) / (1 - x**6) if is_even(wt): a, b, c, d = H_all[wt], 1 if wt >= 4 else 0, H_Kl[wt], H_MS[wt] return (a, b, c, d, a - b - c - d) else: a = H_all[wt - 35] return (a, 0, 0, 0, a)
def _dimension_Gamma0_4_psi_4(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma_0(4)$ with character $\psi_4$. OUTPUT ("Total") REMARK The formula for odd weights is unknown or not obvious from the paper. """ R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all_even = (x ** 12 + x ** 14) / (1 - x ** 2) ** 3 / (1 - x ** 6) if is_even(wt): return (H_all_even[wt],) else: raise NotImplementedError('Dimensions of $M_{k}(\Gamma_0(4), \psi_4)$ for odd $k$ not implemented')
def _dimension_Sp4Z_2(wt): """ Return the dimensions of subspaces of vector-valued Siegel modular forms on $Sp(4,Z)$ of weight integral,2. OUTPUT ("Total", "Non-cusp", "Cusp") REMARK Satoh's paper does not have a description of the cusp forms. """ if not is_even(wt): return (uk, uk, uk) R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) H = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12) V = 1 / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12) # W = 1 / (1 - x ** 10) / (1 - x ** 12) a = H[wt - 10] + H[wt - 14] + H[wt - 16] + V[wt - 16] + V[wt - 18] + V[wt - 22] return (a, uk, uk)
def euler_factor_to_list(P, prec): """ P a polynomial (or power series) returns the list [a_p, a_p^2, ... """ K = P[0].parent() R = PowerSeriesRing(K, "T", default_prec=prec+1) L = ((1/R(P.truncate().coefficients(sparse=False))).truncate().coefficients(sparse=False))[1:] while len(L) < prec: # include zeros at end L.append(0) return L
def _dimension_Gamma0_3_psi_3(wt): """ Return the dimensions of the space of Siegel modular forms on $Gamma_0(3)$ with character $\psi_3$. OUTPUT ("Total") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) B = 1 / (1 - x**1) / (1 - x**3) / (1 - x**4) / (1 - x**3) H_all_odd = B H_all_even = B * x**14 if is_even(wt): return (H_all_even[wt], ) else: return (H_all_odd[wt], )
def _dimension_Gamma0_3_psi_3(wt): """ Return the dimensions of the space of Siegel modular forms on $Gamma_0(3)$ with character $\psi_3$. OUTPUT ("Total") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',)) (x,) = R._first_ngens(1) B = 1 / (1 - x ** 1) / (1 - x ** 3) / (1 - x ** 4) / (1 - x ** 3) H_all_odd = B H_all_even = B * x ** 14 if is_even(wt): return (H_all_even[wt],) else: return (H_all_odd[wt],)
def _dimension_Gamma0_4_psi_4(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Gamma_0(4)$ with character $\psi_4$. OUTPUT ("Total") REMARK The formula for odd weights is unknown or not obvious from the paper. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all_even = (x**12 + x**14) / (1 - x**2)**3 / (1 - x**6) if is_even(wt): return (H_all_even[wt], ) else: raise NotImplementedError( 'Dimensions of $M_{k}(\Gamma_0(4), \psi_4)$ for odd $k$ not implemented' )
def dirichlet(R, euler_factors): PS = PowerSeriesRing(R) pef = zip(primes_first_n(len(euler_factors)), euler_factors) an_list_bound = next_prime(pef[-1][0]) res = [1]*an_list_bound for p, ef in pef: k = RR(an_list_bound).log(p).floor()+1 foo = (1/PS(ef)).padded_list(k) for i in range(1, k): res[p**i] = foo[i] extend_multiplicatively(res) return res
def _dimension_Sp6Z(wt): """ Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$. OUTPUT ("Total", "Miyawaki-Type-1", "Miyawaki-Type-2 (conjectured)", "Interesting") Remember, Miywaki type 2 is ONLY CONJECTURED!! """ if not is_even(wt): return (0, 0, 0, 0) R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) R = PowerSeriesRing(ZZ, default_prec=2 * wt - 1, names=('y', )) (y, ) = R._first_ngens(1) H_all = 1 / ( (1 - x**4) * (1 - x**12)**2 * (1 - x**14) * (1 - x**18) * (1 - x**20) * (1 - x**30)) * (1 + x**6 + x**10 + x**12 + 3 * x**16 + 2 * x**18 + 2 * x**20 + 5 * x**22 + 4 * x**24 + 5 * x**26 + 7 * x**28 + 6 * x**30 + 9 * x**32 + 10 * x**34 + 10 * x**36 + 12 * x**38 + 14 * x**40 + 15 * x**42 + 16 * x**44 + 18 * x**46 + 18 * x**48 + 19 * x**50 + 21 * x**52 + 19 * x**54 + 21 * x**56 + 21 * x**58 + 19 * x**60 + 21 * x**62 + 19 * x**64 + 18 * x**66 + 18 * x**68 + 16 * x**70 + 15 * x**72 + 14 * x**74 + 12 * x**76 + 10 * x**78 + 10 * x**80 + 9 * x**82 + 6 * x**84 + 7 * x**86 + 5 * x**88 + 4 * x**90 + 5 * x**92 + 2 * x**94 + 2 * x**96 + 3 * x**98 + x**102 + x**104 + x**108 + x**114) H_noncusp = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12) H_E = y**12 / (1 - y**4) / (1 - y**6) H_Miyawaki1 = H_E[wt] * H_E[2 * wt - 4] H_Miyawaki2 = H_E[wt - 2] * H_E[2 * wt - 2] a, b, c, d = H_all[wt], H_noncusp[wt], H_Miyawaki1, H_Miyawaki2 return (a, c, d, a - b - c - d)
def tensor_get_an_no_deg1(L1, L2, d1, d2, BadPrimeInfo): """ Same as the above in the case no dimension is 1 """ if d1 == 1 or d2 == 1: raise ValueError('min(d1,d2) should not be 1, use direct method then') s1 = len(L1) s2 = len(L2) if s1 < s2: S = s1 if s2 <= s1: S = s2 BadPrimes = [] for bpi in BadPrimeInfo: BadPrimes.append(bpi[0]) P = prime_range(S + 1) Z = S * [1] S = RealField()(S) for p in P: f = S.log(base=p).floor() q = 1 E1 = [] E2 = [] if not p in BadPrimes: for i in range(f): q = q * p E1.append(L1[q - 1]) E2.append(L2[q - 1]) e1 = list_to_euler_factor(E1, f + 1) e2 = list_to_euler_factor(E2, f + 1) # ld1 = d1 # not used # ld2 = d2 # not used else: # either convolve, or have one input be the answer and other 1-t i = BadPrimes.index(p) e1 = BadPrimeInfo[i][1] e2 = BadPrimeInfo[i][2] # ld1 = e1.degree() # not used # ld2 = e2.degree() # not used F = e1.list()[0].parent().fraction_field() R = PowerSeriesRing(F, "T", default_prec=f + 1) e1 = R(e1) e2 = R(e2) E = tensor_local_factors(e1, e2, f) A = euler_factor_to_list(E, f) while len(A) < f: A.append(0) q = 1 for i in range(f): q = q * p Z[q - 1] = A[i] all_an_from_prime_powers(Z) return Z
def _dimension_Gamma0_4(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all = (1 + x ** 4)(1 + x ** 11) / (1 - x ** 2) ** 3 / (1 - x ** 6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all[wt] return (a, tbi, tbi, 0, tbi)
def _dimension_Gamma0_4_half(k): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$ of half integral weight k - 1/2. INPUT The realweight is k-1/2 OUTPUT ('Total', 'Non cusp', 'Cusp') REMARK Note that formula from Hayashida's and Ibukiyama's paper has formula that coefficient of x^w is for weight (w+1/2). So here w=k-1. """ R = PowerSeriesRing(ZZ, default_prec=k, names=('x', )) (x, ) = R._first_ngens(1) H_all = 1 / (1 - x) / (1 - x**2)**2 / (1 - x**3) H_cusp = (2 * x**5 + x**7 + x**9 - 2 * x**11 + 4 * x**6 - x**8 + x**10 - 3 * x**12 + x**14) / (1 - x**2)**2 / (1 - x**6) a, c = H_all[k - 1], H_cusp[k - 1] return (a, a - c, c)
def _dimension_Gamma0_4_psi_4(wt): r""" Return the dimensions of subspaces of Siegel modular forms $Gamma0(4)$ with character $\psi_4$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK The formula for odd weights is unknown or not obvious from the paper. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all_even = (x**12 + x**14) / (1 - x**2)**3 / (1 - x**6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all_even[wt] return (a, tbi, tbi, tbi, tbi) else: return (uk, uk, uk, uk, uk)
def _dimension_Gamma0_4(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Not completely implemented """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = (1 + x**4)(1 + x**11) / (1 - x**2)**3 / (1 - x**6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all[wt] return (a, tbi, tbi, 0, tbi)
def _dimension_Gamma0_2(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(2)$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Only total dimension implemented. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', )) (x, ) = R._first_ngens(1) H_all = 1 / (1 - x**2) / (1 - x**4) / (1 - x**4) / (1 - x**6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all[wt - 19] return (a, 0, 0, 0, a)
def _dimension_Gamma0_4_half(k): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$ of half integral weight k - 1/2. INPUT The realweight is k-1/2 OUTPUT ('Total', 'Non cusp', 'Cusp') REMARK Note that formula from Hayashida's and Ibukiyama's paper has formula that coefficient of x^w is for weight (w+1/2). So here w=k-1. """ R = PowerSeriesRing(ZZ, default_prec=k, names=('x',)) (x,) = R._first_ngens(1) H_all = 1 / (1 - x) / (1 - x ** 2) ** 2 / (1 - x ** 3) H_cusp = (2 * x ** 5 + x ** 7 + x ** 9 - 2 * x ** 11 + 4 * x ** 6 - x ** 8 + x ** 10 - 3 * x ** 12 + x ** 14) / (1 - x ** 2) ** 2 / (1 - x ** 6) a, c = H_all[k - 1], H_cusp[k - 1] return (a, a - c, c)
def _dimension_Gamma0_4_psi_4(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$ with character $\psi_4$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK The formula for odd weights is unknown or not obvious from the paper. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all_even = (x ** 12 + x ** 14) / (1 - x ** 2) ** 3 / (1 - x ** 6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all_even[wt] return (a, tbi, tbi, tbi, tbi) else: return (uk, uk, uk, uk, uk)
def _dimension_Gamma0_2(wt): """ Return the dimensions of subspaces of Siegel modular forms$Gamma0(2)$. OUTPUT ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting") REMARK Only total dimension implemented. """ R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',)) (x,) = R._first_ngens(1) H_all = 1 / (1 - x ** 2) / (1 - x ** 4) / (1 - x ** 4) / (1 - x ** 6) # H_cusp = ?? # H_Kl = ?? # H_MS = ?? if is_even(wt): a = H_all[wt] return (a, tbi, tbi, tbi, tbi) else: a = H_all[wt - 19] return (a, 0, 0, 0, a)
def list_to_euler_factor(L, d): """ takes a list [a_p, a_p^2,... and returns the euler factor """ if isinstance(L[0], int): K = QQ else: K = L[0].parent() R = PowerSeriesRing(K, "T") # T = R.gens()[0] f = 1 / R([1] + L) f = f.add_bigoh(d + 1) return f
def computation_roots(self): # Write these as p-adic series. Start with helper self.lowered = self.lower_precision() def help_padic(n, p, prec): """ Take an integer n, prime p, and precision prec, and return a prec-tuple of the p-adic coefficients of j """ n = ZZ(n) res = [0 for j in range(prec)] while n < 0: n += p**prec for k in range(prec): res[k] = n % p n = (n - res[k]) / p return res # Second helper, in case some arrays are not extended by 0 def getel(li, j): if j < len(li): return li[j] return 0 myroots = self._data["QpRts"] p = self._data['QpRts-p'] prec = self._data['QpRts-prec'] myroots = [[help_padic(z, p, prec) for z in t] for t in myroots] myroots = [[[ getel(root[j], r) for j in range(len(self._data['QpRts-minpoly']) - 1) ] for r in range(prec)] for root in myroots] myroots = [[coeff_to_poly(x, var='a') for x in root] for root in myroots] # Use power series so degrees increase # Use formal p so we can make a power series PR = PowerSeriesRing(PolynomialRing(QQ, 'a'), 'p') rawrts = [str(PR(x)) + r'+O(p^{})'.format(prec) for x in myroots] rawrts = [z.replace('p', str(p)) for z in rawrts] myroots = [ web_latex(PR(x), enclose=False) + r'+O(p^{' + str(prec) + r'})' for x in myroots ] # change p into its value myroots = [r'\({}\)'.format(z) for z in myroots] myroots = [ re.sub(r'([a)\d]) *p', r'\1\\cdot ' + str(p), z) for z in myroots ] typesetrts = [z.replace('p', str(p)) for z in myroots] return [raw_typeset(z[0], z[1]) for z in zip(rawrts, typesetrts)]
def get_factor_over_nf(curve, prime_ideal, prime_number, conductor, accuracy): """ Returns the inverse of the factor corresponding to the given prime ideal in the Euler product expansion of the L-function at prime_ideal. Unless the accuracy doesn't need this expansion, and then returns 1 in power series ring. """ P = PowerSeriesRing(ZZ, 'T') T = P.gen() q = prime_ideal.norm() inertial_deg = Integer(q).ord(prime_number) if inertial_deg > accuracy: return P(1) if prime_ideal.divides(conductor): a = curve.local_data(prime_ideal).bad_reduction_type() L = 1 - a*(T**inertial_deg) else: discriminant = curve.discriminant() if prime_ideal.divides(discriminant): a = q + 1 - curve.local_minimal_model(prime_ideal).reduction(prime_ideal).count_points() else: a = q + 1 - curve.reduction(prime_ideal).count_points() L = 1 - a*(T**inertial_deg) + q*(T**(2*inertial_deg)) return L
def anlist_over_sqrt5(E, bound): """ Compute the Dirichlet L-series coefficients, up to and including a_bound. The i-th element of the return list is a[i]. INPUT: - E -- elliptic curve over Q(sqrt(5)), which must have defining polynomial `x^2-x-1`. - ``bound`` -- integer OUTPUT: - list of integers of length bound + 1 EXAMPLES:: sage: from psage.ellcurve.lseries.lseries_nf import anlist_over_sqrt5 sage: K.<a> = NumberField(x^2-x-1); E = EllipticCurve([0,-a,a,0,0]) sage: v = anlist_over_sqrt5(E, 50); v [0, 1, 0, 0, -2, -1, 0, 0, 0, -4, 0, 3, 0, 0, 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, -4, 0, 0, 0, 11, 0, -6, 0, 0, 0, 0, 8, 0, 0, 0, 0, -1, 0, 0, -6, 4, 0, 0, 0, -6, 0] sage: len(v) 51 This function isn't super fast, but at least it will work in a few seconds up to `10^4`:: sage: t = cputime() sage: v = anlist_over_sqrt5(E, 10^4) sage: assert cputime(t) < 5 """ import aplist_sqrt5 from psage.number_fields.sqrt5.prime import primes_of_bounded_norm, Prime # Compute all of the prime ideals of the ring of integers up to the given bound primes = primes_of_bounded_norm(bound+1) # Compute the traces of Frobenius: this is supposed to be the hard part v = aplist_sqrt5.aplist(E, bound+1) # Compute information about the primes of bad reduction, in # particular the integers i such that primes[i] is a prime of bad # reduction. bad_primes = set([Prime(a.prime()) for a in E.local_data()]) # We compute the local factors of the L-series as power series in ZZ[T]. P = PowerSeriesRing(ZZ, 'T') T = P.gen() # Table of powers of T, so we don't have to compute T^4 (say) thousands of times. Tp = [T**i for i in range(5)] # For each prime, we write down the local factor. L_P = [] for i, P in enumerate(primes): inertial_deg = 2 if P.is_inert() else 1 a_p = v[i] if P in bad_primes: # bad reduction f = 1 - a_p*Tp[inertial_deg] else: # good reduction q = P.norm() f = 1 - a_p*Tp[inertial_deg] + q*Tp[2*inertial_deg] L_P.append(f) # Use the local factors of the L-series to compute the Dirichlet # series coefficients of prime-power index. coefficients = [0,1] + [0]*(bound-1) i = 0 while i < len(primes): P = primes[i] if P.is_split(): s = L_P[i] * L_P[i+1] i += 2 else: s = L_P[i] i += 1 p = P.p # We need enough terms t so that p^t > bound accuracy_p = int(math.floor(math.log(bound)/math.log(p))) + 1 series_p = s.add_bigoh(accuracy_p)**(-1) for j in range(1, accuracy_p): coefficients[p**j] = series_p[j] # Using multiplicativity, fill in the non-prime power Dirichlet # series coefficients. extend_multiplicatively_generic(coefficients) return coefficients
def gen_func_maybe_cusp_num_t_power_srs(parity=None, prec=10): R = PolynomialRing(QQ, names="t") S = PowerSeriesRing(R, names="s", default_prec=prec) s = S.gen() num = gen_func_maybe_cusp_num_t(parity=parity) return S(num) + O(s ** prec)