#6873: *huge* bug in multivariate polynomial substitution
---------------------------------+------------------------------------------
Reporter: was | Owner: malb
Type: defect | Status: new
Priority: critical | Milestone: sage-4.1.2
Component: commutative algebra | Keywords:
Reviewer: | Author:
Merged: |
---------------------------------+------------------------------------------
Description changed by was:
Old description:
> 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.
New description:
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
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6873#comment:1>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---