#18092: evaluating symbolic expressions (without conversion to SR, i.e.,
staying in
ring of values)
-------------------------+-------------------------------------------------
Reporter: | Owner:
dkrenn | Status: needs_info
Type: | Milestone: sage-6.6
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
symbolics | Work issues:
Keywords: sd66 | Commit:
Authors: | 7e0be7f3a76c98d5ec3e5250947aec814467048b
Daniel Krenn | Stopgaps:
Report Upstream: N/A |
Branch: |
u/dkrenn/SR/eval |
Dependencies: |
-------------------------+-------------------------------------------------
Description changed by dkrenn:
Old description:
> {{{subs}}} of a symbolic expression wraps its values to the symbolic ring
> (if possible) before performing the actual substitution. This ticket
> proposes a new method {{{evaluate}}} which comes over this.
> {{{
> sage: E = (1+x).evaluate(x=RIF(3.42))
> sage: E
> 4.4200000000000000?
> sage: E.parent()
> Real Interval Field with 53 bits of precision
> }}}
> While in the example above you can come over this by doing a conversion
> afterwards, it changes with power series:
> {{{
> 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)
> }}}
New 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)
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/18092#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.