Indefinite theta functions for counting attractor backgrounds

In this note, we employ indefinite theta functions to regularize canonical partition functions for single-center dyonic BPS black holes. These partition functions count dyonic degeneracies in the Hilbert space of four-dimensional toroidally compactified heterotic string theory, graded by electric and magnetic charges. The regularization is achieved by viewing the weighted sums of degeneracies as sums over charge excitations in the near-horizon attractor geometry of an arbitrarily chosen black hole background, and eliminating the unstable modes. This enables us to rewrite these sums in terms of indefinite theta functions. Background independence is then implemented by using the transformation property of indefinite theta functions under elliptic transformations, while modular transformations are used to make contact with semi-classical results in supergravity.


Contents 1 Introduction
Ooguri, Strominger and Vafa introduced a partition function for BPS black holes in four dimensions based on a mixed statistical ensemble [1] Z OSV (p, φ) = q I d(q, p) e πq I φ I , (1.1) where d(q, p) denote microstate degeneracies that depend on electric and magnetic charges (q I , p I ), and φ I denote electrostatic potentials that are held fixed (I = 0, . . . , n). When evaluating this partition function [2,3,4], one encounters divergences that are associated with the indefinite signature of the underlying lattice of electric and magnetic charges. One therefore needs to introduce a regulator. OSV type partition functions have been computed in two different regimes. In one regime one utilizes the description of the system as a bound state of D-branes and regularizes the partition function by modifying the exponent of (1.1) through the addition of a so-called H-regulator [5,6]. This calculation is done in a regime where the D-brane world sheet theory is weakly coupled. The partition function may, however, also be computed in a different regime, where a supergravity description in terms of BPS black holes is available. In this paper we will focus on a subset of these black holes, namely single-center black holes, and we will be interested in single-center black hole partition functions. To define these, the sum (1.1) needs to be restricted in a suitable manner. This can be done as follows.
We consider a specific model, namely four-dimensional toroidally compactified heterotic string theory. For this model there exists an exact counting formula of 1 4 BPS microstate degeneracies [7,8] in terms of a Siegel modular form 1/Φ 10 , expressed as a function of quadratic charge invariants. To be able to use an effective N = 2 description, we will work with a restricted set of N = 4 charges, which we denote by (q I , p I ). Then, a black hole partition such as (1.1) is evaluated in various steps. First, we sum over charges q 0 and q 1 . To do so, we express these charges in terms of T-duality invariant charge bilinears, and we rewrite the chemical potentials φ 0 and φ 1 in (1.1) in terms of the Siegel upper half plane period matrix entries, which act as chemical potentials for the charge invariants that parametrize the degeneracies in the ensemble counted by 1/Φ 10 . This allows us to express the sum over q 0 and q 1 in terms of an integral over 1/Φ 10 , which is then evaluated using residue techniques. In doing so we restrict the analysis to a certain subset of zeroes of Φ 10 [9], in order to single out the contributions that give rise to the dilatonic free energy F D of a single-center black hole [3]. Subsequently, we also sum over charges q a and p a , obtaining generalized OSV type partition functions which we call single-center black hole partition functions. For extremal dyonic black holes, the near-horizon geometry, called the attractor geometry (for reasons explicated in the next section), decouples from asymptotic infinity and encodes the entropy of the black hole microstates sans scalar hair contributions. The single-center black hole partition functions that we obtain 1 count excitations, graded by q a and p a , in the near-horizon geometry of the black hole.
When performing the sum over charges q a (and p a ) we encounter the aforementioned divergences associated with the indefiniteness of the q a (p a ) charge lattice. In [11] we advocated using indefinite theta functions [12] to regularize these sums. There we focussed on OSV black hole partition functions with p 0 = 0. In this paper we will extend our considerations and consider single-center black hole partition functions with p 0 = 0 based on either mixed or canonical ensembles. To regularize the sum over q a (and p a ) we first pick a reference attractor background (which we define in next the section) and consider fluctuations in this background. To enforce thermodynamical stability, we restrict to fluctuations that do not increase the dilatonic free energy F D mentioned above. Thus, we remove exponentially growing contributions. This is done by introducing in the sum a suitable measure factor based on sign functions (rather than by modifying the exponent of (1.1)). The resulting regularized sums are given in terms of indefinite theta functions. The latter have good transformation properties under modular and elliptic transformations. The elliptic transformation property ensures that the result is independent of the chosen reference background. We use modular transformations to extract known semi-classical results from the regularized partition functions, namely the semi-classical free energy F E and the semi-classical Hesse potential H [1,3]. We note that this regularization procedure requires, in addition, extending the electrostatic potentials φ a to complex potentials φ a + iµ a , and similarly for their magnetic counterparts χ a (a = 2, . . . , n), as was already noted in [11]. Indefinite theta functions have previously found applications in counting dyonic degeneracies [13,14,15]. This paper is organized as follows. In section 2 we introduce the notion of an attractor background and collect various useful formulae. In section 3 we define single-center black hole partition functions for two types of ensembles in toroidally compactified heterotic string theory, and we describe the regulator that we use to deal with the aforementioned divergences. Contrary to [11] we do not restrict to single-center black holes with p 0 = 0. The resulting regularized partition functions have good modular and elliptic transformation properties, which we use to make contact with semi-classical supergravity results. We summarize our findings in section 4, where we also comment on various subtleties that we encountered. 1 These partition functions are different from the finite part of the index, ψ F m (τ, z), defined in [10], that counts states in the CFT dual to the near-horizon geometry, in an ensemble parametrized by charge invariants at fixed magnetic charges.

