Hey Mike, At least as a workaround you could do something like this: sage: s=SymmetricFunctions(QQ).s() sage: x = s[2,1] + 2*s[3] sage: for i,c in x: print i, factor(c) [3] 2 [2, 1] 1
Best, Travis On Wednesday, April 15, 2015 at 5:00:18 PM UTC-4, Mike Zabrocki wrote: > > Hi all, > There is very strange behavior if you want factored coefficients of a free > module. Let me give an example in the ring of symmetric functions: > > sage: s=SymmetricFunctions(QQ).s() > sage: (s[2,1] + 2*s[3]).map_coefficients(factor) > 2*s[3] > > What is happening here is that 'factor' returns a factorization object. > factor(1) is an empty list and hence is 'false'. Now if you look at the > code for 's._from_dict' it removes objects which are empty. > > If you look at the documentation for 'map_coefficients' you can see that > this is not technically a bug because map_coefficients needs to be an > endofunction on the coefficient ring. In this case, factor is mapping from > QQ to factor objects and so I wouldn't want to play with the result of that > command. On the other hand, in symmetric functions (especially with > multiple parameters like Macdonald or Hall-Littlewood) one would frequently > like to factor coefficients to know that the coefficients have a nice form. > > Does anyone have any suggestions about what should happen with this case? > I was discussing it with a few people, but we ruled out changing > factor, map_coefficients or _from_dict. > > I find that to work with coefficients in a polynomial ring, the functions > factor, simplify, expand are unsatisfactory because the output is rarely in > a form that shows me what I want to see (Maple and Mathematica seem better > at this). Perhaps what I would like to have is a function 'niceify' that > displays a coefficient in a pretty form. > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.