Skip to content

Instantly share code, notes, and snippets.

@stakemori
Created November 30, 2016 02:56
Show Gist options
  • Save stakemori/ffae3298a92fbba31a6b1cb6b4d94827 to your computer and use it in GitHub Desktop.
Save stakemori/ffae3298a92fbba31a6b1cb6b4d94827 to your computer and use it in GitHub Desktop.
from degree2.all import CuspFormsDegree2
def compute_charpolys(k):
'''
Assuming the charstestic polynomial of T(2) on S_k(Sp(4, Z))
is square free over Q,
return a pair of polynomials (pl1, pl2) s.t.
pl1 is the characteristic polynomial of T(2)
pl2 is the characteristic polynomial of T_1(4).
'''
R = PolynomialRing(QQ, names="x")
x = R.gens()[0]
if k % 2 == 0:
prec = max((k // 10) * 2, 4)
else:
prec = max(((k - 5)//10) * 2, 12)
S = CuspFormsDegree2(k, prec=prec)
pols = []
s_charpoly = S.hecke_charpoly(2)
if any(i > 1 for _, i in s_charpoly.factor()):
raise RuntimeError("charpoly is not square free.")
for pl1, _ in s_charpoly.factor():
if pl1.degree() == 1:
eg = - pl1[0][0]
else:
eg = NumberField(pl1, name="a").gens()[0]
f = S.eigenform_with_eigenvalue_t2(eg)
eg_t4 = f.hecke_eigenvalue(4)
eg_t1_4 = (eg**2 - eg_t4 - 2**(2 * k - 4) - 10 * 2**(2 * k - 6))/2
if eg_t1_4 in QQ:
pl2 = x - eg_t1_4
else:
pl2 = eg_t1_4.charpoly()
pols.append((pl1, pl2))
return (mul(a for a, _ in pols), mul(b for _, b in pols))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment