Hacker News new | past | comments | ask | show | jobs | submit login
SageMath: Python-based Mathematics. Rock it. (sagemath.org)
80 points by tomrod on Jan 10, 2011 | hide | past | favorite | 27 comments



Maxima (http://maxima.sourceforge.net/), one of the packages used by Sage, is a quite capable computer algebra system (written in Lisp) with a very long history. It's descended from Macsyma, which was created at MIT in the 1960s. If you look through some of the Maxima source files you'll find modification dates from the '70s. That has to make it one of the oldest still-active software projects. Heck, it's older than Unix!


The relationship of Sage with existing open source projects was something I never quite understood. Instead of investing their knowledge and time into improving the capabilities of existing systems (SciPy, NumPy or Maxima, Octave) to bring them up to par with the more pervasive commercial offerings (Matlab, Mathematica, Maple), they basically just bolted Python onto everything without in the end improving anything. Sage to me always seemed as just some kind of Python promotion vehicle trying to hide the fact that basically all the underlying systems it uses are written in other languages.


The idea is to allow access to lots of different proven, well-tested systems using a single consistent syntax and environment.


I am writing my master thesis on free & open source mathematical tools. To my shame I have never heard of SageMath, it never came up on my radar. I had heard of Numpy, scipy, matplotlib, maxima, Octave and others. I know that custom software is written in Fortran and C/C++- Why had I not heard of SageMath? Are there any other large open source mathematical projects that may have escaped my notice? Please enlighten me.

The aim of my thesis is to discover why proprietary tools like Maple, Mathlab, and Mathematica have flourished within the mathematics world given that theorem proving and calculating seem to require access to the algorithms for verification processes. I aim to interview the leaders behind both proprietary and open tools to see what drives and motivates them. This video by William Stein http://www.sagemath.org/help-video.html on the SageMath website goes a long way towards answering some of my questions.

I would like to look at this problem space from all angles, economic, ethical, scientific, you name it. I would welcome ideas on research strategies and any and all pointers. Speak up now, no matter how trivial you think your idea!

Thank you tomrod for posting this, thank you.


> The aim of my thesis is to discover why proprietary tools like Maple, Mathlab, and Mathematica have flourished within the mathematics world given that theorem proving and calculating seem to require access to the algorithms for verification processes.

We don't have access to the algorithms that a human mathematician working unaided uses to do things like evaluate a tricky integral, simplify a complicated expression, and so on, yet we can still verify their proofs.

I don't see why him using a computer program, proprietary or not, would make a difference. We verify the proof by checking the result, not the thought processes or computational processes that were used behind the scenes to come up with it.


Here are some places I would immediately look--you most likely have come across some or all of these. I suspect some of the smaller proprietary products teams may be more accessible in interviewing. http://en.wikipedia.org/wiki/Comparison_of_computer_algebra_... http://en.wikipedia.org/wiki/List_of_numerical_analysis_soft...


I don't remember seeing these pages. Thanks.

I have bookmarked:

http://directory.fsf.org/category/math/

and

http://en.wikibooks.org/wiki/FOSS_Education/Research_using_F...

There are a number of other sites dedicated to pre-university level education of mathematics but I was more thinking about my own experience with Maple, Mathematica, and Matlab and FOSS tools of a quality to substitute for these. Having listened to the SageMath intro video I would add Magna to that list I suppose but maybe it is narrower in scope.

I need to know how the tools are categorized. I guess each mathematical field has its own set of tools.

I guess Computer Algebra Systems (CAS) would be the general term for the symbolic math side of things and Automated Theorem Provers (ATP) for the proof theory side of things. Ignoring ATP for the moment I suppose you can subdivide CAS many ways. I wouldn't even know how to list the divisions in mathematics or even if each division had a corresponding type of mathematical tool.


I used sage quite often when studying. I think many people today learn the one or the other programming language quite early, so it becomes natural to them, and an open source mathematical system like sage which extends their understanding of programming with mathematical/symbolic ideas is more powerful and way easier to adapt than those proprietory systems.


That's an interesting way of looking at it. I always thought that the "perfect" mathematical tool should strive for parity with math standard math notation but the way you describe it makes perfect sense from the viewpoint of leveraging existing tools.


I've checked back on this project from time to time but I've never been satisfied with it. The last I used it was perhaps 2 years ago, returning to MATLAB, Mathematica and Haskell/C.

Would any who uses it now or recently care to make a candid comparison between it and its commercial competitors?


The math software I use is Mathematica (Home Ed), Sage, Octave, R, and TeXShop. All open source except for Mathematica.

Mathematica has a few advantages. The input notation can look more like traditional mathematics: adjacency instead of * for multiplication, superscript instead of ^ for exponentiation, fraction notation. I think that cuts down on errors. Variables are symbolic in Mathematica by default. The Mathematica language is something of a defacto standard and WolframAlpha understands it to a certain extent, so you have access for free if you have internet. WolframAlpha mobile gives you CAS on your phone.

That said, an open source version of Mathematica is desirable and Sage should be supported. I keep a table of equivalences at http://hyperpolyglot.org/math to try to lessen the mental burden of using two equivalent products.


R is sweet. Octave has its ups and downs--I'm thinking Numpy/SciPy/Matlibplot may be a better route for my own personal computing (still learning though)--especially since Python has bindings practically for everything.

I agree that Sage still needs work (the 100+ bugs submitted daily to the RSS support feed says so!) but it works really well.


Octave is free and I used MATLAB in school so it made sense to install it. I've never had problems with Octave though I've heard others complain about it. I don't use it that much. For graphics I always use R.

Maybe I should have mentioned Coq in my previous list. I installed it a few days ago. Haven't learned to use it yet.


Octave does not have a pre-packaged optimization routine or a usable toolbox of which I am aware, and I find GnuPlot abysmal (but this is likely due to my lack of experience with it).

These are probably easily corrected. But solutions already exist within the FLOSS community with other packages such as Sage (and, of course, Numpy and the rest)--reinventing the wheel is something few have time for! :-) This is a big reason I like Sage: it is designed like the Borg in that it uses bindings to connect into other software (both proprietary and open source).

