4 ms·
SymPy - Python library for symbolic mathematics
- sajithdilshan 14y agosympy online interpreter : http://pythonsympy.appspot.com/ http://pythonsympy.appspot.com/
- deleted 14y ago[deleted]
- Bootvis 14y agoThis seems to be a ery cool and useful project. Code generation is a killer feature for me. Also check out the Sympy Live Shell: http://docs.sympy.org/dev/modules/utilities/codegen.html http://docs.sympy.org/dev/modules/utilities/codegen.html
- dave_sullivan 14y agoThis 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.
- muuh-gnu 14y agoAlso check out Maxima [1], the GPL'ed version of the venerable computer algebra system DOE Macsyyma, which made the jump to PCs rather late and was therefore overtaken by Maple and Mathematica. Maxima is still under active development, has an community around it, and is available on Linux, Windows and Macs. [1] http://maxima.sourceforge.net/ http://maxima.sourceforge.net/
- lutusp 14y agoIf you're going to mention Maxima, you should be aware that an actively developed open-source program collection called Sage (http://www.sagemath.org/ http://www.sagemath.org/) uses Maxima as well as many other open-source packages to create a rich mathematical environment that's becoming increasingly popular. Sage uses Maxima internally to generate symbolic results, but Sage also has many other integrated math tools, and has a Web 2.0 interface -- a server-enabled front end. My Sage tutorial: http://arachnoid.com/sage http://arachnoid.com/sage
- grdvnl 14y agoThis also is worth a try: http://live.sympy.org/ http://live.sympy.org/
- skierscott 14y agoThis is cool. However, NumPy, SciPy, SymPy, Maxima and a whole lot of other tools are included in Sage, which is a competitor to Mathematica, Matlab, and Maple. It's free and open-source. You can try it here: http://www.sagenb.org http://www.sagenb.org
- fiatmoney 14y agoSee also, OpenOpt and the FuncDesigner package. http://openopt.org/Welcome http://openopt.org/Welcome
- jrpickhardt 14y agoSymPy is great. I've used it and read through the code (available open source). Also, my online calculator Encalc.com uses SymPy on the backend. For example: http://www.encalc.com/#expr=integrate(sin(x) http://www.encalc.com/#expr=integrate(sin(x))
- jrpickhardt 14y agoLooks like the link cut off the closing parentheses.
- metamorfos 14y agoIt would be amazing to have one for ruby, tho I'm definatly going to use this for calculus at uni.
- jdleesmiller 14y agoI know of two very early stage systems in ruby: https://github.com/jdleesmiller/rucas https://github.com/jdleesmiller/rucas (which I wrote) and http://brainopia.github.com/symbolic/ http://brainopia.github.com/symbolic/ I don't think either is really very useful at this stage (certainly mine isn't), but ruby does provide some very nice metaprogramming support for encoding and manipulating symbolic expressions.
- lightcatcher 14y agoDoes your university not provide Mathematica? If not, I highly recommend purchasing Mathematica for students. I love open source software and particularly Python (yet I haven't tried Sage yet...), but Mathematica just strikes me as one of the "great pieces of software" with the likes of emacs, the Linux kernel, and etc.
- i-blis 14y agoMathics (http://www.mathics.org/ http://www.mathics.org/) is a pretty useful online algebra system (with MathJax display) for symbolic computing à la Mathematica, backed by SymPy for most tasks and Sage for advanced stuff. You can check gallery and docs at http://www.mathics.net/ http://www.mathics.net/
- i-blis 14y agoand the guy who does that seems interesting and relying: http://www.poeschko.com/ http://www.poeschko.com/