The joy of factorization at large $N$: five-dimensional indices and AdS black holes

We discuss the large $N$ factorization properties of five-dimensional supersymmetric partition functions for CFT with a holographic dual. We consider partition functions on manifolds of the form $\mathcal{M}= \mathcal{M}_3 \times S^2_\epsilon$, where $\epsilon$ is an equivariant parameter for rotation. We show that, when $\mathcal{M}_3$ is a squashed three-sphere, the large $N$ partition functions can be obtained by gluing elementary blocks associated with simple physical quantities. The same is true for various observables of the theories on $\mathcal{M}_3=\Sigma_\mathfrak{g} \times S^1$, where $\Sigma_\mathfrak{g}$ is a Riemann surface of genus $\mathfrak{g}$, and, with a natural assumption on the form of the saddle point, also for the partition function, corresponding to either the topologically twisted index or a mixed one. This generalizes results in three and four dimensions and correctly reproduces the entropy of known black objects in AdS$_6 \times_{w} S^4$ and AdS$_7\times S^4$. We also provide the supersymmetric background and explicitly perform localization for the mixed index on $\Sigma_\mathfrak{g} \times S^1 \times S^2_\epsilon$, filling a gap in the literature.


Introduction
There has been recently a lot of progress in the microscopic derivation of the entropy of anti de Sitter (AdS) black holes, starting with the magnetically charged and topologically twisted ones in AdS 4 × S 7 [1] and followed by the Kerr-Newman (KN) black holes in AdS 5 ×S 5 [2][3][4]. This analysis has been extended to many other black objects in AdS d , with d = 4, 5, 6, 7 with different types of electromagnetic charges and rotations and with various amounts of supersymmetry. For a (partial) review, see [5]. A general entropy functional that captures the large N entropy of black holes and black strings in general AdS compactifications with a holographic dual was written in [6]. In this picture, the entropy functional is a sum of universal contributions called gravitational blocks, which can be related to some simple field theory quantity, either the central charge or the sphere-partition function of the dual conformal field theory (CFT). The proposal has been successfully tested for all known examples in maximally supersymmetric compactifications and in many other cases with less supersymmetry. The microscopic counting of states for black objects in AdS is usually done by a large N saddle point analysis of a supersymmetric index in the dual CFT. Black hole physics then suggests that, in the large N limit, the corresponding field theory partition functions should factorize and the CFT free energy where M is the Euclidean boundary of the black object, should be the sum of universal contributions associated to a geometric description of M as the gluing of elementary pieces. The form of the entropy functional in [6] was indeed suggested by the decomposition of the supersymmetric partition functions in holomorphic blocks [7]. 1 In this paper, we call this property large N factorization. For a more precise definition see below and the beginning of section 2. All recent field theory computations for black objects in AdS 4 and AdS 5 have confirmed the above picture. The factorization properties are particularly nontrivial when magnetic charges and rotation are simultaneously present, see for example [20] for rotating black strings in AdS 5 × S 5 , and [21] for a class of rotating black holes in AdS 4 .
In this paper we analyse the large N factorization properties of five-dimensional partition functions on various manifolds of the form M = M 3 × S 2 , where is an equivariant parameter for rotations along S 2 and a chemical potential for the angular momentum of the dual black hole. We will consider three examples. The first is the partition function on S 3 b × S 2 , with a squashing along S 3 and a topological twist along S 2 [22]. Although there is no associated dual black object, we expect factorization to hold nevertheless. The other two examples correspond to partition functions on (S 2 × S 1 ) × Σ g , with a topological twist along the genus g Riemann surface Σ g , and a different type of supersymmetry. When S 2 is twisted this is the (partially) refined five-dimensional topologicallly twisted index 1 The idea of "gluing" or "sewing" building blocks to compose field theory observables is old and it has been successfully used in many different contexts. See [8][9][10][11][12][13][14][15][16][17][18][19] for developments related to our context. discussed in [22,23]. The case where S 2 is not twisted corresponds to a mixed index, first considered in [24].
All these partition functions can be written, for genus 0, by gluing copies of the Nekrasov's partition functions [25], in the spirit of [8]. Since a proper derivation of the mixed index is lacking in the literature we provide it here, by identifying the supergravity background the five-dimensional field theory should be coupled to in order to preserve supersymmetry and by performing an explicit localization around this background.
For simplicity, we will focus on two specific field theories, the so-called E N f +1 Seiberg theory, the UV fixed point of a N = 1 USp(2N ) gauge theory coupled to N f fundamental hypermultiplets and an antisymmetric one [26], and the N = 2 SU(N ) super Yang-Mills (SYM) theory, which is supposed to flow at strong coupling to the six-dimensional N = (2, 0) theory of type A N −1 . The two theories are holographically dual to the warped AdS 6 × w S 4 solution in massive type IIA [27], and to AdS 7 × S 4 in M-theory, respectively. Black holes and black strings in these compactifications have been found in [28][29][30][31][32][33][34] and all the corresponding entropy functionals satisfy factorization. In this paper we investigate the factorization properties from the field theory point of view. We will verify that various quantum field theory observables can be written as a sum over two contributions associated with the two hemispheres of S 2 where ∆ i , i = 1, 2 are (constrained) chemical potentials for a U(1) flavor symmetry associated with a rotation on S 4 , t i are the corresponding (constrained) flavor magnetic fluxes on the sphere S 2 , and F has a natural interpretation in terms of the central charge/sphere partition function of the dual CFT. Factorization takes the simple form (1.2) only when written in terms of constrained variables. If there is a topological twist on S 2 , corresponding to dual magnetically charged and twisted black holes, we need to use the minus sign in (1.2) and the constraints 2 while, if S 2 is untwisted, corresponding to dyonic KN black holes, we need to use the plus sign in (1.2) and the constraints The expression (1.2) is clearly reminiscent of an equivariant localization formula.
In the various examples F is proportional to 3 where s i , normalized with s 1 + s 2 = 2 − 2g, are the magnetic fluxes through the Riemann surface Σ g . The quantities in the table have the following interpretations.
is the large N five-sphere free energy of the Seiberg theory in a convenient parameterization, see [35, (3.38)] and [36, (2.37)], and can be read off from the anomaly polynomial of the N = (2, 0) theory at large N , in a way that we will discuss. The expressions for (S 2 × S 1 ) × Σ g , on the other hand, can be interpreted as the S 3 partition function of the three-dimensional CFT obtained by compactifying the Seiberg theory on Σ g , and the trial central charge of the four-dimensional CFT obtained by compactifying the N = (2, 0) theory on Σ g , respectively.
A word of caution is in order. While the evaluation of the partition functions on S 3 b ×S 2 in the large N limit can be done with stardard methods, that for (S 2 × S 1 ) × Σ g is harder and we will not be able do it from first principles. For = 0, it was conjectured in [22,23] that the twisted index localizes at the critical points of an effective twisted superpotential W (S 2 ×S 1 )×R 2 , similarly to the three-dimensional case [1]. Under this working assumption, the entropy of static black objects in AdS 6 and AdS 7 was correctly reproduced [23,[30][31][32]. We will use the same logic here. A similar analysis for the twisted and mixed partition functions on (S 2 × S 1 ) × Σ g was first done in [24] for the Seiberg theory, with the somehow surprising conclusion that factorization holds only in the = 0 limit. This is in contradiction with the results for rotating twisted black objects that exhibit factorization [33,34] and we reconsider the problem here. As we will discuss in detail, the dependence of W (S 2 ×S 1 )×R 2 on gauge magnetic fluxes can be modified by contact terms for = 0. We will show that, both in the case of twisted and mixed index, there is a natural definition of an effective twisted superpotential W (S 2 ×S 1 )×R 2 for = 0 that leads to factorization. 4 If we assume that the partition functions localize at the critical points of W we find the free energy quoted above. As we will show, this result correctly reproduces the entropy of all known black objects in AdS 6 and AdS 7 . It would be nice to have a first principle derivation of log Z M that does not involve the assumptions made in [22][23][24].
One other interesting result of our analysis is that the on-shell superpotential W (S 2 ×S 1 )×R 2 itself factorizes with blocks given by (1.5) or (1.6). 5 Indeed, we have the interesting relation which is the five-dimensional generalization of the index theorem proved in [37,38]. The paper is organized as follows. In section 2, we will discuss general facts about factorization and compare results in different dimensions. This will also serve to fix notations and a common ground for the rest of the paper. In section 3, we discuss the partition function on S 3 b × S 2 and we show that it factorizes. In section 4 we discuss the refined topologically twisted index. We introduce various equivalent definitions of the effective twisted superpotential W (S 2 ×S 1 )×R 2 , and discuss the ambiguity in these definitions. We then show that, for a natural symmetric choice of W, its on-shell value is factorized. Moreover, we will verify that, if the partition function localizes at the critical points of W, it also has a factorized form. We will also show that this result correctly reproduces the entropy of the known rotating twisted black holes in massive IIA [34] and the density of states of black strings in AdS 7 × S 4 [33]. In section 5, we first write the rigid supergravity background for the mixed index, and then explicitly perform localization. Using the same assumptions as in section 4, we show that both the on-shell twisted superpotential and the partition function factorizes. We also verify that this result correctly reproduces the entropy of a class of KN black holes in massive IIA [34]. In section 6 we shed light on the relation between the on-shell W and log Z for the twisted and mixed index by proving the generalization of the index theorem discussed in [37]. We conclude in section 7 with a discussion and open problems.

Generalities about factorization
In this section we discuss some general facts about factorization in three dimensions, that we will use also in five dimensions.

The entropy functional
In the recent and successful approach to microscopic counting, the entropy of supersymmetric AdS black holes is obtained by extremizing the entropy functional where Q i are the electric charges and J a the angular momenta. Here, Z M (∆ i , a ) is a supersymmetric partition function on the compact manifold M that depends on a set of chemical potentials ∆ i and a conjugate to Q i and J a , respectively. Extra conserved charges of the black hole, for example magnetic charges, are encoded in the explicit form of the function Z M (∆ i , a ). The entropy functional (2.1) should be extremized with respect to ∆ i and a . This is the familiar fact that the entropy at zero temperature can be obtained by taking the Legendre transform of the partition function. For all known black holes in AdS, supersymmetry imposes a constraint among the electric charges and the angular momenta. There is a similar linear constraint on the magnetic charges, if present. It is however convenient to include all possible electric charges and angular momenta in (2.1) and perform a constrained extremization. In this picture, the variables ∆ i and a in (2.1) satisfy a linear constraint. This is consistent with the fact that supersymmetric indices can be only refined with fugacities for symmetries that commute with a particular supercharge and it allows for a complete field theory description. We could obviously solve explicitly the constraint and write the entropy functional in terms of independent variables. However, (2.1) takes a simple form only when written in terms of constrained variables. In particular, in all known cases, it is a homogeneous function of degree one of the constrained ∆ i and a .
For all known KN or topologically twisted black holes in maximally supersymmetric AdS compactifications, with or without magnetic charges or rotation, the function Z M (∆ i , a ) in (2.1) can be written as a sum of contributions from the gravitational blocks [6] log and each (σ) a is a linear combination of the rotational chemical potentials a while ∆ , where p i are magnetic fluxes through M. 6 Experimentally, σ runs over the elementary pieces into which the boundary manifold M is decomposed, in the factorization of the partition function in holomorphic blocks [7,16]. Each black hole corresponds to a different gluing. The function F(∆ i ) is instead universal, related to the prepotential or on-shell action of the relevant supergravity, or, more physically, to the large N limit of the central charge of the dual field theory, in the case of even-dimensional CFTs, or of the sphere free-energy for odd-dimensional ones, fully refined with respect to the global symmetries. For the maximal supersymmetric compactifications, F(∆) is proportional to the values given in table 1. Table 1: The structure of the block for the AdS backgrounds with maximal allowed supersymmetry in each dimension. AdS 6 × w S 4 is the background dual to the USp(2N ) five-dimensional theory considered in this paper [26,27]. The chemical potentials ∆ i are associated with the Cartan of the internal sphere isometry in all dimensions.
Let us look at an example which will be also useful in the future. Consider rotating four-dimensional black holes with a spherical horizon. We can decompose the sphere into two hemispheres. We then use the A-gluing for topologically twisted black holes associated with constraints of the form 5) and the identity gluing (id -gluing) associated with constraints of the form for KN ones, including dyonic ones. The chemical potentials ∆ i are conjugate to the U(1) 4 ⊂ SO(8) isometry for AdS 4 × S 7 and to a basis of U(1) symmetries R i in which we can decompose the general R-symmetry of the model viewed as a generic N = 2 theory. The constraints on magnetic charges are dictated by supersymmetry: the R-symmetry magnetic flux must be 2 for the topological twist and zero for KN black holes. There are two cases where the entropy functional simplifies. The first is the case of KN black holes in AdS d , d = 4, 5, 6, 7 with no magnetic charges. The corresponding entropy functional for the maximal supersymmetric compactifications has been written in [44][45][46]. With zero magnetic fluxes, the gluing formula degenerates and the entropy functional is the sum of equal contributions, hiding the factorization properties. These become manifest for dyonic black holes [6,47].
The second is the case of black objects topologically twisted on S 2 but with zero angular momentum on the sphere. The solution depends on magnetic fluxes s i on S 2 normalized as i s i = 2. We assume that the boundary manifold M = N × S 2 factorizes into two blocks of the form N ×D 2 , where the disks D 2 correspond to the two hemispheres. Here, we have = 0. We can still use the A-gluing defined above, and send to zero at the end of the computation. We obtain This is indeed the general structure of the unrefined topologically twisted index at large N in a variety of situations [1,23,37,38]. The sphere S 2 can be replaced with a Riemann surface Σ g of genus g with no major changes and the only difference that now integer fluxes are normalized as In the interesting case where the compactification of the original CFT on the Riemann surface Σ g becomes conformal in the IR, 7 (2.8) will express the large N sphere partition function/central charge of the lower-dimensional CFT in terms of those of the higherdimensional one. This relation is for example satisfied for the large N sphere partition function of the twisted compactification Σ g of the E N f +1 Seiberg theory [23,48]. It is also a general relation between the large N central charges of theories related by twisted compactifications, as it can be easily proved by integrating the anomaly polynomial on Σ g [23,38,49].
The factorization properties are really nontrivial when magnetic charges and rotation are simultaneously present. We will focus on this case in the following and in the rest of the paper.

