-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathQQBar.tst
More file actions
95 lines (89 loc) · 1.45 KB
/
QQBar.tst
File metadata and controls
95 lines (89 loc) · 1.45 KB
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
87
88
89
90
91
92
93
94
95
#@local F, x, z, y, r, M
gap> START_TEST( "QQBar.tst" );
#
gap> F:= QQBarField;
QQBarField
gap> x:= One( F );
<{a1: 1.00000}>
gap> Print( x, "\n" );
<{a1: 1.00000}>
gap> String( x );
"<{a1: 1.00000}>"
gap> z:= Zero( F );
<{a1: 0}>
gap> Zero( x ) = z;
true
gap> z < x;
true
gap> x < z;
false
gap> x < x;
false
gap> z < 1;
true
gap> 0 < x;
true
gap> x = QQBarFieldElement( 1 );
true
gap> y:= x + x;;
gap> 2 * x = y;
true
gap> x * 2 = y;
true
gap> x - x = z;
true
gap> - x = z - x;
true
gap> x * x = x;
true
gap> r:= Sqrt( y );
<{a2: 1.41421}>
gap> r^2 = y;
true
gap> r^-1 = 1 / r;
true
gap> r^-1 = x / r;
true
gap> x = x / 1;
true
gap> AbsoluteValue( -r ) = r;
true
gap> r = QQBarFieldElement( Sqrt( 2 ) );
true
#
gap> Sqrt(-x) = QQBarFieldElement(E(4));
true
gap> Sqrt(-x) = x*E(4);
true
#
gap> M:= [ [ z, r ], [ r, z ] ];;
gap> Determinant( M ) = -2;
true
gap> MinimalPolynomial( M );
x_1^2+(<{a1: -2.00000}>)
gap> Eigenvalues( F, M );
[ <{a2: 1.41421}>, <{a2: -1.41421}> ]
gap> Display( M );
2x2 matrix over QQBarField:
. <{a2: 1.41421}>
<{a2: 1.41421}> .
gap> Display( M : short );
2x2 matrix over QQBarField:
. 1.41421
1.41421 .
#
gap> r:= Sqrt( QQBarFieldElement( 2 ) );;
gap> IsRealQQBarFieldElement( r );
true
gap> ComplexConjugate( r ) = r;
true
gap> r:= Sqrt( QQBarFieldElement( -2 ) );;
gap> IsRealQQBarFieldElement( r );
false
gap> ComplexConjugate( r ) = -r;
true
#
gap> Random( F ) in F;
true
#
gap> STOP_TEST( "QQBar.tst" );