Mandelbrot set#

https://quotepark.com/media/authors/benoit-mandelbrot.detail.jpeg

The Mandelbrot set is one of these iconic abstract object popular outside of mathematics for its aesthetic appeal. Along with LOL cats, YouTube is filled with psychedelic videos deep diving into its incredibly complicated fractal structure. Like many other fractal objects, the Mandelbrot set is often used in introductory classes to Generative Art, see for instance Olbaid-ST.

Despite what its name suggests, the Mandelbrot set was not discovered by Benoît Mandelbrot, a Polish-born French-American mathematician. It finds its origin in the field of complex dynamics, first studied by Pierre Fatou and Gaston Julia in the early 1900s. It was properly defined in 1978 by Robert W. Brooks and Peter Matelski. They were also the firsts to publish a computer-generated visualization of the Mandelbrot set, shown below. Adrien Douaby and John H. Hubbard were the first to really study the mathematical properties of the Mandelbrot set. They are also the ones who named the set in honor of Mandelbrot for his influential work in fractal geometry.

https://upload.wikimedia.org/wikipedia/commons/d/d7/Mandel.png

The first published picture of the Mandelbrot set, by R. Brooks & P. Matelski in 1978. From Wikipedia.

This visualization was primarily limited by the computational power and printing technology available back then. Today, even a fairly standard laptop has enough computational power to generate visualizations of the Mandelbrot set with far more details than the 1978 image. Mathematicians and artists alike regularly come up with new ways to render this incredible mathematical object. One such example is shown below.

../../_images/Mandelbrot_1_0.png

In this chapter, we’ll see how to produce different visualizations of the Mandelbrot set, from a simple black and white image all the way to the Buddhabrot. The algorithm itself is fairly simple and cannot really be considered part of scientific computing. Yet, we’ll see how to write clean code using np.vectorize and how to make it incredibly fast using numba just-in-time compiling capabilities. Finally, we’ll explore how to use matplotlib to do shaded and power normalized rendering.