Infinite product identity
The LHS is $$\prod_{k=1}^\infty\frac{(1-x^{4k-2})(1-x^{2k})^2}{(1-x^{2k-1})^2(1-x^{4k})} =\prod_{k=1}^\infty\frac{(1-x^{4k-2})^2(1-x^{2k})}{(1-x^{2k-1})^2} =\prod_{k=1}^\infty(1+x^{2k-1})^2(1-x^{2k}) =\sum_{m=-\infty}^\infty z^{m^2}$$ by the Jacobi triple product.