Attachment 'find_gamma.sage'
Download 1 def Gamma(E,r):
2 alpha = r.numerator()
3 beta = r.denominator()
4 N = E.conductor()
5 newcusp=0
6 epsilon=var('epsilon')
7 if gcd(beta,N) == 1:
8 [c,d] = xgcd(N*alpha,beta)[1:3]
9 c=-c
10 d=-d
11 Gamma = matrix(ZZ,[[-beta,alpha],[c*N,d]])
12 #Gamma = Gamma0(N)([-beta,alpha,c*N,d])
13 A = 0
14 B = 1
15 [C,D] = xgcd(-B,A)[1:3]
16 M = matrix(ZZ,[[A,B],[C,D]])
17 #M = SL2Z([A,C,B,D])
18 M = M.transpose()
19
20
21
22 Q = N/B
23
24 #[x,y] = xgcd(Q^2,N)[1:3]
25
26 #x = -x/A
27 #y=-y
28
29 #wQ = matrix(ZZ,[[Q*x,y],[N,-A*Q]])
30
31 print solve(epsilon == 1/Q * imag(SL2Z(M.inverse()).acton(SL2Z(Gamma).acton(r+i*epsilon)) ), epsilon)
32
33 else:
34 [c,d] = xgcd(N*alpha,beta)[1:3]
35 [a,b] = xgcd(d,-c*N)[1:3]
36 newcusp = (a*alpha + b*beta)/(c*N*alpha + d*beta)
37 Gamma = matrix(ZZ,[[a,b],[c*N,d]])
38 #Gamma = Gamma0(N)([-beta,alpha,c*N,d])
39 A = newcusp.numerator()
40 B = newcusp.denominator()
41 [C,D] = xgcd(-B,A)[1:3]
42 M = matrix(ZZ,[[A,B],[C,D]])
43 #M = SL2Z([A,C,B,D])
44 M = M.transpose()
45
46 Q = N/B
47
48 #[x,y] = xgcd(Q^2,N)[1:3]
49
50 #x = -x/A
51 #y=-y
52
53 #wQ = matrix(ZZ,[[Q*x,y],[N,-A*Q]])
54
55 print solve(epsilon == 1/Q * imag(SL2Z(M.inverse()).acton(SL2Z(Gamma).acton(r+i*epsilon)) ), epsilon)
56
57
58
59 return [Gamma,newcusp]
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.