I'm wondering if anyone can let me know advantages to installing/setting up Sage on my computer for doing computational math (work in groups, finite fields, and combinatorics, along with some search algorithms).
Currently, I do a lot of my work with Magma; this is great and fast for implementing permutation groups and doing linear algebra over finite fields. I have also been doing some searching for combinatorial objects by setting up my matrices in Magma (geometric constructs), saving them to a file, then using Gurobi to search by setting up an integer programming problem. Gurobi uses a Python interface, so I have a Python script modify my Magma output and feed it into Gurobi and then initialize my problem.
As I understand Sage, it is based on Python, and can interface with a bunch of other things, including Magma and Gurobi. But the syntax seems really weird for calling Magma through the Sage interface. Is there some advantage to be gained? Mostly in terms of using Sage to interface between the two other programs? Am I better off just using Python?
Update, since this question was closed at some point: To make this less opinion based, I am (was) really interested in knowing if it is possible to attain the functionality of Sage in normal Python by loading packages, or if not, what does Sage provide that can not be easily reproduced in Python?
This answer is something of a counterpoint to Samuel's enthusiastic answer. In short (and to directly answer your question), I would say that you are much better off just using Python (or other constituent programs) directly. Exactly which of these you might use depends very much on what you want to do.
While Sage relies on Python, it is not a simple Python library. It is a monolithic amalgam of many open source, mathematical tools. The tools are supposedly integrated via a single language but, in reality, the parts don't generally fit together very well. Here's a simple example that you can try on CoCalc or a SageCellServer:
Any reasonable computer algebra system should be able to deal with this problem. Sage simply returns a long string of errors. To be fair, there is a workaround: simply execute the command
assume(n!=-1)before executing theintegratecommand. (Or, I guess, one could executeassume(n == -1)first; it's hard to say.) But this step is not necessary in maxima, the (very good) computer algebra system that Sage punts to forintegrateand many other algebraic tasks. Thus, this example illustrates an important point: The various tools incorporated into Sage are tied together very poorly. As a result, we might say that Sage is much less than the sum of it's parts. Thus one wonders, why not just use the parts that one needs?Again, you ask specifically about the use of Python and it sounds like you've already got a Python program to do exactly the kind of thing that it's good for. So, why mess with Sage? You're not going to use Sage's Python to execute your program - you'll probably use your system Python or some other (more manageable) Python distribution. Furthermore, there's a huge scientific ecosystem surrounding Python that's developed a large number of great mathematical libraries. Use what you need.
In fairness, there is quite a bit of mathematical code that's been developed specifically for Sage, particularly in number theory. If you happen to need exactly that stuff, then go for it. Also, the Sage group has been an important force in the open source movement for mathematical software. I'm fairly certain their server based notebook inspired the notebook we see in Jupyter now, for example. Having said that and admitting that I love to tinker with open source software, I really think that the advantage that open source software supposedly has in mathematics over closed source software is quite overblown.
Whatever you do, first and foremost - have fun with the math and the code!