Complexplorer

A Python library for visualizing complex functions — domain coloring, phase portraits, Riemann relief maps, and 3D-printable mathematical ornaments. On PyPI.

Language: Python

License: MIT

Install: pip install complexplorer

Complexplorer renders domain colorings and enhanced phase portraits, lifts them onto the Riemann sphere as relief maps (modulus-scaled spheres), and can export the results as STL files — so a complex function can end up as a 3D-printed object on your desk.

Riemann relief map of f(z) = z/(z^10 − 1)

From mathematical function to physical sculpture: f(z) = z/(z¹⁰ − 1)

Highlights:

The magic of complex numbers

The library takes its spirit from a passage that argues complex numbers are not a convenient fiction but something woven into nature itself:

We cannot directly see the minute details of a Dedekind cut, nor is it clear that arbitrarily great or arbitrarily tiny times or lengths actually exist in nature. One could say that the so-called ‘real numbers’ are as much a product of mathematicians’ imaginations as are the complex numbers. Yet we shall find that complex numbers, as much as reals, and perhaps even more, find a unity with nature that is truly remarkable. It is as though Nature herself is as impressed by the scope and consistency of the complex-number system as we are ourselves, and has entrusted to these numbers the precise operations of her world at its minutest scales. …

Moreover, to refer just to the scope and to the consistency of complex numbers does not do justice to this system. There is something more which, in my view, can only be referred to as ‘magic’.

— Sir Roger Penrose, The Road to Reality, Ch. 4: “Magical Complex Numbers”