Artifical workaround:
sage: R.=QQ[]
sage: w=3*x^2+4*x
sage: w.monomials()
[x^2, x]
On 29 Kwi, 00:28, tvn wrote:
> Hi, the monimals function you suggested doesn't work for the below case
> where I want to extract the terms [x^2,x] from the given expression
> 3*x^2+4*x .
>
> sage: type(x)
>
Hi, the monimals function you suggested doesn't work for the below case
where I want to extract the terms [x^2,x] from the given expression
3*x^2+4*x .
sage: type(x)
sage: R. = PolynomialRing(QQ,'x,y')
sage: type(x)
sage: R. = PolynomialRing(QQ,'x')
sage: w=3*x^2 + 4*x
sage: w.monomials()
great -- thanks !
--
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
sage: R.=PolynomialRing(QQ,'x,y,z')
sage: w=3/5*x*y+5*y+3*z
sage: w.monomials()
[x*y, y, z]
sage: w1=3*x^2
sage: w1.monomials()
[x^2]
On 16 Kwi, 07:00, tvn wrote:
> given an expression f of the form c1*t1 + c2*t2 + .. +cn*tn, I want to
> extract from f the list of 'terms' [t1..tn] .. is there