4 ms·
This would be useful for teaching math or prototyping. From their FAQ it sounds like performance is way too slow for problems where speed is an issue. If you'r
by dave_sullivan 14y ago
This would be useful for teaching math or prototyping. From their FAQ it sounds like performance is way too slow for problems where speed is an issue.
If you're looking for a fast symbolic math library for python, check out Theano. On CPU, it can take advantage of whatever BLAS you use, and on GPU, it will convert your code to optimized C++ and compile via nvidia's cuda sdk.
SymPy does seem a lot more feature rich than theano, which relies on numpy
- wisty 14y agoLooking at Theano, they seem pretty different. Theano seems to be a beefed-up numpy (with compilation, symbolic differentiation, stability, and GPU use), while Sympy is a CAS framework. That said, Theano looks really really really cool. I wish I'd seen Theano before trying to force Sympy to do pretty much what Theano does (through Sympy's codegen).
- mjn 14y agoTheano has an interesting description of the lay of the land as they see it, where they position themselves as a hybrid of numpy/MATLAB type numerical-computational tools and sympy/Mathematica-style CAS tools: http://deeplearning.net/software/theano/introduction.html#what-does-it-do-that-they-don-t http://deeplearning.net/software/theano/introduction.html#wh...
- dave_sullivan 14y agoFrom the link, they mention this: The closest Python package to Theano is sympy. Theano focuses more on tensor expressions than Sympy, and has more machinery for compilation. Sympy has more sophisticated algebra rules and can handle a wider variety of mathematical operations (such as series, limits, and integrals).
- deleted 14y ago[deleted]
- raverbashing 14y agoReally? I think you're getting things confused "If you're looking for a fast symbolic math library" you are doing it wrong In none of the symbolic math Sw I used speed was an issue. But rather, capabilities. (Maple, Mathcad). Of course speed is good when evaluating a numeric problem If you're talking about numeric math, which is what Theano does, then you're right about it.
- dave_sullivan 14y agoMaybe? But doesn't most of the sw we're talking about do both? For example, you mentioned Maple, which says right on its website it does both: http://www.maplesoft.com/products/maple/features/feature_detail.aspx?fid=5913 http://www.maplesoft.com/products/maple/features/feature_det... Theano also does both. But maybe I'm using the terminology wrong? Or maybe it doesn't matter? Either way, Theano is fast and is similar to (but not exactly!) SymPy.
- raverbashing 14y agoYes, most do both. Some are more geared towards Symbolic Math (like Maple), some others are focused on numeric computations and even if they do symbolic math are severely limited. You're right, Theano does symbolic differentiations, but this looks like it's in support of its main purpose (multi-dimensional problems) TL;DR: If you want to calculate a triple integral symbolically go for Maple (or maybe SymPy), if you want to calculate its value go for NumPy or Theano
- dmlorenzetti 14y agoGenerally when I'm doing symbolic math, it's as a supplement to computation, not as a replacement. In such cases, speed doesn't matter so much. To take a specific example, think about solving a set of differential equations. The Sundials suite provides an excellent, fast numerical implementation of the popular BDF algorithm. So why would you ever want to do a slower symbolic manipulation of the problem? First, to get insight into how the BDF solver works when applied to a class of problems, you might express the problem symbolically, apply the algorithm symbolically, and play around with the resulting expressions. This might help you choose tolerances, decide how to express your problem (e.g., to avoid catastrophic roundoff errors), or design a new algorithm geared to your particular problem. Second, you might use symbolic algebra to derive the Jacobian matrix of derivatives for your problem, then code that Jacobian up for Sundials to use during numerical solution. This would speed up the numerics by giving it a faster, more accurate way to find the Jacobian than doing so numerically. In both cases, symbolic algebra is not used to find a particular numerical result, but to improve the use of numerical code for solving particular problems.