Indefinite theta functions and black hole partition functions

We explore various aspects of supersymmetric black hole partition functions in four-dimensional toroidally compactified heterotic string theory. These functions suffer from divergences owing to the hyperbolic nature of the charge lattice in this theory, which prevents them from having well-defined modular transformation properties. In order to rectify this, we regularize these functions by converting the divergent series into indefinite theta functions, thereby obtaining fully regulated single-centered black hole partitions functions.


Introduction and motivation
In string theory compactifications, certain classes of microscopic states in the Hilbert space of bound systems of solitons and strings can be described by black hole solutions at strong t'Hooft coupling. In this context, exact counting functions have been developed that provide a statistical mechanical count of BPS states [1,2,3,4,5,6,7]. For a class of string theory compactifications such as type II on Calabi-Yau threefolds CY 3 , a topological twist creates a topological theory that captures the BPS aspects of the parent type II theory. In order to be able to write down the complete non-perturbative partition function of this theory, black holes must feed into the non-perturbative sectors of this theory and hence, writing down a well-defined black hole partition function becomes a significant step in this endeavour.
In this paper we explore aspects of single-center black hole partition functions. We do this in four-dimensional N = 4 compactifications, since exact microstate counting formulae exist in these theories from which one can extract black hole degeneracies. In particular, we look at four-dimensional toroidally compactified heterotic string theory [1,3].
The first step in this program is to choose an ensemble to write down the single-center black hole partition function which can be used to extract the macroscopic black hole free energy. We consider the mixed statistical ensemble first introduced by OSV in [8]. It can be motivated by looking at partition functions in the near-horizon AdS 3 geometry of certain types of supersymmetric black holes. These black hole partition functions were explored by [9,10], where they were computed using formal Poisson resummation techniques. However, these partition functions are divergent due to the indefinite nature of the charge lattice in the theory. After an examination of the role played by the terms that contribute to the divergence in counting single-centered black holes, we propose a regularization of the divergent series by converting the sums into indefinite theta functions following a prescription by Zwegers [11], thereby obtaining fully regulated black hole partitions functions with well defined modular transformation properties. As a guiding principle we demand that the leading contribution to the free energy of this partition function equals the macroscopic black hole free energy.
We now summarize some of the salient features of the dyonic degeneracy formula and set up relevant notation for the discussions that follow in this paper.

Notation and background material
Upon compactification of the type II string on K3 × T 2 physical charges are valued in the lattice Γ 6,22 ≃ H 2 (K3; Z) ⊕ 3 Γ 1,1 . Here Γ 1,1 is the hyperbolic lattice with bilinear form while the intersection form of the homology lattice of K3 decomposes into Γ 3,19 = ⊕2 Γ (−E 8 ) ⊕ 3 Γ 1,1 . The two vectors Q and P encoding the quantum numbers transform as a doublet under the S-duality group. The S-duality group is identified with the electric-magnetic duality in the heterotic frame and hence, these vectors can be labelled as electric and magnetic even if the individual charges are described in type II language. In this paper we will freely switch between the heterotic and type II dual frames, confident that no confusion should arise.
The T-duality invariant charge bilinears of the theory are the norm squares of the electric and magnetic vectors, and their scalar product, explicitely −Q = Q · Q, −P = P · P and R = Q · P . The degeneracies of a class of micro-states 1 are expressed in terms of data associated with an auxiliary genus two Riemann surface. They are encoded in the expansion of the Siegel modular form 1 Φ 10 (σ, ρ, v) = Q,P ∈ 2Z, R ∈ Z d(Q, P, R) e −πi(Q σ+P ρ+R (2 v−1)) , (1.2) where the chemical potentials for the T-duality invariant bilinears parametrize the period matrix of said genus two Riemann surface The degeneracies d(Q, P, R) are non-vanishing for Q ≤ 2, P ≤ 2. For single-centered BPS black holes Q and P are negative while QP − R 2 ≫ 1, and hence convergence of the Q and P sums in (1.2) requires that Im ρ = M 1 ≫ 1 and Im σ = M 2 ≫ 1. Invariance of (1.2) under the large diffeomorphisms of the genus two Riemann surface given by ensures that we can always set the real parts of the chemical potentials to 0 ≤ Re σ < 1 , 0 ≤ Re ρ < 1 , 0 ≤ Re v < 1 . Therefore equation (1.2) can be rewritten by trading the sum over T-duality invariants with a sum over individual charges. The advantage of this rewriting is that it gives a direct path for comparing microscopic Hilbert space degeneracies to a macroscopic partition function over black hole backgrounds. The gravitational picture for these dyonic configurations includes extremal single-centered black holes which, at a specific point in their moduli space, have a near-horizon geometry described by a BTZ black hole in AdS 3 [13]. Approaching the horizon of the BTZ black hole yields an S 1 fibration over AdS 2 . The dual conformal field theory [14] has a central charge defined by the charge p 3 which sets the scale for the AdS 3 space; all states in this CFT are labeled as excitations above the vacuum by the quantum number q 0 and the angular momentum q 1 of the BTZ black hole. This provides a macroscopic partition function which counts single-centered black hole attractor geometries in a statistical ensemble where the p I are held fixed and the q I are summed over 2 . In a general charge configuration, the fixed p I define the AdS 3 spacetime, while the q I determine the BTZ excitations. Physically, this mixed ensemble captures all states in the near-horizon geometry of the black hole and should, in principle, capture the holographic entropy of the black hole, which is localized at the horizon.
This mixed statistical ensemble was first introduced in [8] in the context of N = 2 Calabi-Yau compactifications of type II string theory. Hence, we are motivated to write down a black hole partition function in the mixed ensemble as Z OSV (p I , φ I ) = q I ∈Λe d(q I , p I ) e π q I φ I , (1.8) where Λ e denotes the lattice of electric charges in the large volume polarization, the variables φ I play the role of chemical potentials to be held fixed, and d(q I , p I ) denotes the absolute number (or a suitable index of) micro-states with electric/magnetic charges (q I , p I ). Observe that (1.8) is invariant under the shifts This formal invariance is a consequence of the fact that the charges are quantized and integer valued.
In this paper we propose that the appropriate definition of the sum over the electric charges q a is in terms of indefinite theta functions. This will then also ensure the invariance under the shifts φ a → φ a + 2i. Definitions and properties of indefinite theta functions are briefly summarized in Appendix C.

