Ramanujan's Notebooks, shared: thetaPhi
DefinitionRamanujanNotebooks_shared_thetaPhinumber-theoryramanujan-notebooks
Ramanujan's φ(q) = f(q, q) = ∑_{k ∈ ℤ} q^{k^2} (Entry 22(i), Part III, p. 36; (3.1),
p. 98). The argument is q itself: Berndt's φ(-q) is thetaPhi (-q).
Domain: ‖q‖ < 1. There φ(-q) = (q; q)_∞ / (-q; q)_∞ ((22.4), p. 37). Outside: 0.
Reference: 1 + 2q + 2q^4 + 2q^9 + …, φ(1/5) = 1.4032010240131072067…,
φ(e^{-π}) = π^{1/4} / Γ(3/4).
Definition code
import Mathlib
noncomputable section
namespace RamanujanNotebooks
/-- Ramanujan's `φ(q) = f(q, q) = ∑_{k ∈ ℤ} q^{k^2}` (Entry 22(i), Part III, p. 36; (3.1),
p. 98). The argument is `q` itself: Berndt's `φ(-q)` is `thetaPhi (-q)`.
Domain: `‖q‖ < 1`. There `φ(-q) = (q; q)_∞ / (-q; q)_∞` ((22.4), p. 37). Outside: `0`.
Reference: `1 + 2q + 2q^4 + 2q^9 + …`, `φ(1/5) = 1.4032010240131072067…`,
`φ(e^{-π}) = π^{1/4} / Γ(3/4)`. -/
def thetaPhi (q : ℂ) : ℂ :=
∑' n : ℤ, q ^ (n.natAbs ^ 2)
end RamanujanNotebooks
end
Source
Bruce C. Berndt, Ramanujan's Notebooks.