On Wed, Apr 15, 2009 at 10:54 AM, javier <[email protected]> wrote: > > On Apr 15, 3:26 pm, David Joyner <[email protected]> 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 > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
