FLINT3.7.0-dev
Guide · acb_theta.h

Characteristics, derivatives and precision

This guide explains the conventions shared by all functions of acb_theta. The definitions follow [Mum1983] and [Igu1972]; the algorithms are in Theta functions.

Theta functions with characteristics#

For τ∈Hg\tau \in \mathcal{H}_g (a symmetric complex g×gg \times g matrix with positive definite imaginary part YY), z∈Cgz \in \mathbb{C}^g and a,b∈{0,1}ga, b \in \{0, 1\}^g, viewed as column vectors,

θa,b(z,τ)=∑n∈Zg+a2exp⁡(πinTτn+2πinT(z+b2)).\theta_{a,b}(z,\tau) = \sum_{n\in \mathbb{Z}^{g} + \tfrac a2} \exp\bigl(\pi i n^T \tau n + 2\pi i n^T (z + \tfrac b2)\bigr).

The 22g2^{2g} functions are the theta functions of level 2. Shifting zz by half-periods permutes them up to explicit exponential factors:

θa,b(z,τ)=exp⁡(πiaTτa/4+πiaT(z+b2)) θ0,0(z+τa2+b2,τ).\theta_{a,b}(z,\tau) = \exp\bigl(\pi i a^T\tau a/4 + \pi i a^T(z + \tfrac b2)\bigr) \, \theta_{0,0}\bigl(z + \tau\tfrac{a}{2} + \tfrac{b}{2}, \tau\bigr).

The characteristic is even if aTba^T b is even and odd otherwise. θa,b(−z,τ)=(−1)aTbθa,b(z,τ)\theta_{a,b}(-z, \tau) = (-1)^{a^T b} \theta_{a,b}(z, \tau), so the odd theta functions vanish at z=0z = 0; there are 2g−1(2g+1)2^{g-1}(2^g + 1) even and 2g−1(2g−1)2^{g-1}(2^g - 1) odd characteristics.

For g=1g = 1, in the notation of acb_modular, θ0,0=θ3\theta_{0,0} = \theta_3, θ0,1=θ4\theta_{0,1} = \theta_4, θ1,0=θ2\theta_{1,0} = \theta_2 and θ1,1=−θ1\theta_{1,1} = -\theta_1.

Numbering of characteristics#

A characteristic (a,b)(a, b) is stored as the ulong whose binary expansion, most significant bit first, is a0a1…ag−1b0b1…bg−1a_0 a_1 \ldots a_{g-1} b_0 b_1 \ldots b_{g-1}; vectors of 22g2^{2g} theta values are ordered by this number. For g=2g = 2, (a,b)=((1,0),(0,0))(a, b) = ((1,0), (0,0)) is number 8=100028 = 1000_2, and the even characteristics are those with numbers 0, 1, 2, 3, 4, 6, 8, 9, 12, 15. When aa or bb is handled alone (vectors of 2g2^g values θa,0\theta_{a,0}, say), it is numbered on gg bits in the same way. acb_theta_char_set_slong_vec converts a vector of bits to this number and acb_theta_char_bit extracts a bit.

Derivatives#

Only derivatives with respect to zz are computed: those with respect to τ\tau follow from the heat equation 2πi(1+δj,k) ∂θa,b/∂τj,k=∂2θa,b/∂zj∂zk2\pi i (1 + \delta_{j,k}) \, \partial\theta_{a,b}/\partial\tau_{j,k} = \partial^2\theta_{a,b}/\partial z_j \partial z_k. A derivation tuple k=(k0,…,kg−1)k = (k_0, \ldots, k_{g-1}) of nonnegative integers corresponds to the normalised derivative

1k0!⋯kg−1!∂∣k∣θa,b∂z0k0⋯∂zg−1kg−1,∣k∣=k0+⋯+kg−1,\frac{1}{k_0! \cdots k_{g-1}!} \frac{\partial^{|k|}\theta_{a,b}}{\partial z_0^{k_0}\cdots \partial z_{g-1}^{k_{g-1}}}, \qquad |k| = k_0 + \cdots + k_{g-1},

which is the coefficient of h0k0⋯hg−1kg−1h_0^{k_0} \cdots h_{g-1}^{k_{g-1}} in the Taylor expansion of θa,b(z+h,τ)\theta_{a,b}(z + h, \tau), as in acb_modular_theta_jet. The derivatives up to total order ord, of which there are (ord+gg)\binom{\mathit{ord}+g}{g} (acb_theta_jet_nb), are ordered by total order and then reverse-lexicographically; for g=2g = 2: (0,0),(1,0),(0,1),(2,0),(1,1),(0,2),(3,0),…(0,0), (1,0), (0,1), (2,0), (1,1), (0,2), (3,0), \ldots. acb_theta_jet_tuples lists them and acb_theta_jet_index finds the position of a tuple. The functions acb_theta_jet_mul, acb_theta_jet_compose, acb_theta_jet_exp_pi_i and acb_theta_jet_exp_qf compute with such vectors for arbitrary functions.

The symplectic group#

Sp2g(Z)\mathrm{Sp}_{2g}(\mathbb{Z}) is the group of integer matrices m=(αβγδ)m = \begin{pmatrix} \alpha & \beta \\ \gamma & \delta \end{pmatrix} with mTJm=Jm^T J m = J, J=(0Ig−Ig0)J = \begin{pmatrix} 0 & I_g \\ -I_g & 0 \end{pmatrix}. It acts on Cg×Hg\mathbb{C}^g \times \mathcal{H}_g by

m⋅(z,τ)=((γτ+δ)−Tz,  (ατ+β)(γτ+δ)−1),m \cdot (z, \tau) = \bigl((\gamma\tau + \delta)^{-T} z, \; (\alpha\tau + \beta)(\gamma\tau + \delta)^{-1}\bigr),

and the theta functions transform as

θa,b(m⋅(z,τ))=κ(m)ζ8e(m,a,b)det⁡(γτ+δ)1/2eπizT(γτ+δ)−1γzθa′,b′(z,τ),\theta_{a,b}(m\cdot(z,\tau)) = \kappa(m) \zeta_8^{e(m, a, b)} \det(\gamma\tau + \delta)^{1/2} e^{\pi i z^T (\gamma\tau + \delta)^{-1} \gamma z} \theta_{a',b'}(z,\tau),

where ζ8=eπi/4\zeta_8 = e^{\pi i/4}, (a′,b′)(a', b') and e(m,a,b)e(m, a, b) are given by acb_theta_char_table, and κ(m)\kappa(m), an 8th root of unity that depends on the branch of the square root, by acb_siegel_kappa [Igu1972], [Mum1983]. Every τ\tau is equivalent to a reduced matrix, for which the theta series converge fast and uniformly; see Reduction.

Precision#

The magnitude of θa,b(z,τ)\theta_{a,b}(z, \tau) is, barring cancellation, about

∣θa,b(z,τ)∣≈eπyTY−1ye−d2,|\theta_{a,b}(z,\tau)| \approx e^{\pi y^T Y^{-1} y} e^{-d^2},

where y=Im⁡(z)y = \operatorname{Im}(z) and dd is the distance from −Y−1y-Y^{-1}y to the shifted lattice Zg+a2\mathbb{Z}^g + \tfrac a2 for the norm ∥x∥τ2=πxTYx\lVert x \rVert_\tau^2 = \pi x^T Y x: the largest term of the series is the one with nn closest to −Y−1y-Y^{-1}y. The module therefore works with the normalised function

θ~a,b(z,τ)=e−πyTY−1y θa,b(z,τ),\widetilde{\theta}_{a,b}(z,\tau) = e^{-\pi y^T Y^{-1} y} \, \theta_{a,b}(z,\tau),

which is not holomorphic but is bounded on Cg\mathbb{C}^g for fixed τ\tau, and satisfies the same duplication formulas. A precision argument prec means that θ~a,b(z,τ)\widetilde{\theta}_{a,b}(z,\tau) is computed with an absolute error of about 2−prec2^{-\mathit{prec}}, so the outputs of acb_theta_jet and acb_theta_all have absolute errors of about eπyTY−1y2−prece^{\pi y^T Y^{-1} y} 2^{-\mathit{prec}} (for the reduced arguments). This avoids unbounded work when yy is far from zero. Some internal functions (with a distances argument or a shifted_prec flag) also take the factor e−d2e^{-d^2} into account and compute θ~a,b\widetilde\theta_{a,b} with absolute error about e−d22−prece^{-d^2} 2^{-\mathit{prec}}, a shifted absolute precision; the squared distances are computed by acb_theta_eld_distances.

All outputs are certified enclosures. If the imaginary part of τ\tau is not certainly positive definite at the working precision, the outputs have infinite radius.

Testing and profiling programs#

The test programs in src/acb_theta/test check, among others, that the transformation formula and the duplication formulas hold on random input, that acb_siegel_reduce produces matrices accepted by acb_siegel_is_reduced, and that the quasi-linear algorithm agrees with summation. The programs in src/acb_theta/profile are used for tuning:

  • p-sum g prec all_a all_b tilde skew times acb_theta_sum (distances, contexts, summation) on random input whose last row and column of τ\tau are multiplied by skew;
  • p-ql_setup g nb_steps all skew checks that acb_theta_ql_setup stays cheap and succeeds as the precision and number of steps grow;
  • p-ql_exact g pmin pmax cst s exp compares, for precisions from pmin to pmax, the pattern suggested by acb_theta_ql_nb_steps with neighbouring patterns in acb_theta_ql_exact, on matrices whose last s rows and columns are scaled by 2exp2^{\mathit{exp}};
  • p-ql_jet_fd g prec ord all compares acb_theta_ql_jet_fd with acb_theta_sum_jet, which decides the cutoffs of acb_theta_ql_jet.

References#

Cite this page

The FLINT team, “Characteristics, derivatives and precision (acb_theta.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb_theta/conventions.html (generated 2026-11-02).