Denote ${\rm Sym}(3)= \{ \alpha \in M_{3}\;| \; \alpha^t=\alpha\}$. To each $\alpha \in {\rm Sym}(3)(\Q)$, we associate the unitary character
$\psi_\alpha: U_3(\Q) \backslash U_3(\A) \to \C^\times$ by $  n(u) \in U_3(\A) \mapsto  e( {\rm Tr}(\alpha  u))$
where $e: \Q \backslash \A \to \C^\times$ is  the additive character with $e_\infty(x) := e^{2\pi i x}$ for $ x \in \R$, and conductor 1 at the finite places.
For each $\alpha \in {\rm Sym}(3)(\Q)$, we define a Fourier coefficient along $U_3$ for a cuspidal automorphic representation $\pi$ of $\G(\A)$ as follows.

\begin{definition}\label{Fouriercoeffsiegelrk2}
Let $\Psi$ be a cusp form in the space of $\pi$. Define  \[ \Psi_{U_3, \psi_\alpha}(g):= \int_{U_3(\Q) \backslash U_3(\A)} \psi_\alpha^{-1}(u) \Psi(ug)du. \]
\end{definition}

We let $L_3(\Q)$ acts on ${\rm Sym}(3)(\Q)$ via the right action $ \alpha  \cdot m(g,\mu)  = \mu^{-1}g^t \alpha g $.

\begin{lemma}
Let $\alpha, \beta \in {\rm Sym}(3)(\Q)$. If there exists $m \in L_3(\Q)$ such that $\beta =   \alpha \cdot m,$ then
\[ \Psi_{U_3,\psi_\beta}(g)=\Psi_{U_3, \psi_\alpha}(m g)  \]
\end{lemma}

\begin{proof}
Suppose   that $\beta =   \alpha \cdot m$ with $m=m(g,\mu)$. The result follows from the equality
\[ \psi_\beta (n(u)) = e( {\rm Tr}( \mu^{-1}g^t \alpha g  u)) = e( {\rm Tr}( \alpha g   u \mu^{-1}g^t )) = \psi_\alpha(m n(u) m^{-1}).   \]

\end{proof}

In this manuscript, we are interested in Fourier coefficients associated to the set of rank two elements  of ${\rm Sym}(3)(\Q)$, which we denote by ${\rm Sym}^{{\rm rk } 2}(3)(\Q)$. Let $D \in \Q^\times$ and let $F$ denote the \'etale quadratic extension $\Q(\sqrt{D})$ of $\Q$. If $D$ is not a square then $F$ is a field, else $F=\Q \times \Q$.

\begin{definition}
We let $\psi_D: U_3(\Q) \backslash U_3(\A) \to \C^\times$ be the unitary character \[\psi_{D} : n(u) \mapsto  e( {\rm Tr}(\alpha_D u)) = e(u_{33} -D u_{22})\] associated to $\alpha_D = \left( \begin{smallmatrix} 0  &    & \\  & -D  &  \\ & & 1 \end{smallmatrix} \right) \in  {\rm Sym}^{{\rm rk } 2}(3)(\Q)$.
\end{definition}

We have the following:
\begin{lemma}
A set of representatives of ${\rm Sym}^{{\rm rk } 2}(3)(\Q) /_{\sim M_3(\Q)}$ is given by  \[ \{ \alpha_D \;:\; D \in \Q^\times / (\Q^\times)^2 \}. \]
\end{lemma}

In view of these two lemmas, the set of Fourier coefficients associated to the Siegel parabolic and a rank 2 symmetric matrix is parametrized by the set of \'etale quadratic algebras of $\Q$.

\subsubsection{Fourier coefficients of type $(4 \, 2)$}\label{subsubsec:fc42}
We now turn our attention to Fourier coefficients associated to the unipotent orbit of $\G$ associated to the partition $(4\,2)$. The corresponding unipotent subgroup is the unipotent radical subgroup of the non-maximal standard parabolic $P=L_P\cdot U_P$, which arises as the intersection of the Siegel parabolic $Q$ with the Klingen parabolic. Notice that $P$ has Levi $L_P=\GL_2 \times \GL_1^2$, given by \[ \left\{ \left( \begin{smallmatrix} a &  & & \\  & g & &  \\  & & \mu a^{-1} & \\  & {} & & \mu {^tg^{-1}} \end{smallmatrix} \right) \; : \; a,\mu \in \GL_1, \; g \in \GL_2 \right \}. \]
Following \cite[\S 2.1]{Pollack-Shah}, we define a unitary character which we still denote $\psi_D: U_P(\Q) \backslash U_P(\A) \to \C^\times$ as follows. Every element of $U_P / [U_P, U_P]$ can be expressed as the product of $n(v) \tilde{n}(u)$, where
\[n(v) = \left( \begin{smallmatrix} 1 & v_1  & v_2   & & & \\   & 1  &     & & & \\   &   & 1  & & & \\   &   &     & 1 & & \\   &   &     & -v_1 &1  & \\   &   &     &-v_2 & & 1 \end{smallmatrix} \right) \in \G,\; \tilde{n}(u) = \left( \begin{smallmatrix} 1 &    &     & & & \\   & 1  &     & & u_{22} & u_{23}\\   &   & 1  & &u_{23} & u_{33}\\   &   &     & 1 & & \\   &   &     &   &1  & \\   &   &     &  & & 1 \end{smallmatrix} \right) \in U_3. \]
We will denote by $N_v$ (resp. $N_u$) the set of the $n(v)$'s (resp. $\tilde{n}(u)$'s).
If $n \equiv n(v)\tilde{n}(u)$ modulo $[U_P,U_P]$, define \[ \psi_D(n):= e(v_1+u_{33} -Du_{22})=e(v_1)\psi_D(n(u)). \]
Let $\pi$ be a cuspidal automorphic representation of $\G(\A)$. We define the following Fourier coefficients.

\begin{definition}\label{Fouriercoeff}
Let $\Psi$ be a cusp form in the space of $\pi$. Define  \[ \Psi_{U_P,\psi_D}(g):= \int_{U_P(\Q) \backslash U_P(\A)} \psi_D^{-1}(u) \Psi(ug)du. \]

\end{definition}

In the following proposition, we relate these Fourier coefficients to the ones for the Siegel parabolic associated to rank 2 symmetric matrices.

\begin{proposition} \label{PropFC}
For a cusp form $\Psi$ in the space of $\pi$, the following two conditions are equivalent.
\begin{enumerate}
\item $\Psi_{U_P,\psi_D}(g) \not \equiv 0$.
\item There exists $\alpha \in {\rm Sym}^{{\rm rk } 2}(3)(\Q)$ with $\alpha \sim_{ L(\Q)} \alpha_D$ such that $\Psi_{U_3,\alpha}(g) \not \equiv 0$.
\end{enumerate}
\end{proposition}

\begin{proof}
Fourier expand $ \Psi_{U_3,\psi_D}(g)$ over $N_v$ to get
\[\Psi_{U_3,\psi_D}(g) = \int_{(\Q \backslash \A)^2}\Psi_{U_3,\psi_D}(n(v) g) dv + \sum_{\gamma \in {\rm Stab}_L(\psi_D)(\Q) \backslash L(\Q)} \Psi_{U_P,\psi_D}(\gamma  g).  \]
The term \[ \int_{(\Q \backslash \A)^2} \Psi_{U_3,\psi_D}(n(v) g) dv = \int_{N_u(\Q) \backslash N_u(\A)} \psi_D^{-1}(\tilde{n}(u))\int_{U_K(\Q) \backslash U_K(\A)} \Psi(n_k \tilde{n}(u) g) d n_k d \tilde{n}(u) \]
and the inner integral vanishes because of cuspidality of $\Psi$ along the unipotent radical $U_K$ of the Klingen parabolic. Thus
\[\Psi_{U_3,\psi_D}(g) =   \sum_{\gamma} \Psi_{U_P,\psi_D}(\gamma  g). \]
This relation implies the result as follows. If $\Psi_{U_3,\psi_D}(g) \not \equiv 0$, the Fourier coefficient $ \Psi_{U_P,\psi_D}(g)$ does not vanish identically. Viceversa, if $\Psi_{U_P,\psi_D}(g) \not \equiv 0$ then there is a character $\psi'$ in the $L(\Q)$-orbit of $\psi_D$ such that $\Psi_{U_3,\psi'}(g) \not \equiv 0$.
\end{proof}

\subsection{The Spin $L$-function and its residue at $s=1$}

Let $\pi$ denote any cuspidal automorphic representation of $\G(\A)$ with trivial central character. Let $S$ denote a finite set of places of $\Q$ containing the ones where $\pi$ is ramified and the archimedean place. If ${\rm Spin} : {\rm Spin}_7(\C) \to \GL(V_8)$ denotes the $8$-dimensional spin representation, the partial Spin $L$-function of $\pi$ is defined to be
\[ L^S(s, \pi, {\rm Spin}):= \prod_{\ell \not\in S}\frac{1}{{\rm det}( 1 - \ell^{-s} {\rm Spin}(s_{\pi_\ell}))}, \]
where $s_{\pi_\ell}$ denotes the Satake parameter of the unramified local component $\pi_\ell$. Let $\H$ be the group \eqref{thegroupH} associated to the \'etale cubic algebra $\Q \times F$, where $F=\Q(\sqrt{D})$ with either $D \not\equiv 1 \in \Q^\times_{>0} / (\Q^\times )^2$, in which case $F$ is a real quadratic field, or $D \equiv 1$ mod $(\Q^\times )^2$, in which case $F=\Q \times \Q$. For any cusp form $\Psi \in V_\pi$, Pollack-Shah [48] give an integral representation
\mathcal{I}(\Phi, \Psi, s)=\int_{\Z(\A)\H(\Q) \backslash \H(\A)}E_\Phi(h_1,s)\Psi(h)dh.
of $L^S(s, \pi, {\rm Spin})$. For any $\Phi$ and $\Psi$, the integral $\mathcal{I}(\Phi, \Psi, s)$ is absolutely convergent for $Re(s)$ big enough and has a meromorphic continuation to $\C$. According to \cite[Proposition 7.1]{Gan-Gurevich}, for $Re(s)$ big enough we have the unfolding
\mathcal{I}(\Phi, \Psi, s)=\int_{U_{B_{\H}}(\A)Z(\A)\backslash \H(\A)} f_\Phi(h_1, s) \Psi_{U_P, \psi_D}(h)dh
where $U_{B_{\H}}$ is the unipotent radical of the upper triangular Borel subgroup $B_{\H}$ of $\H$ and $\Psi_{U_P,\psi_D}$ is the Fourier coefficient of Definition \ref{Fouriercoeff}.

\begin{theorem}[[48]] \label{Pollackshahongsp6}
For a set $\Sigma$ of places of $\Q$, denote  \[\mathcal{I}_\Sigma(\Phi, \Psi, s) = \int_{ U_{B_\H(\Q_\Sigma)} Z_\G(\Q_\Sigma) \backslash \H(\Q_\Sigma)} f(h_1, \Phi_\Sigma, s)\Psi_{U_P,\psi_D} (h) dh. \]
Let $\Psi$ be a cusp form in the space of $\pi$. Then, for any factorizable Schwartz-Bruhat function $\Phi$ on $\A^2$ and up to enlarging $S$, we have
\[ \mathcal{I}(\Phi, \Psi, s) = \mathcal{I}_S(\Phi, \Psi, s) L^S(s, \pi, {\rm Spin}). \]
Moreover, there exists a cusp form $\tilde{\Psi}$ in the space of $\pi$ and a factorizable Schwartz-Bruhat function $\Phi$ on $\A^2$ such that \[ \mathcal{I}(\Phi, \tilde{\Psi}, s) = \mathcal{I}_\infty(\Phi, \Psi, s) L^S(s, \pi, {\rm Spin}).\]
\end{theorem}

Note that if $\pi$ does not support a rank two Fourier coefficient (for the Siegel parabolic $Q$) and thus, by Proposition \ref{PropFC}, a Fourier coefficient for $P$, the integral $\mathcal{I}(\Phi, \Psi, s)$ is identically zero.

\begin{corollary}[[48]]
Suppose that $\pi$ supports a rank two Fourier coefficient. Then, the partial Spin $L$-function $L^S(s, \pi, {\rm Spin})$ has meromorphic continuation in $s$, is holomorphic outside $s=1$, and has at worst a simple pole at $s=1$.
\end{corollary}

As we explain in the later sections, using results of Gan and Gan-Gurevich, they further prove that when $L^S(s, \pi, {\rm Spin})$ has a simple pole at $s=1$, $\pi$ lifts to the split $G_2$ under the exceptional theta correspondence. This observation is based on the following key relation between the residue at $s=1$ of $L^S(s, \pi , {\rm Spin} )$ and the automorphic period we have introduced in \S \ref{ss:thepairing}.

\begin{prop}\label{periodvsresidue}
For any factorizable Schwartz-Bruhat function $\Phi$ on $\A^2$, we have
\[
c \cdot \widehat{\Phi}(0)\cdot \int_{\Z(\A)\H(\Q) \backslash \H(\A)}\Psi(h) dh = \mathrm{Res}_{s=1} \left( \mathcal{I}_S(\Phi, \Psi, s) L^S(s,\pi , {\rm Spin}) \right),
\]
where $c>0$ is the constant of Lemma \ref{eisenstein}.
\end{prop}

\begin{proof}
Thanks to Lemma \ref{eisenstein}, the residue at $s=1$ of $\mathcal{I}(\Phi, \Psi, s)$ equals
\[ c \cdot \widehat{\Phi}(0)\cdot \int_{\Z(\A)\H(\Q) \backslash \H(\A)}\Psi(h) dh.\]
The result then follows from Theorem \ref{Pollackshahongsp6}.
\end{proof}

The following characterization is implicit in the work [48] and has been proved in [17] for certain CAP representations.

\begin{proposition}\label{prop:Hdist}
Suppose that $\pi$ is a cuspidal automorphic representation of $\PGSp_6(\A)$ which supports a Fourier coefficient of type $(4\, 2)$ associated to a quadratic \'etale $\Q$-algebra $F$. Then $L^S(s,\pi, {\rm Spin)}$ has a simple pole at $s=1$ if and only if $\pi$ is $\H$-distinguished, with $\H= \GL_2 \boxtimes \GL_{2,F}^*$, i.e. if there exists a cusp form $\Psi$ in $\pi$ such that \[\int_{\Z(\A)\H(\Q) \backslash \H(\A)}\Psi(h) dh \ne 0. \]
\end{proposition}

\begin{proof}
By \cite[Theorem 2.7]{Pollack-Shah} (cf. Theorem \ref{Pollackshahongsp6}), given a cusp form $\Psi$ in $\pi$, there exists a cusp form $\tilde{\Psi}$ and a Schwartz-Bruhat function $\Phi$ such that
\[ \mathcal{I}(\Phi, \tilde{\Psi}, s) = \mathcal{I}_\infty(\Phi, \Psi, s) L^S(s,\pi, {\rm Spin)} \]
Proposition \ref{periodvsresidue}, taking residues at $s=1$ on both sides we have
\[
c \cdot \widehat{\Phi}(0)\cdot \int_{\Z(\A)\H(\Q) \backslash \H(\A)}\tilde{\Psi}(h) dh = \mathrm{Res}_{s=1} \left( \mathcal{I}_\infty(\Phi, \Psi, s) L^S(s,\pi , {\rm Spin}) \right),
\]
where $c>0$ is the constant of Lemma \ref{eisenstein}. We now use \cite[Proposition 12.1]{Gan-Gurevich} to deduce that there exists local data $\Phi_\infty$ and $\Psi_\infty$ such that $\mathcal{I}_\infty(\Phi, \Psi, 1) \ne 0$. Hence, up to modifying $\Psi$ and $\Phi$ at $\infty$, we obtain \[ \widehat{\Phi}(0)\cdot \int_{\Z(\A)\H(\Q) \backslash \H(\A)}\tilde{\Psi}(h) dh = C \cdot \mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin}),
\]
with $C$ a certain non-zero constant in $\C$. Note finally that we have the freedom to choose $\Phi$ such that $\widehat{\Phi}(0) \ne 0$. This follows from the fact that, given the two non-zero linear maps $l_1: \mathcal{S}(\A^2) \to \C, \Phi \mapsto \mathcal{I}_\infty(\Phi, \Psi, 1) $ and $l_2:\mathcal{S}(\A^2) \to \C, \Phi \mapsto \widehat{\Phi}(0) $, ${\rm ker}(l_1) \cup {\rm ker}(l_2) \ne \mathcal{S}(\A^2)$,  hence the result follows.
\end{proof}

We now state our first main result. Let $\mathcal{Z}_{\H, B}^{[\lambda, \mu]}, \mathcal{Z}_{\H, \mathcal{H}}^{[\lambda,\mu]} ,$ and $\omega_\Psi$ be as in \S \ref{SectRealizations} and \S \ref{ss:thepairing}.

\begin{theorem}\label{theoremcyclebetti1}
If $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]} , 1) \ne 0$, then
\begin{align*}
\langle  \mathcal{Z}_{\H, \mathcal{H}}^{[\lambda,\mu]} , [\omega_\Psi] \rangle_\mathcal{H} = \langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle = C \cdot \mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin}),
\end{align*}
where  $C$ is a non-zero constant.
\end{theorem}

\begin{proof}
By Proposition \ref{period} and Proposition \ref{period2}, we have that
\[ \langle  \mathcal{Z}_{\H, \mathcal{H}}^{[\lambda,\mu]} , [\omega_\Psi] \rangle_\mathcal{H} = \langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle = \frac{h_{{U'}}}{(2\pi i)^3\cdot \mathrm{vol}({U'})}
\int_{\H(\Q) \Z_\G(\A) \backslash \H(\A)} \Psi^{[\lambda,\mu]}(h)dh,\]
where $U' = U \cap \H(\Af)$ and $h_{U'} =4^{-1} | \Z_\G(\Q) \backslash \Z_\G(\Af) / (\Z_\G(\Af) \cap {U'})|$. Let $\Phi$ denote a factorizable Schwartz-Bruhat function on $\A^2$, for which $\widehat{\Phi}(0) \neq 0$. By Proposition \ref{periodvsresidue}, we have
\begin{align*}
\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle &= \frac{c \cdot \widehat{\Phi}(0) h_{{U'}}}{(2\pi i)^3\cdot \mathrm{vol}({U'})}
\mathrm{Res}_{s=1} \left( \mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]}, s) L^S(s,\pi , {\rm Spin}) \right) \\
&= C \cdot
\mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin})
\end{align*}
where $$C = \frac{c \cdot \widehat{\Phi}(0) h_{{U'}}}{(2\pi i)^3\cdot \mathrm{vol}({U'})} \mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]}, 1) \neq 0.$$ This finishes the proof.
\end{proof}

Let $H^6_{\mathcal{M}}(\Sh_\G(U), \mathscr{V}^\lambda_F(3))_{hom}$ denote the $F$-vector space defined in section \ref{section:ahreal} and let $H^6_{\mathcal{M}}(\Sh_\G(U), \mathscr{V}^\lambda_F(3))_{hom}[\pi_f^\vee]$ denote its $\pi_f^\vee$-isotypical component. This is a finite dimensional $L$-vector space, where $L$ is the number field introduced in $\S$ \ref{section:Hodgetheory}. Tate conjecture for the motive attached to $\pi$ (see Conjecture \ref{ConjectureBT} (3)) predicts the equality
-\mathrm{ord}_{s=1} L(s, \pi, \mathrm{Spin})=\dim_L H^6_{\mathcal{M}}(\Sh_\G(U), \mathscr{V}^\lambda_F(3))_{hom}[\pi_f^\vee].

\begin{cor} \label{cor:tateconjecture}
If $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]} , 1) \ne 0$, then we have
-\mathrm{ord}_{s=1} L^S(s, \pi, \mathrm{Spin}) \leq \dim_L H^6_{\mathcal{M}}(\Sh_\G(U), \mathscr{V}^\lambda_F(3))_{hom}[\pi_f^\vee].
\end{cor}

\begin{proof}
If $L^S(s, \pi, \mathrm{Spin})$ does not have a pole at $s=1$, there is nothing to prove. Else we have $-\mathrm{ord}_{s=1} L^S(s, \pi, \mathrm{Spin})=1$ by \cite[Theorem 1.3]{Pollack-Shah}. As a consequence $\mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin}) \neq 0$. By Theorem \ref{theoremcyclebetti1}, under the assumption that  $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]} , 1) \ne 0$ this implies that $\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle \neq 0$. In particular, the projection of $\mathcal{Z}_{\H, B}^{[\lambda,\mu]}$ to the $\pi_f^\vee$-isotypical component is non-zero. This implies the statement.
\end{proof}

\section{Exceptional theta lifts from $G_2$ to $\PGSp_6$} \label{Section6}

In this section, we discuss the exceptional theta correspondence for the dual reductive pair $(G_2,\PGSp_6)$ and describe the set of Fourier coefficients associated to the Heisenberg parabolic for cuspidal automorphic forms of $G_2(\A)$. It has as its solely purpose to fix notations and to recall some well known results that will be used later so that the knowledgeable reader might skip it.

