Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

2 Quickstart
 2.1 Example 1 -- quivers, path algebras and quotients of path algebras
 2.2 Example 2 -- Introducing modules
 2.3 Example 3 -- Constructing modules and module homomorphisms

2 Quickstart

This chapter is intended for those who would like to get started with QPA right away by playing with a few examples. We assume that the user is familiar with GAP syntax, for instance the different ways to display various GAP objects: View, Print and Display. These features are all implemented for the objects defined in QPA, and by using Display on an object, you will get a complete description of it.

The following examples show how to create the most fundamental algebraic structures featured in QPA, namely quivers, path algebras and quotients of path algebras, modules and module homomorphisms. Sometimes, there is more than one way of constructing such objects. See their respective chapter in the documentation for more on this. The code from the examples can be found in the examples/ directory of the distribution of QPA.

2.1 Example 1 -- quivers, path algebras and quotients of path algebras

We construct a quiver Q, i.e. a finite directed graph, with one vertex and two loops:

gap> Q := Quiver( 1, [ [1,1,"a"], [1,1,"b"] ] );
<quiver with 1 vertices and 2 arrows>
gap> Display(Q);
Quiver( ["v1"], [["v1","v1","a"],["v1","v1","b"]] )

When displaying Q, we observe that the vertex has been named v1, and that this name is used when describing the arrows. (The "Display" style of viewing a quiver can also be used in construction, i.e., we could have written Q := Quiver( ["v1"], [["v1","v1","a"],["v1","v1","b"]] ) to get the same object.)

If we want to know the number and names of the vertices and arrows, without getting the structure of Q, we can request this information as shown below. We can also access the vertices and arrows directly.

 
gap> VerticesOfQuiver(Q);
[ v1 ]
gap> ArrowsOfQuiver(Q);
[ a, b ]
gap> Q.a;
a

The next step is to create the path algebra kQ from Q, where k is the rational numbers (in general, one can chose any field implemented in GAP).

 
gap> kQ := PathAlgebra(Rationals, Q);
<Rationals[<quiver with 1 vertices and 2 arrows>]>
gap> Display(kQ);
<Path algebra of the quiver <quiver with 1 vertices and 2 arrows> 
over the field Rationals>

We know that this algebra has three generators, with the vertex v_1 as the identity. This can be verified by QPA. For convenience, we introduce new variables v1, a and b to get easier access to the generators.

gap> AssignGeneratorVariables(kQ);
#I  Assigned the global variables [ v1, a, b ]
gap> v1; a; b;
(1)*v1
(1)*a
(1)*b
gap> id := One(kQ);
(1)*v1
gap> v1 = id;
true

Now, we want to construct a finite dimensional algebra, by dividing out some ideal. The generators of the ideal (the relations) are given in terms of paths, and it is important to know the convention of writing paths used in QPA. If we first go the arrow a and then the arrow b, the path is written as a*b.

Say that we want our ideal to be generated by the relations \{a^2, a*b - b*a, b^2\}. Then we make a list relations consisting of these relations and to construct the quotient we say: A := kQ/relations; on the command line in GAP.

gap> relations := [a^2,a*b-b*a, b*b];
[ (1)*a^2, (1)*a*b+(-1)*b*a, (1)*b^2 ]
gap> A := kQ/relations;
<Rationals[<quiver with 1 vertices and 2 arrows>]/<two-sided ideal in 
<Rationals[<quiver with 1 vertices and 2 arrows>]>, (3 generators)>>

See 4.6 for further remarks on constructing quotients of path algebras.

2.2 Example 2 -- Introducing modules

In representation theory, there are several conventions for expressing modules of path algebras, and again it is useful to comment on the convention used in QPA. A module (or representation) of an algebra A = kQ/I is, briefly explained, a picture of Q where the vertices are finite dimensional k-vectorspaces, and the arrows are linear transformations between the vector spaces respecting the relations of I. The modules are right modules, and a linear transformation from k^n to k^m is represented by a n \times m-matrix.

There are several ways of constructing modules in QPA. First, we will explore some modules which QPA gives us for free, namely the indecomposable projectives. We start by constructing a new algebra. The underlying quiver has three vertices and three arrows and looks like an A_3 quiver with both arrows pointing to the right, and one additional loop in the final vertex. The only relation is to go this loop twice.

gap> Q := Quiver( 3, [ [1,2,"a"], [2,3,"b"], [3,3,"c"] ]);
<quiver with 3 vertices and 3 arrows>
gap> kQ := PathAlgebra(Rationals, Q);
<Rationals[<quiver with 3 vertices and 3 arrows>]>
gap> relations := [kQ.c*kQ.c];
[ (1)*c^2 ]
gap> A := kQ/relations;
<Rationals[<quiver with 3 vertices and 3 arrows>]/
<two-sided ideal in <Rationals[<quiver with 3 vertices and 3 arrows>]>, 
  (1 generators)>>

The indecomposable projectives are easily created with one command. We use Display to explore the modules.