Yes! Star Trek reference and SageMath in the same sentence. It is a good night.


- Python is better than MATLAB for numerics now.

- Mathematica is better than the other stuff for symbolics still and it has a really nice interface. For basic stuff the Python libraries work fine. Check out Maple and its clones too.

- C is for when you need speed above all else (check out Weave, a Python package for executing C code from within your Python scripts, though)

I only know a few Haskell people in the scientific computing world. I'm not sure what the draw is, but if you do a lot of algorithms and don't mind the unpredictable performance, Haskell is a good tool too I'm sure. Ocaml also gets some use in scientific computing if functional programming is your thing.


Sage is probably quite useful if you are a pure mathematician. The reason I couldn't use it is that it didn't behave well as a library, but they seem to have improved library support since then (http://www.sagemath.org/doc/tutorial/programming.html#sectio...).

But the project has definitely produced at least one A++ bit of code: Cython. That is very much worth learning and complementary to numpy (e.g. Cython/numpy integration: http://wiki.cython.org/tutorials/numpy).


Numpy, scipy, and matplotlib are the MATLAB replacements.


This might sound a bit silly, but I still have never found something that let me work with problems quite as easily as my TI-89/92. Most of the CAS systems I've used feel like coding, while the TI CAS system feels like doing math. Sage just feels like an extension to the Math direction when all I really want is a fast (color) desktop version of my TI-92. The closest I've seen was the old graphing calc that came with PowerPC macs back in the early 90's.


This meets your fancy? http://lpg.ticalc.org/prj_tiemu/


oh wow...this looks great! Do you know how the keybindings are? One of the nice things about the TI calculators is the custom keyboard...


I don't--I just googled "TI92 Emulator" or something to that effect, and this was the first result--and surprisingly nonspammed.


Here's one I made that I think you'll like: encalc.com

It does computer algebra, like integrate(x^2), as well as physical constants, like coulombs or hbar. I made a draggable graphing calculator for it, but it was too slow so I never released it.


I'm not saying this is close to a TI-92, but here's a calculator we did a while back that's easy to use and powerful.

http://www.ecalc.com


By the way, Macs since OS X 10.4 come with a very nice (numerical) Grapher program, which is in Utilities.


One thing Sage needs to do is to make installation easier. Make a PPA for Ubuntu, a repo for RPM packages, and setups for Windows and OS X.

Then people will start talking more about Sage. It's a great package, but the road to getting it is bumpy.

For those who don't know what Sage is, think of it as an Open Source alternative to Wolfram Mathematica.

I also see comments about R. For me, the best way to code in R is to use RKWard. It's maybe the best frontend for R. Feel free to check it out..


Sage install for Ubuntu is very straightforward--they even provide the command to unpack. If you've programmed in Python, or even better Fortran or C, the installation is mostly trivial.

Nontrivial is compiling from source, however :-).

Sage does more than Mathematica, as I understand it. It can be used as a replacement for Matlab, R, etc. I got informed of it by friend who is an applied mathematician by day and a .Net guru by night. Wikipedia has a decent writeup at: http://en.wikipedia.org/wiki/Sagemath


Compiling from source should be just downloading source, unpacking, and typing `make`, at least on most popular Linux distros and OS X.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: