Hi! Trying to get to coefficients of certain terms in symmetric functions, I am running into trouble:
sage: ks = kSchurFunctions(QQ,3,t=1) sage: f=ks([3,2])+ks([2]) sage: f.monomial_coefficients() {[3, 2]: 1, [2]: 1} sage: f.monomial_coefficients().keys()[1].parent() Partitions of the integer 2 sage: P=f.monomial_coefficients().keys()[1].parent() sage: f.coefficient(P([2])) --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Applications/sage-4.7/devel/sage-combinat/<ipython console> in <module>() /Applications/sage/local/lib/python2.6/site-packages/sage/combinat/free_module.pyc in coefficient(self, m) 447 # that can be turned on or off 448 C = self.parent()._basis_keys --> 449 assert m in C, "%s should be an element of %s"%(m, C) 450 if hasattr(C, "element_class") and not isinstance(m, C.element_class): 451 m = C(m) AssertionError: [2] should be an element of Partitions of the integer An example of an infinite enumerated set: the non negative integers satisfying constraints max_part=3 Why are the parents of the keys different from the actual objects? How would I build a partition in the correct set "Partitions of the integer An example of an infinite enumerated set: the non negative integers satisfying constraints max_part=3?" without specifying the size of the partition? The reason why I need this is that I also sometimes need to get the coefficient of a partition that is not in the support and hence would expect to get zero. Thanks, Anne -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.