the the - 3 years ago 88
Python Question

How can I access SymEngine for use with SymPy?

I'm working on some code and I've noticed that compared to Mathematica, SymPy's simplify command is dreadfully slow. What Mathematica can compute in a split second, SymPy takes forever to compute.

I've read recently online that SymEngine is being (or has been?) implemented into SymPy to make it faster, and that the goal is (was?) to access SymEngine from Python. Is there any way I can somehow make SymPy on my computer use SymEngine?

Answer Source

SymEngine is still under heavy development, but I have sucessfully used some of the functionality they have already implemented. Expect no miracles though, as there are still many parts missing.

Easiest way to use symengine is to download from github and follow their instructions: symengine If you have ubuntu it's really easy, if not you have to install from source (also easy). I suggest systemwide install, it's certainly easier.

Once installed you need to install the python wrapper: Same project, same team, works very well together.

Now you are all set to start experimenting with symengine. To use it you need to import symengine, and likely also import sympy as you are likely to use functions not implemented in symengine (yet).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download