Something like this?
sage: R=CC[','.join('x{0}'.format(i) for i in range(20))]
sage: R.inject_variables()
Defining x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13,
x14, x15, x16, x17, x18, x19
sage: type(x0)
<class
'sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict'>
Jason
Try the .polynomial() method:
sage: var('x,y')
(x, y)
sage: f=x-y
sage: g=f.polynomial(QQ)
sage: g
x - y
sage: type(g)
<type
'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
sage: g.variables()
(x, y)
sage: g.parent()
Multivariate Polynomial Ring in x, y over Rational Field
Jason
This does:
sage: g.parent()
Callable function ring with arguments (x, y)
But:
>
> sage: g(1,1)
> 0
>
> (Note that there is no need to specify the names of the variables. Try
> that with f and you'll get a deprecation warning.)
I'm working on removing this functionality, as the deprecation has been
in Sage for well over a year.
Thanks,
Jason