The following involves characters of affine Lie algebras, and I will be using as reference the book on CFT by Francesco et at (here are some screenshots if useful). But hopefully the post will be self-contained.

Let $$ \Theta^k_\lambda=\sum_{n\in\mathbb Z}\exp\big[-2\pi i(knz+\frac12\lambda z-kn^2\tau-n\lambda\tau-\lambda^2\tau/4k)\big]\tag{14.176} $$ and $$ \chi^k_\lambda=\frac{\Theta^{k+2}_{\lambda+1}-\Theta^{k+2}_{-\lambda-1}}{\Theta^2_1-\Theta^2_{-1}}\tag{14.174} $$

The idea is to expand $\chi$ for $\lambda=k=1$, $z=0$, in powers of $q=e^{2\pi i \tau}$. The expected result is $$ \chi^1_1=q^{5/24}(2+2q+6q^2+8q^3+\cdots)\tag{14.179} $$

How can I use Mathematica to recover eq.$14.179$ from the other two equations? The naive approach does not quite work, because $\chi$ yields an indeterminate form if we take $\lambda=1,z=0$ directly. And the sum does not converge for $|\mathrm{re}(q)|<1$ (and it cannot be analytically continued), so the expansion around $q=0$ is only asymptotic (not a proper power series in the strict sense).


Here's the code, if it helps:

Θ[k_, λ_, z_, τ_] := Sum[Exp[-2 π I (k n z + 1/2 λ z - k n^2 τ - n λ τ - λ^2 τ/(4 k))], {n, -∞, ∞}]
χ[k_, λ_, z_, τ_] := (Θ[k + 2, λ + 1, z, τ] - Θ[k + 2, -λ - 1, z, τ])/(Θ[2, 1, z, τ] - Θ[2, -1, z, τ])
  • 1
    $\begingroup$ No code for those complex expressions? $\endgroup$
    – MarcoB
    Jan 24, 2021 at 22:49
  • $\begingroup$ Exp[-2 π I (k n z + 1/2 λ z - k n^2 τ - n λ τ - λ^2 τ/(4 k))] $\endgroup$ Jan 24, 2021 at 22:59
  • $\begingroup$ I wonder how much of this is expressible in terms of the built-in theta functions or $q$-functions... $\endgroup$ Jan 30, 2021 at 8:52

1 Answer 1


Let $p=e^{2\pi iz}$ and $q=e^{2\pi i\tau}$.

thetaTerm[k_, l_] := p^(-k*n - l/2) q^(k*n^2 + l*n + l^2/(4*k))
numTerm = thetaTerm[k+2, l+1] - thetaTerm[k+2, -l-1] /. {l->1, k->1}
denTerm = thetaTerm[2, 1] - thetaTerm[2, -1]
max = 3
numSum = Sum[numTerm/q^(1/3), {n, -max, max}] // Expand
denSum = Sum[denTerm/q^(1/8), {n, -max, max}] // Expand
lim = Limit[numSum/denSum, p->1]
ser = Series[lim, {q, 0, max}]

$2+2 q+6 q^2+8 q^3+O\left(q^4\right)$

The prefactor $q^{5/24}$ comes from the $q^{1/3}$ in the numerator terms and the $q^{1/8}$ in the denominator terms, which I removed.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.