Am I missing something here?
sage: F.<p> = FunctionField(QQ)
sage: f = F.random_element()
sage: f
(-p^2 + 5*p)/(-2/9*p^2 + 54)
sage: f.subs({p:3})
(-p^2 + 5*p)/(-2/9*p^2 + 54)
I have an element f of a rational function field F in one variable and
want to "evaluate" it at a value of the variable (which I know will
not be a pole). The documentation for f.subs? suggests that the above
is the right way to do this. However looking at the code f.subs??
shows that unless f has a __cal__ method then it does nothing, and
that is what is happening here.
I can see why adding the __call__ method to a rational function might
be problematical since in general there will be poles, but there must
be some way of substituting p=3 into a rational function! All I can
do is
sage: f.numerator()(3)/f.denominator()(3)
3/26
John
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.