Models of interest
In order to be able to use indefinite theta functions to define the sums over electric charges, these have to belong to sub-lattices defined in terms of quadratic forms of signature (r − 1, 1), respectively. This is the case in string models with N = 2 spacetime supersymmetry. However, models for which exact microstate degeneracies of dyonic black holes are known are models with N = 4 (or even N = 8) supersymmetry.
In order to be able to apply the indefinite theta function regularization to N = 4 models we will focus on a subset of N = 4 charges, which we denote by (q I , p I ) (with I = 0, 1, . . . , n), and we will consider an effective N = 2 description of these models based on prepotentials of the form where n denotes the number of N = 2 vector multiplets coupled to N = 2 supergravity and the symmetric matrix C ab appearing in (1.10) has signature (1, n − 2), as required by the consistent coupling of vector multiplets to N = 2 supergravity [15,16]. In this N = 2 description, we take the associated charge bilinears and C ab to satisfy the same conditions as they do in N = 4. We can think of these models as appropriate sub-sectors of the N = 4 models where the charges associated with the extra indefinite directions have been set to zero such that the rank of the intersection form C ab and the gauge group is n − 1. In this paper we focus on toroidally compactified heterotic string theory 3 . Accordingly, we consider integer valued charges (q I , p I ) and integer valued matrices C ab and C ab , so that q a C ab q b ∈ 2Z, The T-duality subgroup of the N = 4 duality group that operates on the charges (q I , p I ) is SO(2, n − 1). The T-duality invariant charge bilinears are (1.11) The heterotic moduli fields are denoted by S = −iY 1 /Y 0 (the heterotic dilaton-axion field) and T a = −iY a /Y 0 . The effective N = 2 description also involves, in addition to F (0) , the S-duality invariant coupling function F (1) (S,S). As mentioned above we restrict ourselves to single-centered black hole states. These satisfy the following conditions, (1.12) The black hole attractor mechanism relates the near horizon values of the moduli fields S and T a to the charges as [17] 2 (1.14) This implies ̺ a C ab ̺ b > 0. Finally another ingredient we will need are indefinite theta functions. Aspects of the theory are reviewed in Appendix C. As in the case of ordinary theta functions, indefinite theta functions depend on a quadratic form Q : R r −→ R and its associated bilinear form B : R r × R r −→ R r . However in this case the quadratic form Q has signature (r − 1, 1). To retain convergence and modularity, one weights the sum with additional factors ρ as ϑ(z; τ ) = n∈Z r ρ(n + a; τ ) e 2πi τ Q(n)+2πi B(n,z) , (1.15) where τ ∈ H takes values in the complex upper half plane H, and z ∈ C r , with a, b ∈ R r defined by z = a τ + b. The factor ρ is the difference of two functions ρ c , ρ = ρ c 1 − ρ c 2 . The ρ c i depend on real vectors c i ∈ R r that satisfy Q(c i ) ≤ 0 and are given by [11] ρ c (n; τ ) = where E and sgn denote the error and sign function, respectively. In the main text we will take Q(c i ) < 0 for both c 1 and c 2 . The paper is organized as follows. We focus on the OSV ensemble and sum over the charges q 0 and q 1 without imposing any restrictions, following [10]. We compare the leading contribution to this sum with the macroscopic 1/4 BPS single-center black hole free energy. We then turn to the sum over the charges q a and specialize to the case p 0 = 0 in order to avoid a technical difficulty that arises when p 0 = 0. We regularize the sum over q a by converting it into an indefinite theta function.
2 Evaluation of Z OSV (p, φ) In the following we consider the evaluation of the mixed partition function (1.8) in toroidally compactified heterotic string theory, using an effective N = 2 description of this model based on (1.10).

Summing over
We first sum over the charges q 0 and q 1 following [9,10]. We convert the sum over (q 0 , q 1 ) into a sum over (Q, P ) using where, for the time being 4 , we assume that both p 0 and p 1 are non-vanishing, i.e. |p 0 | ≥ 1 , |p 1 | ≥ 1. In doing so, we need to ensure that when performing the sums over Q and P , we only keep those contributions that lead to integer-valued charges of q 0 and q 1 . These restrictions can be implemented by inserting the series L −1 L−1 l=0 exp[2πi l K/L], where K and L are integers (with L positive), which projects onto all integer values for K/L. The use of this formula leads to the following expression with R given by and [10] L(R,φ 0 ,φ 1 , φ a ) = Q,P d(Q, P, R) The range of the sums over l 0,1 enforces the condition that only those summands, for which (Q + q a C ab q b )/2p 1 and (P + p a C ab p b )/2p 0 are integers, give a non-vanishing contribution to (2.2). Now we introduce an additional sum over a dummy variable R ′ so as to be able to use the representation (1.2). To this end, we use a complex variable θ = θ 1 + iθ 2 , and write which holds for integer valued R, R ′ . Here, θ 2 is held fixed. Then we introduce (2.7) Next, using (1.2) and interchanging summations and integrations, we obtain [10] q 0 ,q 1 We note that identifying the d(q, p) on the lhs of (2.8) with the microcanonical dyonic degeneracy generated by the Siegel modular form 1 Φ 10 , automatically fixes the arguments (σ(θ), ρ(θ), θ) of the Siegel modular form to be the period matrix of a genus two Riemann surface, i.e. they have to take values in the Siegel upper half-plane Im ρ , Im σ > 0 , Im ρ Im σ > (Im θ) 2 . (2.9) Applying these restrictions to (2.7) imposes the constraints, Next, observe that (2.8) is invariant under the shifts [9,10] with n, m ∈ Z. Namely, under these shifts, σ(θ) and ρ(θ) transform as and since q a C ab q b ∈ 2 Z , p a C ab p b ∈ 2 Z, the exponent in the integrand of (2.8) is invariant under the shifts (2.11). Using Φ 10 (σ−n, ρ, v) = Φ 10 (σ, ρ, v) and Φ 10 (σ, ρ+m, v) = Φ 10 (σ, ρ, v), it follows that (2.8) is invariant under the shifts (2.11). This invariance, together with the sum over l 0 , l 1 -shifts, ensures that (2.8) is invariant under φ 0 → φ 0 + 2i , φ 1 → φ 1 + 2i. Φ 10 has various zeros [1]. The location of these zeros is parametrized in terms of five integers m 1 , n 1 , m 2 , n 2 ∈ Z, j ∈ 2Z + 1, which are subject to the condition The zeros are at 14) The zeros with n 2 encode the jumps in the degeneracies across walls of marginal stability corresponding to two centered small black holes which appear (or disappear) in the stable spectrum [18,19]. The zeros with n 2 ≥ 1 capture the entropy of single-center black holes [1]. The leading contribution to the entropy stems from the zeroes with n 2 = 1. Among them is the zero D with non-vanishing integers n 2 = j = 1, i.e. D = ρσ − v 2 + v = 0. In the following we focus on the zeros with n 2 = 1. These zeros can be generated from the zero D, which is described by (m 1 , n 1 , m 2 , n 2 , j) = (0, 0, 0, 1, 1), as follows. First, observe that Φ 10 (σ, ρ, v) is invariant under the discrete translations in v: Φ 10 (σ, ρ, v +p) = Φ 10 (σ, ρ, v) with p ∈ Z. Then, applying the shift transformation v → v + p as well as (2.12) to D results in zeros D (n,m,p) specified by the integers (n, m, −mn − p 2 + p, 1, 1 − 2p). In particular, D (0,0,0) = D. This provides a parametrization of the zeros with (m 1 , n 1 , m 2 , 1, j) satisfying (2.13). The same holds for the zeroes of Φ 10 (σ(θ), ρ(θ), θ), provided we make the compensating transformation φ 0 → φ 0 − 2ip p 0 , φ 1 → φ 1 + 2ip p 1 when performing the shift θ → θ + p. These compensating transformations constitute an invariance of (2.8), as discussed above. We may thus proceed as follows. The integral (2.8) will be evaluated in terms of the residues associated with the zeros of Φ 10 . Here we restrict ourselves to the zeros with n 2 = 1 which, as we just discussed, can be parametrized in terms of integers n, m, p. The contribution of these zeros can be accounted for by retaining the contribution of the zero D and extending the sum over l 0,1 to run over all positive and negative integers (i.e. l 0,1 ∈ Z) as well as extending the range of integration to −∞ < θ 1 < ∞. Hence, the poles of 1 Φ 10 corresponding to n 2 = 1 are characterized in terms of three numbers m, n and p, and by swapping the infinite ranges of m and n for the infinite ranges of l 0 and l 1 , respectively, and swapping p for the infinite range of θ 1 , we have fully expressed the entire subgroup of symmetries under which the poles corresponding to n 2 = 1 form a closed group, in terms of sums over two discrete variables and an integration over one continuous real variable.
We now proceed with the evaluation of (2.8), focussing on the contribution of the zero D = 0.

