Theta Series and Lattice Analytics

Counting Lattice Points: The Theta Series

When we evaluate the union-bound error probability of a lattice code, we need to count how many lattice points sit at each squared distance from the origin: how many at distance dmin2d_{\min}^2, how many at 2dmin22 d_{\min}^2, and so on. The generating function that packages all of these counts into a single object is the theta series ΘΛ(q)\Theta_\Lambda(q). The theta series is the "spectrum" of a lattice — the analogue of the weight enumerator of a code, or the power spectral density of a signal — and it does all the heavy lifting in three places:

  1. Performance analysis. The union-bound expansion Pe=dNdQ(d/2σ)P_e = \sum_d N_d Q(d/2\sigma) reads off of ΘΛ(q)\Theta_\Lambda(q).
  2. Optimality proofs. Viazovska's proofs use modular-form properties of the theta series of E8E_8 and Λ24\Lambda_{24}.
  3. Code construction. Matching theta-series coefficients between Λc\Lambda_c and Zn\mathbb{Z}^n is the numerical fingerprint of a good coding lattice.

This section introduces the theta series, computes it for the canonical lattices, and illustrates how its first few coefficients are read off the lattice.

Definition:

Theta Series

The theta series of a lattice ΛRn\Lambda \subset \mathbb{R}^n is the formal power series ΘΛ(q)  =  xΛqx2  =  m=0Nm(Λ)qm,\Theta_\Lambda(q) \;=\; \sum_{\mathbf{x} \in \Lambda} q^{\|\mathbf{x}\|^2} \;=\; \sum_{m = 0}^\infty N_m(\Lambda) \, q^m, where Nm(Λ)={xΛ:x2=m}N_m(\Lambda) = |\{\mathbf{x} \in \Lambda : \|\mathbf{x}\|^2 = m\}| is the number of lattice points of squared norm mm. In particular, N0=1N_0 = 1 (the origin) and Ndmin2=K(Λ)N_{d_{\min}^2} = K(\Lambda) (the kissing number).

The series converges as a holomorphic function of qq in the open unit disk q<1|q| < 1. It is often written with the substitution q=eπiτq = e^{\pi i \tau} for τ\tau in the upper half-plane, which makes the modular-form structure explicit.

