On 8-May-09, at 2:23 AM, Kwankyu wrote:
> > Hi, > > This works: > > sage: R.<x,y>=PolynomialRing(QQ,2) > sage: a=x^2+x*y+y > sage: a.polynomial(x) > x^2 + y*x + y > > But this does not work: > > sage: R.<x,y>=PolynomialRing(GF(5),2) > sage: a=x^2+x*y+y > sage: a.polynomial(x) > Traceback (most recent call last): > ... > TypeError: 'tuple' object cannot be interpreted as an index A temporary workaround is to use R.<x, y>=ZZ[] and then maybe a.polynomial(x).change_ring(GF(5)) when you need it. This bug happens because, internally, multivariate are represented in many different ways. What I think is needed is a "multivariate standard representation" agreed upon, but of course this makes creation of elements slower in any particular ring. Nick --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---