Conjugacy classes in groups

3 views
Skip to first unread message

javier

unread,
Apr 15, 2009, 10:21:02 AM4/15/09
to sage-support
Hi there,

just started using SAGE for some research related stuff a couple of
weeks ago. Is there a way to get the conjugacy classes of a group, in
the same way as GAP does? I don't quite mean neither
"conjugacy_classes_subgroups" (which returns conjugacy classes of
subgroups, not of elements) nor "conjugacy_classes_representatives"
that returns only one element of each conjugacy class, but something
like GAP's "ConjugacyClasses".

So far I solved the problem by defining my groups through GAP, but
this forces me to use GAP syntax all the time and add lots of ".AsList
()" to get access to elements. Is there a better way?

Cheers
Javier


David Joyner

unread,
Apr 15, 2009, 10:26:22 AM4/15/09
to sage-s...@googlegroups.com
I'm not sure what you mean by better way. Is this what you want?

sage: G = AlternatingGroup(5)
sage: g = G.random_element()
sage: CCg = Set([x*g*x^(-1) for x in G])



>
> Cheers
> Javier
>
>
>
> >
>

javier

unread,
Apr 15, 2009, 10:54:46 AM4/15/09
to sage-support
On Apr 15, 3:26 pm, David Joyner <wdjoy...@gmail.com> wrote:
> I'm not sure what you mean by better way. Is this what you want?
>
> 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
and there was a way of taking advantage of it. Also, is there a method
for obtaining the centralizer of an element inside a group?

Javier

David Joyner

unread,
Apr 15, 2009, 11:07:19 AM4/15/09
to sage-s...@googlegroups.com
On Wed, Apr 15, 2009 at 10:54 AM, javier <veng...@gmail.com> wrote:
>
> On Apr 15, 3:26 pm, David Joyner <wdjoy...@gmail.com> wrote:
>> I'm not sure what you mean by better way. Is this what you want?
>>
>> 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.


> and there was a way of taking advantage of it. Also, is there a method
> for obtaining the centralizer of an element inside a group?


sage: G.centralizer(g)
Permutation Group with generators [(1,3,4,5,2)]


>
> Javier
> >
>

Robert Bradshaw

unread,
Apr 15, 2009, 2:36:10 PM4/15/09
to sage-s...@googlegroups.com
On Apr 15, 2009, at 8:07 AM, David Joyner wrote:

> On Wed, Apr 15, 2009 at 10:54 AM, javier <veng...@gmail.com> wrote:
>>
>> On Apr 15, 3:26 pm, David Joyner <wdjoy...@gmail.com> wrote:
>>> I'm not sure what you mean by better way. Is this what you want?
>>>
>>> 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).

- Robert

David Joyner

unread,
Apr 15, 2009, 4:04:26 PM4/15/09
to sage-s...@googlegroups.com
On Wed, Apr 15, 2009 at 2:36 PM, Robert Bradshaw
<robe...@math.washington.edu> 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
>
>
> >
>

javier

unread,
Apr 16, 2009, 12:32:17 PM4/16/09
to sage-support
Actually, I think that by calling "conjugacy_classes_representatives"
conjugacy classes are already computed, so didn't want to do all the
work twice. A possible improvement of the algorithm could be something
like this:

def conjugacy_classes(G):
classes = []
G_set = Set(G)
while len(G_set)!=0:
g = G_set[0]
cg = conjugacy_class(G,g)
classes.append(cg)
G_set = G_set.symmetric_difference(cg)
return Set(classes)

but since I am not a group theorist, I don't know if there is a better
algorithm out there, so I assumed that GAP function would be more
efficient than anything I could possibly come up with, that's why I
was asking if there was a native SAGE wrapping of it.

Concerning the math, I need the conjugacy classes as sets in order to
compute some invariants given by noncommutative geometry, where
bicovariant differential calculi over (the Hopf algebra of) finite
groups are in 1-1 correspondence with (unions of) conjugacy classes
satisfying certain properties. My hope is that the NC invariants yield
some information about the group itself, and am trying to compute a
number of examples to get some intuition on what's going on.

Anyway, I got first version of my program running and was able to
compute things for a dozen not-so-small groups without much trouble,
so I guess what I have might do the trick for now.

Thank you all for your help!

Cheers
Javier
Reply all
Reply to author
Forward
0 new messages