Attractor backgrounds
We consider models whose two-derivative Wilsonian effective action is based on an N = 2 prepotential of the form up to worldsheet instanton corrections which we assume are either absent or negligible. Here, n denotes the number of N = 2 abelian vector multiplets coupled to N = 2 supergravity. The consistent coupling of these vector multiplets to supergravity requires the symmetric matrix C ab to have signature (1, n − 2) [16,17]. These models may either describe genuine N = 2 models or provide an effective N = 2 description of N = 4 models when restricting to a subset of N = 4 charges. We introduce the quantity For the class of models specified by (2.1), K (0) takes the form where we defined In heterotic string theory, the field S denotes the dilaton/axion complex scalar field. We can construct single-center dyonic BPS black hole solutions in any given model (2.1). These are static, spherically symmetric, asymptotically Minkowskian spacetimes with line elements given by ds 2 = −e 2U (r) dt 2 + e −2U (r) dr 2 + r 2 dΩ 2 (2) . (2.4) These solutions, which are supported by scalar fields Y I (r) and by the abelian gauge fields of the model, are dyonic and carry electric/magnetic charges (q I , p I ).
A fixed charge vector (q I , p I ) supports a single-center BPS black hole solution if the scalar fields Y I (r) evolve smoothly to near-horizon values Y I = Y I * /r specified by the so-called attractor equations [18,19,20,21] such that the horizon quantity |Z * | 2 ≡ p I F (0) I (Y * ) − q I Y I * is non-vanishing, i.e. |Z * | 2 > 0. Then, the near-horizon line element takes the form of an AdS 2 × S 2 line element, 6) and the macroscopic entropy of the BPS black hole, which at the two-derivative level is determined by the area law, equals S(q, p) = π |Z * | 2 = π p I F (0) The entropy may also be expressed as S(q, p) = πK (0) by virtue of (2.5).
Next, we associated a free energy to the BPS black hole. To this end, we introduce electro/magnetostic potentials as [22] φ I = Y I +Ȳ I , Then, a solution to the attractor equations (2.5) can be expressed as The black hole can be assigned a macroscopic free energy by performing a Legendre transform of the entropy. There are various possibilities here. Performing a Legendre transform with respect to all the electric charges yields the free energy F where S is expressed in terms of the electrostatic potentials φ 0 * and φ 1 * and the magnetic charges p 0 , p 1 as On the other hand, performing the Legendre transform with respect to the electric charges q 0 , q 1 only yields the dilatonic free energy F Finally, performing a Legendre transform of F (0) E (p, φ * ) with respect to the magnetic charges p a yields the reduced Hesse potential [11], The extremization equations following from H (0) (S,S, φ a * , χ a * ) = F (0) D (S,S, p a , q a ) + q a φ a * − p a χ a * yield the attractor values (φ a * , χ a * ), expressed in terms of the charges (q a , p a ) and the field S, namely φ a * + 2 and (2.15) At the two-derivative level, the attractor value of S is determined in terms of the following three charge bilinears The entropy, when expressed in terms of these charge bilinears, reads S(q, p) = π QP − R 2 . Conversely, given a value S with S +S > 0 and charges (q a , p a ), we defined attractor values (φ a * , χ a * ) by (2.14) and (2.15). Therefore, the lattice of electric and magnetic charges singles out a subset of values (φ a , χ a ), namely the attractor values (φ a * , χ a * ). For a given S, these correspond to attractor values In the following, we will refer to the attractor values (φ a * , χ a * ) as attractor backgrounds, provided QP − R 2 > 0 as well as ̺ a C ab ̺ b > 0. The latter are necessary conditions for a charge configuration to constitute a single-center BPS black hole, as we show below. Before doing so, we note that all three quantities F * , χ a * ) will play a role at various steps when evaluating OSV type partition functions in the following sections.
Next, let us introduce the vector ̺ a , which can be motivated as follows. Let us return to K (0) given in (2.2). Imposing the magnetic attractor equations (2.8) as well as the electric attractor equations (2.14) for the q a results in and determines K (0) in terms of the charges (q a , p I ) and S as where Now let us recall that the entropy of a single-center BPS black hole is given by S(q, p) = π K (0) , which implies ̺ a C ab ̺ b > 0 in order for the entropy to be non-vanishing at the twoderivative level (here we are assuming S +S > 0, with |Y 0 * | 2 (S +S) finite). Thus, ̺ a C ab ̺ b > 0 is a necessary condition for a charge configuration to correspond to a single-center black hole. This combination may be expressed in terms of the charge bilinears (2.16) as Single-center black hole solutions necessarily have QP − R 2 > 0. We will now show, using (2.22), that they also have to satisfy Q < 0, P < 0. This can be checked as follows. Since QP − R 2 > 0, we only have two possibilities: either Q < 0, P < 0 or Q > 0, P > 0. Let us first assume that Q < 0, P < 0, in which case we may rewrite (2.22) as When p 0 p 1 > 0, we choose the plus sign in the second term, while when p 0 p 1 < 0 we take the minus sign. Then, using |QP | > |R|, we obtain ̺ a C ab ̺ b > 0. Now let us consider the case when Q > 0, P > 0. We rewrite (2.22) as When p 0 p 1 > 0, we choose the minus sign in the second term, while we choose the plus sign when p o p 1 < 0. Using |QP | > |R|, we see that ̺ a C ab ̺ b < 0, which establishes that configurations with Q > 0, P > 0 cannot correspond to single-center black holes.
In section 3, we will find it useful to perform the replacements Observe that K (0) andK (0) are invariant under S-duality, provided the differential operators in (2.25) transform in the same way as the charges (q a , p a ). Under S-duality, S transforms as with a, b, c, d ∈ Z satisfying ad − bc = 1, while the charges transform as (2.29) The electric and magnetic potentials φ I and χ I transform in a similar manner, and hence the combination and T a * are invariant under S-duality. We will also introduce the quantities K [3], where Ω denotes a real quantity that encodes corrections due to higher-curvature terms.
Aspects of the sigma-model geometry based on (2.30) have been discussed in [24]. In the context of the N = 4 model which we will be considering, Ω only depends on S andS and is S-duality invariant. Hence, K is S-duality invariant. It is also T-duality invariant [3]. Replacing T a by the differential operator (2.26) yieldsK, which will play the role of a measure factor in subsequent discussions.

