acb_modular_theta_sum
#include <flint/acb_modular.h>void acb_modular_theta_sum(acb_ptr theta1, acb_ptr theta2, acb_ptr theta3, acb_ptr theta4, const acb_t w, int w_is_unit, const acb_t q, slong len, slong prec)sourceSets the outputs to the first len \ge 1 Taylor coefficients of \theta_1(z+x,\tau)/q_{1/4}, \theta_2(z+x,\tau)/q_{1/4}, \theta_3(z+x,\tau) and \theta_4(z+x,\tau), given w = e^{\pi i z} and q = e^{\pi i \tau}, by summing truncated theta series with a rigorous bound for the tail. A nonzero w_is_unit asserts that |w| = 1 (real z). Aliasing between inputs and outputs is not allowed.
The factor q_{1/4} is left out of \theta_1 and \theta_2 because it often cancels in quotients; the caller computes q_{1/4} = e^{\pi i\tau/4} and q = q_{1/4}^4 and multiplies it back. The function is meant for |q| \ll 1, after a modular transformation; it accepts any q but returns useless enclosures when the series does not converge quickly.
The four series are summed together. For k = 0, 1, 2, \ldots the exponents of q are \lfloor (k+2)^2/4 \rfloor = 1, 2, 4, 6, 9, \ldots (squares and pronic numbers interleaved), alternately for (\theta_3, \theta_4) and (\theta_1, \theta_2), and the exponents of w are \pm (k+2):
The powers of q are computed with the addition sequence of acb_modular_addseq_theta. Writing the even cosine terms as w^{2n} + w^{-2n}, the odd cosine terms as w (w^{2n} + w^{-2n-2}) and the sine terms as w (w^{2n} - w^{-2n-2}), only even powers of w and w^{-1} are needed. The truncation bound is given in Genus 1.
The FLINT team, “acb_modular_theta_sum (acb_modular.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb_modular/acb_modular_theta_sum.html (generated 2026-10-20).
@misc{flint-doc-acb-modular-acb-modular-theta-sum,
author = {{The FLINT team}},
title = {{acb\_modular\_theta\_sum (acb\_modular.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/acb_modular/acb_modular_theta_sum.html},
note = {Generated 2026-10-20}
}