Department of Mathematics FAS Harvard University One Oxford Street Cambridge MA 02138 USA Tel: (617) 495-2171 Fax: (617) 495-5132
FAS Computer Services to Harvard University IT: (617) 495-7777.

Description

GAP (Groups, Algorithms, and Programming) is a system for computational discrete algebra with particular emphasis on computational group theory. On Abel, Gap 4 is started with "gap", the older Gap 3 with "gap3".

Example

The famous Rubik cube for example, a finitely presented group, is implemented as a permutation group as follows:
                     +--------------+
                     |  1    2    3 |
                     |  4  top    5 |
                     |  6    7    8 |
      +--------------+--------------+--------------+--------------+
      |  9   10   11 | 17   18   19 | 25   26   27 | 33   34   35 |
      | 12  left  13 | 20 front  21 | 28 right  29 | 36  rear  37 |
      | 14   15   16 | 22   23   24 | 30   31   32 | 38   39   40 |
      +--------------+--------------+--------------+--------------+
                     | 41   42   43 |
                     | 44 bottom 45 |
                     | 46   47   48 |
                     +--------------+
Fire up GAP by typing gap at the shell prompt and paste in the following lines representing the rotations of the 6 faces and the definition of the group 'cube' which is generated by these motions.
  a:=( 1, 3, 8, 6)( 2, 5, 7, 4)( 9,33,25,17)(10,34,26,18)(11,35,27,19);
  b:=( 9,11,16,14)(10,13,15,12)( 1,17,41,40)( 4,20,44,37)( 6,22,46,35);
  c:=(17,19,24,22)(18,21,23,20)( 6,25,43,16)( 7,28,42,13)( 8,30,41,11);
  d:=(25,27,32,30)(26,29,31,28)( 3,38,43,19)( 5,36,45,21)( 8,33,48,24);
  e:=(33,35,40,38)(34,37,39,36)( 3, 9,46,32)( 2,12,47,29)( 1,14,48,27);
  f:=(41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40);
cube := Group(a,b,c,d,e,f);
One is now ready to compute. For example, the size of the group is determined with
 
Size(cube);
tells that it is 43252003274489856000. How many times does a Rubik player have to repeat the combination a*b^-1*c*e, to get back to the original situation?
Size(Group(a*b^-1*c*e));
Many more examples can be found at the GAP homepage .


Simplicity, Clarity, Generality B.W. Kernighan, R. Pike, in "The Practice of Programming".
Privacy Digital Accessibility
HTML CSS