What is the difference between SymPy and Sage a.k.a. SageMath?
(Full disclosure: I am the lead developer of SymPy)
The first thing you should understand is that SymPy and Sage are not quite the same thing. SymPy is a pure Python library, that does computer algebra. Sage is a collection of open source mathematical software. Sage tries to gather together all the major open source mathematics software, and glue it together into a useful system. In fact, Sage includes SymPy as one of its systems.
Here is a short list of (biased) facts for each (I won't call them pros or cons, just facts):
**
as it is in Python, not ^
as it is in many other systems.from sympy import init_session; init_session()
at the top (replace init_session
with init_printing
if you just want printing and not to import everything).1/2
without wrapping the integer literals, and it will return a rational. x^2
gives x squared, not Xor(x, 2)
. I'm not sure if it automatically defines variables for you by default. This means that things that you do in an interactive Sage session might not translate directly to a Python script. On the other hand, this can be useful for interactive use (btw, SymPy also has isympy -I
that does some similar things).Maybe that's not what you were looking for. You probably wanted some actual mathematical features. But as I said, Sage includes SymPy, so by definition, every feature of SymPy will be a feature of Sage. In practice, this is not necessarily the case because Sage doesn't always use SymPy by default (I'm not sure what the current status of this is actually), so you may have to call to SymPy manually if you want to use it from within Sage.