I seem to be getting a weird result when I use .subs over QQbar:
R.<x,y,c>=PolynomialRing(QQbar,3)
Y=(x^4*y + 2*c*x^2*y^3 - x*y^4 + (c^2 + c)*y^5)/(x^2*y - x*y^2 +c*y^3)
fm=[x^2 + c*y^2, y^2]
W1=Y.subs({x:fm[0],y:fm[1]})
Yn=Y.numerator().subs({x:fm[0],y:fm[1]})
Yd=Y.denominator().subs({x:fm[0],y:fm[1]})
print Yn/Yd==W1
This is False when it should be True (and is True for other rings/fields).
But if I use __call__() to do the substution it works fine.
For example:
S.<c>=PolynomialRing(QQbar,1)
R.<x,y>=PolynomialRing(S,2)
Y=(x^4*y + 2*c*x^2*y^3 - x*y^4 + (c^2 + c)*y^5)/(x^2*y - x*y^2 +c*y^3)
fm=[x^2 + c*y^2, y^2]
W1=Y.subs({x:fm[0],y:fm[1]})
Yn=Y.numerator().subs({x:fm[0],y:fm[1]})
Yd=Y.denominator().subs({x:fm[0],y:fm[1]})
print Yn/Yd==W1
print Yn/Yd==Y(fm)
I didn't see anything on the trac-server. Am I using .subs()
inappropriately, or is Sage returning the wrong result? This is sage5.5 on
Ubuntu.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.