Factorization in field theory
The gravitational block picture is expected to be a consequence of analogous factorization properties of the quantum field theory observables. Let us consider first three dimensions. Most of the three-dimensional supersymmetric partition functions, and in particular the topologically twisted index and the superconformal one, can be written by gluing two holomorphic blocks B(a, ∆, ) according to the formula [7] Z(∆, ) = da B(a (1) , ∆ (1) , (1) )B(a (2) , ∆ (2) , (2) ) , (2.10) where a (σ) , σ = 1, 2, are gauge fugacities. Another useful expression is [7,16] Z(∆, ) = α B α (∆ (1) , (1) )B α (∆ (2) , (2) ) , (2.11) where α labels a choice of Bethe vacuum for the two-dimensional theory obtained by reducing the theory on a circle and B α (∆, ) = da B(a, ∆, ) is a suitable contour integral passing through the Bethe vacuum a α . In applications to holography, we typically work in a saddle point approximation where one particular Bethe vacuum dominates the sum (2.11) [1]. We then expect some form of factorization also at large N . In a slightly different but equivalent context, the explicit analysis has been performed in [21] confirming factorization in the form discussed in the previous section for the topologically twisted index, the superconformal one, and the sphere partition function, and exploring various relations among all these quantities. 8 To understand the form of (2.3) for generic rotation and magnetic charges, it is convenient to expand the holomorphic blocks in the limit of small . In this limit, the holomorphic blocks are singular (see e.g. [7, (2.22)] and [18, (F.15) where W(a, ∆) is the effective twisted superpotential of the two-dimensional theory and the Bethe vacua a α are its critical points. An important point is that, at large N , the on-shell twisted superpotential W(a α , ∆) is related to the S 3 free energy [21,37,38], 9 and the explicit form of the gravitational block (2.3) follows from (2.11). It might seem that this argument holds only in the strict limit → 0, while in reality (2.3) and the associated factorization are valid also for = 0. However, a careful analysis shows that, at large N , the subleading terms in (2.12) vanish except for the first one, whose only role is to enforce the form of the gluing and the constraint among chemical potentials. A similar situation holds in other dimensions, including five, as we will see. Analogous results hold for the refined topologically twisted index in four dimensions, which can be obtained by gluing two copies of T 2 × D 2 . The index for N = 4 SYM captures the density of states of rotating black strings in AdS 5 × S 5 and it has be shown to factorize both in gravity and field theory in [6,20]. The field theory computation has been done by explicitly evaluating the partition function, but the same result would be obtained using the arguments in [21]. For future reference, let us notice that computation for black strings are usually done in the Cardy limit where the modular parameter τ of the torus T 2 is small. In this limit the on-shell twisted superpotential of the two-dimensional theory becomes proportional to the trial central charge of the four-dimensional CFT [38], (2.13) in agreement with the general discussion. The Cardy limit on T 2 is appropriate for studying the physics of the black holes obtained by compactifying the string on a circle, and leads to the charged Cardy formula [33]. We will encounter a similar setting in section 4.3.2.
For recent results at finite τ see [53].
In five dimensions, the holomorphic blocks B(a, ∆, 1 , 2 ) are given by the K-theoretic Nekrasov's instanton partition function on R 2 1 × R 2 2 × S 1 [25,54,55]. The two chemical potentials 1 and 2 are equivariant parameters for the rotations on R 4 and are conjugate to the two possibile angular momenta for black holes in AdS 6 and black strings in AdS 7 . All the partition functions we will consider can be written in a similar form to (2.10) by gluing Nekrasov's partition functions [19,[22][23][24]. There are many similarities with three and four dimensions. The role of the twisted superpotential is played by the Seiberg-Witten prepotential F SW (a, ∆) and the expansion of the holomorphic block is given by [25] Analogy with lower dimensions motivated the conjecture made in [22,23] that the (unrefined) five-dimensional partition functions localize at the critical point of F SW (a, ∆). The on-shell value of the Seiberg-Witten prepotential for both the Seiberg theory and the N = (2, 0) theory has ben computed in [22,23] and are proportional to the S 5 free energy (1.5) and the anomaly coefficient (1.6), respectively. All these analogies suggest that factorization holds with the blocks given in table 1. Unfortunately, decompositions similar to (2.11), which would help in setting these statements on a firmer ground, are not fully understood in five dimensions. We will try to attack directly the five-dimensional matrix models.
3 Factorization of the S 3 b × S 2 partition function We are interested in evaluating the partition function of five-dimensional N = 1 gauge theories on S 3 b ×S 2 in the limits that are appropriate for holography. Here b is the squashing parameter of the three-sphere and is an Ω-deformation on the twisted two-sphere. We label the (gauge, flavor) fluxes on S 2 by (n, t), respectively. Following [22], for an N = 1 gauge theory with gauge group G, I hypermultiplets in a representation ⊕(R I ⊕R I ) of the gauge group, and vanishing Chern-Simons contributions, we can write down the refined perturbative part of the partition function as (see App. A) 10 where the exponent F S 3 b ×S 2 is given by (3.2) Here, α are the roots of the gauge group, ρ, ν denote the weights of the hypermultiplets under the gauge and flavor symmetry groups, respectively, and |W | is the order of the Weyl group of G. Moreover, g YM is the Yang-Mills coupling constant and x = e ia . Finally, S 2 (z|b) is the double sine function defined by and Before moving forward, let us note the following asymptotic relation for the logarithm of the double sine function, see [56,App. A], 11 that becomes useful when we study the large N limit of the S 3 b × S 2 partition function. Note also that, for a ∈ iR, sign(B) The full partition function on S 3 b × S 2 is a sum over instantonic contributions. In the large N limit, instantons are suppressed and we can restrict to the perturbative part of the partition function given above. 10 One can switch between the conventions used here and those of [22] by setting g there 5 = 1 2 g YM , g there = 0, u there = −iQa, ν there = −iQ(1 − ∆), and m there − r there + 1 = n + t − 1. 11 Recall that sign(0) = 0.

USp(2N ) gauge theory with matter
Let us consider an N = 1 USp(2N ) gauge theory coupled to N f hypermultiplets in the fundamental representation and one hypermultiplet A in the antisymmetric representation of USp(2N ) [26]. The global symmetry of the theory is SU(2) R ×SU(2) A ×SO(2N f )×U(1) I where the first factor is the R-symmetry while the other three factors are flavor symmetries: SU(2) A acts on A as a doublet, SO(2N f ) rotates the fundamental hypermultiplets, and U(1) I is the topological symmetry associated to the conserved instanton number current j = * Tr(F ∧ F ). The global symmetry is enhanced to SU(2) R × SU(2) A × E N f +1 at the UV fixed point [26]. The theory arises on the intersection of N D4-branes and N f D8branes and orientifold planes, and is holographically dual to the AdS 6 × w S 4 background of massive type IIA supergravity [27] (see also [57][58][59]). The partition function on S 3 b × S 2 =0 at large N was computed in [22] and scales as O(N 5/2 ). Here we are interested in the dependence on and the factorization properties.
Denote the Cartan elements of USp(2N ) by a i , i = 1, . . . , N , and normalize the weights of the fundamental representation of USp(2N ) to be ±e i . The antisymmetric representation then has weights ±e i ± e j with i > j and N − 1 zero weights, and the roots are ±e i ± e j with i > j (V 1 ) as well as ±2e i (V 2 ). Vector and hypermultiplets then contribute to the with B K = n + t K − 1. Here, the index K labels all the matter fields in the theory and we introduced the notation Notice that the vector multiplet contribution is equal to minus the contribution of a hypermultiplet with ∆ K = 2 and t K = 2.
As we will see, the dependence on ∆ f is subleading at large N and we will be interested in the chemical potential ∆ m and the flux t m for the Cartan subgroup of SU(2) A . As mentioned in the introduction, the free energy will take a nice form when written in terms of constrained variables. We then define (3.11) Observe that the last term in F A+V 1 is of order O(N ) in the large N limit and, given the expected N 5/2 scaling of the free energy, subleading. We will also make a few assumptions regarding the gauge variables that are true for the solution at = 0 [22] and that we will verify afterwards. Assuming that | Im a i | scales with some positive power of N , and using (3.5) and (3.6), we obtain 12 (3.12) For the ease of notation, we defined a ij ≡ a i − a j , a + ij ≡ a i + a j and the same for the gauge fluxes n i . Because of the Weyl reflections of the USp(2N ) group, we restrict to Im a i > 0. Assuming also that the eigenvalues are ordered by increasing imaginary part, i.e. Im a i > Im a j for i > j, and using Similarly, the contribution of F F +V 2 to the large N free energy can be computed using (3.5) and (3.6). It is natural to assume that a i and n i scale with the same positive power of N . Then, neglecting lower powers of a i and n i that are subleading, we find (3.15) 12 We do not include subleading terms in the rest of this calculation.
Under the same hypothesis also the classical term is subleading, see (3.2). Putting (3.14) and (3.15) together we get the final expression for the F S 3 b ×S 2 functional (3.16) that remarkably can be recast in the following form where we used the A-gluing parameterization Here, F SW is the Seiberg-Witten prepotential of the four-dimensional theory obtained by compactifying the five-dimensional N = 1 theory on S 1 and it receives contributions from all the Kaluza-Klein (KK) modes on S 1 [60]. In the large N limit, it reads [23, (3.67)], Extremizing (3.16) over the gauge variables (a k , n k ), we find the saddle point equations and (3.21) Observe that (3.20) and (3.21) are equivalent to for σ = 1, 2. We see that bothå k andn k scale as N 1/2 and are purely imaginary for generic values of the parameters. Plugging the saddle points (å k ,n k ) back into the partition function (3.1) we can write down the large N version of the S 3 b × S 2 free energy as with F S 5 (∆ i ) being the free energy of the theory on S 5 , In the limit → 0, our expression for the refined free energy (3.23) reduces to which agrees with [22, (3.17)] upon the following change of variables

N = 2 super Yang-Mills
Consider five-dimensional N = 2 super Yang-Mills with gauge group SU(N ). In N = 1 notations, the theory contains one vector multiplet and one hypermultiplet transforming in the adjoint representation of the gauge group. We introduce a fugacity ∆ and a flux t associated with the flavor symmetry acting on the hypermultiplet. We are interested in evaluating the S 3 b × S 2 free energy in the 't Hooft limit with where F(a) is given in (3.9) and a ij ≡ a i − a j . As before, the vector multiplet contribution is equal to minus the contribution of the hypermultiplet with ∆ = 2 and t = 2.
In the strong 't Hooft coupling λ 1 the eigenvalues are pushed apart, i.e. | Im a ij | → ∞, and (3.29), using (3.5), can be approximated as (3.31) where we introduced, as before, a set of constrained variables (3.32) Assuming that the eigenvalues are ordered by increasing imaginary part, using (3.13), we obtain (3.33) Remarkably, this can be recast as where we used the A-gluing parameterization and the effective Seiberg-Witten prepotential, in the strong 't Hooft coupling limit, is given by [23, (3.20)] Extremizing (3.33) over the gauge variables (a k , n k ), we find the saddle points (3.37) Notice that (3.37) is equivalent to for σ = 1, 2. Plugging (å k ,n k ) back into the partition function (3.1) we can write down the S 3 b × S 2 free energy as that can be more elegantly rewritten in the factorized form with blocks associated with the function (1.6). Note that In the limit → 0, our expression for the refined free energy agrees with [22, (4.74)].
Bethe approach. The S 3 b × S 2 free energy (3.33) is linear in the gauge magnetic fluxes n k so one can explicitly perform the sum n∈Γ h in (3.1), where the sum is over all solutionså to the Bethe ansatz equations (BAEs) 13 Here, W S 3 b ×R 2 (a k ; ∆, |b) is the "quantum corrected" effective twisted superpotential of the theory on S 3 b × R 2 and it reads The solution to the BAEs (3.44) is simply given bẙ Plugging the solution (3.46) back into the twisted superpotential (3.45) and the partition function (3.43) we find, respectively, in agreement with (3.39).
|b) and the 4d central charge. The N = 2 SU(N ) SYM theory is supposed to flow at strong coupling to the six-dimensional N = (2, 0) theory of type A N −1 . The eight-form anomaly polynomial of the N = (2, 0) theory at large N is given by where p 2 (R) = e 2 1 e 2 2 is the second Pontryagin class of the SO(5) R-symmetry bundle, with e σ , σ = 1, 2, being the Chern roots. Notice that the chemical potentials ∆ 1 and ∆ 2 are naturally associated with the Cartan of SO(5) and the block function (1.6) is formally obtained by replacing e 1 → ∆ 1 and e 2 → ∆ 2 in the anomaly polynomial. The compactification of the 6d (2, 0) theory on a topologically twisted S 2 gives rise to a class of four-dimensional N = 1 CFTs [61]. The theories are specified by the internal flux t and have an additional global symmetry associated with the U(1) rotational isometry of S 2 and conjugated to the equivariant parameter . We can read off the conformal anomaly coefficient a(∆, t, ) of the four-dimensional N = 1 theory by integrating A 6d on an Ωdeformed S 2 . The integration can be done most conveniently by the localization formula [33,Sect. 3

.3.2] and it yields
where c 1 (F ) is the first Chern class of the 4d R-symmetry bundle and c 1 (J) is the first Chern class of the background U(1) gauge field coupled to the rotation of S 2 . Setting c 1 (J) = c 1 (F ) and comparing (3.49) with the six-form anomaly polynomial, at large N , we find the trial a central charge of the 4d N = 1 theory Remarkably, we observe the following large N relation between the S 3 b × S 2 free energy (3.39) and the a central charge (3.51)

Refined topologically twisted index
We now consider the partition functions on (S 2 × S 1 ) × Σ g , with a topological twist both along the genus g Riemann surface Σ g and on S 2 . We also turn on an Ω-background along S 2 with equivariant parameter . This corresponds to the (partially) refined fivedimensional topologically twisted index introduced in [22,23]. The index depends on fugacities y and fluxes (s, t) on (Σ g , S 2 ) for the flavor symmetries. Setting the possible Chern-Simons levels to zero, the perturbative part of the matrix model reads [23] Z(m, n, a; s, t, , where (m, n) and (s, t) are the gauge and flavor magnetic fluxes on (Σ g , S 2 ), respectively; x = e ia , y = e i∆ , and ζ = e i /2 . We have also defined Here, W (S 2 ×S 1 )×R 2 is the effective twisted superpotential of the two-dimensional theory obtained by compactifying the 5d N = 1 theory on S 2 × S 1 (with infinitely many KK modes). In particular, the contribution of a hypermultiplet to the twisted superpotential W (S 2 ×S 1 )×R 2 can be written as 3) where, in the spirit of [62,63], we have resummed the one-loop contribution of the KK modes on S 1 and included the |B 2 | zero-modes on S 2 , decomposed according to their charges under the U(1) isometry of the sphere. In order to comply with the regularization scheme used in (4.1), we add local parity terms [23], so that the total contribution of a hypermultiplet to the twisted superpotential can be written as for 0 < Re(a) < 2π. In particular, The right-hand side of (4.5) is extended by periodicity to arbitrary values of Re(a). In the range −2π < Re(a) < 0, we need to use The contribution of a vector multiplet can be obtained via Putting together W H and W V , and adding the classical Yang-Mills contribution, we can write down the complete effective twisted superpotential as follows .
(4.9) Finally, in studying the large N limit of the topologically twisted index (4.1) we shall use the following formulae for the asymptotic behavior of the polylogarithms where 0 < Re(a + ∆) < 2π, 14 and In the following, we will give two independent interpretations of the twisted superpotential (4.9). They can be used as alternative definitions and we have checked that both yield (4.9).
(i) Bethe approach. It is easy to see that the twisted superpotential (4.9) appears in the partition function as 15 Resumming the gauge magnetic fluxes m on the Riemann surface, we obtain a set of poles at the Bethe vacua, the critical pointså of the twisted superpotential. We still need to perform a sum over the gauge fluxes on S 2 . It was conjectured in [23,24] that the partition function localizes at the solutions to the generalized BAEs. In our case, these take the form 16 In comparison to the Bethe approach for the three-and four-dimensional indices, see for example [1,18,38,[63][64][65], the equation in the second line of (4.13) is a new feature of the five-dimensional indices, where we have two sets of physical gauge magnetic fluxes. The relation (4.12) can be used as a working definition of W (S 2 ×S 1 )×R 2 . Notice, however, that this definition is inherently ambiguous. We can always add to W (S 2 ×S 1 )×R 2 a function that depends on n but not on a and (4.12) would be still true. For example, precisely for this reason, our twisted superpotential differs from the one used in [24] in a similar context.
The twisted superpotential of the two-dimensional effective theory obtained by reducing the five-dimensional theory on the Ω-deformed copy of R 2 × S 1 is then defined as [66] where where, for completeness, we also included a Chern-Simon term with level k. Here, we defined the double (p, t)-factorial as The second equation is the natural generalization to = 0 of the condition ∂FSW ∂a = ∂W ∂n used in [23]. 17 The partition function can be also derived using localization [22] and the result differs from the one given here in the regularization scheme. Various parity prescriptions start differing at order O( 2 ) with constant terms or terms proportional to g 1 (a). In the theories considered in this paper these differences cancel after gluing when you sum over positive and negative weights or lead to irrelevant constant terms. where x = e ia , y = e i∆ , p = e −i 1 and t = e −i 2 . Moreover, Z P V C 2 ×S 1 and Z P H C 2 ×S 1 denote the parity contributions (4.18) The classical contribution to the effective twisted superpotential (4.14), using (4.16), thus reads Next, we can write the following asymptotic expansion for the contribution of a vector multiplet to the twisted superpotential (4.14) and B s = 1, − 1 2 , 1 6 , 0, − 1 30 , 0, . . . is the sth Bernoulli number. The contribution of a hypermultiplet to the twisted superpotential (4.14), as → 0, is similarly given by Finally, the effective twisted superpotential of the two-dimensional theory obtained by compactifying the five-dimensional N = 1 theory on S 2 × S 1 is constructed via gluing two copies of W (R 2 ×S 1 )×R 2 (a; ∆, ) according to the A-gluing 18 Explicitly, up to irrelevant constant terms, One can check indeed that with B α 2 and B ρ 2 given in (4.2). In writing (4.26) we used that, as → 0, and . (4.28) We thus find agreement between (4.9) and (4.25) up to an irrelevant constant term and linear terms in n that cancel after summing over positive and negative roots and weights for all the theories in this paper.
On a final note, we observe that the consistency between the gluing and the Bethe approach to the definition of the twisted superpotential is a consequence of the fact that the topologically twisted index itself can be obtained by gluing copies of the Nekrasov partition function [23].

W (S 2 ×S 1 )×R 2 and its factorization
In this section, we consider the twisted superpotential W (S 2 ×S 1 )×R 2 as a function of both the gauge variables a and the fluxes n, and study its critical points, or, in other words, the solutions to the generalized BAEs. We will show that the on-shell twisted superpotential factorizes into contributions coming from the North pole and the South pole of the twosphere S 2 . The poles of the sphere are the two fixed points of the rotational symmetry and we will see that to each fixed point we can associate a block B 5 (∆, ). We consider the usual two examples (i) N = 1 USp(2N ) gauge theory with matter. In this case, we find that is the free energy of the theory on S 5 that depends on constrained parameters ∆ 1,2 for the SU(2) A × SU(2) R symmetry.
(ii) N = 2 SYM that decompactifies to the N = (2, 0) theory of type A N −1 in six dimensions. The block in this case is given by being the anomaly coefficient of the 6d (2, 0) theory that depends on the constrained parameters ∆ 1,2 for the U(1) 2 ⊂ SO(5) R-symmetry.
It is interesting to observe that a form of factorization holds for the off-shell twisted superpotential, even before extremization.

USp(2N ) gauge theory with matter
The effective twisted superpotential has the same structure as (3.7) and we only need to replace F ∆ k , t K (a), see (3.9), with We refine the partition function with fugacities ∆ m and fluxes (s m , t m ) for the SU(2) A symmetry acting on the antisymmetric hypermultiplet. Similarly to section 3.1, we assume that | Im a i | and | Im n i | scale with some positive power of N and that the eigenvalues a i are ordered by increasing imaginary part. We also define (4.32) Consider first the following contribution Using (4.10), we obtain (4.34) The above equation can be simplified further by performing the product over in (4.34), using (4.11). Employing the constrained chemical potentials ∆ i and fluxes t i , i = 1, 2 (we also give the definition of the constrained fluxes s i on Σ g for future reference), we can write (4.36) The contribution of can be found similarly. It reads (4.38) Combining (4.36) and (4.38), and using (3.13), we find The contribution of W F +V 2 (S 2 ×S 1 )×R 2 to the large N twisted superpotential can be computed similarly, using (4.10) and (4.11). Neglecting lower powers of a i and n i that are subleading, we get Under the same assumption also the classical term in (4.9) is subleading. Putting (4.39) and (4.40) together we can finally write down the complete twisted superpotential (4.41) that can be more elegantly put in the form (4.42) using the A-gluing parameterization with F SW (a k ; ∆ i ) being the effective Seiberg-Witten prepotential evaluated in the large N limit [23, (3.67 Extremizing (4.41) over the gauge variables (a k , n k ), we find the solution to the generalized BAEs and (4.46) Notice that (4.45) and (4.46) are equivalent to for σ = 1, 2. Plugging the saddle points (å k ,n k ) back into the twisted superpotential (4.41) we obtain with F S 5 (∆ i ) being the free energy of the theory on S 5 , In the limit → 0, our expression for the refined twisted superpotential (4.48) reduces to which matches the expression in [23, (3.88)].
W (S 2 ×S 1 )×R 2 and the free energy on S 3 b × S 2 . Comparing (3.16) with (4.41) we find the following remarkable relations (4.51)

N = 2 super Yang-Mills
The twisted superpotential of the theory reads with and W(a) given in (4.31). Note that In the strong 't Hooft coupling λ 1, (4.52) can be approximated as (4.55) where we used (4.10) to substitute the Li 2 (e i(a+∆) ) with g 2 (a + ∆) as | Im a ij | → ∞ and we defined Let us introduce the following democratic parameterization for the U(1 (4.57) Then, performing the product over in (4.64), using (4.11), we can simplify (4.64) to Assuming that the eigenvalues are ordered by increasing imaginary part, using (3.13), we obtain (4.59) that, using the A-gluing parameterization (4.43), can be more elegantly put in the form where the effective Seiberg-Witten prepotential evaluated in the large N limit [23, (3.67)] reads 20 Extremizing (4.59) over the gauge variables (a k , n k ), we find the solution to the generalized BAEså Notice that (4.62) is equivalent to for σ = 1, 2. Substituting (å k ,n k ) into the twisted superpotential (4.59) we find that can be more elegantly recast in the factorized form In the → 0 limit, (4.65) matches [23, (3.30)].

Factorization of the index
In this section we discuss the factorization properties of the refined twisted index. As we already discussed, we will make the assumption that the partition function localizes at the solutions to the generalized BAEs given in (4.13) [23,24]. We will see that this assumption leads to the factorization of the index and the correct entropy for a class of dual black holes and black strings. 21 We want to factorize log Z (S 2 ×S 1 )×Σg into contributions coming from the North pole and the South pole of the two-sphere S 2 . We will see that to each fixed point we can associate a block B 3 (∆, s, ). As before, we consider two theories, i) N = 1 USp(2N ) gauge theory for which we find Here, F S 3 ×Σg (∆, s), see (4.75), is the free energy of the theory on S 3 × Σ g that depends on a set of twisted masses ∆ and background magnetic fluxes s for the flavor symmetry.
ii) N = 2 SYM for which we find where a(∆, s), see (4.90), is the trial central charge of the four-dimensional theory obtained via compactifying the 6d (2, 0) theory on Σ g with the mixing parameter ∆ and the flavor flux s.
The relation between the blocks for the index, (4.67) and (4.68), and the blocks for the twisted superpotential, (4.29) and (4.30), is simply and consequently

USp(2N ) gauge theory with matter
The refined twisted index in the large N limit does not depend explicitly on the refinement parameter since and it simply reads [23, (3.104 Substituting the saddle points (å k ,n k ), see (4.45) and (4.46), into (4.73) we find 74) with F S 3 ×Σg (∆ i , s i ) being the free energy of the theory on S 3 × Σ g [22], 22 Black holes microstates in AdS 2 × S 2 × Σ g . The refined topologically twisted index (4.74) is expected to reproduce the Bekenstein-Hawking entropy of a class of rotating dyonic black holes in AdS 6 in massive type IIA supergravity whose near horizon geometry is a fibration of AdS 2 over the twisted space S 2 × Σ g . Unfortunately, the most general 22 We can compare with (3.26), valid for genus zero. To have a round S 3 , we should set Q = 1. Recall that the flavor flux through the Ω-deformed S 2 was called t i in (3.26) and now, for the Riemann surface Σ g , should be renamed to s i with 2 i=2 s i = 2 − 2g. Also, ∆ i should be rescaled by a factor of π. black holes are still to be constructed and the only known example [34, Sect. 6.3.1] was found, using gauged supergravity of class F in four dimensions, when the fluxes through the Riemann surface, using the notations of [34], are constrained as follows The above choice leaves us with g > 1. In [34] the magnetic fluxes along the S 2 were denoted by p i , i = 1, 2, satisfying the twisting condition 78) and the angular momentum by J . Then, the Bekenstein-Hawking entropy reads (4.79) The above entropy can be obtained by extremizing the Legendre transform of the refined index, i.e.
with respect to the chemical potentials (∆ 1 , ∆ 2 , ) and the Lagrange multiplier Λ, that enforces the constraint 2 with F S 5 being the exact free energy of the N = 1 USp(2N ) gauge theory on S 5 [69] Then, the extrema of (4.80) are given bẙ (4.83) Plugging (4.83) back into the I-functional (4.80) we find where we used the identification [34, (7.15)] along with the standard AdS 6 /CFT 5 dictionary

N = 2 super Yang-Mills
The refined twisted index in the strong 't Hooft coupling limit λ 1 does not depend explicitly on the refinement parameter , see (4.71), and it is simply given by [23, (3.37 Substituting the saddle points (å k ,n k ), see (4.62), in the above expression we obtain (4.91) 23 We can also compare with (3.51), valid for genus zero. We should set = 0 in (3.51), rename t i as s i and enforce 2 i=1 s i = 2 − 2g for a generic Riemann surface. Also, ∆ i should be rescaled by a factor of π.
Charged Cardy formula. The refined topologically twisted index (4.89) is expected to reproduce the density of states of a class of rotating dyonic black strings in AdS 7 × S 4 in M-theory whose near horizon geometry is a fibration of AdS 3 over the twisted space S 2 × Σ g . A class of such strings have been constructed in [33] wherein it was also shown that the gravitational density of states 24 matches the charged Cardy formula for the dual CFT 2 . We now show that the same result can be derived from (4.89).
We interpret our index as the partition function of the 6d N = (2, 0) A N −1 theory on S 2 × Σ g × S 1 × S 1 (6) , where S 1 (6) is the extra circle opening up at strong coupling. The modulus τ of the torus T 2 = S 1 × S 1 is identified with the gauge coupling constant of the five-dimensional theory. The refined topologically twisted index itself can then be identified with the elliptic genus of the twodimensional CFT obtained by compactifying the 6d (2, 0) theory on S 2 × Σ g . The large N index (4.89) can be rewritten as The number of supersymmetric ground states d micro is thus given by the Fourier transform of (4.93) with respect to (τ, ∆, ), with β ≡ −2πiτ and the corresponding integration is over the imaginary axis. In a saddle point approximation, the number of supersymmetric ground states can obtained by extremizing  Here, we introduced the complex Lagrange multiplier Λ that imposes the constraint (4.57) among the chemical potentials and two independent electric charges. As mentioned in section 2, BPS black objects in AdS have constraints among the charges. For all the known entropy functionals, the constraint arises by requiring that the entropy is real. We will then fix the relation among the charges by requiring that (4.96) is a real positive quantity, and we will see later that this is consistent with the gravity dual. The extrema of the I-functional (4.95) read where we defined, for the ease of notation, We will take˚ to be purely imaginary. 25 Thus, for d micro to be real we need Luckily, this is precisely the constraint among charges for the dual black strings in [33]. The physical interpretation of the constraint is that the black string has zero R-charge, as discussed in [33]. Finally, the microscopic degeneracy of states can be put in the following form are, respectively, the exact central charge, the level of the rotational symmetry, and the flavor symmetry level of the two-dimensional (0, 2) CFT.

A mixed index on (S
The mixed index on (S 2 × S 1 ) × Σ g was first written down in [24] by gluing Nekrasov's partition functions. In this section, we describe the supersymmetric background for the CFT partition function, and we recover the result using supersymmetric localization. We begin by describing the rigid 5d N = 1 supergravity background, with topology S 2 × S 1 × Σ g , on which the CFT lives. The metric on S 2 × S 1 will be such that the S 2 is metrically fibered over the S 1 , corresponding to angular momentum. The background is the same as the 3d background which can be used to compute the three-dimensional superconformal index. We will use a topological twist on Σ g , so that the metric on Σ g is irrelevant, except for g = 0 where another angular momentum can be introduced when the metric admits a continuous isometry. After reduction on the time circle, this type of angular momentum is equivalent to an Ω-background. Our metric, spinor, and supergravity conventions are mostly as in [23]. Spinor conventions are collected in appendix C.1, and supersymmetry conventions in appendix C.2. Note that all of the spacetimes we consider are spin, and we therefore do not need to introduce Spin C bundles. The gravity side of the holography, in the case under consideration, consists of black hole solutions of 6d matter coupled F (4) gauged supergravity. The ordinary F (4) gauged supergravity, introduced by Romans in [71], was considered in the context of holography in [72]. Therein, the boundary supergravity, which is coupled to a 5d N = 1 superconformal theory, can be described using the ordinary Weyl multiplet of 5d superconformal tensor calculus [73][74][75][76], described for instance in [77]. There are hardly any remnants, on the boundary, of the complexities of the transformations in Romans supergravity. According to [72], we can identify the boundary metric, SU(2) R gauge field, and antisymmetric tensor directly with asymptotic values of the bulk supergravity. These are the fields which are turned on for the simplest black hole solutions. More complicated solutions come from the matter coupled supergravity. The boundary theory in that case is coupled to the Weyl multiplet plus additional background vector multiplets. The conditions for preserving supersymmetry in the boundary CFT are best derived by looking at the Weyl multiplet first, and adding the matter multiplets on top.

Rigid supergravity background
A rigid bosonic supersymmetric background is a fixed point of the supersymmetry transformation of the Weyl multiplet [78][79][80]. We will follow the description of the Weyl multiplet given in [77], translated into the notation of [23] using appendix C.2. The relevant supergravity fields are the vielbein e µ a , the antisymmetric tensor T ab , and an SU(2) R-symmetry gauge field A (R) µ . 26 The supersymmetry transformation of the gravitino in the Weyl multiplet reads so that the antisymmetric tensor field of [72] can be identified with the one used in our Weyl multiplet as The identification of the other fields is equally straightforward. We will describe in detail a solution to the equation δψ µ = 0 corresponding to a manifold with topology (S 2 × S 1 ) × S 2 , where a topological twist will be applied to the second S 2 factor. The solution is simple to derive by considering an ansatz whereby the Killing spinor is the product of the ones for the 3d superconformal index, and a constant spinor on the twisted S 2 . More general manifolds, with topology (S 2 × S 1 ) × Σ g for g ≥ 1, can be included by simply changing the factor sin η in the metric, see (5.5), to 1, in the case of g = 1, or to sinh η in the case of g ≥ 2. When g = 1, Σ g is a torus, i.e. a quotient of R 2 , and the supergravity fields and equations are independent of its coordinates. When g ≥ 2, the Riemann surface Σ g is a quotient of the hyperbolic plane, and we can solve the gravitino equations by considering those on (S 2 × S 1 ) × H 2 and noting that the Killing spinor is independent of the coordinates of H 2 . The definition of the twisted fields, and other aspects of localization considered below, are mostly independent of g. However, when considering a compact Σ g with g ≥ 1, one should turn off the Ω-deformation parameter 2 , since such a manifold does not admit a continuous isometry with fixed points.
The background for g = 0. We choose the following vielbein on (S 2 θ,φ × S 1 τ ) × S 2 η,ϕ e 1 = rdθ , e 2 = r sin θ (dφ − β˜ 1 dτ ) , e 5 = βdτ , The real geometric parameters˜ 1,2 correspond to the real part of the angular momentum fugacities when the partition function on this background is viewed as an index. We also take an R-symmetry connection corresponding to a partial twist on both the sphere and the part of the spin connection related to the angular momentum on the twisted sphere, proportional to˜ 2 . Lastly, we turn on the antisymmetric tensor field T Observe that T is covariantly constant. One may check that the Killing spinor equation δψ µ = 0, see (5.1), is satisfied for ξ of the form described below, and that the vanishing of the variation of the dilatino is likewise guaranteed as long as one sets the supergravity field D to the value 27 (5.8) This background actually preserves 2 supercharges of the type covered by our ansatz. In the limit˜ 1 → 0, the number of supercharges is further enhanced to 4. The same is true for g ≥ 2 with the appropriate change of vielbein and with˜ 2 → 0. For g = 1, the amount of supersymmetry is double that of g = 1 in every scenario.
The superalgebra. We choose a specific Killing spinor, which in the notation of appendix C.1 takes the form 28 We define δ to be the supersymmetry transformation associated with ξ. The superalgebra generated by δ contains a number of bosonic transformations: 1. An infinitesimal diffeomorphism with parameter iv, where 2. An infinitesimal R-symmetry transformation given by the matrix such that ξ transforms as ξ → ξΛ T . (5.12)

A gauge transformation which depends on the field realization.
One can explicitly check that there is no Weyl transformation, nor conformal isometries, present in the square of the supersymmetry preserved on this background. This is a necessary, but not sufficient, condition for using localization. Note that the condition (C.14) cannot be solved for the pair ξ,ξ, hence the background considered here is not reachable from the gauge fixed supergravity used in [82][83][84][85]. For continuity with [23], we will nevertheless continue to use the notation from [82] for the matter fields.

Localization
We would like to perform localization for an arbitrary N = 1 theory on the background described above. We will describe first the moduli space arising from such localization. This space is by definition the vanishing locus for the supersymmetry transformations of all the fermions in the theory. However, the fields living in hypermultiplets, assuming that they have generic masses coming from background flavor multiplets, will not contribute any moduli. We therefore examine here the moduli coming from the vector multiplets, which are the configurations for which the transformation of the gaugino vanishes.
The supersymmetry transformation of the gaugino reads One can show that the following configuration solves the BPS equation δλ = 0 where m and n are constants taking values in the magnetic weight lattice of G. They correspond to fluxes for dynamical or background gauge fields. The BPS configuration also implicitly includes a flat G connection commuting with m and n which, given the topology of the space, can be taken to be a spacetime independent profile for A τ . 29 For generic m, n, this flat connection is in the same Cartan subalgebra as m and n . We henceforth work with the Cartan subalgebra defined by the above BPS configurations. These define the Note also, that unlike the situation in [23] the Cartan elements of σ (0) are fixed by the value of the fluxes, and do not define a separate non-compact direction of the Coulomb branch moduli space. The BPS configurations include D 12 ∝ m, and therefore do not satisfy the original reality conditions for the field D IJ . Instead, convergence of the path integral with a measure defined by the classical action of the gauge theory sets D 12 to be purely imaginary, or at least to have a bounded real part, if one makes the standard rotation from Lorentz signature [23]. Configurations with auxiliary fields not satisfying the original reality conditions are common in solutions to the BPS equations of twisted gauge theories [14,23,64]. One can try to explain their appearance by considering a δ-exact mixing term between an auxiliary field and a dynamical scalar. Adding this term, and integrating over the original contour, effectively sets the auxiliary field to a complex value in the BPS equation. The need to add such a mixing term, in the context of localization, is usually attributed to the existence of fermionic zero modes [86], or more generally to the need to lift some of the moduli [87]. In some cases, they can also be understood from the point of view of the effective low energy theory [88], where they represent a breakdown of localization associated with contributions from the boundary of field space. We do not have a good understanding of the arguments for the necessity of including these configurations as they apply to the situation at hand. However, the consistency of the calculation implies that they should be included.

Twisted fields
To examine the moduli space more closely, and to deduce the one loop exact effective action, it is convenient to define twisted fields. Our definition of these fields is very similar to the one given in [85], although the non-pseudo-Majorana nature of our Killing spinor prevents us from using the expressions in that work directly.
Vector multiplets. We first define the spinor bilinears κ a ≡ξγ a ξ , s ≡ξξ . Note that the scalar s vanishes on a great circle in the untwisted S 2 , the equator with respect to the fixed points of v, that κ a κ a = s 2 , and that at the poles s = ±1 and κ a = δ a 5 .
The vanishing of s means that the localization here is not of the type examined in [85] or in [23]. We define the following operators acting on a 2-form Ξ but that the decomposition is a complex one. We now define the following twisted fields Ψ a ≡ξ I γ a λ I , 19) and the auxiliary field H ab ≡ 2s 2 F −ab + s 2 − 1 F V ab + 2sξ I γ ab ξ J D IJ + 6siξ I γ ab ξ I σ + iσ (κ ∧ ds) ab . (5.20) One can show that the change of variables from λ to Ψ a and χ ab is nonsingular, even at the equator. One can also verify that the following projections hold There is a perhaps more natural change of variables, and definition of (anti)self-duality, for the fermions which makes χ horizontal only at the poles and also either self-dual or antiself dual depending on which pole. In the end, it makes no difference for the localization computation.
After the change of variables, we get the following supersymmetry transformations for the twisted fields We can compare these expressions to the ones for either the twisted backgrounds of [23], or the contact type backgrounds of [85]. The only difference is the appearance of powers of s. Had s been not just nowhere vanishing but actually constant, as was the case for both [23] and [85], we would recover the full set of twisted fields defined in those papers. 30 As in [23], we define a ≡ −iΦ (0) = a flat .

(5.23)
Hypermultiplets. The off-shell closed hypermultiplet introduced in appendix C.2 can be twisted in the same manner as the vector multiplet. We define The operator P F is a Hermitian spin projector which selects half of the components of the spinor ψ. It is chosen so as to have rank 2, to annihilate ξ I P F ξ I = 0 , for I = 1, 2 , (5. 25) and to be invariant under δ 2 , i.e. L κ P F = 0 .
The precise form of P F then determines the spinor F in terms of F I and some expression linear in q I . In our chosen coordinates and vielbein, we can take (5.26) 30 Note thatξ, which is related to the field t IJ of [85], vanishes for the twisted backgrounds of [23].
The properties of P F guarantee that the action of δ 2 on the twisted fields is uniform, and of course coincides with the one on the vector multiplet. P F can also be written in the convenient form P F = 1 2 (κ a γ a + s1 4 ) γ 5 , (5.27) generalizing the expression for the hypermultiplet projections in [85].

Localizing terms
We can form a localizing term for the vector multiplet using the twisted fields as in [23] δV The second term in (5.28) is positive semi-definite and vanishes only at This equation is indeed compatible with the Coulomb branch moduli space (5.14). The imaginary part implies that sσ is the moment map for the action of the imaginary part of κ with respect to the symplectic form F , which in turn implies that σ is constant. The real part implies that A τ is a moment map for the real part of κ with respect to the same symplectic form. 31 Had ξ satisfied the symplectic Majorana condition (C.9), the expressionξ I γ ab ξ I D IJ would be real and hence H ab would be integrated over a shifted real contour. The first term in (5.28) would then yield a Lagrange multiplier imposing the real constraint F + = 0 . As it stands, however, ξ does not satisfy the symplectic Majorana condition,ξ I γ ab ξ J D IJ is not real, and it is not clear whether the first term in (5.28) can be used as a localizing term. Specifically, the contour over which H should be integrated needs to be somehow invented. Instead of finding the correct contour, we can consider the standard localizing term δV gauge alt. ≡ √ g Tr λ I (δλ) * I . (5.30) This term vanishes on the moduli space by construction. The localizing term for the hypermultiplets is simply the analogue of the one used in [23]

Fluctuations
We would like to compute the effective action for the supersymmetric moduli of (5.14), which is given by a one loop calculation. We will do this using a mixture of the equivariant index theorem for transversally elliptic operators, and the results of Nekrasov [25] on the local contributions to such an index from a neighborhood of a fixed circle for the equivariant action modeled on C 2 × S 1 .
Vector multiplets. We will use the standard background gauge µ is the covariant derivative with respect to a background connection leading to (5.14). Specifically, it is a connection which itself satisfies the gauge condition ∇ µ a (0) µ = 0 . Such a representative is guaranteed to exist. We fix the gauge by adding a term to the action given by We would like to verify that the relevant operator coming from V is transversally elliptic. According to [89,90], the relevant operator is D oe ⊂ V, which is defined as the order zero term acting between the fields ϕ e and ϕ o . In our case ϕ e = a µ , while ϕ o = {χ, c,c}, where c,c are the ghost and anti-ghost in the gauge fixing multiplet [89]. We find D oe by expressing λ in V as the unique linear combination of χ and Ψ derived above. We then expand V around the forms in the non-coordinate basis: a a , χ ab , c,c. We denote the corresponding momenta by p a . We find that the (leading) matrix symbol of D oe is given by 32 The top 6 rows correspond to χ ab , row 7 to c, and row 8 toc. One can clearly see that the rows {4, 5, 6} are multiples of the rows {1, 2, 3}. This is the reflection of the fact that χ ab is actually constrained, and has only 3 degrees of freedom. We choose to remove the rows {4, 5, 6}, and to call the remaining 5 × 5 matrix the matrix symbol of D oe , denoted σ (D oe ). We can now evaluate the determinant of σ (D oe ). It is given by Note that the singular factor of s −6 is an artifact of the coordinate system and our definition of the twisted fermions and plays no physical role.
In order to check transversal ellipticity, we must verify that det σ (D oe ) is nonzero on the part of the tangent space which is orthogonal to the equivariant action. This is equivalent to evaluating the simultaneous vanishing locus of det σ (D oe ) and of One can easily see that this locus is p = 0, independent of the value of −1 ≤ s ≤ 1, and hence the symbol is transversally elliptic. Note that det σ (D oe ) is not transversally elliptic with respect to the equivariant action on the time circle alone, since the term (p 2 1 + p 2 3 + p 2 4 + s 2 p 2 2 ) can vanish when p 1 = p 3 = p 4 = s = 0 with p 2 arbitrary. This is the result of having an untwisted S 2 . In the fully twisted case considered in [23], the corresponding operator is elliptic once the time circle is taken into account, i.e. once p 5 is removed.
Comparing with the expressions in [89], we see that σ (D oe ) coincides with the standard self-dual complex on S 2 × S 2 at s = −1, θ = 0, and with the anti-self-dual complex at s = 1, θ = π, extended along the 5 th direction.
Hypermultiplets. The symbol for the hypermultiplet localizing term (5.31 tensored with Ω AB , where we have taken care to project the 5d Dirac operator onto the space of ϕ e , spanned by q and hence by ξ J , and to the conjugate space of ϕ o spanned by ψ F and hence byξ I . We can now evaluate (5.38) At s = ±1, this is equivalent to the symbol for the 4d Dirac operator, acting between S + and S − , and its complex conjugate. S ± are the positive and negative chirality spin bundles of a four-manifold. Clearly, σ(D hyper oe ) is transversally elliptic with respect to κ. It is not, however, transversally elliptic with respect to the equivariant action on the time circle alone, for the same reasons as the symbol for the vector multiplet analyzed above. Again, this is the result of having an untwisted S 2 .

Derivation of the partition function
Here, we set β = r 2 = 1. Given the facts in the previous section, it is reasonable to expect that a theory on this background localizes onto the instanton/anti-instanton complex at the fixed points. We therefore expect to get a contribution from the fixed points which is the same as in the twisted case, from the north pole of the untwisted S 2 , and the complex conjugate contribution at the south pole. We must integrate these contributions along the continuous modulus coming from the flat connection. Note that there is no continuous modulus coming from the vev of σ, since this is fixed by the moment map equation (5.29). The modulus a is therefore integrated over a shifted real contour. We must also sum over the localized instantons/anti-instantons and over the two sets of fluxes m, n.
When evaluating the partition function on our spaces, using either Nekrasov's instanton partition function or the equivariant index theorem, the effective values of the real part of the angular momentum parameters at the north and south poles of the untwisted two-sphere have a relative minus sign. 33 Define the following complex angular momentum parameter is the plus or minus real geometric parameter˜ 1 , and s N/S takes the values ∓1 when the point in question is localized at the north and south poles of the untwisted sphere, respectively. The linear combinations N/S 1 are all that ever appear in the calculation, whether as parameters of the equivariant action, or as coefficients multiplying the flux n. We henceforth work only with this combination, and denote There is no analogous shift for˜ 2 , which we now rename to 2 . For the case of g = 0, we can simply make use of the 5d Nekrasov partition function to compute the partition function. The conjecture in [8] implies that the full result can be written as a sum over equivariant fluxes and an integral over a of 4 copies of the 5d Nekrasov partition function associated to the 4 fixed points. We have derived the fact that the partition function actually depends on only two fluxes: m, n which correspond to the homology two cycles of the spacetime manifold. We therefore write the result as (5.41) We choose a parametrization of these fluxes which is suited to the present context. In this parametrization, the parameters a (l) in the fully twisted case would be given by 34 The fixed point data is given in table table 2. 35 The points 1, 2 lie at the north pole of the untwisted sphere, and 3, 4 at the south pole.

33˜
1 is the coefficient of the rotation with respect to φ, which rotates the local frame at the north and south poles in opposite directions. 34 The factors of 1/2 have been inserted in order to match the quantization conditions on m, n with the expression given in terms of the parameters p l (cf. [23,Sect. 2.7.2]). 35 The fixed point data given in [23] is adapted to a general toric geometry. We prefer to use a simpler table for the specific manifold considered here.  The perturbative part of the Nekrasov partition function can be calculated using the equivariant index theorem for transversally elliptic operators. There is an important subtlety in using the equivariant index theorem in the situation where the symbol is only transversally elliptic and not elliptic. One must be careful about how to expand the infinite sum in the index in order to translate it into a determinant [89]. A derivation for the specific case of the superconformal index was performed in [91]. The prescription used in [91], which recovers the result for the superconformal index computed by counting operators, is that half of the effective a (l) , associated to the south pole of the sphere, should be multiplied by an overall −1 (cf. [91, (5.15)-(5.17)]). Adopting this approach, we change the sign of a and Taking the data from table 2, we get the following set of parameters For hypermultiplets, we can introduce background holonomies corresponding to fugacities ∆. In addition to the overall sign change noted above, there is a shift of the origin of ∆ [23]. This shift was first discussed in [92]. The relevant shift in the purely twisted case was a uniform shift, which with our conventions for i is (5. 44) In the case at hand, where the sign of ∆, like that of a, changes between the north and south poles, it is better to think of the shift as a shift of the overall parameter. Combining with the result for the vectors, we get the following In standard conventions, the origin of flavor fluxes s, t would also be at 0. However, we use conventions in which the background fluxes for the universal twist are at s = 1 − g. For g = 0 we therefore take s below to be the flavor flux on the twisted sphere plus one. Taking the data from table 2, we get the following set of parameters For the cases g ≥ 1 one does not have isolated fixed points. Instead, the fixed loci of the action of v are copies of Σ g . The partition function on these spaces can be computed from the two different perspectives, leading to the same result. We consider the situation with g arbitrary and therefore set 2 to 0.

The perturbative partition function
We are interested primarily in determining the partition function in the large N limit, hence we assume that we can safely ignore non-perturbative contributions. The remaining elements of the localization calculation are the classical and one loop pieces.
The classical piece. The classical action on the current background is different from the one indicated in [23]. As in [23], the part of the action containing hypermultiplets will not contribute a classical term because there are no moduli in this sector of the theory. A superconformal action for vector multiplets was constructed in [76]. The action depends on a totally symmetric tensor C ABC and vector multiplets V A . In order to construct a Yang-Mills-like action for a dynamical vector multiplet, one of the V A should be taken to be a background abelian multiplet fixed to a supersymmetric configuration. Such a configuration necessarily breaks conformal symmetry. 36 For the time being, we reinstate β, r, r 2 . 36 One may also construct topological Chern-Simons terms which preserve conformal symmetry.
The bosonic action for abelian V A , translated into our field variables and with an overall normalization which matches that of [23], is given by [76] (5.47) We will choose the index A to run from 1 to 2, with V 2 the dynamical vector multiplet and V 1 a background vector multiplet. We also choose the following symmetric tensor In order to get a Yang-Mills like term, we set the following background configuration for V 1 with all other fields vanishing. In order to get the normalization for the Yang-Mills term used in [23], we will take C = 2r/g 2 YM . It is now straightforward to evaluate the classical contribution to the partition function, by replacing both the supergravity fields and the dynamical vector multiplet fields with their background values. The result is Tr(ma) . Secondly, note that due to the periodicity of a, see (5.15), the classical term is not gauge invariant under large gauge transformations. This is already apparent at the level of the 5d Nekrasov partition function. The issue did not come up in the fully twisted case, described in [23], because the classical contributions had a different structure. There are at least two possibilities to avoid this. For theories with 5d fixed points, g YM must be taken to ∞ before evaluating the partition function in order to flow to the conformal fixed point. The calculation at intermediate values of g YM is presumably ill defined. For theories with a 6d fixed point, on the other hand, it is not completely clear what six-dimensional observable we are computing, and other details of the 6d physics might come to rescue.
Another possibility is that the classical part of the action is always ambiguous because, as is the case for non-conformal theories in 4d, its coefficient can be changed by changing the scale which is introduced in computing the one-loop contribution.
The one loop piece. It should be the case that the one loop determinant can be constructed from the determinants used in the superconformal index, i.e. the partition function on S 2 × S 1 , raised to an appropriate power, which stems from the degeneracy of zero energy modes on Σ g . An explanation for this assertion is as follows. The one loop contribution can be computed using the equivariant index theorem. In the situation at hand, where the fixed loci with respect to the action of the symmetry generator are not points but copies of Σ g , the relevant index theorem is a hybrid of the equivariant index theorem for the case of discrete fixed points, and the usual Atiyah-Singer index theorem applied to the fixed loci. The two contributions should be multiplied to get the result on the product space. 38 This applies directly to the index for the twisted Dirac operator, while the index for the AHS (instanton) deformation complex reduces to the twisted de Rahm complex at the fixed loci. The result of the calculation with the AS index theorem is simply a number, which we associate with the degeneracy. Hence, the result of the one loop calculation is the one stemming from the equivariant index theorem on S 2 ×S 1 , raised to the power of the degeneracy.
The relevant fluctuation operators for computing the degeneracy can be easily extracted by evaluating the symbols σ (D oe ) and σ(D hyper oe ) near the fixed points of the untwisted sphere and restricting to momenta along the twisted directions only. The degeneracy can then be computed using the ordinary index theorem for the relevant complex. For a line bundle of degree d on a Riemann surface of genus g, the Atiyah-Singer index theorem yields d + 1 − g for the twisted Dolbeault complex, which controls the hypermultiplets. A hypermultiplet valued in a weight ρ of the dynamical gauge group and a weight ν of the flavor symmetry group therefore has degeneracy (cf. [14]) − ρ(m) − ν(s) + g − 1 . (5.51) The overall minus sign comes from the opposite grading of the Dirac and Dolbeault complexes. The origin for the flavor fluxes is at 2g − 2, and the shifted expression is The vector multiplet is controlled by a twisted version of the de Rahm complex, which is again related to the Dolbeault complex and yields the same result (c.f. [14]). The degeneracy for a mode proportional to a root α reads α (m) + 1 − g . (5.53) We must also specify the R-charge of the chirals appearing in the superconformal index. To do this, we compare the square of the supercharge used to localized the SCI with th eone used here. The ratio of the 1 dependent term between the derivative with respect to φ and the R-symmetry transformation acting on q 1 is −2. In the context of the SCI, where the eigenvalue with respect to said derivative is usually denoted j 3 , the ratio is −2/∆, where ∆ is both the R-charge and the Weyl weight of the bottom component of a chiral superfield (cf. [91, (5.14)]). Evidently, we should set ∆ to 1. Vector multiplets can also be treated as chiral multiplets for the purposes of constructing the partition function. This is because a chiral multiplet of R-charge 0 can get a vev and Higgs a vector multiplet, yielding an empty theory in the IR. It also holds that the product of the one loop determinants of chiral multiplets with R-charges ∆ and 2 − ∆ is 1 [94]. the vector multiplet may therefore be treated as a chiral multiplet with R-charge 2.
Fermionic zero modes. One must still deal with the fermion zero modes which are the superpartners of the holonomies on Σ g . This can presumably be done using the approach described in e.g. [64], but the details are more complicated in the 5d context. We will rely on the 2d result.

The final formula
We are ready to write the partition function. The result was first derived in [24] by gluing Nekrasov partition functions. We set in the following. As already mentioned, in our conventions for the background fluxes, the universal twist [29] corresponds to s = 1 − g. One could also set the background fluxes on the untwisted two-sphere to zero, t = 0, however, it is vital to keep nonzero. Finally, we define The mixed index can be written as [24] Z(m, n, a; s, t, Bρ I , (5.56) with x = e ia , y = e i∆ , ζ = e i /2 , and W (S 2 ×S 1 )×R 2 (a, n; ) denoting the effective twisted superpotential of the five-dimensional N = 1 theory on (S 2 × S 1 ) × R 2 , whose expression is the subject of the next section.
For g = 0, the partition function can be obtained by gluing the Nekrasov partition function (4.15) using the rules discussed in section 5.3 and sending 2 to zero [24]. The appearance of the determinant of the effective twisted superpotential for g = 0 is discussed in section 5.4. As noticed in section 5.3.1, the one-loop contributions are obtained by raising one-loop determinants of the partition function on S 2 × S 1 , the generalized superconformal index, to integer powers, B α and B ρ , counting the number of zero-modes on the twisted Σ g . The one-loop contribution of a chiral multiplet of R-charge r K to the three-dimensional superconformal index reads [94,95] log where y K = e i∆ K and t K denote the flavor fugacity and magnetic flux, respectively. Setting r K = 1 and y K = y, t K = t we recognize the contributions of the hypermultiplets in (5.56), while setting r K = 2 and ∆ K = 2π, t K = 0 we recognize the contributions of the vector multiplets. Finally, the gluing procedure produces a classical term which is manifestly holomorphic in 1 and coincides with (5.50) when 1 is purely imaginary. As already discussed in section 5.3.1, the role of the classical term, which is not gauge invariant, is not completely clear to us. In any event, it will only contribute to the partition function of the N = 2 super Yang-Mills theory whose interpretation as a six-dimensional index has yet to be clarified.

W (S 2 ×S 1 )×R 2 and its factorization
In this section we derive the effective twisted superpotential of the two-dimensional theory obtained by compactifying a five-dimensional N = 1 theory on S 2 × S 1 .
(i) Gluing W (S 2 ×S 1 )×R 2 . The two-sphere S 2 is not twisted. We shall use the gluing procedure that was detailed in section 4.1. For this purpose, we employ the identity gluing that follows from the rules given in section 5.3 when 2 = 0 We can then write 39 (2) ; ∆ (2) , (2) ) , (5.59) where W (R 2 ×S 1 )×R 2 is given in (4.19)-(4.23). 39 The relative minus follows from the relative minus for a in the identity gluing and the fact that W appears with a derivative in the partition function, see (5.64).
Explicitly, the classical Yang-Mills contribution to the effective twisted superpotential is given by Next, the contribution of a hypermultiplet to the twisted superpotential, in an expansion around → 0, reads where w s (a, n; ∆, t, r) ≡ g s (π(r − n − t)]) Li 3−s (e i(a+∆) ) + i 3−s 2 g 3−s (a + ∆) with g s (a) defined in (4.5). 40 Observe that g s (a) = 0 for s < 0. The contribution of a vector multiplet is simply given by (ii) Bethe approach. Alternatively, the twisted superpotential appears in the mixed index as 41 m k ∂W (S 2 ×S 1 )×R 2 (a, n; ) ∂a k Z int m=0 (a, n; ) , (5.64) where Z int is the integrand in (5.56), as a direct computation shows.
Performing the sum over the gauge magnetic fluxes m through the Riemann surface in (5.64), we find a set of poleså at the Bethe vacua. It remains to evaluate the sum over the gauge fluxes n on S 2 . At this stage, we assume that the mixed index localizes at the solutions to the generalized BAEs (5.65) 40 Note that the sign of Re(a + ∆) is opposite in the two terms in (5.59) and we need to shift accordingly the functions g s (a) in (4.19)-(4.23). 41 We dropped the dependence on the flavor parameters (∆, s, t) to avoid clutter.

USp(2N ) gauge theory with matter
We will now evaluate the effective twisted superpotential of the USp(2N ) theory with matter in the large N limit. The result will take a simple form using a democratic basis for the flavor chemical potential ∆ m and the fluxes (s, t) The effective twisted superpotential has the same structure as (3.7) and we only need to replace F ∆ k , t K (a), see (3.9), with with w s (a, n; ∆ K , t K , r) given in (5.62). Let us start with the W A+V 1 (S 2 ×S 1 )×R 2 contribution. Using (4.10), and assuming that | Im a i | → ∞, we obtain Assuming also that the eigenvalues are ordered by increasing imaginary part, i.e. a i > a j for i > j, and using (3.13), we can simplify (5.68) further and write The contribution W F +V 2 (S 2 ×S 1 )×R 2 to the twisted superpotential at large N can be computed similarly using (4.10) and it is given by Putting (5.69) and (5.70) together we obtain the final expression for the twisted superpotential W (S 2 ×S 1 )×R 2 , 71) that can be recast in the following factorized form , (5.72) with F SW (a k ; ∆ i ) given in (4.44), using the identity gluing parameterization The Bethe solution can be obtained by extremizing (5.71) with respect to the gauge variables (a k , n k ). We find and (5.75) Observe that (5.74) and (5.75) are equivalent to for σ = 1, 2. Note that we use the determination 0 < ∆ i ∓ 2 t i < 2π, i = 1, 2. Plugging the saddle points (å k ,n k ) back into the twisted superpotential (5.71) we obtain with F S 5 (∆ i ) being, in form, the free energy of the theory on S 5 ,

N = 2 super Yang-Mills
For N = 2 super Yang-Mills we find a dependence on the non-gauge invariant classical term (5.50), whose interpretation is not clear. It is nevertheless instructive to check that the twisted superpotential factorizes. Define the democratic basis for the chemical potential ∆ i and the fluxes (s i , t i ), associated to the U(1) 2 ⊂ SO(5) R-symmetry The twisted superpotential of the theory reads and W ∆, t, r (a) given in (5.67). In the strong 't Hooft coupling λ 1, assuming that | Im(a i − a j )| → ∞, (5.80) can be approximated as, using (4.10), (4∆ 1 ∆ 2 + 2 t 1 t 2 )a ij + 2 (∆ 1 t 2 + ∆ 2 t 1 )n ij sign(Im a ij ) .
(5.82) Assuming that the eigenvalues are ordered by increasing imaginary part, we can trade the N i,j=1 with N k=1 using (3.13) to write that, using the identity gluing parameterization (5.73), can be recast in the following factorized form , (5.84) with F SW (a k ; ∆ i ) given in (4.61). We extremize (5.83) over the gauge variables (a k , n k ) to obtain the solutionå for σ = 1, 2. Substituting these values into (5.83) we find Remarkably, this can be recast in the following factorized form (5.88)

Factorization of the index
In this section we will make the assumption that the mixed index localizes at the solutions to the generalized BAEs (5.65). Given (5.64), up to subleading constant factors, the saddle point contribution to the index is given by We will show that this expression factorizes, 42 and leads to the correct entropy for a class of dual black holes in massive type IIA. Moreover, as for the twisted index, we find While the mixed index for the Seiberg theory correctly reproduces the entropy of black holes in massive type IIA, it is not clear what is the interpretation of the mixed index of N = 2 super Yang-Mills in terms of the six-dimensional UV fixed point and we are not aware of dual backgrounds where to test the large N result, which, as already mentioned, explicitly depends on the existence of a non-gauge invariant classical term (5.50). It is however interesting to observe that the result factorizes, as expected.

USp(2N ) gauge theory with matter
We are interested in evaluating the mixed index (5.89) of the USp(2N ) gauge theory in the large N limit. To this aim, let us first consider the building block Z(a, m, n; ∆, s, t, ) = (xyζ r−n−t ; where x = e ia , y = e i∆ , ζ = e i /2 . From (5.64) and the form of W in terms of (5.62), we can immediately write down the following asymptotic expansion log Z(a, m, n; ∆, s, t, ) = (m + s + g − 1) with g s (a) defined in (4.5). Note that g s (a) = 0 for s < 0. Then, Z int m=0 (a i , n i ; ∆ K , s K , t K , ) in (5.89) can be written as 95) Here, we introduced the function log Z ∆ K , s K , t K , r (a) = (s K + g − 1) ∞ s=0 (i ) s−1 (2π) s v s (a, n; ∆ K , t K , r) , as → 0 .
(5.96) Again, the index K labels all the matter fields in the theory and we used the notation The only piece that survives the large N limit is given by Assuming that the eigenvalues are ordered by increasing imaginary part and using (3.13), we can simplify (5.98) further and write 101) where F S 3 ×Σg (∆ i , s i ) is the free energy of the theory on S 3 × Σ g , see (4.75). Recall that Black holes microstates in AdS 2 × S 2 × Σ g . In the following we show that the mixed index (5.101) gives a statistical derivation of the entropy of Kerr-Newman black holes found in [34, Sect. 6.3.2 and 6.3.4]. The near horizon geometry is AdS 2 × S 2 × Σ g . The class of black holes we consider is a two-parameter family of solutions and was found by specializing the magnetic fluxes along the Riemann surface to (in the notations of [34]) This choice leads to a compact Riemann surface Σ g>1 and vanishing magnetic charges along the S 2 . The Bekenstein-Hawking entropy reads with the following constraint among the conserved charges J = ( 72q 2 (q 1 + 3q 2 ) + 1 − 1) 2 2(q 1 + 3q 2 ) 72q 2 (q 1 + 3q 2 ) + 1 + q 1 − 3q 2 6 72q 2 (q 1 + 3q 2 ) + 1 − 1 − 6(q 1 + 3q 2 )(q 1 + 9q 2 ) . (5.105) Note that the limit J → 0 is singular and these black holes are always rotating. We shall extremize the I-functional for t = 0 106) with respect to the chemical potentials (∆ 1 , ∆ 2 , ) and the Lagrange multiplier Λ, enforcing the constraint ∆ 1 + ∆ 2 = 2π + , to obtain Assuming that the charges and the entropy 2πΛ are real we can break (5.108) into two equations (5.109) Solving the first equation gives us, using (5.107), Using also the standard AdS 6 /CFT 5 dictionary (4.86) we find that (Q 1 , Q 2 , J) = S BH (q 1 , q 2 , J ) .
For completeness, we note that, in the special case t = 0, both our results and those in [24], which uses a different twisted superpotential for the conjectured BAEs, coincide. The differences show up for t = 0, where our expression for the index factorizes while the one in [24] does not. To fully test holographically the two sets of different results we would need a Kerr-Newman black hole solution in massive type IIA with non-vanishing magnetic charges. We are not aware of any such solution in the literature and it would be interesting to find one.

