# On algebraic twists with composite moduli

Yongxiao Lin  Data Science Institute, Shandong University, Jinan 250100, China
<EMAIL_ADDRESS>and  Philippe Michel  EPFL/MATH/TAN, Station 8,
CH-1015 Lausanne, Switzerland<EMAIL_ADDRESS>
###### Abstract.

We study bounds for algebraic twists sums of automorphic coefficients by trace
functions of composite moduli.

Ph. M. was partially supported by the SNF (grant 200021_197045).

In memory of Chandra Sekhar Raju

##  1\. Introduction

In a series of papers [FKM1, KLMS, LMS] we studied the absence of correlations
between the coefficients of certain automorphic $L$-functions and trace
functions of prime moduli.

More precisely, given $q$ a prime number, let

$K:{\mathbf{F}_{q}}=\mathbf{Z}/q\mathbf{Z}\mapsto\mathbf{C}$

be the trace function associated to a suitable $\ell$-adic middle extension
sheaf $\mathcal{F}$ on the affine line $\mathbf{A}^{1}_{{\mathbf{F}_{q}}}$,
geometrically irreducible and pure of weight $0$; this implies in particular
that the supnorm of $K$ satisfies

$\|K\|_{\infty}\leqslant C(\mathcal{F})$

where $C(\mathcal{F})$ denotes the analytic conductor of $\mathcal{F}$, a
numerical invariant attached to the Galois representation underlying
$\mathcal{F}$. We now view $K$ as a $q$-periodic function on $\mathbf{Z}$ via
the obvious projection.

Let

$L(\pi,s)=\sum_{n\geqslant
1}\frac{\lambda_{\pi}(n)}{n^{s}}=\prod_{p}L(\pi_{p},s),\ \mathfrak{Re}\,s>1$

be an automorphic $L$-function of some degree $d\geqslant 2$ (normalized so
that $\mathfrak{Re}\,s=1/2$ is the critical line). For $V$ a smooth, compactly
supported function on $\mathbf{R}_{>0}$, we consider the problem of obtaining
non-trivial bounds for the correlation sums

(1.1) $S_{V}(K;X)=\sum_{n\geqslant
1}\lambda_{\pi}(n)K(n)V\left(\frac{n}{X}\right)\ll X^{1-\eta}\hbox{ as
$q,X\rightarrow\infty$;}$

here $\eta>0$ is some positive constant and the above bound depends implicitly
on $\pi$, $C(\mathcal{F})$ and $V$ and for $X$ varying over a range as small
as possible compared to $q$.

#### The convexity range

Under relatively mild conditions on $\mathcal{F}$ it is not too difficult to
obtain non-trivial bounds like (1.1) as long as

$X\geqslant q^{d/2+\delta}$

for some $\delta>0$ (with $\eta$ depending on $\delta$) and so the first
challenge is to pass the so-called the convexity range

(1.2) $X_{\mathrm{cv}}:=q^{d/2}.$

Indeed passing this range for $K=\chi\bmod q$ a non-trivial Dirichlet
character, enables one to solve the subconvexity problem for the twisted
$L$-function $L(\pi\times\chi,s)$ for $\mathfrak{Re}\,s=1/2$ in the large
$q$-aspect.

In the three papers mentioned above, a non-trivial bound (1.1) was obtained
for $X$ at and below the convexity range. Specifically

  * –

[FKM1] considered the situation where $L(\pi,s)$ is the standard $L$-function
of a $\operatorname{GL}_{2,\mathbf{Q}}$ automorphic representation (the
$L$-function of a Hecke eigenform) and obtained (under some mild assumptions
on $\mathcal{F}$ that are recalled below) (1.1) as long as

(1.3) $X\geqslant q^{1-1/4+\delta},\ \delta>0.$

  * –

[KLMS] considered the situation where $L(\pi,s)$ is the standard $L$-function
of a $\operatorname{GL}_{3,\mathbf{Q}}$ automorphic representation (of level
$1$) and obtained (again under some suitable assumptions on $\mathcal{F}$)
(1.1) as long as

(1.4) $X\geqslant q^{3/2-1/6+\delta},\ \delta>0.$

  * –

[LMS] considered the situation where $L(\pi,s)$ is the Rankin–Selberg
$L$-function attached to a pair $(\varphi,f)$ of
$\operatorname{GL}_{3,\mathbf{Q}}$ and $\operatorname{GL}_{2,\mathbf{Q}}$
automorphic forms (both of level $1$). More precisely $\lambda_{\pi}$ is given
by

(1.5) $\lambda_{\pi}(n)=\sum_{mr^{2}=n}\lambda_{\varphi}(m,r)\lambda_{f}(m).$

In that case (1.1) can be obtained for $K$ a trace function associated with a
suitably “good” sheaf $\mathcal{K}$ (see [LMS, §1] for the definition of the
goodness) as long as

(1.6) $X\geqslant q^{3-1/4+\delta},\ \delta>0.$

#### The arithmetic progression range

It is of course desirable and often interesting to try to obtain (1.1) for
even shorter ranges. Such a range arises when studying the distribution of
$(\lambda_{\pi}(n))_{n\leqslant X}$ in large arithmetic progressions. Given
$q$ a modulus and a primitive congruence class $a\bmod q$ (i.e., $(a,q)=1$),
the goal is to improve the trivial estimate111This may require the
Ramanujan–Petersson conjecture. for the sum

(1.7) $\sum_{n\equiv a\bmod q}\lambda_{\pi}(n)V\left(\frac{n}{X}\right)\ll
X^{o(1)}\frac{X}{q}.$

Expressing the congruence $n\equiv a\bmod q$ in terms of Dirichlet characters
$\bmod q$ and using the functional equation for $L(\pi\times\chi,s)$
transforms the left hand side of (1.7) into a sum of the shape (possibly up to
some main terms)

(1.8)
$\frac{X}{q^{\frac{d+1}{2}}}\sum_{n}\lambda_{\overline{\pi}}(n)\operatorname{\mathrm{Kl}}_{d}(an;q)\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{V}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{V}{\scalebox{-1.0}{\tmpbox}}\left(\frac{nX}{q^{d}}\right)$

where
$\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{V}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{V}{\scalebox{-1.0}{\tmpbox}}(x)$
is a suitable integral transform of $V$ (depending on $d$ and the Gamma
factors of $\pi$) and is rapidly decreasing and

$\operatorname{\mathrm{Kl}}_{d}(n;q)=\frac{1}{q^{\frac{d-1}{2}}}\mathop{\sum\sum}\limits_{\stackrel{{\scriptstyle{\scriptstyle
x_{1},\cdots,x_{d}\in(\mathbf{Z}/q\mathbf{Z})^{\times}}}}{{{\scriptstyle
x_{1}.\cdots.x_{d}=n}}}}e\left(\frac{x_{1}+\cdots+x_{d}}{q}\right)$

denotes the $d$-th hyper-Kloosterman sum. As is well known, Kloosterman sums
are trace functions (see [GKM]) and they satisfy Deligne’s bound

$|\operatorname{\mathrm{Kl}}_{d}(n;q)|\leqslant d.$

Therefore, possibly subject to the Ramanujan–Petersson conjecture, one obtains
that (1.8) is bounded by

$\frac{X}{q^{\frac{d+1}{2}}}\sum_{n}\lambda_{\overline{\pi}}(n)\operatorname{\mathrm{Kl}}_{d}(an;q)\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{V}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{V}{\scalebox{-1.0}{\tmpbox}}\left(\frac{nX}{q^{d}}\right)\ll
X^{o(1)}q^{\frac{d-1}{2}}$

which improves over (1.7) as long as

$q\leqslant X^{\theta_{d}-\delta},\ \delta>0$

where

(1.9) $\theta_{d}=\frac{2}{d+1}.$

We call the exponent $\theta_{d}$ the standard level of distribution of the
sequence $(\lambda_{\pi}(n))_{n\geqslant 1}$. For instance we have

$\theta_{2}=2/3,\ \theta_{3}=1/2,\ \theta_{4}=2/5,\ \theta_{6}=2/7.$

To increase this standard level of distribution we would then need to obtain
(1.1) for $K(n)=\operatorname{\mathrm{Kl}}_{d}(an;q)$ and
$\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{X}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{X}{\scalebox{-1.0}{\tmpbox}}=q^{d}/X$
smaller than

$X_{\mathrm{ap}}:=q^{\frac{d-1}{2}}=X_{\mathrm{cv}}q^{-1/2}.$

We call this the a.p. range.

Observe that the three results mentioned above fall short of reaching the a.p.
range.

One possible way to improve the situation is to exploit some special
properties of the arithmetic function $\lambda_{\pi}$ like the existence of a
Dirichlet factorisation

$\lambda_{\pi}(n)=\lambda_{\pi_{1}}\star\lambda_{\pi_{2}}(n)=\sum_{lm=n}\lambda_{\pi_{1}}(l)\lambda_{\pi_{2}}(m).$

A landmark example is the work of Friedlander and Iwaniec [FI] on the ternary
divisor function

$d_{3}(n)=1\star 1\star 1(n)=\sum_{klm=n}1$

where the standard exponent $\theta_{3}$ was replaced by $\theta_{3}+1/230$
(see [HBActa, FKMMath, KMS2] for further improvements and generalisations of
their ideas). See also [FIActa] for result on higher order divisor functions.
Recently, in joint work with E. Kowalski [KLM], we could pass the a.p. range
$\theta_{4}=2/5$ for Rankin–Selberg coefficients $\lambda_{f\times f}(n)$ for
$f$ a cusp form of level $1$ by using the factorisation

$\lambda_{f\times
f}(n)=1\star\lambda_{\mathrm{sym}^{2}f}(n)=\sum_{lm=n}\lambda_{\mathrm{sym}^{2}f}(m)$

combined with [KLMS].

#### Composite moduli

Another option222Possibly combined with the previous one. is to exploit
existing factorisations of the modulus $q$. This is for instance the case of
the work of Fouvry, Iwaniec, and Katz [FIK] on the divisor function
$\lambda_{\pi}(n)=d_{2}(n)$ (which requires an additional averaging over one
factor of the modulus but extends to Fourier coefficients of cusp forms) or of
Irving [Irving] for sufficiently smooth moduli $q$ (however the method also
uses the factorisation of the divisor function).

In this paper we improve the ranges (1.3) and (1.6) for suitable factorable
moduli $q$.

To simplify we limit ourselves to the case where the modulus is of the form
$q=q_{0}q_{1}$ where $q_{0}$ and $q_{1}$ are distinct primes; consequently we
assume that

$K:\mathbf{Z}/q_{0}q_{1}\mathbf{Z}\mapsto\mathbf{C}$

can be expressed (via the Chinese Remainder Theorem) as a product of two
functions of respective moduli $q_{0}$ and $q_{1}$. For $K(\cdot)$ on
$\mathbf{Z}/q\mathbf{Z}$ we denote

(1.10)
$\widehat{K}(n)=\frac{1}{q^{1/2}}\sum_{x\in{\mathbf{F}_{q}}}K(x)e\left(\frac{nx}{q}\right)$

its normalized Fourier transform. We write $\|\widehat{K}\|_{\infty}$ for the
maximum of $|\widehat{K}(n)|$ for $n\in\mathbf{Z}/q\mathbf{Z}$.

Our first result is for $d=2$:

######  Theorem 1.1.

Let $f(z)$ be a Hecke eigencuspform of level $1$ either holomorphic of weight
$k\geqslant 2$ or a Laplacian eigenform with spectral parameter $t_{f}$; let
$(\lambda_{f}(n))_{n\geqslant 1}$ be its Hecke eigenvalues. Let $q=q_{0}q_{1}$
be a product of two distinct primes and let

$K_{0}:\mathbf{Z}/{q_{0}}\mathbf{Z}\mapsto\mathbf{C},\
K_{1}:\mathbf{Z}/{q_{1}}\mathbf{Z}\mapsto\mathbf{C}$

be two complex valued functions which we identify with functions on
$\mathbf{Z}$ of period $q_{0}$ and $q_{1}$ respectively; we assume that
$K_{0}$ is the trace function attached to an $\ell$-adic middle extension
Fourier sheaf $\mathcal{F}$ on $\mathbf{A}^{1}_{\mathbf{F}_{q_{0}}}$,
geometrically irreducible, pure of weight $0$ and such that

  * –

The automorphism group (see [FKMS, §7.1]) of the Fourier transform sheaf
$\widehat{\mathcal{F}}$ is trivial.

  * –

(MO) (see [LMS, §1]) There is no $\lambda\in{\mathbf{F}^{\times}_{q}}$ such
that the geometric monodromy group of $\mathcal{F}$ has some quotient which is
equal, as a representation of the geometric fundamental group $\pi_{1}$ into
an algebraic group, to the geometric monodromy group of the Kloosterman sheaf
$[\times\lambda]^{*}\mathcal{K}\ell_{2}$ modulo $\pm 1$.

Let $K$ be the $q$-periodic function given by

$K(\cdot)=K_{0}(\cdot)K_{1}(\cdot).$

