#13711: charpoly error on matrices with pi
----------------------------------+-----------------------------------------
Reporter: eviatarbach | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: linear algebra | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
----------------------------------+-----------------------------------------
Comment (by nbruin):
The right way of turning a constant into an expression is apparently via
the `expression` method. The element constructor for `SR` tests for the
presence of a `_symbolic_` method on its argument. If we add a method to
`sage.symbolic.constants.Constant`:
{{{
def _symbolic_(self,SR):
"""
doctest:
sage: SR(sage.symbolic.constants.Constant('a'))
a
sage: SR(sage.symbolic.constants.Constant('a')).subs(a=10)
a
"""
return SR(self.expression())
}}}
the system picks up the conversion. The double conversion that's happening
here is a little sad, but the interface for `_symbolic_` is that the ring
in question is given as a parameter. I guess our design does not rule out
the existence of multiple symbolic rings, whereas `expression` will return
a member of whatever symbolic ring is considered "home" by pynac.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13711#comment:2>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.