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.

Monday 29 May 2017

Neural Networks in Python

Neural nets can be programmed easily in Python using freely available APIs. Examples include Google TensorFlow and Microsoft CNTK (Cognitive Toolkit). Coding will still require knowledge of numpy.