Let $Z\geqslant 1$ be some parameter and
$V\in\mathcal{C}^{\infty}_{c}(\mathbf{R})$ be a smooth function compactly
supported in the interval $[1,2[$ satisfying for all $j\geqslant 0$,

(1.11) $V^{(j)}(x)\ll_{j}Z^{j}.$

For $X\geqslant 1$ we have the bound

(1.12)
$\sum_{n=1}^{\infty}\lambda_{f}(n)K(n)V\left(\frac{n}{X}\right)\ll\|\widehat{K_{1}}\|_{\infty}X^{o(1)}\left(Z^{1/2}X^{1/2}q_{0}^{1/2}+ZX^{1/2}q^{1/2}{q_{0}}^{-1/4}+Zq^{1/2}{q_{0}}^{1/4}\right),$

where the implicit constant depends at most on $f$, on the conductor
$C_{0}=C(\mathcal{F})$ of $\mathcal{F}$ and on the implicit constants in
(1.11).

######  Remark 1.2.

Examples of traces functions $K_{0}$ whose associated sheaf $\mathcal{F}$
satisfy the conditions of Theorem 1.1 include the hyper-Kloosterman sums
$\operatorname{\mathrm{Kl}}_{d}(\cdot;q_{0})$ for $d\not=2$.

######  Remark 1.3.

In particular, under the above assumptions on $K$, for $Z=1$ and

$q_{0}=q^{2/3+o(1)}$

from (1.12) we see that the bound (1.1) holds as long as

$X\geqslant q^{2/3+\delta}$

for any given $\delta>0$. The range (for $d=2$)

$q^{2/3}=X_{\mathrm{cv}}^{2/3}>X_{\mathrm{ap}}=q^{1/2}$

is sometimes called the Weyl range. It can be related to the work of Heath-
Brown [H-B78] who obtained a Weyl-type subconvexity bound
$L(\chi,1/2)=O\big{(}q^{1/6+o(1)}\big{)}$ for the Dirichlet $L$-functions
provided that $q$ has a factor $q_{0}$ of size $q_{0}\approx q^{2/3}$.

######  Remark 1.4.

It is possible to improve this range further assuming that $q_{0}$ is
squarefree and suitably factorable (under additional assumptions on $K_{0}$)
by using the recent work of Wu, Xi, and Sawin [PW] which extends Heath-Brown’s
$q$-van der Corput’s method to general trace functions.

######  Remark 1.5.

In [FKM1] the bound (1.1) was obtained for $q$ prime in the range (1.3) under
the sole assumption that $\mathcal{F}$ is a Fourier sheaf (not geometrically
isomorphic to the constant sheaf or any Artin–Schreier sheaf). Theorem 1.1
holds in this generality as well, but to simplify the exposition, we have
chosen to make this extra assumption regarding the automorphism group of
$\widehat{\mathcal{F}}$.

Our second main result concerns the case for $d=6$ where $\lambda_{\pi}(n)$ is
given by (1.5), that is, the $n$-th coefficient of a
$\operatorname{GL}_{3,\mathbf{Q}}\times\operatorname{GL}_{2,\mathbf{Q}}$
Rankin–Selberg $L$-function $L(\varphi\times f,s)$.

######  Theorem 1.6.

Let $f(z)$ be a Hecke eigencuspform of level $1$ either holomorphic of weight
$k\geqslant 2$ or a Laplacian eigenform with spectral parameter $t_{f}$; let
$(\lambda_{f}(n))_{n\geqslant 1}$ be its Hecke eigenvalues. Let $\varphi$ be a
Hecke–Maass cuspform for $\operatorname{GL}_{3,\mathbf{Q}}$ of level $1$ with
Fourier coefficients $(\lambda_{\varphi}(n,r))_{n\geqslant 1,r\not=0}$.

Let $q=q_{0}q_{1}$ be a product of two distinct primes and let

$K_{0}:\mathbf{Z}/{q_{0}}\mathbf{Z}\mapsto\mathbf{C},\
K_{1}:\mathbf{Z}/{q_{1}}\mathbf{Z}\mapsto\mathbf{C}$

be two complex valued functions which we identify with functions on
$\mathbf{Z}$ of period $q_{0}$ and $q_{1}$ respectively; we assume moreover
that $K_{0}$ is the trace function attached to an $\ell$-adic middle extension
Fourier sheaf $\mathcal{F}$ on $\mathbf{A}^{1}_{\mathbf{F}_{q_{0}}}$,
geometrically irreducible and pure of weight $0$, of conductor $C_{0}$ and
which is good in the sense of [LMS, §1]. Let $K$ be the $q$-periodic function
given by

$K(\cdot)=K_{0}(\cdot)K_{1}(\cdot).$

Let $V\in\mathcal{C}^{\infty}_{c}(\mathbf{R})$ be a smooth function satisfying
(1.11). Let $X\geqslant 1$ be such that $X\geqslant Z^{4}q^{2}q_{0}^{1/2}$.
Then

(1.13) $\sum_{n\geqslant
1,r\not=0}\lambda_{\varphi}(n,r)\lambda_{f}(n)K(nr^{2})V\left(\frac{nr^{2}}{X}\right)\ll_{\varphi,f,\|K_{1}\|_{\infty},C_{0}}X^{o(1)}Z^{2}\Bigg{(}X^{3/4}{q_{0}}^{3/4}\\\
+X^{\frac{2-\theta_{3}}{3-2\theta_{3}}}(q^{2}q_{0}^{1/2})^{\frac{1-\theta_{3}}{3-2\theta_{3}}}+\frac{X}{{q_{0}}^{1/4}}+\frac{X^{3/4}q}{q_{0}^{1/2}}\Bigg{)}.$

Here $\theta_{3}=5/14$ is the best known bound towards the Ramanujan–Petersson
conjecture on $\operatorname{GL}_{3}$.

######  Remark 1.7.

In particular for

$q_{0}=q^{4/5+o(1)}$

we obtain that

$\sum_{n\geqslant
1,r\not=0}\lambda_{\varphi}(n,r)\lambda_{f}(n)K(nr^{2})V\left(\frac{nr^{2}}{X}\right)\ll_{\varphi,f,\|K_{1}\|_{\infty},C_{0}}X^{o(1)}Z^{2}\Bigg{(}X^{3/4}q^{3/5}+X^{\frac{2-\theta_{3}}{3-2\theta_{3}}}q^{\frac{12(1-\theta_{3})}{5(3-2\theta_{3})}}+\frac{X}{q^{1/5}}\Bigg{)}$

and when $Z=1$ this bound is non-trivial (i.e., (1.1) holds) as soon as

$X\geqslant q^{12/5+\delta}=q^{5/2-1/10+\delta}$

for some $\delta>0$, in which case the second factor inside the parentheses
can be removed.

Applying Theorem 1.6 to the function

$K(n)=\operatorname{\mathrm{Kl}}_{6}(an;q)$

we obtain

######  Corollary 1.8.

Notations be as above. Assume that

$q_{0}=q^{4/5+o(1)}.$

We have for any $(a,q)=1$,

$\sum_{\stackrel{{\scriptstyle{\scriptstyle n,|r|\geqslant 1}}}{{{\scriptstyle
nr^{2}\equiv a\bmod
q}}}}\lambda_{\varphi}(n,r)\lambda_{f}(n)V\left(\frac{nr^{2}}{X}\right)\ll_{\varphi,f}X^{o(1)}\left(X^{1/4}q^{8/5}+q^{23/10}\right).$

In particular, given $\eta>0$, we have

$\sum_{\stackrel{{\scriptstyle{\scriptstyle n,|r|\geqslant 1}}}{{{\scriptstyle
nr^{2}\equiv a\bmod
q}}}}\lambda_{\varphi}(n,r)\lambda_{f}(n)V\left(\frac{nr^{2}}{X}\right)\ll_{\varphi,f,\eta}(\frac{X}{q})^{1-\delta}$

for some $\delta=\delta(\eta)>0$ as long as

$q\leqslant X^{2/7+1/364-\eta}=X^{\theta_{6}+1/364-\eta}.$

######  Remark 1.9.

The exponent $1/364$ matches the one presented in [Lin-Sun, Cor. 1.4]. In that
work, Q. Sun and the first named author obtained the following error term for
the “sharp cut” sum of the coefficients
$\sum_{mr^{2}=n}\lambda_{\varphi}(m,r)\lambda_{f}(m)$

$\sum_{nr^{2}\leqslant
X}\lambda_{\varphi}(n,r)\lambda_{f}(n)=O\left(X^{\tau_{6}-1/364+o(1)}\right)$

where

$\tau_{d}=\frac{d-1}{d+1}$

is the “standard” exponent of Landau (see [FICan, Prop. 1.1]) for sharp-cut
sums of coefficients of automorphic $L$-functions of degree $d$.

##  2\. Proof of Theorem 1.1

The proof of Theorem 1.1 is based on the method introduced in [AHLS], in which
a Burgess type bound was obtained for $K=\chi$ a multiplicative character of
prime modulus $q$, by unexpectedly utilizing a “trivial” delta method. We
demonstrate in this work once again that the trivial delta method is strong
enough to reach a Weyl type bound when the moduli $q$ factors in an
appropriate way (see [subGL2GL2, Agg1] for other interesting applications of
the trivial delta symbol).

Let $(\lambda_{f}(n))_{n\geqslant 1}$ be the Hecke eigenvalues of a $\rm
GL_{2}$ cusp form $f$. Let $q={q_{0}}{q_{1}}$. Let $K\bmod q$ be a trace
function. From the definition (1.10) we have the twisted multiplicativity

(2.1)
$\widehat{K}(b)=\widehat{K_{0}}(\overline{{q_{1}}}b)\widehat{K_{1}}(\overline{{q_{0}}}b).$

Consider

(2.2) $S(X):=\sum_{n=1}^{\infty}\lambda_{f}(n)K(n)V\left(\frac{n}{X}\right),$

where $V$ satisfies the bound (1.11). Then

$S(X)=\sum_{n=1}^{\infty}\lambda_{f}(n)W\left(\frac{n}{X}\right)\sum_{r=1}^{\infty}K(r)V\left(\frac{r}{X}\right)\delta_{n=r}.$

Here $W$ is a smooth function supported in $(1/100,100)$ and satisfying
$W^{(j)}(x)\ll_{j}1$ for $j\geqslant 0$ and $W(x)=1$ for $x\in[1,2]$, and
$\delta_{n=r}$ is the Kronecker delta symbol.

Following [AHLS], if we assume that $p$ is a prime coprime with $q$ and such
that

(2.3) $p{q_{0}}>1000X$

then for $|n-r|\leqslant 100X$, we have

$\begin{split}\delta_{n=r}=&\frac{1}{p{q_{0}}}\sum_{u(p{q_{0}})}e\left(\frac{u(n-r)}{p{q_{0}}}\right)\\\
=&\frac{1}{p{q_{0}}}\sum_{c|p{q_{0}}}\sideset{}{{}^{\star}}{\sum}_{\alpha(c)}e\left(\frac{\alpha(n-r)}{c}\right),\end{split}$

and by summing over all $p\in{\rm P}:=\\{p\in[P,2P[:p\,\text{prime},\
(p,q)=1\\}$, we have

$\delta_{n=r}=\frac{1}{|\rm P|}\sum_{p\in\rm
P}\frac{1}{pq_{0}}\sum_{c|pq_{0}}\sideset{}{{}^{\star}}{\sum}_{\alpha(c)}e\left(\frac{\alpha(n-r)}{c}\right).$

with $|{\rm P}|\gg P/\log P$ from the prime number theorem.

######  Remark 2.1.

Choosing the parameter $q_{0}$ in place of $q$ is one chief difference between
this paper and [AHLS].

Applying the above expression of $\delta_{n=r}$ to the sum $S(X)$, we get

$S(X)=\frac{1}{|{\rm P}|q_{0}}\sum_{p\in\rm
P}\frac{1}{p}\sum_{c|pq_{0}}\sideset{}{{}^{\star}}{\sum}_{\alpha(c)}\sum_{n=1}^{\infty}\lambda_{f}(n)e\left(\frac{\alpha
n}{c}\right)W\left(\frac{n}{X}\right)\sum_{r=1}^{\infty}K(r)e\left(\frac{-\alpha
r}{c}\right)V\left(\frac{r}{X}\right).$

Applying the Voronoi summation formula ([KMV, Thm. A.4]), we obtain

$\sum_{n=1}^{\infty}\lambda_{f}(n)e\left(\frac{\alpha
n}{c}\right)W\left(\frac{n}{X}\right)=\frac{X}{c}\sum_{\pm}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}e\left(\frac{\mp\bar{\alpha}n}{c}\right)\widehat{W}^{\pm}\left(\frac{n}{c^{2}/X}\right).$

Here $\widehat{W}^{\pm}(\cdot)$ are defined as in [AHLS, Lem. 2.2]. Applying
the Poisson summation formula (modulo $[c,q]$), the $r$-sum

$\sum_{r\geqslant 1}K(r)e\left(\frac{-\alpha
r}{c}\right)V\left(\frac{r}{X}\right)$

is transformed into

(2.4)
$\frac{X}{[c,q]}\sum_{r\in\mathbb{Z}}\left(\sum_{\beta\bmod[c,q]}K(\beta)e\left(\frac{-\alpha\beta}{c}\right)e\left(\frac{r\beta}{[c,q]}\right)\right)\widehat{V}\left(\frac{rX}{[c,q]}\right),$

where $\widehat{V}$ denotes the Fourier transform of the function $V$.

Following [AHLS], we introduce the useful notation $a_{b}:=\frac{a}{(a,b)}$.
Then, using the relation $c=\frac{qc_{q}}{q_{c}}$ we can write

$e\left(\frac{\bullet}{c}\right)=e\left(\frac{\bullet
q_{c}}{qc_{q}}\right)=e\left(\frac{\bullet
q_{c}\overline{c_{q}}}{q}\right)e\left(\frac{\bullet
q_{c}\bar{q}}{c_{q}}\right).$

Similarly, using the relation $[c,q]=qc_{q}$ we have the reciprocity relation

$e\left(\frac{r\beta}{[c,q]}\right)=e\left(\frac{r\beta\overline{c_{q}}}{q}\right)e\left(\frac{r\beta\bar{q}}{c_{q}}\right).$

Then the $\beta$-sum in (2.4) can be rewritten as

$\begin{split}&\sum_{\beta\bmod q}K(\beta)e\left(\frac{(r-\alpha
q_{c})\overline{c_{q}}\beta}{q}\right)\times\sum_{\beta\bmod
c_{q}}e\left(\frac{(r-\alpha q_{c})\overline{q}\beta}{c_{q}}\right)\\\
&=q^{1/2}c_{q}\widehat{K}((r-\alpha
q_{c})\overline{c_{q}})\times\delta_{r-\alpha q_{c}\equiv 0\bmod
c_{q}},\end{split}$

where $\widehat{K}$ is the normalized Fourier transform (1.10) and
$\overline{c_{q}}$ is the multiplicative inverse of $c_{q}$ modulo $q$. We
also note that the weight function $\widehat{V}\left(\frac{rX}{[c,q]}\right)$
restricts the effective range of the $r$-sum in (2.4) to

$|r|\leqslant X^{o(1)}Z[c,q]/X.$

By this we mean that for any $\varepsilon>0$, the contribution of the terms
satisfying

$|r|>X^{\varepsilon}Z[c,q]/X$

is bounded by $O_{A,\varepsilon}(X^{-A})$ for any $A\geqslant 1$.

######  Notation.

To lighten the expressions to come we write

$A\lesssim B\hbox{ in place of }A\leqslant X^{o(1)}B.$

Therefore (2.4) becomes

$\frac{X}{q^{1/2}}\underset{\begin{subarray}{c}|r|\lesssim Z[c,q]/X\\\
r-\alpha q_{c}\equiv 0\bmod c_{q}\end{subarray}}{\sum}\widehat{K}((r-\alpha
q_{c})\overline{c_{q}})\widehat{V}\left(\frac{rX}{[c,q]}\right)+O_{A}\left(X^{-A}\right).$

Therefore one obtains that

$S(X)=\frac{1}{|{\rm P}|q_{0}}\sum_{p\in\rm
P}\frac{1}{p}\sum_{c|pq_{0}}\sideset{}{{}^{\star}}{\sum}_{\alpha(c)}\frac{X}{c}\sum_{\pm}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}e\left(\frac{\mp\bar{\alpha}n}{c}\right)\widehat{W}^{\pm}\left(\frac{n}{c^{2}/X}\right)\\\
\times\frac{X}{q^{1/2}}\underset{\begin{subarray}{c}|r|\lesssim Z[c,q]/X\\\
r-\alpha q_{c}\equiv 0\bmod c_{q}\end{subarray}}{\sum}\widehat{K}((r-\alpha
q_{c})\overline{c_{q}})\widehat{V}\left(\frac{rX}{[c,q]}\right)+O_{A}\left(X^{-A}\right).$

If $c=pq_{0}$, then in the above notation $c_{q}=p$ and $q_{c}=q_{1}$. The
congruence condition $r-\alpha q_{c}\equiv 0\bmod c_{q}$ becomes
$\bar{\alpha}\equiv\bar{r}q_{1}\bmod p$. Furthermore, from the twisted
multiplicativity in (2.1), we have

$\begin{split}\widehat{K}((r-\alpha{q_{1}})\bar{p})=\widehat{K_{0}}((r-\alpha{q_{1}})\overline{{q_{1}}p})\widehat{K_{1}}(r\overline{{q_{0}}p});\end{split}$

similarly we have

$\begin{split}e\left(\frac{\mp\bar{\alpha}n}{pq_{0}}\right)=e\left(\frac{\mp\bar{\alpha}n\overline{q_{0}}}{p}\right)e\left(\frac{\mp\bar{\alpha}n\bar{p}}{q_{0}}\right).\end{split}$

Therefore we can further rewrite $S(X)$ as

(2.5) $S(X)=\frac{X^{2}}{|{\rm
P}|{q_{0}}^{2}q^{1/2}}\sum_{\pm}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}\sum_{p\in\rm
P}\frac{1}{p^{2}}\sum_{|r|\lesssim
Zpq/X}\widehat{K_{1}}(r\overline{{q_{0}}p})e\left(\frac{\mp\overline{r{q_{0}}}n{q_{1}}}{p}\right)\widehat{V}\left(\frac{rX}{pq}\right)\\\
\times\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((r-\alpha{q_{1}})\overline{{q_{1}}p})e\left(\frac{\mp\bar{\alpha}n\bar{p}}{{q_{0}}}\right)\widehat{W}^{\pm}\left(\frac{n}{p^{2}{q_{0}}^{2}/X}\right)+S(X)_{c=p}+S(X)_{c=q_{0}}+O\left(X^{-A}\right),$

where the term $S(X)_{c=p},S(X)_{c=q_{0}}$, given in (2.13) and (2.15),
correspond to the contribution from the terms $c=p$ and $c=q_{0}$ respectively
(we notice that due to rapid decay of $\widehat{W}^{\pm}(x)$ the $c=1$ term
was absorbed into the negligible error term $O_{A}\left(X^{-A}\right)$). We
will treat such terms separately later in Sec. 2.3 (see the bounds (2.14) and
(2.17)).

######  Remark 2.2.

Estimating trivially (assuming the sum over $\alpha\bmod q_{0}$ in (2.5) is
bounded above by $O(q_{0}^{1/2})$) and ignoring the error terms, we have

$\begin{split}S(X)\ll&\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\frac{p^{2}{q_{0}}^{2}}{X}P\frac{Zpq}{X}q_{0}^{1/2}\ll
X^{o(1)}ZPq^{1/2}q_{0}^{1/2}.\end{split}$

In view of the constraint (2.3), this bound is insufficient to beat the
trivial bound $O(X)$ yet.

We can effectively truncate the $n$ sum at $n\lesssim P^{2}{q_{0}}^{2}/X$. To
this end, we further break the $n$-sum into dyadic intervals by introducing
another smooth weight $U(\frac{n}{N})$ to the $n$-sum, where the $N$’s are
such that

$N\lesssim\frac{P^{2}{q_{0}}^{2}}{X}.$

Moreover we can pull out the factor $\frac{1}{p^{2}}$ from the $p$-sum by
introducing another smooth weight to the $p$-sum which we suppress from our
notation. To conclude, we can bound $S(X)$ as follows

$S(X)\ll\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}\bigg{|}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}U\left(\frac{n}{N}\right)\sum_{p\in\rm
P}\sum_{|r|\lesssim
Zpq/X}\widehat{K_{1}}(r\overline{{q_{0}}p})e\left(\frac{\mp\overline{r{q_{0}}}n{q_{1}}}{p}\right)\widehat{V}\left(\frac{rX}{pq}\right)\\\
\times\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((r-\alpha{q_{1}})\overline{{q_{1}}p})e\left(\frac{\mp\bar{\alpha}n\bar{p}}{{q_{0}}}\right)\widehat{W}^{\pm}\left(\frac{n}{p^{2}{q_{0}}^{2}/X}\right)\bigg{|}+|S(X)_{c=p}|+|S(X)_{c=q_{0}}|.$