\subsection{Split $G_2$ and $E_7$} In this section we will follow the exposition of the Appendix of [32] by Savin.

\subsubsection{The group $G_2$}\label{subsub:groupg2}

Let $\mathbb{H}$ be the algebra of Hamilton quaternions over $\Q$ with the usual basis $\{1,i,j,k\}$. The conjugate $\bar{a}$ of an element $a=\alpha_0+\alpha_1i+\alpha_2j+\alpha_3k \in \mathbb{H}$ is $\bar{a}=\alpha_0-\alpha_1i-\alpha_2j-\alpha_3k$. The split octonion algebra over $\Q$ is $\mathbb{O}=\mathbb{H} \oplus \mathbb{H}$ with multiplication
$$(a,b) \cdot (c,d)=(ac+d\bar{b}, \bar{a}d+cb).$$
Then $\mathbb{O}$ is a non-commutative, non-associative $\Q$-algebra. However it is alternative, which means that for any $x,y \in \mathbb{O}$ we have $x \cdot (x \cdot y)=(x \cdot x) \cdot y$ and $(x \cdot y) \cdot y=x \cdot (y \cdot y)$ (see [35]). If $x=(a,b)$, let $\overline{x}=(\overline{a},-b)$. Then $x \mapsto \overline{x}$ is a $\Q$-linear involution on $\mathbb{O}$ satisfying $\overline{x \cdot y}= \overline{y} \cdot \overline{x}$. The norm $\mathrm{N}: \mathbb{O} \rightarrow \Q$ is the quadratic form defined by $x \mapsto x\cdot \overline{x}=\overline{x} \cdot x$.
The trace $\mathrm{Tr}: \mathbb{O} \rightarrow \Q$ is defined by $x \mapsto x+\overline{x}$.
For any $x, y, z \in \mathbb{O}$, the properties
\begin{align*}
\mathrm{N}(x\cdot y) &= \mathrm{N}(x) \mathrm{N}(y),\\
\mathrm{Tr}(x\cdot y)&=\mathrm{Tr}(y\cdot x),\\
\mathrm{Tr}(x\cdot(y\cdot z))&=\mathrm{Tr}((x \cdot y) \cdot z)
\end{align*}
are satisfied. For $x,y \in \mathbb{O}$, we write $y \in x^\perp$ if $y$ is orthogonal to $x$ with respect to the bilinear form $(x,y) \mapsto {\rm Tr}(x \cdot \overline{y})$, which means that $x\cdot \overline{y} +  y \cdot \overline{x} = 0$.\\

Let $l=(0,1) \in \mathbb{O}$ so that $\{1,i,j,k, l,li,lj,lk \}$ is a basis of $\mathbb{O}$. From this, one constructs another useful basis $\{s_1,s_2,s_3,s_4,t_1,t_2,t_3,t_4\}$, where
\[ s_1=\frac{1}{2}(i+li), s_2=\frac{1}{2}(j+lj),
s_3=\frac{1}{2}(k+lk), s_4=\frac{1}{2}(1+l), \] \[ t_1=\frac{1}{2}(i-li), t_2=\frac{1}{2}(j-lj), t_3=\frac{1}{2}(k-lk), t_4=\frac{1}{2}(1-l). \]
The following multiplication table for this basis is given in Table 1 of the Appendix of [32].
\begin{table}[h]
\begin{tabular}{|c ||c|c|c||c|c|c||c|c|}
\hline
& $s_1$ & $s_2$ & $s_3$ & $t_1$ & $t_2$ & $t_3$ & $s_4$ & $t_4$ \\ \hline \hline
$s_1$ & $0$ & $-t_3$ & $t_2$ & $s_4$ & $0$ & $0$ & $0$ & $s_1$    \\ \hline
$s_2$ & $t_3$ & $0$ & $-t_1$ & $0$ & $s_4$ & $0$ & $0$ & $s_2$    \\ \hline
$s_3$ & $-t_2$ & $t_1$ & $0$ & $0$ & $0$ & $s_4$ & $0$ & $s_3$    \\ \hline \hline
$t_1$ & $t_4$ & $0$ & $0$ & $0$ & $s_3$ & $-s_2$ & $t_1$ & $0$    \\ \hline
$t_2$ & $0$ & $t_4$ & $0$ & $-s_3$ & $0$ & $s_1$ & $t_2$ & $0$    \\ \hline
$t_3$ & $0$ & $0$ & $t_4$ & $s_2$ & $-s_1$ & $0$ & $t_3$ & $0$    \\ \hline \hline
$s_4$ & $s_1$ & $s_2$ & $s_3$ & $0$ & $0$ & $0$ & $s_4$ & $0$    \\ \hline
$t_4$ & $0$ & $0$ & $0$ & $t_1$ & $t_2$ & $t_3$ & $0$ & $t_4$    \\
\hline
\end{tabular}

\end{table}

We define
G_2:=\{g \in \mathrm{GL}(\mathbb{O}) \,|\, g(x \cdot y)=(gx) \cdot (gy), \forall x,y \in \mathbb{O}\}.
to be the group of automorphisms of $\mathbb{O}$. We note that $G_2$ acts transitively on non-zero elements of trace zero and norm zero. We will denote the set of trace zero octonions by either $\mathbb{O}^0$ or $V_7$, where the latter notation emphasises that this set defines the standard irreducible 7-dimensional representation of $G_2$ and induces an embedding
\[ G_2 \hookrightarrow {\rm SO}_7.\]

\subsubsection{The dual reductive pair} \label{Section:dualpair}

We consider the Albert algebra $J$ over $\Q$, which is the set of matrices
d & \overline{z} & y\\
z & e & \overline{x}\\
\overline{y} & x & f
\end{pmatrix}
where $d, e, f \in \Q$ and $x, y, z \in \mathbb{O}$. The algebra $J$ is equipped with a cubic form, called the determinant, which is given by
\[ \det(A) = def - d N(x) - e N(y) - f N(z) + \mathrm{Tr}(xyz).\]
The group of isogenies of this form is a group of type $E_6$ and its orbits on $J$ are classified by the rank. We will need to consider the set $\Omega$ of rank $1$ elements $A \in J$, i.e. those $A \neq 0$ such that $A^2=\mathrm{Tr}(A) \cdot A$. This condition means that the entries of $A$ satisfy the equalities
$$ \mathrm{N}(x)=ef, \;\; \mathrm{N}(y)=df, \;\; \mathrm{N}(z)=de, $$
$$ dx=\overline{y}\cdot \overline{z}, \;\; ey=\overline{z}\cdot \overline{x}, \;\; fz=\overline{x}\cdot \overline{y}.
Let $G$ denote the split adjoint group of type $E_7$, which is constructed from $J$ by the Koecher-Tits construction (see Section 3 of [40]). The group $G$ has a maximal parabolic $P=MN$ and its opposite $\bar{P}=M \bar{N}$, with $N \simeq J$ and such that the action under conjugation of the Levi $M$ on $N$ gives an isomorphism of $M$ and the group of similitudes of the cubic form on $J$
\[ M \cong \{ g \in \GL(J) \, | \, \det(gA) = \lambda \det(A) \text{ for some } \lambda \in \G_m \text{ and } \forall A \in J \}. \] The group $G_2$ can be realized as a subgroup of $M$ via its action on $J$ by the rule
g \cdot \begin{pmatrix}
d & \overline{z} & y\\
z & e & \overline{x}\\
\overline{y} & x & f
\end{pmatrix}=\begin{pmatrix}
d & g\overline{z} & gy\\
gz & e & g\overline{x}\\
g\overline{y} & gx & f
\end{pmatrix}.
This action has fixed points $J_3$, the Jordan algebra of symmetric $3 \times 3$ matrices with entries in $\Q$. Note that the left action of $ \GL_3$ on $J_3 \cong N$ given by
\begin{equation} \label{EqactionM}
g \cdot A = \det(g)^{-1} g A g^t
\end{equation}
extends to an action on $J$ preserving the determinant form up to scalar, thus defining an embedding of $ \GL_3$ into $M$. Then $\GL_3$ is the centraliser of $G_2$ in $M$ and $Q= \GL_3 U_3$ (which is the Siegel parabolic of $ \mathrm{PGSp}_6$) is the centralizer of $G_2$ in $P$. Similarly, the opposite $\overline{Q}$ is the centralizer of $G_2$ in $\overline{P}$. This gives the dual reductive pair $(G_2, \mathrm{PGSp}_6)$ in $G$.

\subsection{Fourier coefficients for $G_2$}

\subsubsection{Root system and the Heisenberg parabolic}\label{subsub:RootsandHeisenberg}
Let $T$ be a (rank 2) maximal split torus over $\Q$ in $G_2$ and let $\Delta$, resp. $\Delta^+ \subset \Delta$, be the set of roots, resp. a subset of positive roots, for $G_2$. Let $a$, resp. $b$, denote the long, resp. short, simple root in $\Delta^+$. Then
\[\Delta^+ = \{a, b, a+b, a+2b, a+3b,2a+3b \}. \]
We let $B = T U$ denote the Borel subgroup of $G_2$ associated to $\Delta^+$. Other than $B$, there are two proper standard parabolic subgroups $P_a$ and $P_b$ of $G_2$, such that $P_a \cap P_b = B$. They are characterized by the following. For any $\alpha \in \Delta^+$, denote by $x_\alpha: \mathbf{G}_a \hookrightarrow U$
the one parameter unipotent subgroup associated to $\alpha$. Then, for each $r \in \{ a , b \}$, the Levi $L_r$ of $P_r$ is isomorphic to $\GL_2$ and contains $x_r$. We fix an isomorphism $\GL_2 \simeq L_r$ such that  $ {\matrix{1}{u}{}{1}} \mapsto x_r(u)$. We denote by $H := P_b$ the so-called Heisenberg parabolic and let $L_H U_H$ denote  its Levi decomposition. The unipotent radical $U_H$ is of dimension 5 and admits the filtration \[ 1 \subseteq [U_H, U_H] \subseteq U_H, \]
with  $ U_H/[U_H, U_H]$ being the four dimensional abelian unipotent group generated by
\[\{x_a, x_{a+b}, x_{a+2b}, x_{a+3b} \}, \]
while $[U_H, U_H]$ is isomorphic to the one parameter unipotent subgroup $x_{2a+3b}$. We now give a more detailed description of $U_H$ and $L_H$ which will be useful later. First describe an embedding of $\SL_3$ into $G_2$. The group $G_2$ acts transitively on the set $\mathbb{O}^0$ of trace zero octonions. In particular, it acts transitively on the set
\[ \Gamma_c := \{ x \in \mathbb{O}^0\,|\, N(x) = - c \}. \]
By \cite[Theorem 4]{jacobson}, the stabilizer of an element $y_0 \in \Gamma_1$ is isomorphic to $\SL_3$. Choose $y_0$ such that the unipotent radical $U_{\SL_3}$ of the upper triangular Borel of $\SL_3$ is generated by the one-parameter subgroups
\[ \{ x_a, x_{a+3b}, x_{2a+3b}\}.\]
In terms of the basis chosen in \S \ref{subsub:groupg2}, this is achieved by choosing $y_0 = s_4 - t_4$. In this case, one shows (cf. \cite[Lemma 2]{rallis-schiffmann}) that the stabilizer of $y_0$ leaves invariant the subspace $\langle s_1, s_2, s_3 \rangle$ and is identified with $\SL_3 = \SL(\langle s_1, s_2, s_3\rangle)$.

\subsubsection{The Lie algebra of $G_2$} \label{subsectLieG2}
The multiplication map on $\mathbb{O}$ induces a map $V_7 \otimes V_7 \to V_7$ given by $x \otimes y \mapsto \frac{xy - yx}{2}$. This map is alternating, hence it induces a $G_2$-equivariant map $\wedge^2 V_7 \to V_7$ which is surjective.
Then the Lie algebra $\mathfrak{g}_2$ of $G_2$ can be identified with the kernel of this map. Under this identification, one has an explicit description of the action of $\mathfrak{g}_2$ on $V_7$, namely
\[ (w \wedge x) \cdot v = \langle x, v \rangle w - \langle w, v \rangle x. \] We will also need (cf. \cite[\S 22.2]{FultonHarris}) the decomposition
\begin{align}\label{decompositionLiealgebraG2}
\mathfrak{g}_2 = \mathfrak{sl}_3 \oplus {\rm Std}_3 \oplus {\rm Std}_3^*,
\end{align}
where ${\rm Std}_3$ is the standard representation of $\SL_3$ with basis $\{v_1,v_2,v_3\}$ and ${\rm Std}_3^*$ is its dual with basis $\{\delta_1,\delta_2,\delta_3\}$ and where we denote by $E_{ij}$, $1 \leq i < j \leq 3$ the standard basis vectors of $\mathfrak{sl}_3$. The identification between the two descriptions (cf. \cite[\S 2.2]{Pollack-G2}) of $\mathfrak{g}_2$ is given by $E_{ij} = t_j \wedge s_i$, $1 \leq i < j \leq 3$, $v_i = (s_4 - t_4) \wedge s_i + t_{i+1} \wedge t_{i+2}$ and $\delta_i = (s_4 - t_4) \wedge t_i + s_{i+1} \wedge s_{i+2}$, $1 \leq i \leq 3$, where indices are taken modulo $3$. Moreover, the component $\mathfrak{sl}_3$ is the Lie algebra of the copy of $\SL_3$ embedded into $G_2$ as above. In particular, $E_{12}, E_{13}$ and $E_{23}$ are root vectors for the roots $a, 2a + 3b$ and $a + 3b$ respectively. Moreover, the vectors $v_1, v_2$ and $\delta_3$ are root vectors for the roots $a+b, b$ and $a+2b$, respectively. Via \eqref{decompositionLiealgebraG2}, the Lie algebra $\mathfrak{u}_H$ of $U_H$ is \begin{align}\label{decompositionuh}
\mathfrak{u}_H = \mathfrak{u}_{\SL_3} \oplus \Q v_1 \oplus \Q \delta_3,
\end{align}
Under \eqref{decompositionLiealgebraG2} the Lie algebra $\mathfrak{l}_H$ of the Levi $L_H$ is generated by the Cartan subalgebra and the root vectors $v_2$, $\delta_2$.

\subsubsection{Fourier coefficients}\label{subsub:FcforG2}

We now describe the Fourier coefficients for $G_2$ associated to the Heisenberg parabolic. We closely follow [47] and refer to it for more details. In order to describe the Fourier coefficients associated to $H$, we need to study the $L_H$-representation $V_H :=U_H/[U_H, U_H]$. As a $\GL_2$-representation, $V_H$ is isomorphic to  ${\rm Sym}^3({\rm Std}_2) \otimes {\rm det}^{-1}({\rm Std}_2)$, where ${\rm Std}_2$ denotes the standard representation of $\GL_2$.  Under the identification of \eqref{decompositionuh}, (a representative of) an element of $V_H(\Q)$ can be written as
\[  x_a(\lambda_1) x_{a+b}(\lambda_2/3) x_{a+2b}(\lambda_3/3)x_{a+3b}(\lambda_4),\; \text{ with } \lambda_i \in \Q, \]
which corresponds to the binary cubic polynomial \[p(x,y)= \lambda_1 x^3 + \lambda_2 x^2y + \lambda_3 xy^2 + \lambda_4 y^3\]
where $x,y$ form a basis of ${\rm Std}_2$. Associated to $p$, there is the cubic $\Q$-algebra $R$ with basis $\{1,i,j\}$ with multiplicative table \begin{align*}
ij &= - a d \\
i^2 &= -a c +b i - a j \\
j^2 &= -bd +d i - c j.
\end{align*}
\begin{example}\label{exampleofcubicpols} \leavevmode
\begin{enumerate} \item (\cite[3.2]{Gross-Lucianovic})
If $p(x,y) = x^2y - xy^2$ then the associated $\Q$-algebra $R$ is isomorphic to $\Q^3$.
\item (\cite[3.3]{Gross-Lucianovic}) If $p(x, y) = x^3 - D xy^2$ (or equivalently $p(x,y) = -D x^2 y + y^3$ using the action of ${\matrix 0  1 1 0 }$)  then the associated $\Q$-algebra $R$ is isomorphic to $\Q \oplus \Q(\sqrt{D})$.
\end{enumerate}
\end{example}
There is an action of $\GL_2(\Q)$ on the set of bases $\{1,i,j \}$ of a given cubic algebra $R$, which makes the association $p(X,Y) \mapsto (R, \{1,i,j\})$ $\GL_2(\Q)$-equivariant. Since any cubic algebra admits a basis of this shape, we have the following.

\begin{proposition}[{\cite[Proposition 2.1]{Gross-Lucianovic}}] There is a bijection between the $\GL_2(\Q)$-orbits on $V_H(\Q)$ and the set of isomorphism classes of cubic $\Q$-algebras. Moreover, each orbit has a well-defined discriminant in $\Q^\times / (\Q^\times )^2$.
\end{proposition}