N = 2 super Yang-Mills
In the strong 't Hooft coupling limit λ 1, we need to evaluate 114) with log Z ∆, s, t, r (a) given in (5.96). Employing the asymptotic formula (4.10) and assuming that the eigenvalues are ordered by increasing imaginary part, using (3.13), we find where a(∆, s) is the trial central charge of the four-dimensional theory obtained by compactifying the 6d (2, 0) theory of type A N −1 on Σ g , and is given in (4.90). Recall that 6 An index theorem for the twisted and mixed matrix models As we have seen in sections 4.3 and 5.5, the large N partition functions on (S 2 × S 1 ) × Σ g satisfy the relation where s i , with 2 i=1 s i = 2 − 2g, are the magnetic fluxes on Σ g and ∆ i the chemical potentials for global symmetries. This is a five-dimensional generalization of the index theorem for the topologically twisted index discussed and proved for a large class of threeand four-dimensional gauge theories in [37,38]. 43 We have used constrained variables throughout this paper. This is convenient because the entropy functional is then a homogeneous function of degree one in ∆ i and . The on-shell values of log Z (S 2 ×S 1 )×Σg and W are also homogeneous functions. When written in terms of general chemical potentials and fluxes, (6.1) takes the form where, to avoid clutter in the notations, we have suppressed the reference to the manifold, and we have generalized the formula to the case of an arbitrary number of global symmetries. This clearly reduces to (6.1) when W is a homogeneous function of ∆ i and of degree two, as it is the case in this paper. It is worth noticing that, due to the particular form of the differential operator appearing on the right hand side, (6.2) is parameterization invariant and it can be used both for constrained and unconstrained variables. Indeed, it is a very simple exercise to check that, for the twisted index, we obtain the same result for (6.2) computed using W(∆ 1 , ∆ 2 , ) and constrained variables ∆ 1 + ∆ 2 = 2π and s 1 + s 2 = 2 − 2g or, solving the constraint first, and using W unc (∆, ) ≡ W(∆, 2π − ∆, ) and independent variables ∆ ≡ ∆ 1 and s ≡ s 1 . Similarly, for the mixed index, we could use W(∆ 1 , ∆ 2 , ) and constrained variables ∆ 1 + ∆ 2 = 2π + and s 1 + s 2 = 2 − 2g or, by solving the constraint first, W unc (∆, ) ≡ W(∆ + /2, 2π − ∆ + /2, ) and independent variables ∆ ≡ ∆ 1 − /2 and s ≡ s 1 , with the same final result.
The relation (6.2) was found to hold also in [24], that uses a different W compared to this paper and we expect it to hold in general. We now provide an alternative derivation that can be generalized to other five-dimensional theories. We will prove (6.2) using only a few facts about the general structure of the theories and of the large N saddle point. We will assume that, in the large N limit, the gauge variables a and fluxes n scale with the same positive power of N , and the eigenvalues are ordered by increasing imaginary part, i.e. Im a i > Im a j for i > j. We also assume that (i) The matter content of the theory is vector-like: if ρ(a) is a weight also −ρ(a) is.
(ii) There is long range forces cancellation between vectors and hypers, which, in practice, translates into the requirement that α∈G α(a) − I ρ I ∈R ρ I (a), with α running over the roots and ρ over the weights of the hypermultiplets, either cancels or it is subleading in the large N limit. This condition is necessary to have a well-defined saddle point. 43 And verified in many other examples [50][51][52].
These conditions are satisfied by all the theories discussed in this paper and extend to a larger class of quivers that are relevant to the study five-or six-dimensional fixed points. For the twisted index, the contribution of a hypermultiplet to the twisted superpotential is given in (4.9), which, using (4.10) and (4.11), in the large N limit reads while for a vector we should take the opposite sign and set ∆ = 2π and t = 2. To avoid clutter, we omitted the gauge and flavor representation indices and we used a as a shorthand for ρ(a) or α(a) (and similarly for n, ∆, and t). For the mixed index, the contribution of a hypermultiplet to the twisted superpotential is given by (5.61) and (5.62), which, using (4.10) and (4.7), can be written in the large N limit as with r = 1, while for a vector we should take the opposite sign and set ∆ = 2π, t = 0 and r = 2.
Proof of (6.2): At large N there is no contribution to the index from classical pieces and fundamental hypermultiplets. Using the notations of sections 4 and 5, the contribution of a hypermultiplet to the logarithm of the partition function integrand is where, in our notations s 1 = s, we have suppressed the gauge indices in m and a and W H is one of the functions (6.3) or (6.4). The contribution of the vector multiplet is similarly given by where, for convenience, we introduced a fake chemical potential ∆ g for the vectors, which has to be set to ∆ = 2π at the end of the computation. By setting m = 0, we obtain the large N contribution to the index where W = W H + W V | ∆g=2π . We now promote the number π to the independent variable π, using the same trick as in [37], and we write the previous expression as Indeed, observing that the difference between (6.8) and (6.7), is given by (6.10) All dependences on ∆ and π are in the functions g 3−s (a + ∆) and the only potential nonvanishing contributions in (6.10) come from s = 0 or s = 1 Multiplying by the corresponding polynomials of n in (6.3) and (6.4), we see that (6.10) is a linear function of a and n, multiplied by sign(Im a). The constant pieces vanish when summing over all gauge variables by assumption (i). It is also easy to see, by direct inspection of (6.3) and (6.4), that the linear terms in a and n, either directly cancel or vanish when summing over vectors and hypers by assumption (ii). Now we are ready to complete the proof. Given the explicit form of (6.3) and (6.4), W is a homogeneous function of a, ∆, , π of degree two and therefore At the saddle point, ∂W ∂a = 0 and we can rewrite (6.8) as This completes the proof.

