Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563680 views
1
2
\Chapter{An example application}
3
4
In this section we outline two example computations with the functions
5
of the previous chapter. The first example uses number fields defined
6
by matrices and the second example considers number fields defined by
7
a polynomial.
8
9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
\Section{Number fields defined by matrices}
11
12
\beginexample
13
gap> m1 := [ [ 1, 0, 0, -7 ],
14
[ 7, 1, 0, -7 ],
15
[ 0, 7, 1, -7 ],
16
[ 0, 0, 7, -6 ] ];;
17
18
gap> m2 := [ [ 0, 0, -13, 14 ],
19
[ -1, 0, -13, 1 ],
20
[ 13, -1, -13, 1 ],
21
[ 0, 13, -14, 1 ] ];;
22
23
gap> F := FieldByMatricesNC( [m1, m2] );
24
<rational matrix field of unknown degree>
25
26
gap> DegreeOverPrimeField(F);
27
4
28
gap> PrimitiveElement(F);
29
[ [ -1, 1, 1, 0 ], [ -2, 0, 2, 1 ], [ -2, -1, 1, 2 ], [ -1, -1, 0, 1 ] ]
30
31
gap> Basis(F);
32
Basis( <rational matrix field of degree 4>,
33
[ [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ],
34
[ [ 0, 1, 0, 0 ], [ -1, 1, 1, 0 ], [ -1, 0, 1, 1 ], [ -1, 0, 0, 1 ] ],
35
[ [ 0, 0, 1, 0 ], [ -1, 0, 1, 1 ], [ -1, -1, 1, 1 ], [ 0, -1, 0, 1 ] ],
36
[ [ 0, 0, 0, 1 ], [ -1, 0, 0, 1 ], [ 0, -1, 0, 1 ], [ 0, 0, -1, 1 ] ] ] )
37
38
gap> MaximalOrderBasis(F);
39
Basis( <rational matrix field of degree 4>,
40
[ [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ],
41
[ [ -1, 1, 1, 0 ], [ -2, 0, 2, 1 ], [ -2, -1, 1, 2 ], [ -1, -1, 0, 1 ] ],
42
[ [ -3, -2, 2, 3 ], [ -3, -5, 0, 5 ], [ 0, -5, -3, 3 ], [ 2, -2, -3, 0 ] ],
43
[ [ -1, -1, 0, 1 ], [ 0, -2, -1, 1 ], [ 1, -1, -2, 0 ], [ 1, 0, -1, -1 ] ]
44
] )
45
46
gap> U := UnitGroup(F);
47
<matrix group with 2 generators>
48
49
gap> u := GeneratorsOfGroup( U );;
50
51
gap> nat := IsomorphismPcpGroup(U);;
52
gap> H := Image(nat);
53
Pcp-group with orders [ 10, 0 ]
54
gap> ImageElm( nat, u[1] );
55
g1
56
gap> ImageElm( nat, u[2] );
57
g2
58
gap> ImageElm( nat, u[1]*u[2] );
59
g1*g2
60
gap> u[1] = PreImagesRepresentative(nat, GeneratorsOfGroup(H)[1] );
61
true
62
\endexample
63
64
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65
\Section{Number fields defined by a polynomial}
66
67
\beginexample
68
gap> g := UnivariatePolynomial( Rationals, [ 16, 64, -28, -4, 1 ] );
69
x_1^4-4*x_1^3-28*x_1^2+64*x_1+16
70
71
gap> F := FieldByPolynomialNC(g);
72
<algebraic extension over the Rationals of degree 4>
73
gap> PrimitiveElement(F);
74
a
75
gap> MaximalOrderBasis(F);
76
Basis( <algebraic extension over the Rationals of degree 4>,
77
[ !1, 1/2*a, 1/4*a^2, 1/56*a^3+1/14*a^2+1/14*a-2/7 ] )
78
79
gap> U := UnitGroup(F);
80
<group with 4 generators>
81
82
gap> natU := IsomorphismPcpGroup(U);;
83
gap> elms := List( [1..10], x-> Random(F) );;
84
85
gap> PcpPresentationOfMultiplicativeSubgroup( F, elms );
86
Pcp-group with orders [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
87
88
gap> isom := IsomorphismPcpGroup( F, elms );;
89
gap> y := RandomGroupElement( elms );;
90
gap> z := ImageElm( isom, y );;
91
gap> y = PreImagesRepresentative( isom, z );
92
true
93
94
gap> FactorsPolynomialAlgExt( F, g );
95
[ x_1+(-a), x_1+(a-2), x_1+(-1/7*a^3+3/7*a^2+31/7*a-40/7),
96
x_1+(1/7*a^3-3/7*a^2-31/7*a+26/7) ]
97
\endexample
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