On Fri, Jan 8, 2010 at 11:55 AM, javier <vengor...@gmail.com> wrote: > Hi all, > > I have been working on this and after a while decided that my original > approach wasn't the most appropriate and started rewriting everything > for scratch. > > After thinking about this problem making "conjugacy_class" a method > that returns a list (or set) didn't feel right. GAP has many methods > working on conjugacy classes, so the most natural thing to do should > be to create a sage/python class "ConjugacyClass" for conjugacy > classes, and wrap any desired GAP methods inside this class. Does this > sound fine?
This sounds fine, but if you are going to have a method to compute representatives then your patch possibly should involve modifying the conjugacy_classes_representatives method in the perm_groups module. Also, for the list method you might want to think about "@cached_method", as in the list method for PermutationGroups in the perm_groups module. > > I have some working code, including the definition of the class, > wrapping of several GAP functions, and some native python methods such > as list, set, iter, getitem, repr and so on, but before pushing it I > wanted to be sure this is the right approach. > > I think within this new framework, the definition of the class > "ConjugacyClass" should go in the groups file (but don't know exactly > where!), and the G.conjugacy_class(g) method should be defined for all > groups, not only for finite, with the "set" and "list" methods > initially raising NotImplemented errors for infinite groups, but > giving room if somebody ever want to implement explicit descriptions > for some particular infinite groups (like f.i. FC-groups). I'm not sure where. Maybe a new module? > > Is there anything I should take into account regarding the eventual > merge with the categories code? I don't know. Hopefully someone else does. Thanks for working on this! > > Cheers > J > > On Dec 3 2009, 10:15 pm, Florent Hivert <florent.hiv...@univ-rouen.fr> > wrote: >> > Yes, have a look at sage/groups/group.pyx. It has a FiniteGroup >> > class, where I think you should put your main method (that's what >> > Florent said as well, I think). >> >> Yep ! This will probably needs some cleanup when we will merge categories >> with >> the other generic stuff but I think this is the right place in the mean time. >> >> >> >> > For group elements, one possibility is to put the wrapper method in >> > the class MultiplicativeGroupElement in the file >> > sage/structure/element.pyx. You would probably want to do something >> > like >> >> > defconjugacy_class(self): >> > G = self.parent() >> > try: >> > return G.conjugacy_class(self) >> > except AttributeError: >> > raise NotImplementedError, "Computation of conjugacy classes not >> > implemented for %s"%self >> >> > because some groups (e.g. infinite ones) won't have the >> > methodconjugacy_class(). >> > If anybody thinks that element.pyx should not get cluttered with this >> > kind of thing, please say something! >> >> something :-) >> >> Same remark as above... >> >> Florent > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > >
-- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org