# Symbolics vs Reduce?

**URL:** <https://discourse.julialang.org/t/symbolics-vs-reduce/118322>\
**Category:** General Usage\
**Tags:** package\
**Created:** [August 17, 2024, 10:33pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322 "2024-08-17T22:33:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![brombo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brombo/32/47867_2.png) [@brombo](https://discourse.julialang.org/u/brombo)\
**Post date:** [August 17, 2024, 10:33pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/1 "2024-08-17T22:33:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 17, 2024, 10:41pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/2 "2024-08-17T22:41:03Z")

</div>

> [@brombo](#):
>
> My question is does Julia Symbolics/SymbolicUtils use Reduce (I do see there is a Julia interface for Reduce)

No. Reduce is too slow. In fact, Symbolics.jl started because Reduce was too slow to be used as a backend to ModelingToolkit.

> [@brombo](#):
>
> So does Symbolics use Reduce, if not which is more capable for simplifying algebraic expressions?

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.

> [@brombo](#):
>
> Should I be learning the Julia Reduce package?

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.

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [August 18, 2024, 5:25am UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/3 "2024-08-18T05:25:18Z")

</div>

> [@ChrisRackauckas](#):
>
> 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/](https://symbolica.io/), which looks to be lining itself up against SymPy/Mathematica.

---

<div class="post-metadata">

**Author:** ![brombo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brombo/32/47867_2.png) [@brombo](https://discourse.julialang.org/u/brombo)\
**Post date:** [August 18, 2024, 12:48pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/4 "2024-08-18T12:48:37Z")

</div>

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/](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.

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [August 18, 2024, 4:34pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/5 "2024-08-18T16:34:52Z")

</div>

> [@brombo](#):
>
> …I really like the Julia syntax compared to Python…

If you need some of the capabilities of SymPy that aren’t yet available in Symbolics, you should take a look at [`SymPy.jl`](https://github.com/JuliaPy/SymPy.jl) or [`SymPythonCall.jl`](https://github.com/jverzani/SymPyPythonCall.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:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/1/d1615534085d09d95f2c0bcac93d124435e2c635.png)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 18, 2024, 6:34pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/6 "2024-08-18T18:34:59Z")

</div>

And SymPy is setup with TermInterface now, so you can directly translate between the two pretty easily.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [August 19, 2024, 9:46am UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/7 "2024-08-19T09:46:41Z")

</div>

> [@tecosaur](#):
>
> a new kid on the block in the form of [https://symbolica.io/](https://symbolica.io/)

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.

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [August 19, 2024, 7:20pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/8 "2024-08-19T19:20:06Z")

</div>

My hope is actually that Symbolics will beat out Symbolica in terms of performance and features 😛

---

<div class="post-metadata">

**Author:** ![brombo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brombo/32/47867_2.png) [@brombo](https://discourse.julialang.org/u/brombo)\
**Post date:** [August 19, 2024, 8:04pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/9 "2024-08-19T20:04:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 19, 2024, 10:20pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/10 "2024-08-19T22:20:05Z")

</div>

It does multithread already?

> <https://github.com/JuliaSymbolics/SymbolicUtils.jl/blob/v3.2.0/src/simplify_rules.jl#L160-L183>

---

<div class="post-metadata">

**Author:** ![brombo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brombo/32/47867_2.png) [@brombo](https://discourse.julialang.org/u/brombo)\
**Post date:** [August 19, 2024, 10:35pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/11 "2024-08-19T22:35:44Z")

</div>

Does simplification multithread?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 19, 2024, 10:53pm UTC](https://discourse.julialang.org/t/symbolics-vs-reduce/118322/12 "2024-08-19T22:53:17Z")

</div>

Any walker can multithread, so there’s the threaded\_simplifier call right there.
