CoCalc Shared Fileswww / gross / lattice-aug16-01.m
Author: William A. Stein
1R<y> := PolynomialRing(RationalField());
2f := y^5 - 5*y^3 + 4*y -1;
3print "f has discriminant", Discriminant(f);
4
5RR := PolynomialRing(RealField());
6roots := [r[1] : r in Roots(RR!f)];
7print "roots = ", roots;
8
9K<a> := NumberField(f);   // a is image of y in K.
10A := MaximalOrder(K);
11"h_A = ", ClassNumber(A);
12function EmbeddingSigns(z)
13   h := RR!Eltseq(K!z);
14   return [Sign(Evaluate(h, roots[i])) : i in [1..#roots]];
15end function;
16
17d := (a^4 -4*a^2 + 1)/(5*a^4 - 15*a^2 + 4);
18dprime := d/(a+2);
19
20print "\nEmbeddingSigns(d) =", EmbeddingSigns(d);
21print "EmbeddingSigns(dprime) =", EmbeddingSigns(dprime);
22
23print "\nNorm(d) =",Norm(d);
24print "Norm(dprime) =",Norm(dprime);
25print "Norm(1/f'(y)) =", Norm(1/Evaluate(Derivative(f),a));
26
27B_d := MatrixAlgebra(Integers(),5)!
28             [Trace(d*A.r*A.c) : r in [1..5], c in [1..5]];
29
30B_dprime := MatrixAlgebra(Integers(),5)!
31             [Trace(dprime*A.r*A.c) : r in [1..5], c in [1..5]];
32
33print "\nB_d =", B_d;
34print "B_dprime =", B_dprime;
35print "\nDeterminant(B_d) =", Determinant(B_d);
36print "Determinant(B_dprime) =", Determinant(B_dprime);
37
38L_d := LatticeWithGram(B_d);
39L_dprime := LatticeWithGram(B_dprime);
40
41short_d := [v[1] : v in ShortVectors(L_d,1)];
42short_dprime := [v[1] : v in ShortVectors(L_dprime,1)];
43
44print "\nThe length 1 vectors for L_d up to sign, are:", short_d;
45print "\nThe length 1 vectors for L_dprime up to sign, are:", short_dprime;
46
47print "\nThe inner-product matrix of the short vectors with respect";
48print "to the first form <m,m'> = Tr(dmm') is:";
49
50C := MatrixAlgebra(Rationals(),5)!
51          [InnerProduct(short_d[r], L_d!Eltseq(short_dprime[c])) :
52                          r in [1..5], c in [1..5]];
53
54print "Short product matrix:", C;
55print "which has determinant", Determinant(C);
56
57