22

I recently found a very useful open-source math software called Sage, which provides many useful functions lacking in Mathematica. Since I'm more used to the Mathematica language instead of the language (Python) used in Sage, the ability of calling Sage functions from Mathematica will be of great help. Any ideas on how to do that?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
hxiao
  • 887
  • 5
  • 11
  • 1
    Since Sage is built on a huge library consisting of lots of open-source packages and some other standalone softwares, calling Sage functions from Mathematica will strengthen the power of Mathematica. – hxiao Oct 08 '14 at 14:07
  • 5
    Could you please provide 1-2 examples of Sage functions lacking in Mathematica ? This will also attract more interest to your question. – b.gates.you.know.what Oct 08 '14 at 14:24
  • 2
    Take a look at Sage functions in algebraic geometry, etc.: http://www.sagemath.org/doc/tutorial/tour_advanced.html – murray Oct 08 '14 at 14:32
  • 1
    @b.gatessucks For example, recently I need to repeatedly enumerate all vertices of a large number of polytopes. In Mma, we can use a very old and inefficient package VertexEnum.m. Even the author of the package suggested this package can only handle polytopes with dimensions no larger than 8. To my knowledge, we have no other method to do vertex enumeration in Mma, not to mention other operations on polytopes. – hxiao Oct 08 '14 at 15:34
  • @b.gatessucks However, in Sage we can define an object Polyhedron via LP (H-representation). Then the vertex enumeration is just to list all vertices of the polytope. According to my experience, the speed of vertex enumeration in Sage is much much faster than that in Mma. – hxiao Oct 08 '14 at 15:37
  • @b.gatessucks Another example is constructing large scale linear programming problems (LP) defined on graph structures. The most common way in Mma is to use constraint matrix. However, Sage provides another very flexible way by using the add_constraint method for LP defined by function MixedIntegerLinearProgram. With that method, one can recursively add constraint one by one to the LP without looking into the constraint matrix. Besides, Sage provides many choices for the LP solver. – hxiao Oct 08 '14 at 15:56
  • you can call Mathematica from sagemath. not sure this will help in wanting to call sagemath from Mathematica though :) Now you can also call mathics from sage. – Nasser Mar 11 '22 at 07:27

0 Answers0