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!