Ask Your Question

Revision history [back]

Is it possible to run GAP code in Sage?

This might be a very basic question, but I'm struggling to find a solution. I have created a function in GAP, and I want to use it in Sagemath. So my question is: is it possible to run GAP code in Sage? For example:

f = gap('f := function(n) .... my entire code in GAP ... end;')

If it's not possible to run an entire code block, can I at least create a function in Sage that calls GAP functions?

To illustrate a simple scenario: Suppose I define vector spaces V and U in Sage. I want to define a morphism f using the GAP function LeftModuleHomomorphismByImages(V, U, gens, imgs).