Let $e: \Q \backslash \A \to \C^\times$ be the additive character introduced in \S \ref{subsubFCsiegel}. Let $\langle , \rangle $ denote the symplectic pairing on $V_H$ defined as follows. If $v,v' \in V_H$ correspond to $p(x,y)$ and $p'(x,y)$ respectively, then \[ \langle v , v' \rangle = \lambda_1 \lambda_4' - \tfrac{1}{3} \lambda_2 \lambda_3' + \tfrac{1}{3} \lambda_3 \lambda_2' - \lambda_4 \lambda_1'.\]
Any character $\psi: U_H(\Q) \backslash U_H(\A) \to \C^\times$  factors through $V_H(\A)$, hence we consider the projection $\bar{n}$ of $n \in U_H(\A)$ to $V_H(\A)$, which, by \eqref{decompositionuh}, can be written as $$\overline{n} = x_a(\lambda_1')x_{a+b}(\lambda_2'/3) x_{a+2b}(\lambda_3'/3)x_{a+3b}(\lambda_4').$$
If $v \in V_H(\Q)$ corresponds to $p(x,y)$, we then define $\psi_v : U_H(\Q) \backslash U_H(\A) \to \C^\times$ by \[ n \mapsto e( \langle v , \overline{n} \rangle) = e( \lambda_1 \lambda_4' - \tfrac{1}{3} \lambda_2 \lambda_3' + \tfrac{1}{3} \lambda_3 \lambda_2' - \lambda_4 \lambda_1'). \]
The character $\psi_v$ is non-degenerate if and only if $v$ corresponds to an \'etale cubic algebra over $\Q$. In this manuscript, we are interested in \'etale cubic algebras of the form $\Q \times F$, with $F$ of either the form $\Q(\sqrt{D})$ (with  $ \Q^\times / (\Q^\times)^2 \ni D \not\equiv 1$) or $\Q \times \Q$ (with $D \equiv 1$ mod $(\Q^\times)^2$).

\begin{definition} Let $\psi_{H,D}: U_H(\Q) \backslash U_H(\A) \to \C^\times$ denote the character associated to $\Q \times F$. Given a cusp form $\varphi$ for $G_2(\A)$, define
\[ \varphi_{U_H,\psi_{H,D}} (g) := \int_{U_H(\Q) \backslash U_H(\A)} \psi^{-1}_{H,D}(n) \varphi(n g) d n.\]

\end{definition}

\subsection{The theta lift from $G_2$ to $\mathrm{PGSp}_6$}\label{sub:thetaliftg2pgsp6}

Let $\Pi=\bigotimes'_v \Pi_v$ denote the restricted tensor product of the minimal representations $\Pi_v$ of $E_7(\Q_v)$ over all places $v$ of $\Q$. A unitary model of the minimal representation is given by $L^2(\Omega)$, where recall that $\Omega$ denotes the subset of rank 1 elements in $J$. There is a unique up to a non-zero scalar embedding
\theta: \Pi \rightarrow \mathcal{A}(E_7(\Q) \backslash E_7(\A))
of $\Pi$ in the space $\mathcal{A}(E_7(\Q) \backslash E_7(\A))$ of automorphic forms of $E_7$ (see [22], [40]). For $f \in \Pi$ and $\varphi \in \mathcal{A}(G_2(\Q) \backslash G_2(\A))$, we define a function $\Theta(f,\varphi)$ on $\mathrm{PGSp}_6(\A)$ by
\Theta(f,\varphi)(g)=\int_{G_2(\Q) \backslash G_2(\A)} \theta(f)(g'g)\varphi(g')dg'.

\begin{definition} Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$. \begin{enumerate}
\item Define $\Theta(\sigma)$ to be the span of the functions $\Theta(f,\varphi)$, where $f \in \Pi$ and $\varphi$ runs through the cusp forms in the contragradient $\sigma^\vee$ of $\sigma$.
\item We say that a cuspidal automorphic representation $\pi$ of $\mathrm{PGSp}_6(\A)$ is a $\Theta$-lift of $\sigma$ if it appears as an irreducible subquotient of $\Theta(\sigma)$.
\end{enumerate}
\end{definition}

If a $\Theta$-lift of $\sigma$ exists, then its local constituents are compatible with the local  Theta correspondence between $G_2$ and $\mathrm{PGSp}_6$.

\begin{proposition} \label{proplocalglobal}\
Let $\pi$ be a $\Theta$-lift of $\sigma$, then $\pi_v$ is an irreducible subquotient of  $\Theta(\sigma_v)$.
\end{proposition}

\begin{proof}
See \cite[Theorem 1.7 (i)]{harris-khare-thorne}.
\end{proof}

After imposing certain local conditions on $\sigma$, in the next section we use one of the main results of [23] to show that $\Theta(\sigma)$ is non-zero and cuspidal, thus proving the existence of a non-trivial $\Theta$-lift of $\sigma$. Before doing so, we first recall the properties of the local theta correspondence needed later.

\subsubsection{Discrete series and a conjecture of Gross}

Let $T_c$ denote a compact torus in $G_2(\R)$, which is contained in the maximal compact subgroup $K_{G_2} \simeq (\mathrm{SU}_2 \times \mathrm{SU}_2)/ \mu_2$ of $G_2(\R)$. We abuse notation denoting again by $a,b$ the simple positive roots for $T_c$ (with the short root $b$ which we assume to be compact) and $\Delta^+$ the resulting set of positive roots. Then, $\rho = \tfrac{1}{2} \sum_{\alpha \in \Delta^+} \alpha = 3 a + 5b$. The set of positive compact roots is given by \[ \Delta_c^+ = \{ b , 2 a + 3 b \},  \]
which, in the notation of [45], is $\{ 2 \epsilon_2,2 \epsilon_1\}$. The Weyl group $\mathfrak{W}_{G_2}$ is isomorphic to the dihedral group $D_6$ of 12 elements and it is generated by $w_a$ and $w_b$, where $w_\alpha$ denotes the reflections around the line orthogonal to $\alpha$. The Weyl group $\mathfrak{W}_{K_{G_2}} \simeq (\Z / 2\Z)^2$ is generated by $w_b$ and $w_{2a+3b} = w_a w_b w_a w_b w_a$.\\

Let $\gamma$ be a dominant weight for $G_2$ with respect to $T_c$. The set of equivalence classes of irreducible discrete series of $G_2(\R)$ associated to $\gamma$ has cardinality equal to $|\mathfrak{W}_{G_2} / \mathfrak{W}_{K_{G_2}}| = 3$. Choose representatives $\{w_1, w_2, w_3 \}$ of $ \mathfrak{W}_{G_2} / \mathfrak{W}_{K_{G_2}} $ such that
$w_i\rho$ is dominant for $K_{G_2}$. Then, for any $1 \leq i \leq 3$, there exists an irreducible discrete series $\sigma_\infty^\Gamma$ of Harish-Chandra parameter $\Gamma = w_i (\gamma + \rho)$ and minimal $K_{G_2} $-type $\Gamma + \delta_{G_2} - 2 \delta_{K_{G_2}}$, where $\delta_{G_2}$, resp. $\delta_{K_{G_2}}$, is the half-sum of roots, resp. compact roots, which are positive with respect to the Weyl chamber in which $\Gamma$ lies. Precisely, if we let $w_1 = {\rm id}$, $w_2= w_a$, and $w_3 = w_b w_a$, then
\begin{align*}
w_1 \rho &= \rho = 3 \epsilon_1 + \epsilon_2, \\
w_2 \rho &= 2 a + 5 b = 2 \epsilon_1 + 4 \epsilon_2, \\
w_3 \rho &= a + 4b =  \epsilon_1 + 5 \epsilon_2.
\end{align*}
We let $\mathcal{D}_{3,1}$, $\mathcal{D}_{2,4}$, and $\mathcal{D}_{1,5}$ denote the sets of discrete series of $G_2(\R)$ whose Harish-Chandra parameter lies in the Weyl chamber corresponding to $w_1\rho$, $w_2\rho$, and $w_3\rho$ respectively. Elements of $\mathcal{D}_{3,1}$ are the quaternionic discrete series, while elements of $\mathcal{D}_{2,4}$ are the generic discrete series.\\

Gross has given a precise conjectural description of the entire discrete spectrum of the dual pair $(G_2, \PGSp_6)$ (cf. \cite[Conjecture 1.2]{li}). Recall that there are four families of discrete series for $\PGSp_6(\R)$, indexed by the set of Hodge types up to conjugation. In particular, the discrete series of $\PGSp_6(\R)$ of Hodge type $(4,2)$, resp. $(6,0)$, are the generic, resp. holomorphic discrete series.

\begin{conjecture}[Gross]
Let $\Pi_\infty$ be the minimal representation of $E_7(\R)$. The discrete spectrum of the restriction of $\Pi_\infty$ to the dual pair $G_2(\R) \times \PGSp_6(\R)$ is the direct sum of all tensor products $\sigma_\infty \otimes \theta(\sigma_\infty)$, where $\sigma_\infty$ belongs to the discrete series of $G_2$. If $\sigma_\infty$ has infinitesimal character $\gamma + \rho = r \epsilon_1+ s \epsilon_2$ and belongs to either $\mathcal{D}_{3,1}$, $\mathcal{D}_{2,4}$, or $\mathcal{D}_{1,5}$, then $\theta(\sigma_\infty)$ is the discrete series of $\PGSp_6(\R)$ with infinitesimal character $(r, \tfrac{1}{2}(r+s),\tfrac{1}{2}(r-s))$ and Hodge type $(3,3)$, $(4,2)$, or $(5,1)$ respectively.
\end{conjecture}

The conjecture of Gross has been verified for discrete series in $\mathcal{D}_{3,1}$ by Li (cf. \S \ref{subsubLiresult} below). Moreover, it has been partially confirmed for the generic family $\mathcal{D}_{2,4}$ by Harris-Khare-Thorne in \cite[Theorem 1.5 and Theorem 1.7(ii)]{harris-khare-thorne} using the main result of Savin's appendix to [32] and the non-vanishing of the global theta lift given by \cite[Corollary 4.2]{Ginzburg-Rallis-Soudry2}, while Li verified it for a proper subset $\mathcal{D}_{1,5}'$ of  $\mathcal{D}_{1,5} $ in \cite[Theorem 4.3]{li}. We also note that the remaining equivalence class of holomorphic discrete series of $\PGSp_6(\R)$ (of Hodge type $(6,0)$) is realized in an exceptional theta correspondence studied by Gross-Savin between the compact real form $G_2^c(\R)$ of $G_2$ and $\PGSp_6(\R)$ and moreover this is the only Hodge type that appears in that correspondence (cf. \cite[Theorem 3.5]{GrossSavin}).

\subsubsection{Quaternionic discrete series and their theta lift}\label{subsubLiresult}

We describe the main result of [45], which verifies the conjecture of Gross for quaternionic discrete series. We first notice that a discrete series $\sigma_\infty^{x,y}$ of Harish-Chandra parameter $x \epsilon_1 + y \epsilon_2$ lies in the set of quaternionic discrete series $\mathcal{D}_{3,1}$ if $x,y$ are two non-negative integers such that $x-3 \geq y-1 \geq 0$ and $x-y$ is even. The minimal $K_{G_2}$-type of $\sigma_\infty^{x,y}  \in \mathcal{D}_{3,1}$ is given by \[ {\rm Sym}^{x+1}({\rm Std}_{\epsilon_1}) \boxtimes {\rm Sym}^{y-1}({\rm Std}_{\epsilon_2}),\]
where ${\rm Std}_{\epsilon_1}$ (resp. ${\rm Std}_{\epsilon_2}$) is the standard representation of the $\mathrm{SU}_2$ corresponding to the long root $\epsilon_1$ (resp. the short root $\epsilon_2$).

\begin{proposition}\label{propLi}
Let $\Pi_\infty$ denote the minimal representation of $E_7(\R)$. We have \[{\Pi_\infty}|_{{G_2(\R) \times \mathrm{PGSp}_6(\R)}} \supseteq \bigoplus_{\sigma_\infty^{x,y} \in \mathcal{D}_{3,1}} \sigma_\infty^{x,y}  \otimes \theta(\sigma_\infty^{x,y})\] where $\theta(\sigma_\infty^{x,y}) \in P(V^{\lambda}),$ with $\lambda =(x-3,\tfrac{1}{2}(x+y)-2,\tfrac{1}{2}(x-y)-1,0)$, is the discrete series $ \pi_\infty^{3,3}$ of Hodge type $(3,3)$ and Harish-Chandra parameter $(\tfrac{1}{2}(x+y),  \tfrac{1}{2}(x-y),-x)$.
\end{proposition}

\begin{proof}
See \cite[Theorem 1.1]{li} and \cite[Theorem 5.4]{huang-pandzic-savin}.
\end{proof}

The set $\mathcal{D}_{3,1}$ contains an important family of discrete series, which were studied by Gross and Wallach in [28] and [29].

\begin{definition}\label{def:quatdiscseries}
For every $n \geq 2$, the quaternionic discrete series $\sigma_n$ is the element of $\mathcal{D}_{3,1}$ of Harish-Chandra parameter $(2n -1) \epsilon_1 + \epsilon_2$ and minimal $K_{G_2}$-type \[ {\rm Sym}^{2n}({\rm Std}_{\epsilon_1}) \boxtimes \mathbf{1}.\]
\end{definition}

A fundamental property of the members of this family is that they admit (unique) models with respect to the unipotent radical of the Heisenberg parabolic and non-degenerate characters corresponding to totally real \'etale cubic algebras. Recall, as in \S \ref{subsub:FcforG2}, that a non-degenerate character $\psi: U_H(\R) \to \C^\times$ corresponds to a cubic algebra, whose discriminant is either positive or negative. The first type corresponds to the $\GL_2(\R)$-orbit on $V_H(\R)$ given by $\R^3$, while the second to the $\GL_2(\R)$-orbit of $\R \times \C$. A representative $\psi: U_H(\R) \to \C^\times$ of the totally real orbit is given by $e^{2 \pi i f}$, where $f: U_H(\R) \to \R$ is non-zero on the one parameter unipotent subgroups $x_{a+b}$ and $x_{a+2b}$  and trivial on $x_{a}$ and $x_{a+3b}$ (cf. \cite[\S 6]{Gan-Gross-Savin}). A special case of the main result of [58] gives the following.

\begin{proposition}\label{Wallachprop}
Let $\psi$ be a non-degenerate character of $V_H(\R)$. There is (at most) a one dimensional space of $\psi$-equivariant linear functionals on $\sigma_n$.Moreover, \[ {\rm dim }\; {\rm Hom}_{U_H(\R)} (\sigma_n , \psi) = 1, \]
exactly when $\psi$ corresponds to a totally real cubic algebra.
\end{proposition}

\begin{comment}
\subsubsection{The archimedean theta correspondence}\label{subsubLiresult}

In what follows we describe the main result of [45] on the (partial) decomposition of the minimal representation of $E_7(\R)$ as a $G_2(\R) \times \PGSp_6(\R)$-representation. To do so, we first set some notation. Let $T_c$ denote a compact torus in $G_2(\R)$, which is contained in the maximal compact subgroup $K_{G_2} \simeq (\mathrm{SU}_2 \times \mathrm{SU}_2)/ \mu_2$ of $G_2(\R)$. We abuse notation denoting again by $a,b$ the simple positive roots for $T_c$ (with the short root $b$ which we assume to be compact) and $\Delta^+$ the resulting set of positive roots. Then, $\rho = \tfrac{1}{2} \sum_{\alpha \in \Delta^+} \alpha = 3 a + 5b$. The set of positive compact roots is given by \[ \Delta_c^+ = \{ b , 2 a + 3 b \},  \]
which, in the notation of [45], is $\{ 2 \epsilon_2,2 \epsilon_1\}$. The Weyl group $\mathfrak{W}_{G_2}$ is isomorphic to the dihedral group $D_6$ of 12 elements and it is generated by $w_a$ and $w_b$, where $w_\alpha$ denotes the reflection around the orthogonal line to $\alpha$. The Weyl group $\mathfrak{W}_{K_{G_2}} \simeq (\Z / 2\Z)^2$ is generated by $w_b$ and $w_{2a+3b} = w_a w_b w_a w_b w_a$.\\

Let $\gamma$ be a dominant weight for $G_2$ with respect to $T_c$. The set of equivalence classes of irreducible discrete series of $G_2(\R)$ associated to $\gamma$ has cardinality equal to $|\mathfrak{W}_{G_2} / \mathfrak{W}_{K_{G_2}}| = 3$. Choose representatives $\{w_1, w_2, w_3 \}$ of $ \mathfrak{W}_{G_2} / \mathfrak{W}_{K_{G_2}} $ such that
$w_i\rho$ is dominant for $K_{G_2}$. Then, for any $1 \leq i \leq 3$, there exists an irreducible discrete series $\sigma_\infty^\Gamma$ of Harish-Chandra parameter $\Gamma = w_i (\gamma + \rho)$ and minimal $K_{G_2} $-type $\Gamma + \delta_{G_2} - 2 \delta_{K_{G_2}}$, where $\delta_{G_2}$, resp. $\delta_{K_{G_2}}$, is the half-sum of roots, resp. compact roots, which are positive with respect to the Weyl chamber in which $\Gamma$ lies. Precisely, if we let $w_1 = {\rm id}$, $w_2= w_a$, and $w_3 = w_b w_a$, then
\begin{align*}
w_1 \rho &= \rho = 3 \epsilon_1 + \epsilon_2, \\
w_2 \rho &= 2 a + 5 b = 2 \epsilon_1 + 4 \epsilon_2, \\
w_3 \rho &= a + 4b =  \epsilon_1 + 5 \epsilon_2.
\end{align*}
We let $\mathcal{D}_{3,1}$ denote the set of discrete series of $G_2(\R)$ whose Harish-Chandra parameter lies in the Weyl chamber corresponding to $w_1\rho$. A discrete series $\sigma_\infty^{x,y}$ of Harish-Chandra parameter $x \epsilon_1 + y \epsilon_2$ lies in $\mathcal{D}_{3,1}$ if $x,y$ are two non-negative integers such that $x-3 \geq y-1 \geq 0$ and $x-y$ is even.
The minimal $K_{G_2}$-type of $\sigma_\infty^{x,y}  \in \mathcal{D}_{3,1}$ is given by \[ {\rm Sym}^{x+1}({\rm Std}_{\epsilon_1}) \boxtimes {\rm Sym}^{y-1}({\rm Std}_{\epsilon_2}),\]
where ${\rm Std}_{\epsilon_1}$ (resp. ${\rm Std}_{\epsilon_2}$) is the standard representation of the $\mathrm{SU}_2$ corresponding to the long root $\epsilon_1$ (resp. the short root $\epsilon_2$). Elements of $\mathcal{D}_{3,1}$ are often called quaternionic discrete series.

\begin{proposition}\label{propLi}
Let $\Pi_\infty$ denote the minimal representation of $E_7(\R)$. We have \[{\Pi_\infty}|_{{G_2(\R) \times \mathrm{PGSp}_6(\R)}} \supseteq \bigoplus_{\sigma_\infty^{x,y} \in \mathcal{D}_{3,1}} \sigma_\infty^{x,y}  \otimes \Theta(\sigma_\infty^{x,y})\] where $\Theta(\sigma_\infty^{x,y}) \in P(V^{\lambda}),$ with $\lambda =(x-3,\tfrac{1}{2}(x+y)-2,\tfrac{1}{2}(x-y)-1,0)$, is the discrete series $ \pi_\infty^{3,3}$ of Hodge type $(3,3)$, Harish-Chandra parameter $(x, - \tfrac{1}{2}(x-y),- \tfrac{1}{2}(x+y))$ and minimal $K_\infty$-type $(x+1, - \tfrac{1}{2}(x-y ) - 1, - \tfrac{1}{2}(x+y))$.
\end{proposition}

\begin{proof}
See \cite[Theorem 1.1]{li} and \cite[Theorem 5.4]{huang-pandzic-savin}.
\end{proof}

The set $\mathcal{D}_{3,1}$ contains an important family of quaternionic discrete series, which were studied by Gross and Wallach in [28] and [29].

\begin{definition}\label{def:quatdiscseries}
For every $n \geq 2$, the quaternionic discrete series $\sigma_n$ is the element of $\mathcal{D}_{3,1}$ of Harish-Chandra parameter $(2n -1) \epsilon_1 + \epsilon_2$ and minimal $K_{G_2}$-type \[ {\rm Sym}^{2n}({\rm Std}_{\epsilon_1}) \boxtimes \mathbf{1}.\]
\end{definition}

A fundamental property of the members of this family of discrete series is that they admit (unique) models with respect to the unipotent radical of the Heisenberg parabolic and non-degenerate characters corresponding to totally real \'etale cubic algebras. Recall, as in \S \ref{subsub:FcforG2}, that a non-degenerate character $\psi: U_H(\R) \to \C^\times$ corresponds to a cubic algebra, whose discriminant is either positive or negative. The first type corresponds to the $\GL_2(\R)$-orbit on $V_H(\R)$ given by $\R^3$, while the second to the $\GL_2(\R)$-orbit of $\R \times \C$. A representative $\psi: U_H(\R) \to \C^\times$ of the totally real orbit is given by $e^{2 \pi i f}$, where $f: U_H(\R) \to \R$ is non-zero on the two short root spaces of $v_1$ and $\delta_3$ and trivial on the two long roots spaces of $E_{12}$ and $E_{23}$   (cf. \cite[\S 6]{Gan-Gross-Savin}). A special case of the main result of [58] gives the following.

\begin{proposition}\label{Wallachprop}
Let $\psi$ be a non-degenerate character of $V_H(\R)$. There is (at most) a one dimensional space of $\psi$-equivariant linear functionals on $\sigma_n$. In particular, \[ {\rm dim }\; {\rm Hom}_{U_H(\R)} (\sigma_n , \psi) = 1, \]
exactly when $\psi$ corresponds to a totally real cubic algebra.
\end{proposition}

We let $\mathcal{D}_{2,4}$, resp. $\mathcal{D}_{1,5}$, be the set of discrete series whose Harish-Chandra parameter lies in the Weyl chamber for $w_2\rho$, resp. $w_3\rho$.
By a conjecture of Gross (cf. \cite[Conjecture 1.2]{li}) the theta lift of elements of $\mathcal{D}_{2,4}$, which are the generic discrete series, is expected to be the generic discrete series for $\PGSp_6(\R)$ (of Hodge type $(4,2)$), while elements of $\mathcal{D}_{1,5}$ have theta lift corresponding to discrete series of Hodge type $(5,1)$.  Gross' conjecture has been partially confirmed in the former case by Harris-Khare-Thorne in \cite[Theorem 1.5 and Theorem 1.7(ii)]{harris-khare-thorne} using the main result of Savin's appendix to [32] and the non-vanishing of the global theta lift given by \cite[Corollary 4.2]{Ginzburg-Rallis-Soudry2}, while the latter case has been verified by Li for a proper subset $\mathcal{D}_{1,5}'\subset \mathcal{D}_{1,5} $ in \cite[Theorem 4.3]{li}. We also note that the remaining equivalence class of holomorphic discrete series of $\PGSp_6(\R)$ (of Hodge type $(6,0)$) is realized in an exceptional theta correspondence studied by Gross-Savin between the compact real form $G_2^c(\R)$ of $G_2$ and $\PGSp_6(\R)$ and moreover this is the only Hodge type that appears in that correspondence (cf. \cite[Theorem 3.5]{GrossSavin}).
\end{comment}

\subsubsection{The non-archimedean theta correspondence}

We describe the properties of the non-archimedean theta correspondence which will be later needed to study the global theta correspondence. Let $\sigma$ be an irreducible admissible representation of $G_2(\Q_p)$.

\begin{definition} Let $\Theta(\sigma)$ be the equivalence class of irreducible admissible representations $\pi$ of $\mathrm{PGSp}_6(\Q_p)$ such that $\sigma \otimes \pi$ is a quotient of the minimal representation $\Pi_p$ of $E_7(\qp)$.  Denote by $\theta(\sigma)$ the maximal semisimple quotient of  $\Theta(\sigma)$.
\end{definition}

\begin{proposition}\label{propositiononlocalthetaprop}
For an irreducible admissible representation $\sigma$ of $G_2(\Q_p)$, $\Theta(\sigma)$ has finite length with unique irreducible quotient (if non-zero) $\theta(\sigma)$. Moreover, one has the following.
\begin{enumerate}
\item Let $\sigma$ be an unramified generic representation of $G_2(\Q_p)$ with Satake parameter $s$, then  $\pi= \theta(\sigma)$ is the unramified representation of $\mathrm{PGSp}_6(\Q_p)$ whose Satake parameter is $\varphi \circ s$, where $\varphi: G_2 \hookrightarrow {\mathrm{Spin}_7}$ is the map of $L$-groups.
\item Let ${\rm St}_{G_2}$ (resp. ${\rm St}_{\mathrm{PGSp}_6}$) be the Steinberg representation of $G_2(\Q_p)$ (resp. ${\mathrm{PGSp}_6}(\Q_p)$); then $\theta({\rm St}_{G_2})={\rm St}_{\mathrm{PGSp}_6}$.
\end{enumerate}
\end{proposition}

\begin{proof}
See \cite[Theorem 1.2, Theorem 15.3(v)]{Gan-SavinHoweduality} and \cite[Proposition 3.1]{GrossSavin}.
\end{proof}

\section{Cuspidality and Fourier coefficients of the global theta lift}\label{sectiononcuspidalityandfouriercoefficients}

In this section, based on the works  [23], [27], and the appendix of Savin in [32], we give a criterion on the cuspidality of representations in the image of the exceptional theta lift and on their possession of Fourier coefficients of type $(4 \, 2)$.

\subsection{Cuspidality of the global lift}\label{cuspidalityandperiodvanishing}

Let $V$ denote the unipotent subgroup of $\SL_3$ (embedded into $G_2$ as in \S \ref{subsub:RootsandHeisenberg}) generated by the roots $a+3b$ and $2a+3b$. We further consider the subgroup $\SL_2$ embedded into $G_2$ via the Levi of the ``long root'' parabolic $P_a$ and denote, for any cusp form $\varphi$ for $G_2(\A)$, \[ \varphi^{\SL_2 V}(g) := \int_{\SL_2(\Q) \backslash \SL_2(\A)} \int_{V(\Q) \backslash V(\A)} \varphi(v m g) dv dm.  \]
We are thankful to David Ginzburg, who kindly shared with us a proof that the non-vanishing of the period appearing in \cite[Theorem 3.7(3)]{Ginzburg-Jiang} implies that $\sigma$ is globally generic, i.e. that it has non-zero Whittaker coefficients. We crucially use this fact to prove the following.

\begin{lemma}\label{lem:periodsl2n}
Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$, which is not globally generic. For any cusp form $\varphi \in V_\sigma$ and $g \in G_2(\A)$, we have $\varphi^{\SL_2 V}(g) = 0$.
\end{lemma}

\begin{proof}

Let $Z$ denote the unipotent subgroup of $G_2$ generated by the roots $a+2b, a+3b,$ and $2a+3b$. If we Fourier expand the period  $\varphi^{\SL_2 V}(g)$ along the 1-dimensional unipotent subgroup $x_{a+2b}(r)$ of $G_2$, we get \[\varphi^{\SL_2 V}(g) = \varphi^{\SL_2 Z}(g) + \sum_{\psi_Z} \varphi^{\SL_2,\psi_Z}(g),  \]
where the sum runs over non-trivial additive characters $\psi_Z : Z(\Q) \backslash Z(\A) \to \C^\times$ supported on the root $a+2b$,  $\varphi^{\SL_2 Z}(g)$ is the period of $\varphi$ over $[\SL_2 Z]$, and \[\varphi^{\SL_2,\psi_Z}(g) : = \int_{\SL_2(\Q) \backslash \SL_2(\A)} \int_{(\Q \backslash \A)^3} \varphi( x_{a+2b}(r_1)x_{a+3b}(r_2)x_{2a+3b}(r_3) m g) \psi_Z(r_1) d r_i dm. \]
By \cite[Lemma 2.1]{Ginzburg-Rallis-Soudry2}, $\varphi^{\SL_2 Z}(g) = 0$ for all $\varphi$ in $\sigma$ and $g \in G_2(\A)$. Hence,  $\varphi^{\SL_2 V}(g) = 0$ if and only if $\varphi^{\SL_2,\psi_Z}(g) = 0$ for all choices of data. We argue by contradiction. Suppose that  $\varphi^{\SL_2,\psi_Z}(g) \ne 0$ for a certain choice of data.  We now show that this implies that $\sigma$ supports Whittaker Fourier coefficients, thus contradicting our hypothesis. Let $V_a$ be the unipotent radical of $P_a$. Since $V$ is normal in $V_a$, we can consider the quotient $V_0 = V_a / V$, which is isomorphic to the Heisenberg group in three variables (cf. \cite[ \S  1.1]{GinzburgStdG2}). Note that it is generated by the roots $b, a+b,$ and $a+2b$. We can then apply the results of [34] for the Jacobi group  given by $\SL_2 V_0$. In particular, \cite[Proposition 1.3]{Ikeda-JacobiFC} implies that
$\varphi^{\SL_2,\psi_Z}(1)$ is zero for all choices of data if and only if \begin{align*}
I_1:=  \int_{\SL_2(\Q) \backslash \SL_2(\A)} &\int_{(\Q \backslash \A)^5} \varphi( x_b(v_1)x_{a+b}(v_2)x_{a+2b}(r_1)x_{a+3b}(r_2)x_{2a+3b}(r_3) m ) \cdot  \\ &\cdot \overline{\theta}_{\SL_2}^{\phi_1}(x_b(v_1)x_{a+b}(v_2)x_{a+2b}(r_1) m) \theta_{\SL_2}^{\phi_2}(m) dv_i d r_i dm
\end{align*}
is zero for all choices of data. Here $\theta_{\SL_2}^{\bullet}(g)$ is the theta function on the double cover of the Jacobi group $\SL_2 V_0$ (cf. \cite[p. 620]{Ikeda-JacobiFC}).
The period $I_1$ appears as the residue of the global integral studied in [20]:
since $\theta_{\SL_2}^{\phi_2}(m)$ realizes the residue at $s=3/4$ of the normalized Eisenstein series ${\rm Eis}_{\tilde{\SL}_2}(m,s)$ on the metaplectic cover of $\SL_2$, by \cite[Theorem 4]{GinzburgStdG2}, the integral $I_1$ is the residue of \begin{align*}
I_2(s) :=  \int_{\SL_2(\Q) \backslash \SL_2(\A)} &\int_{(\Q \backslash \A)^5} \varphi( x_b(v_1)x_{a+b}(v_2)x_{a+2b}(r_1)x_{a+3b}(r_2)x_{2a+3b}(r_3) m ) \cdot  \\ &\cdot \overline{\theta}_{\SL_2}^{\phi_1}(x_b(v_1)x_{a+b}(v_2)x_{a+2b}(r_1) m) {\rm Eis}_{\tilde{\SL}_2}(m,s) dv_i d r_i dm.
\end{align*}
If $I_1$ is not zero, then, for ${\rm Re}(s)$ large enough, the integral $I_2(s)$ is not zero. By \cite[Theorem 1]{GinzburgStdG2}, $I_2(s)$ contains the Whittaker coefficient for $\varphi$ as an inner integration. This shows that if $\varphi^{\SL_2,\psi_Z}(1) \ne 0$ for some choice of data, $I_2(s) \ne 0$ and, in particular, $\sigma$ is globally generic. This finishes the proof.
\end{proof}

\begin{theorem} \label{cuspidality}
Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$. Assume that \begin{enumerate}
\item $\sigma$ is not globally generic;
\item there exists a finite place $p$ such that $\sigma_p$ is generic.
\end{enumerate}  Then the big theta lift $\Theta(\sigma)$ of $\sigma$ to $\PGSp_6$ is cuspidal.
\end{theorem}

\begin{proof}
We show the result by using the tower of theta lifts from $G_2$ and its properties studied in [23]. If $\sigma$ lifts trivially to $\mathrm{PGSp}_6$ then there is nothing to prove, so suppose that $\sigma$ has a non-zero theta lift $\pi$ to $\mathrm{PGSp}_6$. Then, by  \cite[Theorem A]{Ginzburg-Rallis-Soudry2} $\pi$ is cuspidal if and only if the lifts of $\sigma$ to $\mathrm{PGSp}_4$ and $\mathrm{PGL}_3$ are both zero. By \cite[Theorem 4.1 (3)]{Ginzburg-Rallis-Soudry2}, the lift to $\mathrm{PGSp}_4$ is zero if and only if $$
\varphi^{\mathrm{SL}_3}(g) =  \int_{[\mathrm{SL}_3]} \varphi(xg) dx = 0 \text{ and } \varphi^{\mathrm{SU}(2,1)}(g) = \int_{[\mathrm{SU}(2,1)]} \varphi(xg) dx=0
for any $g \in G_2(\A)$, any $\varphi \in V_{\sigma^\vee}$. Here, $\mathrm{SL}_3$ embeds into $G_2$ as the stabilizer of a norm $-1$ vector (cf. \S \ref{subsub:RootsandHeisenberg}), while $\mathrm{SU}(2,1)$ is realized as the stabilizer of a norm $-c$ vector, with $c$ not a square in $\Q$. We argue by contradiction. Suppose that $ \sigma^\vee$ has a non-trivial $\mathrm{SU}(2,1)$-functional. This implies that, at every finite $v$, $\sigma_v$ admits one. By Frobenius reciprocity,
\[
\Hom_{\mathrm{SU}(2,1)}(\sigma^\vee_v, \C) = \Hom_{G_2}( {\text{c-Ind}}_{\mathrm{SU}(2,1)}^{G_2}(\C), \sigma_v)
\]
and hence, since $\sigma_v$ is irreducible, one deduces that each local component $\sigma_v$ of $\sigma$ is a quotient of $C^\infty_c(G_2(\Q_v) / \mathrm{SU}(2,1)(\Q_v)$. In particular,   $\sigma_p$ is identified with such a quotient. This is a contradiction as, by hypothesis, $\sigma_p$ is generic but, by \cite[Lemma 4.10]{GrossSavin}, $C^\infty_c(G_2(\qp)/\mathrm{SU}(2,1)(\qp)$ does not admit a Whittaker functional. The same argument also shows the vanishing of $\varphi^{\mathrm{SL}_3}$. We claim finally that the theta lift of $\sigma$ to $\mathrm{PGL}_3$ also vanishes.
Since $\sigma$ is  not globally generic, Lemma \ref{lem:periodsl2n} shows that, for all $\varphi \in \sigma$,  $\varphi^{\SL_2 V}(g)= 0$. We can then apply \cite[Theorem 4.1(4)]{Ginzburg-Rallis-Soudry2} to deduce that the theta lift of $\sigma$ to $\mathrm{PGL}_3$ is zero and conclude the proof.

\begin{comment}
We argue again by contradiction. Assume that $\sigma$ has non-zero theta lift to $\mathrm{PGL}_3$. By the compatibility between global and local theta correspondences, the lift of $\sigma$ has component at $p$ given by the local theta lift of the Steinberg representation $\sigma_p$ of $G_2(\Q_p)$. Now, by \cite[Theorem 1.3(ii)]{Gan-SavinHoweduality}, a discrete series of $G_2(\Q_p)$ lifts to a discrete series representation of precisely one of the groups $\mathrm{PGL}_3(\Q_p)$, $P D^\times$, or $\PGSp_6(\Q_p)$.  Since, by Proposition \ref{propositiononlocalthetaprop}(2), $\sigma_p$ lifts to the Steinberg representation of $\mathrm{PGSp}_6(\Q_p)$, we then deduce that it does not lift to $\mathrm{PGL}_3(\Q_p)$. This finishes the proof of the proposition.
\end{comment}
\end{proof}

\begin{comment}
\subsection{Vanishing of periods}

In this section we prove the vanishing of certain period that will be used later. All the material appearing in this subsection (except the last Proposition \ref{propvanishperiod}) was gently provided to us by Nadir Matringe. We express to him our sincere gratitude.

Let $F$ be a non Archimedean local field, and $e_i$ be the $i$-th vector of the canonical basis of $F^n$. Let $P$ be the mirabolic subgroup of $G=\GL_n(F)$, namely the set of matrices $g$ in $G$ such that ${}^t\! e_1.g={}^t\! e_1$.
The map $f\mapsto f({}^t\! e_1.g)$ identifies $\ind_P^G(\1)$ (the compactly induced representation) and $\mathcal{C}_c^\infty (F^n-\{0\})$. We denote by $Z$ the center of $G$, and by $N$ the subgroup of unipotent upper triangular matrices of $G$. For $i=1,\dots,n-1$, we denote by $N_i$ the subgroup
$\{I_n+t.E_{i,i+1},\ t\in F\}$ of $N$, and call a character $\psi:N\rightarrow \C^\times$ nondegenerate if
it restricts non trivially to all subgroups $N_i$.

A set of representatives $R$ of $ZP\backslash G /N$ is given by the permutations matrices $w_i$ where $w_0=I_n$ and $w_i$ corresponds to the transposition $(n-i,n)$ for $i=1,\dots,n-1$. The space
$\bigsqcup_{k=i}^{n-1} ZPw_i N$ is open in $\bigsqcup_{k=i-1}^{n-1} ZPw_i N$ for $i=1,\dots,n-1$.

Note that for $w\in R$ each double coset $ZPwN$ is an $\ell$-space (locally compact totally disconnected) as a locally closed topological subspace of $G$, and that
$PwN$ as well as a closed space of $ZPwN$ (given by the equation $m_{1,w^{-1}}(i)=1$ inside $\mathcal{M}_n(F)$).

\begin{lemma}\label{A}
For $w\in R$, there is no nonzero left $P$-invariant and right $(N,\psi)$-equivariant distribution (i.e. linear form) on $\mathcal{C}_c^\infty (PwN)$.
\end{lemma}
\begin{proof}
Setting $P^w=w^{-1}Pw$, the $\ell$-spaces $PwN$ and $P\times P^w\cap N\backslash N$ are homemorphic , so that \[\mathcal{C}_c^\infty (PwN)\simeq \mathcal{C}_c^\infty(P)\otimes \mathcal{C}_c^\infty(P^w\cap N\backslash N).\] Because
$\mathrm{Hom}_P(\mathcal{C}_c^\infty(P),\C)\simeq \C$, we deduce that the space of left $P$-invariant distributions on $\mathcal{C}_c^\infty (PwN)$ is the same as the space of linear forms on
$ \mathcal{C}_c^\infty(P^w\cap N\backslash N)\simeq \ind_{P^w\cap N}^N(\mathbf{1})$, hence the space of left $P$-invariant and right $(N,\psi)$-equivariant distributions is isomorphic to
$\Hom_N(\ind_{P^w\cap N}^N(\mathbf{1}),\psi)\simeq \Hom_{P^w\cap N}(\1,\psi)$ (by Frobenius duality as in
\cite[2.29. Proposition]{BZ}). The result now follows from the fact that $P^w\cap N$ always contains
some $N_i$ for $i=1,\dots,n-1$.
\end{proof}

This has the following consequence.

\begin{lemma}\label{B}
For $w\in R$, a distribution on $\mathcal{C}_c^\infty (ZPwN)$ which is left $P$-invariant and right $(N,\psi)$-equivariant vanishes.
\end{lemma}
\begin{proof}
Call $D$ such a distribution. Note that $Z\times PwN$ is homeomorphic to $ZPwN$ so that $\mathcal{C}_c^\infty (ZPwN)\simeq \mathcal{C}_c^\infty(Z)\otimes \mathcal{C}_c^\infty(PwN)$. Note moreover that the action of $P\times N$ on $\mathcal{C}_c^\infty(Z)\otimes \mathcal{C}_c^\infty(PwN)$ is only on the second factor of the tensor product. Suppose that $D$ is nonzero, then there is $f_0\in \mathcal{C}_c^\infty(Z)$ such that $f\mapsto D(f_0\otimes f)$ is a nonzero
linear map on $\mathcal{C}_c^\infty(PwN)$ which has to be left $P$-invariant and right $(N,\psi)$-equivariant. This contradicts lemma \ref{A}.
\end{proof}

We can now deduce the following:

\begin{prop} \label{matringe}
There is no $\psi$-Whittaker functional on $\ind_P^G(\1)$.
\end{prop}
\begin{proof}
We recall that the map $f\mapsto [g\mapsto \int_P f(pg)dp]$ defines a surjection from $\mathcal{C}_c^\infty(G)$ to $\ind_P^G(\1)$.
In particular the existence of a $\psi$-Whittaker functional on $\ind_P^G(\1)$ would imply that there exists a nonzero left $P$-invariant and right $(N,\psi)$-equivariant distribution on $\mathcal{C}_c^\infty(G)$. By \cite[1.9. Corollary]{BZ}), the space $\mathcal{C}_c^\infty(G)$ admits a filration by the spaces $\mathcal{C}_c^\infty (ZPw_iN)$. In particular the existence of a $\psi$-Whittaker functional on $\ind_P^G(\1)$ would imply the existence of a nonzero left $P$-invariant and right $(N,\psi)$-equivariant distribution on some $\mathcal{C}_c^\infty (ZPw_iN)$, contradicting Lemma \ref{B}.
\end{proof}

\begin{proposition}
Let $\sigma = \widehat{\bigotimes}_v \sigma_v$ be an automorphic cuspidal representation of $G_2(\Q) \backslash G_2(\A)$ such that $\sigma_p$ is generic for some finite prime $p$. Let $P \subseteq \SL_3$ be the mirabolic subgroup (i.e. the subgroup of elements $A \in \SL_3$ such that $A e_1 = e_1$). Then, for any $h \in \sigma^\vee$,
\[ h^{P}(g) = 0. \]
\end{proposition}

\begin{proof}
Given a finite prime $\ell$, we denote by $H_\ell$ the $\Q_\ell$ -points of any of $H \in \{ \SL_3, G_2, P \}$.

We have an exact sequence of $\SL_{3,\ell}$-modules (via the natural left action)

\[1 \rightarrow \SL_{3,\ell}/P_\ell  \rightarrow G_{2,\ell}/P_\ell \rightarrow  G_{2,\ell}/\SL_{3,\ell} \rightarrow 1\]
inducing the exact sequence
\mathcal{C}^\infty_c(G_{2,\ell}/\SL_{3,\ell}) \rightarrow \mathcal{C}^\infty_c(G_{2,\ell}/P_\ell) \stackrel{\alpha}{\rightarrow} \mathcal{C}^\infty_c(\SL_{3,\ell}/P_\ell).

Let $\psi$ be a non-degenerate character of the unipotent radical $N_{2,\ell}$ of the Borel subgroup of $G_{2,\ell}$.

According to \cite[Lemma 4.10]{GrossSavin} in the case where $F=\Q_\ell$ and $K=\Q_\ell \times \Q_\ell$, the $G_{2,\ell}$-module $\mathcal{C}^\infty_c(G_{2,\ell}/\SL_{3,\ell})$ does not have a Whittaker functional. Thus, any $N_{2,\ell}$-invariant functional \[F: \mathcal{C}^\infty_c(G_{2,\ell}/P_\ell) \rightarrow \psi \]
factors as
\[F: \mathcal{C}^\infty_c(G_{2,\ell}/P_\ell) \twoheadrightarrow  \mathcal{C}^\infty_c(G_{2,\ell}/\SL_{3,\ell}) \backslash \mathcal{C}^\infty_c(G_{2,\ell}/P_\ell) \rightarrow \psi. \]

After restricting to $\SL_3$, $\psi$ defines a character of the unipotent radical of the Borel of $\SL_3$ and $F$ gives a $N_{\SL_3,\ell}$-equivariant map \[ F: {\rm coker}(\alpha) \to \psi. \]

According to Proposition \ref{matringe}, the $\SL_3(\Q_p)$-module $\mathcal{C}^\infty_c(\SL_3(\Q_p)/P(\Q_p))$ does not have a Whittaker functional. This implies that the $G_2(\Q_p)$-module $\mathcal{C}^\infty(G_2(\Q_p)/P(\Q_p))$ does not have a Whittaker functional.

We now argue as in \cite[Corollary 4.9]{GrossSavin}. Assume there is a non-zero $h \in \sigma^\vee$ such that $h^P(g) \neq 0$. This implies, by Frobenius reciprocity, that $\sigma_v$ is a quotient of $\mathcal{C}_c^\infty(G_2(\Q_v)/P(\Q_v))$ for every place $v$. In particular, for $v = p$, this is in contradiction with the fact that $\sigma_p$ is generic. This implies the result.
\end{proof}

\end{comment}

\begin{corollary} \label{corocusptheta}
Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$. Assume that \begin{enumerate}
\item $\sigma_\infty$ is a discrete series;
\item there exists a finite place $p$ such that $\sigma_p$ is Steinberg.
\end{enumerate} Then $\Theta(\sigma)$ is cuspidal.
\end{corollary}

\begin{proof}
We distinguish two cases. We first suppose that $\sigma$ is globally generic. Then  we apply \cite[Theorem 1.7(ii)]{harris-khare-thorne} to deduce that its theta lift is cuspidal. If, instead, $\sigma$ is not globally generic, the result follows from Theorem \ref{cuspidality} as the Steinberg representation $\sigma_p = {\rm St}_{G_2}$ is generic.
\end{proof}

\subsection{Calculation of orbits} \label{subsetorbits}

This preparatory section presents an elementary but crucial calculation needed in the proof of Proposition \ref{PropFCperiod}.\\

Let $e: \Q \backslash \A \rightarrow \C^\times$ be the standard non-trivial character introduced in \S \ref{Fouriercoefficientsgsp6} and let $A \in J(\Q)$. We define the character $\psi_A: N(\Q) \backslash N(\A) \rightarrow \C^\times$ by $\psi_A(X) = e(\mathrm{Tr}(A \circ X))$ where $A \circ X=\frac{1}{2}(AX+XA)$ is the Jordan product. Recall from \S \ref{Fouriercoefficientsgsp6} that, for any $B \in J_3(\Q)$,  we define a character $\psi_B: U_3(\Q) \backslash U_3(\A) \rightarrow \C^\times$ by $\psi_B(n(X)) = e(\mathrm{Tr}(B X))$. In particular, we have denoted $\psi_D$ the character associated to
\[ \alpha_D =\begin{pmatrix} 0
&  & \\
& -D & \\
&  & 1
\end{pmatrix} \in J_3(\Q). \]  Define
\[ \omega(\Q):=\{A \in \Omega(\Q) \,|\, \psi_A|_{U_3(\A)}=\psi_D \}, \]
i.e. the set of rank 1 matrices in $J(\Q)$ inducing the same character as $\alpha_D$ on the unipotent radical of the Siegel parabolic. In the following, we will always see $\omega(\Q)$ inside $\overline{N}(\Q)$. In particular, if $g \in \GL_3(\Q) \subseteq M(\Q)$, its action on $A$ is the dual action to \eqref{EqactionM}, namely $g \cdot A = \det(g) (g^t)^{-1} A g^{-1}$. Finally, denote by $A(x,y,z)$ the matrix ${\begin{pmatrix}
0 & \overline{z} & y\\
z & -D & \overline{x}\\
\overline{y} & x & 1
\end{pmatrix}} \in J$.

\begin{lemma}\label{lemmabeforeorbits}
We have
\[\omega(\Q)=\left\{ A(x,y,z) \, : \,  \mathrm{Tr}(x)=\mathrm{Tr}(z)=0, \mathrm{N}(x)=-D, N(z)=0,  z \in x^\perp, y=-D^{-1}zx \right \}.\]
\end{lemma}

\begin{proof} Let
A= \begin{pmatrix}
d & \overline{z} & y\\
z & e & \overline{x}\\
\overline{y} & x & f
\end{pmatrix} \in J
Similarly to the proof of \cite[Lemma 3.4]{GrossSavin}, the condition $\psi_A|_{U_3(\A)}=\psi_D$  is equivalent to
d=0, \;\; e=-D, \;\; f=1,
\overline{x}=-x, \;\; \overline{y}=-y, \;\; \overline{z}=-z
The condition that $A$ has rank $1$ gives
\mathrm{N}(x)=-D, \;\; \mathrm{N}(y)=\mathrm{N}(z)=0, $$
yz=0, \;\; zx=-Dy, \;\; xy=z.
We claim that these conditions imply that $z \in x^\perp$, which means that $z\overline{x}+x\overline{z}=0$, or equivalently $zx=-xz$. Indeed, multiplying $z = xy$ on the left by $x$ and using alternativity, we obtain
xz = x(xy) = (xx)y = Dy = -zx.
Finally, as $\mathrm{N}(x)=-D$ and $\mathrm{Tr}(x)=0$, we have $x^2=D$ and hence $x^{-1}=D^{-1}x$, which implies that
$$y = x^{-1} z = D^{-1} xz.$$
This shows one inclusion of the statement.

In the other direction let $x, z \in \mathbb{O}$ be as in the right hand side of the statement. We have to show that $y := -D^{-1}zx$ has norm and trace equal to zero and that $xy=z$. We have $$
\mathrm{N}(y)=(-D)^{-2} \mathrm{N}(z) \mathrm{N}(x)=0
\mathrm{Tr}(y)=-D^{-1}\mathrm{Tr}(zx)=-D^{-1} \mathrm{Tr}(xz)=D^{-1} \mathrm{Tr}(zx)=-\mathrm{Tr}(y) $$
because $xz=-zx$. Hence $\mathrm{Tr}(y)=0$. Moreover
xy=-D^{-1}x(zx)=D^{-1}x(xz)=D^{-1}(xx)z=z. $$
This shows that $A \in \omega(\Q)$ and concludes the proof of the lemma.
\end{proof}

As for any $A(x,y,z) \in \omega(\Q)$, the octonion $y=-D^{-1}zx$ is determined by $x$ and $z$ and we will often denote $A(x,y,z)$ by $A(x,z)$. Note that there is an action of $G_2(\Q)$ on the set $\omega(\Q)$ given by the action on the coefficients. The following proposition describing the orbits of this action will be essential.

\begin{proposition} \leavevmode \label{orbits}
The group $G_2(\Q)$ acts on $\omega(\Q)$ with a finite number of orbits. Moreover, representatives of the orbits and their respective stabilizers are given as follows.
\begin{enumerate}
\item If $D$ is a square in $\Q^\times$:
\begin{enumerate}
\item $A_3 = A(x,0)$, where $x = (s_4-t_4) \sqrt{D}$ and $\mathrm{Stab}_{G_2(\Q)}(A(x, 0)) \cong \SL_3$, where $\SL_3$ is embedded   into $G_2$ as \S \ref{subsub:RootsandHeisenberg}.
\item  $A_2 = A(x, t_3)$ with $\mathrm{Stab}_{G_2}(A_2) = \SL_2 V \subset \SL_3$, where $\SL_2$ and $V$ embed into $\SL_3$ as in \S \ref{cuspidalityandperiodvanishing}.
\item $A_1 = A(x, s_3)$ with $\mathrm{Stab}_{G_2}(A_1) = \SL_2 \overline{V} \subset \SL_3$, where $\SL_2$ is as in (1)(b) and $\overline{V}$ is the opposite unipotent subgroup to $V$.
\item $A_0 = A(x, s_1+t_3)$ with $\mathrm{Stab}_{G_2}(A_0) = U_D,$ where  $U_D$ denotes the unipotent radical of the upper-triangular Borel of $\SL_3$ (denoted by $U_{\SL_3}$ in \S \ref{cuspidalityandperiodvanishing}).
\end{enumerate}
\item If $D$ is not square in $\Q^\times$:
\begin{enumerate}
\item $A_1 = A(x,0) \in \omega(\Q)$, for any $x \neq 0$ for which $N(x)=-D$, with \[\mathrm{Stab}_{G_2(\Q)}(A(x,0)) \cong \SU(2,1).\] To emphasize its dependence on $D$, we denote this stabilizer by $\SU_D(2,1)$.
\item $A_0 = A(x, z)$, for any norm zero $z$ in $x^\perp$, with $\mathrm{Stab}_{G_2}(A_0) \simeq U_{D}$, where $U_D$ denotes the unipotent radical of the upper-triangular Borel of $\SU_D(2,1)$.
\end{enumerate}
\end{enumerate}
\end{proposition}

\begin{comment}
Note that $G_2(\Q)$ acts on the set $\omega(\Q)$. As for any $A(x,y,z) \in \omega(\Q)$, the octonion $y=-D^{-1}zx$ is determined by $x$ and $z$, we will simply denote $A(x,y,z)$ by $A(x,z)$. Let $\omega_0(\Q) \subset \omega(\Q)$ be the subset where $z=0$.

\begin{lemma}\label{lemma:orbitscasetrivial} The following assertions hold.
\begin{itemize}
\item[(i)] The group $G_2(\Q)$ acts transitively on $\omega_0(\Q)$.
\item[(ii)] Suppose that $D$ is a square in $\Q$. Let $A(x,0) \in \omega_0(\Q)$. Then $\mathrm{Stab}_{G_2(\Q)}(A(x,0))$ is isomorphic to $\mathbf{SL}_3$.
\item[(iii)] Suppose that $D$ is not a square in $\Q$. Let $A(x,0) \in \omega_0(\Q)$. Then $\mathrm{Stab}_{G_2(\Q)}(A(x,0))$ is isomorphic to $\SU(2,1)$ and acts transitively on the set of $y \in x^\perp$ such that $\mathrm{N}(y)=0$. To emphasize its dependence on $D$, we denote this stabilizer by $\SU_D(2,1)$
\end{itemize}
\end{lemma}
\end{comment}

\begin{proof}
\textit{Step 1.} By \cite[Theorem 1]{rallis-schiffmann}, the group $G_2$ acts transitively on the set of trace zero elements of norm $-D$ and hence on the sets $A(x, 0)$.
%We prove (1)(a) and (2)(a). We begin by proving that $G_2$ acts transitively on the set of elements $A(x,0)$. Indeed, let $x, x' \in \mathbb{O}^0$ be trace zero octonions such that $\mathrm{N}(x)=\mathrm{N}(x')=-D$. We want to show that there exists an element $g \in G_2(\Q)$ such that $g A(x,0) = A(x', 0)$, or equivalently $g x = x'$. \joaquin{Can't we cite \cite[Theorem 1]{rallis-schiffmann} for this?} By choosing $z \in \mathbb{O}^0$ such that $\mathrm{N}(z)=D$, which is always possible, and by replacing $x$ by $xz^{-1}$ and $x'$ by $x' z^{-1}$, we are reduced to $D=1$, hence to $x^2=(x')^2=1$. Write $e_1=\frac{1}{2}(1-x)$, $e_2=\frac{1}{2}(1+x)$, $e'_1=\frac{1}{2}(1-x')$ and $e'_2=\frac{1}{2}(1+x')$. Then we can decompose
%\mathbb{O} &=& \Q e_1 \oplus \Q e_2 \oplus \mathbb{H}^0 e_1 \oplus \mathbb{H}^0 e_2\\
%&=& \Q e'_1 \oplus \Q e'_2 \oplus \mathbb{H}^0 e'_1 %\oplus \mathbb{H}^0 e'_2,
%where $\mathbb{H}^0$ denotes the traceless elements of $\mathbb{H}$. Then the linear map defined by $e_1 \mapsto e'_1$, $e_2 \mapsto e'_2$, $h e_1 \mapsto h e'_1$, $he_2 \mapsto h e'_2$, $h \in \mathbb{H}^0$, is an element of $G_2(\Q)$ sending $x$ to $x'$. This proves the claim.
The description of the stabilizer in (1)(a) follows from \cite[Theorem 4]{jacobson} or \cite[Lemma 2]{rallis-schiffmann}. The description of the stabilizer in (2)(a) follows from \cite[Theorem 3]{jacobson} or \cite[Lemma 3]{rallis-schiffmann}. More precisely, according to \cite[Lemma 3]{rallis-schiffmann} the space $x^\perp$ has the structure of a $3$-dimensional $\Q(\sqrt{D})$-vector space and the action of $\mathrm{Stab}_{G_2}(x)$ on $x^\perp$ induces an isomorphism $\mathrm{Stab}_{G_2}(x) \simeq \SU_D(2,1)$.
%By Witt's theorem for the unitary group, the group $\SU_D(2,1)$ acts transitively on the $y \in x^\perp$ of a given norm. The statement follows.

