14.11 Interface to Mathematica

Module: sage.interfaces.mathematica

Interface to Mathematica

The Mathematica interface will only work if Mathematica is installed on your computer with a command line interface that runs when you give the math command. The interface offers three pieces of functionality:

  1. mathematica_console() - A function that dumps you into an interactive command-line Mathematica session. This is an enhanced version of the usual Mathematica command-line, in that it provides readline editing and history (the usual one doesn't!)

  2. mathematica(expr) - Creation of a SAGE object that wraps a Mathematica object. This provides a Pythonic interface to Mathematica. For example, if f=mathematica('x2-1'), then f.Factor() returns the factorization of $ x^2 - 1$ computed using Mathematica.

  3. mathematica.eval(expr) - Evaluation of arbitrary Mathematica expressions, with the result returned as a string.



Subsections
See About this document... for information on suggesting changes.