I have been using Symbolics in Julia and the only other symbolic algebra package I have used is sympy (from python). My question is does Julia Symbolics/SymbolicUtils use Reduce (I do see there is a Julia interface for Reduce). So does Symbolics use Reduce, if not which is more capable for simplifying algebraic expressions? I hope this is not a can of worms but I do need a efficient simplification program for what I am doing. Should I be learning the Julia Reduce package?
No. Reduce is too slow. In fact, Symbolics.jl started because Reduce was too slow to be used as a backend to ModelingToolkit.
I think at this point, Reduce might have a better default simplifier but Symbolics is more capable in terms of extensions, and we should improve our default simplification rules but writing your own set of rules is easier than you’d think. I think if someone took another pass at the default simplification rules we’ll be able to overcome the last hurdle here and call victory.
I would say no. It still has a few features we don’t have, but it’s generally very slow. It’s stable in a way that’s good but in a way that also means it’s not improving. Meanwhile, Symbolics is still improving fast. For example, symbolic rootfinding and solving is landing… later today? And some major performance improvements are expected in the next few months.
SymPy also still has its spots, though it’s similar: slow but has some pieces a bit more robust and some of our missing spots (like symbolic integration). We’re targeting those spots one after the other and our development is moving much faster than theirs as well.
That’s quite encouraging to hear! I also see there’s a new kid on the block in the form of https://symbolica.io/, which looks to be lining itself up against SymPy/Mathematica.
Thank you both. I really like the Julia syntax compared to Python. Here is some code I originally developed -
https://galgebra.readthedocs.io/en/latest/
Then the people from Cambridge took it over (with my blessings) and changed the internals (corrected mistakes and made the code more pythonic). They made the code so pythonic that I don’t understand it anymore. I am trying to recreate the system using Julia. For that I need a symbolic algebra package that can do algebraic simplification and differentiation. That is why I am bombarding you with questions and maybe finding some bugs in Symbolics and SymbolicUtils. Other Julia packages that make life easy for me are LinearAlgebra and Combinatorics. I also use Regex a lot to post process the output string for nice LaTeX output both as tex files and Jupyter Notebook output. LaTeXString just does not hack it for me.
If you need some of the capabilities of SymPy that aren’t yet available in Symbolics, you should take a look at SymPy.jl
or SymPythonCall.jl
. They provide a more Julian experience (1-based indexing into vectors and matrices, ability to use broadcasting, etc.) with the full capabilities of SymPy. Here is a short example:
And SymPy is setup with TermInterface now, so you can directly translate between the two pretty easily.
It’s only free for personal use with one CPU, but it’ll be cool if a Julia interface is available. I think it’s written in Rust with a PyO3 Python interface.
My hope is actually that Symbolics will beat out Symbolica in terms of performance and features
I hope that Symbolics/SymbolicUtils will enventually use all the threads (on my desktop Ryzen machine 32) available to my cpu. The must be way to parallelize simplifications.
It does multithread already?
Does simplification multithread?
Any walker can multithread, so there’s the threaded_simplifier call right there.