Endomorphisms of Weil restriction of CM elliptic curves $\newcommand{\End}{\operatorname{End}}$Consider an elliptic curve E defined over $\mathbb Q$ such that $\End(E_{\bar{\mathbb Q}})\neq \mathbb Z$ (i.e. with CM). 
Let $F/\mathbb Q$ be finite Galois extension such that $\End(E_F)=\End(E_{\bar{\mathbb Q}})$ (i.e. all endomorphisms of $E$ are defined over $F$).  
Let $A=\operatorname{Res}_{F/\mathbb Q}(E_F)$ be the abelian variety over $\mathbb Q$ given by the Weil restriction of the elliptic curve $E_F$ over $F$, and write $\End^0(-)$ for $\End(-)\otimes \mathbb Q$. 
What is $\End^0(A)$? 
Can one compute $\End^0(A)$ in terms of the imaginary quadratic field $K=\End^0(E_F)$?
 A: By the universal property of the Weil restriction for abelian varieties, we have
\begin{equation*}
\mathrm{Hom}_{\mathbb{Q}}(A,A) = \mathrm{Hom}_{\mathbb{Q}}(A,\mathrm{Res}_{F/\mathbb{Q}}(E_F)) \cong \mathrm{Hom}_F(A_F,E_F).
\end{equation*}
A general property of the Weil restriction is that it commutes with base change in the following sense:
\begin{equation*}
\mathrm{Res}_{S'/S}(X) \times_S T \cong \mathrm{Res}_{(S' \times_S T)/T}(X \times_{S'} (S' \times_S T))
\end{equation*}
where $S'$ and $T$ are $S$-schemes. This can be checked for the functors of points, thus it holds when the above Weil restrictions exist as schemes (or group schemes, or abelian schemes). In the present situation, this gives
\begin{equation*}
A_F \cong \mathrm{Res}_{(F \otimes F) /F}(E_{F \otimes F}).
\end{equation*}
Now let $G=\mathrm{Gal}(F/\mathbb{Q})$. The algebra $F \otimes F$ is isomorphic to $\prod_G F$ via the map $x \otimes y \mapsto (x \sigma(y))_{\sigma \in G}$. This means that $E_{F \otimes F}$ is just the disjoint union of finitely many copies of $E_F$ indexed by $G$, and consequently that $A_F$ is isomorphic to $\prod_G E_F$.
It follows that $\mathrm{End}^0(A)$ is isomorphic to $\prod_G K$ as a $\mathbb{Q}$-vector space.