Single-center black hole partition functions
In this section we focus on a particular N = 4 model for which there exists an exact counting formula for 1 4 BPS microstates, namely four-dimensional toroidally compactified heterotic string theory [7,8]. We restrict to a subset of N = 4 charges, which we denote by (q I , p I ) (with I = 0, 1, . . . , n), so as to use an effective N = 2 description of this model based on a prepotential of the form (2.1). The charges (q I , p I ) and the matrices C ab and C ab are integer valued, and thus the charge bilinears (2.16) satisfy Q, P ∈ 2Z, R ∈ Z. The BPS microstate degeneracies d(q, p) are encoded in a Siegel modular form, defined on the Siegel Convergence of the Q and P sums is enforced by Im σ > 0 , Im ρ > 0. The sum over R is more subtle. Convergence of the R sum requires restricting it to a certain range, and this range depends on the sign of Im v [25,26].
In the following, we will focus on single-center 1 4 BPS black holes with p 0 = 0 and define an OSV black hole partition function (1.1) for these in a two-step procedure, as follows. The first step is implemented by considering the sum over electric charges q 0 , q 1 , converting it into a sum over Q and P by using the relations (2.16), and subsequently using an integral representation for the degeneracies d(q, p) based on (3.1), which is then computed in terms of residues associated with the zeros of Φ 10 . Here we improve on the analysis of [11] by only retaining those zeroes of Φ 10 that give a contribution to the dilatonic free energy (2.12).
In a second step we sum over charges q a . We begin by picking reference charges q B a (and p a ) which we encode in a reference vector (2.21), denoted by ̺ B a , that satisfies ̺ B a C ab ̺ B b > 0. This is a necessary condition for the configuration to correspond to a single-center black hole, as already discussed. We will refer to ̺ B a as an attractor background. We then consider fluctuations V a = q a − q B a around this background. The sum over these electric fluctuations is ill defined due to the indefiniteness of the charge lattice. We regularize this sum by removing all the contributions that grow exponentially. In addition, we demand that the resulting regularized sum possesses good transformation properties under modular and elliptic transformations. One way of achieving this is to convert the sum over V a into an indefinite theta function [11]. Indefinite theta functions have good modular and elliptic transformations properties [12] which we subsequently utilize to make contact with semi-classical results. The regularized partition function then contains an exponential factor that accounts for the semiclassical free energy of the background, as well as an indefinite theta functions that describes a regularized sum of fluctuations around the background. Due to the elliptic property of the indefinite theta function, the result is actually independent of the choice of the background charge q B a , since two such choices are related by an elliptic transformation. The result for the partition function also uses a differential operator that enforces the condition ̺ a C ab ̺ b > 0 discussed below (2.21). Thus, the partition function can be viewed as a sum over attractor backgrounds.
Subsequently, we extend the discussion by considering single-center black hole partition functions based on a canonical ensemble, obtained by also summing over magnetic charges We restrict our analysis to the case S =S, so as to decouple the sums over (q a , p a ). We regularize these sums by again employing indefinite theta functions. After resorting to modular transformations, the resulting expression is given in terms of the Hesse potential (2.13), two indefinite theta functions and a measure factor, and it is invariant under the strong-weak coupling duality transformation S → 1/S. We proceed to explain these results.

