CoCalc
Sharedwww / Tables / hijikata.gpOpen in CoCalc
Author: William A. Stein
1
\\ tr.gp
2
\\ William A. Stein
3
\\ Created: October 1998
4
\\ Modified: 14 January 2001
5
\\
6
\\ DESCRIPTION: Hijikata trace formula for tr T_n
7
\\ on S_k(Gamma_0(N)), any n>=1, except if n|N,
8
\\ then n must be prime.
9
10
{h(d)=
11
\\ qfbclassno(-236) breaks, so use qfbclassno(-236,1),
12
\\ i.e., use Euler products instead!
13
qfbclassno(d,1);
14
}
15
16
{w(d)=
17
if(d==-4,4,if(d==-3,6,2))/2;
18
}
19
20
{tof(a, f=0,t=1,i=1,b=0)=
21
f=factor(a);
22
b=prod(i=1,matsize(f)[1],
23
t*=f[i,1]^((f[i,2]-f[i,2]%2)/2)
24
);
25
if((a/t^2) % 4 == 1, t, t/2);
26
}
27
28
{mu(N, f)=
29
f = factor(N);
30
N*prod(i=1,matsize(f)[1],(1+1/f[i,1]));
31
}
32
33
{sig(n, N, f=0)=
34
if(N%n==0,
35
n,
36
\\ else
37
f=factor(n);
38
prod(i=1,matsize(f)[1],
39
(1-f[i,1]^(f[i,2]+1))/(1-f[i,1])));
40
}
41
42
{quadpoints(s,n,p,v, len=0,pv=0,x=0,vec=0)=
43
len=0;
44
pv=p^v;
45
vec=vector(pv,x,0);
46
for(x=0,pv-1, \\ very simplistic!
47
if((x^2-s*x+n)%pv==0,
48
len++;
49
vec[len]=x
50
)
51
);
52
vector(len,x,vec[x]);
53
}
54
55
{A(s,f,n,p,v, sr=0, rho=0, cnt=0)=
56
rho=valuation(f,p);
57
sr=eval(Set(quadpoints(s,n,p,v+2*rho)%(p^(v+rho))));
58
cnt=0;
59
for(i=1,length(sr),
60
if((2*sr[i]-s)%(p^rho)==0 && if(n==p,sr[i]%p!=0,1),
61
cnt++
62
)
63
);
64
cnt;
65
}
66
67
{B(s,f,n,p,v)=
68
rho = valuation(f,p);
69
length(Set(quadpoints(s,n,p,v+2*rho+1) % p^(v+rho)));
70
}
71
72
{cp(s,f,n,p,v)=
73
A(s,f,n,p,v) +
74
if(((s^2-4*n)/f^2)%p==0,
75
B(s,f,n,p,v)
76
);
77
}
78
79
{c(s,f,n,N, fac)=
80
fac=factor(N);
81
prod(i=1,matsize(fac)[1],
82
cp(s,f,n,fac[i,1],fac[i,2])
83
);
84
}
85
86
{type_p(n,k,N, s=0)=
87
if(issquare(n),
88
s=floor(sqrt(4*n));
89
1/4*(s/2)*n^(k/2-1)*(c(s,1,n,N) + (-1)^k*c(-s,1,n,N)),0
90
);
91
}
92
93
{absxy(s,n,k,N,f=0,x=0,y=0,t=0)=
94
t = floor(sqrt(s^2-4*n));
95
x = (s-t)/2;
96
y = (s+t)/2;
97
(min(abs(x),abs(y))^(k-1)/abs(x-y))
98
* sign(x)^k
99
* sumdiv(t,f,1/2*eulerphi(t/f)*c(s,f,n,N));
100
}
101
102
{type_h(n,k,N, s=0,sm=0)=
103
for(s=ceil(2*sqrt(n))+issquare(n),4*n,
104
if(issquare(s^2-4*n),
105
sm += (absxy(s,n,k,N)+absxy(-s,n,k,N))
106
)
107
);
108
sm;
109
}
110
111
{xy(s,n,k,N, f=0, x=0, y=0)=
112
x = (s+sqrt(s^2-4*n))/2;
113
y = (s-sqrt(s^2-4*n))/2;
114
1/2 * (x^(k-1)-y^(k-1))/(x-y)
115
* sumdiv(tof(s^2-4*n),f,
116
h((s^2-4*n)/f^2)/w((s^2-4*n)/f^2) * c(s,f,n,N)
117
);
118
}
119
120
{type_e(n,k,N,r=0)=
121
r=floor(2*sqrt(n))-issquare(n);
122
sum(s=-r,r,xy(s,n,k,N));
123
}
124
125
{sum_s(n,k,N)=
126
type_p(n,k,N)+type_h(n,k,N)+type_e(n,k,N);
127
}
128
129
{tr(n,k=12,N=1, t=0)=
130
t=(if(k%2,0,-sum_s(n,k,N)+if(k==2,sig(n,N))
131
+if(issquare(n),(k-1)*mu(N)/12*n^(k/2-1))));
132
if(abs(t-round(t))>.01,print("Precision loss -- Error! noninteger trace! ",t),round(t));
133
}
134
135
print("tr(n,k,N) = tr(T_n on S_k(Gamma_0(N))). (If n | N then n must be prime.)");
136