old wiki Sympy Versus Symbolic

Alexey U. Gudchenko edited this page Dec 2, 2011 · 4 revisions

old wiki Sympy Versus Symbolic

old wiki


symbolic is a pure Python package for doing symbolic manipulations within Python and is developed by Pearu Peterson pearu.peterson@gmail.com. symbolic is available in sympy svn repository, see the branch sympy-research.

You'll know what is sympy:)

As reported in "symbolic versus sympy" thread, basic operations in symbolic is about 200 faster than in sympy. Hence, Pearu have started a review of sympy.core implementation with a aim speeding up sympy.

In this document the implementation differences between symbolic and sympy will be reported.

Creating symbolic objects

The instances of symbolic objects in symbolic are always created in finalized form while in sympy the instances are created and then evaluated to get the finalized form.

This means that much more operations are used to create symbolic objects in sympy than in symbolic. That is deadly to performance.

The above comes from implementation. symbolic uses new to create symbolic objects while sympy uses metaclass idiom.

Evaluating hash values

sympy calculates hash value of a symbolic object when its instance is created. symbolic calculates hash values when hash value is requested. This saves operations when the code does not use hash values.

Is there a reason why sympy cannot use Python hash calculations?

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.