Applying Cauchy–Schwarz inequality, one has

$S(X)\ll|S(X)_{c=p}|+|S(X)_{c=q_{0}}|+\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}\bigg{(}\sum_{n=1}^{\infty}|\overline{\lambda_{f}(n)}|^{2}U\left(\frac{n}{N}\right)\bigg{)}^{1/2}\\\
\times\bigg{(}\sum_{n=1}^{\infty}\bigg{|}\sum_{p\in\rm P}\sum_{|r|\lesssim
Zpq/X}\widehat{K_{1}}(r\overline{{q_{0}}p})e\left(\frac{\mp\overline{r{q_{0}}}n{q_{1}}}{p}\right)\widehat{V}\left(\frac{rX}{pq}\right)\\\
\times\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((r-\alpha{q_{1}})\overline{{q_{1}}p})e\left(\frac{\mp\bar{\alpha}n\bar{p}}{{q_{0}}}\right)\widehat{W}^{\pm}\left(\frac{n}{p^{2}{q_{0}}^{2}/X}\right)\bigg{|}^{2}U\left(\frac{n}{N}\right)\bigg{)}^{1/2}.$

Now we proceed to open the square and obtain that

$\displaystyle S(X)\ll$
$\displaystyle|S(X)_{c=p}|+|S(X)_{c=q_{0}}|+\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N^{1/2}\bigg{(}\sum_{p_{1},p_{2}\in\mathrm{P}}$
$\displaystyle\times\sum_{|r_{1}|,|r_{2}|\lesssim
ZPq/X}\widehat{K_{1}}(r_{1}\overline{{q_{0}}p_{1}})\overline{\widehat{K_{1}}(r_{2}\overline{{q_{0}}p_{2}})}\widehat{V}\left(\frac{r_{1}X}{p_{1}q}\right)\overline{\widehat{V}\left(\frac{r_{2}X}{p_{2}q}\right)}$
$\displaystyle\times\sideset{}{{}^{\star}}{\sum}_{\alpha_{1}({q_{0}})}\sideset{}{{}^{\star}}{\sum}_{\alpha_{2}({q_{0}})}\widehat{K_{0}}((r_{1}-\alpha_{1}{q_{1}})\overline{{q_{1}}p_{1}})\overline{\widehat{K_{0}}((r_{2}-\alpha_{2}{q_{1}})\overline{{q_{1}}p_{2}})}$
$\displaystyle\times\sum_{n=1}^{\infty}e\left(\mp\frac{\overline{r_{1}{q_{0}}}n{q_{1}}p_{2}-\overline{r_{2}{q_{0}}}n{q_{1}}p_{1}}{p_{1}p_{2}}\right)e\left(\mp\frac{\overline{\alpha_{1}}n\overline{p_{1}}-\overline{\alpha_{2}}n\overline{p_{2}}}{{q_{0}}}\right)\mathcal{W}\left(\frac{n}{N}\right)\bigg{)}^{1/2}.$

where

$\mathcal{W}\left(\frac{n}{N}\right):=U\left(\frac{n}{N}\right)\widehat{W}^{\pm}\left(\frac{n}{{p^{2}_{1}}{q_{0}}^{2}/X}\right)\overline{\widehat{W}^{\pm}}\left(\frac{n}{{p^{2}_{2}}{q_{0}}^{2}/X}\right).$

Applying the Poisson summation formula, one has

$\sum_{n=1}^{\infty}e\left(\mp\frac{\overline{r_{1}{q_{0}}}n{q_{1}}p_{2}-\overline{r_{2}{q_{0}}}n{q_{1}}p_{1}}{p_{1}p_{2}}\right)e\left(\mp\frac{\overline{\alpha_{1}}n\overline{p_{1}}-\overline{\alpha_{2}}n\overline{p_{2}}}{{q_{0}}}\right)\mathcal{W}\left(\frac{n}{N}\right)\\\
=\frac{N}{p_{1}p_{2}{q_{0}}}\sum_{\tilde{n}\in\mathbf{Z}}\sum_{\beta(p_{1}p_{2})}e\left(\mp\frac{(\overline{r_{1}{q_{0}}}{q_{1}}p_{2}-\overline{r_{2}{q_{0}}}{q_{1}}p_{1})\beta\mp\tilde{n}\beta\overline{{q_{0}}}}{p_{1}p_{2}}\right)\\\
\times\sum_{\beta({q_{0}})}e\left(\mp\frac{(\overline{\alpha_{1}p_{1}}-\overline{\alpha_{2}p_{2}})\beta\mp\tilde{n}\beta\overline{p_{1}p_{2}}}{{q_{0}}}\right)\widehat{\mathcal{W}}\left(\frac{\tilde{n}N}{p_{1}p_{2}{q_{0}}}\right)\\\
=N\sum_{\tilde{n}\in\mathbf{Z}}\delta_{\alpha_{2}\equiv\overline{\overline{\alpha_{1}}p_{2}\mp\tilde{n}}\,p_{1}\bmod{q_{0}}}\delta_{\tilde{n}\equiv\mp(\overline{r_{1}}p_{2}-\overline{r_{2}}p_{1}){q_{1}}\bmod{p_{1}p_{2}}}\widehat{\mathcal{W}}\left(\frac{\tilde{n}N}{p_{1}p_{2}{q_{0}}}\right).$

Here $\widehat{\mathcal{W}}$ denotes the Fourier transform of $\mathcal{W}$.
Plugging these calculations back, we find

$S(X)\ll|S(X)_{c=p}|+|S(X)_{c=q_{0}}|+\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N\bigg{(}\sum_{p_{1},p_{2}\in\mathrm{P}}\sum_{|r_{1}|,|r_{2}|\lesssim
ZPq/X}\widehat{K_{1}}(r_{1}\overline{{q_{0}}p_{1}})\\\
\times\overline{\widehat{K_{1}}(r_{2}\overline{{q_{0}}p_{2}})}\widehat{V}\left(\frac{r_{1}X}{p_{1}q}\right)\overline{\widehat{V}\left(\frac{r_{2}X}{p_{2}q}\right)}q_{0}^{1/2}\mathop{\sum_{\tilde{n}\in\mathbf{Z}}}_{\tilde{n}\equiv\mp(\overline{r_{1}}p_{2}-\overline{r_{2}}p_{1}){q_{1}}\bmod
p_{1}p_{2}}\mathfrak{C}_{\gamma,{q_{0}}}(\tilde{n})\widehat{\mathcal{W}}\left(\frac{\tilde{n}N}{p_{1}p_{2}{q_{0}}}\right)\bigg{)}^{1/2}$

