On Sat, Jun 28, 2008 at 11:00 AM, John Cremona <[EMAIL PROTECTED]> wrote: > > It seems that what Dan Bump's instructions did not specify is what > properties the class assigned to ._combinatorial_class must have. > And it needs something which PermutationGroupElement does not have. > > Does that help?
Okay. Maybe the best thing is to write a wrapper to GAP's GroupRing function. > > John > > 2008/6/28 David Joyner <[EMAIL PROTECTED]>: >> >> Hi: >> >> Since there are some interesting error-correcting codes based on group >> algebras over a finite field, >> I'm making a stab at implementing group rings for permutation groups. >> Dan Bump (offlist) suggested >> looking at the CombinatorialAlgebra class in >> sage.combinat.combinatorial_algebra.py. The docstring there >> says, in part, >> >> The CombinatorialAlgebra base class makes it easy to define and work >> with new combinatorial algebras in Sage. >> ... >> The important things to define are ._combinatorial_class which specifies >> the combinatorial class that indexes the basis elements, ._one which >> specifies the identity element in the algebra, ._name which specifies >> the name of the algebra, ._prefix which is the string put in front of >> each basis element, and finally a _multiply or _multiply basis method >> that defines the multiplication in the algebra. >> >> Baed on that, I'd like to input >> >> class PermutationGroupRing(CombinatorialAlgebra): >> def __init__(self, R, G): >> self.group = G >> self._combinatorial_class = PermutationGroupElement >> self._one = G.identity() >> self._name = 'Group ring of %s'%str(G) >> self._prefix = '' >> CombinatorialAlgebra.__init__(self, R) >> def _multiply_basis(self, a, b): >> c = a*b >> return c >> >> and have a command like >> >> sage: PermutationGroupRing(ZZ,G) >> >> return a group ring. Instead, I get the traceback error >> >> {{{ >> --------------------------------------------------------------------------- >> AttributeError Traceback (most recent call last) >> >> /home/wdj/sagefiles/sage-3.0.3.rc0/<ipython console> in <module>() >> >> /home/wdj/.sage/temp/hera/7513/_home_wdj_sagefiles_codes_group_rings_sage_6.py >> in __init__(self, R, G) >> 27 self._name = 'Group ring of %s'%str(G) >> 28 self._prefix = '' >> ---> 29 CombinatorialAlgebra.__init__(self, R) >> 30 def _multiply_basis(self, a, b): >> 31 c = a*b >> >> /home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py >> in __init__(self, R, element_class) >> 679 #Set the dimension >> 680 try: >> --> 681 self._dim = self._combinatorial_class.count() >> 682 except (ValueError, NotImplementedError): >> 683 self._dim = None >> >> AttributeError: type object >> 'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute >> 'count' >> }}} >> >> which I can't decipher. >> >> Can anyone explain "AttributeError: type object >> 'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute >> 'count'" >> (in words of two syllables or less, if possible:-)? >> >> - David Joyner >> >> > >> > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---