This question is something of a follow-up to
[Transformation formulae for classical theta functions](https://mathoverflow.net/questions/19400/) .


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?



Distinguishing congruence subgroups of the modular group
There is one answer in the following paper, along with a nice bibliography of other techniques:


[MR1343700 (96k:20100)](http://www.ams.org/mathscinet-getitem?mr=1343700)
Hsu, Tim(1-PRIN)
Identifying congruence subgroups of the modular group. (English summary)
Proc. Amer. Math. Soc. 124 (1996), no. 5, 1351--1359. 