\textit{Step 2.} We now study the remaining $G_2$-orbits when $D$ is a square in $\Q$. Again, we can assume that $D = 1$. Recall from \S \ref{subsub:RootsandHeisenberg} that $\SL_3$ embeds into $G_2$ as the stabilizer of $s_4 - t_4$. This identification is explicitly given as follows (cf. \cite[Lemma 2]{rallis-schiffmann}). An element of $g \in \SL_3$ induces an action on $\mathbb{O}^0$ fixing $s_4 - t_4$ and given by the left multiplication by $g$ on $\langle s_1, s_2, s_3 \rangle$ and by $(g^t)^{-1}$ on $\langle t_1, t_2, t_3 \rangle$. One verifies that this actions respects multiplication and hence defines an element in $G_2$.
%\[ A( r (t_4 - s_4) + \alpha s_4 + \beta t_4) := r (t_4 - s_4) + A(\alpha) s_4 + (A^*)^{-1}(\beta) t_4 . \] One checks (\cite[\S 1.3]{rallis-schiffmann}) that the operator $A$ thus defined preserves the quadratic form and that it belongs to $G_2$ if and only if $A \in \SL(\mathbb{H}^0)$. This embeds $\SL(\mathbb{H}^0)$ as a closed subgroup of $G_2$. We identify $\SL(\mathbb{H}^0) = \SL(\mathbb{H}^0 s_4) = \SL_3$ acting in the natural way on the basis $\{ s_1, s_2, s_3 \}$ of $\mathbb{H}^0 s_4$. As $D = 1$, we can assume that $x = s_4 - t_4$.
Assume $z \neq 0$ is such that $A(x,z) \in \omega(\Q)$. Since $z$ is trace zero and orthogonal to $x = s_4 - t_4$ we can write $z = z_1 + z_2$ with $z_1 = \sum_i \alpha_i s_i$ and $z_2 = \sum_i \beta_i t_i$. Since the group $\SL_3$ acts transitively on the non-zero elements of $\langle s_1, s_2, s_3 \rangle$ and $\langle t_1, t_2, t_3 \rangle$, then the cases where $z_1 = 0$ or $z_2 = 0$ give rise to exactly two orbits. When $z_1 = 0$, taking $z_2 = t_3$ as a generator of this orbit, the corresponding stabilizer is \[  \left\{ \begin{pmatrix} * & * & * \\ * & * & * \\ 0 & 0 & 1 \end{pmatrix} \right\}\subset \SL_3, \] which coincides with $\SL_2 V$ as in (1)(b). Similarly, when $z_2 = 0$, taking $z_1 = s_3$ as the generator of the orbit, then the stabilizer is \[\left\{ \begin{pmatrix} * & * & 0 \\ * & * & 0 \\ * & * & 1 \end{pmatrix} \right\}\subset \SL_3.\]
This is nothing but $\SL_2 \overline{V}$, with $\SL_2$ which again embeds in the Levi of the long root parabolic $P_a$ and $\overline{V}$ is the opposite unipotent subgroup to $V$ generated by the negative roots $-a-3b$, $-2a-3b$. Finally we treat the case $z_1, z_2 \neq 0$. Write
\begin{equation*}
z = \alpha_1 s_1 + \alpha_2 s_2 + \alpha_3 s_3 + \beta_1 t_1 + \beta_2 t_2 + \beta_3 t_3.
\end{equation*}
The condition $N(z) = 0$ translates then in
\begin{equation} \label{eqortho} \alpha_1 \beta_1 + \alpha_2 \beta_2 + \alpha_3 \beta_3 = 0.
\end{equation} We can assume that $z_2 = t_3$. Then $\alpha_3 = 0$ by \eqref{eqortho} and, using the action of the stabilizer of $t_3$, we can assume that $z_1 = s_1$. It is then immediate to check that the stabilizer of $A(s_4-t_4,s_1+t_3)$ is as in (1)(d). This concludes the proof of (1).

