forked from sanni85/Mod-l-galois-representations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmatch.sage
33 lines (27 loc) · 1013 Bytes
/
match.sage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Consistency check: compare Frobenius traces and characters of the
dual pairs that we have computed to coefficients of eigenforms.
"""
from glob import glob
labels = [f.replace('.gp', '') for f in glob('GL2-*.gp')]
# Compare Frobenius traces.
forms = {}
for f in glob('GL2-*/forms.txt'):
g = f.replace('/forms.txt', '')
_, l, n, _ = f.split('-', 3)
P = {ZZ(l)}.union(ZZ(n).prime_factors())
for s in open(f).readlines():
t = tuple(sorted((p, a) for p, a in sage_eval(s)[1] if p not in P))
if t in forms and forms[t] != g:
raise ValueError("key {} already found".format(t))
forms[t] = g
for f in labels:
t = tuple(map(tuple, sage_eval(open(f + '-traces.txt').read())))
g = forms[t]
if f != g: print('mismatch {} != {}'.format(f, g))
# Compare characters.
for f in labels:
c1 = open(f + '-character.txt').read().strip()
c2 = open(f + '/character.txt').read().strip()
if c1 != c2:
print('mismatch: {} != {}'.format(c1, c2))