2007/10/13, Joel B. Mohler <[EMAIL PROTECTED]>: > > Thanks for the discussion about this topic. I send this mail to re-iterate > and summarize. It seems there are two things that you might want: > 1) Get the coefficient of a specific monomial in the multivariate polynomial > ring. > 2) Get the coefficient of the polynomial in a tower of (two) polynomial > extensions > > I suggest that MPolynomial.coefficient method perform function #1 above. It > currently does some strange things over the base rings I've tested. It does > vary on base ring due to implementation differences. > > I suggest that there be a new method which performs function #2 and I suggest > it be called "polynomial_coefficient", but I really don't like that name. I > almost prefer "coefficient_polynomial" since it will sort beside coefficient > in documentation and help people realize that if they are not happy > with "coefficient" that they have an alternative. Of course, each method's > documentation should probably mention the other.
+1, Those should be 2 separate methods, as they try to solve 2 (slightly) different problems. > > I'm wondering if we could have a vote on preferred syntax. I'm not going to > describe the parameters because if they are not clear enough from context, it > probably isn't a good parameter choice :) : > > sage: P.<v,w,x,y,z>=ZZ[] > sage: f=(1-v)*(1-2*w)*(1-3*x); f > -6*v*w*x + 2*v*w + 3*v*x + 6*w*x - v - 2*w - 3*x + 1 > ############## > # Alternative Number 1 > ############## > sage: f.polynomial_coefficient({w:0,v:1}) > 3*x - 1 +1 for this notation. didier --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@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-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---