Discussion and outlook
In this paper we have demonstrated the large N factorization properties of a class of five-dimensional supersymmetric partition functions with a view toward holographic applications to the microscopic counting for black holes in AdS. There is by now compelling evidence that the large N saddle point of supersymmetric indices that are holographically dual to free energies of AdS black objects can be obtained by gluing elementary objects with the rules discussed in section 2. Black hole physics suggests that this should be the case in general. There are many examples in three and four dimensions and we have provided here other examples in five dimensions. In some cases, this factorization can be proved by using the finite N decomposition in holomorphic blocks, in other cases, as in this paper, a direct computation is needed.
We mostly focused on the Seiberg theory and the N = 2 super Yang-Mills theory in five dimensions, which can be used to describe the physics of black objects in AdS 6 × w S 4 and AdS 7 × S 4 , but our results can be easily extended to other more complicated quiver theories.
In this paper we considered the topologically twisted index for manifolds of the type (S 2 × S 1 ) × Σ g . In the special case g = 0, we could turn on a second refinement parameter and consider the partition function on S 2 1 × S 2 2 × S 1 . It would be interesting to analyse whether this partition function factorizes or not. We expect that this is the case, but we have no evidence from holography, since we are not aware of AdS black object solutions with horizon S 2 × S 2 and two independent rotational parameters.
One main open problem remains to justify the assumptions about the saddle point for the twisted and mixed index. Generalizing [22][23][24], we assumed that the two partition functions localize at the solution of a set of Bethe ansatz equations, in analogy to similar three-and four-dimensional indices. This assumption led us to the correct results for the entropy of the known black objects in AdS 6 × w S 4 and AdS 7 × S 4 . However, a slightly different assumption leads to a different result where factorization does not hold [24]. It would be nice to have a first principle derivation of the large N limit of the twisted and mixed index.
where B K = n + t K − 1. Using k ≡ |m 1 + n|, (A.1) can be put in the form .
(A.2) Upon the following change of variables (A.4) This is exactly the contribution of a hypermultiplet to the refined S 3 b ×S 2 partition function (3.2) after we identify 2 ≡ and 2 ≡ .

