[sage-support] Re: Conjugacy classes in groups

2009-04-16 Thread javier
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(

[sage-support] Re: Conjugacy classes in groups

2009-04-15 Thread David Joyner
On Wed, Apr 15, 2009 at 2:36 PM, Robert Bradshaw 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

[sage-support] Re: Conjugacy classes in groups

2009-04-15 Thread Robert Bradshaw
On Apr 15, 2009, at 8:07 AM, David Joyner wrote: > On Wed, Apr 15, 2009 at 10:54 AM, javier wrote: >> >> On Apr 15, 3:26 pm, David Joyner 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:

[sage-support] Re: Conjugacy classes in groups

2009-04-15 Thread David Joyner
On Wed, Apr 15, 2009 at 10:54 AM, javier wrote: > > On Apr 15, 3:26 pm, David Joyner 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 answ

[sage-support] Re: Conjugacy classes in groups

2009-04-15 Thread javier
On Apr 15, 3:26 pm, David Joyner 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 clas

[sage-support] Re: Conjugacy classes in groups

2009-04-15 Thread David Joyner
On Wed, Apr 15, 2009 at 10:21 AM, javier wrote: > > 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" (whi