Exponential Sums

Posted on Aug 4th, 2019


An exponential sum is represented by the following equation

where the exponential is a complex number. The function $f(n)$ is a real-valued function defined for a sequence of positive integers. The exponential sum can be plotted in the complex plane as a progression of partial sums. The x-axis on the plot is the real part and the y-axis is the imaginary part.

Python package

The Python package expsum is a command line tool to plot and optionally animate the exponential sum for a specific function. See the exponential-sums repository on GitHub for installation and usage instructions. Examples of using the expsum tool for various functions are shown below. An animated plot can be displayed using the optional --anim argument. See the GitHub repo for more details.

Function 1

>>> python expsum func1 2000 10 7 17

func1a plot

>>> python expsum func1 8000 11 21 31

func1b plot

Function 2

>>> python expsum func2 1200 100

func2a plot

>>> python expsum func2 4000 800

func2b plot

Function 3

>>> python expsum func3 1000

func3a plot

>>> python expsum func3 4000

func3b plot

Function 4

>>> python expsum func4 4000 4

func4a plot

Function 5

>>> python expsum func5 4000 50 100

func5a plot

Function 6

>>> python expsum func6 2000 4

func6a plot

Function 7

>>> python expsum func7 8000 4

func7a plot

References

This article was inspired by John Cook’s blog post “Exponential sums make pretty pictures”.

  1. John D. Cook. Exponential sums make pretty pictures. October 7, 2017.
  2. David Angell. Exponential sums. School of Mathematics and Statistics, UNSW. Accessed July 7, 2019.
  3. Wikipedia contributors. Exponential sum. In Wikipedia, The Free Encyclopedia. Accessed July 20, 2019.

Back