\begin{comment}
\begin{lemma}\label{lem:caseofnosquare}
Suppose that $D$ is not a square.  $G_2$ acts on the set $\omega(\Q) $ with 2 orbits, one open and one closed. A system of representatives of each orbit and their respective stabilizers are given as follows:
\begin{enumerate}
\item $A_1 = A(x_0, 0)$ with $\mathrm{Stab}_{G_2}(A_1) = \SU_D(2,1)$.
\item $A_0 = A(x_0, z_0)$ with  stabilizer $\mathrm{Stab}_{G_2}(A_0) =U_{D}$, where $U_D$ denotes the unipotent radical of the upper-triangular Borel of $\SU_D(2,1)$.
\end{enumerate}
\end{lemma}
\end{comment}

\textit{Step 3.} We finally deal with the case where $D$ is not a square in $\Q$. By Witt's theorem, the group $\SU(2,1)$ acts transitively on the isotropic vectors of the three dimensional $\Q(\sqrt{D})$ vector space $x^\perp$. We thus have two orbits for $G_2(\Q)$ on $\omega(\Q)$, generated by $A(x,0)$ and $A(x,z)$, where $z$ is any non-zero vector in $x^\perp$ with zero norm. We are now left with calculating the stabilizer of the latter orbit.
Recall that the action of $\SU(2,1)$ on $x^\perp$ is given by its natural action on $\Q(\sqrt{D})^3$. More precisely, after extending scalars to $\Q(\sqrt{D})$, we can decompose \[ x^\perp \otimes_\Q \Q(\sqrt{D}) = \Q(\sqrt{D}) \langle s_1,s_2,s_3 \rangle \oplus \Q(\sqrt{D}) \langle t_1,t_2,t_3 \rangle.   \]
The projection to the first component induces an isomorphism of $\Q(\sqrt{D})$-vector spaces $x^\perp \simeq \Q(\sqrt{D}) \langle s_1,s_2,s_3 \rangle$ (cf. \cite[Lemma 3]{rallis-schiffmann}), with $\SU(2,1)$ acting naturally on the basis $\{s_1,s_2,s_3\}$. Here, we choose the Hermitian form defining $\SU(2,1)$ given by \[\left( \begin{smallmatrix}   &  &  \sqrt{D}^{-1} \\  & 1 &   \\ - \sqrt{D}^{-1} &  &  \end{smallmatrix} \right) \in \GL_3(\Q(\sqrt{D})).\] We can then suppose that $z$ is sent to $s_1$ and the corresponding stabilizer is given by \[ \left \{ \begin{pmatrix} 1 & * & * \\ 0 & * & * \\ 0 & * & * \end{pmatrix} \right \} \cap \SU(2,1) = U_D.\]
\end{proof}

\subsection{Non-vanishing of Fourier coefficients I}

Recall that we have denoted by $\Pi=\bigotimes'_v \Pi_v$ the minimal representation of the group $E_7$. Moreover, in \S \ref{sub:thetaliftg2pgsp6}, for $f \in \Pi$ and $\varphi \in \mathcal{A}(G_2(\Q) \backslash G_2(\A))$, we have defined the function $\Theta(f,\varphi)$ on $\mathrm{PGSp}_6(\A)$ by
\begin{equation} \label{Eqthetadef}
\Theta(f,\varphi)(g)=\int_{G_2(\Q) \backslash G_2(\A)} \theta(f)(g'g)\varphi(g')dg'.
\end{equation}
For any $A \in J(\Q)$ and $f \in \Pi$, consider the Fourier coefficient
\theta(f)_A(g)=\int_{N(\Q) \backslash N(\A)} \theta(f)(ng) \psi_A^{-1}(n)dn.
We then have the Fourier expansion (cf. \cite[\S A.3]{harris-khare-thorne})
\begin{equation} \label{EqFourier}
\theta(f)(g)=\theta(f)_0(g)+\sum_{A \in \Omega(\Q)} \theta(f)_A(g),
\end{equation}
where $\Omega(\Q) \subset J(\Q)$ is the subset of rank $1$ elements.
\begin{comment}
\begin{lemma} Suppose that $D$ is not a square in $\Q$ and let $N_D \subset \mathrm{SU}_D(2,1)$ be as in \cite[\S 4]{Ginzburg-Rallis-Soudry2}. Then, if $$\int_{[N_D]}h(ng)dn \neq 0$$ for some $h \in V_\sigma$ and some $g \in G_2(\A)$, then
\[ \Theta(f, h)_{U_Q, \psi} \neq 0\]
for some choice of $f$. In particular $\Theta(f,h) \neq 0$ for some choice of $f$.
\end{lemma}
\end{comment}

The following Lemma will be used in the proof of Proposition \ref{PropFCperiod}. Its proof is similar to the one of \cite[Lemma 4.6]{GrossSavin} but we give details for the convenience of the reader. Let $A_0$ be the representative of the open $G_2$-orbit on $\omega(\Q)$ given in Proposition \ref{orbits}.  Note that there is no harm in conjugating   $A_0 \in J(\Q)$ by an element of the Levi $\GL_3(\Q)$ of the Siegel parabolic of $\PGSp_6$. Thus, conjugating by $\mathrm{diag}(n,n,n)$, $A_0$ gets multiplied by $n^2$ and so we can assume that the entries $x,y,z$ of $A_0$ are in $\mathbb{O}(\Z)$.

\begin{lemma} \label{technical}
Let $S$ denote a finite number of places containing 2 and $\infty$, and let $f = \otimes_v'f_v \in \Pi$ be such that, for $v \notin S$, we have $f_v=f_v^0$ where $f_v^0$ denotes the spherical vector normalized such that $f_v^0(A_0)=1$. Let $\Q_S=\prod_{v \in S} \Q_v$. If $g \in G_2(\A)$, we write $g=g_Sg^S$ where $g_S \in G_2(\Q_S)$ and $g^S \in \prod_{v \notin S} G_2(\Q_v)$. Then there exists a non-zero constant $c_{A_0}$ such that for every $g \in G_2(\A)$ we have
\theta(f)_{A_0}(g)=c_{A_0} f_S(g_S^{-1}A_0)\prod_{v \notin S} \chi_v(g_v)
where $f_S=\bigotimes_{v \in S} f_v$ and $\chi_v$ is the characteristic function of $U_D(\Z_v) \backslash G_2(\Z_v)$.
\end{lemma}

