Home > documentation, open source software, Sage > Sage 3.0.1 reviewed in LXF

Sage 3.0.1 reviewed in LXF

During the previous weekend, I bought my copy of issue 109, September 2008, of Linux Format (LXF) magazine (dead tree version). Down under in Australia, we have to wait quite some time for overseas magazines to arrive. When they appear on the news stand at my local magazines store, the “latest issues” of Linux related magazines tend to be rather out of date — that is, if you don’t have subscriptions.

The September 2008 issue of LXF has a review of Sage version 3.0.1 on page 33, written by Will Tribbey. This review is part of the issue’s “Roundup” section (pp.30–35), which also reviews the Euler Math Toolbox (EMT), Matlab, Octave and Scilab. Unfortunately, I can’t yet find an online version of the Sage review at the official home page of the magazine, so you just have to be content with me quoting the review below:

Sage

When the maths gets really serious.

Sage is so much more than a numerical computing platform. Yes, it does numerics, but it also does symbolic computer algebra that makes it an extremely capable system for doing calculus and algebra but also research in cryptography, number theory, and graph theory, to name a few.

Sage takes a departure from the other platforms in this review in that it uses Python rather than having a programming language of its own. For some users this will be a significant attractor, since if you already know and love Python you won’t have to learn another language. From the performance checks using the SVD and FFT, Sage (using Python’s Numpy Library) was comparable to Scilab and Octave, while the SVD test was blazingly fast — faster than Matlab by a significant margin.

Sage is a relative newcomer to this group but it does make use of software that started many years ago. Take Maxima for instance. Maxima has as its ancestor the Macsyma computer algebra system initially developed at the Massachusetts Institute of Technology in the late 1960s. Maxima and other components make Sage an eclectic mix of mathematical software.

It’s all about sharing

One laudable goal of the Sage project is to enable the convenient sharing of mathematical ideas, and one way it does this is through the use of web-based notebooks. You can enter commands into the console provided by the Sage web application and then evaluate them. It really is like writing a math notebook online. Your notebooks can be saved and shared, which has many positive implications for teaching and research collaborations. You can try Sage without having to build or install it by going to www.sagenb.org, signing up for a free account and writing your own notebook.

[Image featuring a Sage notebook session and a 3-D plot. The caption reads: “The graphics in Sage normally display in a Java applet inside the page. So much for the bleeding edge…”]

The notebook in the image shows the following code:

sage: u,v = var('u,v')
sage: fx = (3 + sin(v) + cos(u)) * cos(2*v)
sage: fy = (3 + sin(v) + cos(u)) * sin(2*v)
sage: fz = sin(u) + 2 * cos(v)
sage: P = parametric_plot3d([fx, fy, fz], (u, 0, 2*pi), \
....: (v, 0, 2*pi), frame=False, color="red")
sage: show(P)

which was used to produce the 3-D plot below:

LXF gives the following ratings:

EMT:     5/10
Matlab:  9/10
Octave:  7/10
Sage:    6/10
Scilab:  9/10

Sage comes out in fourth position out of the five systems reviewed. Its relatively low rating is not due to its lack of support for numerical computing, although it must be noted that the primary focus of Will Tribbey was that area. As far as I understand, the tests had nothing to do with symbolic capabilities of the five targeted systems. Only Sage is praised for its symbolic capability as well as not inventing its own programming language. Page 35 concludes:

Sage and the Euler Math Toolbox were only included as a matter of diversity and choice, since one person’s numerical nirvana is usually another’s sixth circle of hell. We were therefore pleasantly surprised to find Sage a worthy contender not only for numerical computing but for doing symbolic computing too. It stood out as the only platform to make direct use of an existing programming language, Python. Since you can directly create mathematics documents on the web with Sage, don’t be surprised if maths blogging becomes the next cool thing on the internet. And remember, you read it here first…

The evaluation of EMT, Matlab, Octave, Sage and Scilab were conducted with these factors in mind:

  1. ease of installation
  2. user interface
  3. documentation
  4. community support
  5. available toolboxes

Matlab was held to be the “gold standard” (an expression by the reviewer) against which the other four systems were measured.

A recurring theme throughout tests on the above five systems was the issue of algorithmic performance, as measured “by computing the singular value decomposition (SVD) and fast Fourier transform (FFT) of a 500×500 real-valued matrix 100 times and calculating the average and standard
deviation of those 100 trials” (p.30). On page 31, we have the following performance evaluation:

Performance is one area where Matlab had difficulty maintaining a commanding lead. For the SVD test — an important matrix decomposition in many statistical and numerical algorithms — Matlab performance was slightly more than 20% better than Scilab and Octave. The surprise was that the Numpy algorithm used from within Sage was on average over 250% faster than Matlab. It’s not included in this Roundup, but this performance difference indicates that the Numpy library for Python deserves a closer look when performance matters. Matlab comes out the winner in the fast Fourier transform.

In the end, Scilab comes out with a score of 9/10. Matlab has the same score: “[Matlab’s] score was taken down because of its cost” (p.31). As to why — as a contender against Matlab — Scilab is ahead of EMT, Octave and Sage, Will Tribbey’s reasons can be summarized as follows:

  1. the large number of toolboxes
  2. visual system modelling (the Metanet toolbox) and simulation (the Scicos toolbox)
  3. the number of built-in functions
  4. a Matlab IDE-like command window for developing and debugging functions

You can follow the discussion of Will Tribbey’s review at sage-devel.

Advertisements
  1. RG
    24 October 2012 at 7:42 am

    Thanks for this posting, which points me to something I would have overlooked otherwise! As the author of EMT, I would like to see this review, but could not find it online or in stores.

    But maybe I don’t need to read it. Euler is designed for beauty and ease of use, and its target is education on the high school and university level. Matlab’s target is the industry. Sage seems to have still another target, the algebra people. You cannot really compare those programs with a score. Moreover, Euler does not run on Linux well, so a Linux Journal is not the right place to review Euler anyway.

    I did the above example on

    http://www.euler-math-toolbox.de/renegrothmann/3D-Testplot.html

    just to show how much more beautiful this should be.

    By the way, EMT’s homepage is euler-math-toolbox.de now.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: