#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: | 276f0f3d3583c66c7e137350c578e8588c9b236d
Daniel Krenn | Stopgaps:
Report Upstream: N/A |
Branch: |
u/dkrenn/SR/eval |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by cheuberg):
Replying to [comment:19 nbruin]:
> Anyway, `fast_callable` takes a best effort approach towards compiling a
program that tries to perform the evaluation, so that might be your best
bet.
I had another instance where I needed a version of `.subs` like in this
ticket, because there is no coercion from a number field to the symbolic
ring.
{{{
sage: K.<omega> = NumberField(x^4 + 1)
sage: var('u')
sage: z = u/(u + 1)^2
sage: z.subs(u=omega)
Traceback (most recent call last):
...
TypeError: no canonical coercion from Number Field
in omega with defining polynomial x^16 + 1 to
Symbolic Ring
}}}
Using `fast_callable` works in this case:
{{{
sage: fast_callable(z, vars=[u])(omega)
1/2*omega^3 - 1/2*omega + 1
}}}
It works, but the solution is hard to find and the notation a bit
cumbersome.
I see several solutions:
1. adding a link to `fast_callable` and some examples from this ticket to
the documentation of `subs`.
2. indeed create a method as proposed here which acts as a wrapper for
`fast_callable`.
Opinions?
--
Ticket URL: <http://trac.sagemath.org/ticket/18092#comment:31>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.