Two lattices can have the same theta series without being isometric (Milnor's 1616-dimensional example: E8E8E_8 \oplus E_8 and D16+D_{16}^+). However, for small dimensions and for the classical lattices we care about, the theta series is a very effective fingerprint.

Theorem: Theta Series of Zn\mathbb{Z}^n (Jacobi)

The theta series of the integer lattice factors across dimensions: ΘZn(q)  =  (θ3(q))n,θ3(q)  =  mZqm2  =  1+2q+2q4+2q9+2q16+\Theta_{\mathbb{Z}^n}(q) \;=\; \bigl(\theta_3(q)\bigr)^n, \qquad \theta_3(q) \;=\; \sum_{m \in \mathbb{Z}} q^{m^2} \;=\; 1 + 2q + 2 q^4 + 2 q^9 + 2 q^{16} + \cdots In particular, ΘZn(q)\Theta_{\mathbb{Z}^n}(q) has Nm(Zn)=rn(m)N_m(\mathbb{Z}^n) = r_n(m), the number of ways to write mm as a sum of nn squares of integers.

A lattice point xZn\mathbf{x} \in \mathbb{Z}^n is a tuple (x1,,xn)(x_1, \ldots, x_n) of integers, and x2=xi2\|\mathbf{x}\|^2 = \sum x_i^2. So the theta-series coefficient NmN_m is the count of nn-tuples summing to mm in squares, which factors as an nn-fold convolution of the 1D coefficient Nm(Z)N_m(\mathbb{Z}).

Example: First Coefficients of ΘD4(q)\Theta_{D_4}(q) and ΘE8(q)\Theta_{E_8}(q)

Compute the first few coefficients N0,N1,N2,N3,N4N_0, N_1, N_2, N_3, N_4 of the theta series ΘD4(q)\Theta_{D_4}(q) and ΘE8(q)\Theta_{E_8}(q). Compare the kissing numbers K=Ndmin2K = N_{d_{\min}^2} to the values 2424 (for D4D_4) and 240240 (for E8E_8).

Definition:

Theta Series as Modular Form (Informal)

When Λ\Lambda is an even self-dual lattice (so V(Λ)=1V(\Lambda) = 1 and all squared norms are even integers), the theta series ΘΛ(τ)=xeπiτx2\Theta_\Lambda(\tau) = \sum_{\mathbf{x}} e^{\pi i \tau \|\mathbf{x}\|^2}, regarded as a function of τ\tau in the upper half-plane, is a modular form of weight n/2n/2: it satisfies ΘΛ ⁣(1/τ)=τn/2ΘΛ(τ)andΘΛ(τ+2)=ΘΛ(τ).\Theta_\Lambda\!\bigl(-1/\tau\bigr) = \tau^{n/2} \, \Theta_\Lambda(\tau) \qquad \text{and} \qquad \Theta_\Lambda(\tau + 2) = \Theta_\Lambda(\tau). The first identity is the Poisson summation formula in disguise; the second is immediate from the even-squared-norm property.

For E8E_8 and Λ24\Lambda_{24} this structure determines the theta series uniquely up to scalars — there is essentially only one modular form of weight 44 (giving ΘE8=E4\Theta_{E_8} = E_4) and a two-dimensional space of weight 1212 (giving the two Niemeier-class theta series, one of which is ΘΛ24\Theta_{\Lambda_{24}}). The rigidity is what makes modular-form arguments so powerful for these lattices.

Full modular-form machinery (Eisenstein series, cusp forms, Hecke operators) is beyond the scope of this chapter. The summary one needs is: even self-dual lattices have their theta series essentially determined by nn, and Viazovska's magic function for the Cohn–Elkies bound is built from these same modular forms.

Theta-Series Coefficients for Classical Lattices

Bar chart of the first several theta-series coefficients N0,N2,N4,N6,N8N_0, N_2, N_4, N_6, N_8 for classical lattices Z2,Z4,D4,E8,Λ24\mathbb{Z}^2, \mathbb{Z}^4, D_4, E_8, \Lambda_{24}. The first nonzero coefficient (after N0N_0) is the kissing number K(Λ)K(\Lambda); subsequent coefficients track the number of lattice points at increasing radii. Note the huge disparity: E8E_8 has 240240 minimum vectors, Λ24\Lambda_{24} has 196560196560. These numbers multiply the pairwise union-bound terms in an ML-decoding error analysis.

Parameters

Theorem: Poisson Summation and the Functional Equation

For any lattice ΛRn\Lambda \subset \mathbb{R}^n and any Schwartz function f:RnCf : \mathbb{R}^n \to \mathbb{C}, xΛf(x)  =  1V(Λ)yΛf^(y),\sum_{\mathbf{x} \in \Lambda} f(\mathbf{x}) \;=\; \frac{1}{V(\Lambda)} \sum_{\mathbf{y} \in \Lambda^*} \widehat{f}(\mathbf{y}), where f^\widehat{f} is the Fourier transform of ff. Applied to f(x)=eπτx2f(\mathbf{x}) = e^{-\pi \tau \|\mathbf{x}\|^2} (whose Fourier transform is τn/2eπy2/τ\tau^{-n/2} e^{-\pi \|\mathbf{y}\|^2 / \tau}), this yields the theta-series functional equation ΘΛ(eπτ)  =  τn/2V(Λ)ΘΛ(eπ/τ).\Theta_\Lambda(e^{-\pi \tau}) \;=\; \frac{\tau^{-n/2}}{V(\Lambda)} \, \Theta_{\Lambda^*}(e^{-\pi / \tau}).

Poisson summation says that summing a function over a lattice is the same as summing its Fourier transform over the dual lattice, up to a volume normalisation. The theta series identity falls out by specialising to a Gaussian.

,

How the Theta Series Enters Error Analysis

For a lattice code on the AWGN channel with noise variance σ2\sigma^2, the pairwise error probability between two codewords differing by λΛ{0}\lambda \in \Lambda \setminus \{0\} is Q(λ/2σ2)Q(\|\lambda\| / 2 \sqrt{\sigma^2}). The union bound on ML error probability is Pe    xΛ{0}Q ⁣(x2σ2)  =  mdmin2Nm(Λ)  Q ⁣(m4σ2).P_e \;\le\; \sum_{\mathbf{x} \in \Lambda \setminus \{0\}} Q \!\left(\frac{\|\mathbf{x}\|}{2 \sqrt{\sigma^2}}\right) \;=\; \sum_{m \ge d_{\min}^2} N_m(\Lambda) \; Q\!\left( \sqrt{\frac{m}{4 \sigma^2}}\right). The first term Ndmin2Q(dmin/2σ2)N_{d_{\min}^2} Q(d_{\min} / 2\sqrt{\sigma^2}) dominates at high SNR and is controlled by the kissing number. The tail terms m>dmin2\sum_{m > d_{\min}^2} are controlled by the rest of the theta series, and the series ΘΛ(q)\Theta_\Lambda(q) summarises the entire error-floor picture as a function of "noise parameter" q=e1/4σ2q = e^{-1/4 \sigma^2}.

,
🔧Engineering Note

Using Theta Series for Fast Error-Rate Simulations

In practice, Monte Carlo simulation of lattice-code error rates at SNRs above 1010 dB is prohibitive: error events are so rare that 10910^9 channel uses are required to get 100100 error events for a reliable estimate. The union-bound formula above — reading the theta series directly — provides a tight estimate at a computational cost of zero: one looks up the first 551010 nonzero coefficients of ΘΛ(q)\Theta_\Lambda(q) from Conway–Sloane's tables (or a small Python script iterating over short vectors) and plugs into the formula. This is how Forney–Ungerboeck (1998) generates essentially all of its AWGN error-rate curves for lattice-based TCM.

The theta-series estimate is an upper bound; it over-counts because union bound double-counts overlapping error regions. At error rates below 10410^{-4} it is tight within 0.10.1 dB.

Practical Constraints
  • Requires knowing the first few theta-series coefficients: tabulated in Conway–Sloane for all classical lattices.

  • Tight within 0.1 dB at BER <104< 10^{-4} — better than Monte Carlo for the relevant SNR range.

  • For fading channels, the theta series is replaced by the product distance spectrum.

,

Historical Note: Jacobi (1829): Theta Functions and Sums of Squares

1829

Carl Gustav Jacob Jacobi's 18291829 treatise Fundamenta Nova Theoriae Functionum Ellipticarum introduced the theta functions θ1,θ2,θ3,θ4\theta_1, \theta_2, \theta_3, \theta_4 as tools for studying elliptic functions. In it Jacobi established the product expansion θ3(q)=m=1(1q2m)(1+q2m1)2\theta_3(q) = \prod_{m=1}^\infty (1 - q^{2m})(1 + q^{2m-1})^2, the triple identity θ2(q)4+θ4(q)4  =  θ3(q)4,\theta_2(q)^4 + \theta_4(q)^4 \;=\; \theta_3(q)^4, and — most strikingly for us — the formula for the number of representations of an integer as a sum of two, four, six, or eight squares. The formula r4(m)=8dm,4ddr_4(m) = 8 \sum_{d | m, 4 \nmid d} d, for example, is literally the coefficient of qmq^m in ΘZ4(q)=θ3(q)4\Theta_{\mathbb{Z}^4} (q) = \theta_3(q)^4.

140140 years after Jacobi, the same theta-series technology rephrased would let Viazovska solve the sphere-packing problem in dimensions 88 and 2424. The continuity of mathematical methods across this span is remarkable.

Theta series

The generating function ΘΛ(q)=xΛqx2\Theta_\Lambda(q) = \sum_{\mathbf{x} \in \Lambda} q^{\|\mathbf{x}\|^2} that counts lattice points by squared norm. Equivalent to the weight enumerator of a code in lattice language.

Related: Kissing Number, Theta Series as Modular Form (Informal)

Modular form

A function on the upper half-plane satisfying specific transformation rules under τ1/τ\tau \to -1/\tau and ττ+1\tau \to \tau + 1. The theta series of an even self-dual lattice is a modular form of weight n/2n/2.

Related: Theta Series, Self Dual

Common Mistake: Theta Series is a Power Series, Not a Dirichlet Series

Mistake:

Conflating ΘΛ(q)=mNmqm\Theta_\Lambda(q) = \sum_m N_m q^m with the Dirichlet series mNmms\sum_m N_m m^{-s} that appears in analytic number theory. Both are generating functions for the same counting sequence NmN_m, but they behave very differently under transformation.

Correction:

The theta series is a power series in qq, convergent for q<1|q| < 1. Under the modular transformation τ1/τ\tau \to -1/\tau, it satisfies a functional equation (Jacobi's inversion formula). The associated Dirichlet series is defined in the half-plane s>n/2\Re s > n/2 and has a Mellin-transform relation to the theta series; do not mix the two up unless you know which properties you need.

Quick Check

The coefficient of q2q^2 in ΘZ2(q)\Theta_{\mathbb{Z}^2}(q) is r2(2)r_2(2), the number of ways to write 22 as a sum of two squares of integers. What is this coefficient?

00

22

44

88

Key Takeaway

The theta series ΘΛ(q)=mNmqm\Theta_\Lambda(q) = \sum_m N_m q^m packages every distance-related property of a lattice into one generating function. Its first nonzero coefficient (after N0=1N_0 = 1) is the kissing number K(Λ)K(\Lambda); its higher coefficients directly feed the union-bound error analysis of AWGN lattice codes. For even self-dual lattices — Zn\mathbb{Z}^n, E8E_8, Λ24\Lambda_{24} — the theta series is a modular form, and the whole theory of modular forms is available for computation and proof. This is the mathematical lever Viazovska used to prove optimality of E8E_8 and Λ24\Lambda_{24} in 20172017, and the practical tool Forney–Ungerboeck use to generate AWGN error-rate curves for lattice codes without Monte Carlo.