Function: znchargauss
Section: number_theoretical
C-Name: znchargauss
Prototype: GGDGb
Help: znchargauss(G, chi, {a=1}): given a Dirichlet character chi on
 G = (Z/NZ)^*, return the complex Gauss sum g(chi,a).
Doc: Given a Dirichlet character $\chi$ on $G = (\Z/N\Z)^*$ (see
 \kbd{znchar}), return the complex Gauss sum
 $$g(\chi,a) = \sum_{n = 1}^N \chi(n) e(a n/N)$$
 \bprog
 ? [G,chi] = znchar(-3); \\ quadratic Gauss sum: I*sqrt(3)
 ? znchargauss(G,chi)
 %2 = 1.7320508075688772935274463415058723670*I
 ? [G,chi] = znchar(5);
 ? znchargauss(G,chi)  \\ sqrt(5)
 %2 = 2.2360679774997896964091736687312762354
 ? G = znstar(300,1); chi = [1,1,12]~;
 ? znchargauss(G,chi) / sqrt(300) - exp(2*I*Pi*11/25)  \\ = 0
 %4 = 2.350988701644575016 E-38 + 1.4693679385278593850 E-39*I
 ? lfuntheta([G,chi], 1)  \\ = 0
 %5 = -5.79[...] E-39 - 2.71[...] E-40*I
 @eprog