B Asymptotic behavior of q-functions
The double (p, t)-factorial is defined as  where B s is the sth Bernoulli number.

C Supersymmetry conventions
In this appendix, we describe our conventions for spinors, supersymmetry transformations, and rigid supergravity.

C.1 Spinor conventions
We describe N = 1 (minimal) Euclidean supersymmetry in five dimensions. 44 The Euclidean spin group is the compact symplectic group Spin (5) USp (4). The minimal spinor has 4 complex, or 8 real, components and sits in the pseudo-real representation 4 of USp (4). A complex spinor ξ may be usefully represented by a 4 × 2 matrix ξ αI , where α = 1, . . . , 4 and I = 1, 2. This presentation is useful because the action of the SU(2) R-symmetry is manifest -it acts on the I index in the fundamental representation. Such a spinor has twice the minimal number of components. It is a complexification of the minimal spinor, which it is necessary to introduce in order to write the most general transformations of the Euclidean superalgebra.

(C.4)
Define the index raising operator ε IJ = −ε JI , such that ε IJ = 1 and ε IJ ε JK = δ I K defines the inverse. We define the Majorana conjugate spinor as ξ αI ≡ C αβ ξ βJ ε IJ . (C. 5) In the action of the Euclidean supersymmetry algebra, one uses only the Majorana type conjugate, in both the action and the supersymmetry transformations. We will also use the following convention for spinor bilinears We also have the Fierz identities A complex spinor ξ may satisfy a symplectic Majorana condition: a reality condition, compatible with the spin and R-symmetry groups, which eliminates half of the components. Define the Dirac conjugate of a spinor to be ξ D αI ≡ (ξ * ) αI . (C.8) The symplectic Majorana condition is where theξ αI is the Majorana conjugate, see (C.5).

