# Call Magma in Mathematica

I've written some code in Mathematica, related to some group theory questions I have. Subsequently, I found that part of the code could be significantly sped up if I could just call a routine in Magma. Is there any way to have Mathematica ask Magma to run a subroutine, and then have Mathematica use the output?

More specifically, my Mathematica code outputs a bunch of relations, such as $a^2=b^2,ab=ca$. I need to then have Magma run the lines of code:

g:=Group<a,b,c|a*a=b*b,a*b=c*a>;n:=Index(g,sub<g|g.1>);n;


and then I need Mathematica to use the output $n$.

• Can you add a minimal example to clarify what you want to do? This might make answering more efficient. Jan 8 '16 at 9:25
• Here's a component to use a similar package to magma called GAP: github.com/msollami/CodingBlog/blob/CodingBlog/GapLink.nb
– M.R.
Jan 8 '16 at 15:53
• If you don't find a package that already communicates with Magma then you'll have to roll your own. The simplest way to communicate may be using StartProcess and related functions, if these work well with Magma and if Magma accepts piped input. The other option is to use MathLink to link them up. MathLink has official C, Java and .NET APIs. Doing this will be a lot of work (expect several days in the least), so I would definitely start with controlling the magma process using StartProcess. Jan 8 '16 at 16:36
• @M.R. Your link is dead now. Do you still have this? Jun 6 '18 at 10:46