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 ≥1\ge 1 Taylor coefficients of θ1(z+x,τ)/q1/4\theta_1(z+x,\tau)/q_{1/4}, θ2(z+x,τ)/q1/4\theta_2(z+x,\tau)/q_{1/4}, θ3(z+x,τ)\theta_3(z+x,\tau) and θ4(z+x,τ)\theta_4(z+x,\tau), given w=eπizw = e^{\pi i z} and q=eπiτ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|w| = 1 (real zz). Aliasing between inputs and outputs is not allowed.

The factor q1/4q_{1/4} is left out of θ1\theta_1 and θ2\theta_2 because it often cancels in quotients; the caller computes q1/4=eπiτ/4q_{1/4} = e^{\pi i\tau/4} and q=q1/44q = q_{1/4}^4 and multiplies it back. The function is meant for ∣q∣≪1|q| \ll 1, after a modular transformation; it accepts any qq but returns useless enclosures when the series does not converge quickly.

The four series are summed together. For k=0,1,2,…k = 0, 1, 2, \ldots the exponents of qq are ⌊(k+2)2/4⌋=1,2,4,6,9,…\lfloor (k+2)^2/4 \rfloor = 1, 2, 4, 6, 9, \ldots (squares and pronic numbers interleaved), alternately for (θ3,θ4)(\theta_3, \theta_4) and (θ1,θ2)(\theta_1, \theta_2), and the exponents of ww are ±(k+2)\pm (k+2):

θ1,θ2q0(w1±w−1)k=0θ3,θ4q1(w2±w−2)k=1θ1,θ2q2(w3±w−3)k=2θ3,θ4q4(w4±w−4)k=3θ1,θ2q6(w5±w−5)k=4θ3,θ4q9(w6±w−6)\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 qq are computed with the addition sequence of acb_modular_addseq_theta. Writing the even cosine terms as w2n+w−2nw^{2n} + w^{-2n}, the odd cosine terms as w(w2n+w−2n−2)w (w^{2n} + w^{-2n-2}) and the sine terms as w(w2n−w−2n−2)w (w^{2n} - w^{-2n-2}), only even powers of ww and w−1w^{-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-11-02).