#6873 closed defect (duplicate)
*huge* bug in multivariate polynomial substitution
Reported by: | was | Owned by: | malb |
---|---|---|---|
Priority: | critical | Milestone: | sage-duplicate/invalid/wontfix |
Component: | commutative algebra | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Observe:
sage: R.<x,y> = QQ[] sage: f = x + 2*y sage: f.subs(x=y,y=x) 3*y sage: var('x,y') sage: f = x + 2*y sage: f.subs(x=y,y=x) 2*x + y
This is really really bad. Notice in the first and second substitution that the semantics are completely wrong/inconsistent. The semantics should be as in the second one in both cases.
If you do f.subs
in the first case above you'll see at the bottom code using I think libsingular that is really wrong. Probably the only way to do this right will be to construct a homomorphism and apply it (?), sort of like this:
sage: R.<x,y> = QQ[] sage: f = x + 2*y sage: R.hom([y,x])(f) 2*x + y
Change History (4)
comment:1 Changed 12 years ago by
- Description modified (diff)
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
- Resolution set to duplicate
- Status changed from new to closed
Dupe of #6482
comment:4 Changed 12 years ago by
- Milestone changed from sage-4.1.2 to sage-duplicate/invalid/wontfix
Note: See
TracTickets for help on using
tickets.
This is a dupe of #6482.
I think the fix is to not check whether
b
ina=b
is a monomial but whether it is constant. If it isn't a constant we should just fall back tofast_map
.