Mathematica and GAP: Is there an interface?

Although the abstract algebra add-in is a great package for Mathematica, imo there is nothing that beats the GAP , at least not for Group Theory. When I looked at the Sage several times, I found that I said that it had an interface with Me, but when I looked at it closer, it turned out to be somewhat primitive (but operational). I know that the work was done at the Technical University of Eindhoven ( OpenMath ) on a platform for integration / interaction of basic mathematical tools, I even started working on it. But this work was lost. Now to my question:

Does anyone, and you are willing to share, the interface between GAP and Mathematica?

+6
source share
2 answers

One option is to use Sage as an intermediate. Sage can interact with both Mathematica and GAP .
I believe that Sage interacts with both programs: a) running console interfaces in the background using pexpect
b) knowing how to translate most of the GAP and Mathematica syntax into your own syntax.

Please note that I did this several times earlier, and it works fine - but that means you cannot use the Mathematica laptop interface ....

A really useful tool would be to bind Mathematica to expect (or pexpect ) so that similar interfaces with console programs could be written for Mathematica. This is basically what the second quote in Sjoerd's answer suggests.

+4
source

The GAP FAQ is apparently very pessimistic:

8.1: Can I call GAP functions from another program?

Short answer:. To explain a little more fully, essentially all of the algebraic functions of the GAP system are written to the GAP, therefore, the GAP interpreter is required to run. The translator is written in C, but does not happily coexist with other code in the same for a number of reasons, so there is no reasonable way to link GAP in C, Java or another program as a library of routines.

There is some hope:

What you can do is run GAP in a child process and establish a connection with it using pipes, pseudo-ttys, UNIX FIFO, or another similar device. We have done this successfully in a number of projects, and you can contact the support list for more detailed recommendations if you want to go down this route.

Update

Frequently asked questions are also read:

More recently, some of the SAGE developers have created libGAP, which allows you to embed the entire GAP system in the form of the C library. It is still impossible to embed individual functions, although the first libGAP call should still trigger the full sequence of GAP startup.

In addition, there are several ways to run GAP as a server process and invoke it from C ++ C programs. See SCSCP Packet for GAP Side. There are several C and C ++ libraries that implement the client side.

+6
source

Source: https://habr.com/ru/post/903976/


All Articles