On Jul 27, 9:20 pm, didier  deshommes <[EMAIL PROTECTED]> wrote:
> 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?

It seems pretty strange to me, mostly because you lose too much
information by eliding zeroes.  As far as I can tell, given
MPolynomialRing(QQ,2,order='lex'), all of the following polynomials:

  3*x^2 + 1
  3*x^5 + x
  3*y^7 + 1
  3*y + 1

would have a coefficients() list of [3, 1].  Is that true, and if so,
is this really a useful function?

Carl


--~--~---------~--~----~------------~-------~--~----~
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to