Debian Codegraph @

doc/tut/chap6.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
7 <head>
8 <title>GAP (tut) - Chapter 6: Vector Spaces and Algebras</title>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
10 <meta name="generator" content="GAPDoc2HTML" />
11 <link rel="stylesheet" type="text/css" href="manual.css" />
12 <script src="manual.js" type="text/javascript"></script>
13 <script type="text/javascript">overwriteStyle();</script>
14 </head>
15 <body class="chap6" onload="jscontent()">
16
17
18 <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
19
20 <div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap5.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap7.html">[Next Chapter]</a>&nbsp; </div>
21
22 <p id="mathjaxlink" class="pcenter"><a href="chap6_mj.html">[MathJax on]</a></p>
23 <p><a id="X853484B982F1DF96" name="X853484B982F1DF96"></a></p>
24 <div class="ChapSects"><a href="chap6.html#X853484B982F1DF96">6 <span class="Heading">Vector Spaces and Algebras</span></a>
25 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap6.html#X7DAD6700787EC845">6.1 <span class="Heading">Vector Spaces</span></a>
26 </span>
27 </div>
28 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap6.html#X7DDBF6F47A2E021C">6.2 <span class="Heading">Algebras</span></a>
29 </span>
30 </div>
31 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap6.html#X843A8D6F7A7592B5">6.3 <span class="Heading">Further Information about Vector Spaces and Algebras</span></a>
32 </span>
33 </div>
34 </div>
35
36 <h3>6 <span class="Heading">Vector Spaces and Algebras</span></h3>
37
38 <p>This chapter contains an introduction into vector spaces and algebras in <strong class="pkg">GAP</strong>.</p>
39
40 <p><a id="X7DAD6700787EC845" name="X7DAD6700787EC845"></a></p>
41
42 <h4>6.1 <span class="Heading">Vector Spaces</span></h4>
43
44 <p>A <em>vector space</em> <span class="SimpleMath">V</span> over a field <span class="SimpleMath">F</span> is an (abelian) additive group that is closed under scalar multiplication by elements in <span class="SimpleMath">F</span>, such that</p>
45
46 <ol>
47 <li><p><span class="SimpleMath">1v=v</span>,</p>
48
49 </li>
50 <li><p><span class="SimpleMath">a(bv)=(ab)v</span>,</p>
51
52 </li>
53 <li><p><span class="SimpleMath">a(v+w)=av+aw</span>, and</p>
54
55 </li>
56 <li><p><span class="SimpleMath">(a+b)v=av+bv</span>,</p>
57
58 </li>
59 </ol>
60 <p>for all <span class="SimpleMath">a,b ∈ F</span> and all <span class="SimpleMath">v,w ∈ V</span>. In <strong class="pkg">GAP</strong>, only those domains that are constructed as vector spaces are regarded as vector spaces. In particular, an additive group that does not know about an acting domain of scalars is not regarded as a vector space in <strong class="pkg">GAP</strong>.</p>
61
62 <p>Probably the most common <span class="SimpleMath">F</span>-vector spaces in <strong class="pkg">GAP</strong> are so-called <em>row spaces</em>. They consist of row vectors, that is, lists whose elements lie in <span class="SimpleMath">F</span>. In the following example we compute the vector space spanned by the row vectors <code class="code">[ 1, 1, 1 ]</code> and <code class="code">[ 1, 0, 2 ]</code> over the rationals.</p>
63
64
65 <div class="example"><pre>
66 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= Rationals;;</span>
67 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( F, [ [ 1, 1, 1 ], [ 1, 0, 2 ] ] );</span>
68 &lt;vector space over Rationals, with 2 generators&gt;
69 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">[ 2, 1, 3 ] in V;</span>
70 true
71 </pre></div>
72
73 <p>The full row space <span class="SimpleMath">F^n</span> is created by commands like:</p>
74
75
76 <div class="example"><pre>
77 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= GF( 7 );;</span>
78 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= F^3; # The full row space over F of dimension 3.</span>
79 ( GF(7)^3 )
80 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">[ 1, 2, 3 ] * One( F ) in V;</span>
81 true
82 </pre></div>
83
84 <p>In the same way we can also create matrix spaces. Here the short notation <code class="code"><var class="Arg">field</var>^[<var class="Arg">dim1</var>,<var class="Arg">dim2</var>]</code> can be used:</p>
85
86
87 <div class="example"><pre>
88 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= [ [ 1, 2 ], [ 3, 4 ] ];; m2:= [ [ 0, 1 ], [ 1, 0 ] ];;</span>
89 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ m1, m2 ] );</span>
90 &lt;vector space over Rationals, with 2 generators&gt;
91 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1+m2 in V;</span>
92 true
93 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= Rationals^[3,2];</span>
94 ( Rationals^[ 3, 2 ] )
95 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">[ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ] ] in W;</span>
96 true
97 </pre></div>
98
99 <p>A field is naturally a vector space over itself.</p>
100
101
102 <div class="example"><pre>
103 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsVectorSpace( Rationals );</span>
104 true
105 </pre></div>
106
107 <p>If <span class="SimpleMath">Φ</span> is an algebraic extension of <span class="SimpleMath">F</span>, then <span class="SimpleMath">Φ</span> is also a vector space over <span class="SimpleMath">F</span> (and indeed over any subfield of <span class="SimpleMath">Φ</span> that contains <span class="SimpleMath">F</span>). This field <span class="SimpleMath">F</span> is stored in the attribute <code class="func">LeftActingDomain</code> (<span class="RefLink">Reference: LeftActingDomain</span>). In <strong class="pkg">GAP</strong>, the default is to view fields as vector spaces over their <em>prime</em> fields. By the function <code class="func">AsVectorSpace</code> (<span class="RefLink">Reference: AsVectorSpace</span>), we can view fields as vector spaces over fields other than the prime field.</p>
108
109
110 <div class="example"><pre>
111 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= GF( 16 );;</span>
112 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftActingDomain( F );</span>
113 GF(2)
114 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:= AsVectorSpace( GF( 4 ), F );</span>
115 AsField( GF(2^2), GF(2^4) )
116 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F = G;</span>
117 true
118 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftActingDomain( G );</span>
119 GF(2^2)
120 </pre></div>
121
122 <p>A vector space has three important attributes: its <em>field</em> of definition, its <em>dimension</em> and a <em>basis</em>. We already encountered the function <code class="func">LeftActingDomain</code> (<span class="RefLink">Reference: LeftActingDomain</span>) in the example above. It extracts the field of definition of a vector space. The function <code class="func">Dimension</code> (<span class="RefLink">Reference: Dimension</span>) provides the dimension of the vector space.</p>
123
124
125 <div class="example"><pre>
126 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= GF( 9 );;</span>
127 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, Z(3)^0 ] ];;</span>
128 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( F, m );</span>
129 &lt;vector space over GF(3^2), with 2 generators&gt;
130 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( V );</span>
131 2
132 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= AsVectorSpace( GF( 3 ), V );</span>
133 &lt;vector space over GF(3), with 4 generators&gt;
134 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V = W;</span>
135 true
136 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( W );</span>
137 4
138 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftActingDomain( W );</span>
139 GF(3)
140 </pre></div>
141
142 <p>One of the most important attributes is a <em>basis</em>. For a given basis <span class="SimpleMath">B</span> of <span class="SimpleMath">V</span>, every vector <span class="SimpleMath">v</span> in <span class="SimpleMath">V</span> can be expressed uniquely as <span class="SimpleMath">v = ∑_b ∈ B c_b b</span>, with coefficients <span class="SimpleMath">c_b ∈ F</span>.</p>
143
144 <p>In <strong class="pkg">GAP</strong>, bases are special lists of vectors. They are used mainly for the computation of coefficients and linear combinations.</p>
145
146 <p>Given a vector space <span class="SimpleMath">V</span>, a basis of <span class="SimpleMath">V</span> is obtained by simply applying the function <code class="func">Basis</code> (<span class="RefLink">Reference: Basis</span>) to <span class="SimpleMath">V</span>. The vectors that form the basis are extracted from the basis by <code class="func">BasisVectors</code> (<span class="RefLink">Reference: BasisVectors</span>).</p>
147
148
149 <div class="example"><pre>
150 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= [ [ 1, 2 ], [ 3, 4 ] ];; m2:= [ [ 1, 1 ], [ 1, 0 ] ];;</span>
151 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ m1, m2 ] );</span>
152 &lt;vector space over Rationals, with 2 generators&gt;
153 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );</span>
154 SemiEchelonBasis( &lt;vector space over Rationals, with
155 2 generators&gt;, ... )
156 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( Basis( V ) );</span>
157 [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 0, 1 ], [ 2, 4 ] ] ]
158 </pre></div>
159
160 <p>The coefficients of a vector relative to a given basis are found by the function <code class="func">Coefficients</code> (<span class="RefLink">Reference: Coefficients</span>). Furthermore, linear combinations of the basis vectors are constructed using <code class="func">LinearCombination</code> (<span class="RefLink">Reference: LinearCombination</span>).</p>
161
162
163 <div class="example"><pre>
164 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2 ], [ 3, 4 ] ] );</span>
165 &lt;vector space over Rationals, with 2 generators&gt;
166 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V );</span>
167 SemiEchelonBasis( &lt;vector space over Rationals, with
168 2 generators&gt;, ... )
169 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( Basis( V ) );</span>
170 [ [ 1, 2 ], [ 0, 1 ] ]
171 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 1, 0 ] );</span>
172 [ 1, -2 ]
173 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LinearCombination( B, [ 1, -2 ] );</span>
174 [ 1, 0 ]
175 </pre></div>
176
177 <p>In the above examples we have seen that <strong class="pkg">GAP</strong> often chooses the basis it wants to work with. It is also possible to construct bases with prescribed basis vectors by giving a list of these vectors as second argument to <code class="func">Basis</code> (<span class="RefLink">Reference: Basis</span>).</p>
178
179
180 <div class="example"><pre>
181 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ [ 1, 2 ], [ 3, 4 ] ] );;</span>
182 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( V, [ [ 1, 0 ], [ 0, 1 ] ] );</span>
183 SemiEchelonBasis( &lt;vector space over Rationals, with 2 generators&gt;,
184 [ [ 1, 0 ], [ 0, 1 ] ] )
185 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Coefficients( B, [ 1, 2 ] );</span>
186 [ 1, 2 ]
187 </pre></div>
188
189 <p>We can construct subspaces and quotient spaces of vector spaces. The natural projection map (constructed by <code class="func">NaturalHomomorphismBySubspace</code> (<span class="RefLink">Reference: NaturalHomomorphismBySubspace</span>)), connects a vector space with its quotient space.</p>
190
191
192 <div class="example"><pre>
193 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^4;</span>
194 ( Rationals^4 )
195 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= Subspace( V, [ [ 1, 2, 3, 4 ], [ 0, 9, 8, 7 ] ] );</span>
196 &lt;vector space over Rationals, with 2 generators&gt;
197 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">VmodW:= V/W;</span>
198 ( Rationals^2 )
199 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">h:= NaturalHomomorphismBySubspace( V, W );</span>
200 &lt;linear mapping by matrix, ( Rationals^4 ) -&gt; ( Rationals^2 )&gt;
201 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Image( h, [ 1, 2, 3, 4 ] );</span>
202 [ 0, 0 ]
203 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagesRepresentative( h, [ 1, 0 ] );</span>
204 [ 1, 0, 0, 0 ]
205 </pre></div>
206
207 <p><a id="X7DDBF6F47A2E021C" name="X7DDBF6F47A2E021C"></a></p>
208
209 <h4>6.2 <span class="Heading">Algebras</span></h4>
210
211 <p>If a bilinear multiplication is defined for the elements of a vector space, and if the vector space is closed under this multiplication then it is called an <em>algebra</em>. For example, every field is an algebra:</p>
212
213
214 <div class="example"><pre>
215 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= GF(8); IsAlgebra( f );</span>
216 GF(2^3)
217 true
218 </pre></div>
219
220 <p>One of the most important classes of algebras are sub-algebras of matrix algebras. On the set of all <span class="SimpleMath">n × n</span> matrices over a field <span class="SimpleMath">F</span> it is possible to define a multiplication in many ways. The most frequent are the ordinary matrix multiplication and the Lie multiplication.</p>
221
222 <p>Each matrix constructed as <span class="SimpleMath">[ <var class="Arg">row1</var>, <var class="Arg">row2</var>, ... ]</span> is regarded by <strong class="pkg">GAP</strong> as an <em>ordinary</em> matrix, its multiplication is the ordinary associative matrix multiplication. The sum and product of two ordinary matrices are again ordinary matrices.</p>
223
224 <p>The <em>full</em> matrix associative algebra can be created as follows:</p>
225
226
227 <div class="example"><pre>
228 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= GF( 9 );;</span>
229 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= F^[3,3];</span>
230 ( GF(3^2)^[ 3, 3 ] )
231 </pre></div>
232
233 <p>An algebra can be constructed from generators using the function <code class="func">Algebra</code> (<span class="RefLink">Reference: Algebra</span>). It takes as arguments the field of coefficients and a list of generators. Of course the coefficient field and the generators must fit together; if we want to construct an algebra of ordinary matrices, we may take the field generated by the entries of the generating matrices, or a subfield or extension field.</p>
234
235
236 <div class="example"><pre>
237 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= [ [ 1, 1 ], [ 0, 0 ] ];; m2:= [ [ 0, 0 ], [ 0, 1 ] ];;</span>
238 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m1, m2 ] );</span>
239 &lt;algebra over Rationals, with 2 generators&gt;
240 </pre></div>
241
242 <p>An interesting class of algebras for which many special algorithms are implemented is the class of <em>Lie algebras</em>. They arise for example as algebras of matrices whose product is defined by the Lie bracket <span class="SimpleMath">[ A, B ] = A * B - B * A</span>, where <span class="SimpleMath">*</span> denotes the ordinary matrix product.</p>
243
244 <p>Since the multiplication of objects in <strong class="pkg">GAP</strong> is always assumed to be the operation <code class="code">*</code> (resp. the infix operator <code class="code">*</code>), and since there is already the <q>ordinary</q> matrix product defined for ordinary matrices, as mentioned above, we must use a different construction for matrices that occur as elements of Lie algebras. Such Lie matrices can be constructed by <code class="func">LieObject</code> (<span class="RefLink">Reference: LieObject</span>) from ordinary matrices, the sum and product of Lie matrices are again Lie matrices.</p>
245
246
247 <div class="example"><pre>
248 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= LieObject( [ [ 1, 1 ], [ 1, 1 ] ] );</span>
249 LieObject( [ [ 1, 1 ], [ 1, 1 ] ] )
250 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m*m;</span>
251 LieObject( [ [ 0, 0 ], [ 0, 0 ] ] )
252 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsOrdinaryMatrix( m1 ); IsOrdinaryMatrix( m );</span>
253 true
254 false
255 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsLieMatrix( m1 ); IsLieMatrix( m );</span>
256 false
257 true
258 </pre></div>
259
260 <p>Given a field <code class="code">F</code> and a list <code class="code">mats</code> of Lie objects over <code class="code">F</code>, we can construct the Lie algebra generated by <code class="code">mats</code> using the function <code class="func">Algebra</code> (<span class="RefLink">Reference: Algebra</span>). Alternatively, if we do not want to be bothered with the function <code class="func">LieObject</code> (<span class="RefLink">Reference: LieObject</span>), we can use the function <code class="func">LieAlgebra</code> (<span class="RefLink">Reference: LieAlgebra for an associative algebra</span>) that takes a field and a list of ordinary matrices, and constructs the Lie algebra generated by the corresponding Lie matrices. Note that this means that the ordinary matrices used in the call of <code class="func">LieAlgebra</code> (<span class="RefLink">Reference: LieAlgebra for an associative algebra</span>) are not contained in the returned Lie algebra.</p>
261
262
263 <div class="example"><pre>
264 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= [ [ 0, 1 ], [ 0, 0 ] ];;</span>
265 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= [ [ 0, 0 ], [ 1, 0 ] ];;</span>
266 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= LieAlgebra( Rationals, [ m1, m2 ] );</span>
267 &lt;Lie algebra over Rationals, with 2 generators&gt;
268 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1 in L;</span>
269 false
270 </pre></div>
271
272 <p>A second way of creating an algebra is by specifying a multiplication table. Let <span class="SimpleMath">A</span> be a finite dimensional algebra with basis <span class="SimpleMath">(x_1, x_2, ..., x_n)</span>, then for <span class="SimpleMath">1 ≤ i, j ≤ n</span> the product <span class="SimpleMath">x_i x_j</span> is a linear combination of basis elements, i.e., there are <span class="SimpleMath">c_ij^k</span> in the ground field such that <span class="SimpleMath">x_i x_j = ∑_k=1^n c_ij^k x_k.</span> It is not difficult to show that the constants <span class="SimpleMath">c_ij^k</span> determine the multiplication completely. Therefore, the <span class="SimpleMath">c_ij^k</span> are called <em>structure constants</em>. In <strong class="pkg">GAP</strong> we can create a finite dimensional algebra by specifying an array of structure constants.</p>
273
274 <p>In <strong class="pkg">GAP</strong> such a table of structure constants is represented using lists. The obvious way to do this would be to construct a <q>three-dimensional</q> list <code class="code">T</code> such that <code class="code">T[i][j][k]</code> equals <span class="SimpleMath">c_ij^k</span>. But it often happens that many of these constants vanish. Therefore a more complicated structure is used in order to be able to omit the zeros. A multiplication table of an <span class="SimpleMath">n</span>-dimensional algebra is an <span class="SimpleMath">n × n</span> array <code class="code">T</code> such that <code class="code">T[i][j]</code> describes the product of the <code class="code">i</code>-th and the <code class="code">j</code>-th basis element. This product is encoded in the following way. The entry <code class="code">T[i][j]</code> is a list of two elements. The first of these is a list of indices <span class="SimpleMath">k</span> such that <span class="SimpleMath">c_ij^k</span> is nonzero. The second list contains the corresponding constants <span class="SimpleMath">c_ij^k</span>. Suppose, for example, that <code class="code">S</code> is the table of an algebra with basis <span class="SimpleMath">(x_1, x_2, ..., x_8)</span> and that <code class="code">S[3][7]</code> equals <code class="code">[ [ 2, 4, 6 ], [ 1/2, 2, 2/3 ] ]</code>. Then in the algebra we have the relation <span class="SimpleMath">x_3 x_7 = (1/2) x_2 + 2 x_4 + (2/3) x_6.</span> Furthermore, if <code class="code">S[6][1] = [ [ ], [ ] ]</code> then the product of the sixth and first basis elements is zero.</p>
275
276 <p>Finally two numbers are added to the table. The first number can be 1, -1, or 0. If it is 1, then the table is known to be symmetric, i.e., <span class="SimpleMath">c_ij^k = c_ji^k</span>. If this number is -1, then the table is known to be antisymmetric (this happens for instance when the algebra is a Lie algebra). The remaining case, 0, occurs in all other cases. The second number that is added is the zero element of the field over which the algebra is defined.</p>
277
278 <p>Empty structure constants tables are created by the function <code class="func">EmptySCTable</code> (<span class="RefLink">Reference: EmptySCTable</span>), which takes a dimension <span class="SimpleMath">d</span>, a zero element <span class="SimpleMath">z</span>, and optionally one of the strings <code class="code">"symmetric"</code>, <code class="code">"antisymmetric"</code>, and returns an empty structure constants table <span class="SimpleMath">T</span> corresponding to a <span class="SimpleMath">d</span>-dimensional algebra over a field with zero element <span class="SimpleMath">z</span>. Structure constants can be entered into the table <span class="SimpleMath">T</span> using the function <code class="func">SetEntrySCTable</code> (<span class="RefLink">Reference: SetEntrySCTable</span>). It takes four arguments, namely <span class="SimpleMath">T</span>, two indices <span class="SimpleMath">i</span> and <span class="SimpleMath">j</span>, and a list of the form <span class="SimpleMath">[ c_ij^{k_1}, k_1, c_ij^{k_2}, k_2, ... ]</span>. In this call to <code class="code">SetEntrySCTable</code>, the product of the <span class="SimpleMath">i</span>-th and the <span class="SimpleMath">j</span>-th basis vector in any algebra described by <span class="SimpleMath">T</span> is set to <span class="SimpleMath">∑_l c_ij^{k_l} x_{k_l}</span>. (Note that in the empty table, this product was zero.) If <span class="SimpleMath">T</span> knows that it is (anti)symmetric, then at the same time also the product of the <span class="SimpleMath">j</span>-th and the <span class="SimpleMath">i</span>-th basis vector is set appropriately.</p>
279
280
281 <div class="example"><pre>
282 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0, "symmetric" );</span>
283 [ [ [ [ ], [ ] ], [ [ ], [ ] ] ],
284 [ [ [ ], [ ] ], [ [ ], [ ] ] ], 1, 0 ]
285 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [1/2,1,1/3,2] ); T;</span>
286 [ [ [ [ ], [ ] ], [ [ 1, 2 ], [ 1/2, 1/3 ] ] ],
287 [ [ [ 1, 2 ], [ 1/2, 1/3 ] ], [ [ ], [ ] ] ], 1, 0 ]
288 </pre></div>
289
290 <p>If we have defined a structure constants table, then we can construct the corresponding algebra by <code class="func">AlgebraByStructureConstants</code> (<span class="RefLink">Reference: AlgebraByStructureConstants</span>).</p>
291
292
293 <div class="example"><pre>
294 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );</span>
295 &lt;algebra of dimension 2 over Rationals&gt;
296 </pre></div>
297
298 <p>If we know that a structure constants table defines a Lie algebra, then we can construct the corresponding Lie algebra by <code class="func">LieAlgebraByStructureConstants</code> (<span class="RefLink">Reference: LieAlgebraByStructureConstants</span>); the algebra returned by this function knows that it is a Lie algebra, so <strong class="pkg">GAP</strong> need not check the Jacobi identity.</p>
299
300
301 <div class="example"><pre>
302 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0, "antisymmetric" );;</span>
303 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [2/3,1] );</span>
304 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= LieAlgebraByStructureConstants( Rationals, T );</span>
305 &lt;Lie algebra of dimension 2 over Rationals&gt;
306 </pre></div>
307
308 <p>In <strong class="pkg">GAP</strong> an algebra is naturally a vector space. Hence all the functionality for vector spaces is also available for algebras.</p>
309
310
311 <div class="example"><pre>
312 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:= GF(2);;</span>
313 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">z:= Zero( F );; o:= One( F );;</span>
314 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 3, z, "antisymmetric" );;</span>
315 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ o, 1, o, 3 ] );</span>
316 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 3, [ o, 1 ] );</span>
317 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 3, [ o, 3 ] );</span>
318 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( F, T );</span>
319 &lt;algebra of dimension 3 over GF(2)&gt;
320 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
321 3
322 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftActingDomain( A );</span>
323 GF(2)
324 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Basis( A );</span>
325 CanonicalBasis( &lt;algebra of dimension 3 over GF(2)&gt; )
326 </pre></div>
327
328 <p>Subalgebras and ideals of an algebra can be constructed by specifying a set of generators for the subalgebra or ideal. The quotient space of an algebra by an ideal is naturally an algebra itself.</p>
329
330
331 <div class="example"><pre>
332 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 1, 2, 3 ], [ 0, 1, 6 ], [ 0, 0, 1 ] ];;</span>
333 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m ] );;</span>
334 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">subA:= Subalgebra( A, [ m-m^2 ] );</span>
335 &lt;algebra over Rationals, with 1 generator&gt;
336 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( subA );</span>
337 2
338 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">idA:= Ideal( A, [ m-m^3 ] );</span>
339 &lt;two-sided ideal in &lt;algebra of dimension 3 over Rationals&gt;,
340 (1 generator)&gt;
341 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( idA );</span>
342 2
343 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= A/idA;</span>
344 &lt;algebra of dimension 1 over Rationals&gt;
345 </pre></div>
346
347 <p>The call <code class="code">B:= A/idA</code> creates a new algebra that does not <q>know</q> about its connection with <code class="code">A</code>. If we want to connect an algebra with its factor via a homomorphism, then we first have to create the homomorphism (<code class="func">NaturalHomomorphismByIdeal</code> (<span class="RefLink">Reference: NaturalHomomorphismByIdeal</span>)). After this we create the factor algebra from the homomorphism by the function <code class="func">ImagesSource</code> (<span class="RefLink">Reference: ImagesSource</span>). In the next example we divide an algebra <code class="code">A</code> by its radical and lift the central idempotents of the factor to the original algebra <code class="code">A</code>.</p>
348
349
350 <div class="example"><pre>
351 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:=[[1,0,0],[0,2,0],[0,0,3]];;</span>
352 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:=[[0,1,0],[0,0,2],[0,0,0]];;</span>
353 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m1, m2 ] );;</span>
354 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
355 6
356 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:= RadicalOfAlgebra( A );</span>
357 &lt;algebra of dimension 3 over Rationals&gt;
358 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">h:= NaturalHomomorphismByIdeal( A, R );</span>
359 &lt;linear mapping by matrix, &lt;algebra of dimension
360 6 over Rationals&gt; -&gt; &lt;algebra of dimension 3 over Rationals&gt;&gt;
361 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AmodR:= ImagesSource( h );</span>
362 &lt;algebra of dimension 3 over Rationals&gt;
363 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">id:= CentralIdempotentsOfAlgebra( AmodR );</span>
364 [ v.3, v.2+(-3)*v.3, v.1+(-2)*v.2+(3)*v.3 ]
365 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagesRepresentative( h, id[1] );</span>
366 [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 1 ] ]
367 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagesRepresentative( h, id[2] );</span>
368 [ [ 0, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 0 ] ]
369 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagesRepresentative( h, id[3] );</span>
370 [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
371 </pre></div>
372
373 <p>Structure constants tables for the simple Lie algebras are present in <strong class="pkg">GAP</strong>. They can be constructed using the function <code class="func">SimpleLieAlgebra</code> (<span class="RefLink">Reference: SimpleLieAlgebra</span>). The Lie algebras constructed by this function come with a root system attached.</p>
374
375
376 <div class="example"><pre>
377 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= SimpleLieAlgebra( "G", 2, Rationals );</span>
378 &lt;Lie algebra of dimension 14 over Rationals&gt;
379 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:= RootSystem( L );</span>
380 &lt;root system of rank 2&gt;
381 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PositiveRoots( R );</span>
382 [ [ 2, -1 ], [ -3, 2 ], [ -1, 1 ], [ 1, 0 ], [ 3, -1 ], [ 0, 1 ] ]
383 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CartanMatrix( R );</span>
384 [ [ 2, -1 ], [ -3, 2 ] ]
385 </pre></div>
386
387 <p>Another example of algebras is provided by <em>quaternion algebras</em>. We define a quaternion algebra over an extension field of the rationals, namely the field generated by <span class="SimpleMath">sqrt{5}</span>. (The number <code class="code">EB(5)</code> is equal to <span class="SimpleMath">1/2 (-1+sqrt{5})</span>. The field is printed as <code class="code">NF(5,[ 1, 4 ])</code>.)</p>
388
389
390 <div class="example"><pre>
391 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b5:= EB(5);</span>
392 E(5)+E(5)^4
393 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">q:= QuaternionAlgebra( FieldByGenerators( [ b5 ] ) );</span>
394 &lt;algebra-with-one of dimension 4 over NF(5,[ 1, 4 ])&gt;
395 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">gens:= GeneratorsOfAlgebra( q );</span>
396 [ e, i, j, k ]
397 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e:= gens[1];; i:= gens[2];; j:= gens[3];; k:= gens[4];;</span>
398 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsAssociative( q );</span>
399 true
400 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsCommutative( q );</span>
401 false
402 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">i*j; j*i;</span>
403 k
404 (-1)*k
405 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One( q );</span>
406 e
407 </pre></div>
408
409 <p>If the coefficient field is a real subfield of the complex numbers then the quaternion algebra is in fact a division ring.</p>
410
411
412 <div class="example"><pre>
413 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsDivisionRing( q );</span>
414 true
415 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Inverse( e+i+j );</span>
416 (1/3)*e+(-1/3)*i+(-1/3)*j
417 </pre></div>
418
419 <p>So <strong class="pkg">GAP</strong> knows about this fact. As in any ring, we can look at groups of units. (The function <code class="func">StarCyc</code> (<span class="RefLink">Reference: StarCyc</span>) used below computes the unique algebraic conjugate of an element in a quadratic subfield of a cyclotomic field.)</p>
420
421
422 <div class="example"><pre>
423 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">c5:= StarCyc( b5 );</span>
424 E(5)^2+E(5)^3
425 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g1:= 1/2*( b5*e + i - c5*j );</span>
426 (1/2*E(5)+1/2*E(5)^4)*e+(1/2)*i+(-1/2*E(5)^2-1/2*E(5)^3)*j
427 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Order( g1 );</span>
428 5
429 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g2:= 1/2*( -c5*e + i + b5*k );</span>
430 (-1/2*E(5)^2-1/2*E(5)^3)*e+(1/2)*i+(1/2*E(5)+1/2*E(5)^4)*k
431 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Order( g2 );</span>
432 10
433 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=Group( g1, g2 );;</span>
434 #I default `IsGeneratorsOfMagmaWithInverses' method returns `true' for
435 [ (1/2*E(5)+1/2*E(5)^4)*e+(1/2)*i+(-1/2*E(5)^2-1/2*E(5)^3)*j,
436 (-1/2*E(5)^2-1/2*E(5)^3)*e+(1/2)*i+(1/2*E(5)+1/2*E(5)^4)*k ]
437 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size( g );</span>
438 120
439 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPerfect( g );</span>
440 true
441 </pre></div>
442
443 <p>Since there is only one perfect group of order 120, up to isomorphism, we see that the group <code class="code">g</code> is isomorphic to <span class="SimpleMath">SL_2(5)</span>. As usual, a permutation representation of the group can be constructed using a suitable action of the group.</p>
444
445
446 <div class="example"><pre>
447 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cos:= RightCosets( g, Subgroup( g, [ g1 ] ) );;</span>
448 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Length( cos );</span>
449 24
450 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">hom:= ActionHomomorphism( g, cos, OnRight );;</span>
451 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">im:= Image( hom );</span>
452 Group([ (2,3,5,9,15)(4,7,12,8,14)(10,17,23,20,24)(11,19,22,16,13),
453 (1,2,4,8,3,6,11,20,17,19)(5,10,18,7,13,22,12,21,24,15)(9,16)(14,23) ])
454 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size( im );</span>
455 120
456 </pre></div>
457
458 <p>To get a matrix representation of <code class="code">g</code> or of the whole algebra <code class="code">q</code>, we must specify a basis of the vector space on which the algebra acts, and compute the linear action of elements w.r.t. this basis.</p>
459
460
461 <div class="example"><pre>
462 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bas:= CanonicalBasis( q );;</span>
463 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( bas );</span>
464 [ e, i, j, k ]
465 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">op:= OperationAlgebraHomomorphism( q, bas, OnRight );</span>
466 &lt;op. hom. AlgebraWithOne( NF(5,[ 1, 4 ]),
467 [ e, i, j, k ] ) -&gt; matrices of dim. 4&gt;
468 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImagesRepresentative( op, e );</span>
469 [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]
470 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImagesRepresentative( op, i );</span>
471 [ [ 0, 1, 0, 0 ], [ -1, 0, 0, 0 ], [ 0, 0, 0, -1 ], [ 0, 0, 1, 0 ] ]
472 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImagesRepresentative( op, g1 );</span>
473 [ [ 1/2*E(5)+1/2*E(5)^4, 1/2, -1/2*E(5)^2-1/2*E(5)^3, 0 ],
474 [ -1/2, 1/2*E(5)+1/2*E(5)^4, 0, -1/2*E(5)^2-1/2*E(5)^3 ],
475 [ 1/2*E(5)^2+1/2*E(5)^3, 0, 1/2*E(5)+1/2*E(5)^4, -1/2 ],
476 [ 0, 1/2*E(5)^2+1/2*E(5)^3, 1/2, 1/2*E(5)+1/2*E(5)^4 ] ]
477 </pre></div>
478
479 <p><a id="X843A8D6F7A7592B5" name="X843A8D6F7A7592B5"></a></p>
480
481 <h4>6.3 <span class="Heading">Further Information about Vector Spaces and Algebras</span></h4>
482
483 <p>More information about vector spaces can be found in Chapter <span class="RefLink">Reference: Vector Spaces</span>. Chapter <span class="RefLink">Reference: Algebras</span> deals with the functionality for general algebras. Furthermore, concerning special functions for Lie algebras, there is Chapter <span class="RefLink">Reference: Lie Algebras</span>.</p>
484
485
486 <div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap5.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap7.html">[Next Chapter]</a>&nbsp; </div>
487
488
489 <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
490
491 <hr />
492 <p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
493 </body>
494 </html>