-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwritetolatex.m
150 lines (133 loc) · 4.23 KB
/
writetolatex.m
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
filenames:=ShimDBFilenames();
for filename in filenames do
//create a table in latex of all Shimura curve quotients,
//their genus and the number of points from the database
s:=ShimDBRead(filename);
if s`ShimAtkinLehner eq [1] then
print "\\hline \\hline";
D:=s`ShimDiscriminant;
N:=s`ShimLevel;
if s`ShimLevel eq 1 then
multi:=5;
else
multi:=16;
end if;
pointsize:=0;
printf " %o & %o & %o & & %o \\\\ \n",
D, N, s`ShimGenus, pointsize;
/*print "\\hline";
printf "\\multirow{multi}{*}{%o}", D;
print "\\multirow{multi}{*}{%o}", N;*/
else
D:="";
N:="";
if s`ShimGenus eq 0 then
if s`ShimRationalPoints eq true then
pointsize := "$\\infty$";
else
pointsize := 0;
end if;
elif s`ShimGenus eq 1 then
if Type(s`ShimRationalPoints) eq SetEnum then
pointsize := #s`ShimRationalPoints;
else
pointsize := "$\\infty$";
end if;
else
pointsize := #s`ShimRationalPoints;
end if;
AL:="$";
for w in AtkinLehnerGenerators(s`ShimAtkinLehner) do
AL:=AL cat Sprintf("\\w_{%o},",w);
end for;
Prune(~AL);
AL:=AL cat "$";
printf " %o & %o & %o & %o & %o \\\\ \n",
D, N, s`ShimGenus, AL, pointsize;
if s`ShimAtkinLehner eq [1] then
print "\\hline";
end if;
end if;
end for;
DN:=Setseq({[ShimDBRead(filename)`ShimDiscriminant, ShimDBRead(filename)`ShimLevel] : filename in ShimDBFilenames() });
DBsize:=0;
for A in DN do
if A[2] eq 1 then
DBsize:=DBsize+5;
else
DBsize:=DBsize+16;
end if;
end for;
assert #ShimDBFilenames() eq DBsize;
gy:=[ [A[1],A[2]] : A in GYList() | [A[1],A[2]] notin [[6,1],[10,1],[22,1],[14,1],[15,1],[21,1],[33,1],[34,1],[46,1]] ];
#gy;
//gy are the X(D,1) not of genus 0 or 1
//should be equal to the database
[ A : A in gy | A notin DN ];
assert Set(gy) eq Set(DN);
for filename in ShimDBFilenames() do
//create a table in latex of the Shimura curve quotients of
//level 1 with finitely many points, including the equation,
// the rational points and whether they are CM
s:=ShimDBRead(filename : version:=2);
W:=s`ShimAtkinLehner;
if #W eq 2 then
if s`ShimGenus ge 1 and Type(s`ShimRationalPoints) eq SetEnum
and s`ShimRationalPoints ne {} then
D:=s`ShimDiscriminant; N:=s`ShimLevel;
if N eq 1 and [D,W[2]] in [[35,5],[51,17]] then
//print "\\hline \\hline";
cm_points:=RationalCMPoints(D,N,W[2]);
non_cm_points:=RationalNonCMPoints(D,N,W[2]);
points:=Setseq(s`ShimRationalPoints);
assert #cm_points + #non_cm_points eq #points;
multi:=#cm_points + #non_cm_points;
X:=s`ShimModel;
if s`ShimGenus eq 1 then
pt:=X!Setseq(s`ShimRationalPoints)[1];
E,m1:=EllipticCurve(X,pt);
Ered,m2:=MinimalModel(E);
m:=m1*m2;
else
Ered,m:=ReducedModel(X);
end if;
Xtex:=Reverse(Prune(Reverse(Split(Sprintf("%o",Ered),"b")[2])));
Xtex:=Sprintf("$%o$", Prune(Split(Xtex,"v")[1]));
Xtex:=ReplaceAll(Xtex,"*","");
//printf "\\multirow{%o}{*}{%o} \n", multi, D;
//printf "\\multirow{%o}{*}{$\\w_{%o}$} \n", multi, W[2];
printf "%o & $\\w_{%o}$ & & & & \\\\", D, W[2];
print " \\cline{1-2}";
for i in [1..#cm_points] do
P:=cm_points[i];
PX:=X!P[1];
mPX:=Eltseq(m(PX));
if mPX[3] ne 0 then
Ptex:= Sprintf("(%o,%o)", mPX[1]/mPX[3], mPX[2]/mPX[3]);
else
Ptex:= "\\infty";
end if;
cm:="yes"; disc:= P[2];
printf "& & $%o$ & %o & $%o$ & \\\\ \n",
Ptex, cm, disc;
end for;
for P in non_cm_points do
PX:=X!P;
mPX:=Eltseq(m(PX));
if mPX[3] ne 0 then
Ptex:= Sprintf("(%o,%o)", mPX[1]/mPX[3], mPX[2]/mPX[3]);
else
Ptex:= "\\infty";
end if;
cm:="no"; disc := "";
printf "& & $%o$ & %o & %o & \\\\ \n",
Ptex, cm, disc;
end for;
print "\\multicolumn{6}{c}{} \\\\";
printf "\\multicolumn{6}{l}{%o} \\\\", Xtex;
print "\\multicolumn{6}{c}{} \\\\";
print " \\cline{1-5}";
end if;
end if;
end if;
end for;