I am trying to understand the action of a modular S transformation on a $\vartheta$-function. To do this for the problem I'm considering I first need to understand the following. 


Given a $\vartheta$-function, 
$$
\vartheta\Big[\genfrac{}{}{0pt}{}{\frac{p}{q}}{0} \Big](0|q\,\tau) = \sum\_{n\in \mathbb{Z}} e^{i \pi (n + \frac{p}{q})^2 q\,\tau}
$$ 
where $p \in (0,1,\cdots,q-1)$, $q$ is an integer $\geq 1$, and $\tau \in \mathbb{C}$. I want to prove that (up to signs)
$$
\vartheta\Big[\genfrac{}{}{0pt}{}{\frac{p}{q}}{0} \Big](0|-\frac{q}{\tau}) = \sqrt{\frac{\tau}{iq}}\sum\_{k=0}^{q-1}e^{-2\pi i \frac{k\,p}{q}}\,\vartheta\Big[\genfrac{}{}{0pt}{}{\frac{k}{q}}{0} \Big](0|q\,\tau) 
$$


Now for $q = 1$, I know how to show this using Poisson summation, but I don't understand where the sum over $k$ comes from when $q>1$. I've looked in the literature on $\vartheta$-functions but I haven't found anything that helps me prove this. All of the results are for $\vartheta$-functions of first order whereas this is a higher order one. This is a specific instance of a modular transformation so it should probably be an established result.


I've asked the same question here: <https://math.stackexchange.com/questions/1955899/equality-regarding-vartheta-functions-using-poisson-summation> 



Modular S transformation on higher order $\vartheta$-functions using Poisson summation
I like the treatment of theta functions in Henryk Iwaniec's book "Topics in Classical Automorphic Forms" - Chapter 10. I'm convinced that Proposition 10.4 of this book proves exactly what you need, although it is a good bit more general than you need, since Iwaniec proves a modular $S$ tranformation for the theta series attached to an arbitrary positive-definite quadratic form $Q$, and you only need something for $Q(x) = x^{2}$.


Iwaniec's proof of Proposition 10.4 relies on a "generalized Jacobi inversion" formula (Proposition 10.1) which is proven in the text (using the $n$-variable Poisson summation formula). 


