-
-
Notifications
You must be signed in to change notification settings - Fork 662
Open
Description
This ticket proposes a new method evaluate
which can evaluate symbolic expressions at values coming from a ring which not coerces into SR
. The result again lives in the ring of the values. This forces the calculation to be done completely in the given ring (and not in the symbolic ring, where sometimes one does not know exactly what's going on).
For example:
sage: P.<p> = ZZ[[]]
sage: E = x.evaluate(x=p)
sage: E, E.parent()
(p, Power Series Ring in p over Integer Ring)
which is not possible with subs
sage: P.<p> = ZZ[[]]
sage: x.subs(x=p)
Traceback (most recent call last):
...
TypeError: no canonical coercion from Power Series Ring in p over Integer Ring to Symbolic Ring
sage: E = x.evaluate(x=p)
sage: E, E.parent()
p, Power Series Ring in p over Integer Ring)
CC: @cheuberg @mezzarobba
Component: symbolics
Keywords: sd66
Author: Daniel Krenn
Branch/Commit: u/dkrenn/SR/eval @ 276f0f3
Issue created by migration from https://trac.sagemath.org/ticket/18092