Distinguishing congruence subgroups of the modular group This question is something of a follow-up to
Transformation formulae for classical theta functions .
How does one recognise whether a subgroup of the modular group
$\Gamma=\mathrm{SL}_2(\mathbb{Z})$ is a congruence subgroup?
Now that's too broad a question for me to expect a simple answer
so here's a more specific question. The subgroup $\Gamma_1(4)$
of the modular group is free of rank $2$ and freely generated by
$A=\left(
\begin{array}{cc}
1&1\\\
0&1
\end{array}\right)$
and
$B=\left(
\begin{array}{cc}
1&0\\\
4&1
\end{array}\right)$. If $\zeta$ and $\eta$ are roots of unity there is a
homomorphism $\phi$ from $\Gamma_1(4)$ to the unit circle group
sending $A$ and $B$ to $\zeta$ and $\eta$ resepectively. Then the kernel $K$
of $\phi$ has finite index in $\Gamma_1(4)$. How do we determine whether $K$
is a congruence subgroup, and if so what its level is?
In this example, the answer is yes when $\zeta^4=\eta^4=1$. There are
also examples involving cube roots of unity, and involving eighth
roots of unity where the answer is yes. I am interested in this example
since one can construct a "modular function" $f$, homolomorphic on
the upper half-plane and meromorphic at cusps such that $f(Az)=\phi(A)f(z)$
for all $A\in\Gamma_1(4)$. One can take $f=\theta_2^a\theta_3^b\theta_4^c$
for appropriate rationals $a$, $b$ and $c$.
Finally, a vaguer general question. Given a subgroup $H$ of
$\Gamma$ specified as the kernel of a homomorphism from $\Gamma$ or
$\Gamma_1(4)$ (or something similar) to a reasonably tractable target group,
how does one determine whether $H$ is a congruence subgroup?
 A: There is one answer in the following paper, along with a nice bibliography of other techniques:
MR1343700 (96k:20100)
Hsu, Tim(1-PRIN)
Identifying congruence subgroups of the modular group. (English summary)
Proc. Amer. Math. Soc. 124 (1996), no. 5, 1351--1359. 
A: Although Andy has the correct answer, I thought I would point out that 
there will only be finitely many groups of the type you consider that
are congruence subgroups. Since these are abelian (cyclic) covers of your surface,
they will contain the universal abelian cover (corresponding to the commutator subgroup of 
$\Gamma_1(4)$). By "strong approximation",
this group will map onto all but finitely many congruence quotients of 
$SL_2(\mathbb{Z})$, and therefore so will any group containing it. 
Thus, only finitely many of your groups will be congruence. 
Another way to see this is to notice that abelian covers have Cheeger
constant approaching zero, and therefore first eigenvalue of the 
Laplacian $\lambda_1$ approaching
zero by Buser's inequality. By Selberg's estimate, $\lambda_1\geq 3/16$ for a congruence
subgroup. In principle, one could probably get explicit estimates
on the index of a congruence abelian cover this way. 