C.2 Rigid minimal 5d conformal supergravity
We will mostly follow the 5d conformal supergravity conventions of [77]. From this starting point, one can derive by partial gauge fixing the 5d supergravity used in [82], which was used to define the twisted backgrounds in [23]. The conformal supergravity offers a more flexible framework for finding rigid backgrounds. The supergravity fields of conformal supergravity are contained in the Weyl multiplet. We refer the reader to [77] for details about the relevant Weyl multiplet and its supersymmetry transformations. We summarize the aspects of the Weyl multiplet needed in order to construct rigid backgrounds below.
In the notation of [77], µ, ν, . . . are spacetime indices, a, b, . . . are tangent space indices, and i, j, . . . are SU(2) R-symmetry indices. We begin by simplifying the transformations of the Weyl multiplet by taking k-gauge, setting the dilatational gauge field to zero b µ → 0 . (C.10) The remaining bosonic fields in the 5d Weyl multiplet are e µ a , V µ i j , T ab , D . (C.11) The independent fermionic fields are the gravitino ψ i µ and the dilatino χ i . In order to bring the notation more in line with the one used in [23], we will rename V µ to 2A (R) µ . We will also replace the supersymmetry transformation parameters in [77] as follows there = e πi/4 ξ , η there = −2ie πi/4ξ , (C. 12) and rotate the gravitino ψ there µ = 2e πi/4 ψ µ . (C.13) We will also use I, J, . . . as R-symmetry indices. Note that the gauge fixed supergravity used in e.g. [82] includes an extra symmetric bosonic field t IJ such that ξ I = t I J ξ J . (C.14) The gravitino variation, in the matrix spinor notation of the previous section, reads The variation of the dilatino can be found in [77]. A rigid background is a bosonic fixed point of the supersymmetry transformations. Equivalently, it is a solution to the equations δ ξ,ξ ψ i µ = δ ξ,ξ χ i = 0 , (C. 17) for some spinors ξ,ξ and some configuration of the fields in (C.11). The spinorξ can always be solved for asξ Note that other derivations of the 5d superconformal tensor calculus, such as [75] and its followups or [73] and its followups, have a coupling to the antisymmetric tensor field that is seemingly incompatible with the one used here. de Wit et al. explain that this is due to different conventions for the F (4) algebra. Moreover, the various versions apparently all produce the same Poincare supergravity when a vector multiplet is used as a compensator. There is also an alternative Weyl multiplet called the dilaton Weyl multiplet which is derived for instance in [75] and contains different auxiliary fields and different transformations.

