1# GAP Implementation
2# This contains various tools for computing degenerations of modules in finite type
3# (created A. Mroz, 01.07.2013)
4
5
6
7######################################################
8##
9#F ARQuiverNumerical( <ind> , <proj>, <list> )
10#F ARQuiverNumerical( <name> )
11#F ARQuiverNumerical( <name>, <param1> )
12#F ARQuiverNumerical( <name>, <param1>, <param2> )
13##
14## This function "initializes" Auslander-Reiten quiver and
15## performs all necessary preliminary computations concerning
16## mainly determining the matrix of dimensions of all Hom-spaces between
17## indecomposables.
18## It returns <AR>, an object from the category IsARQuiverNumerical
19## which represents Auslander-Reiten quiver and additionally contains all data
20## necessary for further computations in this subpackage:
21## - attributes: NumberOfIndecomposables - number of indecomposable modules in our category
22##               NumberOfProjectives - number of indecomposable projective modules in our category
23## - components (access by <AR>!.<component>):
24##   ARdesc = numerical description of AR quiver (= <list>)
25##   DimHomMat = matrix [dim Hom (i,j)] (=> rows 1..p contain dim. vectors of all indecomposables)
26##   Simples = list of numbers of simple modules
27##
28## Arguments: <ind> - number of indecomposable modules in our category
29##            <proj> - number of indecomposable projective modules in our category
30##            <list> - list of lists containing description of meshes in AR quiver
31##            defined as follows: <list>[i] = description of mesh ending in vertex
32##            (indec. mod.) no. i having the shape
33##            [a1,...,an,t]
34##             where a1,...,an = numbers of direct predecessors of i in AR quiver
35##             t = number of tau i, or 0 if tau i does not exist (<=> i is projective).
36##             In particular if i is projective <list>[i]=[a1,...,an,0]
37##             where a1,...,an are indec. summands of rad i.
38##             OR:
39##             <list> second version - if the first element of <list> is a string "orbits"
40##             then the remaining elements should provide an alternative (shorter than above) description of A-R
41##             quiver as follows.
42##             <list>[2] is a list of descriptions of orbits identified by chosen representatives.
43##             We assume that if an orbit is non-periodic, then  a projective module is its representative.
44##             Each element of list <list>[2] is a description of orbit and has the shape:
45##             [l, [i1,t1], ... , [is,ts]] where
46##             l = length of orbit - 1
47##             [i1,t1], ... , [is,ts] all the direct predecessors of a representative of this orbit,
48##             of the shape tau^{-t1}(i1), and i1 denotes the representative of orbit no. i1, and so on.
49##             We assume first p elements of <list>[2] are the orbits of projectives.
50##
51##   REMARK: we ALWAYS assume that indecomposables with numbers
52##           1..<proj> are projectives and the only projectives
53##           (further dimension vectors are interpreted according
54##            to this order of projectives!)
55## Alternative arguments:
56##            <name> = string with the name of predefined AR quiver - see description of
57##                     PredefARQuivers
58##            <param1> = (optional) parameter for <name>
59##            <param2> = (optional) second parameter for <name>
60
61InstallGlobalFunction( ARQuiverNumerical,
62  function( arg )
63    local AR, fam, T, Ct, i, j, k, l, found, LL, n, p, t, data, simples,
64          col_sum, are_proj, noo, ss, orbits, tmp, postono, pos, pr;
65
66    if (Length(arg) = 3) and (IsPosInt(arg[1])) and (IsPosInt(arg[2]))
67       and (IsList(arg[3]))  then
68      data := arg;
69    elif (Length(arg) = 3) and IsString(arg[1]) then
70      data := PredefARQuivers(arg[1], arg[2], arg[3]);
71    elif (Length(arg) = 2) and IsString(arg[1]) then
72      data := PredefARQuivers(arg[1], arg[2]);
73    elif (Length(arg) = 1) and IsString(arg[1]) then
74      data := PredefARQuivers(arg[1]);
75      if data = false then # case when the user only asks about what predefined
76                           # algebras are available (parameter "what")
77        return false;
78      fi;
79    else
80      Error("wrong number or type of arguments!");
81    fi;
82
83    n := data[1]; # number of indecomposables
84    p := data[2]; # number of projectives
85    LL := data[3]; # description of AR quiver (see a note before function)
86
87	#return [n,p,LL];
88    #######################################################################################
89    if IsString(LL[1]) and (LL[1] = "orbits") then  # description of orbits
90      # Computing Auslander-Reiten matrix T
91      T := NullMat(n,n);
92      for i in [1..n] do
93        T[i][i] := 1;
94      od;
95      orbits := LL[2];
96      noo := Length(orbits);
97      ss := [];
98      tmp := noo;
99      for i in [1..noo] do
100        if orbits[i][1] > 0 then
101          Add(ss, tmp + 1);
102          tmp := tmp + orbits[i][1];
103        else
104          Add(ss, 0);
105        fi;
106      od; # ss contains numbers of tau^{-1}(representatives)
107
108      postono := function(pos) # translate pos = position [no of orbit, tauminus shift] to number of indec
109        if pos[2] = 0 then
110          return pos[1];
111        else
112          return ss[pos[1]] - 1 + pos[2];
113        fi;
114      end;
115
116      # put tau to T
117      for i in [1..noo] do
118        if i > p then
119          if orbits[i][1] = 0 then T[i][i] := 2;
120          else T[i][ss[i] - 1 + orbits[i][1]] := 1; fi;
121        fi;
122        if ss[i] > 0 then
123          T[ss[i]][i] := 1;
124          for j in [ss[i]+1..ss[i]+orbits[i][1]-1] do
125            T[j][j-1] := 1;
126          od;
127        fi;
128      od;
129      # put incoming arrows to T
130      for i in [1..noo] do
131        for j in [2..Length(orbits[i])] do
132          T[i][postono(orbits[i][j])] := -1;
133        od;
134        for l in [1..orbits[i][1]] do
135          for j in [2..Length(orbits[i])] do
136            pos := orbits[i][j];
137            if (pos[1] <= p) and (l + pos[2] <= orbits[pos[1]][1]) then #preds from orbit of proj
138              T[postono([i,l])][postono([pos[1],pos[2] + l])] := -1;
139            fi;
140            if (pos[1] > p) then #preds from periodic orbit
141              T[postono([i,l])][postono([pos[1], (pos[2] + l) mod (orbits[pos[1]][1]+1) ])] := -1;
142            fi;
143          od;
144        od;
145      od;
146      # add arrows induced by summands of rad(proj) to T
147      for pr in [1..p] do
148	for j in [2..Length(orbits[pr])] do
149	  pos := orbits[pr][j]; # pos(ition) of summand of radical
150	  if pos[1] <= p then # projective summand of radical
151	    for l in [0..orbits[pr][1]] do
152	      if pos[2]+1+l <= orbits[pos[1]][1] then
153	        T[postono([pos[1],pos[2]+1+l])][postono([pr,l])] := -1;
154	      fi;
155	    od;
156	  else # non-projective summand of radical
157	    for l in [0..orbits[pr][1]] do
158	      T[postono([pos[1],(pos[2]+1+l) mod (orbits[pos[1]][1]+1)])][postono([pr,l])] := -1;
159	    od;
160	  fi;
161	od;
162      od;
163      #return T;
164
165    #########################################################################
166    else # descritpion of meshes
167
168      # Check if LL[1],...,LL[p] define projectives
169      for i in [1..p] do
170       if LL[i][Length(LL[i])] <> 0 then
171         Error("wrong AR description, indecomposables with numbers 1,...,",p," should be projectives!");
172       fi;
173      od;
174
175      # Computing Auslander-Reiten matrix T
176      T := NullMat(n,n);
177      for i in [1..n] do
178        T[i][i] := 1;
179      od;
180      for i in [1..Length(LL)] do
181        for j in [1..Length(LL[i])-1] do
182          T[i][LL[i][j]] := -1;
183        od;
184        t := LL[i][Length(LL[i])];
185        if t <> 0 then
186          T[i][t]:=T[i][t]+1;
187        fi;
188      od;
189
190    fi; # end of preparation of T
191
192
193    # Computing matrix Ct = [dim Hom (i,j)] = T^{-1}^tr
194    Ct := TransposedMat(Inverse(T));
195    if not ForAll(Ct, s -> ForAll(s, l -> (IsPosInt(l) or (l=0)))) then
196      Error("wrong AR description, Ct is not a noneg. int. matrix!");
197    fi;
198
199
200    # Determining positions of simples
201    simples := [];
202    for i in [1..p] do
203      for j in [1..n] do
204        if Ct[i][j] = 1 then
205          found := true;
206          for k in [1..p] do
207            if (k <> i) and (Ct[k][j] <> 0) then
208              found := false;
209            fi;
210          od;
211          if found then
212            Append(simples, [j]);
213          fi;
214        fi;
215      od;
216    od;
217    if Length(simples) <> p then
218      Error("wrong AR description - cannot find simples!");
219    fi;
220
221    fam := NewFamily( "ARQuiverNumericalFamily", IsARQuiverNumerical );
222    AR := Objectify( NewType( fam, IsARQuiverNumerical and IsAttributeStoringRep),
223                     rec( ARdesc := data[3],
224                          DimHomMat := Ct,
225                          Simples := simples ) );
226    SetNumberOfIndecomposables(AR, data[1]);
227    SetNumberOfProjectives(AR, data[2]);
228
229    return AR;
230
231  end
232); # ARQuiverNumerical
233
234
235
236######################################################
237##
238#F HowManyTimes( <aa>, <bb> )
239##
240## Auxiliary local function. Determines how many times vector aa
241## fits in vector bb, i.e. it returns max l s.t. l*aa<=bb
242
243HowManyTimes := function(aa, bb)
244  local i, ile, q, l;
245   l := 1;
246   while (l <= Length(aa)) and (aa[l] = 0) do
247     l := l + 1;
248   od;
249   if l > Length(aa) then # for correct data it is impossible!
250     Error("HowManyTimes: vector aa is zero?!");
251   fi;
252   ile := QuoInt(bb[l],aa[l]);
253   for i in [l+1..Length(bb)] do
254     if aa[i] <> 0 then
255       q := QuoInt(bb[i], aa[i]);
256       if q < ile then
257         ile := q;
258       fi;
259     fi;
260   od;
261   return ile;
262end; # HowManyTimes
263
264
265
266
267
268
269######################################################
270##
271#F NextNonsimple( <simples>,  <k> )
272##
273## Auxiliary local function. Determines the least
274## number l > k s.t. l is a number of nonsimple
275## (i.e. not in the list <simples>)
276
277NextNonsimple := function(ss, k)
278  local l;
279  l := k + 1;
280  while l in ss do
281    l := l + 1;
282  od;
283  return l;
284end; # NextNonsimple
285
286
287
288
289
290######################################################
291##
292#O ModulesOfDimVect( <AR> , <which>)
293##
294## This function generates all modules (= multiplicity vectors)
295## with dimension vector equal to vv, where
296## vv = dimension vector of module <which>.
297## <which> can be number of indec. module or dimension vector.
298## (i.e. nonneg. integer solutions of Ax=vv, where A is
299##  [1..p,1..n]-submatrix of <AR>!.DimHomMat; we use here the fact
300##  that simple modules form an "identity submatrix" in A -
301##  this allows to use efficient algorithm, much better than "naive").
302##
303
304InstallMethod( ModulesOfDimVect,
305
306  [ IsARQuiverNumerical, IsObject ],
307  function( AR, which )
308    local solutions, vv, y, collected, Generate,
309          Ct, simples, p, n, i, j, ttime, colsofA, vec;
310
311    # Auxiliary recursive function generating all solutions
312    Generate := function(yy, current, lcollected)
313      local ii, howmany, veccurrent, next, yyy, jj, kk, res;
314
315       veccurrent := colsofA[current];
316       howmany := HowManyTimes(veccurrent, vv - lcollected);
317
318       next := NextNonsimple(simples, current);
319
320       for ii in [0..howmany] do
321
322         yy[current] := ii;  # generating all possible values at position "current"
323
324         if next > n then # now we have whole vector generated
325            yyy := ShallowCopy(yy);
326            for jj in [1..p] do
327              res := 0;
328              for kk in [1..n] do
329                res := res + (Ct[jj][kk] * yyy[kk]);
330              od;
331              yyy[simples[jj]] := vv[jj] - res;
332            od;
333            Append(solutions, [ShallowCopy(yyy)]);
334         fi;
335
336         if next <= n then
337           Generate(yy, next, lcollected + (ii * veccurrent));
338         fi;
339
340       od;
341
342    end; # Generate local
343
344    # Read data from AR
345    n := NumberOfIndecomposables(AR);
346    p := NumberOfProjectives(AR);
347    Ct := AR!.DimHomMat;
348    simples := AR!.Simples;
349
350    ttime := Runtime();
351
352    # Prepare list of columns of "matrix A"
353    # to speed up further computations
354    colsofA := [];
355    for i in [1..n] do
356      vec := [];
357      for j in [1..p] do
358        Append(vec, [Ct[j][i]]);
359      od;
360      Append(colsofA, [ShallowCopy(vec)]);
361    od;
362
363    # Prepare vector vv
364    if IsPosInt(which) and (which in [1..n]) then # number of indecomposable
365      vv := colsofA[which];
366    elif IsList(which) and (Length(which) = p) then # dimension vector
367      vv := which;
368    else
369      Error("second argument should be a number of indecomposable or dimension vector!");
370    fi;
371
372    solutions := [];
373    y := NullMat(1, n)[1];
374    collected := NullMat(1, p)[1];
375    Generate(y, NextNonsimple(simples, 0), collected);
376
377    #Print("Time: ", Float((Runtime()-ttime)/1000), "\n");
378
379    return solutions;
380
381 end
382); # ModulesOfDimVect
383
384
385
386######################################################
387##
388#O DegOrderPredecessors( <AR> , <which>)
389##
390## This function generates all modules (= multiplicity vectors)
391## which are the predecessors of module <which> in deg order,
392## that is all M's such that M degenerates to <which> (M < <which>).
393## <which> can be a number of indecomposable or the multiplicity vector.
394##
395
396InstallMethod( DegOrderPredecessors,
397
398  [ IsARQuiverNumerical, IsObject ],
399  function( AR, which )
400    local solutions, vv, vd, y, collected, Generate,
401          Ct, simples, p, n, i, j, ttime, colsofA, vec,
402	  pos_of_which, found, vecwhich;
403
404    # Auxiliary recursive function generating all solutions
405    Generate := function(yy, current, lcollected)
406      local ii, howmany, veccurrent, next, yyy, jj, kk, res, isleq;
407
408       veccurrent := colsofA[current];
409       howmany := HowManyTimes(veccurrent, vv - lcollected);
410
411       next := NextNonsimple(simples, current);
412
413       for ii in [0..howmany] do
414
415         yy[current] := ii;  # generating all possible values at position "current"
416
417         if next > n then # now we have whole vector generated
418            yyy := ShallowCopy(yy);
419            for jj in [1..p] do
420              res := 0;
421              for kk in [1..n] do
422                res := res + (Ct[jj][kk] * yyy[kk]);
423              od;
424              yyy[simples[jj]] := vv[jj] - res;
425            od;
426
427	    kk := p + 1;
428	    isleq := true;
429	    while isleq and (kk <= n) do # here we check if  yyy DegOrderLEQ which
430              if Ct[kk] * yyy > vd[kk-p] then
431                isleq := false;
432              fi;
433              kk := kk + 1;
434            od;
435
436	    if isleq then
437              Append(solutions, [ShallowCopy(yyy)]);
438	    fi;
439         fi;
440
441         if next <= n then
442           Generate(yy, next, lcollected + (ii * veccurrent));
443         fi;
444
445       od;
446
447    end; # Generate local
448
449    # Read data from AR
450    n := NumberOfIndecomposables(AR);
451    p := NumberOfProjectives(AR);
452    Ct := AR!.DimHomMat;
453    simples := AR!.Simples;
454
455    ttime := Runtime();
456
457    # Prepare list of columns of "matrix Ad"
458    # to speed up further computations
459    colsofA := [];
460    for i in [1..n] do
461      vec := [];
462      for j in [1..p] do
463        Append(vec, [Ct[j][i]]);
464      od;
465      Append(colsofA, [ShallowCopy(vec)]);
466    od;
467
468    # Prepare vector vv = dim vect (which)
469    vv := DimensionVector(AR, which);
470
471    # Prepare the vector vd = [ [X,which] ] for all indec. nonproj. X
472    if IsPosInt(which) then
473      vd := [];
474      for j in [p+1..n] do
475        Append(vd, [Ct[j][which]]);
476      od;
477    else # which is a multiplicity vector
478      vd := Ct{[p+1..n]} * which;
479    fi;
480
481    solutions := [];
482    y := NullMat(1, n)[1];
483    collected := NullMat(1, p)[1];
484    Generate(y, NextNonsimple(simples, 0), collected);
485
486    # throw out <which> from solutions
487    if IsPosInt(which) then
488      vecwhich := NullMat(1, n)[1];
489      vecwhich[which] := 1;
490    else
491      vecwhich := which;
492    fi;
493    pos_of_which := Position(solutions, vecwhich);
494    solutions := Concatenation(solutions{[1..pos_of_which-1]},
495                               solutions{[pos_of_which+1..Length(solutions)]});
496
497    #Print("Time (=, <=): ", Float((Runtime()-ttime)/1000), "\n");
498
499    return solutions;
500
501 end
502); # DegOrderPredecessors
503
504
505
506
507######################################################
508##
509#O DegOrderDirectPredecessors( <AR> , <which>)
510##
511## This function generates all modules (= multiplicity vectors)
512## which are the DIRECT predecessors of module <which> in deg order,
513## that is all M's such that M degenerates to <which> (M < <which>)
514## and there is no M' s.t. M < M' < <which>
515##
516## <which> can be a number of indecomposable or the multiplicity vector.
517## Naive method!!
518
519InstallMethod( DegOrderDirectPredecessors,
520
521  [ IsARQuiverNumerical, IsObject ],
522  function( AR, which )
523    local preds, factorizes, i, j, r, ttime, results;
524
525    preds := DegOrderPredecessors(AR, which);
526
527    ttime := Runtime();
528    r := Length(preds);
529    results := [];
530    for i in [1..r] do # check if preds[i] factorizes by sth
531      factorizes := false;
532      j := 1;
533      while (not factorizes) and (j <= r) do
534        if (i <> j) and (DegOrderLEQNC(AR, preds[i], preds[j])) then
535          factorizes := true;
536        fi;
537        j := j + 1;
538      od;
539      if not factorizes then
540        Append(results, [preds[i]]);
541      fi;
542    od;
543
544    #Print("Time (Direct): ", Float((Runtime()-ttime)/1000), "\n");
545
546    return results;
547
548 end
549); # DegOrderDirectPredecessors
550
551
552
553
554######################################################
555##
556#O DegOrderPredecessorsWithDirect( <AR> , <which>)
557##
558## This function returns a pair (2-element list) [p, dp] where
559## p = result of function DegOrderPredecessors;
560## dp = result of function DegOrderDirectPredecessors;
561##
562## The function generates predecessors only once,
563## so the runtime is exactly the same as  DegOrderDirectPredecessors
564##
565## <which> can be a number of indecomposable or the multiplicity vector.
566## Naive method!!
567
568InstallMethod( DegOrderPredecessorsWithDirect,
569
570  [ IsARQuiverNumerical, IsObject ],
571  function( AR, which )
572    local preds, factorizes, i, j, r, ttime, results;
573
574    preds := DegOrderPredecessors(AR, which);
575
576    ttime := Runtime();
577    r := Length(preds);
578    results := [];
579    for i in [1..r] do # check if preds[i] factorizes by sth
580      factorizes := false;
581      j := 1;
582      while (not factorizes) and (j <= r) do
583        if (i <> j) and (DegOrderLEQNC(AR, preds[i], preds[j])) then
584          factorizes := true;
585        fi;
586        j := j + 1;
587      od;
588      if not factorizes then
589        Append(results, [preds[i]]);
590      fi;
591    od;
592
593    #Print("Time (Direct): ", Float((Runtime()-ttime)/1000), "\n");
594
595    return [preds, results];
596
597 end
598); # DegOrderPredecessorsWithDirect
599
600
601
602
603
604
605
606
607
608
609######################################################
610##
611#O DegOrderSuccessors( <AR> , <which>)
612##
613## This function generates all modules (= multiplicity vectors)
614## which are the successors of module <which> in deg order,
615## that is all M's such that <which> degenerates to M (<which> < M).
616## <which> can be a number of indecomposable or the multiplicity vector.
617##
618
619InstallMethod( DegOrderSuccessors,
620
621  [ IsARQuiverNumerical, IsObject ],
622  function( AR, which )
623    local solutions, vv, vd, y, collected, Generate,
624          Ct, simples, p, n, i, j, ttime, colsofA, vec,
625		  pos_of_which, found, vecwhich;
626
627    # Auxiliary recursive function generating all solutions
628    Generate := function(yy, current, lcollected)
629      local ii, howmany, veccurrent, next, yyy, jj, kk, res, isgeq;
630
631       veccurrent := colsofA[current];
632       howmany := HowManyTimes(veccurrent, vv - lcollected);
633
634       next := NextNonsimple(simples, current);
635
636       for ii in [0..howmany] do
637
638         yy[current] := ii;  # generating all possible values at position "current"
639
640         if next > n then # now we have whole vector generated
641            yyy := ShallowCopy(yy);
642            for jj in [1..p] do
643              res := 0;
644              for kk in [1..n] do
645                res := res + (Ct[jj][kk] * yyy[kk]);
646              od;
647              yyy[simples[jj]] := vv[jj] - res;
648            od;
649
650  	    kk := p + 1;
651            isgeq := true;
652	    while isgeq and (kk <= n) do # here we check if  which DegOrderLEQ yyy
653              if Ct[kk] * yyy < vd[kk-p] then
654                isgeq := false;
655              fi;
656              kk := kk + 1;
657            od;
658
659	    if isgeq then
660              Append(solutions, [ShallowCopy(yyy)]);
661	    fi;
662         fi;
663
664         if next <= n then
665           Generate(yy, next, lcollected + (ii * veccurrent));
666         fi;
667
668       od;
669
670    end; # Generate local
671
672    # Read data from AR
673    n := NumberOfIndecomposables(AR);
674    p := NumberOfProjectives(AR);
675    Ct := AR!.DimHomMat;
676    simples := AR!.Simples;
677
678    ttime := Runtime();
679
680    # Prepare list of columns of "matrix Ad"
681    # to speed up further computations
682    colsofA := [];
683    for i in [1..n] do
684      vec := [];
685      for j in [1..p] do
686        Append(vec, [Ct[j][i]]);
687      od;
688      Append(colsofA, [ShallowCopy(vec)]);
689    od;
690
691    # Prepare vector vv = dim vect (which)
692    vv := DimensionVector(AR, which);
693
694    # Prepare the vector vd = [ [X,which] ] for all indec. nonproj. X
695    if IsPosInt(which) then
696      vd := [];
697    for j in [p+1..n] do
698      Append(vd, [Ct[j][which]]);
699    od;
700    else # which is a multiplicity vector
701      vd := Ct{[p+1..n]} * which;
702    fi;
703
704    solutions := [];
705    y := NullMat(1, n)[1];
706    collected := NullMat(1, p)[1];
707    Generate(y, NextNonsimple(simples, 0), collected);
708
709    # throw out <which> from solutions
710    if IsPosInt(which) then
711      vecwhich := NullMat(1, n)[1];
712      vecwhich[which] := 1;
713    else
714      vecwhich := which;
715    fi;
716    pos_of_which := Position(solutions, vecwhich);
717    solutions := Concatenation(solutions{[1..pos_of_which-1]},
718                               solutions{[pos_of_which+1..Length(solutions)]});
719
720    #Print("Time (DegOrderSuccessors =, >=): ", Float((Runtime()-ttime)/1000), "\n");
721
722    return solutions;
723
724 end
725); # DegOrderSuccessors
726
727
728
729
730######################################################
731##
732#O DegOrderDirectSuccessors( <AR> , <which>)
733##
734## This function generates all modules (= multiplicity vectors)
735## which are the DIRECT successors of module <which> in deg order,
736## that is all M's such that <which> degenerates to M (<which> < M)
737## and there is no M' s.t. <which> < M' < M
738##
739## <which> can be a number of indecomposable or the multiplicity vector.
740## Naive method!!
741
742InstallMethod( DegOrderDirectSuccessors,
743
744  [ IsARQuiverNumerical, IsObject ],
745  function( AR, which )
746    local succs, factorizes, i, j, r, ttime, results;
747
748    succs := DegOrderSuccessors(AR, which);
749
750    ttime := Runtime();
751    r := Length(succs);
752    results := [];
753    for i in [1..r] do # check if succs[i] factorizes by sth
754      factorizes := false;
755      j := 1;
756      while (not factorizes) and (j <= r) do
757        if (i <> j) and (DegOrderLEQNC(AR, succs[j], succs[i])) then
758          factorizes := true;
759        fi;
760        j := j + 1;
761      od;
762      if not factorizes then
763        Append(results, [succs[i]]);
764      fi;
765    od;
766
767    #Print("Time (Direct): ", Float((Runtime()-ttime)/1000), "\n");
768
769    return results;
770
771 end
772); # DegOrderDirectSuccessors
773
774
775######################################################
776##
777#O DegOrderSuccessorsWithDirect( <AR> , <which>)
778##
779## This function returns a pair (2-element list) [s, ds] where
780## s = result of function DegOrderSuccessors;
781## ds = result of function DegOrderDirectSuccessors;
782##
783## The function generates successors only once,
784## so the runtime is exactly the same as  DegOrderDirectSuccessors
785##
786## <which> can be a number of indecomposable or the multiplicity vector.
787## Naive method!!
788
789InstallMethod( DegOrderSuccessorsWithDirect,
790
791  [ IsARQuiverNumerical, IsObject ],
792  function( AR, which )
793    local succs, factorizes, i, j, r, ttime, results;
794
795    succs := DegOrderSuccessors(AR, which);
796
797    ttime := Runtime();
798    r := Length(succs);
799    results := [];
800    for i in [1..r] do # check if succs[i] factorizes by sth
801      factorizes := false;
802      j := 1;
803      while (not factorizes) and (j <= r) do
804        if (i <> j) and (DegOrderLEQNC(AR, succs[j], succs[i])) then
805          factorizes := true;
806        fi;
807        j := j + 1;
808      od;
809      if not factorizes then
810        Append(results, [succs[i]]);
811      fi;
812    od;
813
814    #Print("Time (Direct): ", Float((Runtime()-ttime)/1000), "\n");
815
816    return [succs, results];
817
818 end
819); # DegOrderSuccessorsWithDirect
820
821
822
823
824
825######################################################
826##
827#O DimensionVector( <AR> , <which>)
828##
829## This function returns the dimension vector of module
830## indicated by <which>. The order of dimension is exactly
831## the same as the order of corresponding projective indecomposables
832## in ARQuiverNumerical <AR>.
833## <which> can be a number of indecomposable or the multiplicity vector.
834##
835
836InstallMethod( DimensionVector,
837
838  [ IsARQuiverNumerical, IsObject ],
839  function( AR, which )
840    local j, p, n, vec;
841
842    n := NumberOfIndecomposables(AR);
843    p := NumberOfProjectives(AR);
844
845    if IsList(which) and (Length(which) = n) then
846      return AR!.DimHomMat{[1..p]} * which;
847    elif IsPosInt(which) and (which in [1..n]) then
848      vec := [];
849      for j in [1..p] do
850        Append(vec, [AR!.DimHomMat[j][which]]);
851      od;
852      return vec;
853    else
854      Error("second parameter should be a number if indecomposable or the multiplicity vector!");
855    fi;
856
857 end
858); # DimensionVector
859
860
861
862######################################################
863##
864#O DimHom( <AR> , <M>, <N>)
865##
866## This function returns the dimension of Homspace
867## between modules <M> and <N>.
868## <M> and <N> can be either numbers of indecomposables or the multiplicity vectors.
869##
870
871InstallMethod( DimHom,
872
873  [ IsARQuiverNumerical, IsObject, IsObject ],
874  function( AR, M, N )
875    local i, j, n, vec, sum;
876
877    n := NumberOfIndecomposables(AR);
878
879    if IsPosInt(M) and IsPosInt(N) and (M in [1..n]) and (N in [1..n]) then
880      # number, number
881      return AR!.DimHomMat[M][N];
882    elif IsPosInt(M) and (M in [1..n]) and IsList(N) and (Length(N) = n) then
883      # number, vector
884      sum := 0;
885      for j in [1..n] do
886        sum := sum + (AR!.DimHomMat[M][j] * N[j]);
887      od;
888      return sum;
889    elif IsPosInt(N) and (N in [1..n]) and IsList(M) and (Length(M) = n) then
890      # vector, number
891      sum := 0;
892      for j in [1..n] do
893        sum := sum + (M[j] * AR!.DimHomMat[j][N]);
894      od;
895      return sum;
896    elif IsList(M) and IsList(N) and (Length(M) = n) and (Length(N) = n) then
897      # vector, vector
898      sum := 0;
899      for i in [1..n] do
900        for j in [1..n] do
901          sum := sum + (M[i] * AR!.DimHomMat[i][j] * N[j]);
902        od;
903      od;
904      return sum;
905    else
906      Error("second and third parameter should be a number if indecomposable or the multiplicity vector!");
907    fi;
908
909 end
910); # DimHom
911
912
913######################################################
914##
915#O DimEnd( <AR> , <M> )
916##
917## This function returns the dimension of endomorphism algebra
918## of module <M>.
919## <M> can be either number of indecomposables or the multiplicity vector.
920##
921
922InstallMethod( DimEnd,
923
924  [ IsARQuiverNumerical, IsObject ],
925  function( AR, M )
926    return DimHom(AR, M, M);
927 end
928); # DimEnd
929
930
931
932######################################################
933##
934#O OrbitDim( <AR> , <M> )
935##
936## This function returns the dimension of the orbit of module <M>
937## (in the variety of representations of quiver with relations).
938## OrbitDim = d_1^2+...+d_p^2 - dim End(<M>), where (d_i)_i = DimVect(<M>).
939## <M>  can be either number of indecomposable or the multiplicity vector.
940##
941##
942
943InstallMethod( OrbitDim,
944
945  [ IsARQuiverNumerical, IsObject ],
946  function( AR, M )
947    local dimvect, d, sum;
948
949      dimvect := DimensionVector(AR, M);
950      sum := 0;
951      for d in dimvect do
952       sum := sum + d^2;
953      od;
954
955    return sum - DimEnd(AR, M);
956 end
957); # OrbitDim
958
959
960
961######################################################
962##
963#O OrbitCodim( <AR> , <M> , <N>)
964##
965## This function returns the codimension of orbits of modules <M> and <N>
966## (= dim End(<N>) - dim End(<M>)).
967## <M> and <N> can be either numbers of indecomposables or the multiplicity vectors.
968##
969## NOTE: Function does not check if it makes sense, i.e. if <M> and <N> are in the same
970## variety ( = dimension vectors coincide)!
971##
972
973InstallMethod( OrbitCodim,
974
975  [ IsARQuiverNumerical, IsObject, IsObject ],
976  function( AR, M, N )
977    return DimEnd(AR, N) - DimEnd(AR, M);
978 end
979); # OrbitCodim
980
981
982######################################################
983##
984#O DegOrderLEQ( <AR> , <M> , <N>)
985##
986## This function returns true if <M> <= <N> in degeneration order
987## i.e. <N> is a degeneration of <M>
988## (<=> <M> <= <N> in Hom-order; we are in finite type, cf. Zwara's thm).
989##
990## <M> and <N> can be either numbers of indecomposables or the multiplicity vectors.
991##
992## NOTE: Function checks if it makes sense, i.e. if <M> and <N> are in the same
993## variety ( = dimension vectors coincide). If not, it returns false
994## and prints warning.
995##
996
997InstallMethod( DegOrderLEQ,
998
999  [ IsARQuiverNumerical, IsObject, IsObject ],
1000  function( AR, M, N )
1001    local i, n, isleq;
1002
1003    if DimensionVector(AR, M) = DimensionVector(AR, N) then
1004      isleq := true;
1005      n := NumberOfIndecomposables(AR);
1006	    i := NumberOfProjectives(AR) + 1;
1007
1008      if IsList(M) and IsPosInt(N) then
1009        while isleq and (i <= n) do
1010          if AR!.DimHomMat[i] * M > AR!.DimHomMat[i][N] then
1011            isleq := false;
1012          fi;
1013          i := i + 1;
1014        od;
1015	    elif IsList(M) and IsList(N) then
1016        while isleq and (i <= n) do
1017          if AR!.DimHomMat[i] * M > AR!.DimHomMat[i] * N then
1018            isleq := false;
1019          fi;
1020          i := i + 1;
1021        od;
1022      elif IsPosInt(M) and IsList(N) then
1023        while isleq and (i <= n) do
1024          if AR!.DimHomMat[i][M] > AR!.DimHomMat[i] * N then
1025            isleq := false;
1026          fi;
1027          i := i + 1;
1028        od;
1029	    elif IsPosInt(M) and IsPosInt(N) then
1030        while isleq and (i <= n) do
1031          if AR!.DimHomMat[i][M] > AR!.DimHomMat[i][N] then
1032            isleq := false;
1033          fi;
1034          i := i + 1;
1035        od;
1036	    fi;
1037
1038      return isleq;
1039    else
1040      Print("Modules are not in the same variety (their dimension vectors are different)!\n");
1041      return false;
1042    fi;
1043 end
1044); # DegOrderLEQ
1045
1046######################################################
1047##
1048#O DegOrderLEQNC( <AR> , <M> , <N>)
1049##
1050## This function returns true if <M> <= <N> in degeneration order
1051## i.e. <N> is a degeneration of <M>
1052## (<=> <M> <= <N> in Hom-order; we are in finite type, cf. Zwara's thm).
1053##
1054## <M> and <N> can be either numbers of indecomposables or the multiplicity vectors.
1055##
1056## NOTE: Function does not check if it makes sense, i.e. if <M> and <N> are in the same
1057## variety ( = dimension vectors coincide). If not, the result doesn't make sense!
1058##
1059
1060InstallMethod( DegOrderLEQNC,
1061
1062  [ IsARQuiverNumerical, IsObject, IsObject ],
1063  function( AR, M, N )
1064    local i, n, isleq;
1065
1066    isleq := true;
1067    n := NumberOfIndecomposables(AR);
1068    i := NumberOfProjectives(AR) + 1;
1069
1070    if IsList(M) and IsList(N) then
1071      while isleq and (i <= n) do
1072        if AR!.DimHomMat[i] * M > AR!.DimHomMat[i] * N then
1073          isleq := false;
1074        fi;
1075        i := i + 1;
1076      od;
1077    elif IsList(M) and IsPosInt(N) then
1078      while isleq and (i <= n) do
1079        if AR!.DimHomMat[i] * M > AR!.DimHomMat[i][N] then
1080          isleq := false;
1081        fi;
1082        i := i + 1;
1083      od;
1084
1085    elif IsPosInt(M) and IsList(N) then
1086      while isleq and (i <= n) do
1087        if AR!.DimHomMat[i][M] > AR!.DimHomMat[i] * N then
1088          isleq := false;
1089        fi;
1090        i := i + 1;
1091      od;
1092   elif IsPosInt(M) and IsPosInt(N) then
1093      while isleq and (i <= n) do
1094        if AR!.DimHomMat[i][M] > AR!.DimHomMat[i][N] then
1095          isleq := false;
1096        fi;
1097        i := i + 1;
1098      od;
1099    fi;
1100
1101    return isleq;
1102
1103 end
1104); # DegOrderLEQNC
1105
1106
1107
1108
1109######################################################
1110##
1111#O PrintMultiplicityVector( <mv>)
1112##
1113## This function prints the multiplicity vector <mv>
1114## in a more "readable" way (especially useful if
1115## <mv> is long and sparse). It prints a "sum" of nonzero multiplicities
1116## in the form "multiplicity * (no.-of-indecomposable)".
1117##
1118
1119InstallMethod( PrintMultiplicityVector,
1120
1121  [ IsList ],
1122  function( mv )
1123    local i, firstprinted;
1124
1125        firstprinted := false;
1126
1127	for i in [1..Length(mv)] do
1128	  if mv[i] <> 0 then
1129	    if not firstprinted then
1130	      Print(mv[i],"*(",i,")");
1131	      firstprinted := true;
1132	    else
1133	      Print(" + ",mv[i],"*(",i,")");
1134	    fi;
1135	  fi;
1136	od;
1137	if not firstprinted then
1138	  Print("0");
1139	fi;
1140	Print("\n");
1141
1142 end
1143); # PrintMultiplicityVector
1144
1145
1146######################################################
1147##
1148#O PrintMultiplicityVectors( <list>)
1149##
1150## This function prints all the multiplicity vectors from the <list>
1151## in a more "readable" way, as PrintMultiplicityVector.
1152##
1153
1154InstallMethod( PrintMultiplicityVectors,
1155
1156  [ IsList ],
1157  function( l )
1158    local mv;
1159
1160    for mv in l do
1161      PrintMultiplicityVector(mv);
1162    od;
1163
1164 end
1165); # PrintMultiplicityVectors
1166
1167
1168
1169
1170InstallMethod( PrintObj,
1171  "for ARQuiverNumerical",
1172  true,
1173  [ IsARQuiverNumerical ], 0,
1174  function( G )
1175
1176    Print( "<ARQuiverNumerical with " );
1177    Print( NumberOfIndecomposables(G) );
1178    Print( " indecomposables and " );
1179    Print( NumberOfProjectives(G) );
1180    Print( " projectives>" );
1181
1182  end
1183);
1184
1185InstallMethod( ViewObj,
1186  "for ARQuiverNumerical",
1187  true,
1188  [ IsARQuiverNumerical ], NICE_FLAGS + 1,
1189  function( G )
1190
1191    Print( "<ARQuiverNumerical with " );
1192    Print( NumberOfIndecomposables(G) );
1193    Print( " indecomposables and " );
1194    Print( NumberOfProjectives(G) );
1195    Print( " projectives>" );
1196end
1197);
1198
1199
1200######################################################
1201##
1202#O TestCodimConjecture( <AR>, <printbool>, <breakbool> )
1203##
1204## This function tests the A-R quiver <AR> for the following
1205## hypothesis:
1206## Given M,N such that M < N and N is indecomposable.
1207## M is a direct deg-predecessor of N (i.e. there is no M' s.t. M < M' < N)
1208## <=> Codim(M, N) = 1.
1209## The function tests case by case all indecomposables.
1210## Additional arguments:
1211## <printbool> = true - function prints more info (consecutive tested indesomposables).
1212## <printbool> = false - function prints less info.
1213## <breakbool> = true - function breaks when a counterexample is found.
1214## <breakbool> = false - function doesn't break when a counterexample is found
1215##               (it collects all possible counterexamples).
1216## Function prints a summary.
1217
1218InstallMethod( TestCodimConjecture,
1219
1220  [ IsARQuiverNumerical, IsBool, IsBool ],
1221  function( AR, printbool, breakbool )
1222    local ind, n, ttime, cexs, preddpred, vec,
1223          no_of_dpred, no_of_pred, no_of_cexs, no_of_cexs_loc;
1224
1225    ttime := Runtime();
1226
1227    n := NumberOfIndecomposables(AR);
1228    no_of_dpred := 0;
1229	no_of_pred := 0;
1230    no_of_cexs := 0;
1231    cexs := [];
1232
1233    for ind in [1..n] do
1234      preddpred := DegOrderPredecessorsWithDirect(AR, ind);
1235      no_of_pred := no_of_pred + Length(preddpred[1]);
1236	  no_of_dpred := no_of_dpred + Length(preddpred[2]);
1237      no_of_cexs_loc := 0;
1238      for vec in preddpred[2] do
1239         if OrbitCodim(AR, vec, ind) <> 1 then
1240           no_of_cexs_loc := no_of_cexs_loc + 1;
1241           if breakbool then
1242             Print("Counterexample founded!\n");
1243             Print("Total runtime: ", Float((Runtime()-ttime)/1000), " sec.\n");
1244             return [vec, ind];
1245           fi;
1246           Append(cexs, [[vec, ind]]);
1247         fi;
1248      od;
1249      no_of_cexs := no_of_cexs + no_of_cexs_loc;
1250      if printbool then
1251        Print("Ind.: ", ind, "/",n,"; deg-predecessors: ", Length(preddpred[1]),
1252		      "; direct: ", Length(preddpred[2]),"\n");
1253        if no_of_cexs_loc > 0 then
1254          Print("\nCounterexamples: ",no_of_cexs_loc,"!\n");
1255        fi;
1256      fi;
1257    od;
1258
1259    if printbool then
1260      Print("\n");
1261    fi;
1262    Print("Summary:\n", n," indecomposables,\n", no_of_pred, " deg-predecessors of indecomposables,\n");
1263    Print(no_of_dpred, " direct deg-predecessors of indecomposables.\n");
1264    Print(no_of_cexs, " counterexample(s) founded.\n");
1265    if no_of_cexs > 0 then
1266      Print("Conjecture disproved!");
1267    else
1268      Print("Conjecture confirmed.");
1269    fi;
1270    Print("\nTotal runtime: ", Float((Runtime()-ttime)/1000), " sec.\n");
1271
1272    return cexs;
1273
1274 end
1275); # TestCodimConjecture
1276
1277
1278
1279
1280
1281
1282######################################################
1283##
1284#F PredefARQuivers(<name>, [<param1> [,<param2>]])
1285##
1286## An auxiliary function containing predefined AR quivers.
1287## it returns a list of three elements <ind>, <proj>, <list>
1288## as in the description of ARQuiverNumerical.
1289## So far we have the following AR quivers:
1290## <name> =
1291##
1292## <name> = "BG" =
1293##        an algebra from Bongartz-Gabriel list of maximal
1294##        algebras of finite type with 2 simples. Then
1295##        <param1> = number of an algebra from B-G list
1296##                  (so far <param1> = 1,2)
1297##        <param2> = additional parameter defining algebra no. <param1>
1298##                   <param2> is necessary for B-G algebras with numbers:
1299##                   1
1300##
1301##
1302
1303InstallGlobalFunction( PredefARQuivers,
1304  function( arg )
1305    local data, i, r, orb, orbits, ono;
1306
1307    data := [];
1308
1309    if (Length(arg) = 1) and (arg[1] = "what") then
1310      Print("1) (\"BG\",i), for i=2,5,7,8,9,11,12,13,14, algebra no. i from Bongartz-Gabriel list ");
1311      Print("of maximal finite type with 2 simples;\n");
1312      Print("2) (\"BG\",i,r), for i=1,3,4,6,10; r>=1; algebra no. i with parameter r ");
1313      Print("from Bongartz-Gabriel list of maximal finite type with 2 simples;\n");
1314
1315      Print("3) (\"D4 subspace\"), path algebra of Dynkin quiver D4 with ");
1316      Print("subspace\n orientation of arrows;\n");
1317      Print("4) (\"E6 subspace\"), path algebra of Dynkin quiver E6 with ");
1318      Print("subspace\n orientation of arrows;\n");
1319      Print("5) (\"A3 zero\"), path algebra of equioriented Dynkin quiver A3  ");
1320      Print("modulo unique zero relation of length 2;\n");
1321      Print("6) (\"A1,2 zero\"), path algebra of Euclidean quiver A1,2 modulo zero relation  ");
1322      Print("(i.e. Quiver(3,[[3,1,\"a\"],[3,2,\"b\"],[2,1,\"c\"]])/(bc) );\n");
1323      Print("7) (\"A2,2 comm\"), path algebra of Euclidean quiver A2,2 modulo unique commutativity relation;\n");
1324      Print("8) (\"R nilp\"), one arrow + one loop modulo nilpotency deg. 2  ");
1325      Print("(i.e. Quiver(2,[[2,1,\"a\"],[1,1,\"b\"]])/(b^2) );\n");
1326      return false;
1327    fi;
1328
1329    if Length(arg) = 3 then
1330
1331      if (arg[1] = "BG") and (arg[2] = 1) then # Bongartz-Gabriel list no. 1
1332        r := arg[3];
1333        data[1] := 8 * r;
1334        data[2] := 2;
1335        data[3] := [[4,0],[3,0]];
1336        for i in [1..4*r-2] do
1337          Append(data[3], [ [2*i-1, 2*i+4, 2*i+2], [2*i, 2*i+3, 2*i+1]]);
1338        od;
1339        Append(data[3], [[8*r-3, 8*r],[8*r-2, 8*r-1]]);
1340      elif (arg[1] = "BG") and (arg[2] = 6) and (arg[3]=1) then # Bongartz-Gabriel list no. 6, by orbits, r=1
1341        data[1] := 9;
1342        data[2] := 2;
1343        data[3] := [ "orbits", [
1344            [0,[4,0]],#1
1345            [1,[3,2]],#2
1346            [3,[4,0],[2,1]],#3
1347            [1,[3,1],[3,3]]#4
1348          ]
1349        ];
1350      elif (arg[1] = "BG") and (arg[2] = 6) and (arg[3]>=2) then # Bongartz-Gabriel list no. 6, by orbits, series, r>=2
1351        data[1] := 0;
1352        data[2] := 2;
1353        r := arg[3];
1354        orbits :=  [
1355          [2*r-2,[4,0]],#1
1356          [1,[3,2*r]],#2
1357          [2*r+1,[2,1],[4,2*r]]#3
1358        ];
1359        if r = 2 then
1360          Add(orbits, [2*r+1,[3,1],[5,2]]); #4
1361        else Add(orbits, [2*r+1,[3,1],[5,2*r+1]]); #4
1362        fi;
1363        ono := 4;
1364        for i in [1..r-3] do #5..second before last
1365          ono := ono + 1;
1366          Add(orbits, [2*r+1,[ono+1,2*r+1],[ono-1,0]]);
1367        od;
1368        if r > 2 then
1369          ono := ono + 1;
1370          Add(orbits, [2*r+1, [ono+1,r],[ono-1,0]]);
1371        fi;
1372        Add(orbits, [r,[ono,r+1],[ono,0]] ); # last
1373        data[3] := [ "orbits", orbits ];
1374        for orb in data[3][2] do
1375          data[1] := data[1] + orb[1] + 1;
1376        od;
1377      elif (arg[1] = "BG") and (arg[2] = 10) and (arg[3] >= 1) then # Bongartz-Gabriel list no. 10, by orbits, r>=1, n=r+3
1378        data[1] := 0;
1379        data[2] := 2;
1380        r := arg[3];
1381        orbits :=  [
1382          [0,[3,0]],#1
1383          [0,[2*r+7,1]],#2
1384          [1,[4,1]]#3
1385        ];
1386        ono := 3;
1387        for i in [4..2*r+6] do #
1388          ono := ono + 1;
1389          Add(orbits, [1,[ono+1,1],[ono-1,0]]);
1390        od;
1391        Add(orbits, [1,[2,0],[2*r+6,0],[2*r+8,1]] ); # one before last - no 2r+7
1392		Add(orbits, [1,[2*r+7,0]] ); # last - no 2r+8
1393        data[3] := [ "orbits", orbits ];
1394        for orb in data[3][2] do
1395          data[1] := data[1] + orb[1] + 1;
1396        od;
1397      elif (arg[1] = "BG") and (arg[2] = 3) and (arg[3] = 1) then # Bongartz-Gabriel list no. 3, by orbits, r=1, omega=r+1
1398        data[1] := 0;
1399        data[2] := 2;
1400        orbits :=  [
1401          [1,[3,0],[3,2]],#1
1402          [1,[3,0]],#2
1403          [3,[1,1]]#3
1404        ];
1405        data[3] := [ "orbits", orbits ];
1406        for orb in data[3][2] do
1407          data[1] := data[1] + orb[1] + 1;
1408        od;
1409      elif (arg[1] = "BG") and (arg[2] = 3) and (arg[3] >= 2) then # Bongartz-Gabriel list no. 3, by orbits, r>=2, omega=r+1
1410        data[1] := 0;
1411        data[2] := 2;
1412        r := arg[3];
1413        orbits :=  [
1414          [r,[3,0],[r+2,2]],#1
1415          [1,[r+2,0]],#2
1416          [r+2,[4,r+2]]#3
1417        ];
1418        ono := 3;
1419        for i in [4..r+1] do #
1420          ono := ono + 1;
1421          Add(orbits, [r+2,[ono+1,r+2],[ono-1,0]]);
1422        od;
1423		    Add(orbits, [r+2,[ono,0],[1,r]] ); # last - no r+2
1424        data[3] := [ "orbits", orbits ];
1425        for orb in data[3][2] do
1426          data[1] := data[1] + orb[1] + 1;
1427        od;
1428      elif (arg[1] = "BG") and (arg[2] = 4) and (arg[3] = 1) then # Bongartz-Gabriel list no. 4, by orbits, r=1, omega=r+1=2
1429        data[1] := 0;
1430        data[2] := 2;
1431        orbits :=  [
1432          [4,[2,0],[1,2]],#1
1433          [2,[3,0]],#2
1434          [3,[4,1]],#3
1435		  [1,[3,0],[3,2]]#4
1436        ];
1437        data[3] := [ "orbits", orbits ];
1438        for orb in data[3][2] do
1439          data[1] := data[1] + orb[1] + 1;
1440        od;
1441      elif (arg[1] = "BG") and (arg[2] = 4) and (arg[3] = 2) then # Bongartz-Gabriel list no. 4, by orbits, r=2, omega=r+1=3
1442        data[1] := 0;
1443        data[2] := 2;
1444        orbits :=  [
1445          [5,[2,0],[3,0]],#1
1446          [3,[4,0]],#2
1447          [2,[1,2],[1,5]],#3
1448		  [4,[5,4]],#4
1449		  [4,[5,2],[4,0]] #5
1450        ];
1451        data[3] := [ "orbits", orbits ];
1452        for orb in data[3][2] do
1453          data[1] := data[1] + orb[1] + 1;
1454        od;
1455      elif (arg[1] = "BG") and (arg[2] = 4) and (arg[3] = 3) then # Bongartz-Gabriel list no. 4, by orbits, r=3, omega=r+1=4
1456        data[1] := 0;
1457        data[2] := 2;
1458		r := arg[3];
1459        orbits :=  [
1460          [6,[2,0],[3,3]],#1
1461          [4,[4,0]],#2
1462          [6,[3,3],[1,3]],#3
1463          [5,[5,5]],#4
1464          [5,[4,0],[6,2]], #5
1465           [2,[5,0],[5,3]], #6
1466        ];
1467        data[3] := [ "orbits", orbits ];
1468        for orb in data[3][2] do
1469          data[1] := data[1] + orb[1] + 1;
1470        od;
1471      elif (arg[1] = "BG") and (arg[2] = 4) and (arg[3] > 3) and (arg[3] mod 2 = 0) then # Bongartz-Gabriel list no. 4, by orbits, r>3, omega=r+1, r even
1472        data[1] := 0;
1473        data[2] := 2;
1474        r := arg[3];
1475        orbits :=  [
1476          [r+3,[2,0],[3,3]],#1
1477          [r+1,[3+r/2,0]],#2
1478          [r+3,[1,r],[4,0]],#3
1479        ];
1480        ono := 3;
1481        for i in [4..2+r/2-1] do
1482          ono := ono + 1;
1483          Add(orbits,[r+3,[ono+1,0],[ono-1,r+3]]);
1484        od;
1485        ono := ono + 1;
1486        Add(orbits, [(r+2)/2, [ono-1,(r+2)/2],[ono-1,r+3]]);
1487        ono := ono + 1;
1488        Add(orbits, [r+2, [ono+1, r+2]]);
1489        for i in [1..(r+2)/2-2] do
1490          ono := ono + 1;
1491          Add(orbits, [r+2, [ono-1,0],[ono+1,r+2]]);
1492        od;
1493        Add(orbits, [r+2, [ono,0],[ono+1,(r+2)/2]]);
1494        data[3] := [ "orbits", orbits ];
1495        for orb in data[3][2] do
1496          data[1] := data[1] + orb[1] + 1;
1497        od;
1498      elif (arg[1] = "BG") and (arg[2] = 4) and (arg[3] > 3) and (arg[3] mod 2 = 1) then # Bongartz-Gabriel list no. 4, by orbits, r>=5, omega=r+1, r odd
1499        data[1] := 0;
1500        data[2] := 2;
1501        r := arg[3];
1502        orbits :=  [
1503          [r+3,[2,0],[3,3]],#1
1504          [r+1,[(r-1)/2+3,0]],#2
1505          [r+3,[4,0],[1,r]],#3
1506        ];
1507        ono := 3;
1508        for i in [1..(r-1)/2-2] do
1509          ono := ono + 1;
1510          Add(orbits,[r+3,[ono-1,r+3],[ono+1,0]]);
1511        od;
1512        ono := ono + 1;
1513        Add(orbits, [r+3, [ono-1,r+3],[ono,(r+3)/2]]);
1514        ono := ono + 1;
1515        Add(orbits, [r+2, [ono+1,r+2]]);
1516        for i in [1..(r+3)/2-3] do
1517          ono := ono + 1;
1518          Add(orbits, [r+2, [ono-1,0],[ono+1,r+2]]);
1519        od;
1520        ono := ono + 1;
1521        Add(orbits, [r+2, [ono-1,0],[ono+1,(r+1)/2]]);
1522        ono := ono + 1;
1523        Add(orbits, [(r+1)/2, [ono-1,0],[ono-1,(r+1)/2+1]]);
1524        data[3] := [ "orbits", orbits ];
1525        for orb in data[3][2] do
1526          data[1] := data[1] + orb[1] + 1;
1527        od;
1528      fi;
1529    fi;
1530
1531    if Length(arg) = 2 then
1532
1533      if (arg[1] = "BG") and (arg[2] = 2)  then # Bongartz-Gabriel list no. 2
1534        data[1] := 66;
1535        data[2] := 2;
1536        data[3] := [
1537          [11,0],[19,0],[12,1],[13,3],#4
1538          [14,4],[15,5],[16,6],[17,7],#8
1539          [18,8],[20,2],[21,10],[22,1,11],#12
1540          [23,3,12],[24,4,13],[25,5,14],[26,6,15],#16
1541          [27,7,16],[28,8,17],[61,66],[30,2,19],#20
1542          [31,10,20],[32,11,21],[33,12,22],[34,13,23],#24
1543          [35,14,24],[36,15,25],[37,16,26],[38,17,27],#28
1544          [39,18,28],[19,54,61],[40,20,30],[42,21,31],#32
1545          [44,22,32],[46,23,33],[48,24,34],[50,25,35],#36
1546          [52,26,36],[54,27,37],[40,28,38],[30,55,38,54],#40
1547          [40,55],[39,31,41,40],[42,41],[56,32,43,42],#44
1548          [44,43],[45,57,33,44],[46,45],[47,58,34,46],#48
1549          [48,47],[49,59,35,48],[50,49],[51,60,36,50],#52
1550          [52,51],[53,61,37,52],[54,53],[29,42,39],#56
1551          [62,44,56],[63,46,57],[64,48,58],[65,50,59],#60
1552          [66,52,60],[56,29],[57,62],[58,63],#64
1553          [59,64],[60,65]
1554         	];
1555      elif (arg[1] = "BG") and (arg[2] = 5)  then # Bongartz-Gabriel list no. 5
1556        data[1] := 72;
1557        data[2] := 2;
1558        data[3] := [
1559          [11,0],[17,0],[12,1],[13,3],#4
1560	  [14,4],[18,2],[19,6],[20,7],#8
1561	  [21,8],[22,9],[23,10],[24,1,11],#12
1562	  [25,3,12],[26,4,13],[27,5,14],[63,69],#16
1563	  [28,16],[29,2,17],[6,30,18],[7,31,19],#20
1564	  [8,32,20],[9,33,21],[10,34,22],[11,35,23],#24
1565	  [12,36,24],[13,37,25],[14,38,26],[47,16,63],#28
1566	  [17,39,28],[18,40,29],[19,41,30],[20,42,31],#32
1567	  [21,43,32],[22,44,33],[23,45,34],[24,46,35],#36
1568	  [25,47,36],[26,39,37],[37,48,28,47],[29,49,38,39],#40
1569	  [30,50,57,40],[31,51,58,41],[32,52,59,42],[33,53,60,43],#44
1570	  [34,54,61,44],[35,55,62,45],[36,56,63,46],[47,56],#48
1571	  [39,48],[40,49],[41,50],[42,51],[43,52],[44,53],#54
1572	  [45,54],[46,55],[40,27,38],[41,64,57],#58
1573	  [42,65,58],[43,66,59],[44,67,60],[45,68,61],#62
1574	  [46,69,62],[57,15,27],[58,70,64],[59,71,65],#66
1575	  [60,72,66],[61,67],[62,68],[64,15],#70
1576	  [65,70],[66,71] #72
1577
1578        ];
1579    elif (arg[1] = "BG") and (arg[2] = 8)  then # Bongartz-Gabriel list no. 8
1580        data[1] := 57;
1581        data[2] := 2;
1582        data[3] := [
1583          [5,0],[4,16,0],[6,1],[7,3],[2,4],[1,8,5],[3,9,6],#7
1584          [5,17,2],[6,18,8],[7,19,9],[20,10]#11
1585         ];
1586	 for i in [1..4] do Add(data[3],[20+i,10+i]); od; #15
1587	 Append(data[3],[ [53,57],[2,26,16],[8,27,17] ]); #18
1588         for i in [1..7] do Add(data[3],[8+i,27+i,17+i]); od; #25
1589         Append(data[3],[ [16,41,53],[17,35,26] ]); #27
1590         for i in [1..6] do Add(data[3],[17+i,35+i,26+i]); od; #33
1591         Append(data[3],[ [24,35,33],[26,42,33,41],[34,43,27,35],[49,44,28,36] ]); #37
1592	 for i in [1..4] do Add(data[3],[49+i,44+i,28+i,36+i]); od; #41
1593         Append(data[3],[ [41,48],[35,42] ]); #43
1594         for i in [1..5] do Add(data[3],[35+i,42+i]); od; #48
1595         Append(data[3],[ [25,36,34],[54,37,49] ]); #50
1596         for i in [1..3] do Add(data[3],[54+i,37+i,49+i]); od; #53
1597         Append(data[3],[ [49,25],[50,54],[51,55],[52,56] ]); #57
1598     elif (arg[1] = "BG") and (arg[2] = 9)  then # Bongartz-Gabriel list no. 9
1599        data[1] := 28;
1600        data[2] := 2;
1601        data[3] := [
1602          [5,0],[21,26,0],[6,1],[11,7],#4
1603	  [8,4],[1,9,5],[3,10,6],[4,12,19,11],#8
1604	  [5,13,16,8],[6,14,17,9],[7,15,18,10],[11,15],#12
1605	  [8,12],[9,13],[10,14],[8,23,19],#16
1606	  [9,20,16],[10,21,17],[11,22,18],[16,25,23],#20
1607	  [17,20],[2,18,21],[19,24,22],[22,27,2],#24
1608	  [23,28,24],[25,28],[2,26],[24,27]#28
1609         ];
1610     elif (arg[1] = "BG") and (arg[2] = 11)  then # Bongartz-Gabriel list no. 11
1611        data[1] := 63;
1612        data[2] := 2;
1613        data[3] := [
1614          [14,0],[10,0],[11,2],[15,1],[16,4],#5
1615         ];
1616	 for i in [1..5] do Add(data[3],[16+i,4+i]); od; #10
1617	 Append(data[3],[ [2,22,10],[3,23,11],[55,60],[24,13],[1,25,14],[4,26,15] ]); #16
1618         for i in [1..7] do Add(data[3],[4+i,26+i,15+i]); od; #23
1619	 Append(data[3],[ [13,41,55],[14,34,24] ]); #25
1620	 for i in [1..7] do Add(data[3],[14+i,34+i,24+i]); od; #32
1621	 Append(data[3],[ [22,34,32],[24,32,42,41],[25,33,43,34],[26,44,50,35] ]); #36
1622	 for i in [1..5] do Add(data[3],[26+i,44+i,50+i,35+i]); od; #41
1623	 Append(data[3],[ [41,49],[34,42] ]); #43
1624	 for i in [1..6] do Add(data[3],[34+i,42+i]); od; #49
1625	 Append(data[3],[ [23,35,33],[56,36,50] ]); #51
1626	 for i in [1..4] do Add(data[3],[56+i,36+i,50+i]); od; #55
1627	 Append(data[3],[ [12,50,23],[51,61,56],[52,62,57],[53,63,58], #59
1628	                 [54,59],[56,12],[57,61],[58,62] #63
1629		 ]); #
1630      elif (arg[1] = "BG") and (arg[2] = 12)  then # Bongartz-Gabriel list no. 12
1631        data[1] := 153;
1632        data[2] := 2;
1633        data[3] := [
1634          [21,0],[6,0],[7,2],[8,3],[22,1],#5
1635	  [23,5],[2,24,6],[3,25,7],[4,26,8],[27,9],#10
1636         ];
1637	 for i in [1..7] do Add(data[3],[27+i,9+i]); od; #17
1638	 Append(data[3],[
1639	  [17,35,34],[36,18],[37,19],#20
1640	  [38,20],[1,39,21],[5,40,22] #23
1641	 ]);
1642	 for i in [1..11] do Add(data[3],[5+i,40+i,22+i]); od; #34
1643	 Append(data[3], [[34,52,51],[18,53,35]]); #36
1644	 for i in [1..15] do Add(data[3],[18+i,53+i,35+i]); od; #51
1645	 Append(data[3], [[51,69,68],[35,70,52]]); #53
1646	 for i in [1..15] do Add(data[3],[35+i,70+i,52+i]); od; #68
1647	 Append(data[3], [[68,103,85],[52,104,69]]); #70
1648	 for i in [1..15] do Add(data[3],[52+i,104+i,69+i]); od; #85
1649	 Append(data[3], [[119,102],[103,86]]); #87
1650	 for i in [1..15] do Add(data[3],[103+i,86+i]); od; #102
1651	 Append(data[3], [[85,86,120,119],[69,87,121,103]]); #104
1652	 for i in [1..15] do Add(data[3],[69+i,87+i,121+i,103+i]); od; #119
1653	 Append(data[3], [[119,137,136],[103,138,120]]); #121
1654	 for i in [1..15] do Add(data[3],[103+i,138+i,120+i]); od; #136
1655	 Append(data[3], [[136,153],[120,137]]); #138
1656	 for i in [1..15] do Add(data[3],[120+i,137+i]); od; #153
1657      elif (arg[1] = "BG") and (arg[2] = 13)  then # Bongartz-Gabriel list no. 13
1658        data[1] := 26;
1659        data[2] := 2;
1660        data[3] := [
1661          [2,0],[8,0],[4,1],[1,9,2],#4
1662	  [3,10,4],[11,5],[12,6],[13,20],#8
1663	  [2,15,8],[4,17,9],[5,19,10],[6,13,11],#12
1664	  [11,20,23,19],[13,26,23],[8,12,14,13],[15,14],#16
1665	  [9,16,21,15],[17,16],[10,18,22,17],[19,18],#20
1666	  [7,15,12],[17,24,21],[19,25,22],[21,7],#24
1667	  [22,24],[23,25] #26
1668         ];
1669      elif (arg[1] = "BG") and (arg[2] = 14)  then # Bongartz-Gabriel list no. 14
1670        data[1] := 20;
1671        data[2] := 2;
1672        data[3] := [
1673          [5,0],[20,0],[1,6,5],[7,3],#4
1674	  [8,4],[5,9,8],[3,10,6],[4,11,7],#8
1675	  [8,14,11],[6,12,9],[7,13,10],[9,15,20,14],#12
1676	  [10,16,18,12],[11,17,19,13],[14,17],[12,15],#16
1677	  [13,16],[2,12,20],[13,18],[14,19] # 20
1678        ];
1679      elif (arg[1] = "BGo") and (arg[2] = 14)  then # Bongartz-Gabriel list no. 14 given by orbits
1680        data[1] := 20;
1681        data[2] := 2;
1682        data[3] := [
1683          "orbits", [ [0,[3,2]], [0,[8,2]], [2,[4,0],[1,0]], [2,[5,0],[3,2]], [2,[6,2],[4,2]],
1684                      [2,[8,2],[7,0],[5,0]], [2,[6,2]], [2,[2,0],[6,0]] ]
1685        ];
1686      elif (arg[1] = "BGo") and (arg[2] = 13)  then # Bongartz-Gabriel list no. 13 given by orbits
1687        data[1] := 26;
1688        data[2] := 2;
1689        data[3] := [
1690          "orbits", [ [1,[2,0]], [7,[3,0]],
1691		   [11,[4,0]], [3,[3,7],[3,11],[3,3]]
1692		  ]
1693         ];
1694      elif (arg[1] = "BGo") and (arg[2] = 2)  then # Bongartz-Gabriel list no. 2 given by orbits
1695        data[1] := 66;
1696        data[2] := 2;
1697        data[3] := [
1698          "orbits", [
1699		  [7,[2,2]],#1
1700		  [9,[3,0]],#2
1701		  [15, [4,15]],#3
1702		  [15,[3,0],[5,7]],#4
1703		  [7,[4,0],[4,8],[6,7]],#5
1704		  [7,[5,0]]#6
1705		  ]
1706         ];
1707      elif (arg[1] = "BG") and (arg[2] = 7)  then # Bongartz-Gabriel list no. 7 given by orbits
1708        data[1] := 143;
1709        data[2] := 2;
1710        data[3] := [
1711          "orbits", [
1712		  [12,[3,0]],#1
1713		  [1,[1,7]],#2
1714		  [15,[4,0]],#3
1715		  [15,[5,0],[3,15]],#4
1716		  [15,[6,0],[4,15]],#5
1717		  [15,[8,0],[5,15]],#6
1718		  [15,[8,15]],#7
1719		  [15,[7,0],[9,0],[6,15]],#8
1720		  [15,[10,0],[8,15]],#9
1721		  [15,[9,15]]#10
1722		  ]
1723         ];
1724      fi;
1725
1726    fi;
1727
1728
1729    if Length(arg) = 1 then
1730      if (arg[1] = "D4 subspace")  then
1731        data[1] := 12;
1732        data[2] := 4;
1733        data[3] := [
1734           [0], [1,0], [1,0], [1,0],
1735           [2,3,4,1],[5,2],[5,3],[5,4],
1736           [6,7,8,5],[9,6],[9,7],[9,8]
1737         	];
1738      fi;
1739      if (arg[1] = "E6 subspace")  then
1740        data[1] := 36;
1741        data[2] := 6;
1742        data[3] := [ [0], [1,0], [2,0], [1,0], [1,0], [5,0],
1743           [2,4,5,1], [3,7,2], [8,3], [7,4],
1744           [7,6,5], [11,6], [8,10,11,7], [9,13,8],
1745           [14,9], [13,10], [13,12,11], [17,12],
1746           [14,16,17,13], [15,19,14], [20,15], [19,16],
1747           [19,18,17], [23,18],[20,22,23,19],[21,25,20],
1748           [26,21],[25,22],[25,24,23],[29,24],
1749           [26,28,29,25],[27,31,26],[32,27],[31,28],
1750           [31,30,29],[35,30]
1751         	];
1752      fi;
1753	  if (arg[1] = "A3 zero")  then
1754        data[1] := 5;
1755        data[2] := 3;
1756        data[3] := [
1757           [0], [1,0], [4,0], [2,1], [3,4]
1758         	];
1759      fi;
1760	  if (arg[1] = "A1,2 zero")  then
1761        data[1] := 9;
1762        data[2] := 3;
1763        data[3] := [
1764           [0], [1,0], [4,1,0], [7,5],
1765	   [3,4],[3,2,1],[5,6,3],[6,2],[7,8,6]
1766         	];
1767      fi;
1768	  if (arg[1] = "A2,2 comm")  then
1769        data[1] := 11;
1770        data[2] := 4;
1771        data[3] := [
1772           [0], [1,0], [1,0], [5,0],
1773	   [2,3,1], [5,2], [5,3], [6,7,4,5],
1774	   [8,6], [8,7], [9,10,8]
1775         	];
1776      fi;
1777	  if (arg[1] = "R nilp")  then
1778        data[1] := 7;
1779        data[2] := 2;
1780        data[3] := [
1781           [4,0], [1,0], [1,6,4], [3,6],
1782	   [3,2,1], [4,5,3], [5,2]
1783         	];
1784      fi;
1785    fi;
1786
1787
1788    if Length(data) <> 3 then
1789      Error("wrong number or type of arguments!");
1790    fi;
1791
1792    return data;
1793  end
1794 ); # PredefARQuivers
1795
1796
1797 #2013.09.05. orbity, wszystkie BG => koniec!