with $\mathfrak{C}_{\gamma,{q_{0}}}(\tilde{n})$ the following correlation sum

(2.6)
$\begin{split}\mathfrak{C}_{\gamma,{q_{0}}}(\tilde{n}):=&\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((r_{1}-\alpha{q_{1}})\overline{{q_{1}}p_{1}})\overline{\widehat{K_{0}}((r_{2}-\overline{\bar{\alpha}p_{2}\mp\tilde{n}}\,p_{1}{q_{1}})\overline{{q_{1}}p_{2}})}\\\
=&\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((\overline{{q_{1}}}r_{1}-\alpha)\overline{p_{1}})\overline{\widehat{K_{0}}((\overline{{q_{1}}}r_{2}-\overline{\bar{\alpha}p_{2}\mp\tilde{n}}\,p_{1})\overline{p_{2}}))}.\end{split}$

######  Remark 2.3.

As can be expected, if the modulus $q=q_{0}q_{1}$ of $K(\cdot)$ admits further
factorisation, then it is possible to apply a $q$-analogue of van der Corput’s
argument to the $(r_{1},r_{2})$-sum to obtain further improvements of our
final result, cf. see also Remark 1.4.

We rewrite the inequality above into the form

(2.7)
$S(X)\ll|S(X)_{c=p}|+|S(X)_{c=q_{0}}|+S_{\text{dia}}(X)+S_{\text{off}}(X),$

where $S_{\text{dia}}(X)$ and $S_{\text{off}}(X)$ denote the terms
corresponding to $\tilde{n}=0$ and $\tilde{n}\neq 0$ respectively.

###  2.1. Contribution from the $\tilde{n}\not=0$ frequencies

Now we treat the term $S_{\text{off}}(X)$, corresponding to $\tilde{n}\neq 0$
in (2.7).

We consider two subcases: $\tilde{n}\not\equiv 0\bmod q_{0}$ and
$\tilde{n}\equiv 0\bmod q_{0}$ and denote their contribution to
$S_{\text{off}}(X)$ by $S_{\text{off},1}(X)$ and $S_{\text{off},2}(X)$,
respectively.

####  2.1.1. The case $\tilde{n}\not\equiv 0\bmod q_{0}$

By a change of variable, the correlation sum can be written

$\mathfrak{C}_{\gamma,{q_{0}}}(\tilde{n})=\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}(\gamma_{1}\cdot\alpha)\overline{\widehat{K_{0}}(\gamma_{2}\cdot\alpha)}=\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}(\alpha)\overline{\widehat{K_{0}}(\gamma_{2}.\gamma_{1}^{-1}\cdot\alpha)}+O(\frac{\|\widehat{K}_{0}\|_{\infty}^{2}}{q_{0}^{1/2}})$

where

$\gamma_{1}=\begin{pmatrix}-q_{1}&r_{1}\\\ 0&p_{1}q_{1}\end{pmatrix},\
\gamma_{2}=\begin{pmatrix}\mp\tilde{n}r_{2}-p_{1}q_{1}&p_{2}r_{2}\\\
\mp\tilde{n}p_{2}q_{1}&p_{2}^{2}q_{1}\end{pmatrix}\in\operatorname{GL}_{2}(\mathbf{F}_{q_{0}})$

and where we have set for

$\gamma=\begin{pmatrix}a&b\\\
c&d\end{pmatrix}\in\operatorname{GL}_{2}(\mathbf{F}_{q_{0}}),\
\gamma\cdot\alpha=\frac{a\alpha+b}{c\alpha+d}.$

If $\tilde{n}\not\equiv 0\,(\mathrm{mod}\,{q_{0}})$, the matrix
$\gamma_{2}.\gamma_{1}^{-1}$ is not a scalar matrix. Therefore, by our
assumption that the group of automorphisms of the Fourier transform sheaf
$\widehat{\mathcal{F}}$ is trivial and by [FKMS, Prop. 7.2], we obtain

(2.8)
$\mathfrak{C}_{\gamma,{q_{0}}}(\tilde{n})\ll_{C_{0}}1\quad\text{whenever}\,\,\tilde{n}\not\equiv
0\bmod q_{0}.$

It follows that

$S_{\text{off},1}(X)\ll\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\times\\\
\sup_{N\lesssim\frac{P^{2}{q_{0}}^{2}}{X}}N\bigg{(}q_{0}^{1/2}\sum_{p_{1},p_{2}\in\mathrm{P}}\sum_{0\neq|\tilde{n}|\lesssim
P^{2}{q_{0}}/N}\sum_{\stackrel{{\scriptstyle{\scriptstyle|r_{1}|\lesssim
ZPq/X}}}{{{\scriptstyle r_{1}\equiv\mp\overline{\tilde{n}}p_{2}q_{1}\bmod
p_{1}}}}}\sum_{\stackrel{{\scriptstyle{\scriptstyle|r_{2}|\lesssim
ZPq/X}}}{{{\scriptstyle r_{2}\equiv\pm\overline{\tilde{n}}p_{1}q_{1}\bmod
p_{2}}}}}\|\widehat{K_{1}}\|_{\infty}^{2}\bigg{)}^{1/2}$

which gives

$\begin{split}S_{\text{off},1}(X)\ll&\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N\bigg{(}q_{0}^{1/2}P^{2}\frac{P^{2}{q_{0}}}{N}\frac{Zq}{X}\frac{Zq}{X}\|\widehat{K_{1}}\|_{\infty}^{2}\bigg{)}^{1/2}\\\
\ll&\frac{\|\widehat{K_{1}}\|_{\infty}ZX^{1+o(1)}q^{1/2}}{P{q_{0}}^{5/4}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N^{1/2}\\\
\ll&\|\widehat{K_{1}}\|_{\infty}ZX^{1/2+o(1)}q^{1/2}{q_{0}}^{-1/4}.\end{split}$

####  2.1.2. The case $\tilde{n}\equiv 0\,(\mathrm{mod}\,{q_{0}})$

If $\tilde{n}\equiv 0\,(\mathrm{mod}\,{q_{0}})$ we have

(2.9)
$\mathfrak{C}_{\gamma,{q_{0}}}(0)=\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}(\alpha)\overline{\widehat{K_{0}}(\begin{pmatrix}p_{1}^{2}q_{1}&-(p_{1}r_{1}-p_{2}r_{2})\\\
0&p_{2}^{2}q_{1}\end{pmatrix}\cdot\alpha)}+O(\frac{\|\widehat{K}_{0}\|_{\infty}^{2}}{q_{0}^{1/2}}).$

The matrix $\begin{pmatrix}p_{1}^{2}q_{1}&-(p_{1}r_{1}-p_{2}r_{2})\\\
0&p_{2}^{2}q_{1}\end{pmatrix}$ is scalar if and only if

$p_{1}r_{1}-p_{2}r_{2}\equiv 0\,(\mathrm{mod}\,{q_{0}})\hbox{ and
}p_{1}\equiv\pm p_{2}\,(\mathrm{mod}\,{q_{0}}).$

Again, by our assumption that the group of automorphisms of the Fourier
transform sheaf $\widehat{\mathcal{F}}$ is trivial and by [FKMS, Prop. 7.2],
we obtain

(2.10)
$\mathfrak{C}_{\gamma,{q_{0}}}(0)\ll_{C_{0}}q_{0}^{1/2}\delta_{\begin{subarray}{c}r_{1}p_{1}\equiv
r_{2}p_{2}\,(\mathrm{mod}\,{q_{0}})\\\ p_{1}\equiv\pm
p_{2}\,(\mathrm{mod}\,{q_{0}})\end{subarray}}+1.$

Hence for the terms such that $\tilde{n}\equiv 0\bmod q_{0}$, we replace the
previous $\tilde{n}$ by $q_{0}\tilde{n}$ with $\tilde{n}\lesssim 1+P^{2}/N$
and apply the bound (2.10) to obtain

$\begin{split}S_{\text{off},2}(X)\ll&\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim\frac{P^{2}{q_{0}}^{2}}{X}}N\bigg{(}q_{0}^{1/2}\sum_{p_{1},p_{2}\in\mathrm{P}}\sum_{0<|\tilde{n}|\lesssim
1+P^{2}/N}\\\ &\ \ \
\times\sum_{\stackrel{{\scriptstyle{\scriptstyle|r_{1}|\lesssim
ZPq/X}}}{{{\scriptstyle r_{1}\equiv\mp\overline{q_{0}\tilde{n}}p_{2}q_{1}\bmod
p_{1}}}}}\sum_{\stackrel{{\scriptstyle{\scriptstyle|r_{2}|\lesssim
ZPq/X}}}{{{\scriptstyle r_{2}\equiv\pm\overline{q_{0}\tilde{n}}p_{1}q_{1}\bmod
p_{2}}}}}\|\widehat{K_{1}}\|_{\infty}^{2}\big{(}q_{0}^{1/2}\delta_{r_{1}p_{1}\equiv
r_{2}p_{2}\bmod{q_{0}}}+1\big{)}\bigg{)}^{1/2}\\\
\ll&\|\widehat{K_{1}}\|_{\infty}\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N\bigg{(}q_{0}^{1/2}P^{2}\big{(}1+\frac{P^{2}}{N}\big{)}\frac{Zq}{X}\frac{Zq}{X}\bigg{)}^{1/2}\\\
\ll&\|\widehat{K_{1}}\|_{\infty}ZX^{o(1)}\Bigl{(}q^{1/2}{q_{0}}^{1/4}+X^{1/2}q^{1/2}{q_{0}}^{-3/4}\Bigr{)}.\end{split}$

Combining the above estimates for $S_{\text{off},1}(X)$ and
$S_{\text{off},2}(X)$, we have therefore proved that the $\tilde{n}\not=0$
frequencies $S_{\text{dia}}(X)$ in (2.7) contribute at most

(2.11) $\begin{split}S_{\text{off}}(X)\ll
X^{o(1)}\|\widehat{K_{1}}\|_{\infty}\Bigl{(}ZX^{1/2}q^{1/2}{q_{0}}^{-1/4}+Zq^{1/2}{q_{0}}^{1/4}\Bigr{)}.\end{split}$

###  2.2. Contribution of the $\tilde{n}=0$ frequency

We recall that the $\tilde{n}=0$ frequency $S_{\text{dia}}(X)$ in (2.7) is
given by

$S_{\text{dia}}(X)=\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N\bigg{(}\sum_{p_{1},p_{2}\in\mathrm{P}}\sum_{|r_{1}|,|r_{2}|\lesssim
ZPq/X}\widehat{K_{1}}(r_{1}\overline{{q_{0}}p_{1}})\overline{\widehat{K_{1}}(r_{2}\overline{{q_{0}}p_{2}})}\\\
\times\widehat{V}\left(\frac{r_{1}X}{p_{1}q}\right)\overline{\widehat{V}\left(\frac{r_{2}X}{p_{2}q}\right)}\,q_{0}^{1/2}\mathfrak{C}_{\gamma,{q_{0}}}(0)\delta_{\overline{r_{1}}p_{2}\equiv\overline{r_{2}}p_{1}\bmod{p_{1}p_{2}}}\widehat{\mathcal{W}}\left(0\right)\bigg{)}^{1/2}$

The congruence condition
$\overline{r_{1}}p_{2}\equiv\overline{r_{2}}p_{1}\bmod p_{1}p_{2}$ implies
that

$p_{1}=p_{2}:=p\hbox{ and }r_{1}\equiv r_{2}\bmod p.$

Inserting $p_{1}=p_{2}$ into (2.9), the bound in (2.10) reads

$\mathfrak{C}_{\gamma,{q_{0}}}(0)\ll_{C_{0}}q_{0}^{1/2}\delta_{r_{1}\equiv
r_{2}\,(\mathrm{mod}\,{q_{0}})}+1.$

It follows that

(2.12)
$\begin{split}S_{\text{dia}}(X)\ll_{C_{0}}&\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{2}q^{1/2}}\sup_{N\lesssim
P^{2}{q_{0}}^{2}/X}N\bigg{(}q_{0}^{1/2}\sum_{p\in\mathrm{P}}\sum_{|r_{1}|,|r_{2}|\lesssim
ZPq/X}\|\widehat{K_{1}}\|_{\infty}^{2}\\\
&\times\big{(}q_{0}^{1/2}\delta_{r_{1}\equiv
r_{2}\bmod{q_{0}}}+1\big{)}\delta_{r_{1}\equiv r_{2}\bmod p}\bigg{)}^{1/2}\\\
\ll_{C_{0}}&\|\widehat{K_{1}}\|_{\infty}\frac{X^{2+o(1)}}{P^{3}{q_{0}}^{7/4}q^{1/2}}\frac{P^{2}{q_{0}}^{2}}{X}\bigg{(}\sum_{p\in\mathrm{P}}\sum_{|r_{1}|,|r_{2}|\lesssim
ZPq/X}q_{0}^{1/2}\delta_{r_{1}\equiv r_{2}\bmod{pq_{0}}}\\\
&+\sum_{p\in\mathrm{P}}\sum_{|r_{1}|,|r_{2}|\lesssim ZPq/X}\delta_{r_{1}\equiv
r_{2}\bmod p}\bigg{)}^{1/2}\\\
\ll_{C_{0}}&\|\widehat{K_{1}}\|_{\infty}\frac{X^{1+o(1)}{q_{0}}^{1/4}}{Pq^{1/2}}\bigg{(}\frac{Z^{1/2}Pq^{1/2}{q_{0}}^{1/4}}{X^{1/2}}+\frac{ZPq}{X}\bigg{)}\\\
\ll_{C_{0}}&\|\widehat{K_{1}}\|_{\infty}Z^{1/2}X^{1/2+o(1)}q_{0}^{1/2}+\|\widehat{K_{1}}\|_{\infty}X^{o(1)}Zq^{1/2}{q_{0}}^{1/4}.\end{split}$