Free energy computation
To compute the contribution from the zero D = 0, we follow the prescription given in [19], as follows. In the complex θ-plane, the contour of integration in (2.8) is taken to be −∞ < θ 1 < ∞ (as we just discussed) with fixed θ 2 , either θ 2 > 0 or θ 2 < 0. The θ-dependent part of the exponential in (2.8) can be written as with ̺ a given in (1.14). We consider single-center black holes so that ̺ a C ab ̺ b > 0. The choice of the sign of θ 2 then depends on the sign of p 0 p 1 . Namely, when p 0 p 1 < 0, we take θ 2 > 0. We can then deform the contour to θ 2 → −∞, where the integrand becomes vanishing. In doing so, we pick up the contribution from the zero D = 0, which will be specified below.
Here, the zero is encircled in a clockwise direction. When p 0 p 1 > 0, we take θ 2 < 0. The contour can then be moved to θ 2 → ∞, where the integrand is again zero. In doing so, we pick up the contribution from the zero D = 0, but this time it is encircled in a counter clockwise direction. Thus, we obtain a non-vanishing contribution provided we choose the integration contour to satisfy p 0 p 1 θ 2 < 0. Then, the integral yields where Res denotes the residue which we now compute. Inserting (2.7) into the expression for D = v + ρσ − v 2 = 0, we find that the zero is located at the value (recall that now l 0,1 ∈ Z) which is complex, and hence away from the real θ 1 axis. In the vicinity of θ * , D takes the form For later convenience, we also introduce the notation Then, using (2.16), we obtain for (2.8) (we drop an overall numerical constant) we obtain Now, following [10], we generalize the definitions of S and Y 0 given in (A.8) and (A.9) and introduce the shifted fields Observe that in the presence of the l 0 , l 1 -shifts,S andȲ 0 are not any longer the complex conjugate of S and of Y 0 , respectively. Using (2.26), we obtain as well as (2.28) Inserting these expressions into (2.24), we get (dropping again a numerical constant) where in this expression the derivatives are with respect to S and toS, respectively. Next, let us relate (2.29) to the free energy of a macroscopic black hole. To this end, we first note that the mixed ensemble (1.8) involves summing (2.29) over q a . The macroscopic free energy, which corresponds to a critical point of the free energy functional, is obtained by extremizing the exponent in (2.29) with respect to q a . Performing this extremization we find . Then, inserting (2.31) into the exponent of (2.29) gives When l 0 = l 1 = 0, the value q B a can be thought of as a background charge that defines an attractor background geometry in view of the fact that (2.31) is simply the attractor equation for the real part of the scalar moduli fields Y a , cf. (A.11). Then, (2.32) equals the macroscopic free energy of this background charge black hole [10] (2.33) and the sum over the q a can be interpreted as a sum over fluctuations about this attractor background. In these expressions, Y 0 ,Ȳ 0 , S andS are defined with shifts φ 0 and φ 1 , as in (2.26). When l 0 = l 1 = 0, S and Y 0 become related to the attractor values for a singlecentered black hole. Indeed, using (2.32), we can rewrite (2.29) as where V a describes a fluctuation about the background charge (2.31). This follows by writing V a as where we used (2.31). One can see that the fluctuations can be space-like, time-like or null due to the hyperbolic structure of the charge-lattice metric C ab . In fact, if one thinks of the exponent as a free energy functional used to define the action for a partition function in a discrete hyperbolic lattice, then it is easy to see that there are no extrema of the action, but only critical points corresponding to single-centered black holes, since at any given point on this hyperbolic lattice there is always a space-like and a time-like direction.
For the purpose of single-centered black hole entropy, we will only be interested in fluctuations in the l 0 = l 1 = 0 sector. The appearance of the other sectors in the mixed partition function function can be explained by analyzing the microcanonical degeneracy given in Here the contours are chosen such that the imaginary parts of the three arguments are fixed at certain values determined in terms of the charge invariants [19], and the real parts are chosen to run from 0 to 1. The integrand has second order poles corresponding to D (n,m,p) . In order to evaluate the residues at these poles, one can use the invariance of the integrand under imaginary translations in σ, ρ and v to map D (n,m,p) to D (0,0,0) while extending the range of the real parts of σ, ρ and v to the real line. In the case of Φ 10 (σ(θ), ρ(θ), θ), D (n,m,p) are mapped to D (n,m,0) . This involves an extension of the range of the real part of θ and a simultaneous translation in φ 0 and φ 1 in order to preserve the ranges of σ(θ) and ρ(θ), cf.
(2.7). Here, the values of (l 0 , l 1 ) mod (p 1 , p 0 ) correspond to the increase in the ranges of the real parts of σ and ρ in Φ 10 (σ, ρ, v). The integral over v is done by expressing the leading divisor as a function of v and then evaluating the residue. The remaining two integrals are then performed by saddle point integration. The contour that passes through the saddle point is chosen in such a way that the two variables become conjugate to each other along the contour and that at the saddle point they correspond to the heterotic axion-dilaton pair and its conjugate [20]. Another way of expressing this is to say that the axion and dilaton scalars become real on this specific contour. The triple integral (2.37) also helps in defining background charges q 0 and q 1 , as follows. The imaginary parts of the integration variables, for the single-centered degeneracy, are expressed in terms of T-duality invariants as [19] Im σ = −2Λ P |Q ∧ P | , Using the definitions of the period matrix variables (2.7) in terms of φ 0 and φ 1 , and the definition of q 0 and q 1 in terms of Q and P (cf. (2.1)), respectively, we get an expression relating the background values of q 0 and q 1 to φ 0 , φ 1 and the other background charges, determined up to a positive constant Λ.

