5 ms·
Is that maybe because you are familiar with Mathematica?
by FPGAhacker 4y ago
Is that maybe because you are familiar with Mathematica?
- auggierose 4y agoI don't have experience with SageMath, but if they are really running on Python, then they are surely giving up on some of the nice rewriting that Mathematica is based on, as I would expect then a library call is needed instead in Python.
- vacuumcl 4y agoNo. In Mathematica important operations like mapping functions over sets (arrays/tensors) at various depths have simple operators such as (/@, @, @@, @@@). You can do functional composition using @*, etc. You don't need to define your variables and functions before being able to write them in expressions. Often you want to have intermediate terms that have some temporary name, and which get substituted later on. The replacement rules in Mathematica are very powerful for this. As another example, I googled some project Euler solutions in Mathematica and (pure Python) and found this: https://www.nayuki.io/page/project-euler-solutions https://www.nayuki.io/page/project-euler-solutions. Compared to the pure Python solutions, the Mathematica code is typically much smaller. Of course this is not Sympy, but a lot of the Python syntax carries over to SymPy as well.
- nayuki 4y agoMy Mathematica solutions are a bit shorter than my Python solutions mainly because of convenient functions like PrimeQ, Binomial, ContinuedFraction.