\begin{proof} By uniqueness of local functionals (\cite[Theorem A.4]{harris-khare-thorne}), there exists a non-zero scalar $c_{A_0}$ such that for any $g \in E_7(\A)$, we have $\theta(f)_{A_0}(g)=c_{A_0} (\Pi(g)f)(A_0)$. For $g \in G_2(\A)$ we have $(\Pi(g)f)(A_0)=f(g^{-1}A_0)$ where $g^{-1}A_0$ is the result of the natural action of $g^{-1}$ on the off diagonal entries of $A_0$. Hence $\theta(f)_{A_0}(g)=c_{A_0}f(g^{-1}A_0)=c_{A_0} \prod_v f_v(g_v^{-1}A_0)$ for $g \in G_2(\A)$. Let us prove that for any $p \notin S$, we have $f_p(g_p^{-1}A_0)=\chi_p(g_p)$. So let $g_p \in G_2(\Q_p)$ be such that $f^0_p(g_p^{-1}A_0) \neq 0$ and let $x',y',z'$ denote the off diagonal entries of $g_p^{-1}A_0$. According to \cite[Theorem A.5]{harris-khare-thorne} the spherical vector $f_p^0$ is supported in $J(\Z_p)$. Hence $x',y',z' \in \mathbb{O}(\Z_p)$. Consider $\mathbb{O}(\F_p)$ the split octonion algebra over $\F_p$. The projections of $(x,y,z)$ and $(x',y',z')$ to $\mathbb{O}(\F_p)$ are $G_2(\F_p)$-conjugated by the proof of Step 1 in Proposition \ref{orbits}, which is still valid over the base field $\F_p$ as long as $p \neq 2$. It follows from Hensel lemma that $(x,y,z)$ and $(x',y',z')$ are $G_2(\Z_p)$-conjugated. Therefore the function $g_p \mapsto f_p^0(g_p^{-1}A_0)$ is supported in $U_D(\Z_p) \backslash G_2(\Z_p) \subset U_D(\Q_p) \backslash G_2(\Q_p)$. Since $f_p^0$ is $G_2(\Z_p)$-invariant, for $g_p \in G_2(\Z_p)$ we have $f_p^0(g_p^{-1}A_0)=f_p^0(A_0)=1$. This completes the proof.
\end{proof}

\begin{proposition} \label{PropFCperiod}
Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$ as in Theorem \ref{cuspidality} and let $\varphi \in \sigma^\vee$ be a cuspidal form. Then, the following conditions are equivalent
\begin{enumerate}
\item $\Theta(f, \varphi)_{U_P, \psi_D}(1) \neq 0$ for some choice of $f$.
\item $\varphi^{U_D}(g) \neq 0$ for some  $g \in G_2(\A)$.
\end{enumerate}
In particular, if any of the conditions holds then $\Theta(\sigma)$ is non-zero.
\end{proposition}

\begin{proof}
Recall first that, according to Proposition \ref{PropFC}, we have $\Theta(f, \varphi)_{U_P, \psi_D} \neq 0$ if and only if $\Theta(f, \varphi)_{U_3, \alpha} \neq 0$ for some   $\alpha \in {\rm Sym}^{{\rm rk } 2}(3)(\Q)$ with $\alpha \sim_{ L(\Q)} \alpha_D$. We write
\begin{eqnarray*}
\Theta(f,\varphi)_{U_3, \psi_D}(1) &=& \int_{U_3(\Q) \backslash U_3(\A)} \Theta(f,\varphi)(u) \psi_D^{-1}(u) du \\
&=& \int_{G_2(\Q) \backslash G_2(\A)} \int_{U_3(\Q) \backslash U_3(\A)} \sum_{A \in \Omega(\Q)} \theta(f)_A(ug) \varphi(g)  \psi_D^{-1}(u) du dg,
\end{eqnarray*}
where in the second equality we used the definition \eqref{Eqthetadef} of $\Theta(f, \varphi)$ and the Fourier expansion \eqref{EqFourier} of $\theta(f)$. Since $U_3 \subseteq N$, we have that $\theta(f)_A(ug) = \psi_A(u) \theta(f)_A(g)$ and \[ \int_{U_3(\Q) \backslash U_3(\A)} \psi_A(u) \psi_D^{-1}(u) = \begin{cases} \mathrm{vol}(U_3(\Q) \backslash U_3(\A)) & \text{ if }  \psi_D = \psi_A|_{U_3(\A)} \\ 0 & \text{ otherwise. }\end{cases} \] Hence we have
\begin{equation} \label{eqtmp1}
\Theta(f,\varphi)_{U_3, \psi_D}(1) = \mathrm{vol}(U_3(\Q) \backslash U_3(\A)) \int_{G_2(\Q) \backslash G_2(\A)} \sum_{A \in \omega(\Q)} \theta(f)_A(g) \varphi(g) dg.
\end{equation}

Let $(A_i)_i$ be the finite representatives of the orbits of the action of $G_2(\Q)$ on $\omega(\Q)$ as given by Proposition \ref{orbits}, and write $\mathrm{Stab}_{A_i}$ for the stabilizers of $A_i$ in $G_2$. The integral on the right hand side of \eqref{eqtmp1} becomes
\[ \sum_{i} \int_{G_2(\Q) \backslash G_2(\A)} \sum_{g' \in \mathrm{Stab}_{A_i}(\Q) \backslash G_2(\Q)} \theta(f)_{A_i}(g'g) \varphi(g) dg = \sum_{i} \int_{\mathrm{Stab_{A_i}(\Q)} \backslash G_2(\A)} \theta(f)_{A_i}(g) \varphi(g) dg.\]
Observe now that, by \cite[Theorem A.4]{harris-khare-thorne} we have $\theta(f)_{A_i}(g) = c_{A_i} f(g^{-1} A_i)$ for any $g \in G_2$. Hence, since $\mathrm{Stab}_{A_i}(\A)$ fixes the matrix $A_i$, we deduce that the function $g \mapsto \theta(f)_{A_i}(g)$ is left $\mathrm{Stab}_{A_i}(\A)$-invariant. Making an inner integration over $\mathrm{Stab}_{A_i}(\Q) \backslash \mathrm{Stab}_{A_i}(\A)$ in each term of the outer sum, we deduce that the above equals
\[ \sum_{i} \int_{\mathrm{Stab}_{A_i}(\A) \backslash G_2(\A)} \theta(f)_{A_i}(g) \varphi^{\mathrm{Stab}_{A_i}}(g) dg,\]
where $\varphi^{\mathrm{Stab}_{A_i}}(g)$ denotes the period of $\varphi$ over $\mathrm{Stab}_{A_i}(\Q) \backslash \mathrm{Stab}_{A_i}(\A)$. We now analyse two different possibilities. If $D$ is not a square in $\Q$, then, by $(2)$ of Proposition \ref{orbits},  $G_2(\Q)$ acts on $\omega(\Q)$ with two orbits, one closed and one open. Let $A_0,A_1$ denote representatives of these two orbits with stabilizers $\mathrm{Stab}_{A_0} = U_D$ and $\mathrm{Stab}_{A_1} = \SU_D(2,1)$ in $G_2$. By the proof of Theorem \ref{cuspidality}, $\varphi^{\SU_D(2,1)}(g)=0$, and hence the only surviving term is the one corresponding to the orbit represented by $A_0$. If $D$ is a square in $\Q$, then by $(1)$ of Proposition \ref{orbits}, $G_2(\Q)$ acts on the set $\omega(\Q)$ with four orbits, three closed and one open. Let $A_i, 0 \leq i \leq 3$ denote representatives of those orbits, with $A_0$ representing the open one. The corresponding stabilizers are are $U_D$, $\SL_3$, $\SL_2 V$ and its conjugate $\SL_2 \overline{V}$. By the proof of Theorem \ref{cuspidality}, we have $\varphi^{\SL_3}(g)=0$. By hypothesis  $\sigma$ (and $\sigma^\vee$) is not globally generic, hence Lemma \ref{lem:periodsl2n} implies that  $\varphi^{\SL_2 V}(g)=\varphi^{\SL_2 \overline{V}}(g)=0$. From this, we deduce that, for any $D$,
\begin{equation} \label{Eqtmp1}
\Theta(f,\varphi)_{U_3, \psi_D}(1) = \int_{U_D(\A) \backslash G_2(\A)} \theta(f)_{A_0}(g) \varphi^{U_D}(g) dg ,
\end{equation}
where $\varphi^{U_D}(g)$ is the constant term of $\varphi$ along $U_D$. This shows that if $\Theta(f,\varphi)_{U_3, \psi_D}(1) \neq 0$ then $\varphi^{U_D} \neq 0$ since the period appears as an inner integral of the Fourier coefficient.

\begin{comment}
\textit{Case $2$: $D$ is a square in $\Q$}. In this case, by Lemmas \ref{lemma:orbitscasetrivial}(ii) and \ref{lem:orbitswhensquare}, $G_2(\Q)$ acts on the set $\omega(\Q)$ with four orbits, three closed and one open . Let $A_i, 0 \leq i \leq 3$ denote representatives of those orbits, with $A_0$ representing the open one. We can therefore write as before
\[ \Theta(f,h)_{U_3, \psi_D}(1) = \sum_{i=0}^3 c_{A_i} \int_{G_2(\Q) \backslash G_2(\A)} \sum_{g \in \mathrm{Stab}_{A_i}(\Q) \backslash G_2(\Q)} f(g^{-1} A_i) h(g) dg. \]
As we did above, observing that the inner sum is invariant under the action of $\mathrm{Stab}_{A_i}(\A)$, we can make an inner integration over $\mathrm{Stab}_{A_i}(\Q) \backslash\mathrm{Stab}_{A_i}(\A)$ to reduce the above sum as
\[ \sum_{i=0}^3 c_{A_i} \int_{\mathrm{Stab}_{A_i}(\A) \backslash G_2(\A)} f(g^{-1} A_i) h^{\mathrm{Stab}_{A_i}}(g) dg. \]
We now observe that  all the summands for $i \neq 0$ vanish.
Indeed, by Lemma \ref{lemma:orbitscasetrivial}(ii), the stabilizer $\mathrm{Stab}_{A_3}=\SL_3$ and $h^{\mathbf{SL}_3}(g)=0$ by Theorem \ref{cuspidality}. Similarly, $h^{\mathrm{Stab}_{A_i}}(g)=0$ for $i=1,2$ \anto{This has to be shown using the fact that an element in $C_c^\infty(\mathbf{SL}_3(\Q_p) /\mathrm{Stab}_{A_i}(\Q_p) )$ has no Whittaker function.}
We are left with \[c_{A_0} \int_{U_D(\A) \backslash G_2(\A)} f(g^{-1} A_0) h^{U_D}(g) dg,  \]
where $U_D$ is the unipotent radical of the upper triangular Borel of $\mathbf{SL}_3$. This shows again that if $\Theta(f,h)_{U_3, \psi_D} \neq 0$ then $h^{U_D} \neq 0$.
\end{comment}

We now show the converse, i.e. that if $\varphi^{U_D} \neq 0$ then, for some choice of $f \in \Pi$, the Fourier coefficient $\Theta(f,\varphi)_{U_3, \psi_D}$ does not vanish. Let $S$ be as in Lemma \ref{technical}. By enlarging $S$ if necessary, we can assume that the cusp form $\varphi$ is $G_2(\Z_v)$-invariant for all $v \notin S$. By Lemma \ref{technical}, the integral of \eqref{Eqtmp1} equals
c_{A_0} \cdot \left( \int_{U_D(\Q_S) \backslash G_2(\Q_S)} f_S(g^{-1}A_0)\varphi^{U_D}(g) dg \right) \cdot \prod_{v \notin S} vol(U_D(\Z_v) \backslash G_2(\Z_v), dg_v).
It remains to show that, when $\varphi^{U_D} \neq 0$ then for a good choice of $f$ at the places in $S$, the integral
\int_{U_D(\Q_S) \backslash G_2(\Q_S)} f_S(g^{-1}A_0)\varphi^{U_D}(g)dg \neq 0.
It follows from \cite[Theorem A.4]{harris-khare-thorne} that $f_S$ can be any smooth compactly supported function on $\Omega(\Q_S)$. Let $g_0 \in G_2(\Q_S)$ be such that $\varphi^{U_D}(g_0) \neq 0$. We can take a non-negative $f$ supported in a sufficiently small neighborhood of $g_0$ to ensure the non-vanishing of the integral. This finishes the proof of the proposition.
\end{proof}

\subsection{Non-vanishing of Fourier coefficients II}

The purpose of this section is to prove the following result.

\begin{theorem}\label{thm:thetaliftproperties}
Let $F$ denote a quadratic \'etale algebra and $\sigma = \sigma_\infty \otimes \sigma_f$ be a cuspidal automorphic representation of $G_2(\A)$ such that \begin{itemize}
\item $\sigma_\infty$ is a discrete series in $\mathcal{D}_{3,1}$.
\item there exists a finite prime $p$ such that $\sigma_p$ is Steinberg.
\item  The representation $\sigma$ supports Fourier coefficient associated to the cubic algebra $\Q \times F$.
%\item The representation $\sigma$ supports Fourier coefficient associated to a cubic extension of the form $\Q \times F$, with \[F = \begin{cases} \Q \times \Q & \text{ if } D \equiv 1  \text{ mod }(\Q^\times)^2 \\ \Q(\sqrt{D}) & \text{ otherwise.} \end{cases} \]
\end{itemize}
The theta lift $\Theta(\sigma) = \otimes_v'\Theta(\sigma_v)$ is a non-zero cuspidal automorphic representation of $\PGSp_6(\A)$. Let $\pi$ by any non-zero irreducible subquotient of $\Theta(\sigma)$. Then
\begin{itemize}
\item $\pi_\infty$ is a discrete series of Hodge type $(3,3)$.
\item $\pi_p$ is Steinberg.
\item The representation $\pi$ supports a non-trivial Fourier coefficient of type $(4\, 2)$ associated to $F$.
\end{itemize}
\end{theorem}

\begin{remark}\label{remarkonFCqds}
By \cite[Theorem 3.1]{ganmultcubic}, every irreducible non-trivial automorphic representation of $G_2(\A)$ has a non-zero Fourier coefficient for some \'etale cubic algebra $R$. If $R$ does not split as $\Q \times F$, then, one can show that the theta lift of $\sigma$ supports a Fourier coefficient for the Siegel parabolic associated to a symmetric matrix of rank three. Together with \cite[Theorem A.9]{harris-khare-thorne}, which deals with the generic case, this gives a complete correspondence between Fourier coefficients of $\sigma$ and $\Theta(\sigma)$. A detailed proof of this statement will appear in a forthcoming work of ours.
\end{remark}

%We now want to relate Fourier coefficients of forms of $G_2$ and Fourier coefficients of their theta lifts. The case of Whittaker coefficients has been dealt in Savin's appendix to [32], and we essentially follow his strategy in our setting.

Let us first fix some notations first. Recall from \S \ref{Section:dualpair} that the centralizer of $G_2$ in $M$ is $\GL_3$ and let
\[ U_0 = \left\{ \begin{pmatrix} 1 & a & b \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \right\} \]
be the unipotent radical of its Borel subgroup of upper triangular matrices. Note that the unipotent subgroup $U_0 U_3$ is the unipotent radical of the parabolic subgroup $P$ of $\PGSp_6$ of Levi $\GL_2 \times \GL_1^2$ appearing in \S \ref{subsubsec:fc42}.

\begin{definition} \label{Definitionpsi0}
Define the character $\psi_0: U_0(\Q) \backslash U_0(\A) \to \C^\times$ by sending \[ \psi_0(u) = e(a). \]
\end{definition}
Note that $\psi_0 \psi_D$ is the character (simply denoted by $\psi_D$) on $U_P(\Q) \backslash U_P(\A)$ introduced in \S \ref{subsubsec:fc42}.

As explained in \S \ref{subsetorbits}, we view the space $\Omega$ of rank 1 elements in $J$ inside $\overline{N}$ so that $U_0$ acts on $\Omega$ via the natural right action of $\GL_3 \subseteq M$ on $\overline{N}$. Then, we let $U_0$ act on the left on $\omega$ and hence on the triples $(x,y,z)$ of off-diagonal terms by the rule
\begin{equation} \label{Equationactionu}
u^{-1} \cdot (x,y,z) = (x + ay +bz , y, z).
\end{equation}

\subsubsection{The relation between $U_P$ and $U_H$}

In what follows, we relate the unipotent subgroup $U_0$ to the unipotent radical $U_H$ of the Heisenberg parabolic. Such a relation will be employed in Proposition \ref{prop:comparisonbetweenFC} to establish a relation between Fourier coefficients for the Heisenberg parabolic of $G_2$-cusp forms and Fourier coefficients of type $(4\,2)$ of their theta lifts.

Before stating our result, we make the following comments on the choice of representatives of the open orbits in Proposition \ref{orbits}. First, suppose that $D = d^2$, with $d \in \Q^\times$. There is no harm in assuming $ d \in \Z$. Recall that the stabilizer in $G_2$ of the vector $s_4 - t_4$ can be identified with $\SL_3 = \SL(\langle s_1, s_2, s_3 \rangle)$. Since the Heisenberg parabolic $H = L_H \cdot U_H$ is the stabilizer of the flag $\langle s_1, t_3 \rangle$, its unipotent radical $U_H$ contains $U_D = \mathrm{Stab}_{G_2}(A_0)$, where \[A_0 = A(d(s_4 - t_4), s_1 - t_3, d( s_1 + t_3)) \in J(\Z) \] is the representative of the open orbit of the action of $G_2$ on $\omega(\Q)$ as in Proposition \ref{orbits}. Moreover, $U_H / U_D$ is 2-dimensional and supported on the roots $a+b$ and $a+2b$. Let us now suppose that $D$ is not a square in $\Q^\times$.
\begin{comment}
By Proposition \ref{orbits}, the representative of the open orbit of $G_2$ on $\omega(\Q)$ is given by $A_0=A(x,z)=A(x, - D^{-1}z x , z)$, where $N(x) = -D$ and $z$ is any norm zero octonion perpendicular to $x$. As explained  in \cite[p. 809]{rallis-schiffmann}, the choice of $x$ gives a splitting \[\mathbb{O} = K_x \oplus \mathcal{C}_x, \]
where  $K_x := \Q \oplus \Q x$ and $\mathcal{C}_x$ is its orthogonal complement. Note that $K_x$ is isomorphic to the quadratic extension $\Q(\sqrt{D})$, while the vector space $\mathcal{C}_x$ is contained in $V_7$ and is stable under multiplication by elements of $K_x$. After extending scalars, we can decompose \[ \mathcal{C}_x \otimes K_x = (\mathcal{C}_x \otimes K_x)^+ \oplus (\mathcal{C}_x \otimes K_x)^-, \]
with $(\mathcal{C}_x \otimes K_x)^\pm$ equal to the totally isotropic subspace where (left) multiplication by $x$ acts as (scalar) multiplication by $\pm \sqrt{D}$. The composition of the projection to the first factor with the natural map $\mathcal{C}_x \to \mathcal{C}_x \otimes K_x$ induces an isomorphism \[ \iota_x : \mathcal{C}_x \simeq ( \mathcal{C}_x \otimes K_x)^+.  \]
By using $\iota_x$, we can then choose $A_0=A(x,y,z)$, where $z$ is any non-zero vector in $( \mathcal{C}_x \otimes K_x)^+$ and $y =-\tfrac{1}{D} z x  \in \mathcal{C}_x$ is such that \[ \iota_x(y) = -\tfrac{1}{D}\iota_x( z x) = \tfrac{1}{D} x \iota_x(  z) = \tfrac{1}{\sqrt{D}} \iota_x(z),   \]
where for the second equality we have used the fact that $z$ belongs to $\mathcal{C}_x$ if and only if $z x = - x z$, and for the third one that $x \iota_x(z) = \sqrt{D} \iota_x(z)$.
Recall that $U_0$ acts on the triple $(x,y,z)$ as \begin{align}\label{eq:actionu0nonsplit}
u^{-1} \cdot (x,y,z) = (x + ay+bz,y,z) = (x + z' , y , z),
\end{align}
where $z' \in \mathcal{C}_x$ corresponds to $\iota_x( z') =  \iota_x(ay+bz) =  \tfrac{a}{\sqrt{D}}\iota_x(z) + b \iota_x(z) = (a + b \sqrt{D}) \iota_x(y)$. In the following lemma, we identify this action with the one of the unipotent radical $U_H$ modulo $U_D$. To do so, we further explicit the choice of representative of the orbit as follows.
\end{comment}
The vector $x = s_2 + D t_2$ is a trace zero octonion of norm $D$ and orthogonal to $t_3$. We choose the representative of the open orbit to be \[A_0 = A ( s_2 + D t_2, s_1, t_3) \in J(\Z). \]
%With this choice, the unipotent radical $U_{H}$ acts naturally on this triple, fixing $s_1$ and $t_3$, and, as we explain in the Lemma below, its quotient by $U_D = {\rm Stab}_{G_2}(A_0)$ is isomorphic to $U_0$.

\begin{lemma}\label{lemma:Hactionontriple}
There is a natural surjection $ p: U_{H} \to U_{0}$ inducing an isomorphism
\[ U_{H} / U_D \to U_0. \]
\end{lemma}