Summing over charges q I
We begin by considering the sum over charges (q 0 , q 1 ), using various results obtained in [11].
In doing so, we improve on the analysis of [11] and clarify certain statements made there. There, we specialized to p 0 = 0. Here, we keep p 0 = 0 (as well as p 1 = 0), which will be kept fixed throughout.
As stated above, we focus on toroidally compactified heterotic string theory, for which there exists an exact counting formula for 1 4 BPS microstates based on the Siegel modular form 1/Φ 10 . We first convert the sum over (q 0 , q 1 ) into a sum over the charge bilinears (Q, P ) using the relations (2.16), where we keep (q a , p a ) fixed. From (3.1) we see that the states that contribute are states for which Q and P are mostly negative, which implies that the states contributing to the sum over (q 0 , q 1 ) are mostly states with a definite sign of (q 0 , q 1 ). Replacing (q 0 , q 1 ) by (Q, P ) we obtain . . , where the dots refer to terms that do not involve Q and P . Thus, for the exponent in (3.2) to be damped for negative Q and P , we require and using (3.4), we obtain Next, let us consider the combination R in (2.16). Replacing (q 0 , q 1 ) by (Q, P ) we obtain the combination For fixed (q a , p I ), and taking |Q| ≫ 1, |P | ≫ 1, the sign of R(Q, P ) equals the sign of −p 0 p 1 . Next, we convert the sum (3.2) over (q 0 , q 1 ) into a sum over (Q, P ) following [2,3]. In order to use the representation (3.1), we introduce an additional sum over a dummy variable R ′ ∈ Z [11], where θ = θ 1 + iθ 2 ∈ C, and where θ 2 is held fixed with θ 2 = 0. For a fixed θ 2 , convergence of the R ′ sum requires restricting it to a certain range that is taken to include R. This is similar to what was observed below (3.1). Using this, we obtain the following representation for the sum over (q 0 , q 1 ) [11], andφ 0 = φ 0 + 2il 0 , The extra sum over the integers l 0 and l 1 arises when trading the summation variables (q 0 , q 1 ) for the T-duality invariant combinations Q and P [2,3]. The integration contour in (3.9) is at fixed θ 2 , whose value is obtained by requiring that the conditions for convergence of the expansion (3.1) in the Siegel upper half plane are satisfied when restricting σ and ρ to (3.10). Namely, demanding Im σ(θ) > 0, Im ρ(θ) > 0, we obtain from which we infer where S is given in (3.5). Recalling (3.4), we see that the right hand side of (3.12) is positive. Taking it to be very large, so that (S +S)|φ 0 + ip 0 | 2 is very large, we see that the conditions (3.12) (as well as (3.13)) are satisfied for any finite value of θ 2 . Similar considerations apply to the Siegel upper half plane condition Im σ(θ) Im ρ(θ) > (Im v(θ)) 2 , which translates into (3.14) Now we note that we can also impose the more restrictive condition Im σ(θ) ≫ 1, Im ρ(θ) ≫ 1, which ensures that (3.1) has a well defined expansion for very large charges. We obtain from which it follows that In this case the conditions (3.15) and (3.16) can be satisfied for any finite value of φ 0 , φ 1 , p 0 , p 1 by taking θ 2 to satisfy p 0 p 1 θ 2 < 0 with |θ 2 | ≫ 1. This choice also ensures the validity of the Siegel upper half plane condition (3.14). Thus specifies another viable integration contour for the integral (3.1). Below we will show that this choice of contour is necessary in order to select large charge single-center black holes. The left hand side of (3.9) is invariant under the shifts φ 0 → φ 0 + 2i , φ 1 → φ 1 + 2i. The right hand side of (3.9) is also invariant under these shifts. This follows from the fact that the integrand of (3.9) is invariant under shifts σ(θ) → σ(θ) − n , ρ(θ) → ρ(θ) + m , n, m ∈ Z , (3.18) which are induced by Now let us turn to the evaluation of the integral (3.9). We begin with the following observation. The θ-dependent part of the exponential in (3.9) reads exp[iπ θ ̺ a C ab ̺ b /(p 0 p 1 )], with ̺ a given in (2.21) [11]. We will assume |̺ a C ab ̺ b | = 0, as the ̺ a C ab ̺ b = 0 contributions will be subleading. Below we will evaluate the integral (3.9) by residue techniques. To this end, we will first extend the range of integration to the entire real line and then move the contour to a region where the integrand becomes vanishing. Choosing the contour specified by (3.17), we obtain a non-vanishing result provided that ̺ a C ab ̺ b > 0. The result will thus be proportional to a Heaviside step function H(̺ a C ab ̺ b ), as expected for an inverse Laplace transform. Note that ̺ a C ab ̺ b > 0 is a necessary condition for a charge configuration to correspond to a single-center black hole, as discussed below (2.21). Thus, in the following, we will use the contour (3.17). It corresponds to the so-called attractor contour introduced in [27] to single out large charge single-center contributions to the entropy.
We now evaluate (3.9). Here we proceed differently from [11] and resort to an approximation. Namely, we approximate the exact result by only keeping the contributions from zeroes of Φ 10 (σ(θ), ρ(θ), θ) that encode the dilatonic free energy contribution (2.12), as follows. The zeroes of Φ 10 (σ, ρ, v) that yield the leading contribution to the entropy of single-center black holes are parametrized by three integers (m, n, p) and given by [7], This can be verified by considering a certain constrained extremization problem [9]. In the following, we consider a related extremization problem in order to determine the subset of zeroes (3.20) that encode the dilatonic free energy of single-center black holes.
To leading order, (3.9) can be calculated by saddle point approximation, by extremizing the exponent on the right hand side of (3.9) with respect to θ subject to (3.20). By inserting (3.10) into (3.20), we obtain the combination Denoting the exponent on the right hand side of (3.9) by E, we consider the constrained extremization problem, where λ denotes a Lagrange multiplier. We obtain with ̺ a given in (2.21). Inserting this into (3.23) we get as well as The first relation determines the value of λ, while the second relation selects a subset of the zeroes (3.20). The value of θ associated to these zeroes is determined from the condition D = 0 given in (3.21), which we need to supplement with (3.26), resulting in The exponent E, on the other hand, takes the value with θ given by (3.27). The zeroes (3.26) depend on the combinations l 0 + p 1 n and l 1 + p 0 m. Using Φ 10 (σ − n, ρ, v) = Φ 10 (σ, ρ + m, v) = Φ 10 (σ, ρ, v) as well as q a C ab q b ∈ 2Z, p a C ab p b ∈ 2Z, we can absorb the shifts p 0 m and p 1 n into l 1 and l 0 and extend the original range of l 0 and l 1 in (3.9) to run over all the integers. The condition (3.26) then becomes where now −∞ < l 0,1 < ∞. Next, we parametrize the zeroes satisfying (3.29) by The associated value of θ reads, Then, inserting (3.31) into E in (3.28) shows that the real part of E will depend on k, unless k = 0, in which case we obtain which is real and independent of p. Here F where in this expression z ∈ R, whose value can be read off from (3.31), and where τ is given by (3.34) Taking S +S > 0 as well as ̺ a C ab ̺ b > 0 (recall that this is implemented by using the contour (3.17)), τ takes its value in the complex upper half plane, and the sum over k gives a theta function. Thus, we have established that only the subset of zeroes parametrized by (3.30) solves the extremization problem (3.23), and that out of these only those with k = 0 encode the dilatonic free energy F (0) D , while those with k = 0 yield instanton corrections. In the following, and contrary to [11], we will suppress instanton corrections and only retain the subset of zeroes with k = 0. These are the zeroes (l 0 , l 1 , p) = (pp 0 , −pp 1 , p). Since they contribute with a factor F (0) D , they yield the semi-classical free energy of a single-center 1 4 BPS black hole when ̺ a C ab ̺ b > 0.
We proceed to evaluate (3.9) by retaining only the subset of zeroes just discussed, and employing the contour (3.17). Since e E is independent of p, and using the property Φ 10 (σ, ρ, v + p) = Φ 10 (σ, ρ, v) for p ∈ Z, we can use the zeroes (l 0 , l 1 , p) = (pp 0 , −pp 1 , p) to extend the range of integration of θ 1 to −∞ < θ 1 < ∞. The relevant zero of Φ 10 is then given by D = v + ρσ − v 2 = 0. In the vicinity of this zero, Φ 10 takes the form Φ 10 ≈ D 2 ∆ with [25] where In these expressions, (σ, ρ, v) is replaced by (3.10) with l 0 = l 1 = 0. Then, using (3.28), (3.9) becomes The contour of integration is at fixed θ 2 satisfying (3.17). The quantity D 2 (θ) has a double zero at 2θ * = 1+(S −S)/(S +S) [3]. Recall that we consider configurations with ̺ a C ab ̺ b = 0. We now evaluate the integral by residue technique, moving the contour to a region where the integrand becomes vanishing. In this way we find that only configurations with ̺ a C ab ̺ b > 0 contribute. They pick up the contribution from the zero D(θ * ) = 0, resulting in Here, H denotes the Heaviside step function. It ensures that only configurations with ̺ a C ab ̺ b > 0 contribute. As mentioned before, the latter is a necessary condition for the charge configuration to constitute a single-center black hole. We note that the Heaviside step function can be smoothen out into a continuous and differentiable function. Below we will assume that this is the case, but will refrain from writing this out explicitly.
In obtaining these results we used that on the zero D(θ * ) = 0 [11], Note that (3.38) no longer exhibits the shift symmetry φ 0 → φ 0 + 2i, φ 1 → φ 1 + 2i, due to the fact that we only retained the contributions from zeroes of Φ 10 that give rise to the semi-classical dilatonic free energy F D .
Observe that both F D and the measure factor M/[(S +S)|Y 0 | 2 ] 2 in (3.38) are invariant under S-duality transformations (2.28), (2.29). This can be easily seen by rewriting M in (3.40) as with T a defined as in (2.19), and K given in (2.30). The factor M/[(S +S)|Y 0 | 2 ] is also T-duality invariant [3]. The measure (3.42) is closely related to (but not identical with) the measure factor √ ∆ − introduced in [3] on the grounds of electric/magnetic duality covariance. It differs from √ ∆ − by duality covariant terms. Next, we would like to sum (3.38) over charges q a (a = 2, . . . , n). Here we face various issues. First, we have a measure factor M that depends on q a . To deal with this, we first extend φ a to φ a + iµ a (with µ a ∈ R n−1 ). Then, we replace the charge q a in M by the corresponding differential operator of (2.25). This results in a differential operatorM , which is obtained from M by replacing T a witĥ Thus, we replace (3.38) by

