Drawing Kloosterman sums
For any power $q$ of a prime number (called the modulus), let us note $$ 1\leq j_1<\dotsc<j_{\varphi(q)}<q $$ the integers prime to $q$. For all $a$ and $b$ prime to $a$, and for $j_\ell$ one of the integers prime to $q$ defined above, we define the Kloosterman partial sum $K_j(a,b)$ by $$ K_{j_{\ell}}(a,b;q)=\frac{1}{\sqrt{q}}\sum_{n=1}^{\ell}\exp\left(2i\pi\frac{aj_n+b\overline{j_n}}{q}\right) $$ where $\overline{j_n}$ is an inverse of $j_n$ modulo $q$. Kloosterman’s partial sums are complex numbers. We can therefore associate them with points that we plot, one after the other, starting with $K_{j_1}(a,b)$ then $K_{j_2}(a,b)$ up to $K_{j_{\varphi(q)}}(a,b;q)$.
Kloosterman clouds
For fixed values of $q$, $a$ and $b$, we plot the points associated with Kloosterman’s partial sums, without linking them together. The color keeps track of the number of elements in each sum (or, equivalently, the order in which these points were plotted) according to the following scale:
Modulus is prime
Modulus is a power of prime
Kloosterman paths
For fixed values of $q$, $a$ and $b$, we plot the points associated with Kloosterman’s partial sums, and draw a segment between two consecutive points.
Modulus is prime
Modulus is a power of prime
One parameter fixed
For a fixed $b$, we draw the $\varphi(q)$ paths associated to the $\varphi(q)$ parameters $a$ and the fixed parameters $b$ and $q$. Each path is colored according to the previous scale.
Modulus is prime
Modulus is a power of prime
Paths leading to the same Kloosterman sum
The last partial sum is called the Kloosterman sum $$ K(a,b;q)=\frac{1}{\sqrt{q}}\sum_{n=1}^{\varphi(q)}\exp\left(2i\pi\frac{aj_n+b\overline{j_n}}{q}\right). $$ We can show that $K(a\overline{b},b;q)=K(a,1;q)$. Taking the $\varphi(q)$ possible values for $a$, we then plot the $\varphi(q)$ different paths leading to the Kloosterman sum $K(a,1;q)$.
Modulus is prime
Modulus is a power of prime