FLINT3.7.0-dev

acb_modular_theta_sum

Synopsis#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)source

Sets 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):

\begin{array}{llll} & \theta_1, \theta_2 & q^0 & (w^1 \pm w^{-1}) \\ k = 0 & \theta_3, \theta_4 & q^1 & (w^2 \pm w^{-2}) \\ k = 1 & \theta_1, \theta_2 & q^2 & (w^3 \pm w^{-3}) \\ k = 2 & \theta_3, \theta_4 & q^4 & (w^4 \pm w^{-4}) \\ k = 3 & \theta_1, \theta_2 & q^6 & (w^5 \pm w^{-5}) \\ k = 4 & \theta_3, \theta_4 & q^9 & (w^6 \pm w^{-6}) \\ \end{array}

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.

Cite this page

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).