44)
Next, we consider summing (3.44) over q a . Here we face the problem that this sum is illdefined due to the indefinite signature of the q a charge lattice (a = 2, . . . , n). Thus, the sum over q a has to be regularized. We propose the following procedure. First, we pick a reference vector q B a such that ̺ B a C ab ̺ B b > 0. As mentioned below (2.18), we will refer to this reference vector as an attractor background associated with a single-center BPS black hole. We then consider fluctuations V a = q a − q B a around this black hole background. Thus, we set q a = q B a + V a in (3.44) and sum over V a . To enforce thermodynamic stability, we restrict to fluctuations that do not increase the dilatonic free energy F D . We do this by modifying the measure factor in (3.44). Namely, we introduce an additional measure factor ρ, whose role is to weight each summand in the V a sum with ±1 or 0, in such a way that the contributions (3.44) with growing exponent are removed from the sum, while the remaining contributions are weighted by ±1. This is achieved by taking ρ to be the difference of two sign functions ρ = ρ c 1 − ρ c 2 , with ρ c (V ; τ ) = −sgn(V a C ab c b ) and suitably chosen vectors c 1 and c 2 [12]. Thus, the proposed regulator turns the sum over V a into an indefinite theta function based on sign functions. In principle, we can also consider indefinite theta functions that are based on error functions, as in [11]. These would then be defined in terms of different choices for c 1 and c 2 . Note that the regulator ρ does not preserve all of T-duality, but only the subgroup SO(1, n − 2; Z). We also note that there exist other proposals for regularizing the sum, which are based on a modification of the exponent of (3.44). Examples thereof are the so-called H-regulator, which has been proposed when p 0 = 0, and Siegel-Narain theta functions [5,28,29,6].
The resulting regularized partition function Z reg OSV (p, φ; µ) appears to depend on the choice of the reference attractor background q B a , but this dependence is only apparent, since two different choices of a reference background are related by an elliptic transformation of the indefinite theta function. Thus, the result for the regularized partition function is independent of the choice of the background. We proceed with the details of this construction.
The reference charge vector q B a has a background value φ a B associated to it, which is determined by (2.14). Expanding the exponent of (3.44) around q a = q B a + V a gives where we introduced Q e (q) = 1 2 q a A ab q b , B(z e , q) = z e a A ab q b , A ab = −C ab , Then, by multiplying (3.44) with the regular ρ specified below and summing over fluctuations V a (a = 2, . . . , n), we define the regularized partition function Z reg OSV (p, φ; µ) by where ϑ(∆; τ e ) denotes an indefinite theta function [12], Here we decomposed ∆ = α τ e + β (with α, β ∈ Z n−1 ), so that The regulator ρ = ρ c 1 − ρ c 2 is taken to be ρ(q; τ e ) = sgn(B(q, c 1 )) − sgn(B(q, c 2 )) , (3.50) where sgn denotes the sign-function, and where c 1 and c 2 are two linearly independent null vectors, Q(c i ) = 0. To assess the physical meaning of this construction, consider the case when φ a does not equal φ B , but has a nearby value, so that U a is small. A single unit of elliptic transformation shifts α a by unity. Hence any given excitation about the specified black hole background can be regarded as a fluctuation characterized by α a with |α a | < 1. This puts the sum over the indefinite charge lattices squarely in the domain of the Göttsche-Zagier treatment in [30], as each component α a is the range 0 < |α a | < 1. Then, restricting to a two-dimensional lattice Γ 1,1 for simplicity, i.e. taking n = 3, the indefinite theta function based on (3.50) precisely does what was described above, namely, contributions that would lead to an increase of the exponential in (3.48) are removed from the sum in a Lorentz invariant manner [30]. We refer to appendices B and D of [11] for a brief review of this.
Next, using (2.14), we note that the regularized partition function (3.47) may also be written as where F E (φ a B , p a , S,S) denotes the free energy (2.10) in the presence of R 2 corrections, Note that in an N = 2 model, F (Y a , S) has the interpretation of a topological string free energy at weak topological string coupling. The exponent F E (φ a B , p a , S,S) describes the semi-classical free energy of a BPS black hole with charges q B a , while ϑ(∆; τ ) encodes the regulated contributions from the fluctuations V a = q a − q B a . As already mentioned, the choice of a reference background vector q B a satisfying ̺ B a C ab ̺ B b > 0 is arbitrary. Two different choices are related by an elliptic transformation of ϑ(∆; τ e ), as follows. Under the elliptic transformation ∆ → ∆ + λ τ e with λ ∈ Z n−1 , ϑ(∆; τ e ) transforms as ϑ(∆ + λ τ e ; τ e ) = e −2πiQ(λ)τe−2πiB(∆,λ) ϑ(∆; τ e ) . (3.53) Choosing two different reference background vectors q B 1 and q B 2 (both satisfying ̺ B a C ab ̺ B b > 0 at fixed magnetic charges), and denoting the associated values of ∆ by ∆ 1 and ∆ 2 , respectively, we implement the elliptic transformation ∆ 1 = ∆ 2 + λ τ e on ϑ(∆ 1 ; τ e ), with λ = q B 1 − q B 2 . This results in expression (3.47), with (q B 1 , φ B 1 ) replaced by (q B 2 , φ B 2 ). Thus, (3.47) is independent of the chosen background. Here we have assumed that the vectors c i which define ρ are independent of any background value.
Since (3.47) is background independent, we may remove any reference to the background q B by redefining the sum. Rewriting (3.47) into a sum over charges q a = q B a + V a , we obtain Z reg OSV (p, φ; µ) = e π |S| 2 S+S p a C ab p b +4πΩ(S,S) where ϑ(z e ; τ e ) denotes the indefinite theta function ϑ(z e ; τ e ) = q∈Z n−1 ρ(q + a; τ e ) e 2πiτeQe(q)+2πiB(ze,q) . (3.55) Here we decomposed z e as z e = aτ e + b (with a, b ∈ R n−1 ), resulting in Note that since the measure factorM projects onto configurations with ̺ a C ab ̺ b > 0, (3.54) has the interpretation of a sum over attractor backgrounds. The regulated sum (3.54) has φ a -shift symmetry. Namely, under shifts of φ a by φ a → φ a + 2i, we have C ab z e b → C ab z e b − 1, which leaves ϑ(z e ; τ e ) invariant.
Let us now comment on a subtlety. In the discussion below (3.50) we took φ a not to equal an attractor value φ a B . When φ a is taken to be on an attractor value (2.14), the components a a are integer valued and can be brought to zero by an appropriate elliptic transformation, as discussed above. In this case, the indefinite theta function (3.48) would vanish, unless we keep µ a = 0, so that ∆ a is non-vanishing. This subtlety was already noted in [11], and is the reason why in (3.54) we have refrained from setting µ a = 0 after the evaluation ofM ϑ(z e ; τ e ). Then, by applying the modular transformation τ → −1/τ (to be discussed below) we obtain a representation of the indefinite theta function with a a replaced by −b a = 1 2 C ab µ b . Choosing µ b so that 0 < |b a | < 1, we again obtain a set-up that is similar to the one described below (3.50).
Thus, by making use of a modular transformation we have related the regulated sum Z reg OSV to the free energy F E . The regularized partition function (3.62) takes the form of an exponential factor |e −2πiF | 2 , where F denotes the holomorphic topological free energy (3.52), times a measure factor and an indefinite theta function. If we artificially set n = 27, which corresponds to taking a model with 28 abelian gauge fields just as in the original N = 4 model, the powers of S +S cancel out in the measure factor [31], and we are left with the duality covariant differential operator (K + 4(S +S) 2 ∂ S ∂SΩ)/|Y 0 | 2 . This operator, when acting on e πF E , yields the duality covariant factor (K + 4(S +S) 2 ∂ S ∂SΩ)/|Y 0 | 2 , with K given in (2.30) and T a = −i(φ a + iµ a + ip a )/(2Y 0 ).

