  The implementation of modular invariance on the torus as a phase space at the
quantum level is discussed in a group-theoretical framework. Unlike the
classical case, at the quantum level some restrictions on the parameters of the
theory should be imposed to ensure modular invariance. Two cases must be
considered, depending on the cohomology class of the symplectic form on the
torus. If it is of integer cohomology class $n$, then full modular invariance
is achieved at the quantum level only for those wave functions on the torus
which are periodic if $n$ is even, or antiperiodic if $n$ is odd. If the
symplectic form is of rational cohomology class $\frac{n}{r}$, a similar result
holds --the wave functions must be either periodic or antiperiodic on a torus
$r$ times larger in both direccions, depending on the parity of $nr$.
Application of these results to the Abelian Chern-Simons is discussed.