\begin{proof}
By the description of the action in \eqref{Equationactionu} and the linear independence of the coordinates $(x,y,z)$ of the representative of the open orbit, one sees that $U_0$ acts freely on it. Hence, the result follows from showing that any element in $U_{H}$ acts on the triple $(x,y,z)$ as an element of $U_0$ and vice versa.
\begin{comment}
It proves the same thing but it is not explicit enough
Notice that, since $u$ fixes $z$ and $y$ and it preserves multiplication, we have
\[ ( u \cdot x) \cdot z = ( u \cdot x) \cdot (u \cdot z) = u \cdot (x z) = u \cdot ( - z x) =   u \cdot ( D y) = Dy.      \]
As $D y = x z$, we have that $(u\cdot x -x) z = z (u\cdot x -x) = 0,$
where the first equality follows from the fact that $u\cdot x$ belongs to the orthogonal complement of $z$, as \[ ( u \cdot x) \cdot z =  u \cdot ( - z x) = - z (u \cdot x).  \]
Since $x y = z$ (cf. Lemma \ref{lemmabeforeorbits}),  we have that
\[(u\cdot x) y =  u \cdot (xy) = u \cdot z = z, \]
and thus
\[ (u\cdot x -x) y = y (u\cdot x -x) = 0.\]
This implies that $\langle u\cdot x -x, y , z \rangle$ forms a null subspace of $V_7$. Since any null subspace of $V_7$ is at most $2$ dimensional, we deduce that for any $u \in U_H$,  there exist $\lambda_1, \lambda_2 \in \Q$ such that \[  u\cdot x = x + \lambda_1 y + \lambda_2 z, \]
i.e. $u \in U_H$ acts on the triple $(x,y,z)$ as \[ u \cdot (x,y,z) = ( x + \lambda_1 y + \lambda_2 z , y , z). \]
Note that $\lambda_1 = \lambda_2 = 0$ if and only if $u \in U_D$. As $U_H / U_D$ is a two dimensional abelian unipotent group, this action coincides with the one of \eqref{Equationactionu},  and thus gives the desired isomorphism \[ U_H / U_D \to U_0.  \]

We now explicit this isomorphism by distinguishing two cases.
\end{comment}
\textit{Case 1.} We start with the case where $D$ is a square in $\Q^\times$.
The action of $U_0$ is given by
\begin{equation} \label{action0}
u^{-1} \cdot (d(s_4 - t_4), s_1 - t_3, d(s_1 + t_3)) =  (d(s_4 - t_4) + (a+db) s_1 +(db-a)t_3, s_1 - t_3, d(s_1 + t_3)).
\end{equation}
Since any element of $U_H$ fixes $s_1$ and $t_3$, it suffices to show that $U_H$ acts on $(s_4 - t_4)$ as an element of $U_0$. We verify this by studying the action of the Lie algebra. By \eqref{decompositionuh}, we know that the Lie algebra of $U_H$ is generated by the Lie algebra of the unipotent upper-triangular subgroup $U_D$ in $\SL_3$ and by the vectors $v_1$ and $\delta_3$. Using the explicit action of the action of the Lie algebra given in \S \ref{subsectLieG2}, one checks that
\[ E_{ij} \cdot (s_4 - t_4) = 0, \]
\[ v_1 \cdot (s_4 - t_4) =  s_1, \]
\[ \delta_3 \cdot (s_4 - t_4) = t_3. \]
\begin{comment}
\begin{equation} \label{action}
u \cdot (s_4 - t_4) = \alpha (s_4 - t_4) + \alpha_1 s_1  + \alpha_2 s_2 + \alpha_3 s_3 + \beta_1 t_1 + \beta_2 t_2 + \beta_3 t_3,
\end{equation}
and using the fact that $\langle s_4 - t_4 , s_i \rangle = \langle s_4 - t_4 , t_i \rangle = \langle s_i, s_j \rangle = \langle t_i, t_j \rangle = 0$ for $1 \leq i, j \leq 3$, and $\langle s_i, t_j \rangle = \delta_{ij}$, one reduces the above claim to showing that
\[
\langle u \cdot (s_4-  t_4), v \rangle = 0
\]
for any $v \in \{ s_1, s_2, t_2, t_3\}$.

Observe first that, since $U_H$ fixes $s_1$ and $t_3$, and since $s_4 - t_4$ is orthogonal to them, then the above equation holds for these two elements. For the other two, we check it at the level of the $\mathfrak{g}_2$-action. Using the description of \cite[2.2]{Pollack-G2}, the Lie algebra of $U_H$ is generated by the unipotent upper-triangular matrices in $\SL_3$ and by other root subspaces, which are associated to the two elements $v_1 = (s_4 - t_4) \wedge s_1 + t_2 \wedge t_3, \delta_3 = (s_4 - t_4) \wedge t_3 + s_1 \wedge s_2$, which are elements in the Lie algebra $\mathfrak{g}_2$, as the latter is identified with a subspace of $\wedge^2 V_7$. With this identification, the action is given by the formula (\cite[\S 2.2]{Pollack-G2})
\[ (w \wedge x) \cdot v = \langle x, v \rangle w - \langle w, v \rangle x. \]
From this, one checks that
\begin{align*}
v_1 \cdot t_1 &= s_4 - t_4, \;\;  v_1 \cdot t_2  = v_1 \cdot t_3 =0, \\ v_1 \cdot s_1 &= 0, \;\; v_1 \cdot s_3 = t_2, \;\; v_1 \cdot s_2 = - t_3, \\
\delta_3 \cdot t_1 & = -s_2, \;\; \delta_3 \cdot t_2 = s_1, \;\; \delta_3 \cdot t_3 =0, \\ \delta_3 \cdot s_3 &= s_4 - t_4, \; \; \delta_3 \cdot s_1  = \delta_3 \cdot s_2 =0 .
\end{align*}

Since $\mathfrak{u}_H = \mathfrak{u}_{B_{\SL_3}} \oplus \C v_1 \oplus \C \delta_3$, and since $\mathfrak{sl}_3$ kills the vector $s_4 - t_4$, one reduces to studying the action of the two one parameter subgroups $U_{v_1}, U_{\delta_3} $ of $U_H$ corresponding to $v_1$ and $\delta_3$. The above computations show that, for $u_1 = x_{a+b}(\lambda) \in U_{v_1}$ for some scalar $\lambda$, plugging $u_1$ in Equation \eqref{action}, we have $\alpha_i = \langle u (s_4 - t_4), t_i \rangle = \langle -\lambda s_1, t_i \rangle$, and thus $\alpha_1= -\lambda$, $\alpha_2 = \alpha_3 = 0$. Similarly, as $\beta_i =  \langle -\lambda s_1, s_i \rangle$, we have that $\beta_1 = \beta_2=\beta_3 = 0$. Finally, as the action of $u_1$ preserves the norm, we must have that $\alpha = 1$.
\end{comment}
The above equations show that, for $u_1 = x_{a+b}(\lambda_1)$ and $u_2 = x_{a+2b}(\lambda_2)$ for some scalars $\lambda_1, \lambda_2$, we have \[ u_1 \cdot (d(s_4 - t_4)) = d(s_4 - t_4 + \lambda_1 s_1), \]
\[ u_2 \cdot (d(s_4 - t_4)) = d(s_4 - t_4 + \lambda_2 t_3).\]
This gives the desired isomorphism: if $u \in U_H /U_D$ is identified with the product of $x_{a+b}(\lambda_1) x_{a+2b}(\lambda_2)$, then, from Equation \eqref{action0}, we see that it gets sent to the element \[\begin{pmatrix} 1 &  d\tfrac{\lambda_1 - \lambda_2}{2} &   \tfrac{\lambda_1 + \lambda_2}{2} \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \in U_0. \]

\textit{Case 2.} We now suppose that $D$ is not a square in $\Q^\times$. Similarly to Case 1, it suffices to calculate $u\cdot (s_2 + D t_2)$ for any $u \in U_H$. As above, one checks that
\begin{align*}
E_{12} \cdot (s_2 + D t_2) &= s_1,\\
E_{23} \cdot (s_2 + D t_2) &= D t_3,\\
E_{13} \cdot (s_2 + D t_2) &= 0,\\
v_1 \cdot (s_2 + D t_2)  &=  t_3,\\
\delta_3 \cdot (s_2 + D t_2)  &= - D s_1.
\end{align*}
This implies that if $u \in V_H = U_H / [U_H,U_H]$ equals to $x_a(\lambda_1)x_{a+b}(\lambda_2) x_{a+2b}(\lambda_3)x_{a+3b}(\lambda_4)$, then \[ u \cdot (s_2 + D t_2) = s_2 + D t_2 + (\lambda_1 - \lambda_3 D) s_1 + (\lambda_2 + D \lambda_4) t_3. \]
In particular, $U_D$ embeds into $U_H$ as the subgroup of matrices with $\lambda_1 = \lambda_3 D$ and $\lambda_2 = - \lambda_4 D$, and the map $p: U_H/U_D \to U_0$ sends $u$ to the element \[\begin{pmatrix} 1 &  \lambda_1 - \lambda_3 D &   \lambda_2 + \lambda_4 D \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \in U_0. \]

\begin{comment}

\textit{Case 1.} We start with the case where $D$ is a square in $\Q^\times$.
The action of $U_0$ is given by
\begin{equation} \label{action0}
u^{-1} \cdot (d(s_4 - t_4), s_1 - t_3, d(s_1 + t_3)) =  (d(s_4 - t_4) + (a+db) s_1 +(db-a)t_3, s_1 - t_3, d(s_1 + t_3)).
\end{equation}
Since any element of $U_H$ fixes $s_1$ and $t_3$, it suffices to show that, if $u \in U_H$, then
\[ u (s_4 - t_4) \in \langle s_4 - t_4, s_1, t_3 \rangle. \]
To show this, we use the $G_2$-equivariant bilinear trace pairing $\langle \cdot, \cdot \rangle : V_7 \times V_7 \to \Q$, recalling that $V_7$ is the standard 7-dimensional representation of $G_2$ given by trace zero octonions.

Using the description of \cite[2.2]{Pollack-G2} (see also \eqref{decompositionuh}), the Lie algebra of $U_H$ is generated by the Lie algebra of unipotent upper-triangular subgroup $U_D$ in $\SL_3$ and by the root subspaces of $v_1$ and $\delta_3$. These choices can be made precise as follows. The Lie algebra $\mathfrak{g}_2$ can be identified with a subspace of $\wedge^2 V_7$ and, under this identification, the  $\mathfrak{g}_2$-action on $V_7$ is given by the formula
\[ (w \wedge x) \cdot v = \langle x, v \rangle w - \langle w, v \rangle x. \]  Moreover, the elements $E_{ij} = t_j \wedge s_i$, $1 \leq i < j \leq 3$ define the standard basis vectors of $\mathfrak{sl}_3$, and the other two vectors generating $\mathfrak{u}_H$ are explicitly $v_1 = (s_4 - t_4) \wedge s_1 + t_2 \wedge t_3, \delta_3 = (s_4 - t_4) \wedge t_3 + s_1 \wedge s_2$.

From this explicit description, one checks that \anto{I checked that there was a sign mistake}
\[ E_{ij} \cdot (s_4 - t_4) = 0, \]
\[ v_1 \cdot (s_4 - t_4) =  s_1, \]
\[ \delta_3 \cdot (s_4 - t_4) = t_3. \]

\begin{equation} \label{action}
u \cdot (s_4 - t_4) = \alpha (s_4 - t_4) + \alpha_1 s_1  + \alpha_2 s_2 + \alpha_3 s_3 + \beta_1 t_1 + \beta_2 t_2 + \beta_3 t_3,
\end{equation}
and using the fact that $\langle s_4 - t_4 , s_i \rangle = \langle s_4 - t_4 , t_i \rangle = \langle s_i, s_j \rangle = \langle t_i, t_j \rangle = 0$ for $1 \leq i, j \leq 3$, and $\langle s_i, t_j \rangle = \delta_{ij}$, one reduces the above claim to showing that
\[
\langle u \cdot (s_4-  t_4), v \rangle = 0
\]
for any $v \in \{ s_1, s_2, t_2, t_3\}$.

Observe first that, since $U_H$ fixes $s_1$ and $t_3$, and since $s_4 - t_4$ is orthogonal to them, then the above equation holds for these two elements. For the other two, we check it at the level of the $\mathfrak{g}_2$-action. Using the description of \cite[2.2]{Pollack-G2}, the Lie algebra of $U_H$ is generated by the unipotent upper-triangular matrices in $\SL_3$ and by other root subspaces, which are associated to the two elements $v_1 = (s_4 - t_4) \wedge s_1 + t_2 \wedge t_3, \delta_3 = (s_4 - t_4) \wedge t_3 + s_1 \wedge s_2$, which are elements in the Lie algebra $\mathfrak{g}_2$, as the latter is identified with a subspace of $\wedge^2 V_7$. With this identification, the action is given by the formula (\cite[\S 2.2]{Pollack-G2})
\[ (w \wedge x) \cdot v = \langle x, v \rangle w - \langle w, v \rangle x. \]
From this, one checks that
\begin{align*}
v_1 \cdot t_1 &= s_4 - t_4, \;\;  v_1 \cdot t_2  = v_1 \cdot t_3 =0, \\ v_1 \cdot s_1 &= 0, \;\; v_1 \cdot s_3 = t_2, \;\; v_1 \cdot s_2 = - t_3, \\
\delta_3 \cdot t_1 & = -s_2, \;\; \delta_3 \cdot t_2 = s_1, \;\; \delta_3 \cdot t_3 =0, \\ \delta_3 \cdot s_3 &= s_4 - t_4, \; \; \delta_3 \cdot s_1  = \delta_3 \cdot s_2 =0 .
\end{align*}

Since $\mathfrak{u}_H = \mathfrak{u}_{B_{\SL_3}} \oplus \C v_1 \oplus \C \delta_3$, and since $\mathfrak{sl}_3$ kills the vector $s_4 - t_4$, one reduces to studying the action of the two one parameter subgroups $U_{v_1}, U_{\delta_3} $ of $U_H$ corresponding to $v_1$ and $\delta_3$. The above computations show that, for $u_1 = x_{a+b}(\lambda) \in U_{v_1}$ for some scalar $\lambda$, plugging $u_1$ in Equation \eqref{action}, we have $\alpha_i = \langle u (s_4 - t_4), t_i \rangle = \langle -\lambda s_1, t_i \rangle$, and thus $\alpha_1= -\lambda$, $\alpha_2 = \alpha_3 = 0$. Similarly, as $\beta_i =  \langle -\lambda s_1, s_i \rangle$, we have that $\beta_1 = \beta_2=\beta_3 = 0$. Finally, as the action of $u_1$ preserves the norm, we must have that $\alpha = 1$.

The above equations show that, for $u_1 = x_{a+b}(\lambda_1) \in U_{v_1}$ and $u_2 = x_{a+2b}(\lambda_2) \in  U_{\delta_3}$ for some scalars $\lambda_1, \lambda_2$ (as usual, for any positive root $\alpha$, the map $\lambda \mapsto x_{\alpha}(\lambda)$ denotes the one parameter unipotent subgroup associated to $\alpha$), we have \[ u_1 \cdot (d(s_4 - t_4)) = d(s_4 - t_4 + \lambda_1 s_1), \]
\[ u_2 \cdot (d(s_4 - t_4)) = d(s_4 - t_4 + \lambda_2 t_3).\]
This gives the desired isomorphism: if $u \in U_H /U_D$ is identified with the product of $x_{a+b}(\lambda_1) x_{a+2b}(\lambda_2)$, then, from Equation \eqref{action0}, we see that it gets sent to the element \[\begin{pmatrix} 1 &  d\tfrac{\lambda_1 - \lambda_2}{2} &   \tfrac{\lambda_1 + \lambda_2}{2} \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \in U_0. \]

\textit{Case 2.} We now suppose that $D$ is not a square in $\Q^\times$. Similarly to Case 1, it suffices to show that if $u \in U_H$ then
\[u\cdot x  \in \langle x, y, z \rangle. \]
\end{comment}

\end{proof}

\begin{corollary}\label{cor:onthecharacters}
Under the isomorphism $p:U_H/U_D \to U_0$, we have \[ \psi_{H,D} = \psi_0 \circ p,\]
where $\psi_{H,D}:U_H(\Q) \backslash U_H(\A) \to \C^\times$ is the character corresponding to the \'etale cubic algebra $\Q \times \Q(\sqrt{D})$.
\end{corollary}

\begin{proof}

We start with the case where $D$ is a square in $\Q^\times$. For simplicity, we can (and do) assume that $D=1$.  From Lemma \ref{lemma:Hactionontriple}, if $n \in U_H /U_D$ is identified with the product of $x_{a+b}(\lambda_1) x_{a+2b}(\lambda_2)$, it is sent via $p$ to \[\begin{pmatrix} 1 &  \tfrac{\lambda_1 - \lambda_2}{2} &   \tfrac{\lambda_1 + \lambda_2}{2} \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \in U_0. \]
Hence, the character $\psi_0 \circ p: U_H(\Q) \backslash U_H(\A) \to \C^\times$ sends $n \mapsto e(\tfrac{\lambda_1 - \lambda_2}{2})$. We now show that this corresponds to the character $\psi_{H,D}$ associated to $\Q \times \Q \times \Q$ as in \S \ref{subsub:FcforG2}. Recall that each character on $U_H(\Q) \backslash U_H(\A)$ is of the form $n \mapsto e( \langle w, \overline{n} \rangle)$, where $\overline{n}$ denotes the projection of $n$ to  $U_H/[U_H,U_H]$ and $w \in U_H(\Q)/[U_H(\Q),U_H(\Q)]$ corresponds to a binary  cubic form \[ f_w(x,y)= \lambda_1 x^3 + \lambda_2 x^2y + \lambda_3 xy^2 + \lambda_4 y^3, \] with $\lambda_i \in \Q$. Furthermore, as $\overline{n} = x_a(\lambda_1')x_{a+b}(\lambda_2'/3) x_{a+2b}(\lambda_3'/3)x_{a+3b}(\lambda_4')$  corresponds to
$f'(x,y)= \lambda_1' x^3 + \lambda_2' x^2y + \lambda_3' xy^2 + \lambda_4' y^3,$ the pairing is \[\langle w, \overline{n} \rangle = \lambda_1\lambda_4' - \tfrac{\lambda_2\lambda_3'}{3} + \tfrac{\lambda_3\lambda_2'}{3} - \lambda_4\lambda_1'. \]
Then, the character $\psi_0 \circ p$ corresponds to an element $w_D$ for which $\lambda_1,\lambda_4=0$ and $\lambda_2,\lambda_3 =  1/2$, namely the binary cubic polynomial $f_D(x,y) =  \tfrac{1}{2}(x^2y + xy^2)$. The latter is in the $L_H(\Q)$-orbit corresponding to the cubic algebra $\Q^3$. Indeed, if we let  $ g = \left(\begin{smallmatrix}  2 & \\ & -2 \end{smallmatrix} \right) \in L_H(\Q)$ act on $f_D$, we get \[ g \cdot f_D(x,y) = - \tfrac{1}{4} f_D(2x, -2y) =  \tfrac{1}{8}  (8x^2y - 8xy^2)=x^2y - xy^2, \]
which corresponds to $\Q^3$ by Example \ref{exampleofcubicpols}(1).

We now suppose that $D$ is not a square in $\Q^\times$. Then, by Lemma  \ref{lemma:Hactionontriple}, if  \[n \equiv x_a(\lambda_1)x_{a+b}(\lambda_2) x_{a+2b}(\lambda_3)x_{a+3b}(\lambda_4)\, \text{ mod } [U_H,U_H],\]  the character $\psi_0 \circ p: U_H(\Q) \backslash U_H(\A) \to \C^\times$ sends $n \mapsto e(\lambda_1 - \lambda_3 D)$. This character is associated to the binary cubic polynomial $f_D(x,y) = D x^2y - y^3$, which corresponds to $\Q \times \Q(\sqrt{D})$ by Example \ref{exampleofcubicpols}(2).
\end{proof}

\subsubsection{Comparison of Fourier coefficients}

The following proposition can be paired with Proposition \ref{PropFCperiod} to give three equivalent ways of proving that the theta lift of an automorphic representation of $G_2$ does not vanish.

\begin{proposition}\label{prop:comparisonbetweenFC} Let $\sigma$ be a cuspidal automorphic representation of $G_2(\A)$ as in Theorem \ref{cuspidality} and let $\varphi \in \sigma^\vee$ be a cuspidal form. The following conditions are equivalent
\begin{enumerate}
\item $\Theta(f, \varphi)_{U_P, \psi_D}(1) \neq 0$ for some choice of $f \in \Pi$,
\item $\varphi_{U_H, \psi_{H, D}}(g) \neq 0$ for some  $g \in G_2(\A)$.
\end{enumerate}
In particular, if any of the conditions holds then  $\Theta(\sigma)$ is non-zero.
\end{proposition}

