Opened 10 years ago
Closed 10 years ago
#8502 closed defect (fixed)
evaluating multivariate polynomials yields non-constant
Reported by: | cremona | Owned by: | AlexGhitza |
---|---|---|---|
Priority: | major | Milestone: | sage-4.4 |
Component: | algebra | Keywords: | polynomial evaluation |
Cc: | wuthrich, malb | Merged in: | sage-4.4.alpha0 |
Authors: | John Cremona | Reviewers: | Alex Ghitza |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
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.
Attachments (1)
Change History (5)
comment:1 Changed 10 years ago by
- Cc malb added
comment:2 Changed 10 years ago by
- Status changed from new to needs_review
comment:3 Changed 10 years ago by
- Reviewers set to Alex Ghitza
- Status changed from needs_review to positive_review
Looks good.
comment:4 Changed 10 years ago by
- Merged in set to sage-4.4.alpha0
- Resolution set to fixed
- Status changed from positive_review to closed
Merged "trac_8502-mpoly.patch" in 4.4.alpha0.
Note: See
TracTickets for help on using
tickets.
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.