Models of the modular curve $Y_1(N)$ Consider the familiar Riemann surface
$$ Y_1(N) = \Gamma_1(N) \backslash \mathcal{H} $$
where $\mathcal{H}$ is the upper half-plane and $\Gamma_1(N)$ is the subgroup of matrices in $SL_2(\mathbb{Z})$ which are congruent to $\begin{pmatrix} 1 & * \\\ 0 & 1 \end{pmatrix}$ modulo $N$. 
It's a standard theorem that $Y_1(N)$ has a canonical model as an algebraic curve over $\mathbb{Q}$, and this model is a moduli space for pairs $(E, P)$ where $E$ is an elliptic curve and $P$ is an point of order $N$, with the map from $\Gamma_1(N) \backslash \mathcal{H}$ given by sending $\tau$ to $(\mathbb{C} / (\mathbb{Z} + \mathbb{Z} \tau), 1/N)$,
I used to believe that the function field of this canonical $\mathbb{Q}$-model was exactly the meromorphic $\Gamma_1(N)$-invariant functions (with sufficiently slow growth at the cusps) whose $q$-expansions at $\infty$ have coefficients in $\mathbb{Q}$. But some stuff I've just read on Siegel units convinces me that this can't be true.

  
*
  
*Can one characterize the rational functions on the canonical $\mathbb{Q}$-model in terms of $q$-expansions?
  
*Does the field of modular functions with rational $q$-expansions also give a model of $Y_1(N)$ over $\mathbb{Q}$? If so, does it have any natural interpretation as a moduli space? 
  

 A: In the model you describe, the cusp $\infty$ of $X_1(N)$ is not defined over ${\bf Q}$ (but the cusp $0$ is). A way to see this is that the marked elliptic curve $({\bf C}/({\bf Z}+\tau{\bf Z}),1/N)$ is isomorphic to the marked Tate curve $E_q=({\bf C}^\times/q^{\bf Z},e^{2\pi i/N})$ with $q=e^{2\pi i\tau}$. When you let $\tau \to \infty$, you get $q \to 0$ so that $E_q \to ({\bf G}_m,e^{2i\pi/N})$, which is not defined over ${\bf Q}$. This fact is explained in Diamond-Im, Modular forms and modular curves, see 9.3.5 and 9.3.6.
There is an alternative model $Y_\mu(N)$ classifying elliptic curves $E$ together with a closed immersion $\mu_N \hookrightarrow E$ (see loc. cit. 8.2.2). In this model the cusp $\infty$ is defined over ${\bf Q}$, so it gives an affirmative answer to your second question.
You can switch from one model to another with the Atkin-Lehner involution $W_N$, which becomes an isomorphism defined over ${\bf Q}$ — it is only defined over ${\bf Q}(\mu_N)$ when considered as an involution of either $X_1(N)$ or $X_{\mu}(N)$. But I don't see a nice way to characterize those functions which are rational for the canonical model in terms of the $q$-expansion at $\infty$.
A: There are in fact explicit equations (at least for the prime level) worked out in  arXiv:math/0010272.