In the above we have applied the fact that when $r_{1}\equiv
r_{2}\,(\mathrm{mod}\,{pq_{0}})$ then $r_{1}=r_{2}$, as we have (or we will)
assume

$Zq<Xq_{0}.$

###  2.3. Error terms: treatment of $S(X)_{c=p}$ and $S(X)_{c=q_{0}}$

Recall that in (2.5) $S(X)_{c=p}$ is defined by

(2.13) $\begin{split}S(X)_{c=p}=&\frac{X}{|{\rm
P}|q_{0}}\sum_{\pm}\sum_{p\in\rm
P}\frac{1}{p^{2}}\sideset{}{{}^{\star}}{\sum}_{\alpha(p)}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}e\left(\frac{\mp\bar{\alpha}n}{p}\right)\widehat{W}^{\pm}\left(\frac{n}{p^{2}/X}\right)\times\frac{X}{q^{1/2}}\underset{\begin{subarray}{c}|r|\lesssim
Zpq/X\\\ r-\alpha q\equiv 0\bmod
p\end{subarray}}{\sum}\widehat{K}(r\bar{p};q)\widehat{V}\left(\frac{rX}{pq}\right)\\\
=&\frac{X^{2}}{|{\rm P}|q_{0}q^{1/2}}\sum_{\pm}\sum_{p\in\rm
P}\frac{1}{p^{2}}\sum_{|r|\lesssim
Zpq/X}\widehat{K}(r\bar{p};q)\widehat{V}\left(\frac{rX}{pq}\right)\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}e\left(\frac{\mp
q\bar{r}n}{p}\right)\widehat{W}^{\pm}\left(\frac{n}{p^{2}/X}\right).\end{split}$

If we apply summation by parts and the Wilton-type bound ([Iwaniec-Spec, Thm.
8.1]) to the $n$-sum, we get

(2.14)
$\begin{split}|S(X)_{c=p}|\ll&\frac{X^{2+o(1)}}{Pq_{0}q^{1/2}}\frac{1}{P}\frac{ZPq}{X}\|\widehat{K}\|_{\infty}\big{(}\frac{P^{2}}{X}\big{)}^{1/2}\ll\frac{\|\widehat{K}\|_{\infty}ZX^{1/2+o(1)}q^{1/2}}{q_{0}}.\end{split}$

Likewise, $S(X)_{c=q_{0}}$ is given by

(2.15) $\begin{split}S(X)_{c=q_{0}}=&\frac{X}{|{\rm
P}|{q_{0}}^{2}}\sum_{\pm}\sum_{p\in\rm
P}\frac{1}{p}\sideset{}{{}^{\star}}{\sum}_{\alpha(q_{0})}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}e\left(\frac{\mp\bar{\alpha}n}{q_{0}}\right)\widehat{W}^{\pm}\left(\frac{n}{{q_{0}}^{2}/X}\right)\\\
&\quad\quad\quad\times\frac{X}{q^{1/2}}\sum_{|r|\lesssim
Zq/X}\widehat{K}(r-\alpha q_{1};q)\widehat{V}\left(\frac{rX}{q}\right)\\\
=&\frac{X^{2}}{|{\rm P}|{q_{0}}^{3/2}q^{1/2}}\sum_{\pm}\sum_{p\in\rm
P}\frac{1}{p}\sum_{n=1}^{\infty}\overline{\lambda_{f}(n)}\widehat{W}^{\pm}\left(\frac{n}{{q_{0}}^{2}/X}\right)\\\
&\quad\quad\quad\times\sum_{|r|\lesssim
Zq/X}\widehat{K_{1}}(r\overline{q_{0}})\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha(q_{0})}\widehat{K_{0}}((r-\alpha
q_{1})\overline{q_{1}})e\left(\frac{\mp\bar{\alpha}n}{q_{0}}\right)\widehat{V}\left(\frac{rX}{q}\right).\end{split}$

Here we have made use of the twisted multiplicativity (2.1). Concerning the
$\alpha$-sum we have

(2.16)
$\frac{1}{q_{0}^{1/2}}\sideset{}{{}^{\star}}{\sum}_{\alpha({q_{0}})}\widehat{K_{0}}((r-\alpha{q_{1}})\overline{{q_{1}}})e\left(\frac{\mp\bar{\alpha}n}{{q_{0}}}\right)=\frac{1}{q_{0}^{1/2}}\sum_{x({q_{0}})}K_{0}(x)e\left(\frac{r\overline{{q_{1}}}x}{{q_{0}}}\right)\mathrm{Kl}_{2}(\pm
nx;{q_{0}})\ll_{C_{0}}1.$

That follows from [LMS, Lem. 8.1] and our assumption that the sheaf
$\mathcal{F}$ associated to $K_{0}$ satisfies the (MO) condition.

Therefore we obtain

(2.17)
$\begin{split}|S(X)_{c=q_{0}}|\ll\|\widehat{K_{1}}\|_{\infty}\frac{X^{2+o(1)}}{P{q_{0}}^{3/2}q^{1/2}}\frac{{q_{0}}^{2}}{X}\frac{Zq}{X}\ll\|\widehat{K_{1}}\|_{\infty}X^{o(1)}\frac{Zq_{0}^{1/2}q^{1/2}}{P}.\end{split}$

###  2.4. Bounding $S(X)$: Conclusion

Plugging the bounds in (2.11) and (2.12) for $S_{\text{off}}(X)$ and
$S_{\text{dia}}(X)$ into (2.7), we eventually obtain that

$\begin{split}S(X)\ll&\|\widehat{K_{1}}\|_{\infty}Z^{1/2}X^{1/2+o(1)}q_{0}^{1/2}+\|\widehat{K_{1}}\|_{\infty}ZX^{1/2+o(1)}q^{1/2}{q_{0}}^{-1/4}\\\
&\quad\quad\quad\quad\quad\quad+\|\widehat{K_{1}}\|_{\infty}ZX^{o(1)}q^{1/2}{q_{0}}^{1/4}+|S(X)_{c=p}|+|S(X)_{c=q_{0}}|\\\
\ll&\|\widehat{K_{1}}\|_{\infty}X^{o(1)}\Bigl{(}Z^{1/2}X^{1/2}q_{0}^{1/2}+ZX^{1/2}q^{1/2}{q_{0}}^{-1/4}\\\
&\quad\quad\quad\quad\quad\quad\quad\quad+Zq^{1/2}{q_{0}}^{1/4}+\frac{ZX^{1/2}q^{1/2}}{q_{0}}+\frac{Zq_{0}^{1/2}q^{1/2}}{P}\Bigr{)}\end{split}$

upon inserting the bounds (2.14) and (2.17) for
$|S(X)_{c=p}|+|S(X)_{c=q_{0}}|$. To satisfy (2.3), one needs

$p{q_{0}}\gg X$

which can be met by taking $P$ ($<q^{A}$) large enough.

######  Remark 2.4.

(1) The parameter $P$ does not play an essential role in the final bounds (cf.
see also [AHLQ]).

(2) Similar results can also be proved using an amplified second moment
approach as in [Bykovskii] and [FKM1].

##  3\. Proof of Corollary 1.8

In this section we show how to derive Corollary 1.8 from Theorem 1.6.

Let $q=q_{0}q_{1}$ be a product of two primes as above. We apply the duality
principle [LMS, Cor. 9.2] to the sum

$S_{V}(K;X)=\sum_{n|r|\geqslant
1}\lambda_{\varphi}(n,r)\lambda_{f}(n)K(nr^{2})V\left(\frac{nr^{2}}{X}\right)$

where

$K(n)=q^{1/2}\delta_{n\equiv a\bmod q}.$

Setting
$\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{X}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{X}{\scalebox{-1.0}{\tmpbox}}=q^{6}/X$,
this gives (up to negligible error terms)

$q^{-1/2}S_{V}(K;X)=\frac{X}{q^{7/2}}\sum_{r|n|\geqslant
1}\lambda_{\varphi}(r,n)\lambda_{f}(n)\mathrm{Kl}_{6}(anr^{2};q)\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{V}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{V}{\scalebox{-1.0}{\tmpbox}}\left(\frac{r^{2}n}{\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{X}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{X}{\scalebox{-1.0}{\tmpbox}}}\right).$

By the Chinese Remainder Theorem we have

$\operatorname{\mathrm{Kl}}_{6}(n;q_{0}q_{1})=\operatorname{\mathrm{Kl}}_{6}(\overline{q}_{1}^{6}n;q_{0})\operatorname{\mathrm{Kl}}_{6}(\overline{q}_{0}^{6}n;q_{1})$

and the hyper-Kloosterman sum
$\operatorname{\mathrm{Kl}}_{6}(\overline{q}_{1}^{6}n;q_{0})$ is the trace
function attached to the hyper-Kloosterman sheaf
$[\times\overline{q}_{1}^{6}]^{*}\mathcal{K}\ell_{6}$ which is “good” in the
sense of [LMS]. Applying Theorem 1.6 we obtain

$\begin{split}\sum_{\stackrel{{\scriptstyle{\scriptstyle n,|r|\geqslant
1}}}{{{\scriptstyle nr^{2}\equiv a\bmod
q}}}}\lambda_{\varphi}(n,r)\lambda_{f}(n)V\left(\frac{nr^{2}}{X}\right)\ll&X^{o(1)}\frac{X}{q^{7/2}}\left(\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{X}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{X}{\scalebox{-1.0}{\tmpbox}}^{3/4}q^{3/5}+\savestack{\tmpbox}{\stretchto{\scaleto{\scalerel*[\widthof{X}]{\kern-0.4pt\bigwedge\kern-0.4pt}{\rule[-505.89pt]{4.30554pt}{505.89pt}}}{}}{0.5ex}}\stackon[2pt]{X}{\scalebox{-1.0}{\tmpbox}}q^{-1/5}\right)\\\
=&X^{o(1)}\left(X^{1/4}q^{8/5}+q^{23/10}\right)\leqslant(X/q)^{1-\delta}\end{split}$

for some $\delta>0$ as long as

$q\leqslant X^{15/52-\eta}=X^{\theta_{6}+1/364-\eta}$

for some $\eta>0$ (here $\theta_{6}=2/7$ cf. (1.9)).

##  4\. Proof of Theorem 1.6

In this section, we give a detailed proof for Theorem 1.6, following the same
approach as in [LMS]. The proof will be very similar to the one presented in
[LMS], the chief difference being in the choice of the parameter when the
delta method is applied. Since that paper contains almost all the necessary
technical details (corresponding to the case $q_{0}=q$) we will be brief here
(with some simplifications) and refer the readers to [LMS] for the relevant
details (see also [Sun-Yu] where the case $K=\chi$ a multiplicative character
is treated).

###  4.1. First transformations

From now on we assume that $Z$ satisfies $1\leqslant Z\leqslant q$ and
$V\in\mathcal{C}^{\infty}_{c}(\mathbf{R})$ satisfying the bound (1.11). As in
[LMS], we write

(4.1)
$S^{t}_{V}(K,X):=\sum_{r,n}\lambda(r,n)\lambda_{f}(n)K(nr^{2})V\left(\frac{nr^{2}}{X}\right)=\sum_{|r|\leqslant
R}S_{V,r}(K,X/r^{2})+X^{o(1)}R^{\theta_{3}}X/R,$

where

(4.2)
$S_{V,r}(K,X):=\sum_{n=1}^{\infty}\lambda(r,n)\lambda_{f}(n)K(nr^{2})V\left(\frac{n}{X}\right)$

and $R$ satisfying $R<q$ is some parameter to be determined later (see
(4.29)). In the above $\theta_{3}=5/14$ is the Kim–Sarnak bound towards the
Ramanujan–Petersson conjecture on $\operatorname{GL}_{3}$. For each fixed $r$
with $r\leqslant R$ we can write $S_{V,r}(K,X)$ as

(4.3)
$S_{V,r}(K,X)=\sum_{n=1}^{\infty}\lambda(r,n)\sum_{m=1}^{\infty}\lambda_{f}(m)K(mr^{2})\delta_{n=m}U\left(\frac{n}{X}\right)V\left(\frac{m}{X}\right).$

Here $U$ is a smooth function supported in $(1/100,100)$ and satisfying
$U^{(j)}(x)\ll_{j}1$ for $j\geqslant 0$ and $U(x)=1$ for $x\in[1,2]$.

Let $C=(X/q_{0})^{1/2}$. We apply a version of the Duke–Friedlander–Iwaniec
delta method ([DFI1.5])

