8
$\begingroup$

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$.

$\endgroup$
  • 1
    $\begingroup$ Can you add a minimal example to clarify what you want to do? This might make answering more efficient. $\endgroup$ – Yves Klett Jan 8 '16 at 9:25
  • $\begingroup$ Here's a component to use a similar package to magma called GAP: github.com/msollami/CodingBlog/blob/CodingBlog/GapLink.nb $\endgroup$ – M.R. Jan 8 '16 at 15:53
  • 2
    $\begingroup$ 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. $\endgroup$ – Szabolcs Jan 8 '16 at 16:36
  • $\begingroup$ @M.R. Your link is dead now. Do you still have this? $\endgroup$ – Szabolcs Jun 6 '18 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.