gap> projectives := IndecProjectiveModules(A);
[ <[ 1, 1, 2 ]>, <[ 0, 1, 2 ]>, <[ 0, 0, 2 ]> ]
gap> proj1 := projectives[1];
<[ 1, 1, 2 ]>
gap> Display(proj1);
<Module over <Rationals[<quiver with 3 vertices and 3 arrows>]/
<two-sided ideal in <Rationals[<quiver with 3 vertices and 3 arrows>]>, 
  (1 generators)>> with dimension vector 
[ 1, 1, 2 ]> and linear maps given by
for arrow a:
[ [  1 ] ]
for arrow b:
[ [  1,  0 ] ]
for arrow c:
[ [  0,  1 ],
  [  0,  0 ] ]

If we, for some reason, want to use the maps of this module, we can get the matrices directly by using the command MatricesOfPathAlgebraModule(proj1):

gap> M := MatricesOfPathAlgebraModule(proj1);
[ [ [ 1 ] ], [ [ 1, 0 ] ], [ [ 0, 1 ], [ 0, 0 ] ] ]
gap> M[1];
[ [ 1 ] ]

Naturally, the indecomposable injective modules are just as easily constructed, and so are the simple modules.

gap> injectives := IndecInjectiveModules(A);
[ <[ 1, 0, 0 ]>, <[ 1, 1, 0 ]>, <[ 2, 2, 2 ]> ]
gap> simples := SimpleModules(A);
[ <[ 1, 0, 0 ]>, <[ 0, 1, 0 ]>, <[ 0, 0, 1 ]> ]

We know for a fact that the simple module in vertex 1 and the indecomposable injective module in vertex 1 coincide. Let us look at this relationship in QPA:

gap> s1 := simples[1];
<[ 1, 0, 0 ]>
gap> inj1 := injectives[1];
<[ 1, 0, 0 ]>
gap> IsIdenticalObj(s1,inj1);
false
gap> s1 = inj1;
true
gap> IsomorphicModules(s1,inj1);
true

We observe that QPA recognizes the modules as "the same" (that is, isomorphic); however, they are not the same instance and hence the simplest test for equality fails. This is important to bear in mind -- objects which are isomorphic and regarded as the same in the "real world", are not necessarily the same in GAP.

2.3 Example 3 -- Constructing modules and module homomorphisms

Assume we want to construct the following A-module M, where A is the same algebra as in the previous example xymatrix0ar[r]^0 & ℚar[r]^1 & ℚ ar@(ur,dr)^0. This module is neither indecomposable projective or injective, nor simple, so we need to do the dirty work ourselves. Usually, the easiest way to construct a module is to state the dimension vector and the non-zero maps. Here, there is only one non-zero map, and we write

gap> M := RightModuleOverPathAlgebra( A, [0,1,1], [ ["b", [[1]] ] ] );
<[ 0, 1, 1 ]>

To make sure we got everything right, we can use Display(M) to view the maps. The most tricky thing is usually to get the correct numbers of brackets. Here is a slightly bigger example: xymatrixℚar[r]^(beginsmallmatrix0 & 0endsmallmatrix) & ℚ^2ar[r]^(beginsmallmatrix1 & 0 -1 & 0endsmallmatrix) & ℚ^2ar@(ur,dr)^(beginsmallmatrix0 & 0 1 & 0endsmallmatrix)}.

gap> N := RightModuleOverPathAlgebra( A, [1,2,2], [ ["a",[[1,1]] ], 
   ["b", [[1,0], [-1,0]] ], ["c", [[0,0],[1,0]] ] ] );
<[ 1, 2, 2 ]>

Now we want to construct a map between the two modules, say f: M \rightarrow N, which is non-zero only in vertex 2. This is done by

gap> f := RightModuleHomOverAlgebra(M,N, [ [[0]], [[1,1]], NullMat(1,2,Rationals)]);
<<[ 0, 1, 1 ]> ---> <[ 1, 2, 2 ]>>
gap> Display(f);
<<Module over <Rationals[<quiver with 3 vertices and 3 arrows>]/
<two-sided ideal in <Rationals[<quiver with 3 vertices and 3 arrows>]>, 
  (1 generators)>> with dimension vector 
[ 0, 1, 1 ]> ---> <Module over <Rationals[<quiver with 3 vertices and 3 arrows>]/
<two-sided ideal in <Rationals[<quiver with 3 vertices and 3 arrows>]>, 
  (1 generators)>> with dimension vector [ 1, 2, 2 ]>>
with linear map for vertex number 1:
[ [  0 ] ]
linear map for vertex number 2:
[ [  1,  1 ] ]
linear map for vertex number 3:
[ [  0,  0 ] ]

Note the two different ways of writing zero maps. Again, we can retrieve the matrices describing f:

gap> MatricesOfPathAlgebraMatModuleHomomorphism(f);
[ [ [ 0 ] ], [ [ 1, 1 ] ], [ [ 0, 0 ] ] ]
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 Bib Ind

generated by GAPDoc2HTML