On Jan 6, 2009, at 7:17 PM, thelamecamel wrote:

> Hi,
>
> I have inherited a numerical simulation program a few thousand lines
> long, written in Mathematica (and fortran via mathlink) into Sage.  I
> am fed up with Mathematica as a programming language and would like to
> replace this with python code, to be run in sage.

Welcome! Having a real programming language is I think one of Sage's  
great strengths.

> As an intermediate
> stage I was hoping to drive the mathematica simulations from sage,
> analyse the results in sage, and gradually rewrite the simulation code
> in python/sage.  I have struck trouble early on:
>
> It appears that I can send Sage's lists to mathematica:
> sage: slist = [1,2,3]
> sage: mathematica(slist)
> {1, 2, 3}
>
> But I don't seem to be able to do the reverse:
> sage: mathematica(slist).sage()
> ------------------------------------------------------------
> SyntaxError: invalid syntax (<string>, line 1)
> Error using SAGE to evaluate '{Integer(1), Integer(2), Integer(3)}'
>
> How can I get mathematica lists into sage?

Have you tried list(mathematica(slist))? Just a guess, as I don't  
have a copy of mathematica handy to try it with.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to