Attractor geometry constraints on q a summation
Summarizing, by summing over (q 0 , q 1 ), the number of integrations in (2.37) gets reduced from three to one, and the remaining integral over θ can be evaluated via residues. This is achieved by introducing an infinite sum over integers l 0,1 ∈ Z, which makes the shift symmetry φ 0,1 → φ 0,1 + 2i manifest. In the above we assumed that p 0 p 1 = 0. The result (2.29) remains valid when setting either p 0 = 0 or p 1 = 0. This can be checked (and we will do so in the next subsection) by redoing the above calculations using instead (Q, R) and (P, R) as summation variables, following [9]. Eq. (2.29) captures part of the OSV partition function for single-center black holes, namely the part associated with n 2 = 1. This yields the leading contribution to the partition function. Next, we would like to sum over charges q a . Here one faces the problem that one has to restrict to states with sgn(̺ a C ab ̺ b ) > 0,. Implementing this condition in a sum over charges q a is somewhat unwieldy. Note that this constraint becomes trivial in the rigid limit. Namely, when decoupling gravity, we recover a low-energy gauge theory based on a prepotential F (0) with a definite metric C ab , and the associated sum over the electric charges is unrestricted. To proceed, we note that a simplification occurs when setting p 0 = 0, since in this case ̺ a C ab ̺ b = −(p 1 ) 2 P and sgn(̺ a C ab ̺ b ) = sgn(−P ), which only depends on magnetic charges. Further, to make contact with a gravity partition function over single-centered black holes, one notes that black holes with p 0 = 0 have a near horizon geometry that, at an appropriate point of the moduli space, can be seen as a BTZ excitation of AdS 3 [13]. The OSV ensemble naturally sums over the q I charges and keeps the p I charges fixed. The fixed charges precisely define the AdS 3 background while the summed charges define excitations in this background. For these reasons, we will restrict ourselves to a summation over states with p 0 = 0 in the remainder of this paper.
2.4 Case p 0 = 0: summing over q a We will now compute the OSV mixed partition function (1.8) for the case when p 0 = 0.
First, we redo the steps leading to (2.29) for the case p 0 = 0. Using we convert the sum over (q 0 , q 1 ) into a sum over (Q, R) and obtain [9] q 0 ,q 1 where now P is independent from Q and R. We set where we recall from (2.26), Once again, observe thatȲ 0 andS are not the complex conjugates of Y 0 and S when l 0,1 are non-vanishing. Next, we use the definition where ρ = ρ 1 + iρ 2 , and ρ 2 is fixed. We obtain [9] q 0 ,q 1 We consider single-center black hole solutions, so that P < 0. As before, identifying d(q, p) with the microcanonical dyonic degeneracy generated by 1 Φ 10 fixes the arguments (σ * , ρ, v * ) to satisfy the Siegel upper-half plane conditions (2.45) Next, we proceed as in the previous subsection. Using the characterization of the zeroes of Φ 10 corresponding to n 2 = 1 in terms of integers n, m, p we extend the sum over l 0,1 to run over all the integers, and we extend the range of integration to −∞ < ρ 1 < ∞. Using as well as Φ 10 ≈ D 2 ∆, we obtain the analogue of (2.30), where we used p 1 = Y 0 (S +S). Eventually, we obtain for the unregularized OSV partition function (up to an overall numerical constant), where where a = Im z/Im τ and b = Im (z τ )/Im τ . Here Q m (p) and Q e (q) are indefinite quadratic forms, and B e (z, q) is the bilinear form associated to Q e (q). Using τ e = σ * we obtain that τ e takes values in the complex upper half plane by virtue of the Siegel upper half plane conditions (2.45). Note that (2.47) agrees with (2.29) when setting p 0 = 0.
For generic values of l 0 and l 1 both a a and b a are non-vanishing in the decomposition (2.48). On the other hand, when l 0 = l 1 = 0, (S +S) and i(S −S) are both real, and hence b a = 0. We will return to this issue in the next subsection when regularizing the sum (2.47).
The matrix A ab has signature (n − 2, 1), and hence the quadratic form Q e (q) is indefinite, rendering the sum (2.47) over q a divergent, as discussed previously. We propose to regulate the divergence by turning the sum over the q a in (2.47) into an indefinite theta function ϑ(z; τ e ) following [11].

