Can commands in GAP be executed and results be used from another software, like MATLAB or Maple?

125 Views Asked by At

Can commands in GAP be executed and results be loaded to another computation in a program in softwares like MATLAB or Maple?

I saw in FAQ in GAP main website "Can I call GAP functions from another programme?", and it was answered saying "...run GAP in a child process and communicate with it using pipes, pseudo-ttys, UNIX FIFOs or some similar device." So can I do the same?

As an example, I need to compute the direct product of two finite groups in GAP and load the resulting elements to a program in MATLAB or Maple. Is this possible using pipes, pseudo-ttys or UNIX FIFOs as mentioned above?

Please be kind enough to advice me in this regard.

Thanks a lot in advance.

1

There are 1 best solutions below

2
On BEST ANSWER

There are a couple of ways one could integrate GAP calculations into other systems, but in general this hard, has no ready-made solutions (in particular it is unlikely that someone would have code at hand that you could just use), will not work under Windows, and might run into difficulties in that the other system has no corresponding concept for some of GAP's objects. (For example, I doubt that MATLAB will understand a direct product, so what you transfer might be a list of permutations, given as lists of images.) In order from easy-to-do to hard:

  • Use Sage which integrates GAP and a number of other systems
  • Transfer data by hand -- i.e. cut, possibly edit, and paste the objects by hand between the systems
  • Use SCSCP (https://www.gap-system.org/Packages/scscp.html). You will need to find a dual interface for the other system. Maple has one, I'm not aware for MATLAB
  • Have the other system (Maple, MATLAB &c) print a file that is valid GAP input (write your own function for that), then have it call GAP on this input, and have the GAP routines produce (again write your own code for that) a file with valid input for the other system.
  • Ditto but go through Unix pipes &c
  • Use the libgap interface provided for Sage to write your own integration for the other system

All but the first two might not be worth the effort unless you have a significant number of calculations to do this way.