next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
MapleInterface :: MapleInterface

MapleInterface -- Interface to Maple.


What’s new:

December 1, 2009: Added functions msqrt computing the modular square root (for large numbers) and integralBasis computing an integral basis of an algebraic function field.

October 4, 2009: Added method callMaple(String).

August 25, 2009: Added an Option store to callMaple to store the result of a computation in a file, and a function readMaple to read the file.


The goal of this package is to provide an interface to run Maple scripts from Macaulay2.


This package is just an interface. To use it you need a licence for Maple and have the program installed on your machine.

Install this package by doing


Edit the file init-MapleInterface.m2 in the directory .Macaulay2 in your home directory changing the line

"MapleCommand" => "maple"


"MapleCommand" => StringWithMapleCommand

where StringWithMapleCommand is a string containing the command starting command-line Maple in the shell.

This is usually "maple" on Unix machines (be sure that you do not put the command launching xmaple).

If you are using Macaulay2 in cygwin and the Windows native Maple version best put the complete path to the Maple command line executeable, e.g., StringWithMapleCommand could be (depending on the Maple version)

"C:/Program Files/Maple 9.5/"

(English Windows version)

"C:/Programme/Maple 9.5/"

(German Windows version).

To test whether the interface is working do, e.g.,


(which should return 1)


Note that the file init-MapleInterface.m2 will be overwritten when you reinstall a newer version of the package, but there will be a backup.



This documentation describes version 0.3 of MapleInterface.

Source code

The source code from which this documentation is derived is in the file MapleInterface.m2. The auxiliary files accompanying it are in the directory MapleInterface/.


  • Functions and commands
    • callMaple -- Run a Maple program from Macaulay 2.
    • integralBasis -- Compute an integral basis of an algebraic function field.
    • msqrt -- Compute modular square root.
    • readMaple -- Read the result of a previous Maple computation.
  • Symbols
    • store -- Store result of a Maple computation in a file.