TITLE: theta functions from fock space
QUESTION [5 upvotes]: Is it possible to get theta functions from free fermions?  I'm looking for proof of identity
\[  \sum_{n = -\infty}^\infty (-1)^n q^{n^2} = \prod_{j=1}^\infty \frac{1-q^j}{1+q^j} \]
maybe as a matrix element or trace in a Fock space.

REPLY [2 votes]: Here is another point of view inspired by conformal field theory. If rewritten as   
$$\prod_{n=1}^\infty \frac{1+q^n}{(1-q^n)} \sum_{j \in \mathbb{Z}} (-1)^j q^{j^2}=1$$ 
this identity (I think) follows as a consequence of a BGG-type resolution of the trivial representation for the N=1 (Ramond) superconformal algebra.
Similarly, famous Euler's pentagonal number theorem
$$\frac{\sum_{j \in \mathbb{Z}} (-1)^j q^{j(3j-1)/2}}{\prod_{n=1}^\infty (1-q^n)}=1$$
follows from a similar resolution for the Virasoro algebra.