Regularizing Z OSV (p, φ)
Recall that in our particular model, A ab is integer valued and indefinite, and τ e takes values on the upper half complex plane by (2.45). This is precisely the setting where indefinite theta functions can be defined. We will now modify the definition of the OSV sum in order to obtain an indefinite theta function, and discuss the consequences of this procedure. A physically motivated discussion of the regulatory procedure is given in Appendix B via a toy model. The main properties of indefinite theta functions are summarized in the Appendix C. An indefinite theta function (1.15) differs from an ordinary theta function by the presence of an extra factor ρ which deals with the indefinite directions, preserving modular properties. This factor ρ explicitly depends on two vectors c 1 and c 2 . Depending on the specific form of ρ these two vectors are used to project out the lattice points giving an exponentially growing contribution, or to weight them with a positive definite quadratic form.
Thus, by introducing the weight ρ (e) in the OSV partition function (2.47), we obtain a convergent and modular sum Note that this should be intended as part of the definition of the electric sum, as we are not going to remove the weight ρ (e) in the following. Whether this factor can be derived from first principle, and not just by macroscopic arguments, is clearly an interesting question.
Having obtained a modular object 5 , we now consider the modular transformation (τ e , z) → (−1/τ e , z/τ e ). Using that A ab is integer valued, ϑ(z; τ e ) transforms as [11] ϑ(z/τ e ; −1/τ e ) = 1 √ − det A (−iτ e ) (n−1)/2 e 2πi Qe(z)/τe ϑ(z; τ e ) = ν∈Z n−1 ρ (e) (ν +ã; −1/τ e ) e −2πi Qe(ν)/τe+2πi Be(z/τe,ν) , (2.50) Hence we obtain which makes it manifest that (2.49) has the shift symmetry φ a → φ a + 2i. Using (2.52), Z c 1 ,c 2 OSV (p, φ) gets expressed as where F E (p,φ) denotes the free energy (2.32) with φ a replaced byφ a . Apart from modular transformations, the indefinite theta function may also be subjected to elliptic transformations. One such transformation is induced by the S-duality transformation S → S + i λ with λ ∈ Z. This transformation induces the shift z a → z a + λ a τ e , where λ a = −C ab p b λ, as can be seen from (2.48). Under this transformation, the indefinite theta function picks up a factor [11] 2πiB(z, λ a )]. This particular elliptic transformation can also be viewed as inducing a shift of the background charge q B a given in (2.31). Namely, using (2.48), the above transformation can also be obtained by performing the shift φ a → φ a − 2λ p a /(S +S) which, using (2.31), translates into shifting the background charge by q B a → q B a + λC ab p b . This shows how the background charge dependence is encoded in the elliptic transformation.
Introducing T a as T +T a = (S +S) p 1 p a , (2.55) and using p 1 = Y 0 (S +S) we get as well as This quantity equals the Kähler potential and Ω are given in (1.10) and in (2.27)), with T a = −iY a /Y 0 replaced by (2.55), and with Y 0 and S replaced by the shifted quantities (2.42). Observe that K is invariant under both S-and T-duality [10]. This extends toK and to the combination K + 4(S +S) 2 ∂ S ∂SΩ, provided S-and T-duality are defined in the same way when acting on the shifted fields (2.42) and (2.55). Note also that if we artificially take n = 27 (which corresponds to taking a model with 28 abelian gauge fields, just as in the original N = 4 model), the term (S +S) 12 in (2.57) precisely cancels against a similar term coming from Ω(S,S) in (2.27) [21], so that (2.57) becomes Thus, (2.60) takes a form reminiscent of |e Ftop | 2 (where F top denotes the holomorphic topological free energy), with an additional duality invariant measure factor [10] as well an extra weight factor ρ (e) . Our result for the regularized OSV partition function (2.57) contains a sum over indefinite theta functions over different (l 0 , l 1 ) sectors. In each (l 0 , l 1 )-sector, we can choose wedge vectors c 1 and c 2 to define the regulating error functions. Let us consider the sector l 0 = l 1 = 0 in more detail, and let us discuss a subtlety to which we already alluded to above. The sector l 0 = l 1 = 0 describes the semi-classical sector, and hence we must demand that our choice of wedge vectors and regularization yields sensible results in the semi-classical regime. The exact semi-classical point corresponds to ν = 0 in the l 0 = l 1 = 0 sector. However, as already mentioned, we have b a = 0 in this sector, and hence, both error functions in the regulator vanish. To resolve this conundrum, we propose a shift in the fluctuation (2.36) Here, we have used the fact that at the semi-classical point, Re(S −S) = Im(S +S) = 0. The modified free energy has an extra term −λ 2 Q(U ) S+S − iλU a C abφ b , as can be seen from (2.32). We will now pick appropriate value of c 1 and c 2 to preserve the classical free energy. In a well defined classical limit one should ensure that the exponential corrections coming from the error function do not affect the free energy. From (2.57) both the exponential and ρ go as S +S. If we denote y = −Im 1 τe and x 1 and x 2 the remaining factors in the error function, we can write Here, since we are interested in the semi-classical limit, we set l 0 = l 1 = 0 and obtain which are invariant under rescaling of the c i . In the semi-classical limit we have (S +S) → ∞, and hence we consider the expansion of the error function (C.3) around x = 0 as [22], In our case this yields (setting ν a = 0) (2.67) We choose U a to be a spacelike vector with norm U = U a C ab U b , so that in some Tduality frame we can bring it to the form U a = (1, 1 2 U 2 , 0), where vector 0 spans the timelike SO(r − 2) directions and the non-zero slots fill out a hyperbolic lattice. Then, in this frame, we choose c 1 a = ( 1 2 U 2 , 1, 0) and c 2 a = (1, 1 2 U 2 , 0), so as to ensure that the exponent in the regulator outside the brackets in (2.67) fully cancels the extra real term in the free energy πF E . In addition, for large U , the second term in the brackets is subleading compared to the first (when λ → 0). Then, normalizing the regulator in (2.67) by λ 1+α e −πiλU a C abφ b , where 0 < α < 1, and demanding that lim λ→0,S+S→∞ λ 2α (S +S) stays finite, we remove all leading order contributions to the semi-classical free energy.
Let us now briefly comment on the symmetries of the regularized OSV partition function. The indefinite theta function has modular and elliptic transformation properties. The modular transformation (τ e , z) → (−1/τ e , z/τ e ) implements Poisson resummation, which we employed to extract the semi-classical free energy, see (2.57). The elliptic transformation z a → z a + λ a τ e , with λ a = −C ab p b λ and λ ∈ Z, induces a shift of the background charge, q B a → q B a + λC ab p b . This is a reflection of the underlying S-duality invariance that is present in the original N = 4 theory, see (A.4). The regularized OSV partition function also has the shift symmetry φ I → φ I + 2i, which expresses integrality of the charges. This shift symmetry was made manifest using the following steps. In going from the OSV partition function (1.8) to the dyonic degeneracy formula (1.2), the summation variables changed from charges to T-duality invariant charge bilinears. The chemical potentials appearing in the dyonic degeneracy formula (1.2) have translational symmetries associated with the integrality of the invariant charge bilinears. In order to ensure the stronger condition for the integrality of charges, we had to make the translation symmetry of the original OSV potentials explicit by introducing new dummy summation variables and complexifying the potentials. Hence, the shift symmetry φ I → φ I + 2i of (1.8) is manifest in the result (2.57), which is entirely expressed in terms of hatted potentialφ I that are complex. This was achieved by regularizing the sum over q a by turning it into an indefinite theta function ϑ(z; τ ), and subsequently applying a modular transformation to it. To achieve this, we had to introduce a vector U a with norm Q(U a ) < 0. We may identify U a with the real part of an asymptotic T a -modulus lying in the Kähler cone. This shows that, in general, only an SO(1, r) subgroup of the T-duality symmetry group is preserved by the regulator/the specific choice of the vectors c 1 and c 2 that enter in the definition of ρ, in the Zweger's prescription.
2.6 Z c 1 ,c 2 OSV (p, φ) from an expansion of 1 Φ 10 in powers of P In the OSV ensemble, the p I are kept fixed, which implies that when p 0 = 0, the charge bilinear P is constant. This allows us to obtain an exact expression for Z c 1 ,c 2 OSV (p, φ) by using a Fourier expansion of 1/Φ 10 in P -modes, as follows.
Proceeding as above, we regularize the sum over the q a by turning it into an indefinite theta function, with z a given as in (2.48). Performing the modular transformation (2.52) we get

