subs in fractions of polynomials

18 views
Skip to first unread message

Martin R

unread,
Nov 14, 2021, 6:25:46 AM11/14/21
to sage-support
I would expect subs to replace c with 1, but it doesn't.  Why?

sage: S.<a, b, c, d, e, f, g> = QQ[]
sage: R.<x> = S[]
sage: ex = (a*x+b)/(c*x + d) - (e*x+f)/(g*c*x + g*d)
sage: ex
((a*g - e)*x + b*g - f)/(c*g*x + d*g)
sage: ex.subs(c=1)
((a*g - e)*x + b*g - f)/(c*g*x + d*g)
sage: ex.subs({c:1})
((a*g - e)*x + b*g - f)/(c*g*x + d*g)

Dima Pasechnik

unread,
Nov 14, 2021, 6:27:44 AM11/14/21
to sage-support
how about ex(c=1) ?
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/1504387a-90c4-46d2-9759-a952bafe8edfn%40googlegroups.com.

Martin R

unread,
Nov 14, 2021, 6:33:59 AM11/14/21
to sage-support
ah!  that's a good idea.

is it "obvious", that subs won't work?

Dima Pasechnik

unread,
Nov 14, 2021, 6:58:48 AM11/14/21
to sage-support
it seems that .subs() does not work for fraction fields, but only for
polynomial rings.
No idea why. File a ticket.

On Sun, Nov 14, 2021 at 11:34 AM 'Martin R' via sage-support
<sage-s...@googlegroups.com> wrote:
>
> ah! that's a good idea.
>
> is it "obvious", that subs won't work?
>
> dim...@gmail.com schrieb am Sonntag, 14. November 2021 um 12:27:44 UTC+1:
>>
>> how about ex(c=1) ?
>>
>> On Sun, Nov 14, 2021 at 11:25 AM 'Martin R' via sage-support
>> <sage-s...@googlegroups.com> wrote:
>> >
>> > I would expect subs to replace c with 1, but it doesn't. Why?
>> >
>> > sage: S.<a, b, c, d, e, f, g> = QQ[]
>> > sage: R.<x> = S[]
>> > sage: ex = (a*x+b)/(c*x + d) - (e*x+f)/(g*c*x + g*d)
>> > sage: ex
>> > ((a*g - e)*x + b*g - f)/(c*g*x + d*g)
>> > sage: ex.subs(c=1)
>> > ((a*g - e)*x + b*g - f)/(c*g*x + d*g)
>> > sage: ex.subs({c:1})
>> > ((a*g - e)*x + b*g - f)/(c*g*x + d*g)
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups "sage-support" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
>> > To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/1504387a-90c4-46d2-9759-a952bafe8edfn%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/8119eaa9-6b15-4eee-b7a8-699df0b3180fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages