0
$\begingroup$
DeclareOperation("helpfunction", [IsList]);
InstallMethod(helpfunction, "for a representation of a quiver",[IsList],0,function(L)
local list, n, i, j, f, temp, temp2, temp3, u;

  n:=L[1];
  s:=L[2];
  l:=L[3];

  A:=GroupRing(GF(3),SymmetricGroup(n));
  temp:=[];
  r:=Identity(A);

  for i in [1..l-1] do
    r:=r+s^i;
  od;
  return(r);
end);

This works:

gap> helpfunction([3,(1,2),4]);
(Z(3))*()+(Z(3))*(1,2)

But now I use it:

DeclareOperation("helpfunction2", [IsList]);
InstallMethod(helpfunction2, "for a representation of a quiver",[IsList],0,function(L)
local list, n, i, j, f, temp, temp2, temp3, u;

  x:=L[1];
  n:=L[2];
  A:=SymmetricGroup(n);
  U:=Size(Elements(A));
  temp:=[];
  for i in [1..U] do
    Append(temp,[helpfunction([n,x,i])]);
  od;
  return(temp);
end);

This works as well alone:

gap> helpfunction2([(1,3),3]);
[ (Z(3)^0)*(), (Z(3)^0)*()+(Z(3)^0)*(1,3), (Z(3))*()+(Z(3)^0)*(1,3), 
  (Z(3))*()+(Z(3))*(1,3), (Z(3))*(1,3),  of ... ]

Now the next things do not work:

gap> B:=SymmetricGroup(3);
Sym( [ 1 .. 3 ] )
gap> A:=GroupRing(GF(3),B);

gap> W:=Subspace(A,helpfunction2([(1,3),3]));

Error, first argument must be a left module, second a collection
 called from (  )

called from read-eval loop at line 1823 of stdin

So what did I do wrong? Somehow it seems the list is not regocnized as a subset of A.

  • 0
    OK. I've had questions and answers here that I could not understand any part of, but a program? Give me a break!2017-01-23
  • 0
    well this site has a gap tag2017-01-23
  • 2
    As far as I can surmise from the atrocious formatting, the issue is that your `helpfunction` creates a *new* group ring $A$ every time. GAP will not consider them as compatible objects. You need to create this ring once at the start and then always use the identity of this same ring to create elements.2017-01-24
  • 0
    thanks, that was the mistake.2017-01-24
  • 0
    @ahulpke Please consider converting your comment into an answer, so that this question gets removed from the unanswered queue.2018-09-29

1 Answers 1

3

The issue is that your helpfunction creates a new group ring $A$ every time it is called. GAP will not consider these rings as different, incompatible objects. You need to create this ring once at the start of your calculation and then always use the identity of this same ring to create elements.