Solution 1:

To clarify, what you found is a q-continued fraction for the Jacobi theta function $\vartheta_2(0,q)$. Using ccorn's formulation,

$$\left(\frac{\vartheta_2(0,q)}{2\,q^{1/4}}\right)^2 =\Big(\sum_{n=0}^\infty q^{n(n+1)}\Big)^2 =\cfrac{1}{1-q+\cfrac{q(1\color{red}-q)^2}{1-q^3+\cfrac{q^2(1\color{red}-q^2)^2}{1-q^5+\cfrac{q^3(1\color{red}-q^3)^2}{1-q^7+\ddots}}}}\tag1$$

One can compare this to your other cfrac in this post,

$$\frac{1}{2\,q^{1/2}}\frac{\vartheta_2(0,q^2)}{\vartheta_3(0,q^2)}=\cfrac{1}{1-q+\cfrac{q(1\color{blue}+q)^2}{1-q^3+\cfrac{q^2(1\color{blue}+q^2)^2}{1-q^5+\cfrac{q^3(1\color{blue}+q^3)^2}{1-q^7+\ddots}}}}\tag2$$

They are beautifully similar, differing only in the $\pm$ within the square, though these two identities are not yet rigorously proven. (Update: The second was already established in 2005 by Michael Somos as the cfrac for sequence $A079006$ discussed in this answer.)

P.S. Ramanujan's octic cfrac can also express $(2)$, but I am unsure if there are q-cfracs for any of the $\vartheta_n(0,q)$. (I believe there are, but I'll have to go through my notes.)

Solution 2:

I refer to your claim with the sign of $q$ adjusted so that it reads $$\small(1+q^{2}+q^{6}+q^{12}+q^{20}+q^{30}+\cdots)^{2} =\cfrac{1}{1-q+{\cfrac{q\,(1-q)^2}{1-q^3+\cfrac{q^2(1-q^2)^2} {1-q^5+\cfrac{q^3(1-q^3)^2}{1-q^7+\cdots}}}}}$$ Given

  1. a related answer introducing a continued fraction formula by Ramanujan with parameters $a,b,q$ and making use of some Jacobi thetanull properties,
  2. plus another answer where the formula and the thetanull stuff is applied again with other settings of $a$ and $b$,
  3. and yet another one where we found and applied the insight that whenever $ab=q$, the result can be simplified along the same lines as before, this time using the two-argument Jacobi theta functions,

you know what comes next.

But it does not get boring: This one comes with another twist and a slight beautification.

As usual in posts like these, I write $q_n = \exp\frac{2\pi\mathrm{i}\tau}{n}$, thus $q_n^n=q$, and I consider expressions with $q_n$ implicity as functions of $\tau$.

I will again use Ramanujan's formula $$\small\frac{(-a;q)_\infty\,(-b;q)_\infty - (a;q)_\infty\,(b;q)_\infty} {(-a;q)_\infty\,(-b;q)_\infty + (a;q)_\infty\,(b;q)_\infty} = \cfrac{a+b}{1-q+\cfrac{(a+bq)(aq+b)}{1-q^3+\cfrac{q\,(a+bq^2)(aq^2+b)} {1-q^5+\cfrac{q^2(a+bq^3)(aq^3+b)}{1-q^7+\cdots}}}}\tag{*}$$ If you look at formula $(2)$ in my previous answer, you may notice that, by pulling out the first factor of the $q$-Pochhammer symbol containing $q^{-1}$, the identity can be written in the fully symmetric form $$\small\frac{(-a;q)_\infty\,(-b;q)_\infty - (a;q)_\infty\,(b;q)_\infty} {(-a;q)_\infty\,(-b;q)_\infty + (a;q)_\infty\,(b;q)_\infty} = (a+b)\,\frac{(-a^2q^3;q^4)_\infty\,(-b^2q^3;q^4)_\infty} {(-a^2q;q^4)_\infty\,(-b^2q;q^4)_\infty} \qquad (ab=q) \tag{**}$$ Combining $(*)$ and $(**)$, you get the following formula, restricted to the case $ab=q$: $$\small\cfrac{1}{1-q+\cfrac{(a+bq)(aq+b)}{1-q^3+\cfrac{q\,(a+bq^2)(aq^2+b)} {1-q^5+\cfrac{q^2(a+bq^3)(aq^3+b)}{1-q^7+\cdots}}}} = \frac{(-a^2q^3;q^4)_\infty\,(-b^2q^3;q^4)_\infty} {(-a^2q;q^4)_\infty\,(-b^2q;q^4)_\infty} \tag{***}$$ Note that the factor $(a+b)$ has been cancelled from both sides. This is important because now we are going to use it for $a+b=0$ by continuity.

