Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Saving for posterity. The following code does the job:

class Element(GradedLieAlgebra.Element):

    def degree(self):

        l = [m for m in self]
        monomials = [x[0] for x in l]
        dictionary = self.parent().name_degree_map
        degrees=self.parent()._degrees

        values = [dictionary[key] for key in monomials if key in dictionary]

        return max(values)