Theta Series of Quadratic Forms and Sums of Squares
Anchor (Master): Serre *A Course in Arithmetic* Ch. VII §§6-7 (full theta-series development, the sum-of-squares formulas, the bridge from Part I quadratic forms to Part II modular forms); Iwaniec *Topics in Classical Automorphic Forms* Ch. 10-11 (theta series of quadratic forms, the Weil representation, half-integer weight); Shimura 1973 *Ann. of Math.* 97 (originator paper: modular forms of half-integral weight, the Shimura correspondence to integral weight); Ogg *Modular Forms and Dirichlet Series* (Benjamin 1969) Ch. VI (theta series and Eisenstein series); Miyake *Modular Forms* (Springer 1989) Ch. 4 §4.9 (theta series of positive-definite forms as modular forms); Conway-Sloane *Sphere Packings, Lattices and Groups* (Springer Grundlehren 290, 3rd ed. 1999) Ch. 2-7 (theta series of lattices, modular-form identities); Jacobi 1829 *Fundamenta Nova Theoriae Functionum Ellipticarum* (originator: the two- and four-square formulas via theta-function identities)
Intuition Beginner
How many ways can you write a whole number as a sum of squares? The number is , and if you count signs and order — and — there are eight such ways. Counting these representations one number at a time looks like bookkeeping with no pattern. The surprise of this unit is that all the counts at once are hidden inside a single smooth function, and reading them off becomes a matter of recognising which function it is.
The trick is to pack every count into one power series. Form the sum where the term for carries a marker raised to the power . If you take the basic series , whose exponents are the perfect squares, and you multiply it by itself a few times, the coefficient sitting in front of in the product is exactly the number of ways to write as a sum of that many squares. The counting problem has turned into a multiplication of power series.
This packaged series is the theta series, and it is not just any series: it has a deep symmetry under a group of changes of variable, the same kind of symmetry that defines a modular form. Because there are only finitely many functions with a given symmetry and weight, the theta series must equal a simple combination of standard building blocks whose coefficients are known divisor sums. So counting sums of squares becomes reading off coefficients of a modular form.
Visual Beginner
Picture three stacked number lines. The top line marks the perfect squares — these are the exponents that appear in the basic theta series (the factor counts the two signs ). The middle line marks, for a chosen target , every pair of squares that adds up to ; the bottom line collapses all those pairs into a single height, the representation count .
The picture conveys the whole strategy in one image: the squares on top are the raw material, multiplying theta series together combines them, and the height at in the product is the answer to "how many ways is a sum of squares." The modular symmetry, invisible in the picture, is what pins the product down to a known formula.
Worked example Beginner
Take the question: in how many ways is a sum of two squares, counting order and sign? List them directly. We need with whole numbers (positive, negative, or zero). The only square parts available are , and the squares larger than are out of range. So both and must equal .
Step 1. Fix the sizes. We need and , so and .
Step 2. Count the sign choices. The value can be or : two choices. Independently can be or : two choices. That gives ordered sign-aware representations: .
Step 3. Read the same answer off the series. The basic theta series is , where is the bookkeeping marker. Squaring it, The coefficient of is , matching the direct count .
What this tells us: the coefficient of in is the count of ways to write as an ordered, signed sum of two squares. The coefficient of is , recording the single empty representation . The coefficient of is , recording that is not a sum of two squares. The power series stores every count at once.
Check your understanding Beginner
Formal definition Intermediate+
We work over the complex upper half-plane and write , so for .
Definition (theta series). The Jacobi theta series is the holomorphic function $$ \theta(z) ;=; \sum_{n \in \mathbb{Z}} q^{n^2} ;=; \sum_{n \in \mathbb{Z}} e^{2\pi i n^2 z}, \qquad z \in \mathbb{H}, $$ with Fourier expansion . The series converges absolutely and uniformly on compact subsets of because decays super-geometrically in .
Definition (theta series of a quadratic form). Let be a positive-definite integral quadratic form, with a symmetric positive-definite integer matrix with even diagonal (the even-integral normalisation). The theta series of is $$ \theta_Q(z) ;=; \sum_{x \in \mathbb{Z}^m} q^{Q(x)} ;=; \sum_{n \geq 0} r_Q(n) , q^n, \qquad r_Q(n) := #{ x \in \mathbb{Z}^m : Q(x) = n }. $$ The non-negative integer is the representation number of by ; the finiteness follows from positive-definiteness, which makes a bounded, hence finite, subset of the lattice . When is the sum of squares, and is the sum-of--squares count.
Definition (half-integer weight and the theta multiplier). A holomorphic is a modular form of weight on if is holomorphic at every cusp and satisfies $$ f(\gamma z) ;=; \nu_\theta(\gamma) , (c z + d)^{1/2} , f(z), \qquad \gamma = \begin{pmatrix} a & b \ c & d \end{pmatrix} \in \Gamma_0(4), $$ where uses the principal branch of the square root and is the theta multiplier, an explicit eighth root of unity defined by with the extended Jacobi symbol and if , if . The half-integer weight is forced: no automorphy factor without a chosen square root and a multiplier can make modular, because transforms with the square root of the usual factor .
The congruence subgroup is ; the group generated by and inside which is modular is the theta group.
Definition (weight for ). For a positive-definite even integral form of rank and level (the level being the smallest positive integer with even integral), is a modular form of weight on with a character determined by the discriminant of ; for even the weight is an ordinary integer and no multiplier is needed, while for odd the theta multiplier reappears.
Counterexamples to common slips Intermediate+
The theta series is not modular on the full group . The element sends to , since picks up the sign . Only the translation by , namely , fixes , which is why the natural level is , not .
The weight is , not . Squaring, has weight on , and a count by analogy with integer-weight forms that assigned weight would be off by a factor-of-two error in the rank-to-weight rule. The correct rule is weight .
Positive-definiteness is essential for to be a holomorphic modular form. For an indefinite form the series diverges, since along some directions makes unbounded. Indefinite forms require Siegel's theory of indefinite theta functions, a different object.
counts lattice points, with signs and order, not unordered representations. The four-square count records in each of the four coordinate slots — eight points — not the single "essentially one-way" representation. Translating to unordered partitions into squares requires dividing out the sign-and-permutation symmetry by hand.
Key theorem with proof Intermediate+
Theorem (modular transformation of via Poisson summation; Serre VII §6). The theta series satisfies the inversion law $$ \theta!\left( -\frac{1}{4z} \right) ;=; \sqrt{-2 i z}; \theta(z), \qquad z \in \mathbb{H}, $$ where is the principal branch; equivalently, on the imaginary axis with , writing one has . Together with the periodicity and , this makes a modular form of weight on with the theta multiplier.
Proof. The engine is the Poisson summation formula: for a Schwartz function on with Fourier transform , $$ \sum_{n \in \mathbb{Z}} g(n) ;=; \sum_{n \in \mathbb{Z}} \widehat{g}(n). $$
Step 1 (the Gaussian and its transform). Fix and let . A standard contour computation of the Gaussian integral gives the self-similar transform $$ \widehat{g_t}(\xi) ;=; \frac{1}{\sqrt{t}}, e^{-\pi \xi^2 / t} ;=; \frac{1}{\sqrt{t}}, g_{1/t}(\xi). $$ The Gaussian is, up to the scale , its own Fourier transform with inverted.
Step 2 (apply Poisson). Summing over gives the theta value . Poisson summation equates this to . Rearranging, $$ \vartheta(1/t) ;=; \sqrt{t}; \vartheta(t). $$ This is the inversion law on the imaginary axis in the normalisation ; analytic continuation from the imaginary axis to all of (both sides are holomorphic and agree on a set with a limit point) extends the identity to the stated .
Step 3 (assemble the modularity). The two maps and generate the theta group, a subgroup commensurable with ; under each generator transforms by the displayed automorphy factor times a root of unity. Tracking the cocycle relation through the generators identifies the multiplier on all of . Holomorphy at the three cusps of follows because is bounded near each cusp (the -expansion at has non-negative exponents, and conjugating by the cusp-fixing scaling preserves boundedness). Hence .
Bridge. The Poisson-summation inversion builds toward the entire sum-of-squares machinery: is a half-integer-weight modular form whose Fourier coefficients are the counts , and the foundational reason exact formulas exist is that this space is finite-dimensional. This is exactly the same finiteness that pins in [21.04.01], now transplanted to a congruence subgroup with half-integer weight; the inversion law is dual to the functional equation of the Riemann zeta function, whose completed form [21.03.01] is the Mellin transform of this very theta series. The central insight is that representation numbers, defined by counting, become Fourier coefficients of an object constrained by symmetry, and putting these together — Poisson summation, finite-dimensionality, and Eisenstein-plus-cusp decomposition — appears again in [21.04.02] as the Hecke-operator analysis that splits into its eigencomponents. The bridge is that the analytic transformation law converts an arithmetic counting problem into a linear-algebra problem in a finite-dimensional space, and that conversion generalises from squares to every positive-definite quadratic form.
Exercises Intermediate+
A graded set covering the theta inversion, representation numbers, the four-square formula, and the Eisenstein-cusp decomposition.
Advanced results Master
The elementary statement "every theta series is a modular form" unfolds into a complete machine for representation numbers. We collect the structural results: the precise modularity of , the Eisenstein-cusp decomposition, Siegel's mass formula, and the half-integer-weight theory that houses itself.
Modularity of (Schoeneberg-Pfetzer; Serre VII §6). Let be a positive-definite even integral quadratic form of rank , with Gram matrix , level , and discriminant . Then $$ \theta_Q ;\in; M_{m/2}\big(\Gamma_0(N), \chi_D\big), \qquad \chi_D(d) = \left( \frac{(-1)^{m/2} D}{d} \right), $$ for even , where is the Kronecker character of the discriminant; for odd the form lies in the half-integer-weight space built on the theta multiplier. The proof generalises the Poisson-summation argument: applying multidimensional Poisson summation to the Gaussian on the lattice produces the inversion law relating to its dual form ; self-duality of the relevant combination assembles the modularity on .
The Eisenstein-cusp decomposition. For the space has the orthogonal decomposition
$$
M_{m/2} ;=; \mathcal{E}{m/2} ;\oplus; S{m/2},
$$
Eisenstein subspace plus cusp forms, with respect to the Petersson inner product of [21.04.02]. Writing , the Eisenstein component depends only on the genus of — the local equivalence class at every place, the same genus data classified by Hasse-Minkowski in [21.02.08] — while the cusp component detects the finer class of within its genus. Two forms in the same genus have the same Eisenstein part but generally different cusp parts.
Siegel's mass formula. The Fourier coefficients of the genus Eisenstein series are products of local representation densities. Siegel's 1935 theorem states that the weighted average of representation numbers over the classes in a genus equals a product of local densities:
$$
\frac{\sum_{Q' \in \mathrm{gen}(Q)} r_{Q'}(n)/|\mathrm{Aut}(Q')|}{\sum_{Q' \in \mathrm{gen}(Q)} 1/|\mathrm{Aut}(Q')|} ;=; \prod_p \beta_p(n), \qquad \beta_\infty(n)\beta_2(n)\beta_3(n)\cdots,
$$
where each is a -adic density counting solutions of modulo powers of , and is the real (archimedean) density. This is the analytic content of the Eisenstein part: the main term in every representation-number formula is a Siegel product of local densities, the global-to-local principle of [21.02.08] realised quantitatively. For sums of squares the genus has one class and no cusp form, so the mass formula is an exact identity, recovering the Jacobi formulas.
Half-integer weight and the Shimura correspondence. The series itself, of weight , sits at the bottom of Shimura's 1973 theory of half-integral-weight modular forms. Shimura constructed a Hecke-equivariant lift sending a half-integer-weight eigenform to an integral-weight eigenform with matching Hecke eigenvalues. The cusp parts of theta series, living in half-integer weight when is odd, are governed by this correspondence; the Waldspurger theorem later expressed the Fourier coefficients of the half-integer-weight form in terms of central -values of the Shimura lift, tying representation numbers of ternary forms to -functions of elliptic curves.
Even unimodular lattices and level-one theta series. When is the quadratic form of an even unimodular lattice — discriminant , even diagonal, forcing — the level is and is a modular form on the full group of weight , directly inside the ring of [21.04.01]. For the unique such lattice is and , giving . For the two lattices and have equal theta series — they are isospectral but non-isometric, Milnor's 1964 example of distinct lattices "sounding the same," because leaves no room for a distinguishing cusp form. For the Niemeier lattices, including the Leech lattice, are separated by the weight- cusp form .
Synthesis. Putting these together, the theta-series construction is the foundational reason the two halves of Serre's book join: the quadratic-form data of Part I — genus, class, local densities, the Hasse-Minkowski classification of [21.02.08] — becomes the Fourier-coefficient data of a modular form in Part II, and this is exactly the dictionary in which Siegel's mass formula is the Eisenstein main term and the cusp form is the local-to-global defect. The central insight is that representation numbers factor as a genus-determined product of local densities plus a cusp correction; this generalises the elementary Jacobi formulas, where the cusp space vanishes, to arbitrary forms, where it does not, and it is dual to the geometric picture of theta series as sections over the moduli of lattices. The bridge is that counting lattice points at fixed length, a question of pure arithmetic, is read off a finite-dimensional space of modular forms — and the same finiteness that made computable in [21.04.01] makes every computable here. Putting these together, the theta series is the load-bearing arch between quadratic forms and modular forms.
Full proof set Master
Proposition 1 (Jacobi's four-square theorem). For every positive integer , $$ r_4(n) ;=; 8 \sum_{\substack{d \mid n \ 4 \nmid d}} d. $$
Proof. The generating function is , a modular form of weight on . The space has dimension and consists entirely of Eisenstein series, because the modular curve has genus , so . A basis is furnished by the two weight- Eisenstein series obtained from the quasi-modular by the level-raising combinations $$ \phi_1(z) = 2 E_2(2z) - E_2(z), \qquad \phi_2(z) = 4 E_2(4z) - E_2(z), $$ each of which is a genuine modular form of weight on since the quasi-modular anomaly of cancels in the difference. Their -expansions begin $$ \phi_1 = 1 + 24\sum_{n\geq 1}\Big(\sum_{d\mid n, d \text{ odd}} d\Big) q^n + \cdots, \qquad \phi_2 = 1 + 8\sum_{n \geq 1}\Big(\sum_{d \mid n, 4 \nmid d} d\Big) q^n + \cdots, $$ after collecting divisor sums from .
Now , so for constants . Comparing constant terms: and both have constant term , giving . Comparing the coefficient of : , while and , so . Solving and gives , . Hence , and reading off the general coefficient, $$ r_4(n) ;=; [q^n]\phi_2 ;=; 8\sum_{d \mid n,; 4 \nmid d} d. \qquad \square $$
Corollary (Lagrange's four-square theorem). Every non-negative integer is a sum of four squares.
Proof. For the divisor always satisfies , so the sum , whence : there is at least one representation. For the empty representation gives . So for every .
Proposition 2 (theta inversion forces half-integer weight). There is no integer for which satisfies for all with the identity multiplier; the correct automorphy factor is times the theta multiplier .
Proof. Evaluate the inversion law from the Key theorem on the imaginary axis . The matrix realising inside the theta group has lower-left entry in the normalised coordinate, and the factor produced is , whose modulus grows like , not for any integer . If an integer-weight automorphy factor with governed , then squaring the inversion identity would give , i.e. has weight — an odd-looking integer weight that is nonetheless consistent — while itself has weight exactly half of that. Since is odd, no integer with exists, so cannot carry an integer weight. The multiplier is then forced as the eighth-root-of-unity cocycle making the half-integer automorphy factor consistent under composition, with the sign ambiguity of the square root.
Proposition 3 (the two-square theorem from ). For , , where .
Proof. The form has weight on with the character , the non-principal character modulo . The space is one-dimensional and spanned by the single weight- Eisenstein series $$ E_{1,\chi_{-4}}(z) ;=; 1 + 4\sum_{n \geq 1}\Big(\sum_{d \mid n}\chi_{-4}(d)\Big) q^n, $$ where for , for , and for even . Since has constant term and lies in this one-dimensional space, . The inner divisor sum is , so reading off the coefficient gives . In particular exactly when has more divisors congruent to than to modulo , recovering the classical two-square criterion: is a sum of two squares iff every prime divides to an even power.
Connections Master
Modular forms on
21.04.01. The entire method rests on the finite-dimensionality of spaces of modular forms established there: lives in a space of known, small dimension, so matching a few Fourier coefficients pins it down completely. The level- structure theorem is the special case governing theta series of even unimodular lattices, where and the rank- isospectral pair both equal because .Hecke operators and Hecke algebra
21.04.02. The Eisenstein-cusp decomposition is an eigenspace decomposition for the Hecke operators, and the cusp part is analysed through its Hecke eigenvalues. Self-adjointness of the Hecke operators under the Petersson inner product is what makes the orthogonal projection onto the Eisenstein subspace well-defined, so that — the genus theta series with Siegel's local-density coefficients — is separated cleanly from the class-distinguishing cusp form .Hasse-Minkowski theorem and quadratic forms over
21.02.08. The Eisenstein part depends only on the genus of , the local-equivalence data at every place that the Hasse-Minkowski local-global principle organises. Siegel's mass formula expresses the genus average of representation numbers as a product of the same local densities that the local classification of forms supplies; theta series is the quantitative, modular-form-valued refinement of the local-global principle, counting solutions rather than merely deciding solvability.Quadratic residues and the Legendre symbol
21.01.06. The two-square theorem emerges in Proposition 3 from , whose coefficients are the character sum with the Legendre-symbol-based character modulo . The criterion " is a sum of two squares iff every prime appears to even order" is exactly a statement about which primes are quadratic residues, linking the modular-forms count back to elementary reciprocity.Theta function on a Riemann surface / Jacobian
06.06.05. This unit's is a one-variable specialisation of the multivariable Riemann theta function on a principally polarised abelian variety, taken at with the period matrix replaced by the Gram matrix of . The contrast is instructive: there the theta function is a section of a line bundle on a complex torus encoding its geometry; here, evaluated at the origin and summed against a quadratic form, it is an arithmetic generating function. The two theta functions share the Poisson-summation transformation law — the modular inversion of this unit is its rank-one shadow.Riemann zeta function
21.03.01. The completed zeta function is the Mellin transform of the theta series of this unit: , and the functional equation is the Mellin image of the theta inversion proved here by Poisson summation. The same analytic identity drives both the modularity of and the symmetry of .
Historical & philosophical context Master
The theta function entered analysis through Jacobi's 1829 Fundamenta Nova [Jacobi 1829], where the products and series now bearing his name were the engine of the theory of elliptic functions. Jacobi derived the two-square formula and the four-square formula — equal to times the sum of divisors of not divisible by — as identities among theta functions, by manipulating infinite products and the addition formulas for elliptic functions. These were exact counting formulas, sharper than the qualitative four-square theorem of Lagrange 1770 [Lagrange 1770], which had established only that every integer is a sum of four squares — the bare positivity that Jacobi's formula now explained by exhibiting the count. The conceptual leap was that an arithmetic quantity, the number of representations, was the Fourier coefficient of an analytic object with a hidden transformation symmetry.
The modern framing — theta series of a quadratic form as a modular form, with representation numbers read off as Fourier coefficients — crystallised in the twentieth century. Hecke and his school recognised the transformation behaviour as modularity on congruence subgroups; Siegel's 1935 mass formula expressed the genus average of representation numbers as a product of local densities, founding the analytic theory of quadratic forms and giving the Eisenstein part of every theta series a closed form. Schoeneberg and Pfetzer established the precise modularity of on with character. The half-integer-weight theory, latent in 's own weight , was placed on rigorous foundations by Shimura's 1973 Annals paper [Shimura 1973], which defined modular forms of half-integral weight via the theta multiplier and constructed the correspondence lifting them to integral weight — the framework in which the cusp parts of odd-rank theta series are now understood, and through which Waldspurger later connected ternary representation numbers to central -values.
Philosophically, the theta-series method is Serre's chosen climax in A Course in Arithmetic: the bridge from Part I, the algebraic and local theory of quadratic forms, to Part II, the analytic theory of modular forms. The two subjects, developed independently, meet in a single function whose existence is forced by Poisson summation and whose coefficients are simultaneously arithmetic counts and analytic data. That a problem as elementary as "in how many ways is a sum of four squares" is solved completely, and a problem as elementary-seeming as the general is solved up to a controlled cusp-form error, is a paradigm for the unity of mathematics: the rigidity of a symmetry in one domain dictates exact answers in another.
Bibliography Master
@book{Serre1973CinA,
author = {Serre, Jean-Pierre},
title = {A Course in Arithmetic},
series = {Graduate Texts in Mathematics},
volume = {7},
publisher = {Springer},
year = {1973},
}
@book{Jacobi1829,
author = {Jacobi, Carl Gustav Jacob},
title = {Fundamenta Nova Theoriae Functionum Ellipticarum},
publisher = {Borntr\"ager, K\"onigsberg},
year = {1829},
}
@article{Lagrange1770,
author = {Lagrange, Joseph-Louis},
title = {D\'emonstration d'un th\'eor\`eme d'arithm\'etique},
journal = {Nouveaux M\'emoires de l'Acad\'emie Royale des Sciences et Belles-Lettres de Berlin},
year = {1770},
}
@article{Shimura1973,
author = {Shimura, Goro},
title = {On modular forms of half integral weight},
journal = {Annals of Mathematics},
volume = {97},
year = {1973},
pages = {440--481},
}
@article{Siegel1935,
author = {Siegel, Carl Ludwig},
title = {{\"U}ber die analytische {T}heorie der quadratischen {F}ormen},
journal = {Annals of Mathematics},
volume = {36},
year = {1935},
pages = {527--606},
}
@book{Iwaniec1997,
author = {Iwaniec, Henryk},
title = {Topics in Classical Automorphic Forms},
series = {Graduate Studies in Mathematics},
volume = {17},
publisher = {American Mathematical Society},
year = {1997},
}
@book{Miyake1989theta,
author = {Miyake, Toshitsune},
title = {Modular Forms},
series = {Springer Monographs in Mathematics},
publisher = {Springer},
year = {1989},
}
@book{Ogg1969,
author = {Ogg, Andrew},
title = {Modular Forms and Dirichlet Series},
publisher = {W. A. Benjamin},
year = {1969},
}
@book{ConwaySloane1999,
author = {Conway, John H. and Sloane, Neil J. A.},
title = {Sphere Packings, Lattices and Groups},
series = {Grundlehren der mathematischen Wissenschaften},
volume = {290},
edition = {3rd},
publisher = {Springer},
year = {1999},
}
@book{HardyWright2008,
author = {Hardy, G. H. and Wright, E. M.},
title = {An Introduction to the Theory of Numbers},
edition = {6th},
publisher = {Oxford University Press},
year = {2008},
}