On Sun, Feb 19, 2012 at 4:38 AM, ObsessiveMathsFreak
<obsessivemathsfr...@gmail.com> wrote:
> Basically, I want to restrict the variables of a multivariate
> polynomial to a certain set of symbols.
>
> B.variables() should return
> [x,y]
> instead of
> [a,x,y]
>
> How can this be done.

I have a patch at http://trac.sagemath.org/sage_trac/ticket/12542
which provides a fix for this:

sage: var('a,x,y')
sage: f = a*x^10*y+3*x
sage: B = f.polynomial(ring=SR['x,y'])
sage: B.coefficients()
[a, 3]

The key is specifying that the resulting polynomial should live in the
ring SR['x,y'] instead of (by default) SR['a,x,y'].

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