This response is in answer to David's further question about whether it is possible to bound the rate at which $S_N/N$ tends to zero, as he was wanting to use Weyl's inequality to do.

I don't think that it is possible, even in the case d=2 and $f(n)=\theta n^2$. (for d=1 it is not hard to show that $S_N$ is bounded so $S_N/N=O(N^{-1})$). [Edit: There is an error below, but I'm hopeful it can be fixed]. I'll write
$$
S_N(\theta)=\sum_{n=1}^Ne^{2\pi i\theta n^2}
$$
in the following. Then, I'll try to show that, for any given h(N)->0, it is not true that $S_N(\theta)/N$ always tends to zero at rate O(h(N)).

> (1) Let $h\colon\mathbb{N}\to\\mathbb{R}_+$ satisfy $\lim_nh(n)=0$. Then, there exists an irrational $\theta$ such that $\sup_N\vert S_N(\theta)/(h(N)N)\vert=\infty$

I'll construct this by choosing θ as the limit of a very quickly converging sequence of rational numbers. Let's break up the construction, starting with the case where θ is actually rational.

> (2) Let θ = a/b for integers a,b with b > 0. Setting $x=S_b(\theta)/b$ then $S_N(\theta)/N\to x$ as $N\to\infty$.

*Proof:*
If m&nbsp;&equiv;&nbsp;n (mod b) then m<sup>2</sup>&nbsp;&equiv;&nbsp;n<sup>2</sup> (mod b), so &theta;m<sup>2</sup>&nbsp;-&nbsp;&theta;n<sup>2</sup> is an integer, and $e^{2\pi i\theta m^2}=e^{2\pi i \theta n^2}$. This shows that $n\mapsto e^{2\pi i\theta n^2}$ has period b.
This gives
$$
S_{bN}(\theta)=\sum_{j=0}^{N-1}\sum_{k=1}^{b}e^{2\pi i\theta(jb+k)^2}=N\sum_{k=1}^be^{2\pi i\theta k^2}.
$$
So, S<sub>bN</sub>(&theta;)&nbsp;=&nbsp;NS<sub>b</sub>(&theta;). Now, any N can be written as N&nbsp;=&nbsp;bM&nbsp;+&nbsp;R for some R&nbsp;&lt;&nbsp;b. Then, $\vert S_N-MS_b\vert\le R$ and, dividing by N gives $\vert S_N/N-S_b/b\vert\to0$ as N goes to infinity.

> (3) Let &theta;&nbsp;=&nbsp;a/b for coprime integers a,b with b odd and &phi;(b)&ge;b/2 (&phi; is [Euler's totient function][1]. Then $x=S_b(\theta)/b$ is nonzero and, by (2), $S_N(\theta)/N$ tends to a nonzero limit.

*Proof:*
As a,b are coprime, $u=e^{2\pi i \theta}$ is a primitive b'th root of unity, with minimal polynomial of degree &phi;(b)&ge;b/2 over the rationals. So
$$
S_b(\theta)=\sum_{k=1}^{b}u^{k^2}=1+2\sum_{k=1}^{(b-1)/2}u^{k^2}
$$
is nonzero. [Edit: There is still an error here. I need to show that $\{u^{k^2}\colon k=0,\ldots,(b-1)/2\}$ is linearly independent over the rationals, which I haven't done. Hopefully this can be fixed]

Using this, a &theta; can be constructed proving (1) above.

> Let $h\colon\mathbb{N}\to\mathbb{R}$ satisfy $\lim_nh(n)=0$. Then, there exists a sequence $p_k$ of prime numbers, tending to infinity, such that the sum
$$
\begin{array}
{}\displaystyle\theta=\sum_{n=1}^\infty\frac{1}{p_n}&&(*)
\end{array}
$$
converge to an irrational number, and $\sup_NS_N(\theta)/(h(N)N)=\infty$.

*Proof:*
In order for the sum in (*) to converge, we have to require that p<sub>n</sub> grows quickly, such as p<sub>n</sub>&nbsp;&ge;&nbsp;2<sup>n</sup>.
Now, let us choose p<sub>1</sub>,p<sub>2</sub>,... inductively. Suppose that odd primes p<sub>1</sub>,...,p<sub>m</sub> have already been chosen, and set $\theta_m=1/p_1+\cdots+1/p_m$. We can write &theta;<sub>m</sub>=a<sub>m</sub>/b<sub>m</sub> where b<sub>m</sub>=p<sub>1</sub>...p<sub>m</sub>.
If we make sure that $p_m>2^{m-n}b_n^n$ for all m&gt;n, this will give the following rational approximations
$$
\vert\theta-a_m/b_m\vert=\sum_{k=n+1}^\infty \frac{1}{p_k}\le\frac{1}{p_n}^n
$$
and, by [Liouville's theorem][2], &theta; will be irrational (transcendental, in fact).

Also, assuming that p<sub>n</sub> are chosen large enough that $\prod_n(1-1/p_n)>1/2$ then we have &phi;(b<sub>m</sub>)&nbsp;&ge;&nbsp;b<sub>m</sub>/2 and (3) can be applied.
By (3), $S_N(\theta_m)/N$ converges to a nonzero limit, so we can choose an $N_m$ with $\vert S_{N_m}(\theta_m)/(h(N_m)N_m)\vert>m$.
By continuity, there is an $\epsilon>0$ such that $\vert S_{N_m}(\theta)/{N_m}\vert>m$ whenever $\vert\theta-\theta_m\vert\le\epsilon$. To guarantee that our value of &theta; defined by (*) satisfies this, it is only necessary to choose $p_n>2^{n-m}/\epsilon$ for all n&nbsp;&gt;&nbsp;m.

Proceeding in this way, we can choose a quickly increasing sequence of prime numbers, where each choice of  prime number imposes a lower bound on the following terms in the sequence. It also provides us with a sequence N<sub>1</sub>,N<sub>2</sub>,... of integers such that $\vert S_{N_m}(\theta)/{(h(N_m)N_m)}\vert\ge m$, so $\sup_N\vert S_N(\theta)/(h(N)N)\vert=\infty$.


  [1]: http://en.wikipedia.org/wiki/Euler%2527s_totient_function
  [2]: http://en.wikipedia.org/wiki/Liouville_number