Opened 8 years ago
Last modified 3 years ago
#10946 new defect
Evaluation and subsitution of multi-variable polynomials
Reported by: | wuthrich | Owned by: | malb |
---|---|---|---|
Priority: | major | Milestone: | sage-7.4 |
Component: | commutative algebra | Keywords: | multi_polynomials, evaluation, substitution |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
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
Change History (6)
comment:1 Changed 8 years ago by
comment:2 Changed 6 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:3 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:4 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:5 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:6 Changed 3 years ago by
- Description modified (diff)
- Milestone changed from sage-6.4 to sage-7.4
This came up when I tried to resolve #10888. But I found a different way of dealing with it there: I changed the troublesome occurriencies of ii) by i).