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}?$$