Suppose I have a symbolic expression f( t1, t2) which can be interpreted as
a multivariate polynomial in t1 and t2., e.g.
a = var('a')
f(t1,t2) = a*t1+t2
To make this clear to Sage I say
P.<p1,p2>=PolynomialRing(SR)
g = f.polynomial(QQ).subs(t1=p1,t2=p2)
This works but becomes very slow when the symbolic expression f becomes
lengthy. If on the other hand I simply try
g = f.subs(t1=p1,t2=p2)
it remains very fast even if f becomes lengthy but it does not work:
P(g).variables()
returns an empty list.
Is there a way to keep the speed and obtain the desired result?
I posted this before in more complicated terms. Maybe I am more lucky with
this stripped down version. Thank you.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.