Summing over charges p a
Next, we turn to the black hole partition function (3.3), obtained by summing over charges p a as well. We take (3.38) as our starting point and consider summing over both q a and p a .
Here we face the problem that the dilatonic free energy F (0) D contains a term proportional to (S −S)q a p a that couples one type of charges to the other type. To avoid this coupling, we consider the case S =S in the following. This allows us to interpret the sum over q a as a sum over attractor values φ a * at fixed χ a * , and the sum over p a as sum over attractor values χ a * at fixed φ a * , using (2.14) and (2.15). We proceed as in the case of the regularized partition function (3.54). We first extend φ a and χ a to φ a +iµ a and χ a +iν a , respectively (with µ a , ν a ∈ R n−1 ). We convert the measure M in (3.42) into a differential operatorM , obtained by replacing T a by the differential operator (2.26). Then, taking (3.38) as a starting point, we obtain (3.63) Then, in analogy to (3.54), we define the regularized partition function, obtained by summing (3.63) over charges q a and p a (a = 2, . . . , n), by where ϑ(z e ; τ e ) and ϑ(z m ; τ m ) denote indefinite theta functions with We take both indefinite theta functions to be defined in terms of sign functions, as in (3.50). Observe that (3.64) is invariant under S → 1/S. It is also invariant under SO(1, n − 2; Z) T-duality transformations, as well as under shifts φ a → φ a + 2i and χ a → χ a + 2i. Applying the modular transformations (τ e , τ m ) → (−1/τ e , −1/τ m ) we obtain, in a manner analogous to (3.57), ϑ(z e ; τ e ) ϑ(z m ; τ m ) = 2 n−1 and where H (0) denotes the Hesse potential (2.13). Using this, we arrive at Z reg (φ I , χ a ; µ, ν) = 2 n−3M S 2 |Y 0 | 4 e πH(S,φ a +iµ a ,χa+iνa) ϑ(z e /τ e ; −1/τ e ) ϑ(z m /τ m ; −1/τ m ) , (3.68) where we introduced the Hesse potential H in the presence of higher-derivative corrections [3], H(S, φ a , χ a ) = H (0) (S, φ a , χ a ) + 4Ω(S Expanding (3.64) around (q B a , p a B ) is implemented by applying the following elliptic transformations to ϑ(z e ; τ e ) and ϑ(z m ; τ m ), where Using the transformation property (3.53) gives Here we decomposed Z = Aτ + B, so that In (3.73), the first line gives the contribution of the attractor background to the partition function, while the second line contains the contribution from fluctuations around it.
Observe that the final expression (3.73) is identical to what one obtains starting from the regularized OSV partition function (3.51), with S =S, multiplying it with e −πp a (χa+iνa) , summing over charges p a by resorting to the background expansion (3.70) and regularizing this sum. Thus, our proposal (3.64) for the regularized partition function is consistent with what one obtains by first regularizing the sum over q a , which results in (3.51), and subsequently summing over the charges p a and regularizing this sum in a similar manner. Note that our proposal (3.64) does not depend on any particular attractor background (φ B , χ B ).
Observe that the regularized partition function (3.64) only counts axion-free attractor backgrounds (2.14) and (2.15). We may extend this by implementing the S-duality transformation S → S + i and summing over all its images.
Finally, we note that the form of (3.64) is reminiscent of the proposal [32] for a background independent partition function for matrix models and topological strings.

Conclusions
We first defined an OSV partition function for single-center BPS black holes by restricting to those zeroes of Φ 10 that give rise to the dilatonic free energy F D of single-center BPS black holes. Within this approximation, we dealt with the divergences that arise when performing the sum over charges q a by first expanding around an attractor background, and then regularizing the sum over fluctuations V a around this background by removing contributions that are exponentially growing. This was achieved by converting the V a -sum into an indefinite theta function based on a regulator ρ constructed out of sign functions. The choice of the attractor background is arbitrary, and two different choices are related by an elliptic transformation of the indefinite theta function. We then used its modular properties to relate the regularized sum to the free energy F E which, in N = 2 compactifications, is relatd to the topological free energy at weak topological string coupling. Observe that the regulator ρ only preserves a subset of T-duality transformations, namely the one given by SO(1, n − 2; Z) transformations.
We then turned to a canonical partition function by also summing over charges p a . We set S =S in order to decouple the sums over q a and p a . We again regularized the sums using indefinite theta functions. We then used a modular transformation to relate the regularized canonical partition function to the Hesse potential H of supergravity. The regularized sum is invariant under the electric-magnetic duality transformation S → 1/S. Its form is reminiscent of the proposal [32] for a background independent partition function for matrix models and topological strings.
One subtlety that arises in our proposal is that if we choose φ a and/or χ a to be on an attractor value (2.14) and/or (2.15), the indefinite theta functions vanish unless we extend φ a , χ a to the complex plane, i.e. φ a → φ a + iµ a , χ a → χ a + iν a . Thus, our regularized partition functions depend on µ a , ν a .
We chose a regulator with good modular and elliptic transformation properties in order to be able to relate the regularized partition function to semi-classical results, and to ensure that the partition function is independent of the particular attractor background around which one chooses to expand it. We opted to work with indefinite theta functions based on sign functions, but other choices are, in principle, also possible [10,11].
Finally, we note that the computation of a Witten index in the presence of a continuous spectrum may yield a result [33,34,35] that is reminiscent of an indefinite theta function. Consider a supersymmetric one-dimensional quantum mechanics model with Hamiltonian H = p 2 + W 2 (x) − [ψ † , ψ] W ′ (x). This Hamiltonian describes a charged spin 1 2 particle moving in a potential W (x). Take W to have a solitonic form, i.e.
Upon imposing boundary conditions, an explicit computation of the Witten index in this model yields [33] where E denotes the error function. In the presence of superselection sectors labelled by γ, this generalizes to where we allowed for the presence of a topological term H top in the Hamiltonian [36]. Then, a judicious choice of both the asymptotics of the potential W γ ± and the topological Hamiltonian H γ top labeling the superselection sectors, gives an indefinite theta function.