You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I think the fix is to not check whether b in a=b is a monomial but whether it is constant. If it isn't a constant we should just fall back to fast_map.
Observe:
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:Component: commutative algebra
Issue created by migration from https://trac.sagemath.org/ticket/6873
The text was updated successfully, but these errors were encountered: