Sunday 4 June 2017

The Axiom Computer Algebra System

The Axiom computer algebra system can be downloaded in source or binary form across various platforms. A comprehensive online book is available.

The book starts with an introduction to Axiom, demonstrating its powers in both symbolic and numeric computation, and ends with a few Axiom programs to visualise functions in differential geometry.

What's cool about Axiom is it has its own programming language, which has regular data types you might expect such as lists and dictionaries, as well as algebraic types.  Having these algebraic types, allows you to define algorithms in their most general setting.

A great example would be the following:

R: Ring
power: (R, NonNegativeInteger): R -> R
power(x, n) == x ** n

Another interesting data structure permissible in Axiom is the infinite stream. Assume we have define the polynomial P(x) for all integers x in Axiom.

We can then declare the infinite stream of the derivatives of all such polynomials:

[D(p(i), x) for i in 1..]

The further elements in the stream are computed on demand (lazy evaluation).

Streams are used as an internal data structure for power series.