Conclusions
In this paper we have streamlined a new approach to deal with black hole partition functions in quantum gravity. The main feature is that the indefinite character of the charge lattice, a distinctive feature of gravity, and the need to preserve as many symmetries as possible, point towards the necessity of new mathematical structures to deal with the sums over microscopic states. We propose that the theory of indefinite theta functions may play a distinctive role in this program, as elucidated below.

Partition functions and divergences
In order to contextualize the divergences in the mixed ensemble, it is instructive to analyze the counting formula in two other ensembles. The first ensemble is defined by chemical potentials corresponding to the variation of the T-duality charge bilinears, where the partition function is given by In the Siegel upper-half plane, where this series is well-defined, Im σ ≫ 1 , Im ρ >≫ 1 and Im ρ Im σ ≫ (Im v) 2 , and hence the Q and P expansions are convergent. However, for a given value of Im v, the series is divergent in the R-sum, as the R sum goes over both positive and negative values. Hence, one cannot define the series for both positive and negative values of R, for a fixed value of Im v. This is related to the meromorphic structure of Φ 10 , arising from its double zero structure, which we dealt with, in detail, in section 2. In particular, the partition function has a double pole at y (1−y) 2 , where y = e −2πiv . One can expand this series about y = 0 or y = ∞, resulting in an expansion in positive powers of y , corresponding to positive R or an expansion in negative powers of y, corresponding to negative powers of R, respectively. But one cannot analytically continue from one expansion to another due to the pole at y = 1 corresponding to Im v = 0. As one moves through the pole, one picks up the residue around the pole, and this results in a jump in the degeneracy across a line of marginal stability corresponding to the appearance or disappearance of decadent dyons. One way to extract the microcanonical degeneracy and regulate the series is to compute the degeneracy for one sign of R, corresponding to the fixed sign of Im v, which makes the series well-defined. Then, we define the degeneracy of the charge configuration with the same value of Q and P , but with the opposite sign of R, as being equal to the degeneracy of the computed charge configuration, by applying parity-invariance [12].
A second ensemble in which we can write down a dyonic counting formula is obtained by fixing P and varying the other two charge bilinears. We can write down a partition function in this ensemble by going to a point in the Siegel upper-half plane where Im ρ ≫ Im σ. This allows us to expand the Siegel form as [23] 1 where ψ 10,m is a Jacobi form of weight 10 and index m. The Jacobi form inherits its meromorphicity from the Siegel modular form, and this leads to a divergence at the double poles. One can regulate this divergence by splitting the Jacobi form into two mock modular forms, one of which, the polar part, ψ P , encodes the double poles of the Jacobi form, and hence the jumps across the lines of marginal stability due to the decadent dyons, and the other is the finite analytic part of the Jacobi form which counts the immortal single-centered dyons, ψ F , as ψ 10,m = ψ P + ψ F .
On the other hand, in the mixed statistical ensemble, the partition function is written as Z OSV (p I , φ I ) = q I d(q, p) e πq I φ I . For any sign of the chemical potentials, as we sum over both positive and negative values of q I , this series is divergent. As we saw in section 2, this divergence shows up in the evaluation of the fluctuations about the critical point contribution to the free energy of the partition function. In this paper we have physically motivated a reason to use a soft regulatory mechanism to handle the divergences in the partition function written in the OSV ensemble (see Appendix B). We used a soft regulator following Zwegers to convert this into an indefinite theta function. The regulator converts the divergent series into an indefinite theta function. However, this regulator could be one of many choices to define a convergent series. In order to provide a physical basis for it, we notice that the resulting well-defined partition function counts single-centered black holes. Hence, a physical justification for our regulator lies in establishing a connection between the regulated partition function in the mixed ensemble, and the finite mock modular form. Accordingly, one must turn to the connection between the theory of indefinite theta functions and mock modular forms analyzed in [11], and show that the mock modular form associated with this indefinite theta function is precisely the one that encodes the single-centered degeneracies. This connection can be worked backwards in theories like the STU or FHSV models, where there is a strong suggestion [24,25] that the wall crossing phenomena are encoded in terms of indefinite theta functions, to be able to extract mock modular forms and hence, partition functions for counting single-center black holes. These open questions are being currently pursued.

