CoCalc Public Fileswww / tables / magma_src / ModFrm / misc.mOpen with one click!
Author: William A. Stein
1
freeze;
2
3
/****-*-magma-* EXPORT DATE: 2004-03-08 ************************************
4
5
MODFORM: Modular Forms in MAGMA
6
7
William A. Stein
8
9
FILE: misc.m
10
11
$Header: /home/was/magma/packages/modform/code/RCS/misc.m,v 1.1 2001/05/30 18:55:42 was Exp $
12
13
$Log: misc.m,v $
14
Revision 1.1 2001/05/30 18:55:42 was
15
Initial revision
16
17
18
***************************************************************************/
19
20
21
function MinimalLiftOfCharacter(e)
22
// A pair eps, phi, where eps is a minimal lift of e to characteristic 0
23
// and phi is a homomorphism from BaseRing(eps) to BaseRing(e), that is
24
// defined on a subset of the domain.
25
26
assert Type(e) eq GrpDrchElt;
27
R := BaseRing(Parent(e));
28
29
if Type(R) in {FldCyc, FldRat} then
30
return e, map<R->R | x :-> x>;
31
end if;
32
33
G := Parent(e);
34
u, r := DistinguishedRoot(G);
35
d := Order(e);
36
if d eq 1 then
37
K := RationalField();
38
z := K!1;
39
phi := hom<K -> R | a :-> R!a>;
40
elif d eq 2 then
41
K := RationalField();
42
z := K!(-1);
43
phi := hom<K -> R | a :-> R!a>;
44
else
45
K<z> := CyclotomicField(d);
46
phi := hom<K -> R | u^(r div d) >;
47
end if;
48
H := DirichletGroup(Modulus(G),K,z,d);
49
v := Eltseq(e);
50
g := GCD(v);
51
assert r mod d eq 0;
52
eps := H![Integers()|a div (r div d) : a in v];
53
return eps, phi;
54
end function;
55
56
57
function EchelonPolySequence(P, prec)
58
// Put the sequence of poly's in Echelon form.
59
if #P eq 0 then
60
return P;
61
end if;
62
R := Parent(P[1]);
63
mat := RMatrixSpace(BaseRing(R),#P,prec);
64
A := mat!&cat[[Coefficient(f,i) : i in [0..prec-1]] : f in P];
65
E := EchelonForm(A);
66
return [&+[E[j][i+1]*R.1^i : i in [0..prec-1]] : j in [1..#P] | E[j] ne 0];
67
end function;
68
69
function EchelonPowerSeriesSequence(P)
70
if #P eq 0 then
71
return P;
72
end if;
73
R<q> := Parent(P[1]);
74
prec := Min([AbsolutePrecision(f) : f in P]);
75
E := EchelonPolySequence(P,prec);
76
return [f + O(q^prec) : f in E];
77
end function;
78
79
function CoercePowerSeries(f, phi, q)
80
assert Type(f) eq RngSerPowElt;
81
assert Type(phi) eq Map;
82
assert Type(q) eq RngSerPowElt;
83
prec := AbsolutePrecision(f);
84
return &+[phi(Coefficient(f,n))*q^n : n in [0..prec-1]] + O(q^prec);
85
end function;
86
87
function MakeLattice(B)
88
Mat := RMatrixSpace(Rationals(),#B, #Eltseq(B[1]));
89
X := Mat!B;
90
if Dimension(RowSpace(X)) eq 0 then
91
return RowSpace(X);
92
end if;
93
return Lattice(X);
94
end function;
95
96
function Saturate(B)
97
t := Cputime();
98
if Type(B[1]) eq SeqEnum then
99
V := RSpace(Rationals(), #B[1]);
100
B := [V|b : b in B];
101
end if;
102
L := MakeLattice(B);
103
S := PureLattice(L);
104
return S;
105
end function;
106
107
function SaturatePowerSeriesSequence(P)
108
// Returns generators for the saturation of the Z-module generated
109
// by the sequence of q-expansions.
110
if #P eq 0 then
111
return P;
112
end if;
113
R := Parent(P[1]);
114
prec := Min([AbsolutePrecision(f) : f in P]);
115
X := [[Integers()!Coefficient(f,i) : i in [0..prec-1]] : f in P];
116
S := Saturate(X);
117
S := sub<RSpace(Integers(),Degree(S)) | [Eltseq(b) : b in Basis(S)]>;
118
return [&+[Integers()!(v[i])*R.1^(i-1) :
119
i in [1..prec]] + O(R.1^prec): v in Basis(S)];
120
end function;
121
122
123
124
125
ALPHABET := {@ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
126
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" @};
127
alphabet := {@ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
128
"m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" @};
129
function IsogenyCodeToInteger(s)
130
// Returns the number n so that s = ToIsogenyCode(n).
131
return 26*(#s-1)+Index(ALPHABET,s[1])+Index(alphabet,s[1]);
132
end function;
133
134
function ToIsogenyCode(n)
135
// Returns the n-th isogeny coding. The coding goes A,B,C,...,Z,AA,BB,...
136
if n eq 0 then return "?"; end if;
137
return &cat[ALPHABET[((n-1)mod 26)+1]: i in [0..((n-1) div 26)]];
138
end function;
139
140
function ToLowerCaseLetter(n)
141
// Returns the n-th isogeny coding. The coding goes a,b,c,...,z,aa,bb,...
142
if n eq 0 then return "?"; end if;
143
return &cat[alphabet[((n-1)mod 26)+1]: i in [0..((n-1) div 26)]];
144
end function;
145
146
147
intrinsic mfdevel(fun::MonStgElt, mesg::MonStgElt)
148
{}
149
vprintf ModularForms,2 : "\t(mfdevel: in %o -- %o)\n", fun, mesg;
150
end intrinsic;
151
152
153