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.
我正在研究一些代码而且我注意到与Mathematica相比,SymPy的简化命令非常慢。 Mathematica可以在瞬间计算出什么,SymPy需要永远计算。
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?
我最近在网上看到SymEngine正在(或已经被)实现到SymPy中以使其更快,并且目标是(是?)从Python访问SymEngine。有什么方法可以让我的计算机上的SymPy使用SymEngine吗?
1 个解决方案
#1
2
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.
SymEngine仍在大力开发中,但我已成功使用了他们已经实现的一些功能。不过没有奇迹,因为还有很多部分缺失。
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.
最简单的使用symengine的方法是从github下载并按照他们的指示:symengine如果你有ubuntu它真的很容易,如果不是你必须从源码安装(也很简单)。我建议全系统安装,这当然更容易。
Once installed you need to install the python wrapper: symengine.py Same project, same team, works very well together.
安装完成后,你需要安装python包装器:symengine.py同一个项目,同一个团队,可以很好地协同工作。
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).
现在你已经开始尝试使用symengine。要使用它,您需要导入symengine,并且可能还会导入sympy,因为您可能会使用未在symengine中实现的功能(尚未)。
#1
2
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.
SymEngine仍在大力开发中,但我已成功使用了他们已经实现的一些功能。不过没有奇迹,因为还有很多部分缺失。
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.
最简单的使用symengine的方法是从github下载并按照他们的指示:symengine如果你有ubuntu它真的很容易,如果不是你必须从源码安装(也很简单)。我建议全系统安装,这当然更容易。
Once installed you need to install the python wrapper: symengine.py Same project, same team, works very well together.
安装完成后,你需要安装python包装器:symengine.py同一个项目,同一个团队,可以很好地协同工作。
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).
现在你已经开始尝试使用symengine。要使用它,您需要导入symengine,并且可能还会导入sympy,因为您可能会使用未在symengine中实现的功能(尚未)。