Concretely, set $a=-\mathrm{i}q_2$, $b=\mathrm{i}q_2$, so $ab=q$ and $a/b=-1$. This yields $$\begin{align} \cfrac{1}{1-q+\cfrac{q\,(1-q)^2}{1-q^3+\cfrac{q^2(1-q^2)^2} {1-q^5+\cfrac{q^3(1-q^3)^2}{1-q^7+\cdots}}}} &\stackrel{(***)}{=} \frac{(q^4;q^4)_\infty^2}{(q^2;q^4)_\infty^2} \\ &\stackrel{(P1)}{=} (q^4;q^4)_\infty^2\,(-q^2;q^2)_\infty^2 \\ &\stackrel{(P2)}{=} (q^2;q^2)_\infty^2\,(-q^2;q^2)_\infty^4 \\ &\stackrel{(T1)}{=} \left(\frac{\vartheta_2(0\mid2\tau)}{2q_4}\right)^2 \\ &\stackrel{(T2)}{=} \left(\sum_{n=0}^\infty q^{n\,(n+1)}\right)^2 \end{align}$$ where $(\mathrm{P1})$ and $(\mathrm{P2})$ are $q$-Pochhammer symbol manipulation rules like $$\begin{align} (-q;q)_\infty\,(q;q^2)_\infty &= 1 \tag{P1} \\ (-q;q)_\infty\,(q;q)_\infty &= (q^2;q^2)_\infty \tag{P2} \end{align}$$ and $(\mathrm{T1})$ refers to the product representation of $\vartheta_2$: $$\vartheta_2(0\mid\tau) = 2q_8\,(-q;q)_\infty^2\,(q;q)_\infty \tag{T1}$$ while $(\mathrm{T2})$ describes the series representation $$\vartheta_2(0\mid\tau) = \sum_{k\in\mathbb{Z}} q_8^{(2k+1)^2} = 2q_8\sum_{n=0}^\infty q^{n\,(n+1)/2} \tag{T2}$$ which is linked with $(\mathrm{T1})$ by the triple product identity. Those ingredients are the same as for the other answers. Nothing new here.

That's it. Enjoy the formulae with more continued fractions of that sort.

Solution 3:

In a paper of me and Professor M.L. Glasser [1] we have generalized the continued fractions regarding this conversation. Namely

If $|q|<1$ and we set $$ (a;q)_{\infty}=\prod^{\infty}_{n=0}\left(1-aq^n\right),\tag 1 $$ then $$ \left(\frac{(-a;q)_{\infty}}{(a;q)_{\infty}}\right)^2=-1+\frac{2}{1-}\frac{2a}{1-q+}\frac{a^2(1+q)^2}{1-q^3+}\frac{a^2q(1+q^2)^2}{1-q^5+}\frac{a^2q^2(1+q^3)^2}{1-q^7+}\ldots,\tag 2 $$ $$ \sum^{\infty}_{n=0}\frac{q^n}{1-a^2q^{2n}}=\frac{1}{1-q+}\frac{-a^2(1-q)^2}{1-q^3+}\frac{-qa^2(1-q^2)^2}{1-q^5+}\frac{-q^2a^2(1-q^3)^2}{1-q^7+}\ldots,\tag 3 $$ where $a$ is a complex number.

Hence for example

