When calculating a Partition function, I encounter the following summation
$$\sum\_{n=0}^{\infty} x^n q^{n^2}.$$


I know that the sum $\sum\_{n=-\infty}^{\infty} x^n q^{n^2}$ is a Theta function, but I do not know how to perform the sum from 0.


Can anyone help?


By the way I would like to have the result in an infinite product form, which I can easily do in the Theta case using Jacobi's triple product identity.


I want to make a small addition to this question which might or not be related but is also relevant for the physical problem I want to solve. The usual formulas for the infinite product generating functions involve products over 1 integer. To be more concrete one has for example
$$\sum\_{n=0}^{\infty} \frac{x^n q^{n(n-1)/2}}{(1-q) ... (1-q^n)} = \prod\_{m=0}^{\infty} (1+ x q^m).$$
which is the Partition for fermions.


Do you know any reference where people study double products like
$$\prod\_{m,n=0}^{\infty} (1+ x q^{(n \pm m)}).$$
or maybe
$$\prod\_{m,n=0}^{\infty} (1+ x q^{(n m)}).$$


Can then one write them as infinite sums with one label as
$$\sum\_{n=0}^{\infty} x^n A^{n}?$$



Summation of an infinite q-series
Those are usually called **partial theta functions**. They were probably first studied in some depth by Ramanujan, and seem to be closely related to general q-series, mock modular forms. They also show up in combinatorics and statistical physics.


They are not necessarily as well behaved as the complete ones, and usually not modular, but some basic properties such as convergence for $|q|<1$ still holds.


In particular, you still have an infinite product. Using q-Pochhammer notation, I think you can recover what you are looking for from the following Jacobi-type identity:


$$1+\sum\_{n=1}^\infty (-1)^nq^{n(n-1)/2}(a^n+b^n)=(q)\_\infty(a)\_\infty(b)\_\infty \sum\_{n=1}^\infty \frac{(ab/q)\_{2n}q^n}{(q)\_n(a)\_n(b)\_n(ab)\_n}$$


This is proved in section 2 of the paper:


* S. Ole Warnaar, [Partial Theta Function I. Beyond the Lost Notebook](http://arxiv.org/pdf/math/0105002v1.pdf) (2003)


See that you can get Jacobi's triple product identity by taking $b=q/a$.


For more general information about partial thetas here are some references:


* Vladimir Petrov Kostov, [A property of a partial theta function](http://arxiv.org/pdf/1504.01524v1.pdf) (2015)
* Krishnaswami Alladi, A partial theta identity of Ramanujan and its number-theoretic interpretation (2009)
* Jeremy Lovejoy, [Ramanujan-type partial theta identities and conjugate Bailey pairs](http://lovejoy.perso.math.cnrs.fr/residualBailey3.pdf) (2012)
* Kathrin Bringmann, Amanda Folsom, Robert C. Rhoades, [Partial theta functions and mock modular forms as q-hypergeometric series](http://arxiv.org/pdf/1109.6560v1.pdf) (2012)


