TITLE: Does anyone recognize this exponential sum?
QUESTION [5 upvotes]: For $a$, $b$ two integers, let $(a,b)$ denotes their gcd. We define the following exponential sum :
$$G_q(n):=\sum_{d|q,~(d,q/d)=1}{e^{2i\pi n\frac{dd'}{q}}}$$ 
for $n$ a non-negative integer and $q$ a positive integer ($d'$ denotes the inverse of $d \pmod{q/d}$).
Does anyone recognize this sum?
Many thanks!

REPLY [10 votes]: Yes, these sums occur as the arithmetic part of the Fourier expansion of
period kernels $\sum_{ad-bc=1}(a\tau+b)^{-k}(c\tau+d)^{-k}$, the analytic part
being J-Bessel functions. The derivation is not difficult. I can send you
the paper where I compute them if you want (from 1980), private e-mail
please.