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

evaluating multivariate polynomials yields non-constant #8502

Closed
JohnCremona opened this issue Mar 11, 2010 · 8 comments
Closed

evaluating multivariate polynomials yields non-constant #8502

JohnCremona opened this issue Mar 11, 2010 · 8 comments

Comments

@JohnCremona
Copy link
Member

The following behaviour does not agree with the documentation for the {{{call}} function on multivariable polynomials, which states that (as one would expect and hope) the result should lie in the constant field:

sage: K.<t> = NumberField(x^2+47)
sage: R.<X,Y,Z> = K[]
sage: f = X+Y+Z
sage: a = f(t,t,t)
sage: a.parent()
Multivariate Polynomial Ring in X, Y, Z over Number Field in t with defining polynomial x^2 + 47

It is also inconsistent:

sage: R.<X,Y,Z> = QQ[]
sage: f = X+Y+Z
sage: a = f(2,3,4)
sage: a.parent()
Rational Field

This causes strange bugs -- see #8498 for an example.

CC: @categorie @malb

Component: algebra

Keywords: polynomial evaluation

Author: John Cremona

Reviewer: Alex Ghitza

Merged: sage-4.4.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8502

@JohnCremona
Copy link
Member Author

comment:1

Bug fixed: I added tests for when the resulting value is either 0, or a nonzero constant, in which case an element of the base ring is returned. Otherwise an element of the parent is returned (so you can still evaluate f(x+y,y) and similar.)

Patch up as soon as testing is finished.

malb: I'm CC-ing you as the past person to work on this file.

@JohnCremona
Copy link
Member Author

Author: John Cremona

@JohnCremona
Copy link
Member Author

Applies to 4.3.5

@JohnCremona
Copy link
Member Author

comment:2

Attachment: trac_8502-mpoly.patch.gz

@aghitza
Copy link

aghitza commented Apr 3, 2010

Reviewer: Alex Ghitza

@aghitza
Copy link

aghitza commented Apr 3, 2010

comment:3

Looks good.

@jhpalmieri
Copy link
Member

Merged: sage-4.4.alpha0

@jhpalmieri
Copy link
Member

comment:4

Merged "trac_8502-mpoly.patch" in 4.4.alpha0.

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

3 participants