[GAP Forum] Writing custom action on a set of list(erratum)
Alexander Konovalov
alexander.konovalov at gmail.com
Thu May 7 16:54:12 BST 2015
Dear Pierre-Alain,
Let me first check that you have the same error as given below. First of all,
> On 7 May 2015, at 13:34, Pierre-Alain BOURDIL <pabourdi at laas.fr> wrote:
>
> Sorry, wrong copy/paste on the function source code, corrected. Neverthelles i still get the problem.
>
> Hi,
>
> I've tryed unsuccesfuly to implement an action on a set of list.
>
>
> Say G=S_2, Omega = [[1,rc1,2],[2,rc2,1]]
Omega is an operation in GAP, so it is protected and you can't assign this list to it
(there is even a mild advise somewhere to tend to use name starting in lowercase to
avoid name clashes).
> where rc1, rc2 are rightcosets of Stabilizer(G,1) and a function :
>
> Act := function (x,g)
> local repr,comp,rc,orbital,g;
Also, this function can't be read in GAP, as 'g' is used for an argument and for a local
variable
> #extract args
> comp := x[1];
> rc := x[2];
> orbital := x[3];
> # compute the coset
> repr:=rc*g;
> return [comp^g,repr,orbital];
> end;;
>
> Now
> A:=Action(G,Omega,Act)
> gives a no method found errors. With ShowArguments i see that x and g are set with 1 and rc1 respectively. I do not find a way for x to be set to [1,rc1,2] and g with the current G's element.
>
> How can i implement such an action function ?
However, if I fix the two errors above, I still have a problem:
gap> G:=SymmetricGroup(2);
Sym( [ 1 .. 2 ] )
gap> stab:=Stabilizer(G,1);
Group(())
gap> rc:=RightCosets(G,stab);
[ RightCoset(Group( () ),()), RightCoset(Group( () ),(1,2)) ]
gap> omega := [[1,rc[1],2],[2,rc[2],1]] ;
[ [ 1, RightCoset(Group( () ),()), 2 ],
[ 2, RightCoset(Group( () ),(1,2)), 1 ] ]
gap> act := function (x,g)
> local repr,comp,rc,orbital;
> #extract args
> comp := x[1];
> rc := x[2];
> orbital := x[3];
> # compute the coset
> repr:=rc*g;
> return [comp^g,repr,orbital];
> end;;
gap>
gap> A:=Action(G,omega,act);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `<' on 2 arguments called from
func( elm ) called from
ForAll( D, IsList and IsSSortedList ) called from
ActionHomomorphismConstructor( xset, true ) called from
attr( xset ) called from
CallFuncList( ActionHomomorphism, arg ) called from
... at line 16 of *stdin*
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> D;
[ [ 1, RightCoset(Group( () ),()), 2 ],
[ 2, RightCoset(Group( () ),(1,2)), 1 ] ]
because GAP expects IsSSortedList to work on elements of omega, while it doesn't:
gap> IsSSortedList(omega[1]);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `<' on 2 arguments called from
<function "HANDLE_METHOD_NOT_FOUND">( <arguments> )
called from read-eval loop at line 31 of *stdin*
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>
Before continuing, do we now at least see the same error message?
Best,
Alexander
P.S. Actually, the following works:
gap> G:=SymmetricGroup(2);
Sym( [ 1 .. 2 ] )
gap> stab:=Stabilizer(G,1);
Group(())
gap> rc:=RightCosets(G,stab);
[ RightCoset(Group( () ),()), RightCoset(Group( () ),(1,2)) ]
gap> A:=Action(G,rc,OnRight);
Group([ (1,2) ])
and also
gap> A:=Action(G,[1,2],OnPoints);
Group([ (1,2) ])
- could any of these examples be helpful?
More information about the Forum
mailing list