15 ms·
SymPy Gamma: an open-source, Python-based alternative to Wolfram Alpha
- techwizrd 13y agoI'm not entirely sure how this works as an alternative to Wolfram Alpha. Much of the value I see in Wolfram Alpha comes from it's highly curated data set and ability to parse natural language into a useful mathematical representation. It brings curated constants and mathematical equations, graphs, and simulations to the general public. On the other hand, this really seems like the SymPy interpreter in a browser. I think this would do much better without the comparison to Wolfram Alpha.
- grej 13y agoThis is a great start and thanks for open sourcing this! Although I noticed that some of the plots throw errors (ex. "series(sin(x), x, pi/2")
- catchmrbharath 13y agoSeries are not supported for plotting. Could you please raise a bug at [1]. https://code.google.com/p/sympy/ https://code.google.com/p/sympy/
- catchmrbharath 13y agoWe should be catching the exception though.
- primitivesuave 13y agoI used to work at Wolfram Research on Wolfram Alpha's backend, and one of the most challenging technical problems we faced was free-form input. Although W|A has by no means perfected this, this is hardly an alternative - queries like "factor the number 100" fail because there is only the beginnings of a free-form transformer. Obviously, the usefulness of being able to answer "factor one hundred" is questionable, but W|A solved it out of Stephen Wolfram's aspiration to be able to "compute everything". Right now, this is just a programming language you can run on the web. The other thing is that W|A has trillions of data points and what I am only allowed to describe as the beginnings of a semantic network for inferring relations between them. It was a vastly overcomplicated system that was difficult to work with, so I am quite confident that some day there will be an open-source alternative that anyone can contribute to. The other thing to take into account is how this affects the future. Wolfram Research thought they were going to "disrupt the calculator" (I heard this ridiculous statement once at a meeting). In reality, Wolfram Alpha queries are more often for the sake of fun than for the sake of discovery (I know this because there was a big TV in the break room that would keep displaying things that people searched on Wolfram Alpha). Is it really that useful to be able to have a computer give you an answer to "I have two apples, Jill has three apples. How many apples do we both have?" http://www.wolframalpha.com/input/?i=I+have+two+apples%2C+Jill+has+three+apples.+How+many+apples+do+we+both+have%3F http://www.wolframalpha.com/input/?i=I+have+two+apples%2C+Ji... Or is it more useful to make something that can take in symptoms of your current ailment and tell you which disease you are most likely to have? Wolfram Alpha does this as well. http://www.wolframalpha.com/input/?i=I+have+a+fever+and+a+runny+nose http://www.wolframalpha.com/input/?i=I+have+a+fever+and+a+ru... Although the results are difficult to interpret. In my time at Wolfram Research, I was certainly convinced by the idea of knowledge engines and their ultimate emergence, but I think the way this will be accomplished is in more in a Google-esque fashion where their knowledge engine results are displayed alongside a real search algorithm. Best of luck to the people on this project, I hope you make the first step into creating an open source knowledge engine.
- mh_yam 13y ago"In reality, Wolfram Alpha queries are more often for the sake of fun than for the sake of discovery" In advanced math classes (upper undergraduate or graduate) it is almost impossible to check results or do a complex operation on a simple calculator. In many cases I have to turn to a tool like Mathematica/Wolfram Alpha. I have a W|A Pro account and it has worked wonders for me. For example, entering "integral from 0 to infinity of (ye^(-y)((-1/y)(e^(-t))+1/y)) with respect to y" into Wolfram Alpha is so much easier than doing the same with a TI-89. I can copy/paste and adjust very easily and the software produces multiple interpretations/representations which is very useful.
- runarberg 13y agoI use IPython/SymPy for the same purpose. It is nice to be able to do these calculations on my local machine, in stead of relying on an internet conection. Plus I get the powers of Python to back me up if I want to do anything more compilcated.
- shawn-furyan 13y agoIt's not nothing, however, that Wolfram Alpha works spectacularly well on a phone. The mobile app even has a very useful keyboard that has common math symbols. With mobile data, at any given time, I'm much more likely to have a computing device with an internet connection than I am to have one with a useable programming keyboard. Not that I'm against the progression of these tools, far from it, I just think that wolfram alpha does a better job at math homework type problems for most people most of the time. If you have more complicated modeling/statistical/etc. work, then bring out the bigger guns.
- mh_yam 13y agoI used the Wolfram Alpha iPad app in real-time during mathematics / statistics lectures to check the notes on the blackboard and to try out alternatives. Very useful in the classroom.
- mrcactu5 13y agothis is a few steps behind Wolfram Alpha, but at least it's open source
- Glyptodon 13y agoHmm. It doesn't know who Harry Potter is. Much more math based, I guess?
- catchmrbharath 13y agoYes. Its more of a computer algebra system (a mathematica equivalent). Have a look at http://sympy.org/en/index.html http://sympy.org/en/index.html.
- mekane8 13y agoHmmm, my favorite inputs to Wolfram|Alpha are unit conversions. This thing just spews error messages. http://www.sympygamma.com/input/?i=5+gallons+%2F+12+fl+oz http://www.sympygamma.com/input/?i=5+gallons+%2F+12+fl+oz. http://www.sympygamma.com/input/?i=how+many+calories+in+a+cubic+light+year+of+strawberries http://www.sympygamma.com/input/?i=how+many+calories+in+a+cu... I wouldn't call it an "alternative" just yet. (And I'm an ex-W|A employee).
- dmd 13y agoJust out of curiosity, why use W|A for unit conversions vs. using Google's calculator for that?
- capnrefsmmat 13y agoBecause W|A can tell me that the caloric equivalent of the molasses spilled in the Boston Molasses Disaster of 1919 is 36 kilotons of TNT: http://www.wolframalpha.com/input/?i=%28Calories+in+2300000+gallons+of+molasses%29+in+kilotons+of+TNT http://www.wolframalpha.com/input/?i=%28Calories+in+2300000+... https://en.wikipedia.org/wiki/Boston_Molasses_Disaster https://en.wikipedia.org/wiki/Boston_Molasses_Disaster So you can do unit conversions with all sorts of weird facts, like the nutritional content of molasses.
- jrpt 13y agoTry Encalc: http://www.encalc.com/documentation.php http://www.encalc.com/documentation.php
- frik 13y agoSymPy Gamma knows Boolean Logic like (x | y) & (x | ~y) & (~x | y) while Wolfram|Alpha doesn't. I would like to see an open source W|A in Julia instead of Python. It could be a great addition to e.g. Wikipedia.org
- lightcatcher 13y agoJulia has very little (more or less zero) symbolic manipulation library work right now. If I were to write a Wolfram Alpha alternative in Julia right now, I'd do all of the symbolic manipulation using PyCall and sympy.
- sp332 13y agoI think Alpha just didn't recognize your notation. (x or y) and (x or not y) and (not x or y) works fine https://www.wolframalpha.com/input/?i=%28x+or+y%29+and+%28x+or+not+y%29+and+%28not+x+or+y%29+ https://www.wolframalpha.com/input/?i=%28x+or+y%29+and+%28x+...
- mafuyu 13y agoWolfram|Alpha does take boolean, but in the notation that Mathematica likes (&&, ||, !, etc). You can also write it out in plain english (NOT A OR B, etc). I used it to simplify some kmaps for class the other day and it's very nice: prints out a truth table and various types of minimal forms.
- reeses 13y ago"Conventional" boolean operators work as well. Again, I suspect that it depends on whether a developer has mapped something ToExpression can consume, either via forms, boxes, or unlocking the function itself. (This would be consistent with the "throw more mud at it" comment.) As a Mathematica and WApro user, I find most of the utility in not having to import random datasets myself. As every researcher, I have a disgusting library of scripts that often involve curl, groovy, awk, sed, etc., to pull info into mma. It's nice when that becomes SEP[1]. http://www.wolframalpha.com/input/?i=+%28x+%E2%88%A8+y%29+%E2%88%A7+%28x+%E2%88%A8+%C2%ACy%29+%E2%88%A7+%28%C2%ACx+%E2%88%A8+y%29+ http://www.wolframalpha.com/input/?i=+%28x+%E2%88%A8+y%29+%E... [1] Someone Else's Problem
- zokier 13y agoI wonder if any of the stuff developed for Gamma will trickle down (/up?) to ipython. Frankly it is bit surprising that they seem to have developed a new web-interactive system for (augmented) python instead of leveraging the ipython framework.
- jessaustin 13y agoOn Chrome 33.0.1750.46, the up-down caret next to the topic headings doesn't respond to a click, even though the cursor indicates that it should. Clicking on the topic heading itself or even around the caret works, but the caret seems the most natural target to me.
- aaren 13y agoSame on Firefox. I spent a while clicking - it seemed natural.
- dekhn 13y agoMany many many years ago, I wanted to use Mathematica, but I didn't like the language (just the algebra system, plotting, etc). I wrote a python bridge, which was actually pretty cool. It's probably the neatest, cleanest, most CS-y code I've written (it converted Python objects to Mathematica objects over MathLink. It integrated with Numeric Python. https://code.google.com/p/pymathematic/source/browse/trunk/examples/pyml.py?spec=svn14&r=14 https://code.google.com/p/pymathematic/source/browse/trunk/e...
- asmeurer 13y ago(I am the lead developer of SymPy) The important thing to note about SymPy Gamma is that it does only the mathematics part of WolframAlpha. It's also relatively new. There is no natural language input. There are no non-mathematical capabilities. The syntax should match Python syntax for the most part, though there are extensions to allow things like "sin x" or "x^2" or "2 x". All this will hopefully improve in the future (and pull requests are welcome!). Most of the code was written by David Li (who is actually a high school student). You can watch a presentation about it here: http://conference.scipy.org/scipy2013/presentation_detail.php?id=183 http://conference.scipy.org/scipy2013/presentation_detail.ph.... It started out as a "because we can" toy, and it's gotten much better. The real benefit of SymPy Gamma over WolframAlpha is that there are no barriers around it, since it's entirely (BSD) open source. For example, if you start computing something interesting and want to try more, you can move to SymPy Live (http://live.sympy.org/ http://live.sympy.org/) and compute in a more session like environment. Or you can use SymPy locally on your own computer. Regarding the comments that wolfram is mostly used for play, I'm not so sure about it. Wolfram is invaluable to students as a calculator. Sure Google can compute 100 * pi, but it falls apart when you try to compute integrate(sin(x) * x, x). When I was in college (which was last year), I saw people use it all the time. It's been very successful in making computer algebra accessible to virtually everyone. By the way, probably the best feature of SymPy Gamma right now is the integration steps. See for instance the "integral steps" section of http://www.sympygamma.com/input/?i=integrate%28sin%28x%29*x%29 http://www.sympygamma.com/input/?i=integrate%28sin%28x%29*x%.... This is a feature that used to be free at WolframAlpha, and it's extremely useful if you are learning integration in calculus. It doesn't work for all integrals, because not all integrals are computed the way you would by hand.
- mkesper 13y agoThe important thing to note about SymPy Gamma is that it does only the mathematics part of WolframAlpha. Please tell so clearly so you don't get bad credit for non-implemented features.
- roryokane 13y agoSee also Mathics (try online at http://mathics.net/; http://mathics.net/; info at http://mathics.org/ http://mathics.org/), which wraps SymPy with a Mathematica-compatible programming language.
- jrpt 13y agoI once almost started making something I called SymPyScript... think CoffeeScript for SymPy. You'd get the syntax of something like this: http://calculize.com/pickhardt/numerical_derivatives http://calculize.com/pickhardt/numerical_derivatives But it'd convert to SymPy for evaluation. In the end I called it Calculize and evaluated it with JS instead.
- nathanb 13y agoI typed "12 c in f", a very simple example of the sort of thing I use wolfram alpha (usually by way of duck duck go) for most often. It choked. I bailed. I'm a Linux user. I have bc and units installed. I even have some shell script wrappers to make those utilities actually helpful for casual use. I can open a terminal and calculate expressions and convert units...so long as I ask nicely. The big win for W|A is that it doesn't require me to ask nicely. This is helpful for quick 'n' dirty queries as well as for queries where the work required isn't in doing the calculation so much as reducing the query into a simple expression in the first place. In other words, simpygamma solves a problem that by and large doesn't exist.
- motters 13y agoLooks like just a wrapper around a rather limited Google service. Not much improvement on WA.