-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheichler.gp
87 lines (78 loc) · 2.55 KB
/
eichler.gp
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
/*Code from Aurel Page to compute prime power Eichler orders. In PARI/GP as of 2.18, around Nov 1 2024.*/
/* eichler.gp */
/*
This GP script implements Eichler orders over arbitrary central simple
algebras, in the following sense.
Let O be the order stored in an alginit structure A.
Let pr be a prime ideal of the base field F that is unramified in O and k an integer.
Let f: O/pr^k ---> M_d(ZF/pr^k) be an isomorphism.
Then eichlerprimepower(A,pr,k) computes a basis for a preimage by some f of the
set of matrices whose first column is 0 except the top entry:
[* * * * ]
[0 * * * ]
[0 * * * ]
[0 * * * ]
*/
algfromcenter(A,x) =
{
my(y);
y = vectorv(algdim(A,1));
y = algbasistoalg(A,y);
y[1] = nfbasistoalg(algcenter(A),x);
algalgtobasis(A,y); \\We need an easier way to embed the center!!!
};
algmodpr(A,pr) =
{
my(p,Ap,g,Q,pro,lif,map,mapi);
p = pr.p;
Ap = algtableinit(algmultable(A),p);
g = algfromcenter(A,pr.gen[2]);
g = algtomatrix(Ap,g);
g = matimagemod(g,p); \\ideal generated by pr.gen[2]
[Q,pro,lif] = algquotient(Ap,g,1);
[map,mapi] = algsplit(Q);
[map*pro,lif*mapi]
};
\\e in A such that e mod pr is an idempotent of maximal rank
eichleridempotent(A,pr) =
{
my(map,mapi,d,n,e);
[map, mapi] = algmodpr(A,pr);
d = algdegree(A);
n = pr.f;
e = vectorv(n*d^2);
for(i=1, d-1, e[1+n*(d+1)*i] = 1); \\We need an automatic conversion
\\ from matrices to vectors!!!
mapi*e
};
eichlerprimepower(A,pr,k) =
{
my(e,p,polidem = 3*x^2-2*x^3,B,N,Me,Mzk,nf,Mprk);
p = pr.p;
e = eichleridempotent(A,pr);
i = 1;
while(i<k,
e = algpoleval(A,polidem,e); \\Newton iteration
i *= 2;
e %= p^ceil(i/pr.e);
);
N = algdim(A,1);
B = Vec(matid(N));
Me = Mat(vector(N,i,algmul(A,B[i],e))); \\We need access to the right multiplication table!!!
nf = algcenter(A);
Mzk = Mat([algfromcenter(A,z) | z <- nf.zk]);
prk = idealtwoelt(nf,idealpow(nf,pr,k));
Mprk = algtomatrix(A,algfromcenter(A,prk[2]),1);
mathnfmodid(matconcat([Me,Mzk,Mprk]),prk[1])
};
/*Computes and returns the basis of an Eichler order of the given level in A. Over Q, the level can be an integer.*/
algeichlerbasis(A, lev) = {
my(nf, fact, lats, L);
nf = algcenter(A);
fact = idealfactor(nf, lev);
lats = vector(matsize(fact)[1], i, eichlerprimepower(A, fact[i, 1], fact[i, 2]));/*Prime power lattices.*/
if (#lats == 0, return(matid(#algbasis(A))));/*Level 1*/
L = alglathnf(A, lats[1]);
for (i = 2, #lats, L = alglatinter(A, L, alglathnf(A, lats[i])));/*Intersect them all.*/
return(L[1]);
}