Ticket #4325 (closed defect: wontfix)
CC() fails on Mathematica output
| Reported by: | ddrake | Owned by: | was |
|---|---|---|---|
| Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | interfaces | Keywords: | mathematica |
| Cc: | Author(s): | ||
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description
Using 3.1.2 on sage.math:
sage: mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]')
-0.105203133241753451256 + 0.017589014615189905553 I
Now say I want to get a CC element out of that:
sage: CC(mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]'))
------------------------------------------------------------
File "<string>", line 1
-RealNumber('0.105203133241753451256')+RealNumber('0.017589014615189905553')I
^
SyntaxError: unexpected EOF while parsing
It's confused because Mathematica uses a space between the number and I; a workaround is to put in an asterisk:
sage: CC(mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]').replace(' I', '*I'))
-0.105203133241753 + 0.0175890146151899*I
I understand that this kind of parsing can get difficult and complicated, but it seems like something we should aim for.
Change History
Note: See
TracTickets for help on using
tickets.
