Fourier coefficient of a modular form

If someone hands you a prime number $p$, and an algebraic number $x$ inside the Hasse-Weil bound, is there a normalized newform (say of weight two) so that $a_p=x$, where $a_p$ is the $p$th Fourier coefficient?

-
I think you have to impose the condition that all of the Q-conjugates of $a_p$ also have to lie inside the Hasse-Weil bound. (In this context I'd call it the Ramanujan bound, but I know what you mean.) For if $f$ is a normalized newform, then so is $\sigma(f)$, where $\sigma$ is any automorphism of $\overline{\mathbf{Q}}$. –  Jared Weinstein Oct 19 '10 at 5:10
Have you thought about finding a CM form with $a_p=x$? –  Tony Scholl Oct 19 '10 at 7:46
In the case $x$ is an integer, I think it is known that there exists an elliptic curve $E$ over $\mathbf{F}_p$ with $a_p(E)=x$. So in this case the answer to Ian's question is yes. –  François Brunault Oct 19 '10 at 10:03
And if it is not totally real, by the stability of the Hecke algebra under the Rosatti involution and its positivity, the field generated by the coefficients of $f$ is a CM field, isn't it? –  Olivier Oct 19 '10 at 10:37
@Tony: I tried thinking CM forms. Let's say $a_p$ is totally real, let $\pi$ be a root of $X^2+a_pX+p$, let $F^+=\mathbf{Q}(a_p)$ and let $F=F^+(\pi)$. Then $F/F^+$ is CM. Now $\pi$ is a Weil $p$-integer: the proof of Honda-Tate supplies us with an abelian variety $A$ over $\mathbf{F}_p$ with CM by $F$ on which Frob is $\pi$ (up to a root of unity). The problem is lifting $A$ to an abelian variety over $\mathbf{Q}$. (It lifts to some undetermined number field; restricting scalars to $\mathbf{Q}$ results in something too big.) I don't see any way around this. –  Jared Weinstein Oct 19 '10 at 14:29

Some Remarks. I parse the problem in the following way: Start with a totally real algebraic integer $\alpha$ such that every conjugate of $\alpha$ has absolute value at most $2 \sqrt{p}$. Then does there exist a normalized cuspidal Hecke eigenform $f$ of weight $2$ with $a_p = \alpha$?
First, here is a heuristic reason why one should expect this to be false. Suppose we ask a slightly stronger question, namely, that all the coefficients of $f$ are defined over the field $E = \mathbb{Q}(\alpha)$. Then, we are asking for the existence of an abelian variety of $\mathrm{GL}_2$-type with endomorphisms by (some order in) the ring $\mathcal{O}_E$. Such objects (ignoring issues of polarization) correspond to rational points on Shimura curves. But these curves, in general, will have large genus, and so there's no reason to expect that they have any rational points. It will probably be hard to prove anything this way, however.
A second heuristic is to ask the problem in different weights. For example, is there a weight $12$ normalized cuspidal eigenform $f$ of level co-prime to $p$ with $a_p = 0$? This sounds tricky. Maybe Serre even conjectured once that this never happened if $p$ was sufficiently large. Let's say he did. Are you going to contradict Serre?
Finally, let me show in a rather cheap way that the answer to the original question is "not always". Suppose that $\alpha = 2 \sqrt{p}$, which satisfies the Weil bounds. Suppose that $a_p = \alpha$, and let $\epsilon$ denote the nebentypus character of $f$. Then the characteristic polynomial of Frobenius is $$x^2 - 2 \sqrt{p} \cdot x + p \cdot \epsilon(p).$$ I claim that $\epsilon(p)$, which is a root of unity, is actually $1$. (This follows easily from the fact that the roots of this polynomial are Weil numbers and the triangle inequality.) In particular, the characteristic polynomial of Frobenius is actually $$x^2 - 2 \sqrt{p} \cdot x + p = (x - \sqrt{p})^2.$$ This doesn't happen! Losely speaking, one knows that the action of crystalline Frobenius is semi-simple on Abelian varieties, and yet the Eichler-Shimura relations implies that $(\mathrm{Frob}_p - \sqrt{p})^2 = 0$, which then implies that $\mathrm{Frob}_p = \sqrt{p}$ acts as a scalar, which contradicts how one knows Frobenius to interact with the Hodge Filtration --- all this is explained in (and is indeed the main point of) a paper of Coleman and Edixhoven from the groovy 90's.
This is a nice answer. I think the bottom line is that the main thing it indicates is that the question needs to be made precise in an even stronger way. One needs to assume that $\alpha$ is a totally real algebraic integer such that every conjugate has absolute value strictly less than $2\sqrt{p}$. I don't think $\alpha=0$ is a problem because one can use forms of level $p^2$ to get this. I don't buy the Shimura curves argument because, even though one Shimura curve is unlikely to contain a point, we're allowed to change level so we have infinitely many to play with. –  Kevin Buzzard Oct 21 '10 at 6:44
"This sounds tricky. Maybe Serre even conjectured once that this never happened if $p$ was sufficiently large. Let's say he did. Are you going to contradict Serre?" - I liked your style of persuasion. –  Idoneal Oct 21 '10 at 9:23