Here is a partial answer, regarding only the computational part of the answer, we get explicitly the representation of $\Theta^6(q)$ in terms of the sage basis $f_1, f_2$ of the space $M =M_3(\ \Gamma_1(4))$. The space has dimension two, as in the print of $M$ or as `M.dimension()`

shows. We check that the first some 10 000 coefficients correspond in the obvious linear combination of $f_1$ and $f_2$, after we compute the $q$-expansion of $\Theta^6$.

```
sage: M3 = ModularForms( Gamma1(4), 3 )
sage: M3
Modular Forms space of dimension 2 for Congruence Subgroup Gamma1(4) of weight 3 over Rational Field
sage: f1, f2 = M3.basis()
sage: f1.qexp( 10 )
1 + 12*q^2 + 64*q^3 + 60*q^4 + 160*q^6 + 384*q^7 + 252*q^8 + O(q^10)
sage: f2.qexp( 10 )
q + 4*q^2 + 8*q^3 + 16*q^4 + 26*q^5 + 32*q^6 + 48*q^7 + 64*q^8 + 73*q^9 + O(q^10)
sage: theta_qexp( 10 )^6
1 + 12*q + 60*q^2 + 160*q^3 + 252*q^4 + 312*q^5 + 544*q^6 + 960*q^7 + 1020*q^8 + 876*q^9 + O(q^10)
sage: ( f1 + 12*f2 ).qexp(10000) - theta_qexp(10000)^6
O(q^10000)
```

In a similar "simpler" manner we can check for the coincidence of the appropriate $q$-expansions in the space $M_1(\ \Gamma_1(4)\ )$:

```
sage: M1 = ModularForms( Gamma1(4), 1 )
sage: M1
Modular Forms space of dimension 1 for Congruence Subgroup Gamma1(4) of weight 1 over Rational Field
sage: f, = M1.basis()
sage: f.qexp(10000) - theta_qexp(10000)^2
O(q^10000)
```

As the author of the book (with the exercise, Alvaro Lozano-Robledo, Elliptic Curves, Modular Forms and Their L-functions) also mentions in the above cited link
http://math.stackexchange.com/questions/135472/a-question-about-modular-forms-in-sage
this does not gives a proof of $\Theta^2\in M_1(\ \Gamma_1(4)\ )=M(1,\chi)$, $\chi$ being given by $\chi(d)=(-1)^{(d-1)/2}$, GTM 97, Koblitz, N. - Introduction to elliptic curves and modular forms, Proposition 30, III.§3.

Postlude:

However, we can use sage to support the proof as follows. Let us introduce $S$, and $T\dots$

```
sage: G01 = Gamma0(1)
sage: G01.gens()
(
[ 0 -1] [1 1]
[ 1 0], [0 1]
)
sage: S, T = G01.gens()
Then $T$, $S T^4 S$, and $-I$ generate $\Gamma_0(4)$, although we get an other preference...
sage: G04 = Gamma0(4)
sage: G04.gens()
(
[1 1] [ 3 -1] [-1 0]
[0 1], [ 4 -1], [ 0 -1]
)
```

Then we have immediately the invariance of $\Theta$ w.r.t. $T$ and $-1$, need to consider only

```
sage: S * T^4 * S
[-1 0]
[ 4 -1]
sage: J, C = ( S * T^4 * S ).matrix().jordan_form( transformation=True )
sage: J, C # C is the base *C*hange matrix
(
[-1 1] [0 1]
[ 0 -1], [4 0]
)
sage: C * (-T.matrix()^(-1)) * C^(-1)
[-1 0]
[ 4 -1]
sage: # J is -T^(-1)
```

This is the starting point for the computation:
$$
\Theta\Big|_1\ (ST^4S)
= \Theta\ \Big|_1\ C(-T)C^{-1}
= \Theta\ \Big|_1\ C\ \Big|_1\ (-T)\ \Big|_1\ C^{-1}\ ,
$$
and $\Theta$ is invariated by $C$, we need for this the transformation formula for $\theta(-1/t)$, which transfers to a transformation formula for $\Theta(z)=\theta(-2i\, z)$. (The inverse of $C$ is a scalar times $C$.)

It remains to see that $\Theta$ is holomorphic in the cusps

```
sage: G04.cusps()
[0, 1/2, Infinity]
```

and we have no problems in $\tau=\infty$, which corresponds to $q=0$, then $C$ exchange $0$ and $\infty$, and for $1/2$ (and for me) the expansion of $\theta_{01}$ is a good start. A related link (for $\theta$ instead of $\Theta$):

http://mathoverflow.net/questions/90772/order-of-vanishing-at-the-cusps-for-the-modular-theta-function

Just as a note to any finding this - the author of the book answered regarding the content of the book piece at http://math.stackexchange.com/questions/135472/a-question-about-modular-forms-in-sage