I have defined the q-theta function as follows:

$$\theta(x;q) = \prod\_{k=0}^{\infty} (1-q^k x)(1-q^{k+1}/x)$$

I want to calculating, using this, the series expansion of the following series:

$$\frac{\theta^2(x)\theta(q^{1/2}x^2)}{\theta^2(a)\theta(ax)\theta(a/x)}$$

As a naive approach, I have defined the theta function as the above product in my Mathematica file and tried a series expansion of the more complicated function using Series, about {z,0,2}, say, but unfortunately my code doesn't return anything useful and/or accurate. Instead I get a mess of Pochhammer symbols which I think are incorrect.

If anyone has any tips on calculating the series expansions of these types of q-hypergeometric function-related objects,I would be extremely grateful.

```
θ[z_, q_] := Product[(1 - q^k z) (1 - q^(k + 1)/z), {k, 0, ∞}];
Series[(θ[x, q]/θ[a, q])^2 θ[q^(1/2) x^2, q]/(θ[a*x, q] θ[a/x, q]), {x, 0, 1}]

```