forked from stmar89/AbVarFq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelescope_workshop_sorting_demo.txt
78 lines (60 loc) · 2.27 KB
/
telescope_workshop_sorting_demo.txt
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
//GetCurrentDirectory()
//ChangeDirectory("C:/Users/tdupuy/Dropbox/computing/AbVarFq");
AttachSpec("packages.spec"); //graph_builder needs to be added here
print "To run the code we need to instantiate some things...";
P<x>:=PolynomialRing(Integers());
//f:=x^6-3*x^4-4*x^4-15*x^2+125; not a good choice since there is only one order
//f:=1*x^6-6*x^5+18*x^4-41*x^3+90*x^2-150*x + 125; only has two orders
f:=x^6 - 3*x^4 - 4*x^3 - 15*x^2 + 125;
//is_ordinary:=IsOrdinary(f);
is_weil, q := IsWeil(f);
K:=AssociativeAlgebra(f);
g := Degree(f)/2;
F:= PrimitiveElement(K);
V:= q/F;
R:= Order([F,q/F]);
OK:= MaximalOrder(R);
k := 2*g;
k := (Integers() ! k); //coerce g to be an integer
//MatZ := MatrixAlgebra(Integers(), k);
//MatQ := MatrixAlgebra(Rationals(),k);
//This is the basis that we are using for the LMFDB
std_beta := Reverse([V^i : i in [0..g-1]]) cat [F^i : i in [1..g] ];
//lmfdb-basis as power basis
chg_of_basis:=Transpose(Matrix(std_beta)); //lmfdb-basis to power-basis
//chg_of_basis:= (MatQ ! chg_of_basis); //coerce into an integer matrix
inverse_chg_of_basis:=chg_of_basis^-1;
load "graph_builder.m"; //Attaching packages needs intrinsics?
print "Computing orders...";
ordersR :=FindOverOrders(R);
print "There are ";
print #ordersR;
print "Sorting orders...";
sordersR := Sort(ordersR, CompareOrders);
//Describes the permutation of the orders according to our sorts
permutation:= [Position(sordersR, O) : O in ordersR];
print permutation;
//There is also functionality for comparing lattices
print "Computing ideal class monoid of Frobenius order...";
icmR := ICM(R);
print "Completed computation...";
print "Number of classes:";
print #icmR;
print "Selecting 5th order in output for our example...";
I5 := icmR[5];
print "computing its endomorphism algebra...";
O5:=MultiplicatorRing(I5);
print "output looks like this: ";
print O5;
print "Using our sorting algortihm to determine its position";
order_label_5:=Position(sordersR,O5);
print order_label_5;
print "it has index: ";
print Index(OK,O5);
print "There is also functionality for comparing lattices...";
print "The second lattice in Stefano's output is...";
I2 := icmR[2];
print I2;
print "Given these specific fractional ideals we can compare them:";
print "Comparison output CompareLattices(I5,I2)";
print CompareLattices(I5,I2);