Skip to content

evaluating symbolic expressions (without conversion to SR, i.e., staying in ring of values) #18092

@dkrenn

Description

@dkrenn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions