Kloostermania, the program

While cleaning up a bit the files on my laptop recently, I “discovered” an old computer program that I had written some time in 2003 or so, to display the graphical evolution of the partial sums of exponential sums, and more precisely of Kloosterman sums. In other words, given a prime number p and integers a and b, this program plots the points in the complex plane corresponding to the values

S_k=\sum_{x=0}^{k}{\exp(2i\pi \frac{ax+b\bar{x}}{p})}

for

0\leq k\leq p-1,

and draws the line segments joining each successive Sk. (As usual, the bar over x indicates the inverse modulo p).

The resulting paths look fittingly psychedelic:

The rather badly written code (for moderately modern Linux systems) can be downloaded here; the compilation should be a straightforward

./configure ; make

the resulting executable kloostermania is then found in the src directory.

Alternatively, still for pretty recent Linux systems (at least, Fedora on Intel machines), you can get the executable here.

(I should probably state formally that the license is GPL, not that there’s much danger of a proprietary software company deciding to make a fortune and deprive mathematicians of much freedom to play with the code by selling derivatives of this program; of course, if anyone decides to add features or to make the program work, e.g., on Mac, this would be much appreciated…)

The program should be fairly easy to use; the File menu offers the possibility of saving the current picture as a PNG file or to print it to a PostScript file (the New and Open commands are just decoys). The Edit menu’s only interesting item is the Preference command, where the colors can be changed by clicking on the respective patches, and where the drawing of the axes can be disabled if desired. The View menu’s equally single item is used to enter the parameter for a new drawing; if the modulus p is not prime, the next prime will be selected (computed in a ridiculously inefficient way…) Finally, the current parameters and the final value of the sum are displayed at the bottom of the window…

Published by

Kowalski

I am a professor of mathematics at ETH Zürich since 2008.