$\displaystyle\delta_{n=0}$ $\displaystyle=$
$\displaystyle\frac{1}{C}\sum_{\stackrel{{\scriptstyle{\scriptstyle c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c{q_{0}}}\sideset{}{{}^{\star}}{\sum}_{u(c{q_{0}})}e\left(n\frac{u}{c{q_{0}}}\right)h\left(\frac{c}{C},\frac{n}{C^{2}{q_{0}}}\right)$
$\displaystyle+$
$\displaystyle\frac{1}{C}\sum_{\stackrel{{\scriptstyle{\scriptstyle c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c{q_{0}}}\sideset{}{{}^{\star}}{\sum}_{a(c)}e\left(n\frac{a}{c}\right)h\left(\frac{c}{C},\frac{n}{C^{2}{q_{0}}}\right)$
$\displaystyle+$ $\displaystyle\frac{1}{C}\sum_{c\leqslant
2C/q}\frac{1}{cq{q_{0}}}\sideset{}{{}^{\star}}{\sum}_{a(cq{q_{0}})}e\left(n\frac{a}{cq{q_{0}}}\right)h\left(\frac{cq}{C},\frac{n}{C^{2}{q_{0}}}\right)+O_{A}\left(C^{-A}\right)$

as presented in [HB, Thm. 1] and [LMS, (3.7)] (see also [Sun-Yu, Lem. 2] for a
similar version), to the difference $n-m$ in (4.3) and obtain

(4.4)
$S_{V,r}(K,X)=\mathrm{Main}+\mathrm{Err}_{1}+\mathrm{Err}_{2}+O_{A}\left(X^{-A}\right)$

where

(4.5)
$\mathrm{Main}=\frac{1}{Cq_{0}}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sideset{}{{}^{\star}}{\sum}_{u(cq_{0})}\sum_{n=1}^{\infty}\lambda(r,n)e\left(\frac{un}{cq_{0}}\right)U\left(\frac{n}{X}\right)\\\
\times\sum_{m=1}^{\infty}\lambda_{f}(m)K(mr^{2})e\left(\frac{-um}{cq_{0}}\right)V\left(\frac{m}{X}\right)h\left(\frac{c}{C},\frac{n-m}{C^{2}q_{0}}\right),$

and

(4.6)
$\mathrm{Err}_{1}=\frac{1}{Cq_{0}}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sideset{}{{}^{\star}}{\sum}_{a(c)}\sum_{n=1}^{\infty}\lambda(r,n)e\left(\frac{an}{c}\right)U\left(\frac{n}{X}\right)\\\
\times\sum_{m=1}^{\infty}\lambda_{f}(m)K(mr^{2})e\left(\frac{-am}{c}\right)V\left(\frac{m}{X}\right)h\left(\frac{c}{C},\frac{n-m}{C^{2}q_{0}}\right),$
(4.7)
$\mathrm{Err}_{2}=\frac{1}{Cq{q_{0}}}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C/q}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sideset{}{{}^{\star}}{\sum}_{a(cqq_{0})}\sum_{n=1}^{\infty}\lambda(r,n)e\left(\frac{an}{cqq_{0}}\right)U\left(\frac{n}{X}\right)\\\
\times\sum_{m=1}^{\infty}\lambda_{f}(m)K(mr^{2})e\left(\frac{-am}{cqq_{0}}\right)V\left(\frac{m}{X}\right)h\left(\frac{cq}{C},\frac{n-m}{C^{2}{q_{0}}}\right).$

In the following, we focus our analysis on the term $\mathrm{Main}$ in (4.5)
which is the hardest and is responsible for the final bound. The treatment for
the terms $\mathrm{Err}_{1},\mathrm{Err}_{2}$ are almost identical to the one
presented in [LMS, §7.1], and just as in [LMS] their contribution turns out to
be smaller as compared to that of $\mathrm{Main}$. As such we completely skip
their treatments here and the reader is referred to [LMS, §7.1] for the
details.

####  4.1.1. Bounding $\mathrm{Main}$

To prepare for the application of Voronoi summation formula to the $m$-sum in
(4.5) we write

$K(mr^{2})=\frac{1}{q^{1/2}}\sum_{b\bmod
q}\widehat{K}(b)e(\frac{-bmr^{2}}{q})=\frac{1}{q^{1/2}}\sum_{b\bmod
q}\widehat{K}(b)e(\frac{-bcr^{2}m}{cq}),$

where $\widehat{K}(b)=\widehat{K}(b;q)$ denotes the Fourier transform of $K$;
see (1.10).

We find that the term in (4.5) can be rewritten as

(4.8)
$\mathrm{Main}=\frac{1}{Cq_{0}}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sideset{}{{}^{\star}}{\sum}_{u(cq_{0})}\sum_{n=1}^{\infty}\lambda(r,n)e\left(\frac{un}{cq_{0}}\right)U\left(\frac{n}{X}\right)\\\
\times\frac{1}{q^{1/2}}\sum_{b\bmod
q}\widehat{K}(b)\sum_{m=1}^{\infty}\lambda_{f}(m)e\left(\frac{-(bcr^{2}+uq_{1})m}{cq}\right)V\left(\frac{m}{X}\right)h\left(\frac{c}{C},\frac{n-m}{C^{2}q_{0}}\right).$

We can further assume that $(bcr^{2}+uq_{1},cq)=1$, as otherwise we would have
$(bcr^{2}+uq_{1},q)\geqslant q_{1}$ and the contribution from the latter case
can be seen to be much smaller (see [LMS, §3.1]).

Under $(bcr^{2}+uq_{1},cq)=1$, we now apply Voronoi summation to the $m$-sum
in (4.8), to get

(4.9)
$\mathrm{Main}=\frac{X}{Cq_{0}q}\sum_{\pm}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c^{2}}\frac{1}{q^{1/2}}\sideset{}{{}^{\star}}{\mathop{\sum\sum}\limits}_{\stackrel{{\scriptstyle{\scriptstyle
b(q),u(cq_{0})}}}{{{\scriptstyle(bcr^{2}+uq_{1},cq)=1}}}}\widehat{K}(b)\\\
\times\sum_{m=1}^{\infty}\overline{\lambda_{f}(m)}e(\frac{\pm\overline{bcr^{2}+uq_{1}}m}{cq})\sum_{n=1}^{\infty}\lambda(r,n)e\left(\frac{un}{cq_{0}}\right)U\left(\frac{n}{X}\right)\widehat{\mathcal{V}}^{\pm}\left(n,\frac{mX}{c^{2}q^{2}}\right)+O\left(X^{-A}\right),$

where $\widehat{\mathcal{V}}^{\pm}\left(n,y\right)$ is given as in [LMS,
(3.16)].

Next, we further apply Voronoi summation ([LMS, Prop. 2.2]) to the $n$-sum
above to obtain a sum of the form

(4.10)
$\frac{Xq_{0}^{1/2}}{Cq}\sum_{\pm\pm}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sum_{n_{1}|rcq_{0}}\sum_{m,n}\overline{\lambda_{f}(m)}\frac{\lambda(n,n_{1})}{nn_{1}}\mathcal{C}(m,n;\frac{rcq_{0}}{n_{1}})\mathcal{W}_{\pm\pm}(\frac{m}{c^{2}q^{2}/X},\frac{n_{1}^{2}n}{c^{3}q^{3}_{0}r/X})$

where

$\mathcal{C}(m,n;\frac{rcq_{0}}{n_{1}})=\frac{1}{(qq_{0})^{1/2}}\sideset{}{{}^{\star}}{\mathop{\sum\sum}\limits}_{\stackrel{{\scriptstyle{\scriptstyle
b(q),u(cq_{0})}}}{{{\scriptstyle(bcr^{2}+uq_{1},cq)=1}}}}\widehat{K}(b)e(\frac{\pm\overline{bcr^{2}+uq_{1}}m}{cq})S(r\overline{u},\pm
n;\frac{rcq_{0}}{n_{1}})$

and

$\begin{split}\mathcal{W}_{\pm\pm}(y,z)&=\int_{\mathbb{R}}V(x)\mathcal{W}_{x,\pm}(z)\mathcal{J}^{\pm}_{f}(4\pi\sqrt{xy}){\mathrm{d}x}\\\
=&z\int_{\mathbb{R}}V(x)\bigl{(}\int_{0}^{\infty}W_{x}(\xi)J_{\varphi,\pm}(z\xi){\mathrm{d}\xi}\bigr{)}\,\mathcal{J}^{\pm}_{f}(4\pi\sqrt{xy}){\mathrm{d}x};\end{split}$

see [LMS, (3.19)]. Here

$W_{x}(\xi):=U(\xi)h\left(\frac{c}{C},\frac{X(\xi-x)}{C^{2}{q_{0}}}\right).$

In particular, for $z\ll 1$ we have

(4.11) $\mathcal{W}_{\pm\pm}(y,z)\ll z^{1/2}.$

###  4.2. The case $q_{0}\not|n_{1}$

For the sum in (4.10), we further split it into two subsums according to
$(n_{1},q_{0})=1$ or not, and write

$\mathrm{Main}=\mathrm{Main}_{00}+\mathrm{Err}_{4}+O\left(X^{-A}\right),$

where

(4.12)
$\mathrm{Main}_{00}=\frac{Xq_{0}^{1/2}}{Cq}\sum_{\pm\pm}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sum_{\stackrel{{\scriptstyle{\scriptstyle
n_{1}|rc}}}{{{\scriptstyle(n_{1},q_{0})=1}}}}\sum_{m,n}\overline{\lambda_{f}(m)}\\\
\times\frac{\lambda(n,n_{1})}{nn_{1}}\mathcal{C}(m,n;\frac{rcq_{0}}{n_{1}})\mathcal{W}_{\pm\pm}(\frac{m}{c^{2}q^{2}/X},\frac{n_{1}^{2}n}{c^{3}q^{3}_{0}r/X})$

and $\mathrm{Err}_{4}$ corresponds to the complementary sum where
$q_{0}|n_{1}$, whose contribution is given in (4.28) (see [LMS, §6.3]).

We have (since $(c,q)=1$)

$e(\frac{\pm\overline{bcr^{2}+uq_{1}}m}{cq})=e(\frac{\pm\overline{bcr^{2}+uq_{1}}\overline{c}m}{q})e(\frac{\pm\overline{uq_{1}}\overline{q}m}{c})$
$S(r\overline{u},\pm
n;\frac{rcq_{0}}{n_{1}})=S(\overline{c}n_{1}\overline{u},\pm\overline{rc}n_{1}n;{q_{0}})S(\overline{q_{0}}r\overline{u},\pm\overline{q_{0}}n;{rc}/n_{1}).$

Therefore, the $(b,u)$-sum in $\mathcal{C}(m,n;\frac{rcq_{0}}{n_{1}})$ splits
into a product of two sums of respective moduli $rc/n_{1}$ and $q_{0}$.
Accordingly, we write

$\mathcal{C}(m,n;\frac{rcq_{0}}{n_{1}})=M_{n_{1},r}(m,n;rc)N_{\overline{cr}}(m,n)$

where

$M_{n_{1},r}(m,n;rc):=\sideset{}{{}^{\star}}{\sum}_{u(c)}e(\frac{\pm\overline{uq^{2}_{1}}\overline{q_{0}}m}{c})S(\overline{q_{0}}r\overline{u},\pm\overline{q_{0}}n;{rc}/n_{1}),$

and

(4.13)
$N_{\overline{cr}}(m,n):=\frac{1}{(qq_{0})^{1/2}}\sideset{}{{}^{\star}}{\mathop{\sum\sum}\limits}_{\stackrel{{\scriptstyle{\scriptstyle
b(q),u(q_{0})}}}{{{\scriptstyle(bcr^{2}+uq_{1},q)=1}}}}\widehat{K}(b)e(\frac{\pm\overline{bcr^{2}+uq_{1}}\overline{c}m}{q})S(\overline{c}n_{1}\overline{u},\pm\overline{rc}n_{1}n;{q_{0}})\\\
=\frac{1}{q^{1/2}}\sideset{}{{}^{\star}}{\mathop{\sum\sum}\limits}_{\stackrel{{\scriptstyle{\scriptstyle
b(q),u(q_{0})}}}{{{\scriptstyle(b+uq_{1},q)=1}}}}\widehat{K}(b)e(\frac{\pm\overline{c}^{2}\overline{r}^{2}m\overline{b+uq_{1}}}{q})\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2}n\overline{u};{q_{0}})\\\
=\sideset{}{{}^{\star}}{\sum}_{u(q_{0})}L_{\pm\overline{c}^{2}\overline{r}^{2}m,1}(uq_{1};q)\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2}n\overline{u};{q_{0}})$

with

(4.14)
$L_{\alpha,\beta}(u;q):=\frac{1}{q^{1/2}}\sum_{\stackrel{{\scriptstyle{\scriptstyle
b(q)}}}{{{\scriptstyle(b+\beta
u,q)=1}}}}\widehat{K}(b)e\left(\frac{\alpha\,\overline{b+\beta u}}{q}\right).$

From these notations we find that the sum $\mathrm{Main}_{00}$ in (4.12) is
equal to

$\mathrm{Main}_{00}=\frac{Xq_{0}^{1/2}}{Cq}\sum_{\pm\pm}\sum_{\stackrel{{\scriptstyle{\scriptstyle
c\leqslant
2C}}}{{{\scriptstyle(c,q)=1}}}}\frac{1}{c}\sum_{\stackrel{{\scriptstyle{\scriptstyle
n_{1}|rc}}}{{{\scriptstyle(n_{1},q_{0})=1}}}}\sum_{m,n}\overline{\lambda_{f}(m)}\frac{\lambda(n,n_{1})}{nn_{1}}\times\\\
M_{n_{1},r}(m,n;rc)N_{\overline{cr}}(m,n)\mathcal{W}_{\pm\pm}(\frac{m}{c^{2}q^{2}/X},\frac{n_{1}^{2}n}{c^{3}q^{3}_{0}r/X}).$

