Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does it compare to sage math? I used sage math today and was pleasantly surprised. Even has a latex option. If you name your variables correctly, it even outputs Greek symbols and subscript correctly!


As one point of comparison, SymPy is comically slow compared to Sage. This is mostly because SymPy is purely Python; Sage on the other hand uses its own derivative of GiNaC [1], Pynac [2], for its internal symbolic expression representation, and then multiple external libraries for non-trivial operations. Symbolic transformations are mostly Maxima [3], for example. Sage literally converts expressions to strings, pipes them through a Maxima process, and then parses the result back. This is still much faster than the pure Python SymPy.

There is an effort to speed up SymPy core, SymEngine [4], but it's been in development for years now, and still isn't integrated into SymPy. Not sure why.

Case in point: 'expand("(2 + 3 * x + 4 * x * y)^60")' takes 5 seconds with SymPy; Sage (Pynac) does the same in 0.02 seconds.

[1] https://www.ginac.de/

[2] http://pynac.org/

[3] http://maxima.sourceforge.net/

[4] https://github.com/symengine/symengine


As per the Sage FAQ[0], Sage uses Maxima for its symbolic and numerical computation: http://maxima.sourceforge.net/

[0] https://doc.sagemath.org/html/en/faq/faq-general.html#why-di...


I have Sympy set up to do latex printing in my Jupyter notebooks with Greek symbols and subscripts etc.


User 29athrowaway mentions in another comment that they use Sympy through Sagemath, so they probably could answer your question best. It sounds like Sympy is a subset of what Sage offers, but I'm not familiar enough with either tool to know.


There's a lot of overlap and there are syntactical differences. SymPy is included in the CoCalc image. SageMath is now conda-installable.

Things that the SageMath CAS can do that SymPy cannot yet:

- solve multivariate systems of inequalities


Try sympy.latex(expr). You can output latex using Sympy too!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: