Solution (source code)

= Solution

With $\mu_{\leq U}(d)=\mu(d)1_{d\leq U}$ and analogous notation for $\Lambda_{\leq V}$, <Vaughan identity> is
$$
\Lambda
=\Lambda_{\leq V}
+\mu_{\leq U}*\log
-\mu_{\leq U}*\Lambda_{\leq V}*1
+\mu_{>U}*\Lambda_{>V}*1.
$$
Thus, when $UV\leq N$,
$$
\begin{aligned}
\sum_{n\leq N}\Lambda(n)e(\alpha n^2)
={}&\sum_{n\leq V}\Lambda(n)e(\alpha n^2)\\
&+\sum_{d\leq U}\mu(d)\sum_{m\leq N/d}(\log m)e(\alpha d^2m^2)\\
&-\sum_{d\leq U}\mu(d)\sum_{m\leq V}\Lambda(m)
  \sum_{r\leq N/(dm)}e(\alpha d^2m^2r^2)\\
&+\sum_{\substack{d>U,\ m>V,\ r\geq1\\dmr\leq N}}
  \mu(d)\Lambda(m)e(\alpha d^2m^2r^2).
\end{aligned}
$$
The first term is short, the next two are Type I sums, and the last becomes a Type II <bilinear sum> after grouping variables and applying a <dyadic decomposition>.