Description
Let f be a polynomial in two variables x and y over a ring R.
Consider the following three commands
i) f(2,3)
ii) f(x=2,y=3)
iii) f.subs(x=2,y=3)
They give the same results but not the same type. i) gives an element in R while ii) and iii) are constant polynomials in two variables:
sage: K.<x,y> = QQ[]
sage: f = x^2 + y^2
sage: f(2,3).parent()
Rational Field
sage: f(x=2,y=3).parent()
Multivariate Polynomial Ring in x, y over Rational Field
sage: f.subs(x=2,y=3).parent()
Multivariate Polynomial Ring in x, y over Rational Field
Following the documentation, i) and ii) should give an element in R
while iii) is a polynomial.
f(x=2,y=3) is the __call__
method in sage.rings.polynomials.multi_polynomial_libsingular.pyx
and there, in the first lines (currently line 1673), it jumps to execute subs.
See this thread: http://groups.google.com/group/sage-devel/browse_thread/thread/503d0d82307c9aa5
Component: commutative algebra
Keywords: multi_polynomials, evaluation, substitution
Issue created by migration from https://trac.sagemath.org/ticket/10946
Activity