sympy: a python package for symbolic computation

Do you still remember how to calculate difference, gradient, limit, … in mathematic? if you forget, never mind. Here is a python package to help you. What you need: know python programming and define your functions, and then call package function to do your task. Symbolic computation is important component in PyTorch and Tensorflow.

The package name is symoy, refer Python package for Symbolic Computation. Symbolic computation deals with the computation of mathematical objects symbolically. This means that the mathematical objects are represented exactly, not approximately, and mathematical expressions with unevaluated variables are left in symbolic form. The following example

from sympy import *

x = symbols('x')

y = diff(sin(x)*exp(x), x)


y is 𝑒𝑥sin(𝑥)+𝑒𝑥cos(𝑥)

It is quite interesting. Will integrate into projects when symbolic processing is needed.

Leave a comment