\begin{proof}
Decomposing $U_P = U_0 U_3$, we have
\[ \Theta(f, \varphi)_{U_P, \psi_D}(1) = \int_{U_0(\Q) \backslash U_0(\A)} \int_{U_3(\Q) \backslash U_3(\A)} \Theta(f,\varphi)(u u') \psi_{D}^{-1}(u') \psi_{U_0}^{-1}(u)  du' d u. \]
As in the proof of Proposition \ref{PropFCperiod}, this equals
\[ \int_{U_0(\Q) \backslash U_0(\A)} \int_{U_D(\A) \backslash G_2(\A)} \theta(f)_{A_0}(u g) \varphi^{U_D}(g) \psi_{U_0}^{-1}(u) dg d u. \]
Exchanging integrals and  making an inner integration over $U_D(\A) \backslash U_H(\A)$, we get
\[ \int_{U_H(\A) \backslash G_2(\A)}\int_{U_D(\A) \backslash U_H(\A)}  \left ( \int_{U_0(\Q) \backslash U_0(\A)} \theta(f)_{A_0}(u u' g) \psi_{U_0}^{-1}(u) du \right )  \varphi^{U_D}(u'g)du' dg. \]

\begin{comment}
We now use the isomorphism $ U_H/U_D \cong U_0$ of Lemma \ref{lemma:Hactionontriple}, Corollary \ref{}, and the fact that the function $\theta(f)_{A_0}(x) = c_{A_0} f(x^{-1 }A_0) $ for some non-zero constant $c_{A_0}$, to write the   integral as
\[  c_{A_0} \int_{U_H(\A) \backslash G_2(\A)} \int_{U_D(\A) \backslash U_H(\A)} \left ( \int_{U_H(\Q) U_D(\A) \backslash U_H(\A)}  f( (u u' g)^{-1} A_0)  \psi_{H,D}(u)d u \right )  h^{U_D}(u'g) du' dg  . \]
Denoting by $f_{\psi_{H,D}}(g) = \int_{U_H(\Q) U_D(\A) \backslash U_H(\A)}  f( (u g)^{-1} A_0)  \psi_{H,D}(u)d u$, the integral is
\[c_{A_0} \int_{U_H(\A) \backslash G_2(\A)} \int_{U_D(\A) \backslash U_H(\A)}   f_{\psi_{H,D}}(  u' g)   h^{U_D}(u'g) du' dg.   \]
Notice that, because of a change of variable, \[f_{\psi_{H,D}}(  u' g) = \psi_{H,D}^{-1}(u') f_{\psi_{H,D}}( g), \]
hence the integral becomes
\[c_{A_0} \int_{U_H(\A) \backslash G_2(\A)} f_{\psi_{H,D}}( g)  \int_{U_D(\A) \backslash U_H(\A)}     h^{U_D}(u'g) \psi_{H,D}^{-1}(u') du' dg \] \[= c_{A_0} \int_{U_H(\A) \backslash G_2(\A)} f_{\psi_{H,D}}( g) h_{U_H, \psi_{H,D}}(g) dg,  \]
where we have denoted \[  h_{U_H, \psi_{H,D}}(g)= \int_{U_H(\Q) \backslash U_H(\A)}     h(ug) \psi_{H,D}^{-1}(u) du.  \]
\end{comment}

The isomorphism $p:U_H/U_D \cong U_0$ of Lemma \ref{lemma:Hactionontriple} induces \[ U_0(\Q) \backslash U_0(\A) \cong U_H(\Q) U_D(\A) \backslash U_H(\A) \]
such that $\psi_{H,D} = \psi_0 \circ p$ (cf. Corollary \ref{cor:onthecharacters}).
Thus, we can write the integral as
\[
\int_{U_H(\A) \backslash G_2(\A)} \int_{ U_D(\A) \backslash U_H(\A)} \left ( \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)} \theta(f)_{A_0}(u u' g)  \psi_{H,D}^{-1}(u) du\right )  \varphi^{U_D}(u'g) du'  dg.
\]
Exchanging integrals, we have

\[
\int_{U_H(\A) \backslash G_2(\A)} \int_{ U_H(\Q)U_D(\A) \backslash U_H(\A)} \left ( \int_{U_D(\A) \backslash U_H(\A)} \theta(f)_{A_0}(u u' g)  \varphi^{U_D}(u'g)  du'\right )  \psi_{H,D}^{-1}(u)du  dg
\]
\[  =\int_{U_H  \backslash G_2(\A)}  \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)}  \left ( \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)}\sum_{\gamma \in U_D  \backslash U_H(\Q)} \theta(f)_{A_0}(u \gamma u' g)   \varphi^{U_D}(\gamma u'g) du'\right)\psi_{H,D}^{-1}(u)  du   dg
\]
\[  =\int_{U_H  \backslash G_2(\A)}  \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)} \sum_{\gamma  } \left ( \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)} \theta(f)_{A_0}(\gamma u  u' g)  \varphi^{U_D}(\gamma u'g) du' \right ) \psi_{H,D}^{-1}(u) du dg
\]
Changing variable $u' \mapsto u'' = \gamma  u u'= u \gamma u''$ in the inner integral, the above becomes
\[ \int_{U_H(\A) \backslash G_2(\A)}  \int_{U_H(\Q)U_D(\A) \backslash U_H(\A)}  \left ( \int_{U_D(\A) \backslash U_H(\A)} \theta(f)_{A_0}(u'' g)  \varphi^{U_D}(u^{-1} u'' g) du'' \right ) \psi_{H,D}^{-1}(u) du dg
\]
which, after rearranging the integrals, equals to
\[ \int_{U_H(\A) \backslash G_2(\A)} \int_{U_D(\A) \backslash U_H(\A)} \theta(f)_{A_0}(u'' g) \varphi_{U_H, \psi_{H, D}}(u''g) du'' dg \]
\[ = \int_{U_D(\A) \backslash G_2(\A)} \theta(f)_{A_0}(g)\varphi_{U_H, \psi_{H,D}}(g)dg. \]
This shows that $(1)$ implies $(2)$. The proof of the converse is identical as the one given in Proposition \ref{PropFCperiod}.

% Unnecessary
\begin{comment}
As $h_{U_H, \psi_{H, D}}(u''g) = \psi_{H, D} (u'') h_{U_H, \psi_{H, D}}(g)$  and $\theta(f)_{A_0}(x) = c_{A_0} f(x^{-1} A_0)$ for some non-zero constant $c_{A_0}$, the above is equal to
\[c_{A_0} \int_{U_H(\A) \backslash G_2(\A)} f_{\psi_{H,D}}(g) h_{U_H, \psi_{H, D}}(g) dg, \]
where \[f_{\psi_{H,D}}(g) = \prod_v \int_{U_D(\Q_v) \backslash U_H(\Q_v)} f_v(ug^{-1} A_0) \psi_{H,D,v}^{-1}(u) du. \]
\end{comment}

%% Commented proof (already appears before)_
\begin{comment}
Let $S$ be as in Lemma \ref{technical}. By enlarging $S$ if necessary, we can assume that the cusp form $h$ is $G_2(\Z_v)$-invariant. As a consequence, the integral that we want to prove to be non-zero, which is
\int_{U_D(\A) \backslash G_2(\A)} \theta(f)_{A_0}(g)h_{U_H, \psi_H}(g)dg
c_{A_0} \cdot \left( \int_{U_D(\Q_S) \backslash G_2(\Q_S)} f_S(g^{-1}A_0)h_{U_H, \psi_H}(g)dg \right) \cdot \prod_{v \notin S} vol(U_H(\Z_v) \backslash G_2(\Z_v), dg_v).
by Lemma \ref{technical}. It remains to show that, when $h_{U_H, \psi_H} \neq 0$, for a good choice of $f$ at the places in $S$, the integral
\int_{U_D(\Q_S) \backslash G_2(\Q_S)} f_S(g^{-1}A_0)h_{U_H, \psi_H}(g)dg
is non-zero. It follows from \cite[Theorem A.4]{harris-khare-thorne} that $f_S$ can be any smooth and compactly supported function on $\Omega(\Q_S)$. Let $g_0 \in G_2(\Q_S)$ be such that $h_{U_H, \psi_H}(g_0) \neq 0$. We can take a non-negative $f$ supported in a sufficently small neighborhood of $g_0$ to ensure the non-vanishing of the integral.
\end{comment}
\end{proof}

We are now ready to give a proof of Theorem \ref{thm:thetaliftproperties}.
\begin{proof}[Proof of Theorem \ref{thm:thetaliftproperties}]
Let $\sigma$ be a cuspidal automorphic representation satisfying the hypotheses of the Theorem. We first apply Corollary \ref{corocusptheta} to deduce that $\Theta(\sigma)$ is cuspidal. Moreover, by Proposition \ref{prop:comparisonbetweenFC}, the theta lift supports a Fourier coefficient of type $(4\, 2)$ and, in particular, it is non-zero.
Finally, by the compatibility between the global and local correspondences (Proposition \ref{proplocalglobal}), the result of Li (Proposition \ref{propLi}) implies that the archimedean component of $\pi$ is a discrete series of Hodge type $(3,3)$, while its component at $p$ is the Steinberg representation by Proposition \ref{propositiononlocalthetaprop}(2). This finishes the proof.
\end{proof}

\section{The cycle class formula and the standard motive for $G_2$}\label{sec:cycleclassformulaandstandardlvalues}

We conclude this article with the arithmetic applications described in the introduction.

\subsection{The relation between $L$-functions of $G_2$ and ${\rm PGSp}_6$}

The dual group of $G_2$ is $G_2(\C)$, which can be realized as the intersection ${\rm SO}_7(\C) \cap {\rm Spin}_7(\C)$. More precisely, we have the commutative diagram

\begin{equation}\label{eq:diagramLF}
\xymatrix{ G_2(\C) \ar@{^{(}->}[r] \ar@{^{(}->}[d]_{\zeta} \ar@/^2pc/[rr]^{{\rm Std}} & {\rm SO}_7(\C)\ar@{^{(}->}[r] \ar@{^{(}->}[d] & {\rm GL}_7(\C) \ar@{^{(}->}[d]  \\ {\rm Spin}_7(\C) \ar@{^{(}->}[r] \ar@/_2pc/[rr]^{{\rm Spin}}  & {\rm SO}_8(\C)\ar@{^{(}->}[r] & {\rm GL}_8(\C),  }
\end{equation}
where ${\rm Std}: G_2(\C) \to \GL(V_7)$ is the standard representation given by trace zero octonions, ${\rm Spin} : {\rm Spin}_7(\C) \to \GL(V_8)$ is the 8-dimensional spin representation, while the embedding $\zeta$ is defined from the fact that the stabilizer in ${\rm Spin}_7(\C)$ of a generic vector of $V_8$ is isomorphic to $G_2(\C)$. From the commutative diagram, one immediately sees that
\[ {V_8}_{|_{G_2}} = V_7 \oplus \mathbf{1}. \]
In particular, if $\pi_\ell$ is an unramified smooth representation of $\PGSp_6(\Q_\ell)$ with Satake parameter $s_{\pi_\ell}$ belonging to $\zeta(G_2(\C))$, then
\[L(s, \pi_\ell, {\rm Spin}) = L(s, \pi_\ell, {\rm Std}) \zeta_\ell(s), \]
where \[ L(s, \pi_\ell, {\rm Std}):=\frac{1}{{\rm det}( 1 - \ell^{-s} {\rm Std}(s_{\pi_\ell}))} \]
denotes the Euler factor at $\ell$ of the 7-dimensional standard $L$-function for $G_2$.

Let now $\pi$ be a cuspidal automorphic representation of $\PGSp_6$, which is unramified outside a finite set of places $S$ containing the Archimedean place. As a special case of Langlands functoriality, one then expects that if $L^S(s, \pi, {\rm Spin})$ has a simple pole at $s=1$, $\pi$ is a functorial lift from either  $G_2$ or $G_2^c$, where recall that $G_2^c$ denotes the form of $G_2$  which is compact at $\infty$ and split at all finite places of $\Q$. We invite the reader to consult   [21], [17], [48], and [18] for results in this direction. In particular, using results of [11], [18] and [41], one deduces the following.

\begin{proposition}\label{onsimplepoles} Suppose that $\pi$ satisfies the hypotheses \textbf{(DS)} and \textbf{(St)} of \S \ref{ss:cohomologyloc}. Then $\pi$ is tempered and the following are equivalent: \begin{enumerate}
\item For almost all $\ell$, the Satake parameter $s_{\pi_\ell} \in \zeta(G_2(\C))$,
\item  There exists a cuspidal automorphic representation $\sigma$ of either $G_2$ or $G_2^c$ such that $\pi$ is a weak functorial lift of $\sigma$.
\end{enumerate}
Moreover, if these conditions hold, the partial $L$-function $L^S(s,\pi, {\rm Spin)}$ has a simple pole at $s=1$ with residue
\[{ \rm Res}_{s=1} L^S(s,\pi, {\rm Spin)} =  L^S(1, \sigma, {\rm Std}) \prod_{\ell \in S}(1-\ell^{-1}) \ne 0.  \]
\end{proposition}

\begin{proof}

Since $\pi$ is cohomological and it is Steinberg at a finite place, we can apply \cite[Lemma 2.7]{KretShin} to deduce that $\pi$ is essentially tempered at all places. As $\pi$ has trivial central character, this is equivalent to being tempered. The first part of the statement then follows from \cite[Theorem 1.1]{Gan-SavinExceptionalSW}. We now discuss the formula for the residue of the Spin $L$-function. If either (hence both) condition (1) or (2) holds, the commutative diagram above implies that
\begin{align*}
L^S(s, \pi, {\rm Spin}) = L^S(s, \pi, {\rm Std}) \zeta^S(s),
\end{align*}
where $L^S(s, \pi, {\rm Std})$ is the partial $L$-function of $\pi$ associated to the standard 7-dimensional representation of ${\rm Spin}_7$. By \cite[Theorem 1.1.1]{Labesse-Schwermer}, the restriction to ${\rm Sp}_6(\A)$ of $\pi$ contains a cuspidal automorphic representation $\pi^\flat$, such that (up to possibly enlarge $S$) \[L^S(s, \pi, {\rm Std}) = L^S(s, \pi^\flat, {\rm Std}). \]
By \cite[Corollary 2.2 \& Lemma 2.3]{KretShin}, there exists a cuspidal automorphic representation $\pi^\sharp$ of $\GL_7(\A)$ such that \[  L^S(s, \pi^\flat, {\rm Std}) = L^S(s, \pi^\sharp),\]
where $L^S(s, \pi^\sharp)$ denotes the standard $L$-function of $\pi^\sharp$. We claim that $L^S(1, \pi^\sharp)\ne 0$. By \cite[Theorem (1.3)]{Jacquet-ShalikaNonvanishing}, $L(s, \pi^\sharp)\ne 0$ for any $s$ with ${\rm Re}(s)=1$. If we write
\[L^S(s, \pi^\sharp) = L(s, \pi^\sharp) \prod_{\ell \in S} L(s, \pi^\sharp_\ell)^{-1}, \]
then our claim follows from the fact that each $L(s, \pi^\sharp_\ell)$ has no pole at $s=1$ (cf. \cite[p. 317]{Rudnick-Sarnak}).
This implies that (up to possibly enlarge $S$) \[ L^S(1, \pi, {\rm Std}) = L^S(1, \sigma, {\rm Std}) \ne 0, \]
where the first equality is a consequence of the fact that the Satake parameters of $\sigma$ and $\pi$ agree almost everywhere. Thus, $L^S(s, \pi, {\rm Spin})$ has a simple pole at $s=1$ with residue \[{\rm Res}_{s=1}L^S(s, \pi, {\rm Spin}) = L^S(1, \sigma, {\rm Std}) {\rm Res}_{s=1} \zeta^S(s) \ne 0.  \]
\end{proof}

The hypotheses of Proposition \ref{onsimplepoles} can be weakened at the cost of working with an integral representation of the Spin $L$-function. The following result uses the integral $\mathcal{I}(\Psi, \Psi, s)$ of Theorem \ref{Pollackshahongsp6} and its corollary.

\begin{proposition} [{\cite[Theorem 1.3]{Pollack-Shah}}]\label{prop:residuewithPS}
Let $\pi$ be a cuspidal automorphic representation of $\PGSp_6(\A)$ supporting a Fourier coefficient of type $(4\, 2)$. If  $L^S(s,\pi,{\rm Spin})$ has a simple pole at $s=1$, then there exists a cuspidal automorphic representation $\sigma$ of $G_2$ such that $\pi$ is a weak functorial lift of $\sigma$, and \[{ \rm Res}_{s=1} L^S(s,\pi, {\rm Spin)} =  L^S(1, \sigma, {\rm Std}) \prod_{\ell \in S}(1-\ell^{-1}).  \]
\end{proposition}

\subsection{The cycle class formula}\label{subsec:cycleclassformula}

Let $\pi$ be a cuspidal automorphic representation of $\PGSp_6(\A)$ such that $\pi_\infty$ is the discrete series of Hodge type (3,3) in the $L$-packet of $V^\lambda$ with $\lambda=(\lambda_2+\lambda_3, \lambda_2, \lambda_3,0)$.
Let $\Psi=\Psi_\infty \otimes \Psi_f$ denote a cusp form in $\pi$ such that $\Psi_\infty$ is a highest weight vector of the minimal $K_\infty$-type $\tau_{(\lambda_2+2, \lambda_3+2, -\lambda_1-4)}$ of $\pi_{\infty, 1}^{3,3} \subseteq \pi_\infty |_{\Sp_6(\R)}$. We assume that $\Psi_f \in \pi_f $ is $U$-invariant, so that we have (cf. \S \ref{ss:thepairing})
\[
[\omega_\Psi] = [\omega_{\Psi_\infty} \otimes \Psi_f] \in H^6(\mathfrak{g},K_\G; \pi^U \otimes V^\lambda).\]
For any $\lambda_2 \geq \mu \geq \lambda_3$, we denote $\Psi^{[\lambda,\mu]} := A^{[\lambda,\mu]} \cdot \Psi_\infty \otimes \Psi_f$,  where $A^{[\lambda,\mu]}$ is the operator that appeared in Proposition \ref{period}. Finally, we denote by ${\rm pr}_{\pi^\vee}$ the projection to the $\pi_f^\vee$-isotypic component in Betti cohomology of $\Sh_\G(U)$. In Proposition \ref{period} and Theorem \ref{theoremcyclebetti1}, we related the value $\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle$ to the residue at $s=1$ of the partial Spin $L$-function of $\pi$.  Combining these results with Proposition \ref{prop:residuewithPS}, we have the following.

\begin{theorem}\label{theoremcycleclassbettistandard}
Suppose $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]} , 1) \ne 0$. Assume that $L^S(s,\pi, {\rm Spin})$ has a simple pole at $s=1$ and let $\sigma$ be the weak functorial lift of $\pi$ given by Proposition \ref{prop:residuewithPS}. Then the class ${\rm pr}_{\pi^\vee}(\mathcal{Z}_{\H, B}^{[\lambda,\mu]}) \ne 0$ and
\begin{align*}
\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle = C' \cdot
L^S(1,\sigma , {\rm Std}),
\end{align*}
with $C'$ a non-zero constant.
\end{theorem}

\begin{proof}
By Theorem \ref{theoremcyclebetti1}, we have that
\[\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle = C \cdot
\mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin}),\]
where $$C = \frac{c \cdot \widehat{\Phi}(0) h_{{U'}}}{(2\pi i)^3\cdot \mathrm{vol}({U'})} \mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]}, 1).$$ By hypothesis, the integral $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]}, s)$ is not identical zero, which implies that $\pi$ supports a Fourier coefficient of type $(4\,2)$. Thus, by Proposition \ref{prop:residuewithPS} we get \[\mathrm{Res}_{s=1}  L^S(s,\pi , {\rm Spin}) =L^S(1,\sigma , {\rm Std}) \prod_{\ell \in S}(1- \ell^{-1}).  \]
This finishes the proof by setting $C':= C \cdot \prod_{\ell \in S}(1- \ell^{-1})$.
\end{proof}

Our result slightly improves if we assume that $\pi$ is Steinberg at a finite place. When this holds, by Lemma \ref{exloc},  we have \[{\rm dim}_{\R \otimes_\Q L} \, H^1_\mathcal{H}(M(\pi_f^\vee)_\R(4)) = {\rm dim}_\C \, (\pi_f^\vee)^U.\] Combining Theorem \ref{theoremcyclebetti1}, Proposition \ref{onsimplepoles}, and Proposition \ref{period2}, we obtain the following.

\begin{theorem}\label{theoremcyclebetti2}
Suppose that $\pi$ satisfies the following hypotheses: \begin{itemize}
\item $\pi_p$ is Steinberg at a prime $p \in S$;
\item $\mathcal{I}_S(\Phi, \Psi^{[\lambda,\mu]} , 1) \ne 0$ for some $\mu $;
\item for all $\ell \not \in S$, the Satake parameter $s_{\pi_\ell} \in \zeta(G_2(\C))$.
\end{itemize}
Then there exists a cuspidal automorphic representation $\sigma$ of $G_2$ such that
\begin{align*}
\langle  \mathcal{Z}_{\H, B}^{[\lambda,\mu]} , [\omega_\Psi] \rangle = \langle  \mathcal{Z}_{\H, \mathcal{H}}^{[\lambda,\mu]} , [\omega_\Psi] \rangle_\mathcal{H} = C' \cdot
L^S(1,\sigma , {\rm Std}) \ne 0,
\end{align*}
with $C'$ the constant of Theorem \ref{theoremcycleclassbettistandard}. In particular ${\rm pr}_{\pi^\vee} \mathcal{Z}_{\H, \mathcal{H}}^{[\lambda,\mu]}$ and its Hecke translates generate $H^1_\mathcal{H}(M(\pi_f^\vee)_{\R}(4))$.
\end{theorem}

\begin{remark}