On Wed, Apr 15, 2009 at 2:36 PM, Robert Bradshaw
<[email protected]> wrote:
>

>>>>
>>>> sage: G = AlternatingGroup(5)
>>>> sage: g = G.random_element()
>>>> sage: CCg = Set([x*g*x^(-1) for x in G])
>>>
>>> Thanks for your answer,
>>>
>>> I was thinking more about getting all the conjugacy classes in a list
>>> (or set) of sets, I guess I could define my own functions as
>>>
>>> def conjugacyclass(group, g):
>>>    return Set([x*g*x^(-1) for x in group])
>>>
>>> def conjugacyclasses(group):
>>>    return Set([conjugacyclass(group, g) for g in group])
>>>
>>> but I thought maybe GAP function ConjugacyClasses() was more
>>> efficient
>>
>> Actually, I think permutation multiplication was rewritten in Cython
>> so what you have is pretty efficient I think.
>
> Being in Cython means there's a constant speedup, but aren't there
> better algorithms for this kind of thing? (Depending on the size of
> groups you're working with though, the above may be plenty fast).


I don't see how conjugacyclass can be done more efficiently.
Of course,

def conjugacyclasses(group):
  return Set([conjugacyclass(group, g) for g in group])

should really be

def conjugacyclasses(group):
  reps = group.conjugacy_classes_representatives()
  return Set([conjugacyclass(group, g) for g in reps])

But really even this is impossible to do fast for large groups.
For computational problems involving permutation groups, my
understanding was that you should generally try very hard to
only deal with *representatives* of conjugacy classes, but
the original question seemed to indicate he didn't want to use
that command for some reason.

Maybe I'm misunderstanding something?

>
> - Robert
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to