Is there any way to get this code to deal with non integer
coefficients. Specifically, can it return coefficients that are
symbolic.

For example I would like

f(x,y)=a*x^10*y+3*x
B=f(x,y).polynomial(SR)
print B.coefficients()

to return

[a,3]

but instead it returns

[1,3]

Is it possible to have this code consider 'a' not as a variable but as
a constant?

On Feb 9, 10:36 pm, ObsessiveMathsFreak
<obsessivemathsfr...@gmail.com> wrote:
> Are you certain that these two functions return elements in the same
> order?
>
> On Feb 8, 11:40 pm, Mike Hansen <mhan...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On Wed, Feb 8, 2012 at 3:29 PM, ObsessiveMathsFreak
>
> > <obsessivemathsfr...@gmail.com> wrote:
> > > Is there no way of getting sage to give back the degree's of the
> > > corresponding multivariate polynomials as well. That is to return
> > > something like
>
> > > [[10,[100,1]],[3,[1,0]]]
>
> > exponents() is what you need:
>
> > sage: zip(B.coefficients(), B.exponents())
> > [(10, (100, 1)), (3, (1, 0))]
>
> > --Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to