Rank of Unit Group of Burnside Ring: Converting Thoughts into Codes

The goal of Week 4 is to convert the calculation of the rank from work on paper into a GAP function. Even though I have experienced writing functions when I practiced with the GAP manual during Week 1, this was my first time writing an actual original function in GAP. The first step was to construct the table of marks of the input group. After trying to write lines of codes in GAP to simulate the construction of table of marks, I was very lucky to find out that GAP actually has built-in function which can be called by the command TableofMarks(group) that is similar to what I tried to do on paper. However, the table was reversed in direction comparing to what I did on paper, thus the second step was transposing the table of marks by using the function “TransposedMat”. The hardest part was simulating the process of generating the equations and finding the solutions, which was very easy by paper and pen but was hard to be generalized by codes. I first tried to code the process of equation solving by reproducing what I did by hand, but I found out it is a very inefficient process due to the excessive amount of “if” statements. After trying many other ways to code for this step, I found the simplest way to be thinking of the equations as vectors and finding the solution of the matrix. The final code is shown below:

 

 

BurnsideUnit:=function(grp)
local tom, mat, tm, size, vects, sols, a, i;
tom:=TableOfMarks(grp);
mat:=MatTom(tom);
tm:=TransposedMat(mat);
size:=Size(tm);
vects:=Tuples([-1,1],size);
sols:=[];
for i in [1..Size(vects)] do
  a:=SolutionIntMat(mat, vects[i]);
  if IsVector(a) then
    Append(sols,[a]);
  fi;
od;
return sols;
end;

    However, even though this function gives the correct output for C2, C3, D4, and other smaller groups, it was unable to generate an output (or is too slow) when the input became a larger group. After discussing with Dr. Carman and thinking on my own, I realized the main reason is that the function calculated the solutions of every line before appending the necessary ones onto the list, which wasted a lot of time on processing the unnecessary part. Thus, the next step of the project is to improve on the algorithm to make it more efficient.