We break the $c$-sum into $O(\log X)$ many dyadic intervals with $c\sim
C^{\prime}$, where $C^{\prime}$ satisfies

$C^{\prime}\leqslant 2C=2(X/{q_{0}})^{1/2}.$

By [LMS, Lem. 3.3] we know that the $(m,n)$-sum can be truncated at

(4.15) $m\lesssim
M=Z^{2}\frac{{C^{\prime}}^{2}q^{2}}{X},nn^{2}_{1}\lesssim\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}.$

For each fixed $n_{1}$ we break the $n$-sum into $O(\log q)$ dyadic intervals
$n\sim N/n^{2}_{1}$ with $N$ satisfying

$N\lesssim\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}.$

Now for each $c\sim C^{\prime}$ and $nn^{2}_{1}\sim N$ we will evaluate the
truncated version of $\mathrm{Main}_{00}$.

####  4.2.1. Cauchy–Schwarz

We now factor $c=c_{1}c_{2}$ with

$c_{1}\leqslant C^{\prime},\ {n_{1}|rc_{1}},\ c_{1}|(n_{1}r)^{\infty}\hbox{
and }(c_{2},n_{1}r)=1.$

Then we apply Cauchy–Schwarz inequality and the Rankin–Selberg estimate to
bound the sum $\mathrm{Main}_{00}$ as follows (for the various choices of
$\pm,\pm$)

(4.16) $\mathrm{Main}_{00}\ll
X^{o(1)}\frac{Xq_{0}^{1/2}}{CqC^{\prime}}\sup_{N\lesssim\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}}\frac{1}{N^{1/2}}B(N)^{1/2}$

with

$B(N):=\mathop{\sum\sum}\limits_{\stackrel{{\scriptstyle{\scriptstyle
c_{1},nn_{1}^{2}\approx
N}}}{{{\scriptstyle(n_{1},q_{0})=1}}}}n_{1}\biggl{|}\sum_{m\leqslant
M}\overline{\lambda_{f}(m)}\\\
\times\sum_{\stackrel{{\scriptstyle{\scriptstyle c_{2}\sim
C^{\prime}/c_{1}}}}{{{\scriptstyle(c_{2},q)=1}}}}M_{n_{1},r}(m,n;rc_{1}c_{2})N_{\overline{c_{1}c_{2}r}}(m,n)\mathcal{W}_{\pm\pm}(\frac{m}{c_{1}^{2}c_{2}^{2}q^{2}/X},\frac{n_{1}^{2}n}{c_{1}^{3}c_{2}^{3}q^{3}_{0}r/X})\biggr{|}^{2}U\left(\frac{n}{N/n^{2}_{1}}\right).$

Here $U$ is a smooth function with compact support contained in $(0,\infty)$
satisfying $U^{(j)}(x)\ll_{j}1$ for $j\geqslant 0$.

After opening the square, the factor $B(N)$ equals

(4.17) $\displaystyle
B(N)=\mathop{\sum\sum}\limits_{c_{1},n_{1}}n_{1}\mathop{\sum\sum}\limits_{m,m^{\prime}}\overline{\lambda_{f}(m)}\lambda_{f}(m^{\prime})\mathop{\sum\sum}\limits_{c_{2},c_{2}^{\prime}}\times$
(4.18) $\displaystyle\sum_{n\geqslant
1}M_{n_{1},r}(m,n;rc_{1}c_{2})\overline{M_{n_{1},r}(m^{\prime},n;rc_{1}c^{\prime}_{2})}$
$\displaystyle\times
N_{\overline{c_{1}c_{2}r}}(m,n)\overline{N_{\overline{c_{1}c^{\prime}_{2}r}}(m^{\prime},n)}\mathcal{W}\left(\frac{n}{N/n^{2}_{1}}\right),$

where

$\mathcal{W}\left(\frac{n}{N/n^{2}_{1}}\right)=U\left(\frac{n}{N/n^{2}_{1}}\right)\mathcal{W}_{\pm\pm}(\frac{m}{c^{2}_{1}c^{2}_{2}q^{2}/X},\frac{n_{1}^{2}n}{c^{3}_{1}c^{3}_{2}q^{3}_{0}r/X})\overline{\mathcal{W}_{\pm\pm}}(\frac{m^{\prime}}{c^{2}_{1}{c^{\prime}_{2}}^{2}q^{2}/X},\frac{n_{1}^{2}n}{c^{3}_{1}{c^{\prime}_{2}}^{3}q^{3}_{0}r/X}).$

We apply Poisson formula to the $n$-variable keeping in mind that

$n\mapsto
M_{n_{1},r}(m,n;rc_{1}c_{2})\overline{M_{n_{1},r}(m^{\prime},n;rc_{1}c^{\prime}_{2})}N_{\overline{c_{1}c_{2}r}}(m,n)\overline{N_{\overline{c_{1}c^{\prime}_{2}r}}(m^{\prime},n)}$

is periodic of period $q_{0}rc_{1}c_{2}c_{2}^{\prime}/n_{1}:=q_{0}k$, and see
that (4.17) equals

(4.19)
$\mathop{\sum\sum}\limits_{c_{1},n_{1}}n_{1}\mathop{\sum\sum}\limits_{m,m^{\prime}}\overline{\lambda_{f}(m)}\lambda_{f}(m^{\prime})\mathop{\sum\sum}\limits_{c_{2},c_{2}^{\prime}}\frac{N}{n^{2}_{1}\sqrt{q_{0}k}}\sum_{n\in\mathbf{Z}}\mathrm{FT}(n,m,m^{\prime};q_{0}k)\widehat{\mathcal{W}}(n/N^{*}),$

where (after inserting (4.13))

$\mathrm{FT}(n,m,m^{\prime};q_{0}k)=\mathop{\sum\sum}\limits_{u,u^{\prime}\bmod{q_{0}}}L_{\pm\overline{c}^{2}\overline{r}^{2}m,1}(uq_{1};q)\overline{L_{\pm\overline{c^{\prime}}^{2}\overline{r}^{2}m^{\prime},1}(u^{\prime}q_{1};q)}\times\\\
\frac{1}{\sqrt{q_{0}k}}\sum_{v\bmod{q_{0}k}}\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u};{q_{0}})\overline{\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c^{\prime}}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u^{\prime}};{q_{0}})}M_{n_{1},r}(m,v;rc)\overline{M_{n_{1},r}(m^{\prime},v;rc^{\prime})}\,e\left(\frac{nv}{q_{0}k}\right)$

(with $c=c_{1}c_{2}$ and $c^{\prime}=c_{1}c^{\prime}_{2}$) and

(4.20) $N^{*}:=q_{0}kn_{1}^{2}/N.$

Here due to the rapid decay of the weight function $\widehat{\mathcal{W}}(y)$
when $|y|\gg q^{\varepsilon}$, we can truncate the dual $n$-sum in (4.19) at
$|n|\ll q^{\varepsilon}N^{*}$. By using the estimate (4.11) and the truncation
in (4.15), for $|n|\ll q^{\varepsilon}N^{*}$, we readily have the bound (see
for instance [Lin, (27)])

(4.21)
$\widehat{\mathcal{W}}(n/N^{*})\ll\frac{N}{{C^{\prime}}^{3}q^{3}_{0}r/X}.$

####  4.2.2. Computation of $\mathrm{FT}$

Recall $k=rc_{1}c_{2}c^{\prime}_{2}/n_{1}$. We have $(q_{0},k)=1$ and we split
the sum $\mathrm{FT}(n,m,m^{\prime};q_{0}k)$ in the above as a product of sums
$\mathrm{FT}(n)$ and $\mathrm{FT}(n;k)$ of respective moduli $q_{0}$ and $k$
(to simplify notations we do not display the dependency in $m,m^{\prime}$ in
these expressions).

####  4.2.3. The $k$-sum

The $k$-sum equals

$\mathrm{FT}(n;k):=\frac{1}{\sqrt{k}}\sum_{v(k)}M_{n_{1},r}(m,v;rc_{1}c_{2})\overline{M_{n_{1},r}(m^{\prime},v;rc_{1}c^{\prime}_{2})}\,e\left(\frac{nv\overline{q_{0}}}{k}\right).$

The following bounds can be found in [LMS, Lem. 4.4].

######  Lemma 4.1.

We have the following estimates

$\mathrm{FT}(0;k)\ll\sqrt{k}rc_{1}c_{2}\mathop{\sum_{d|c_{1}c_{2}}\sum_{d^{\prime}|c_{1}c_{2}}}_{(d,d^{\prime})|(m-m^{\prime})}(d,d^{\prime}),$

and

$\begin{split}\mathrm{FT}(n;k)\ll\sqrt{k}\sum_{d_{1}|c_{1}}d_{1}\sum_{d^{\prime}_{1}|c_{1}}d^{\prime}_{1}\mathop{\sideset{}{{}^{\star}}{\sum}_{\stackrel{{\scriptstyle{\scriptstyle
x_{1}(rc_{1}/n_{1})}}}{{{\scriptstyle q^{2}_{1}n_{1}x_{1}\equiv\mp
m\bmod{d_{1}}}}}}}\mathop{\sum\sum}\limits_{\stackrel{{\scriptstyle{\scriptstyle
d_{2}|(c_{2},q^{2}_{1}n_{1}c^{\prime}_{2}+nm)}}}{{{\scriptstyle
d^{\prime}_{2}|(c^{\prime}_{2},q^{2}_{1}n_{1}c_{2}+nm^{\prime})}}}}d_{2}d^{\prime}_{2}.\end{split}$

####  4.2.4. The $q_{0}$-sum

The $q_{0}$-sum equals

(4.22)
$\mathrm{FT}(n)=\frac{1}{\sqrt{q_{0}}}\mathop{\sum\sum}\limits_{u,u^{\prime}\bmod{q_{0}}}L_{\pm\overline{c}^{2}\overline{r}^{2}m,1}(uq_{1};q)\overline{L_{\pm\overline{c^{\prime}}^{2}\overline{r}^{2}m^{\prime},1}(u^{\prime}q_{1};q)}\\\
\times\sum_{v\bmod{q_{0}}}\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u};{q_{0}})\overline{\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c^{\prime}}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u^{\prime}};{q_{0}})}\,e\left(\frac{\overline{k}vn}{q_{0}}\right).$

As we recall, by making use of the factorisation $q=q_{0}q_{1}$, we have the
twisted multiplicativity (2.1)

$\widehat{K}(b;q)=\widehat{K_{0}}(\overline{{q_{1}}}b)\widehat{K_{1}}(\overline{{q_{0}}}b)$

and then (recalling (4.14))

$L_{\alpha,\beta}(uq_{1};q)=L_{\alpha\overline{q_{1}}^{2},\beta}(u)L_{\alpha\overline{q_{0}}^{2},\beta}(0),$

where

$L_{\alpha,\beta}(u):=\frac{1}{\sqrt{q_{0}}}\sum_{b(q_{0})}\widehat{K_{0}}(b)e\left(\frac{\alpha\overline{(b+\beta
u)}}{q_{0}}\right),L_{\alpha,\beta}(u):=\frac{1}{\sqrt{q_{1}}}\sum_{b(q_{1})}\widehat{K_{1}}(b)e\left(\frac{\alpha\overline{(b+\beta
u)}}{q_{1}}\right).$

With this factorisation we can write (4.22) as

$\mathrm{FT}(n)=L_{\pm\overline{c}^{2}\overline{r}^{2}\overline{q_{0}}^{2}m,1}(0)\overline{L_{\pm\overline{c^{\prime}}^{2}\overline{r}^{2}\overline{q_{0}}^{2}m^{\prime},1}(0)}\times\\\
\frac{1}{\sqrt{q_{0}}}\mathop{\sum\sum}\limits_{u,u^{\prime}\bmod{q_{0}}}L_{\pm\overline{c}^{2}\overline{r}^{2}\overline{q_{1}}^{2}m,1}(u)\overline{L_{\pm\overline{c^{\prime}}^{2}\overline{r}^{2}\overline{q_{1}}^{2}m^{\prime},1}(u^{\prime})}\times\\\
\sum_{v\bmod{q_{0}}}\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u};{q_{0}})\operatorname{\mathrm{Kl}}_{2}(\pm\overline{c^{\prime}}^{3}\overline{r}^{3}n_{1}^{2}v\overline{u^{\prime}};{q_{0}})\,e\left(\frac{\overline{k}vn}{q_{0}}\right).$

According to the calculations in [LMS, §4.2.2], we can further express

$\mathrm{FT}(n)=L_{\pm\overline{c}^{2}\overline{r}^{2}\overline{q_{0}}^{2}m,1}(0)\overline{L_{\pm\overline{c^{\prime}}^{2}\overline{r}^{2}\overline{q_{0}}^{2}m^{\prime},1}(0)}\times\sqrt{q_{0}}\sum_{v\bmod{q_{0}}}Z(v)\overline{Z^{\prime}(v-\delta)},$

where

$Z(v)=Z_{\alpha,\beta,\gamma}(v):=\frac{1}{\sqrt{q_{0}}}\sum_{x\in{\mathbf{F}^{\times}_{q_{0}}}}\operatorname{\mathrm{Kl}}_{2}(\beta\gamma
x)K_{0}(xv)\operatorname{\mathrm{Kl}}_{2}(\alpha xv),$

