Evaluation of $\sum_{n=1}^{\infty}q^{n^{2}}$?

144 Views Asked by At

I would like to evaluate the following summation \begin{equation} \sum_{n=1}^{\infty}q^{n^{2}} \end{equation} assuming $ 0<q<1$ obviously the series converge but can anyone help me how to evaluate it? I know it's related to Jacobi theta function fro some special value but that is not what I'm looking for as an answer.

1

There are 1 best solutions below

7
On BEST ANSWER

I think you are almost there: the Jacobi's third theta function in nome form is $$ \vartheta_3(\eta, q) = \sum_{n=-\infty}^{\infty} q^{n^2} \eta^n. $$ Thus your series can be evaluated via $\frac{1}{2}(\vartheta_3(1,q)-1)$. Most scientific computing packages allow you to do so. For example, below is the plot of the series against $0<q<1$ using the mpmath package (note $\vartheta_3(1,q)$ corresponds to mpmath.jtheta(n=3, z=0, q=q).)

Summation when <span class=$0<q<1$, $q\in\mathbb{R}$">

EDIT: Minimax Rational Approximation

We will write $\vartheta_3(q)$ for $\vartheta_3(1,q)$. As OP asked for analytical approximation when $q\in\mathbb{R}$ with small values, it might be possible to consider as simple as a rational function of the form $$ r(q) = \frac{\sum_{i=0}^n a_i q^i}{1 + \sum_{i=1}^m b_i q^i}. $$ Note that $r(q)$ is quasi-convex, and thus we can generate a bunch of evaluations $\{(q_i, y_i)\}_{i=1}^N$ with $y_i=\vartheta_3(q_i)$ and do a minimax rational fit (c.f. Boyd Ex. A 5.2) to minimize the max of $\lvert{r(q_i) - \vartheta_i(q_i)}\rvert$. For example, using $N=1000$ and $n=m=3$ we obtained a fit $$ \hat{\mathbf{a}} = {[ 1.044359498, \quad -1.271249380, \quad -0.44275578, \quad 0.670133658 ]}^{\top}, \quad \hat{\mathbf{b}} = {[ -2.56134660,\quad 2.129914536,\quad -0.568564211 ]}^{\top} $$ The maximum absolute error is below $0.05$ for $q$ bounded below from $1$, and well below $0.05$ for most of the values (see below). It should be feasible to study bounds on the derivate of $\vartheta_3(q)$ with small values of $q$, hence the error bound can be made uniform in that region. And certainly you can use more samples and finer stopping criteria to meet your accuracy need.

Abs error of minimax fit with <span class=$m=n=3$.">