Hi there, I'm trying to work with multivariate polynomials in SAGE and here are 3 features that I would like. Assume f is a multi-poly: * f.coefficients() for multivariate polynomials. I would like to get all the coefficients of f in a list, according to the term order attached to its ring (this would basically the equivalent of the univariate case). For example: {{{ sage: # lex ordering sage: R.<x,y> = MPolynomialRing(QQ,2,order='lex') sage: f=23*x^6*y^7 + x^3*y+6 sage: f 23*x^6*y^7 + x^3*y+6 sage: f.coefficients() [23, 1, 6] }}}
Another example where we use revlex ordering: {{{ sage: # revlex ordering sage: R.<x,y> = MPolynomialRing(QQ,2,order='revlex') sage: f=23*x^6*y^7 + x^3*y+6 sage: f 6 + x^3*y + 23*x^6*y^7 sage: f.coefficients() [6,1,23] }}} Does such function make sense? * random_element() for multivariate polynomials would be really nice to have. In addition, I think it would be a good idea to specify certain additional parameters: * d : maximum total degree of each term. I'm using total degree here to mimic the univariate case, but I'd like to hear other suggestions. * n: how many terms of total degree at most d we must generate. For example: {{{ sage: R.<x,y> = MPolynomialRing(QQ,2,order='lex') sage: # generate a poly of total degree 3, with 2 terms in it sage: R.random_element(d=3, n=2) 2*x^2*y + x*y }} * A function to compute the pth norm of a polynomials. I don't think this is hard to implement, it's just that no one has had a use for it yet :) Feedback and suggestion would be greatly appreciated. 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/ -~----------~----~----~----~------~----~------~--~---