Summary and context
The simple idea described and implemented in this paper provides a starting point to define OSV-like sums over single-centered black hole microstates which have a semiclassical limit consistent with supergravity. Indeed, the need of having sums over states which are both mathematically meaningful (and not just formal) and compatible with an infrared gravitational description has been the guiding principle of our approach. One can extend the procedure implemented in this paper to the n 2 > 1 poles of the Siegel modular form that counts the microscopic states in the theory. Regularizing the OSV partition function using indefinite theta functions renders it convergent while maintaining the shift symmetry (1.9), and allows to make contact with semi-classical results through the usage of modular transformations that implement Poisson resummation.
In order to prove the absolute convergence of the indefinite theta function series, one can show [11] that the series of the absolute values of the terms in the theta function converges faster than a canonical series obtained by effectively modifying the metric Q(c) of the charge lattice so as to remove the indefinite direction, and hence regulate the series. The norms of the vectors then change to Q(ν) → Q(ν) − B(c,ν) 2 2Q(c) (cf. (C.7)). Hence one could alternatively choose to simply modify the metric as above. It turns out that this is equivalent to introducing a canonical partition function regulator e −βH , where H is the Hamiltonian of the dyonic system seen as a bound state of D-branes in the theory. Indeed, if we consider the exponent Q c (ν) Imτ e in (C.7) and focus on the second term, given by B(c, ν) 2 /[−2(S +S)Q(c)] (here we set l 0 = l 1 = 0), and perform the replacements β = 1/(S +S) and u a = C ab c b / −2Q(c), we obtain β (ν a u a ) 2 with C ab u a u b = 1. This is precisely the H-regulator proposed in (6.15) of [26]. Thus, amusingly, the H-regulator used in [26,27] can be formally identified with the second term of Q c . We note, however, that the H-regulator has, so far, only been used at strong topological string coupling, c.f. (2.51) and (2.54) in [27]. We are not aware of its extension to weak topological string coupling, which corresponds to the semi-classical limit.
One can also view the present work in the context of the picture of the quantum entropy function introduced by Sen in [28]. The quantum entropy function, which counts the microstates of a supersymmetric black hole, was defined in the AdS 2 background which formed the near horizon geometry of the black hole. In this background, the fluctuation over the various fields had to be performed keeping the charge fixed since, in two dimensions, the charge is associated with the non-normalizable part of the electric field. Hence, the quantum gravity partition function computed in this background is bound to be the microcanonical partition function of black hole microstates, and it can be expressed as the exponential of the Legendre transform of the full quantum action evaluated on this background with respect to the charges of the black hole, to give the full quantum entropy function. On the other hand, to compute a canonical partition function, we looked at black holes which, at some point in their moduli space, have a near horizon background factor of AdS 3 . The central charge of the holographically dual CFT and the radius of AdS 3 are fixed by the p I , while the chiral excitation that defines the black hole is determined by the q I 6 . Hence, the partition function is defined by summing over the q I while keeping p I fixed. This mixed ensemble counts fluctuations in AdS 3 , and the free energy computed in this ensemble will include not just the single-center black hole excitations, but also other excitations of the AdS 3 vacuum. The associated partition function can be asymptotically expressed as the exponent of a free energy which is the Legendre transform of the action with respect to the q I . Finally, the work presented here paves the way for rigorously defining black hole partition functions in a grand canonical ensemble. The grand canonical ensemble sums over every charge in the system [10] and can be thought of as summing over all fluctuations. The free energy computed in this case will have contributions from various AdS 3 backgrounds, each of which defines a mixed ensemble. This quantity will be the full Euclidean quantum action that encode the dynamics of black hole backgrounds in the theory. A well defined properly regulated partition function in the grand canonical ensemble is therefore quintessentially important in an understanding of the underlying stringy effective action of the theory.
Finally, we note that our results indicate the need for defining indefinite theta functions on more general lattices.
A S-duality, attractor equations, and the Hesse potential In this Appendix we will review some of the duality properties of the effective N = 2 description and their relation with the attractor equations. In particular we will also discuss the relation between the effective free energy and the Hesse potential. Consider the prepotential (1.10). Associated to each Y I is a pair (q I , p I ) of electric/magnetic charges. This is the charge vector in the so-called type IIA polarization. It is related to the one in the heterotic polarization byq = (q 0 , −p 1 , q a ) , p = (p 0 , q 1 , p a ) . (A.1) Under S-duality, where a, b, c, d are real parameters that satisfy ad − bc = 1. It acts as on S = −iY 1 /Y 0 , and as follows on the charges, In particular, under the transformation a = d = 0, b = −c = 1, we have S → 1/S and q a → −C ab p b , p a → C ab q b . We define φ I = Y I +Ȳ I , where F as well as the electric attractor equations for the q a , leads to a full determination of the Y I in terms of S, as follows [10], Using (A.9), the attractor values for (φ a , χ a ) are and Using (1.10) and (A.10) we compute Next, let us consider the macroscopic free energy based on (1.10). It is given by (2.32) with Ω = 0 (and l 0 = l 1 = 0), The modular parameters τ e and τ m that appear in (2.48) can be defined starting from the macroscopic free energy (A.14), as follows. We use the attractor equation (A.11) to express φ a in terms of S,S and the charges (p a , q a ). Then, viewing F E as a function of p a , q a (and S,S) we get If we now set 16) we obtain τ e = i/(S +S) and τ m = i|S| 2 /(S +S).
Finally, let us consider the Hesse potential H (0) (φ, χ, S,S) that is obtained by Legendre transformation of the free energy (A.14) with respect to p a , (A.17) Using χ a = ∂F (0) E /∂p a we obtain

B Toy model for a regulator
We outline a simple model of regulating a divergent series so as to be able to provide a physical motive for the prescription of Zwegers. Consider the series V e V 2 , where V a is a vector in a two-dimensional Lorentzian space, and V 2 = V a C ab V b . The spacelike vectors render this series divergent. One simple way to regulate this series in a Lorentz-invariant fashion is simply to sum over only the time-like vectors. To implement this we go to the light cone gauge, where the norm-squared of the vector V a is given by ). This is precisely the regulatory proposal of Zwegers to define indefinite theta functions, which we review below. Note that in the case of a regulator based on error functions, all the vectors V a contribute to the sum, but those that would cause a divergence now appear with an exponential damping factor, rendering the sum convergent. Thus, no vectors are discarded in this case.

