Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation and subsitution of multi-variable polynomials #10946

Open
chriswuthrich opened this issue Mar 16, 2011 · 2 comments
Open

Evaluation and subsitution of multi-variable polynomials #10946

chriswuthrich opened this issue Mar 16, 2011 · 2 comments

Comments

@chriswuthrich
Copy link
Contributor

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

@chriswuthrich
Copy link
Contributor Author

comment:1

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).

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-6.4, sage-7.4 Aug 15, 2016
@mkoeppe mkoeppe removed this from the sage-7.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants