\documentclass{amsart} \input{preamble} \begin{document} \title{A polynomial-time algorithm to compute theta functions of Schottky groups} \author{Marc Masdeu} \address{Departament de Matem\`atiques\\Universitat Aut\`onoma de Barcelona\\Edifici C, 08193 Bellaterra, Barcelona, Catalonia} \address{Centre de Recerca Matemàtica\\Bellaterra, Barcelona, Catalonia} \email{marc.masdeu@uab.cat} \subjclass[2020]{14Q99, 14H42 (14K25, 11Y99, 30F10)} \date{} \begin{abstract} Abelian integrals, holomorphic differentials, period matrices and the Schottky--Klein prime function of a Riemann surface uniformized by a classical Schottky group are given by Poincar\'e theta series, which are sums over the elements of a free group. The algorithms that evaluate these series sum a truncated, possibly adaptively pruned, portion of the Cayley tree of the group, and the number of terms needed grows exponentially with the number of correct digits. We observe that the sum over all group elements starting with a fixed generator is a holomorphic function on the complement of a disc, and that these functions satisfy an exact linear functional equation coming from the self-similarity of the Cayley tree, given by a transfer operator built from the generators. Representing them by truncated Taylor expansions turns the evaluation of the series into a finite-dimensional linear problem, which we solve iteratively. The resulting algorithm computes the integrals $\Omega_n$, the period matrix and the prime function to $P$ bits of precision; for a fixed Schottky datum the number of arithmetic operations is cubic in $P$ and in the genus. We prove that it converges geometrically under a standard Schottky-type hypothesis on the group, which is closely related to the absolute convergence of the series. Along the way we give a complete proof of the cross-ratio formula for the period matrix, including a term that is missing from one version of it in the literature. We compare with the existing algorithms, and illustrate the method by reproducing a published value of the prime function and computing it to $30$ digits, and by computing period matrices of genus up to six to about $25$ digits. \end{abstract} \maketitle \section*{Disclosure of AI use} {\sloppy This work was prepared with substantial assistance from AI language models, used through the Claude Code command-line agent: Claude Opus~5.5, Claude Sonnet~5.5 and Claude Haiku~5.5, all developed by Anthropic. They were used to draft and edit the text of this article, to survey the literature and to suggest references, to propose and check proofs and calculations, to write and run the Sage code and the numerical experiments reported here (including the benchmarks and the examples of Section~\ref{sec:applications}), and, in separate sessions acting as referees, to criticise earlier versions of the manuscript. No AI system is listed as an author. The author conceived the project and the algorithm's origin in the $p$-adic setting, directed all the work, and takes full responsibility for the content of the article, including the correctness of its statements and the accuracy of its references. The software is available at \url{https://github.com/mmasdeu/archimedean_theta}.\par} \section{Introduction} Throughout we follow the notations from~\cite{Schmies2011}, which we now recall. Let $G$ be a (classical) Schottky group, with loxodromic generators \[ \sigma_1, \ldots, \sigma_N \in \PGL_2(\CC). \] Denote by $A_n$ and $B_n$ the repelling and attracting fixed points of $\sigma_n$, respectively, and by $\mu_n = \sigma_n'(B_n)$, with $|\mu_n|<1$, its loxodromic factor; thus \begin{equation}\label{eq:multiplier} \frac{\sigma_n(z) - B_n}{\sigma_n(z) - A_n} = \mu_n\,\frac{z - B_n}{z - A_n}. \end{equation} For convenience, we will also write $\sigma_{-i} = \sigma_i^{-1}$. Since $G$ is freely generated by the $\sigma_i$, each $\sigma \in G$ has a unique representation of the form \[ \sigma = \sigma_{i_1} \cdots \sigma_{i_k},\quad i_j \in \{\pm 1, \ldots, \pm N\}, \] where we require $i_j \neq -i_{j+1}$ for all $j$. The list of integers $[i_1,\ldots, i_k]$ will be called the \emph{Tietze word} associated to $\sigma$. Denote by $H_n=\langle\sigma_n\rangle$ the subgroup generated by $\sigma_n$. Every coset in $G/H_n$ has a unique representative whose Tietze word does not end in $\pm n$, that is, a representative with Tietze word of the form \[ [i_1,\ldots, i_k],\quad i_j \in \{\pm 1, \ldots, \pm N\},\quad i_k \neq \pm n. \] Consider now the series \[ \omega_n(z) = \sum_{\sigma \in G/H_n}\left( \frac{1}{z - \sigma(B_n)} - \frac{1}{z - \sigma(A_n)}\right)dz, \] which is a holomorphic differential provided that the sum converges absolutely. The series $\omega_n(z)$ can be integrated to give \[ \Omega_n(z) = \int_\infty^z \omega_n = \sum_{\sigma \in G/H_n}\log\frac{z - \sigma(B_n)}{z - \sigma(A_n)}. \] One may also obtain the period matrix $(B_{mn})_{1\leq m,n\leq N}$, where $B_{mn}=\int_z^{\sigma_m(z)}\omega_n$ (this is independent of $z$ and of the path, up to $2\pi i\ZZ$) is given by \begin{equation}\label{eq:periodmatrix} B_{mn} = \delta_{mn} \log \mu_n + \sum_{\substack{\sigma \in H_m\backslash G / H_n\\ \sigma \notin H_n \text{ if } m=n}} \log \left(B_m:A_m:\sigma(B_n):\sigma(A_n)\right), \end{equation} with $\delta_{mn}$ being Kronecker's delta function and $(a:b:c:d)$ the cross-ratio \[ (a:b:c:d) = \frac{(a-c)(b-d)}{(a-d)(b-c)} \] of the points $a,b,c,d$. The sum runs over the double cosets, represented by the reduced words which neither begin with $\sigma_{\pm m}$ nor end with $\sigma_{\pm n}$, \emph{together with the trivial double coset when $m\neq n$}, which contributes $\log(B_m:A_m:B_n:A_n)$. This is the formula of~\cite[Theorem~30]{BobenkoIntro2011} (see also~\cite[(5.14)]{CrowdyMarshallMcurves2011}); the term of the trivial double coset for $m\neq n$ is easy to overlook, and is missing in~\cite[(4.4)]{Schmies2011} (see Remark~\ref{rem:identity}). We give a complete proof in Proposition~\ref{prop:periods}. These series go back to Schottky, Burnside and Baker~\cite{Burnside1891,Baker1897} (see also~\cite{Hejhal1972,BobenkoIntro2011}), and algorithms to evaluate them have been proposed in the literature; we review them in Section~\ref{sec:existing-algorithms}. For example, \cite{Schmies2011} studies the convergence of the series $\omega_n$ and gives a priori error bounds, \cite{Lyamaev2022} sharpens the estimates and the summation strategy, and~\cite{YamamotoMiyoshi2026} does the same for the product defining the Schottky--Klein prime function. All the algorithms which evaluate the series rely on the summation of a certain finite subset of their terms, and the number of terms which are needed grows exponentially with the target precision (see Section~\ref{sec:existing-algorithms}). For the prime function of a planar circular domain there are also methods which avoid the series altogether, by collocation~\cite{CrowdyMarshall2007} or by solving boundary value problems~\cite{CKGN2016}; they are specific to that setting (Schottky doubles), and for the first of them no convergence proof is available~\cite{CrowdyMarshallMcurves2011}. The goal of this note is to describe a polynomial-time algorithm to compute the above quantities, by means of an iterative procedure. In fact, we will give an algorithm to compute $\Omega_n(z)$ as a function of $z$. By computing its derivative we will recover $\omega_n(z)$. We will also give an algorithm to compute the period matrix, and the Schottky--Klein prime function. \subsection*{Origin, main ideas and results} The algorithm is the archimedean analogue of the algorithm of Masdeu and Xarles~\cite{masdeu-xarles} for $p$-adic theta functions of Mumford curves, which is where this work originated (see Section~\ref{sec:applications}). The Cayley tree of $G$ is self-similar: the subtree of descendants of a vertex only depends on the last letter of the corresponding word. Consequently, the sum of the terms of the series over all words \emph{beginning} with a given generator $\sigma_i$ is one holomorphic function $F^{(i)}_n$ on the complement of a closed disc, and these $2N$ functions satisfy the linear system \[ F^{(i)}_n = E^{(i)}_n + \sum_{j\neq -i} T_{ij} F^{(j)}_n, \] where $E_n^{(i)}$ is an explicit logarithm of a ratio of linear functions, and $T_{ij}$ is a ``transfer operator'': the composition with the M\"obius transformation $\sigma_i^{-1}$ followed by a normalization (Theorem~\ref{thm:functional-equation}). Expanding each $F^{(i)}_n$ in a Taylor series in a coordinate that is natural to the disc, the operators $T_{ij}$ become explicit matrices, which can be computed in $O(p^2)$ operations via a three-term recurrence (Lemma~\ref{lem:recurrence}). Our main results are: \begin{itemize} \item an algorithm (Algorithm~\ref{alg:main}) which computes $\Omega_n$, for all $n$, to $P$ bits of precision with $O(N^3 P^3)$ arithmetic operations (Theorem~\ref{thm:convergence}), whereas the term-by-term summation needs $2^{\Theta(P)}$ terms, together with a proof that it converges geometrically under hypothesis (S) of Section~\ref{sec:preliminaries}, which is closely related to the absolute convergence of the series (Remark~\ref{rem:S-equiv}); the constants depend on the geometry of the Schottky datum; \item a corresponding algorithm for the period matrix (Section~\ref{sec:periods}), together with a careful proof of the classical cross-ratio formula~\eqref{eq:periodmatrix}, and for the Schottky--Klein prime function (Section~\ref{sec:prime}), the latter being the basic tool for the explicit solution of boundary value problems in multiply connected planar domains~\cite{CKGN2016,Crowdy2020}; \item an implementation in Sage, and numerical experiments (Section~\ref{sec:experiments}), including a comparison with the truncation by word length and with a pruned summation of Bogatyrev type. \end{itemize} The rest of the article is organized as follows. In Section~\ref{sec:preliminaries} we recall the necessary facts on Schottky groups, state the convergence hypothesis, and prove the recursive structure of the series. Section~\ref{sec:existing-algorithms} reviews the state of the art. Our algorithm and its analysis occupy Section~\ref{sec:algorithm}. Section~\ref{sec:periods} and Section~\ref{sec:prime} treat the period matrix and the prime function. Section~\ref{sec:experiments} reports on numerical experiments, and Section~\ref{sec:applications} discusses applications and open directions. \section{Preliminaries} \label{sec:preliminaries} \subsection{Schottky data} Let $\Lambda$ be the closure of the set of limit points for $G$, and set $\Omega = \Ch \setminus \Lambda$, on which $G$ acts discontinuously. The quotient $\Omega/G$ is a Riemann surface of genus $N$. We work with \emph{classical} Schottky groups, given by the following data. \begin{definition}\label{def:schottky-data} A \emph{Schottky datum} consists of open discs $\cD_i\subset\CC$, for $i\in I=\{\pm 1,\ldots,\pm N\}$, with centers $a_i$ and radii $r_i$, and loxodromic $\sigma_1,\ldots,\sigma_N\in\PGL_2(\CC)$ such that \begin{enumerate} \item The closed discs $\overline{\cD_i}$ are mutually disjoint, \item For all $i\in I$, we have $\sigma_i(\Ch \setminus \cD_{-i}) = \overline{\cD_i}$. \end{enumerate} The set \[ \cF = \Ch \setminus \bigcup_{i\in I} \overline{\cD_i} \] is a fundamental domain for $G=\langle\sigma_1,\ldots,\sigma_N\rangle$. \end{definition} We will assume that all the data defining this fundamental domain is available to us, and (after a change of coordinates) that $\infty\in\cF$. The attracting fixed point $B_n$ of $\sigma_n$ lies in $\cD_n$, and the repelling one $A_n$ lies in $\cD_{-n}$. The group $G$ is not determined by the discs alone: the transformation $\sigma_i$ is only determined up to composition with a M\"obius transformation preserving $\overline{\cD_i}$, and which one is chosen changes the group. \begin{remark} Schmies~\cite{Schmies2011} works with isometric circles (the \emph{iso-classical} case), for which the discs $\cD_{\pm i}$ are the interiors of the isometric circles of $\sigma_{\mp i}$. Nothing in this article requires this. \end{remark} For $i\in I$ we use the coordinate \begin{equation}\label{eq:coordinate} t_i(z) = \frac{r_i}{z-a_i}, \end{equation} which identifies $\Ch\setminus\cD_i$ with the closed unit disc $\{|t|\leq 1\}$, with $t_i(\infty)=0$. \subsection{Convergence} For $\sigma\neq 1$ with Tietze word $[i_1,\ldots,i_k]$, let \[ O(\sigma) = \sigma\bigl(\Ch\setminus\cD_{-i_k}\bigr) = \sigma_{i_1}\cdots\sigma_{i_{k-1}}\bigl(\overline{\cD_{i_k}}\bigr) \] (a closed disc: the ``outer disc of level $k$'' in the terminology of~\cite{Lyamaev2022}). Note that $O(\sigma)\subset \overline{\cD_{i_1}}$. We will assume the following hypothesis, which is what makes the series of interest converge absolutely. \begin{enumerate} \item[\textbf{(S)}] There are constants $C_{\mathrm S}>0$ and $0<\theta<1$ such that for all $k\geq 1$, \[ \sum_{\sigma\in\cW_k}\diam O(\sigma)\ \leq\ C_{\mathrm S}\theta^k, \] where $\cW_k=\{\sigma\in G: |\sigma|=k\}$. \end{enumerate} Sufficient conditions for (S) go back to Burnside~\cite{Burnside1891} (sufficiently small discs), and were made quantitative by Schmies~\cite{Schmies2011} and, for real hyperelliptic curves, by Bogatyrev~\cite{Bogatyrev1999,Bogatyrev2012}. For instance, in the setting of Theorem~1 in~\cite{Lyamaev2022} the sum of the diameters of the inner circles of the domain $\sigma\cF$ is at most $\frac{\gamma-1}{\gamma+1}$ times the diameter of its outer circle, where $\gamma=\max_j\gamma_j$; these inner circles are the $O(\sigma\sigma_l)$, so this gives (S) with $\theta=\frac{\gamma-1}{\gamma+1}$. Our results are stated and proved under (S). We now recall why (S) is essentially the absolute convergence of the series $\omega_n$; the facts involved are standard, we only sketch the argument, and it is not used elsewhere. \begin{remark}[sketch]\label{rem:S-equiv} Let $\delta$ be the Hausdorff dimension of $\Lambda$, which is also the critical exponent of the Poincar\'e series $\sum_{\sigma\in G}|\sigma'(z)|^s$~\cite{Sullivan1979}. By the Koebe distortion theorem, $\diam O(\sigma)$ is comparable, with constants that only depend on the datum and on $z$, to $|\sigma'(z)|$ for any fixed $z\in\cF$, so that $\sum_{\sigma\in\cW_k}\diam O(\sigma)^s$ grows like $e^{k\Pr(s)+o(k)}$, where $\Pr$ is the pressure function of the associated expanding map. By Bowen's formula~\cite{Bowen1979}, $\Pr$ is strictly decreasing and vanishes at $s=\delta$. Hence (S) holds if and only if $\delta<1$. On the other hand, for a classical Schottky group the Poincar\'e series diverges at $s=\delta$~\cite{Sullivan1979}, so the series $\omega_n$, whose terms are of size $\asymp|\sigma'(z)|$, converge absolutely if and only if $\delta<1$ (compare~\cite[\S1.8.2]{BobenkoIntro2011}). Sufficient geometric conditions are Schottky's ``circle decomposability'' (which holds for instance for the Schottky uniformizations of real Riemann surfaces of decomposing type by Fuchsian groups of the second kind, see~\cite[Theorems 31, 32]{BobenkoIntro2011}) and the criteria of~\cite{Burnside1891,Schmies2011,Bogatyrev2012} quoted above; there are classical Schottky groups with $\delta>1$, for which the series diverge (see the references in~\cite[\S1.8.2]{BobenkoIntro2011}). For a given datum, $\delta$ can be computed (rigorously) with the methods of~\cite{McMullen1998,PollicottVytnova2022}. \end{remark} \subsection{A recursive definition of \texorpdfstring{$G$}{G}} \label{sec:recurs-defin-g} For each $\sigma \in G$, denote by $|\sigma|$ its length, namely the number of terms in its Tietze word representation. Recall that $\cW_k$ denotes the set of elements of length $k$. Given $\sigma\neq 1$, define $h(\sigma) = \sigma_j$ if $|\sigma_{-j}\sigma| < |\sigma|$ (the \emph{head} of $\sigma$, its first letter). As an extra piece of notation, write \[ \cW_k^{(i)} = \{ \sigma \in \cW_k ~|~ h(\sigma)=\sigma_i\} \] for the subset of elements in $G$ of length $k$ that start with the generator $\sigma_i$. \begin{lemma}\label{lem:tree} For all $k\geq 1$, \[ \cW_{k+1}^{(i)} = \coprod_{j\neq -i} \sigma_i \cW_k^{(j)}. \] \end{lemma} \begin{proof} Every $\sigma\in\cW_{k+1}^{(i)}$ is of the form $\sigma_i\tilde\sigma$ for a unique $\tilde\sigma\in \cW_k$, and since the Tietze word of $\sigma$ is reduced, $h(\tilde\sigma)\neq\sigma_{-i}$. Hence $\tilde\sigma\in\cW_k^{(j)}$ for some $j\neq -i$. Conversely, if $j\ne -i$ and $\tilde\sigma\in \cW_k^{(j)}$, then $\sigma_i\tilde\sigma$ is reduced and belongs to $\cW_{k+1}^{(i)}$. \end{proof} For a fixed $n\in\{1,\ldots,N\}$, let $\cR_n\subset G$ be the set of elements whose Tietze word does not end in $\pm n$ (together with the identity). It is a set of representatives of $G/H_n$, and we write $\cR_n^{(i)}=\cR_n\cap\cW^{(i)}$ for those that start with $\sigma_i$, with $\cW^{(i)}=\bigcup_k \cW_k^{(i)}$. The analogue of Lemma~\ref{lem:tree} is \begin{equation}\label{eq:cosetrec} \cR_n^{(i)} = \{\sigma_i : |i|\neq n\}\ \sqcup \coprod_{j\neq -i}\sigma_i\cR_n^{(j)}. \end{equation} Indeed, $\sigma_i\tilde\sigma$ with $\tilde\sigma\neq 1$ ends in $\pm n$ if and only if $\tilde\sigma$ does, while the word $\sigma_i$ itself ends in $\pm n$ if and only if $|i|=n$. \subsection{A recursive definition of \texorpdfstring{$\Omega_n$}{Omega\_n}} \label{sec:recurs-defin-omegan} Note that $\Omega_n(z)$ can be written as \[ \Omega_n(z)= \log \prod_{\sigma \in G / H_n} \frac{z - \sigma(B_n)}{z - \sigma(A_n)}. \] For $\sigma\in\cR_n$, the points $\sigma(A_n)$ and $\sigma(B_n)$ lie in $O(\sigma)$ (because $A_n,B_n\in\cD_{\pm n}$ and $\sigma$ does not end in $\pm n$). We deduce from (S) that \[ \sum_{\sigma\in\cR_n}\bigl|\sigma(B_n)-\sigma(A_n)\bigr|\ \leq\ \sum_{k\geq 0}\sum_{\sigma\in\cW_k}\diam O(\sigma)<\infty \] (the term $k=0$ being the single point $\sigma=1$), so the series defining $\Omega_n$ and $\omega_n$ converge absolutely and uniformly on compact subsets of $\Omega$; note that the points $\sigma(A_n),\sigma(B_n)$ are fixed points of loxodromic elements of $G$, hence lie in $\Lambda$. For $i\in I$, let \begin{equation}\label{eq:Fi} F_n^{(i)}(z) = \sum_{\sigma \in \cR_n^{(i)}} \log\frac{z - \sigma(B_n)}{z - \sigma(A_n)}, \end{equation} where each summand is the branch of the logarithm which vanishes at $z=\infty$ (it is a function without zeros or poles on the simply connected set $\Ch\setminus\cD_i$ which contains $\infty$, because both $\sigma(B_n)$ and $\sigma(A_n)$ lie in $\cD_i$). Thus \begin{equation}\label{eq:Omega-decomp} \Omega_n(z) = \log\frac{z-B_n}{z-A_n} + \sum_{i\in I}F_n^{(i)}(z),\qquad z\in\cF, \end{equation} up to the choice of the branch of the first logarithm. Each $F_n^{(i)}$ is holomorphic on $\Ch\setminus\cD_i$ and vanishes at $\infty$. Moreover, the singularities of~\eqref{eq:Fi} lie in the compact set $Z_i=\sigma_i\bigl(\bigcup_{j\neq-i}\overline{\cD_j}\bigr)$, which is contained in $\cD_i$, because $\overline{\cD_j}\cap\overline{\cD_{-i}}=\emptyset$ for $j\ne -i$. Hence \begin{equation}\label{eq:Ri} R_i = \min_{z\in Z_i}\,|t_i(z)|\ >\ 1, \end{equation} and $F_n^{(i)}$, expressed in the coordinate $t_i$, is given by a power series $\sum_{m\geq 1}c_m t_i^m$ converging on the disc $|t_i|1$. We now describe how the functions $F_n^{(i)}$ are related to each other. Let $\cH_i$ denote the space of functions holomorphic on a neighborhood of $\Ch\setminus\cD_i$ and vanishing at $\infty$. For $j\neq -i$ we have $\sigma_i^{-1}(\Ch\setminus\cD_i)=\overline{\cD_{-i}}\subset\Ch\setminus\overline{\cD_j}$, so that we may define \[ T_{ij}:\cH_j\to\cH_i,\qquad (T_{ij}f)(z) = f\bigl(\sigma_i^{-1}z\bigr)-f\bigl(\sigma_i^{-1}\infty\bigr). \] \begin{theorem}[Functional equation]\label{thm:functional-equation} For every $i\in I$, \[ F^{(i)}_n \;=\; E^{(i)}_n \;+\; \sum_{j\neq -i}T_{ij}F_n^{(j)}, \] where $E_n^{(i)}(z)=\log\frac{z-\sigma_i(B_n)}{z-\sigma_i(A_n)}$ if $|i|\neq n$, and $E_n^{(i)}=0$ if $|i|=n$. \end{theorem} \begin{proof} By~\eqref{eq:cosetrec}, $F_n^{(i)}$ is the sum of $E_n^{(i)}$ and of the sum over $j\neq -i$ and $\tilde\sigma\in\cR_n^{(j)}$ of $\log\frac{z-\sigma_i\tilde\sigma(B_n)}{z-\sigma_i\tilde\sigma(A_n)}$. If $\sigma_i=\smtx{a}{b}{c}{d}$, then for all $z,w$ one has $\sigma_i(z)-\sigma_i(w)=\frac{(ad-bc)(z-w)}{(cz+d)(cw+d)}$. Applying this with $z$ replaced by $u=\sigma_i^{-1}(z)$ gives \[ \frac{z-\sigma_i(w_1)}{z-\sigma_i(w_2)} = \frac{u-w_1}{u-w_2}\cdot\frac{cw_2+d}{cw_1+d}. \] Taking $w_1=\tilde\sigma(B_n)$ and $w_2=\tilde\sigma(A_n)$ we find that the $\tilde\sigma$-summand equals the corresponding summand of $F_n^{(j)}$ evaluated at $\sigma_i^{-1}z$, plus a constant. Since both sides vanish at $z=\infty$, the constant is minus the value of the first term at $z=\infty$, which is exactly the normalization in $T_{ij}$. Summing over $\tilde\sigma$ (the sums converge absolutely) gives the result. \end{proof} Write $\cH=\bigoplus_{i\in I}\cH_i$, $F_n=(F_n^{(i)})_i$, $E_n=(E_n^{(i)})_i$ and let $\cT:\cH\to\cH$ be the operator with components $T_{ij}$ ($j\neq -i$) and $0$ otherwise. Then $F_n=E_n+\cT F_n$. Unwinding using Lemma~\ref{lem:tree}, we see that \[ (\cT^kE_n)^{(i)}(z)=\sum_{\sigma\in\cR_n^{(i)},\ |\sigma|=k+1}\log\frac{z-\sigma(B_n)}{z-\sigma(A_n)}, \] that is, $\cT^kE_n$ is precisely the contribution of the level $k+1$ of the Cayley tree, and \begin{equation}\label{eq:neumann} F_n=\sum_{k\geq 0}\cT^kE_n=(1-\cT)^{-1}E_n, \end{equation} where the series converges and $1-\cT$ is invertible on a suitable space of functions (see the proof of Theorem~\ref{thm:convergence}). The point of this formula is that each level is not computed term by term: a level is a vector of $2N$ functions, and passing to the next level is one application of the fixed operator $\cT$. \section{Existing algorithms} \label{sec:existing-algorithms} In this section we review the existing algorithms to compute theta functions of Schottky groups. All of them evaluate the series in the form \[ \sum_{\sigma\in\cR_n} \bigl(\text{explicit term attached to }\sigma\bigr) \] over a finite subtree $\cS_0\subset\cR_n$ of the Cayley tree, and differ in the way $\cS_0$ is chosen and in the error estimate for the discarded part. Note that if we normalize so that the evaluation point $z$ is in $\cF$, the term attached to $\sigma$ is of size $\asymp |\sigma(B_n)-\sigma(A_n)|\leq\diam O(\sigma)$. \subsubsection*{Truncation by word length} The simplest method~\cite{FairchildRiosOrtiz2024} (see also~\cite{Schmies2011}) keeps all words of length at most $L$, a set of $1+\sum_{k=1}^L 2N(2N-1)^{k-1}$ elements. By hypothesis (S) the neglected part is $O(\theta^L)$, and explicit values of $\theta$ in terms of cross-ratios of the circles are given by Bogatyrev's lemma (Lemma~6.1 in~\cite{FairchildRiosOrtiz2024}, based on~\cite[Lemma 6.1]{Bogatyrev2012}). The cost is exponential in the precision: to achieve error $2^{-P}$ one needs $L\approx P\log 2/\log(1/\theta)$ and hence about $(2N-1)^{L}$ terms. \subsubsection*{Bogatyrev's and Burnside's estimates, and adaptive summation} Bogatyrev~\cite{Bogatyrev1999} observed that the rates at which the terms decay along different branches of the tree differ widely, and proposed to decide separately for each branch whether to stop: one descends from a vertex $\sigma$ as long as an estimate $K(\sigma)|\sigma(B_n)-\sigma(A_n)|$ for the total contribution of the descendants of $\sigma$ is larger than a tolerance $\nu$ (depth-first traversal, a posteriori error estimate). Schmies~\cite{Schmies2005,Schmies2011} uses the sharper Burnside-type estimates~\cite{Burnside1891}, valid under a criterion on the Schottky data, and orders the vertices by a weight, always expanding the vertex of largest weight (a priority queue), which yields an a priori error estimate. Both are described in detail in~\cite[\S2]{Lyamaev2022}. Lyamaev~\cite{Lyamaev2022,Lyamaev2022b} proves a new estimate for the sum over a subtree in terms of the term at its root, valid in situations where Burnside's estimate is not applicable, and uses it to reduce the number of terms needed ``by several times in the case of slow convergence and by tens of percent in the usual situations'' (for real hyperelliptic curves, in the setting of the \emph{Schottky model} used by Bogatyrev for extremal polynomials). Yamamoto and Miyoshi~\cite{YamamotoMiyoshi2026} apply the same philosophy to the infinite product defining the Schottky--Klein prime function: each group element is assigned a cross-ratio ``potential'' bounding its contribution, uniform bounds on how the potential changes when a generator is prepended allow an efficient enumeration of the elements above a threshold, and the relative error decays exponentially in the threshold at a rate governed by the Hausdorff dimension of the limit set. Burnside's method is also the one used to compute period matrices in the numerical Schottky uniformizations of~\cite{Hidalgo2001,HidalgoFigueroa2005}. These methods are very effective at moderate accuracy, for which they were designed. However, their cost grows exponentially with the number of digits, with an exponent which we now determine. Let $\delta\in(0,1)$ be as in Remark~\ref{rem:S-equiv} and let $m_\Lambda$ be the Patterson--Sullivan measure of $G$, a probability measure on $\Lambda$ which is conformal of dimension $\delta$~\cite{Sullivan1979}, so that $m_\Lambda(O(\sigma))\asymp\diam O(\sigma)^\delta$ by bounded distortion. A pruned summation stops at a \emph{cut} $\cS$ of the tree, that is, a set of vertices whose discs $O(\sigma)$ cover $\Lambda$ without overlaps; the part of the series below a vertex $\sigma$ is $\asymp\diam O(\sigma)$, so the discarded part, bounded by the sum of the absolute values of its terms, is $\asymp\sum_{\sigma\in\cS}\diam O(\sigma)$, while $\sum_{\sigma\in\cS}\diam O(\sigma)^\delta\asymp m_\Lambda(\Lambda)=1$. By H\"older's inequality, $\sum_{\cS}\diam O(\sigma)^\delta\leq|\cS|^{1-\delta}\bigl(\sum_{\cS}\diam O(\sigma)\bigr)^\delta$, so that a cut whose discarded part is at most $\varepsilon$ has at least a constant times $\varepsilon^{-\delta/(1-\delta)}$ elements, and this is attained, up to constants, by cutting at the level set $\diam O(\sigma)\approx\varepsilon^{1/(1-\delta)}$. Hence any method which sums the terms individually and bounds the discarded part by the sum of the absolute values of its terms needs about $2^{\delta P/(1-\delta)}$ terms to reach the accuracy $2^{-P}$: pruning improves the constant in the exponent, not the exponential growth, and the exponent $\delta/(1-\delta)$ tends to infinity as $\delta\to1$, that is, as the data approach the boundary of the range of convergence (compare the dimension-dependent rate in~\cite{YamamotoMiyoshi2026}). In our experiments (Section~\ref{sec:experiments}) the number of terms visited by a pruned depth-first summation grows like $\nu^{-0.38}$ and its error decays like $\nu^{0.62}$ in the tolerance $\nu$, consistent with $\delta\approx0.38$ for that datum: the number of terms is multiplied by about $10^{\delta/(1-\delta)}\approx4$ for each additional digit. \subsubsection*{Methods which avoid the series} For the Schottky--Klein prime function of a circular domain in the plane, Crowdy and Marshall~\cite{CrowdyMarshall2007} proposed an algorithm which does not use any sum or product over the group: the prime function (more precisely its square $X=\omega^2$) and some auxiliary functions are expanded in Fourier--Laurent series about the centres of the circles, and the coefficients are found by imposing the defining functional relations at collocation points on the circles and solving the resulting overdetermined linear system by least squares (building on a code of Trefethen). In their example, $15$ Laurent coefficients give $15$ correct digits, while the product truncated at level $9$ gives about $12$; no convergence proof is given (as noted in~\cite{CrowdyMarshallMcurves2011}). Their cost is polynomial in the number of circles. Write $N$ for the number of pairs of circles and $N_1$ for the truncation order. Step~1 of~\cite[\S4]{CrowdyMarshall2007} has $4NN_1+2N$ real unknowns and at least $2N(2N_1+1)$ real equations, the same matrix serving for the $N$ right-hand sides, and Step~2 has $2NN_1$ complex unknowns; a dense least-squares solution therefore costs $O(N^3N_1^3)$ operations, and each evaluation of the prime function afterwards costs $O(NN_1)$. (Adding a circle adds only $O(N_1)$ unknowns, as remarked in~\cite{CrowdyMarshall2007}.) This is the same exponent as ours, with $N_1$ playing the r\^ole of the number $p$ of Taylor coefficients. What is not known is how large $N_1$ has to be for $P$ bits: the Laurent coefficients should decay geometrically, so that $N_1=O(P)$ for a fixed domain, as in the observed $N_1=15$ for $15$ digits, but neither this nor the conditioning of the least-squares problems is proved, and the constants depend on the geometry. We implemented the method of~\cite{CrowdyMarshall2007} to measure it (Section~\ref{sec:collocation}): the observed cost is cubic in $N_1$ and in $N$, and about $0.7$ digit is gained per coefficient. We have not analysed the cost of the boundary value formulation of~\cite{CKGN2016}, whose implementation can use fast multipole acceleration. This was superseded by the boundary value formulation of Crowdy, Kropf, Green and Nasser~\cite{CKGN2016} (see also~\cite{Crowdy2020}), with a public \textsc{Matlab} implementation (\texttt{SKPrime}). These methods have the important advantage of not needing the convergence of the series, but they are specific to Schottky doubles of planar domains. Our algorithm is also based on expansions at the circles, but the linear system relating the coefficients is not obtained by collocation: it is derived \emph{exactly} from the group action (Theorem~\ref{thm:functional-equation}), applies to any classical Schottky group satisfying (S), and the truncation order and the number of iterations are the only sources of error, which we analyze in Theorem~\ref{thm:convergence}. \subsubsection*{Functional equations} The idea of replacing a Poincar\'e series by a system of functional equations for functions analytic in discs is not new. In the \emph{method of functional equations} of Mityushev and Rogosin~\cite{MityushevRogosin2000}, boundary value problems in circular multiply connected domains are reduced to systems of functional equations, in which the unknown functions are analytic in the discs and are related through compositions with the inversions in the boundary circles; these systems are solved by successive approximations, which amounts to summing Poincar\'e series level by level, and the method has been used to study the convergence of Poincar\'e series~\cite{Mityushev1998} and to compute them efficiently, also for nearly touching discs~\cite{MityushevRylko2013}. Our equation $F_n=E_n+\cT F_n$ is of the same nature. What we add, as far as we know, is its formulation for the Abelian integrals of an arbitrary classical Schottky group (not necessarily generated by inversions in the circles of a planar domain), an explicit discretization of the transfer operator by Taylor expansions computed with the recurrence of Lemma~\ref{lem:recurrence}, and a complexity analysis with a proof of geometric convergence of the discretized iteration (Theorem~\ref{thm:convergence}). We have not compared our implementation with theirs. \subsubsection*{Other approaches} Starting from an algebraic model of the curve one may compute periods by numerical integration, which is the standard route to Riemann matrices and the setting of the efficient evaluation of Riemann theta functions~\cite{DHBHS2004}; in our setting the algebraic model is exactly what is unknown. See also~\cite{FairchildRiosOrtiz2024} for the computation of an algebraic curve from a Schottky group, where the truncation of the Poincar\'e theta series limits the attainable precision, and which was one of the motivations of the present work. \medskip In Table~\ref{tab:comparison} we summarize the comparison. \begin{table}[t] \centering \small \renewcommand{\arraystretch}{1.25} \begin{tabularx}{\textwidth}{@{}>{\raggedright\arraybackslash}p{4.6cm}>{\raggedright\arraybackslash}X>{\raggedright\arraybackslash}p{3.3cm}@{}} \toprule Method & Cost for $P$ bits & Error control \\ \midrule Truncation by word length~\cite{FairchildRiosOrtiz2024} & $(2N-1)^{\Theta(P)}$ terms & a priori (Bogatyrev) \\ Pruned DFS / priority queue~\cite{Bogatyrev1999,Schmies2011,Lyamaev2022,YamamotoMiyoshi2026} & about $2^{\delta P/(1-\delta)}$ terms & a priori or a posteriori \\ Collocation~\cite{CrowdyMarshall2007} (prime function, planar domains) & $O(N^3N_1^3)$ operations (dense least squares), $N_1$ coefficients per circle, with $N_1=O(P)$ expected but not proved (Section~\ref{sec:collocation}) & a posteriori \\ Boundary value problems~\cite{CKGN2016} (prime function, planar domains) & not analysed here; fast in practice & a posteriori \\ \midrule \textbf{This article} & $O(N^3P^3)$ operations, constants depending on the datum & geometric rate, non-explicit constants (Thm.~\ref{thm:convergence}) \\ \bottomrule \end{tabularx} \caption{Comparison of the cost of the algorithms to compute $\Omega_n(z)$ with $2^{-P}$ accuracy.} \label{tab:comparison} \end{table} \section{The algorithm} \label{sec:algorithm} \subsection{Transfer matrices} For $j\neq -i$, let $\varphi_{ij}=t_j\circ\sigma_i^{-1}\circ t_i^{-1}$, a M\"obius transformation. It maps the closed unit disc into the open unit disc (because $\sigma_i^{-1}t_i^{-1}$ maps it onto $\overline{\cD_{-i}}$, which is disjoint from $\overline{\cD_j}$). In the coordinates $t_i$ and $t_j$, the operator $T_{ij}$ reads \[ T_{ij}\Bigl(\sum_{k\geq 1}f_kt^k\Bigr)=\sum_{k\geq 1}f_k\bigl(\varphi_{ij}(u)^k-\varphi_{ij}(0)^k\bigr). \] Let $M^{(ij)}\in\CC^{p\times p}$ be the matrix whose entry $M^{(ij)}_{km}$ is the coefficient of $u^m$ in $\varphi_{ij}(u)^k$, for $0\leq k,m0$, $p_0\geq1$ and $0<\kappa<1$, where $\kappa$ only depends on the Schottky datum, such that for all $p\ge p_0$ and all $K\geq0$ the output of Algorithm~\ref{alg:main} satisfies \[ \sup_{z\in\overline\cF}\Bigl|\Omega_n(z)-\Omega_n^{(p,K)}(z)\Bigr|\ \leq\ C\bigl(\lambda^K+\kappa^{p}\bigr) \] (modulo $2\pi i$), where $\Omega_n^{(p,K)}$ is the right hand side of~\eqref{eq:eval}. In particular, if $p,K\geq c\,P$ for a constant $c$ which only depends on the datum, the error is $O(2^{-P})$, and the number of arithmetic operations is $O(N^2p^2K)$ for each $n$, that is, $O(N^3P^3)$ for all $n$ together. \end{theorem} Here the operations are counted in exact arithmetic, and the constants depend on the datum (see Remark~\ref{rem:transfer}). We have not analysed the propagation of rounding errors, and we make no claim on the bit complexity. In the experiments of Section~\ref{sec:experiments} we work with $40$ to $64$ bits more than the target accuracy, and the results do not change when the precision is increased. For the matrices of Lemma~\ref{lem:recurrence}, we compared the recurrence with the computation by repeated multiplication of power series: for the data of Section~\ref{sec:experiments} and of Example~\ref{ex:fro}, with $p=120$ at $200$ bits, the relative difference is below $2\cdot10^{-62}$, that is, below the working precision. In all our examples $ac=0$ in Lemma~\ref{lem:recurrence}, so that the recurrence has only two terms; we have not tested the general three-term case. \begin{proof} \emph{Function spaces.} For $\rho\geq1$ and $i\in I$ let $U_i^\rho=\{z\in\Ch:|t_i(z)|<\rho\}$, the complement of the closed disc of centre $a_i$ and radius $r_i/\rho$; it is an open disc in $\Ch$ containing $\infty$, and $U_i^1=\Ch\setminus\overline{\cD_i}$. Let $Y_\rho$ be the Banach space of tuples $f=(f^{(i)})_{i\in I}$ of bounded holomorphic functions $f^{(i)}$ on $U_i^\rho$ vanishing at $\infty$, with the norm $\|f\|_\rho=\max_i\sup_{U_i^\rho}|f^{(i)}|$. We identify $f^{(i)}$ with its Taylor series in $t_i$, and denote by $\Pi_p$ the truncation of each component to degree $1$ and $R'\leq R$. By compactness we may choose $1<\rho<\rho'1$ have no real points~\cite{Shimura1975}, so this is only available for modular curves. The fast and precise evaluation of the curve attached to a Schottky datum makes it possible to solve this problem by Newton's method, as the following example shows. \begin{example}\label{ex:x023} The modular curve $X_0(23)$ has genus $2$ and the model \[ X_0(23)\colon\ y^2=(x^3-x+1)(x^3-8x^2+3x-7), \] of discriminant $2^{12}\cdot23^6$; we checked that its numbers of points over $\mathbb{F}_p$, $3\leq p<60$, $p\neq 23$, agree with the coefficients of the newform of level $23$, whose coefficient field is $\QQ(\sqrt5)$. Its Igusa--Clebsch invariants are $(I_2,I_4,I_6,I_{10})=(-1144,\,669124,\,-17115576,\,606355001344)$. The sextic has two real roots, so $X_0(23)(\RR)$ has one real oval. We use the real Schottky model of Bogatyrev for such curves~\cite{Bogatyrev2012} (see~\cite[\S1]{Lyamaev2022}): two discs $\cD_j$ of centre $c_j>0$ and radius $r_j$ on the positive real half-line, $\cD_{-j}=-\cD_j$, and the generators \[ \sigma_j(u)=c_j+\frac{r_j^2}{u+c_j}\qquad(j=1,2), \] which map $\Ch\setminus\cD_{-j}$ onto $\overline{\cD_j}$. These groups preserve the real line, so the series converge by Schottky's criterion (see~\cite[Theorem~31]{BobenkoIntro2011}). Then $u\mapsto-u$ induces the hyperelliptic involution, and the Weierstrass points are $0$, $\infty$ and $c_j\pm ir_j$. As in Example~\ref{ex:fro}, the values of $\varphi=\omega_2/\omega_1$ at these six points give a model $y^2=\prod_k(x-\varphi_k)$ of the curve, and hence its absolute invariants $(I_4/I_2^2,\ I_2I_4/I_6,\ I_{10}/I_2^5)$ as functions of the three real parameters $(r_1,c_2,r_2)$, where we normalize $c_1=1$. We solved the three equations expressing that these invariants equal those of $X_0(23)$. A coarse search and a Nelder--Mead minimization at $p=14$ give a starting point, which we refined by Newton's method (with the Jacobian computed once, by finite differences, at $p=60$), successively with $p=60$, $120$ and $200$; the whole computation takes about $50$ minutes on one core. The discs nearly touch (the gap between $\cD_1$ and $\cD_2$ is about $0.042$), and the convergence is about $0.24$ digits per Taylor coefficient. We obtain \begin{align*} r_1&=0.1666951580327760609280827065351772813460\ldots,\\ c_2&=1.2882213331143925842580331840891030391867\ldots,\\ r_2&=0.0791274636493090013132263963050174632062\ldots, \end{align*} with an error of at most about $10^{-40}$ (the final residual is $4\cdot10^{-44}$ and the inverse Jacobian has norm about $150$; the solution at $p=120$ agrees to $4\cdot10^{-30}$). The fixed points and multipliers of the generators are \begin{align*} B_1=-A_1&=1.01379843939097291614505198297\ldots, & \mu_1&=-0.00685194661047901954277103106\ldots,\\ B_2=-A_2&=1.29064920043929657297740608307\ldots, & \mu_2&=-0.000941445990915403693931876068\ldots \end{align*} (the multipliers are negative because the $\sigma_j$ reverse the orientation of the real line). As an independent check, we computed the Riemann matrix of this Schottky group with Algorithm~\ref{alg:periods}, which was not used in the fit: \begin{align*} \tau_{11}&=-\tfrac12+0.81287551976127870033\ldots\,i, & \tau_{12}=\tau_{21}&=0.68070897251165259288\ldots\,i,\\ \tau_{22}&=-\tfrac12+1.2292513977736790783\ldots\,i \end{align*} (with $p=120$; the entries are defined modulo $1$, and we chose them to make $\tau$ symmetric). An integer relation search (\texttt{integer\_matrix\_relations} in Sage, at $90$ bits) between $\tau$ and the Riemann matrix of the model above, computed by numerical integration with Sage's \texttt{RiemannSurface} (see~\cite{BSZ2018}), finds a $\ZZ$-module of relations of rank $2$, which contains a symplectic matrix of determinant $1$. So the two matrices are equivalent under $\mathrm{Sp}_4(\ZZ)$, and the rank $2$ reflects the real multiplication of $J_0(23)$ by $\ZZ[\frac{1+\sqrt5}{2}]$. Here the equation of $X_0(23)$ was an input, and fitting the parameters of a Schottky group to a given curve is a classical approach to numerical uniformization~\cite{Hidalgo2001,HidalgoFigueroa2005,Seppala2004}; what is new is the precision. Obtaining the Schottky group of a modular curve from the modular side alone is possible in principle: the covering map $\mathfrak H\to\Omega$ is a quotient of solutions of a differential equation $y''+\frac12 qy=0$, where $q$ is a $\Gamma_0(N)$-invariant quadratic differential whose $3g-3$ coefficients are fixed by requiring trivial monodromy along the chosen $a$-cycles. With such a computation, Algorithm~\ref{alg:main} would then produce the canonical model of the curve without using any equation. We leave this for future work. \end{example} \subsubsection*{Conformal mapping and potential theory in multiply connected domains} The Schottky--Klein prime function is the basic ingredient of the explicit formulas for conformal maps from multiply connected circular domains, Green's functions and harmonic measures, and of the solutions of boundary value problems arising in fluid mechanics and elsewhere~\cite{CrowdyMarshall2007,CKGN2016,Crowdy2020}. As Section~\ref{sec:prime} shows, the algorithm applies to this setting whenever the product converges (for instance for all Schottky groups of Fuchsian type, see~\cite{CrowdyMarshallMcurves2011}), giving the prime function to $30$ digits in about $4$ seconds with the first implementation (Section~\ref{sec:experiments}). It is also natural to use it to uniformize real hyperelliptic $M$-curves as in~\cite{CrowdyMarshallMcurves2011}. \subsubsection*{Other applications} Schottky models of real hyperelliptic curves are used for Chebyshev polynomials for several intervals and multiband filters~\cite{Bogatyrev1999,Bogatyrev2012,BGL2017}, the capacity of condensers~\cite{Bezrodnykh2019}, the filtration under a stepped dam~\cite{BogatyrevGrigorev2020} and planar magnetic nanoelements~\cite{Bogatyrev2017}; Schottky uniformization also appears in finite-gap integration~\cite{Bobenko1988,BBEIM1994,LiuYouYuan2026}, in dimer models~\cite{BBS2024,BB2024}, and in the construction of higher-genus polylogarithms~\cite{BBILZ2024,BergerBroedel2026}, whose integration kernels are Poincar\'e series. These computations often involve large genus or slow convergence, where term-by-term summation is most expensive, but where the rates $\kappa,\lambda$ of Theorem~\ref{thm:convergence} also deteriorate (Figure~\ref{fig:geometry}); the break-even point should be determined on specific examples. We expect the method to extend to other Poincar\'e series (of higher weight, or twisted by characters), with $\cT$ replaced by a weighted composition operator. \subsubsection*{The $p$-adic origin of the algorithm} This work originated in the $p$-adic setting, where the analogue of $\Omega_n$ is the theta function of a Mumford curve, an infinite product over the Schottky group~\cite{GvdP,FvdP}. Masdeu and Xarles~\cite{masdeu-xarles} gave an iterative algorithm, polynomial in the precision, which computes these theta functions as locally analytic functions without enumerating group elements (see also~\cite{MR,negrini-masters} for earlier algorithms, \cite{guitart-masdeu-xarles,darmon-vonk} for applications to $p$-adic singular moduli, and~\cite{KMMvdP2026} for $p$-adic Abelian integrals and heights). The algorithm of this article is its archimedean counterpart: the structure which makes both work is the same, namely that the subtree below a vertex depends only on its last letter, and that the sum over it is an analytic function on the complement of a disc. What is specific to the archimedean case is that convergence rests on hypothesis~(S), and that the functions are logarithms of products, which require the normalization at $\infty$. \subsubsection*{Limitations and further work} We assume (S), that is, the absolute convergence of the series, as all the algorithms which sum them; the methods of~\cite{CrowdyMarshall2007,CKGN2016} do not need it, but only apply to the prime function of planar domains. It would be interesting to know whether the equation $(1-\cT)F=E$, which makes sense without (S), can be used beyond the range of convergence. We have not compared with the methods of Mityushev and coauthors~\cite{MityushevRogosin2000,MityushevRylko2013} or with \texttt{SKPrime}~\cite{CKGN2016}. The constants in Theorem~\ref{thm:convergence} are not explicit, and we have not analysed rounding errors: it would be desirable to have explicit and rigorous a priori bounds for $p$ and $K$, as are available in the algorithms of Schmies and Lyamaev, using the methods of~\cite{BandtlowJenkinson2008} and interval arithmetic for the matrix recurrence (we noted that a naive use of ball arithmetic produces enclosures which are too wide for the larger examples). The algorithm treats the discs as given: finding Schottky data for a given curve (``numerical uniformization'', see e.g.~\cite{Seppala2004}) is a separate problem, which is not addressed here. \printbibliography \end{document}