| 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)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.