8
$\begingroup$

I hope this question is suitable for the site.

I recently had to work with Mathematica, and the experience was, to put it kindly, unpleasing. I do not have much experience with similar programs, but I remember not liking much Matlab or Maple either. The result is that I am a mathematician who likes programming, but I never managed to learn how to work with a computer algebra system.

Does there exist a CAS which can be programmed using a standard language? I guess the best thing would be just an enormous library of mathematical algorithms implemented for C or Python or whatever.

I know SAGE is based on Python, but as far as I understand (which is not much) it just collects preexisting open source software, so (I assume) one has to learn how to use a new tool for every different problem.

  • 2
    I believe in English it should be "displeasing."2010-09-03
  • 0
    Your assumption (that one has to learn how to use a new tool for every different problem) is good but not entirely correct. AFAIK SAGE offers pretty uniform interface to all those tools it collects. :)2010-09-04
  • 2
    I think "unpleasant" would be more correct in this context.2010-09-04
  • 0
    If Sage didn't collect preexisting open source software, it would suck. That is, any open source program that didn't collect all the others it could would suck unless it has been in existence for 10-20 years. And, I haven't had any problem working with Sage. I read a beginning book on Python and I use techniques from Python all the time.2012-03-14

6 Answers 6

0

I have used GiNaC several years ago to do complex analytical continuation on a special option that my company had embedded in a Financial product. It is a flexible tool, but if you need to integrate a Taylor series, you may need to construct your own integrators.

6

You should definitely use SymPy. It was invented in large part for this reason, because Ondřej Čertík didn't like how CAS systems like Mathematica invented their own language, which you had to learn if you wanted to write non-trivial stuff using the system.

SymPy is written entirely in pure Python, and the general execution of is in some kind of Python interpreter (for example, the isympy script is a convenience script that calls "from sympy import *" and defines some common variable names, and it also uses IPython if you have it installed).

Because of this, it's very easy to write scripts that work with SymPy, because they would just be Python scripts, where you import SymPy and work with it. But it's also easy to extend with your own functions. By subclassing SymPy objects and defining methods on them, you can make them work with built-in SymPy functions.

(full disclosure: I am the lead developer of SymPy)

4

If you're a big fan of C numerous libraries exist for doing certain tasks. MPIR/GMP are two libraries for doing arbitrary precision arithmetic. On top of these you'll find more specialised libraries like MPC which adds support for the complex field.

Flint is a library that sits on top of MPIR, for example, providing an array of number theory functions. PARI/GP I believe provides a similar foundation but via the GMP library.

I'm sure if you googled "library for linear algebra" or "library for x" you would find it. However, a CAS unites all of this functionality.

Now we come to sage. From what I understand of the sage project, it is not so much a collection of open source libraries but an interface uniting them. For example, from the tutorial:

sage: a = 5   # a is an integer
sage: type(a)

sage: a = 5/3  # now a is a rational number
sage: type(a)

sage: a = 'hello'  # now a is a string
sage: type(a)

Is a sage session. As you're probably aware sage.rings.integer.Integer is not a built-in python type.

I would recommend giving sage a go. I think it is the closest thing out there to what you're after. I personally don't find Mathematica too bad.

2

If you don't want to install all of Sage (which is quite big), you could perhaps try one of its components, SymPy, on its own to be begin with.

If you use C++ maybe GiNaC is useful (I haven't tried it).

1

GiNaC and SymbolicC++ are C++ based CASs.

0

Considering that Maxima is developed in Common Lisp and accepts CL sintax, maybe this system would suit your requirement.