C Properties of indefinite theta functions
In this Appendix we review various properties of indefinite theta functions. Indefinite theta functions ϑ(z; τ ) were defined and studied by Zwegers in [11], and are modified versions of the sums considered in [29]. They have found recent string theory applications in [25,30,31,32,23]. Indefinite theta functions are based on quadratic forms Q : R r → R of signature (r−1, 1), defined in terms of symmetric non-degenerate r × r matrices A with integer coefficients, where τ ∈ H takes values in the complex upper half plane H, and z ∈ C r , with a, b ∈ R r defined by z = a τ +b. The factor ρ is the difference of two functions ρ c , ρ = ρ c 1 −ρ c 2 . The ρ c i depend on real vectors c i ∈ R r that satisfy Q(c i ) ≤ 0. In the following, we take Q(c i ) < 0 for both c 1 and c 2 . The other possibility, that is when Q(c i ) = 0, will be discussed in Appendix D. The set of vectors with Q(c) < 0 has two components, and we take c 1 and c 2 to be in the same component, so that B(c 1 , c 2 ) < 0. Then, the ρ c i are given in terms of error functions, Observe that ρ c (n + a; τ ) is non-holomorphic in τ . Also note that the definition of ρ(n + a; τ ) doesn't change if we replace c i by λ c i , with λ ∈ R + . This implies that two c i belonging to the same component of Q(c) < 0 should not be collinear, since otherwise ρ = 0, and that we may replace the condition Q(c i ) < 0 by Q(c i ) = −1 [11]. As shown in [11], (C.1) is convergent and has nice modular and elliptic transformation properties that are similar to those of theta functions based on positive definite quadratic forms. In the following, we briefly highlight various aspects that go into proving these remarkable facts. Following [11], we consider the indefinite theta function ϑ a,b (τ ) defined by ϑ a,b (τ ) = e 2πiQ(a)τ +2πiB(a,b) ϑ(z; τ ) = ν∈a+Z r ρ(ν; τ ) e 2πiQ(ν)τ +2πiB(ν,b) . (C.5) We begin by sketching the proof of convergence of (C.5). Since the proof is rather lengthy, we focus on the regulatorρ(x) = −sgn(x) β(x 2 ), which is related to ρ according to (C.3). To prove the convergence of the series usingρ, we will need the following two lemmata from [11]. The first lemma states that To show this, we consider the function f (x) = β(x 2 ) − e −πx 2 . It vanishes at x = 0, ±∞. Away from these values, it has extrema located at πx = sgn(x), which are local minima. Hence it follows that f (x) ≤ 0, which establishes the lemma. The second lemma that is needed states that the combination is positive definite. Here, c is a vector satisfying Q(c) < 0. Note that Q c (ν) > 0 regardless of the sign of Q(ν). This lemma can be proven as follows. First let us consider the case when ν ∈ R r is linearly independent of c. Then the quadratic form Q has signature (1, 1) on the two-span{c, ν}, and hence the matrix has determinant < 0, so noting that Q(c) < 0 we obtain On the other hand, when ν = λ c with λ = 0, we obtain Q c (ν) = −Q(c) λ 2 > 0, which shows that the combination (C.7) is always positive definite. Next, using Q(c) < 0, we compute ρ(ν; τ ) e 2πiQ(ν)τ +2πiB(ν,b) ≤ e π B 2 (c,ν) Q(c) Im τ e 2πiQ(ν)τ +2πiB(ν,b) = e −2πQc(ν) Im τ . (C.10) Since Q c (ν) > 0, the series ν∈a+Z r e −2πQc(ν) Im τ (C.11) converges, and thus ϑ a,b (τ ) is absolutely convergent for the above choice of regulator, and hence convergent. It is also uniformly convergent for Imτ ≥ ε > 0. The proof of convergence for the regulator ρ is much more involved, but proceeds along similar lines [11]. Now let us consider the behavior of ϑ a,b (τ ) under the modular transformation τ → −1/τ . The proof given in [11] establishing that ϑ a,b (τ ) has a good behavior under this transformation requires the regulator ρ(ν; τ ) to be an odd function of ν, and the derivatives ∂ρ/∂ν to exist. In [11] it is shown that under τ → −1/τ , ϑ a,b (τ ) transforms as We now sketch the proof leading to this result. It uses a lemma as well as Poisson resummation. The lemma states that for all α ∈ R r and τ ∈ H, R r ρ(a; τ ) e 2πiQ(a)τ +2πiB(a,α) da = 1 Its proof goes as follows. The integral on the left hand side is convergent. Using ∂ ∂α l e 2πiQ(aτ +α)/τ = 1 τ ∂ ∂a l e 2πiQ(aτ +α)/τ , (C.14) we obtain ∂ ∂α l e 2πiQ(α)/τ R r ρ(a; τ ) e 2πiQ(a)τ +2πiB(a,α) da = − 1 τ R r ∂ρ ∂a l (a; τ ) e 2πiQ(aτ +α)/τ da , (C.15) where we integrated by parts and used that the boundary terms do not contribute. Since ρ is the difference of two error functions, the derivatives ∂ρ ∂a l (a; τ ) yield derivatives of error functions. We therefore consider the following expression which appears on the right hand side of the above equation, where we used the property E ′ (x) = 2e −πx 2 . As shown in [11], the integral over R r can be split into an integral over R (corresponding to the direction associated with the negative eigenvalue of Q) and an integral over R r−1 associated with the directions that correspond to the positive eigenvalues of Q. The integration over R would yield a divergent result where it not for the presence of the additional factor E ′ which converts the factor τ appearing in the exponent on the right hand side into a factorτ , rendering the integration over R well behaved, R e 2πiQ(c) a 2 cτ +4πiQ(c)acαc da c , (C.17) where we refer to [11] for a detailed derivation of this remarkable result. Using this, the right hand side of (C.16) evaluates to Im τ e 2πiQ(aτ +α)/τ da Using this expression in (C.15) leads to (C. 19) It follows that the expressions in the two brackets have to agree, up to an α-independent expression. Since ρ(x) is an odd function, both brackets are odd as a function of α, and hence the α-independent expression has to vanish. This proves lemma (C.13).

D An example of an indefinite theta function
In this appendix we consider an explicit example [29] of an indefinite theta function. In doing so we explicitly show how indefinite theta functions differ from ordinary theta functions, and how the indefinite directions are dealt with. In this example the weight function ρ is taken to be the difference of two sign functions. In this case Zweger's "wedges" act as a projector onto a specific sublattice. We consider the indefinite theta function given by [29] x∈Γ 1,1 ρ(x + α) e 2πiQ(x)τ +2πiB(x,γ) , (D.1) defined over the indefinite lattice Γ 1,1 . We write the vector γ as γ = ατ + β. The other vectors are explicitly x = (m, n) , γ = (γ 1 , γ 2 ) , α = (α 1 , α 2 ) , β = (β 1 , β 2 ) .

(D.2)
For simplicity we will focus on the case where both c 1 and c 2 are chosen in such a way that Q(c i ) = 0 for i = 1, 2. In this case the weight function ρ = ρ c 1 − ρ c 2 simply plays the role of a projector and ρ c i (x + α) = sgn B (x + α; c i ) . We have now two possibilities. In the first case we pick the domain S 1 . Then c 1 = (0, +1) and c 2 = (−1, 0). Therefore we have to work with the condition {0 < α 1 < 1} ∩ {−1 < α 2 < 0} .
(D. 6) In particular ρ(x + a; τ ) = sgn B(x + α, c 1 ) − sgn B(x + α, c 2 ) = sgn(m + α 1 ) + sgn(n + α 2 ) = The border values have to be treated separately: m = 0 =⇒ sgn(α 1 ) + sgn(n + α 2 ) = +1 + sgn(n + α 2 ) = 0 ⇐⇒ n > 0 n = 0 =⇒ sgn(m + α 1 ) + sgn(α 2 ) = sgn(m + α 1 ) − 1 = 0 ⇐⇒ m < 0 (D.8) Therefore the sum of the theta function is only in m ≥ 0, n > 0 and m < 0, n ≤ 0. Therefore x=(m,n)∈Γ 1,1 ρ(x + α) q mn e m(2πiγ 2 )+n(2πiγ 1 ) Note that in both cases the weight function ρ acts as a regulator projecting out certain lattice points, among which those that would have given an exponentially growing contribution. The situation where ρ is the difference between two error functions (C.2) can be treated similarly. Indeed as pointed out in (C.3) the error function can be written as E(x) = sgn(x) 1 − β(x 2 ) = sgn(x) − sgn(x)β(x 2 ) . (D.14) The first term in the sum behaves precisely as we have explained in the above text. The second term has a different role. Note that the second term is precisely the combination which we calledρ in the appendix C, cf. below (C.5). As discussed there, it follows from (C.10) that the combination ofρ with the exponential of an indefinite quadratic form is always bounded by a damped positive definite quadratic form. This was used to bound the whole series to prove its convergence. This means that in the function ρ = ρ c 1 −ρ c 2 , the competition between the sign terms in (D.14) acts as a projector, while the terms proportional to β sum over all the lattice points, but suppress their contribution exponentially via the error function.