Characteristic functional equation of a Theta Function Define the following as a "simple" theta function
$$ \vartheta(q) = \sum_{n=0}^{\infty} q^{n^2} = 1 + q + q^4+q^9+ \ ...$$ 
Defined on the open unit circle on the complex plane. 
I'm trying to find a non trivial functional equation that this obeys, such that up to some "regularity" conditions the function is completely characterized by the its functional equation. 
To make this concrete consider the analogous problem if we instead look at 
$$ f(q) = q + q^2 + q^4 + q^8 + ... = \sum_{n=0}^{\infty} q^{2^n} $$ 
Then it's easy to see that 
$$ f(q^2) - f(q) = - q $$ 
And any analytic function (this is the "regularity" condition mentioned above) obeying this functional equation such that $f(0)=0$ must necessarily be equal to the aforementioned series on the disk.
 A: One approach is to define
 $$ a(q) := (2\vartheta(q) - 1)^2 \tag{1} $$
and $\ b(q) := a(-q).\ $ Now the classical
Gauss/Lagrange AGM gives us that
$$a(q^2) = (a(q) + b(q))/2 \ \textrm{ and }\ b(q^2) = \sqrt{a(q)\ b(q)}. \tag{2}$$
Some algebra then gives the following functional equation for $\ a(q)\ $ alone:
$$ 0 = (a(q) - a(q^2))^2 + 4\ a(q^4)\ (a(q^4) - a(q^2)). \tag{3}$$
This implies a similar functional equation for $\ \vartheta(q).$ Explicitly, first let 
$$ t_1 := \vartheta(q), \:\: 
   t_{-1} := \vartheta(-q), \:\:
   t_2 := \vartheta(q^2), \:
   t_4 := \vartheta(q^4). \tag{4}$$
The arithmetic mean part of equation $(2)$ implies the identity
$$ 2\ t_2(t_2 - 1) = t_1(t_1 - 1) + t_{-1}(t_{-1} - 1). \tag{5}$$
Next equation $(3)$
implies the following identity holds:
$$  (t_1 - t_4)^2 = t_2(t_2 - 1) - t_4(t_4 - 1). \tag{6}$$
Notice that the function $\ t_1(t_1 - 1)\ $ is the generating function for OEIS sequence A002654 which is the number of ways of writing $n$ as a sum of at most two nonzero squares. Also,
the function $\ (t_1 - t_4)^2\ $ is the generating function of the sum of two odd squares. Thus, equation $(6)$ has a number theory interpretation involving decomposition of integers as sum of two square integers.
