CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

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

Views: 418346
1
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
2
<!-- %% -->
3
<!-- %W algvspc.tex GAP documentation Thomas Breuer -->
4
<!-- %% -->
5
<!-- %H @(#)<M>Id: algvspc.tex,v 4.22 2002/10/04 09:19:52 gap Exp </M> -->
6
<!-- %% -->
7
<!-- %Y Copyright (C) 1997, Lehrstuhl D für Mathematik, RWTH Aachen, Germany -->
8
<!-- %% -->
9
<Chapter Label="Vector Spaces and Algebras">
10
<Heading>Vector Spaces and Algebras</Heading>
11
12
This chapter contains an introduction into vector spaces and
13
algebras in &GAP;.
14
15
16
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
17
<Section Label="Vector Spaces">
18
<Heading>Vector Spaces</Heading>
19
<P/>
20
A <E>vector space</E> over the field <M>F</M> is an additive group
21
that is closed under scalar multiplication with elements in <M>F</M>.
22
In &GAP;, only those domains that are
23
constructed as vector spaces are regarded as vector spaces.
24
In particular, an additive group that does not know about an
25
acting domain of scalars is not regarded as a vector space in &GAP;.
26
<P/>
27
Probably the most common <M>F</M>-vector spaces in &GAP; are so-called
28
<E>row spaces</E>.
29
They consist of row vectors, that is, lists whose elements lie in <M>F</M>.
30
In the following example we compute the vector space spanned by the
31
row vectors <C>[ 1, 1, 1 ]</C> and <C>[ 1, 0, 2 ]</C> over the rationals.
32
<P/>
33
<Example><![CDATA[
34
gap> F:= Rationals;;
35
gap> V:= VectorSpace( F, [ [ 1, 1, 1 ], [ 1, 0, 2 ] ] );
36
<vector space over Rationals, with 2 generators>
37
gap> [ 2, 1, 3 ] in V;
38
true
39
]]></Example>
40
<P/>
41
The full row space <M>F^n</M> is created by commands like:
42
<P/>
43
<Example><![CDATA[
44
gap> F:= GF( 7 );;
45
gap> V:= F^3; # The full row space over F of dimension 3.
46
( GF(7)^3 )
47
gap> [ 1, 2, 3 ] * One( F ) in V;
48
true
49
]]></Example>
50
<P/>
51
In the same way we can also create matrix spaces. Here the short notation
52
<C><A>field</A>^[<A>dim1</A>,<A>dim2</A>]</C> can be used:
53
<P/>
54
<Example><![CDATA[
55
gap> m1:= [ [ 1, 2 ], [ 3, 4 ] ];; m2:= [ [ 0, 1 ], [ 1, 0 ] ];;
56
gap> V:= VectorSpace( Rationals, [ m1, m2 ] );
57
<vector space over Rationals, with 2 generators>
58
gap> m1+m2 in V;
59
true
60
gap> W:= Rationals^[3,2];
61
( Rationals^[ 3, 2 ] )
62
gap> [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ] ] in W;
63
true
64
]]></Example>
65
<P/>
66
A field is naturally a vector space over itself.
67
<P/>
68
<Example><![CDATA[
69
gap> IsVectorSpace( Rationals );
70
true
71
]]></Example>
72
<P/>
73
If <M>\Phi</M> is an algebraic extension of <M>F</M>, then <M>\Phi</M> is
74
also a vector space over <M>F</M>
75
(and indeed over any subfield of <M>\Phi</M> that contains <M>F</M>).
76
This field <M>F</M> is stored in the attribute
77
<Ref Func="LeftActingDomain" BookName="ref"/>.
78
In &GAP;, the default is to view fields as vector spaces
79
over their <E>prime</E> fields.
80
By the function <Ref Func="AsVectorSpace" BookName="ref"/>,
81
we can view fields as vector spaces over fields other than the prime field.
82
<P/>
83
<Example><![CDATA[
84
gap> F:= GF( 16 );;
85
gap> LeftActingDomain( F );
86
GF(2)
87
gap> G:= AsVectorSpace( GF( 4 ), F );
88
AsField( GF(2^2), GF(2^4) )
89
gap> F = G;
90
true
91
gap> LeftActingDomain( G );
92
GF(2^2)
93
]]></Example>
94
<P/>
95
A vector space has three important attributes:
96
its <E>field</E> of definition,
97
its <E>dimension</E> and a <E>basis</E>.
98
We already encountered the function
99
<Ref Func="LeftActingDomain" BookName="ref"/> in the example above.
100
It extracts the field of definition of a vector space.
101
The function <Ref Func="Dimension" BookName="ref"/> provides the dimension
102
of the vector space.
103
<P/>
104
<Example><![CDATA[
105
gap> F:= GF( 9 );;
106
gap> m:= [ [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, Z(3)^0 ] ];;
107
gap> V:= VectorSpace( F, m );
108
<vector space over GF(3^2), with 2 generators>
109
gap> Dimension( V );
110
2
111
gap> W:= AsVectorSpace( GF( 3 ), V );
112
<vector space over GF(3), with 4 generators>
113
gap> V = W;
114
true
115
gap> Dimension( W );
116
4
117
gap> LeftActingDomain( W );
118
GF(3)
119
]]></Example>
120
<P/>
121
One of the most important attributes is a <E>basis</E>.
122
For a given basis <M>B</M> of <M>V</M>,
123
every vector <M>v</M> in <M>V</M> can be expressed uniquely as
124
<M>v = \sum_{b \in B} c_b b</M>, with coefficients <M>c_b \in F</M>.
125
<P/>
126
In &GAP;, bases are special lists of vectors.
127
They are used mainly for the computation of coefficients and linear
128
combinations.
129
<P/>
130
Given a vector space <M>V</M>, a basis of <M>V</M> is obtained by
131
simply applying the function <Ref Func="Basis" BookName="ref"/> to <M>V</M>.
132
The vectors that form the basis are extracted from the basis by
133
<Ref Func="BasisVectors" BookName="ref"/>.
134
<P/>
135
<Example><![CDATA[
136
gap> m1:= [ [ 1, 2 ], [ 3, 4 ] ];; m2:= [ [ 1, 1 ], [ 1, 0 ] ];;
137
gap> V:= VectorSpace( Rationals, [ m1, m2 ] );
138
<vector space over Rationals, with 2 generators>
139
gap> B:= Basis( V );
140
SemiEchelonBasis( <vector space over Rationals, with
141
2 generators>, ... )
142
gap> BasisVectors( Basis( V ) );
143
[ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 0, 1 ], [ 2, 4 ] ] ]
144
]]></Example>
145
<P/>
146
The coefficients of
147
a vector relative to a given basis are found by the function
148
<Ref Func="Coefficients" BookName="ref"/>.
149
Furthermore, linear combinations of the basis vectors
150
are constructed using <Ref Func="LinearCombination" BookName="ref"/>.
151
<P/>
152
<Example><![CDATA[
153
gap> V:= VectorSpace( Rationals, [ [ 1, 2 ], [ 3, 4 ] ] );
154
<vector space over Rationals, with 2 generators>
155
gap> B:= Basis( V );
156
SemiEchelonBasis( <vector space over Rationals, with
157
2 generators>, ... )
158
gap> BasisVectors( Basis( V ) );
159
[ [ 1, 2 ], [ 0, 1 ] ]
160
gap> Coefficients( B, [ 1, 0 ] );
161
[ 1, -2 ]
162
gap> LinearCombination( B, [ 1, -2 ] );
163
[ 1, 0 ]
164
]]></Example>
165
<P/>
166
In the above examples we have seen that &GAP; often chooses the basis
167
it wants to work with. It is also possible to construct bases with
168
prescribed basis vectors by giving a list of these vectors as second argument
169
to <Ref Func="Basis" BookName="ref"/>.
170
<P/>
171
<Example><![CDATA[
172
gap> V:= VectorSpace( Rationals, [ [ 1, 2 ], [ 3, 4 ] ] );;
173
gap> B:= Basis( V, [ [ 1, 0 ], [ 0, 1 ] ] );
174
SemiEchelonBasis( <vector space over Rationals, with 2 generators>,
175
[ [ 1, 0 ], [ 0, 1 ] ] )
176
gap> Coefficients( B, [ 1, 2 ] );
177
[ 1, 2 ]
178
]]></Example>
179
<P/>
180
We can construct subspaces and quotient spaces of vector spaces. The
181
natural projection map (constructed by
182
<Ref Func="NaturalHomomorphismBySubspace" BookName="ref"/>),
183
connects a vector space with its quotient space.
184
<P/>
185
<Example><![CDATA[
186
gap> V:= Rationals^4;
187
( Rationals^4 )
188
gap> W:= Subspace( V, [ [ 1, 2, 3, 4 ], [ 0, 9, 8, 7 ] ] );
189
<vector space over Rationals, with 2 generators>
190
gap> VmodW:= V/W;
191
( Rationals^2 )
192
gap> h:= NaturalHomomorphismBySubspace( V, W );
193
<linear mapping by matrix, ( Rationals^4 ) -> ( Rationals^2 )>
194
gap> Image( h, [ 1, 2, 3, 4 ] );
195
[ 0, 0 ]
196
gap> PreImagesRepresentative( h, [ 1, 0 ] );
197
[ 1, 0, 0, 0 ]
198
]]></Example>
199
200
</Section>
201
202
203
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
204
<Section Label="Algebras">
205
<Heading>Algebras</Heading>
206
207
If a multiplication is defined for the elements of a vector space,
208
and if the vector space is closed under this multiplication then it is
209
called an <E>algebra</E>. For example, every field is an algebra:
210
<P/>
211
<Example><![CDATA[
212
gap> f:= GF(8); IsAlgebra( f );
213
GF(2^3)
214
true
215
]]></Example>
216
<P/>
217
One of the most important classes of algebras are sub-algebras of matrix
218
algebras. On the set of all <M>n \times n</M> matrices over a field <M>F</M>
219
it is possible to define a multiplication in many ways.
220
The most frequent are the ordinary matrix multiplication and the Lie
221
multiplication.
222
<P/>
223
Each matrix constructed as <M>[ <A>row1</A>, <A>row2</A>, \ldots ]</M>
224
is regarded by &GAP; as an <E>ordinary</E> matrix,
225
its multiplication is the ordinary associative matrix multiplication.
226
The sum and product of two ordinary matrices are again ordinary matrices.
227
<P/>
228
The <E>full</E> matrix associative algebra can be created as follows:
229
<P/>
230
<Example><![CDATA[
231
gap> F:= GF( 9 );;
232
gap> A:= F^[3,3];
233
( GF(3^2)^[ 3, 3 ] )
234
]]></Example>
235
<P/>
236
An algebra can be constructed from generators using the function
237
<Ref Func="Algebra" BookName="ref"/>.
238
It takes as arguments the field of coefficients and a list of generators.
239
Of course the coefficient field and the generators must fit together;
240
if we want to construct an algebra of ordinary matrices,
241
we may take the field generated by the entries of the generating matrices,
242
or a subfield or extension field.
243
<P/>
244
<Example><![CDATA[
245
gap> m1:= [ [ 1, 1 ], [ 0, 0 ] ];; m2:= [ [ 0, 0 ], [ 0, 1 ] ];;
246
gap> A:= Algebra( Rationals, [ m1, m2 ] );
247
<algebra over Rationals, with 2 generators>
248
]]></Example>
249
<P/>
250
An interesting class of algebras for which many special algorithms
251
are implemented is the class of <E>Lie algebras</E>.
252
They arise for example as algebras of matrices whose product is defined
253
by the Lie bracket <M>[ A, B ] = A * B - B * A</M>,
254
where <M>*</M> denotes the ordinary matrix product.
255
<P/>
256
Since the multiplication of objects in &GAP; is always assumed to be
257
the operation <C>*</C> (resp. the infix operator <C>*</C>),
258
and since there is already the <Q>ordinary</Q> matrix product defined for
259
ordinary matrices, as mentioned above,
260
we must use a different construction for matrices that occur as elements
261
of Lie algebras.
262
Such Lie matrices can be constructed by
263
<Ref Func="LieObject" BookName="ref"/> from ordinary matrices,
264
the sum and product of Lie matrices are again Lie matrices.
265
<P/>
266
<Example><![CDATA[
267
gap> m:= LieObject( [ [ 1, 1 ], [ 1, 1 ] ] );
268
LieObject( [ [ 1, 1 ], [ 1, 1 ] ] )
269
gap> m*m;
270
LieObject( [ [ 0, 0 ], [ 0, 0 ] ] )
271
gap> IsOrdinaryMatrix( m1 ); IsOrdinaryMatrix( m );
272
true
273
false
274
gap> IsLieMatrix( m1 ); IsLieMatrix( m );
275
false
276
true
277
]]></Example>
278
<P/>
279
Given a field <C>F</C> and a list <C>mats</C> of Lie objects over <C>F</C>,
280
we can construct the Lie algebra generated by <C>mats</C> using the function
281
<Ref Func="Algebra" BookName="ref"/>.
282
Alternatively, if we do not want to be bothered with the function
283
<Ref Func="LieObject" BookName="ref"/>,
284
we can use the function <Ref Func="LieAlgebra" BookName="ref"/>
285
that takes a field
286
and a list of ordinary matrices, and constructs the Lie algebra generated
287
by the corresponding Lie matrices.
288
Note that this means that the ordinary matrices used in the call of
289
<Ref Func="LieAlgebra" BookName="ref"/> are not contained in the returned
290
Lie algebra.
291
<P/>
292
<Example><![CDATA[
293
gap> m1:= [ [ 0, 1 ], [ 0, 0 ] ];;
294
gap> m2:= [ [ 0, 0 ], [ 1, 0 ] ];;
295
gap> L:= LieAlgebra( Rationals, [ m1, m2 ] );
296
<Lie algebra over Rationals, with 2 generators>
297
gap> m1 in L;
298
false
299
]]></Example>
300
<P/>
301
A second way of creating an algebra is by specifying a multiplication table.
302
Let <M>A</M> be a finite dimensional algebra with basis
303
<M>(x_1, x_2, \ldots, x_n)</M>,
304
then for <M>1 \leq i, j \leq n</M> the product <M>x_i x_j</M> is
305
a linear combination of basis elements, i.e., there are <M>c_{ij}^k</M> in the
306
ground field such that
307
<M>x_i x_j = \sum_{k=1}^n c_{ij}^k x_k.</M>
308
It is not difficult to show that the constants <M>c_{ij}^k</M>
309
determine the multiplication completely. Therefore, the <M>c_{ij}^k</M> are
310
called <E>structure constants</E>. In &GAP; we can create a finite dimensional
311
algebra by specifying an array of structure constants.
312
<P/>
313
In &GAP; such a table of structure constants is represented using
314
lists. The obvious way to do this
315
would be to construct a <Q>three-dimensional</Q> list <C>T</C> such that
316
<C>T[i][j][k]</C> equals <M>c_{ij}^k</M>.
317
But it often happens that many of these constants vanish.
318
Therefore a more complicated structure is used in order to be able to
319
omit the zeros.
320
A multiplication table of an <M>n</M>-dimensional algebra is an
321
<M>n \times n</M> array <C>T</C> such that <C>T[i][j]</C> describes the product
322
of the <C>i</C>-th and the <C>j</C>-th basis element. This product is encoded
323
in the following way. The entry <C>T[i][j]</C> is a list of two elements.
324
The first of these is a list of
325
indices <M>k</M> such that <M>c_{ij}^k</M> is nonzero.
326
The second list contains the corresponding constants <M>c_{ij}^k</M>.
327
Suppose, for example, that <C>S</C> is the table
328
of an algebra with basis <M>(x_1, x_2, \ldots, x_8)</M> and that <C>S[3][7]</C>
329
equals <C>[ [ 2, 4, 6 ], [ 1/2, 2, 2/3 ] ]</C>.
330
Then in the algebra we have the relation
331
<M>x_3 x_7 = (1/2) x_2 + 2 x_4 + (2/3) x_6.</M>
332
Furthermore, if <C>S[6][1] = [ [ ], [ ] ]</C> then the product of the
333
sixth and first basis elements is zero.
334
<P/>
335
Finally two numbers are added to the table. The first number can be
336
1, -1, or 0. If it is 1, then the table is known to be symmetric,
337
i.e., <M>c_{ij}^k = c_{ji}^k</M>. If this number is -1, then the table is
338
known to be antisymmetric (this happens for instance when the algebra
339
is a Lie algebra).
340
The remaining case, 0, occurs in all other cases.
341
The second number that is added is the zero element of the field over
342
which the algebra is defined.
343
<P/>
344
Empty structure constants tables are created by the function
345
<Ref Func="EmptySCTable" BookName="ref"/>, which takes a dimension <M>d</M>,
346
a zero element <M>z</M>,
347
and optionally one of the strings <C>"symmetric"</C>, <C>"antisymmetric"</C>,
348
and returns an empty structure constants table <M>T</M> corresponding to
349
a <M>d</M>-dimensional algebra over a field with zero element <M>z</M>.
350
Structure constants can be entered into the table <M>T</M> using the function
351
<Ref Func="SetEntrySCTable" BookName="ref"/>.
352
It takes four arguments, namely <M>T</M>, two indices <M>i</M> and <M>j</M>,
353
and a list of the form
354
<M>[ c_{ij}^{{k_1}}, k_1, c_{ij}^{{k_2}}, k_2, \ldots ]</M>.
355
In this call to <C>SetEntrySCTable</C>,
356
the product of the <M>i</M>-th and the <M>j</M>-th basis vector
357
in any algebra described by <M>T</M> is set to
358
<M>\sum_l c_{ij}^{{k_l}} x_{{k_l}}</M>.
359
(Note that in the empty table, this product was zero.)
360
If <M>T</M> knows that it is (anti)symmetric, then at the same time also
361
the product of the <M>j</M>-th and the <M>i</M>-th basis vector is set
362
appropriately.
363
<P/>
364
In the following example we temporarily increase the line length limit from
365
its default value 80 to 82 in order to make the long output expression fit
366
into one line.
367
<P/>
368
<Example><![CDATA[
369
gap> T:= EmptySCTable( 2, 0, "symmetric" );
370
[ [ [ [ ], [ ] ], [ [ ], [ ] ] ],
371
[ [ [ ], [ ] ], [ [ ], [ ] ] ], 1, 0 ]
372
gap> SetEntrySCTable( T, 1, 2, [1/2,1,1/3,2] ); T;
373
[ [ [ [ ], [ ] ], [ [ 1, 2 ], [ 1/2, 1/3 ] ] ],
374
[ [ [ 1, 2 ], [ 1/2, 1/3 ] ], [ [ ], [ ] ] ], 1, 0 ]
375
]]></Example>
376
<P/>
377
If we have defined a structure constants table, then we can construct
378
the corresponding algebra by
379
<Ref Func="AlgebraByStructureConstants" BookName="ref"/>.
380
<P/>
381
<Example><![CDATA[
382
gap> A:= AlgebraByStructureConstants( Rationals, T );
383
<algebra of dimension 2 over Rationals>
384
]]></Example>
385
<P/>
386
If we know that a structure constants table defines a Lie algebra,
387
then we can construct the corresponding Lie algebra by
388
<Ref Func="LieAlgebraByStructureConstants" BookName="ref"/>;
389
the algebra returned by this function knows that it is a Lie algebra,
390
so &GAP; need not check the Jacobi identity.
391
<P/>
392
<Example><![CDATA[
393
gap> T:= EmptySCTable( 2, 0, "antisymmetric" );;
394
gap> SetEntrySCTable( T, 1, 2, [2/3,1] );
395
gap> L:= LieAlgebraByStructureConstants( Rationals, T );
396
<Lie algebra of dimension 2 over Rationals>
397
]]></Example>
398
<P/>
399
In &GAP; an algebra is naturally a vector space. Hence all the functionality
400
for vector spaces is also available for algebras.
401
<P/>
402
<Example><![CDATA[
403
gap> F:= GF(2);;
404
gap> z:= Zero( F );; o:= One( F );;
405
gap> T:= EmptySCTable( 3, z, "antisymmetric" );;
406
gap> SetEntrySCTable( T, 1, 2, [ o, 1, o, 3 ] );
407
gap> SetEntrySCTable( T, 1, 3, [ o, 1 ] );
408
gap> SetEntrySCTable( T, 2, 3, [ o, 3 ] );
409
gap> A:= AlgebraByStructureConstants( F, T );
410
<algebra of dimension 3 over GF(2)>
411
gap> Dimension( A );
412
3
413
gap> LeftActingDomain( A );
414
GF(2)
415
gap> Basis( A );
416
CanonicalBasis( <algebra of dimension 3 over GF(2)> )
417
]]></Example>
418
<P/>
419
Subalgebras and ideals of an algebra can be constructed by specifying
420
a set of generators for the subalgebra or ideal. The quotient space
421
of an algebra by an ideal is naturally an algebra itself.
422
<P/>
423
In the following example we temporarily increase the line length limit from
424
its default value 80 to 81 in order to make the long output expression fit
425
into one line.
426
<P/>
427
<Example><![CDATA[
428
gap> m:= [ [ 1, 2, 3 ], [ 0, 1, 6 ], [ 0, 0, 1 ] ];;
429
gap> A:= Algebra( Rationals, [ m ] );;
430
gap> subA:= Subalgebra( A, [ m-m^2 ] );
431
<algebra over Rationals, with 1 generators>
432
gap> Dimension( subA );
433
2
434
gap> idA:= Ideal( A, [ m-m^3 ] );
435
<two-sided ideal in <algebra of dimension 3 over Rationals>,
436
(1 generators)>
437
gap> Dimension( idA );
438
2
439
gap> B:= A/idA;
440
<algebra of dimension 1 over Rationals>
441
]]></Example>
442
<P/>
443
The call <C>B:= A/idA</C> creates a new algebra that does not <Q>know</Q> about
444
its connection with <C>A</C>. If we want to connect an algebra with its factor
445
via a homomorphism, then we first have to create the homomorphism
446
(<Ref Func="NaturalHomomorphismByIdeal" BookName="ref"/>).
447
After this we create the factor algebra from the homomorphism by
448
the function <Ref Func="ImagesSource" BookName="ref"/>. In the next example
449
we divide an algebra <C>A</C> by its radical and lift the central idempotents
450
of the factor to the original algebra <C>A</C>.
451
<P/>
452
<Example><![CDATA[
453
gap> m1:=[[1,0,0],[0,2,0],[0,0,3]];;
454
gap> m2:=[[0,1,0],[0,0,2],[0,0,0]];;
455
gap> A:= Algebra( Rationals, [ m1, m2 ] );;
456
gap> Dimension( A );
457
6
458
gap> R:= RadicalOfAlgebra( A );
459
<algebra of dimension 3 over Rationals>
460
gap> h:= NaturalHomomorphismByIdeal( A, R );
461
<linear mapping by matrix, <algebra of dimension
462
6 over Rationals> -> <algebra of dimension 3 over Rationals>>
463
gap> AmodR:= ImagesSource( h );
464
<algebra of dimension 3 over Rationals>
465
gap> id:= CentralIdempotentsOfAlgebra( AmodR );
466
[ v.3, v.2+(-3)*v.3, v.1+(-2)*v.2+(3)*v.3 ]
467
gap> PreImagesRepresentative( h, id[1] );
468
[ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 1 ] ]
469
gap> PreImagesRepresentative( h, id[2] );
470
[ [ 0, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 0 ] ]
471
gap> PreImagesRepresentative( h, id[3] );
472
[ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
473
]]></Example>
474
<P/>
475
Structure constants tables for the simple Lie algebras are present in &GAP;.
476
They can be constructed using the function
477
<Ref Func="SimpleLieAlgebra" BookName="ref"/>. The Lie
478
algebras constructed by this function come with a root system attached.
479
<P/>
480
<Example><![CDATA[
481
gap> L:= SimpleLieAlgebra( "G", 2, Rationals );
482
<Lie algebra of dimension 14 over Rationals>
483
gap> R:= RootSystem( L );
484
<root system of rank 2>
485
gap> PositiveRoots( R );
486
[ [ 2, -1 ], [ -3, 2 ], [ -1, 1 ], [ 1, 0 ], [ 3, -1 ], [ 0, 1 ] ]
487
gap> CartanMatrix( R );
488
[ [ 2, -1 ], [ -3, 2 ] ]
489
]]></Example>
490
<P/>
491
Another example of algebras is provided by <E>quaternion algebras</E>.
492
We define a quaternion algebra over an extension field of the
493
rationals, namely the field generated by <M>\sqrt{{5}}</M>.
494
(The number <C>EB(5)</C> is equal to <M>1/2 (-1+\sqrt{{5}})</M>.
495
The field is printed as <C>NF(5,[ 1, 4 ])</C>.)
496
<P/>
497
<Example><![CDATA[
498
gap> b5:= EB(5);
499
E(5)+E(5)^4
500
gap> q:= QuaternionAlgebra( FieldByGenerators( [ b5 ] ) );
501
<algebra-with-one of dimension 4 over NF(5,[ 1, 4 ])>
502
gap> gens:= GeneratorsOfAlgebra( q );
503
[ e, i, j, k ]
504
gap> e:= gens[1];; i:= gens[2];; j:= gens[3];; k:= gens[4];;
505
gap> IsAssociative( q );
506
true
507
gap> IsCommutative( q );
508
false
509
gap> i*j; j*i;
510
k
511
(-1)*k
512
gap> One( q );
513
e
514
]]></Example>
515
<P/>
516
If the coefficient field is a real subfield of the complex numbers
517
then the quaternion algebra is in fact a division ring.
518
<P/>
519
<Example><![CDATA[
520
gap> IsDivisionRing( q );
521
true
522
gap> Inverse( e+i+j );
523
(1/3)*e+(-1/3)*i+(-1/3)*j
524
]]></Example>
525
<P/>
526
So &GAP; knows about this fact.
527
As in any ring, we can look at groups of units.
528
(The function <Ref Func="StarCyc" BookName="ref"/> used below computes
529
the unique algebraic
530
conjugate of an element in a quadratic subfield of a cyclotomic field.)
531
<P/>
532
<Example><![CDATA[
533
gap> c5:= StarCyc( b5 );
534
E(5)^2+E(5)^3
535
gap> g1:= 1/2*( b5*e + i - c5*j );
536
(1/2*E(5)+1/2*E(5)^4)*e+(1/2)*i+(-1/2*E(5)^2-1/2*E(5)^3)*j
537
gap> Order( g1 );
538
5
539
gap> g2:= 1/2*( -c5*e + i + b5*k );
540
(-1/2*E(5)^2-1/2*E(5)^3)*e+(1/2)*i+(1/2*E(5)+1/2*E(5)^4)*k
541
gap> Order( g2 );
542
10
543
gap> g:=Group( g1, g2 );;
544
#I default `IsGeneratorsOfMagmaWithInverses' method returns `true' for
545
[ (1/2*E(5)+1/2*E(5)^4)*e+(1/2)*i+(-1/2*E(5)^2-1/2*E(5)^3)*j,
546
(-1/2*E(5)^2-1/2*E(5)^3)*e+(1/2)*i+(1/2*E(5)+1/2*E(5)^4)*k ]
547
gap> Size( g );
548
120
549
gap> IsPerfect( g );
550
true
551
]]></Example>
552
<P/>
553
Since there is only one perfect group of order 120, up to isomorphism,
554
we see that the group <C>g</C> is isomorphic to <M>SL_2(5)</M>.
555
As usual, a permutation representation of the group can be constructed
556
using a suitable action of the group.
557
<P/>
558
<Example><![CDATA[
559
gap> cos:= RightCosets( g, Subgroup( g, [ g1 ] ) );;
560
gap> Length( cos );
561
24
562
gap> hom:= ActionHomomorphism( g, cos, OnRight );;
563
gap> im:= Image( hom );
564
Group([ (2,3,5,9,15)(4,7,12,8,14)(10,17,23,20,24)(11,19,22,16,13),
565
(1,2,4,8,3,6,11,20,17,19)(5,10,18,7,13,22,12,21,24,15)(9,16)(14,23) ])
566
gap> Size( im );
567
120
568
]]></Example>
569
<P/>
570
To get a matrix representation of <C>g</C> or of the whole algebra <C>q</C>,
571
we must specify a basis of the vector space on which the algebra acts,
572
and compute the linear action of elements w.r.t. this basis.
573
<P/>
574
<Example><![CDATA[
575
gap> bas:= CanonicalBasis( q );;
576
gap> BasisVectors( bas );
577
[ e, i, j, k ]
578
gap> op:= OperationAlgebraHomomorphism( q, bas, OnRight );
579
<op. hom. AlgebraWithOne( NF(5,[ 1, 4 ]),
580
[ e, i, j, k ] ) -> matrices of dim. 4>
581
gap> ImagesRepresentative( op, e );
582
[ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]
583
gap> ImagesRepresentative( op, i );
584
[ [ 0, 1, 0, 0 ], [ -1, 0, 0, 0 ], [ 0, 0, 0, -1 ], [ 0, 0, 1, 0 ] ]
585
gap> ImagesRepresentative( op, g1 );
586
[ [ 1/2*E(5)+1/2*E(5)^4, 1/2, -1/2*E(5)^2-1/2*E(5)^3, 0 ],
587
[ -1/2, 1/2*E(5)+1/2*E(5)^4, 0, -1/2*E(5)^2-1/2*E(5)^3 ],
588
[ 1/2*E(5)^2+1/2*E(5)^3, 0, 1/2*E(5)+1/2*E(5)^4, -1/2 ],
589
[ 0, 1/2*E(5)^2+1/2*E(5)^3, 1/2, 1/2*E(5)+1/2*E(5)^4 ] ]
590
]]></Example>
591
592
</Section>
593
594
595
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
596
<Section Label="Further Information about Vector Spaces and Algebras">
597
<Heading>Further Information about Vector Spaces and Algebras</Heading>
598
599
More information about vector spaces can be found in
600
Chapter&nbsp;<Ref Chap="Vector Spaces" BookName="ref"/>.
601
Chapter&nbsp;<Ref Chap="Algebras" BookName="ref"/> deals with the
602
functionality for general algebras.
603
Furthermore, concerning special functions for Lie algebras,
604
there is Chapter&nbsp;<Ref Chap="Lie Algebras" BookName="ref"/>.
605
606
</Section>
607
</Chapter>
608
609
610
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
611
<!-- %% -->
612
<!-- %E -->
613
614
615