and $Z^{\prime}(v)$ is defined likewise with the parameter
$(\alpha,\beta,\gamma)$ being replaced by
$(\alpha^{\prime},\beta^{\prime},\gamma^{\prime})$.

The following choices of values of the parameters correspond to our initial
problem:

$\displaystyle\alpha=\pm\overline{c}^{2}\overline{r}^{2}\overline{q_{1}}^{2}m,\
\alpha^{\prime}=\pm\overline{c^{\prime}}^{2}\overline{r}^{2}\overline{q_{1}}^{2}m^{\prime},\
\beta=\beta^{\prime}=1$ (4.23)
$\displaystyle\gamma=\pm\overline{c}^{3}\overline{r}^{3}n_{1}^{2},\
\gamma^{\prime}=\pm\overline{c^{\prime}}^{3}\overline{r}^{3}n_{1}^{2},\
\delta=\overline{k}n,$

We recall the following result proven in [LMS, §8].

######  Proposition 4.2.

Let $T_{\mathcal{F}}({\mathbf{F}_{q}})$ be the subgroup of
${\mathbf{F}^{\times}_{q}}$ defined by

$T_{\mathcal{F}}({\mathbf{F}_{q}})=\\{\lambda\in{\mathbf{F}^{\times}_{q}},\
[\times\lambda]^{*}\mathcal{F}\hbox{ is geometrically isomorphic to
}\mathcal{F}\\}.$

Assuming that the sheaf $\mathcal{F}$ is good, then for any
$\alpha,\beta,\alpha^{\prime},\beta^{\prime},\gamma,\gamma^{\prime},\delta\in{\mathbf{F}^{\times}_{q}}$,
we have

$\sum_{v}Z(v)\overline{Z^{\prime}(v-\delta)}=O(q^{1/2}).$

If $\delta=0$ the above bound holds unless

$\alpha/\alpha^{\prime}=\beta\gamma/\beta^{\prime}\gamma^{\prime}\in
T_{\mathcal{F}}({\mathbf{F}_{q}})$

in which case

$\sum_{v}Z(v)\overline{Z^{\prime}(v)}=c_{\mathcal{F}}(\alpha/\alpha^{\prime})q+O(q^{1/2})$

for $c_{\mathcal{F}}(\alpha/\alpha^{\prime})$ some complex number of modulus
$1$. Here the implicit constants depend only on $C(\mathcal{F})$.

Returning to our original sum, applying [LMS, Lem. 8.1] to

$L_{\alpha,1}(0)=\sum_{x\bmod{q_{1}}}K_{1}(x)\operatorname{\mathrm{Kl}}_{2}(\alpha
x)$

and Proposition 4.2 (with $q=q_{0}$), we see that the $\mathrm{FT}(n)$ in
(4.22) is $O(q_{0})$ unless $\delta=0$ and

${c^{\prime}}^{2}m/c^{2}m^{\prime}={c^{\prime}}^{3}/c^{3}\in
T_{\mathcal{F}}({\mathbf{F}_{q_{0}}})$

in which case (4.22) equals
$C({c^{\prime}}^{2}m/c^{2}m^{\prime}){q_{0}}^{3/2}+O(q_{0})$ with
$|C({c^{\prime}}^{2}m/c^{2}m^{\prime})|=1.$

###  4.3. Contribution of the $n=0$ frequency

In this section we bound the contribution to (4.19) from the frequency $n=0$
in (4.17). By [LMS, (4.15)], we then have

(4.24) $c_{2}=c_{2}^{\prime},\ c=c^{\prime},\ k=rc_{1}c_{2}^{2}/n_{1}.$

We use the case $\delta=0$ of Proposition 4.2: by (4.24) and (4.23) we have
that (4.22) is $O(q_{0})$ unless we have the congruence modulo $q_{0}$

$m/m^{\prime}=1\in T_{\mathcal{F}}({\mathbf{F}_{q_{0}}})$

in which case (4.22) equals $C(m/m^{\prime}){q_{0}}^{3/2}+O(q_{0})$ with
$|C(m/m^{\prime})|=1.$

According to the calculations in [LMS, §5], the contribution of the $n=0$
frequency to (4.19) is bounded by

$X^{o(1)}\frac{rN{C^{\prime}}^{2}M}{q_{0}^{1/2}}(C^{\prime}{q_{0}}^{3/2}+q_{0}{M}).$

Taking the square root of this term and multiplying it by
$\frac{Xq_{0}^{1/2}}{CqC^{\prime}}\frac{1}{N^{1/2}}$ where
$N\ll\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}$, we see that the contribution of
these terms to (4.16) and therefore to (4.12) is bounded by

(4.25)
$X^{o(1)}\frac{r^{1/2}XM^{1/2}{q_{0}}^{1/4}}{Cq}\left({C^{\prime}}^{1/2}{q_{0}}^{3/4}+q_{0}^{1/2}M^{1/2}\right)\\\
\ll
X^{o(1)}r^{1/2}\left(ZX^{3/4}{q_{0}}^{3/4}+Z^{2}X^{1/2}q{q_{0}}^{1/4}\right).$

###  4.4. Contribution from the $n\not=0$ frequencies

Recall from (4.19) that

$B_{n\neq
0}(N)=\frac{N}{\sqrt{{q_{0}}}}\mathop{\sum\sum}\limits_{c_{1},n_{1}}\frac{1}{n_{1}}\sum_{m\leqslant
M}\overline{\lambda_{f}(m)}\sum_{m^{\prime}\leqslant
M}{\lambda_{f}(m^{\prime})}\sum_{c_{2}\sim
C^{\prime}/c_{1}}\sum_{c_{2}^{\prime}\sim C^{\prime}/c_{1}}\\\
\times\frac{1}{\sqrt{k}}\sum_{n\not=0}\mathrm{FT}(n;{q_{0}})\mathrm{FT}(n;k)\widehat{\mathcal{W}}(n/N^{*}).$

We consider two cases: $n\not=0\bmod{q_{0}}$ and $n\equiv 0\bmod{q_{0}}$.

The following two bounds (by also multiplying the bound (4.21) for
$\widehat{\mathcal{W}}(n/N^{*})$)

$\begin{split}B_{n\neq
0\bmod{q_{0}}}(N)\ll&X^{o(1)}r^{2}{C^{\prime}}^{5}{q_{0}}^{3/2}M\left(1+\frac{M}{{C^{\prime}}}\right)\cdot\frac{N}{{C^{\prime}}^{3}q^{3}_{0}r/X}\\\
B_{{q_{0}}|n,n\not=0}(N)\ll&X^{o(1)}r^{2}{C^{\prime}}^{5}{q_{0}}^{3/2}M\left(1+\frac{M}{{C^{\prime}}}\right)\frac{1}{q_{0}^{1/2}}\cdot\frac{N}{{C^{\prime}}^{3}q^{3}_{0}r/X}\end{split}$

were proven in [LMS, §6.1] and [LMS, §6.2] respectively.

The non-zero frequencies contribution to (4.16) and hence to (4.12) is bounded
by

$\displaystyle
X^{o(1)}\frac{Xq_{0}^{1/2}}{CqC^{\prime}}\sup_{N\lesssim\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}}\frac{1}{N^{1/2}}\left(B_{n\neq
0\bmod{q_{0}}}(N)+B_{{q_{0}}|n,n\not=0}(N)\right)^{1/2}$ $\displaystyle\ll
X^{o(1)}\frac{Xq_{0}^{1/2}}{CqC^{\prime}}\sup_{N\lesssim\frac{{C^{\prime}}^{3}q^{3}_{0}r}{X}}\frac{1}{N^{1/2}}\left(r^{2}{C^{\prime}}^{5}{q_{0}}^{3/2}M\left(1+\frac{M}{{C^{\prime}}}\right)\cdot\frac{N}{{C^{\prime}}^{3}q^{3}_{0}r/X}\right)^{1/2}$
$\displaystyle\ll
X^{o(1)}\frac{X^{3/2}}{r^{1/2}C{C^{\prime}}^{5/2}qq_{0}}\left(r^{2}{C^{\prime}}^{5}{q_{0}}^{3/2}M\left(1+\frac{M}{{C^{\prime}}}\right)\right)^{1/2}$
(4.26) $\displaystyle\ll
X^{o(1)}r^{1/2}\left(\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}\right),$

since by (4.15) $M=Z^{2}\frac{{C^{\prime}}^{2}q^{2}}{X}$ and
$C^{\prime}\leqslant 2C=2(X/q_{0})^{1/2}$.

###  4.5. Bounding $S^{t}_{V}(K,X)$: the final steps

Let us recall that the sum $\mathrm{Main}$ in (4.10) was split into two
subsums depending on whether $(n_{1},q_{0})=1$ or not.

By (4.25) and (4.26) the first subsum (4.12) is bounded by

(4.27) $\ll
X^{o(1)}r^{1/2}\Big{(}ZX^{3/4}{q_{0}}^{3/4}+Z^{2}X^{1/2}q{q_{0}}^{1/4}+\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}\Big{)}.$

According to [LMS, (6.5)], the complement sum, $\mathrm{Err}_{4}$ (when
$q_{0}|n_{1}$), is bounded by

(4.28) $\ll X^{o(1)}{q_{0}}^{\theta_{3}}rZ^{2}\frac{X}{q_{0}}.$

Combining this bound with (4.27) we see that the sum $\mathrm{Main}$ in (4.5)
and hence the sum $S_{V,r}(K,X)$ in (4.2) is bounded as follows

$S_{V,r}(K,X)\ll
X^{o(1)}rZ^{2}\frac{X}{{q_{0}}^{1-\theta_{3}}}+X^{o(1)}r^{1/2}\Big{(}ZX^{3/4}{q_{0}}^{3/4}+Z^{2}X^{1/2}q{q_{0}}^{1/4}+\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}\Big{)}.$

Replacing $X$ by $X/r^{2}$ and averaging this bound over $|r|\leqslant R$ we
obtain

$\sum_{|r|\leqslant R}S_{V,r}(K,X/r^{2})\ll
X^{o(1)}Z^{2}\frac{X}{{q_{0}}^{1-\theta_{3}}}+X^{o(1)}\Big{(}ZX^{3/4}{q_{0}}^{3/4}+Z^{2}R^{1/2}X^{1/2}q{q_{0}}^{1/4}+\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}\Big{)}.$

Substituting this into (4.1), we get

$S^{t}_{V}(K,X)\ll
X^{o(1)}Z^{2}\frac{X}{{q_{0}}^{1-\theta_{3}}}+X^{o(1)}\Big{(}ZX^{3/4}{q_{0}}^{3/4}+Z^{2}R^{1/2}X^{1/2}q{q_{0}}^{1/4}+\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}+R^{\theta_{3}-1}X\Big{)}.$

By choosing

(4.29)
$R=\left(\frac{X}{Z^{4}q^{2}q_{0}^{1/2}}\right)^{\frac{1}{3-2\theta_{3}}}$

to equate the second and the fifth terms inside the parentheses, we see that

$\begin{split}S^{t}_{V}(K,X)\ll&X^{o(1)}Z^{2}\frac{X}{{q_{0}}^{1-\theta_{3}}}+X^{o(1)}\Big{(}ZX^{3/4}{q_{0}}^{3/4}+Z^{\frac{4(1-\theta_{3})}{3-2\theta_{3}}}X^{\frac{2-\theta_{3}}{3-2\theta_{3}}}(q^{2}q_{0}^{1/2})^{\frac{1-\theta_{3}}{3-2\theta_{3}}}+\frac{ZX}{{q_{0}}^{1/4}}+\frac{Z^{2}X^{3/4}q}{q_{0}^{1/2}}\Big{)}\\\
\ll&X^{o(1)}Z^{2}\left(X^{3/4}{q_{0}}^{3/4}+X^{\frac{2-\theta_{3}}{3-2\theta_{3}}}(q^{2}q_{0}^{1/2})^{\frac{1-\theta_{3}}{3-2\theta_{3}}}+\frac{X}{{q_{0}}^{1/4}}+\frac{X^{3/4}q}{q_{0}^{1/2}}\right).\end{split}$

In the above, to guarantee $R\geqslant 1$, we need to assume

(4.30) $X\geqslant Z^{4}q^{2}q_{0}^{1/2}.$

### Acknowledgements

Part of this work was inspired by [AHLS]. The first named author would like to
thank K. Aggarwal, R. Holowinsky, and Q. Sun for generously sharing their
ideas while working on that project. We thank P. Sharma for a helpful comment
on an earlier version of this manuscript.

As mentioned in the beginning of this paper, this work is dedicated to the
memory of Chandra Sekhar Raju who passed away one year ago, in India,
surrounded by his family. Before his premature passing, Chandra was a postdoc
in the TAN group at EPFL and before that, a PhD student at Stanford under the
supervision of K. Soundararajan. Chandra was not only a gentle soul but also a
wonderful colleague, full of ideas, with whom we had countless
discussions333In his thesis [subGL2GL2] Chandra showed, using the
$\delta$-symbol method, how to pass the convexity range for character twists
of $\operatorname{GL}_{2}\times\operatorname{GL}_{2}$ Rankin–Selberg
$L$-functions; a lot of our discussions had been revolved around our tentative
attempt (so far unsuccessful) to replace Dirichlet characters by more general
trace functions.; several of his ideas are to be found in this paper. It is
therefore with both sadness and gratitude that we dedicate this paper to the
memory of him.

## References