defining a function on an abstract group

Hi,

I have defined my group in maple as

G:=grelgroup({u,v,w},{[u,v,u,1/w],[v,u,v,1/w],[u,u],[v,v],[w,w]})

I now want to define a function on GxGxG. Previously I have used array, i.e. f:=array(0..2,0..3,0..4), but how do I do it for elements in G?

Many thanks,

Jenny

alec's picture

For example

It is more convenient to use a permgroup representation. That can be done as

with(group):

G:=grelgroup({u,v,w},{[u,v,u,1/w],[v,u,v,1/w],[u,u],[v,v],[w,w]}):

pg:=permrep(subgrel({},G));

  pg := permgroup(6, {u = [[1, 2], [3, 6], [4, 5]],

        v = [[1, 3], [2, 5], [4, 6]], w = [[1, 4], [2, 6], [3, 5]]})

g:=elements(pg);

  g := {[], [[1, 5, 6], [2, 3, 4]], [[1, 6, 5], [2, 4, 3]],

        [[1, 2], [3, 6], [4, 5]], [[1, 3], [2, 5], [4, 6]],

        [[1, 4], [2, 6], [3, 5]]}

nops(g);

                                  6

Now, the function on GxGxG can be defined using a 3-dimensional Array if one wishes. For example,

f:=Array((1..6)$3,(i,j,k)->nops(g[i])+nops(g[j])+nops(g[k])):

f(1,2,3);

                                  4

Of course, it can be defined in a usual way as well, as

F:=(i,j,k)->nops(g[i])+nops(g[j])+nops(g[k]):

F(1,2,3);

                                  4

in this example

Alec

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}