Interpreter Interfaces¶
Sage provides a unified interface to the best computational software. This is accomplished using both C-libraries (see C/C++ Library Interfaces) and interpreter interfaces, which are implemented using pseudo-tty’s, system files, etc. This chapter is about these interpreter interfaces.
Note
Each interface requires that the corresponding software is installed on your computer. Sage includes GAP, PARI, Singular, and Maxima, but does not include Octave (very easy to install), MAGMA (non-free), Maple (non-free), or Mathematica (non-free).
There is overhead associated with each call to one of these
systems. For example, computing 2+2 thousands of times using
the GAP interface will be slower than doing it directly in
Sage. In contrast, the C-library interfaces of
C/C++ Library Interfaces
incur less overhead.
In addition to the commands described for each of the interfaces
below, you can also type e.g., %gap,
%magma, etc., to directly interact with a given
interface in its state. Alternatively, if X is an
interface object, typing X.interact() allows you to
interact with it. This is completely different than
X.console() which starts a complete new copy of
whatever program X interacts with. Note that the
input for X.interact() is handled by Sage, so the
history buffer is the same as for Sage, tab completion is as for
Sage (unfortunately!), and input that spans multiple lines must be
indicated using a backslash at the end of each line. You can pull
data into an interactive session with X using
sage(expression).
The console and interact methods of an interface do very different things. For example, using gap as an example:
gap.console(): You are completely using another program, e.g., gap/magma/gp Here Sage is serving as nothing more than a convenient program launcher, similar to bash.gap.interact(): This is a convenient way to interact with a running gap instance that may be “full of” Sage objects. You can import Sage objects into this gap (even from the interactive interface), etc.
The console function is very useful on occasion, since you get the exact actual program available (especially useful for tab completion and testing to make sure nothing funny is going on).
- Common Interface Functionality
- Common Interface Functionality through Pexpect
- Sage wrapper around pexpect’s
spawnclass and - Abstract base classes for interface elements
- Abstract class for Python internal interfaces
- Interface to Axiom
- The Elliptic Curve Factorization Method
- Interface to 4ti2
- Interface to FriCAS
- Interface to Frobby for fast computations on monomial ideals.
- Interface to GAP
- Interface to GAP3
- Interface to Groebner Fan
- Pexpect Interface to Giac
- Interface to the Gnuplot interpreter
- Interface to the GP calculator of PARI/GP
- Interface for extracting data and generating images from Jmol readable files.
- Interface to KASH
- Library interface to Kenzo
- Interface to LattE integrale programs
- Interface to LiE
- Lisp Interface
- Interface to Macaulay2
- Interface to Magma
- Interface to the free online MAGMA calculator
- Interface to Maple
- Interface to Mathematica
- Interface to Mathics
- Interface to MATLAB
- Pexpect interface to Maxima
- Abstract interface to Maxima
- Library interface to Maxima
- Interface to MuPAD
- Interface to mwrank
- Interface to GNU Octave
- Interface to PHC.
- Interface to polymake
- POV-Ray, The Persistence of Vision Ray Tracer
- Parallel Interface to the Sage interpreter
- Interface to QEPCAD
- Interfaces to R
- Interface to Regina
- Interface to several Rubik’s cube solvers.
- Interface to Sage
- Interface to Scilab
- Interface to Singular
- Interface to SnapPy
- SymPy –> Sage conversion
- Mixin For Extra Tab Completions
- The Tachyon Ray Tracer
- Interface to TIDES
- Quitting interfaces
- An interface to read data files
Indices and Tables¶
Bibliography
A. Abad, R. Barrio, F. Blesa, M. Rodriguez. “TIDES tutorial: Integrating ODEs by using the Taylor Series Method.” https://web.archive.org/web/20120206041615/http://www.unizar.es/acz/05Publicaciones/Monografias/MonografiasPublicadas/Monografia36/IndMonogr36.htm
A. Abad, R. Barrio, F. Blesa, M. Rodriguez. Algorithm 924. ACM Transactions on Mathematical Software, 39 no. 1 (2012), 1-28.
Benjamin Assarf, Ewgenij Gawrilow, Katrin Herr, Michael Joswig, Benjamin Lorenz, Andreas Paffenholz, and Thomas Rehn, Computing convex hulls and counting integer points with polymake, Math. Program. Comput. 9 (2017), no. 1, 1-38, https://doi.org/10.1007/s12532-016-0104-z
Ewgenij Gawrilow, Simon Hampe, and Michael Joswig, The polymake XML file format, Mathematical software - ICMS 2016. 5th international congress, Berlin, Germany, July 11-14, 2016. Proceedings, Berlin: Springer, 2016, pp. 403-410, https://doi.org/10.1007/978-3-319-42432-3_50, ISBN 978-3-319-42431-6/pbk.
Ewgenij Gawrilow and Michael Joswig, polymake: a framework for analyzing convex polytopes, Polytopes—combinatorics and computation (Oberwolfach, 1997), DMV Sem., vol. 29, Birkhäuser, Basel, 2000, pp. 43-73. https://doi.org/10.1007/978-3-0348-8438-9_2
Ewgenij Gawrilow and Michael Joswig, Flexible object hierarchies in polymake (extended abstract), Mathematical software—ICMS 2006, Lecture Notes in Comput. Sci., vol. 4151, Springer, Berlin, 2006, pp. 219-221, https://doi.org/10.1007/11832225_20
Ewgenij Gawrilow, Michael Joswig, Thilo Rörig, and Nikolaus Witte, Drawing polytopal graphs with polymake, Comput. Vis. Sci. 13 (2010), no. 2, 99-110, https://doi.org/10.1007/s00791-009-0127-3
Michael Joswig, Benjamin Müller, and Andreas Paffenholz, polymake and lattice polytopes, 21st International Conference on Formal Power Series and Algebraic Combinatorics (FPSAC 2009), Discrete Math. Theor. Comput. Sci. Proc., AK, Assoc. Discrete Math. Theor. Comput. Sci., Nancy, 2009, pp. 491-502