1) If we set $a=iq$ in (3) and using [2] pg.17, pg.55: $$ cn(u)=\frac{2\pi}{Kk}\sum^{\infty}_{n=0}\frac{q^{n+1/2}}{1+q^{2n+1}}\cos((2n+1)z) $$ where $z=\frac{\pi}{2K}u$ and $cn(0)=1$, we get $$ \sum^{\infty}_{n=0}\frac{q^n}{1+q^{2n+1}}=\frac{1}{1-q+}\frac{q(1-q)^2}{1-q^3+}\frac{q^2(1-q^2)^2}{1-q^5+}\frac{q^2(1-q^3)^2}{1-q^7+}\ldots= $$ $$ =q^{-1/2}\frac{Kk}{2\pi}=\left(\frac{\theta_2(q)}{2q^{1/4}}\right)^2=\left(\sum^{\infty}_{n=0}q^{n(n+1)}\right)^2, $$ where $\theta_2(q)=\sum^{\infty}_{n=-\infty}q^{(n+1/2)^2}=\sqrt{2Kk/\pi}$, $q=e^{-\pi\sqrt{r}}$, $r>0$.

2) From [3] pg.37 we have $$ \theta_4(q)=\sum^{\infty}_{n=-\infty}(-1)^nq^{n^2}=\frac{(q;q)_{\infty}}{(-q,q)_{\infty}}. $$ Using (2) we arive to $$ \left(\sum^{\infty}_{n=-\infty}(-1)^nq^{n^2}\right)^{-2}=-1+\frac{2}{1-}\frac{2q}{1-q+}\frac{q^2(1+q)^2}{1-q^3+}\frac{q^3(1+q^2)^2}{1-q^5+}\frac{q^4(1+q^3)^2}{1-q^7+}\ldots $$

3) For $q\rightarrow q^2$ and $a=q$, we get $$ S_1=\left(\frac{(-q;q^2)_{\infty}}{(q;q^2)_{\infty}}\right)^2= -1+\frac{2}{1-}\frac{2q}{1-q^2+}\frac{q^2(1+q^2)^2}{1-q^6+}\frac{q^4(1+q^4)^2}{1-q^{10}+}\frac{q^6(1+q^6)^2}{1-q^{14}+}\ldots\tag 4 $$ we also get $$ S_2=\left(\frac{(q;q^2)_{\infty}}{(-q;q^2)_{\infty}}\right)^2=\frac{1}{S_1}= $$ $$ =-1+\frac{2}{1+}\frac{2q}{1-q^2+}\frac{q^2(1+q^2)^2}{1-q^6+}\frac{q^4(1+q^4)^2}{1-q^{10}+}\frac{q^6(1+q^6)^2}{1-q^{14}+}\frac{q^8(1+q^8)^2}{1-q^{18}+}\ldots\tag 5 $$ But $\chi(q)=(-q;q^2)_{\infty}$, $\psi(q)=\sum^{\infty}_{n=0}q^{n(n+1)/2}=\frac{(q^2;q^2)_{\infty}}{(q;q^2)_{\infty}}$, $f(-q)=(q;q)_{\infty}$ (note that $\chi(-q)=\frac{\theta_4(q)}{f(-q)}$). Moreover if $k'_r=\sqrt{1-k_r^2}$ is the complementary elliptic singular modulus, then from [3] chapter 16, Entry 24, pg. 39 we have the following cfrac expansions: $$ S_1=\frac{\chi(q)}{\chi(-q)}=\frac{f(q)}{f(-q)}=\frac{\psi(q)}{\psi(-q)}=\sqrt{\frac{\theta_3(q)}{\theta_4(q)}}=\frac{1}{\sqrt[4]{k'_r}} $$

Note. $$ k_r=\sqrt{m(q)}=4q^{1/2}\exp\left(-4\sum^{\infty}_{n=1}q^n\sum_{d|n}\frac{(-1)^{d+n/d}}{d}\right), $$
where $q=e^{-\pi\sqrt{r}}$, $r>0$.

etc...

References

[1]: N.D. Bagis and M.L. Glasser. "Evaluations of a Continued Fraction of Ramanujan". Rend. Sem. Mat. Univ. Padova, Vol. 133 (2015). (submited 2013)

[2]: J.V. Armitage W.F. Eberlein. 'Elliptic Functions'. Cambridge University Press, (2006).

[3]: Bruce C. Berndt. 'Ramanujan`s Notebooks Part III'. Springer Verlag, New York, (1991).