Exploring CAS

  1. 1. Problem
  2. 2. Exploration
    1. 2.1. Axiom and FriCAS
    2. 2.2. SageMath
    3. 2.3. SymPy
    4. 2.4. Maxima
  3. 3. Assessment

CAS for Computer Algebra System.

Problem

Recently I ran into a situation that I needed to do some symbolic math but did not have access to a decent CAS software. I have been a Mathematica user for quite long time, but it is apparently not available everywhere.

After struggling with my problem, this question is raised: What is a good substitue for Mathematica? What I like about Mathematica include:

  1. Strong symbolic capabilities in simplification, polynomials, calculus, etc.
  2. Support for multiple paradigms, including functional programming - and everything is a list.
  3. Notebook-like GUI with various export options.

For the substitute, I hope it is light-weight and easy to pick up.

Exploration

A long of list of major CAS software can be found here. Removing the specialized ones and picking the ones with as many capabilities as possible, some candidates are selected. These include: Maxima, SymPy, SageMath, Axiom, and FriCAS.

For completeness of discussion, there is also Rubi based on Mathematica, which focuses solely on integration.

Axiom and FriCAS

Axiom and FriCAS, as a fork of Axiom, used HyperDoc as its GUI, which is - sorry to use this word - ugly. FriCAS is said to be particularly good at integrations. However, its capability in simplification is very limited, as documented by itself. Candidates eliminated.

SageMath

SageMath is somewhat more than a CAS software, as it tries to include many other capabilities like those in MATLAB. However, that is exactly my issue with SageMath. The capabilities depend on different other packages, include Maxima and SymPy as mentioned above. That makes the ecosystem way too heavy for the CAS purpose. Candidate eliminated.

SymPy

SymPy is nice in the sense that it is in the Python ecosystem and is expected to work well with the NumPy toolchain. So it is very easy to pick up (at least for a heavy Python user). Moreover, the Jupyter notebook provides a good solution for the GUI. Yet, its symbolic capability is limited.

Maxima

Maxima appears to be another CAS language that is easy to pick up. A GUI option is provided by wxMaxima, which looks like Mathematica and Jupyter. Its symbolic capability is fair. There is also an App MaximaOnAndroid on the smart phone.

Assessment

Two sets of tests are found for assessing the symbolic capabilities of CAS.

The first one is the Charlwood's Integration Problems, which are documented here and here. The integral problem, or the antiderivative problem, is considered difficult for a CAS system. The aforementioned integration problems are specially developed for testing CAS. In the so-called ten “hardest” integrals, the performance of Maxima is fair (8 out of 10), while SymPy only got 2 correct.

The second one is from the blog Maxima v.s. Mathematica. A set of problems, including limit operation, integrals, simplification, algebraic equation solver, are discussed. In all problems, Maxima either provides a wrong answer, or fails to provide an answer. The blog is old (2015), but as of writing, I have tried all the problems except the simplification ones on (1) Maxima 5.40 using MaximaOnAndroid and (2) SymPy 1.1. For Maxima, no improvement is identified. SymPy fails in the integrals (again), but it did much better than Maxima in the algebraic solver. The test is unnecessarily fair, as there is always an aspect of a CAS software that is weaker than that of another.

Subsequently, wxMaxima is tried out on WSL. There is a Windows version for wxMaxima, but I prefer to have it in Linux-like environment. The installation is standard. However, the Maxima kernel somehow does not work. The kernel terminates upon start with an error message personality failure 38. This appears to be an issue with WSL support for Common LISP, as identified here and here.

So, finally, SymPy with the Jupyter environment is down-selected for the open-source substitute for Mathematica. Nevertheless, there is probably no real open-source substitute for Mathematica after all.