C.3 Matter multiplet transformations
The superalgebra generated by a single Killing spinor pair ξ,ξ includes the following bosonic transformations 1. An infinitesimal diffeomorphism with parameter iv, where the vector v µ is given by v µ ≡ξγ µ ξ .
We will continue using the notation for matter fields used in [23]. The matter fields in [77] have therefore been renamed as follows

(C.22)
The vector multiplet is off-shell closed. The transformations for hypermultiplets in a rigid bosonic background are δq A I = −2iξ I ψ A , δψ A = Γ m ξ I D m q AI + iξ I (σq) AI + 3ξ I q AI . (C.23) Indices A, B, . . . denote the pseudo-real gauge/flavor symmetry representation to which the hypermultiplets belong. The invariant antisymmetric form for this representation is denoted Ω AB , with Ω AB Ω BC = δ A C . The reality condition on the squark is The transformations for the hypermultiplet are only closed on-shell. Off-shell closure can be achieved, for a specific ξ,ξ pair by introducing an auxiliary field F AI , and a spinor ξ I such thatξ One can check that the solution space for these equations is two-dimensional. Let δ ξ,ξ ψ A = δ ξ,ξ ψ A +ξ I F AI , (C. 26) and define δ ξ I F AI = δ 2 ξ,ξ ψ A + i L v ψ A + ψ A Λ T , (C.27) thenδ ξ,ξ is off-shell closed and satisfies the correct algebra.