{'fraction_non_alphanumeric': 0.040890037172761066, 'fraction_numerical': 0.01668819698926999, 'mean_word_length': 4.11089153379744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Topological Strings, Two-Dimensional Yang-Mills Theory and Chern-Simons Theory on Torus Bundles

We study the relations between two-dimensional Yang-Mills theory on the torus, topological string theory on a Calabi-Yau threefold whose local geometry is the sum of two line bundles over the torus, and Chern-Simons theory on torus bundles. The chiral partition function of the Yang-Mills gauge theory in the large N limit is shown to coincide with the topological string amplitude computed by topological vertex techniques. We use Yang-Mills theory as an efficient tool for the computation of Gromov-Witten invariants and derive explicitly their relation with Hurwitz numbers of the torus. We calculate the Gopakumar-Vafa invariants, whose integrality gives a non-trivial confirmation of the conjectured nonperturbative relation between two-dimensional Yang-Mills theory and topological string theory. We also demonstrate how the gauge theory leads to a simple combinatorial solution for the Donaldson-Thomas theory of the Calabi-Yau background. We match the instanton representation of Yang-Mills theory on the torus with the nonabelian localization of Chern-Simons gauge theory on torus bundles over the circle. We also comment on how these results can be applied to the computation of exact degeneracies of BPS black holes in the local Calabi-Yau background.


Introduction and Summary
The OSV conjecture [1]- [3] proposes an intriguing relation between topological string theory and the physics of black holes. It asserts that the partition function of an extremal black hole arising in a Calabi-Yau compactification of Type II string theory is related to the modulus squared of the partition function of topological string theory whose target space is the same Calabi-Yau manifold. This insight relies on the well known fact that topological string amplitudes compute F-terms in the four-dimensional supersymmetric theory in a graviphoton background [4,5]. This provides a powerful tool for calculating higher derivative corrections to black hole entropy, extending previous results based on supergravity calculus [6]- [8].
A concrete realization of the OSV conjecture is modelled on a specific class of Calabi-Yau threefolds whose local geometry is given by the sum of two line bundles over a compact Riemann surface [2,3]. A four-dimensional BPS black hole 1 is engineered by wrapping a system of D4-D2-D0 branes on holomorphic cycles of the Calabi-Yau space, realizing an explicit construction of the black hole microstates of charge N . The counting of these microstates is thus given by the number of bound states that the D2 and D0 branes can form with N D4 branes, which in turn corresponds to excited gauge field configurations of the N = 4 (topologically twisted) U (N ) gauge theory living on the worldvolume of the D4 branes. These configurations are then argued [2] to localize in a two-dimensional q-deformed U (N ) Yang-Mills theory living on the Riemann surface over which the Calabi-Yau manifold is fibred. This chain of arguments closes with the identification between the partition function of the two-dimensional Yang-Mills theory in the large N limit, which admits a chiral/antichiral factorization, and the modulus squared of the topological string partition function. In this way the q-deformed gauge theory is conjectured to provide a nonperturbative completion of topological string theory in the local Calabi-Yau background.
This conjecture has been studied in a variety of different contexts. The dynamics of the q-deformed theory on the sphere has been analyzed in detail in [9]- [13]. While [9]- [11] are focused mostly on the gauge theoretical aspects of the correspondence and deal primarily with the phase transition of q-deformed Yang-Mills theory on the sphere, 2 in [12] we have exhibited a precise link between the two-dimensional theory and the underlying toric Calabi-Yau geometry through an explicit topological string computation. The interplay between the various geometrical invariants that arise in topological string theory is crucial for this correspondence. A different perspective has been proposed in [11,15]- [18], where it is shown that the q-deformation is very natural from the point of view of three-dimensional Chern-Simons gauge theory defined on a Seifert manifold fibred over the Riemann surface. In this case the three-dimensional gauge theory, which describes open topological strings on the cotangent bundle of the total space of the Seifert fibration, localizes to a q-deformed gauge theory on the base space. The two-dimensional gauge theory has been used in this way as an efficient tool for the computation of various three-manifold and knot invariants [19]- [22]. The q-deformed theory has also been studied from the perspective of its large N Gross-Taylor string expansion in terms of central elements of Hecke algebras in [23], while its use in more general BPS state counting is described in [24,25]. Moreover, the relevant topological string theory has been studied in great detail in [26] where it was shown that the isometries of these backgrounds lift to the moduli space of curves and thereby provide a powerful tool for the computation of equivariant Gromov-Witten invariants.
The aim of this paper is to further connect the various points of view that lead to two-dimensional Yang-Mills theory in the case where the base Riemann surface is a torus and the two-dimensional gauge theory is not deformed. Our analysis provides, amongst other things, a detailed elucidation of some of the constructs proposed in [2]. At the same time the local elliptic threefolds we study provide a class of non-toric examples in which we can explicitly verify a number of conjectured physical and mathematical equivalences in (non-perturbative) topological string theory, extending previous correspondences for local theories of rational curves [12] and other toric Calabi-Yau backgrounds [24].
We compute explicitly the large N limit of the two-dimensional gauge theory and extract the chiral contribution following the standard Gross-Taylor expansion [27]. In particular, we show explicitly that the role played by the U (1) charges is intimately related to the appearence of open string degrees of freedom. The precise matching with topological string theory on the elliptic threefold would provide an explicit realization of Gross-Taylor string theory on the elliptic curve in terms of an equivariant topological sigma-model in six dimensions. This is to be compared with its relation [5] to a two-dimensional topological sigma-model coupled to topological gravity and perturbed by the Kähler class of the underlying elliptic curve. We will see very directly that these two topological string theories are in fact the same.
To compare with the conjecture of [2], we explicitly construct the pertinent Calabi-Yau geometry by using blowup techniques to relate it to a formal toric variety. Topological string amplitudes on formal toric varieties can be computed by means of the topological vertex [28,29]. After blowing down and a change of framing in the topological vertex gluing rules to recover the non-toric geometry of [2], the resulting topological string amplitude matches the two-dimensional prediction. This allows us to exploit the two-dimensional gauge theory to compute geometrical invariants of the elliptic Calabi-Yau threefold. In particular, we find that the computation of Gromov-Witten invariants can be reduced to the evaluation of Hurwitz numbers that count (connected) coverings of the torus. In this way we deduce a closed, explicit combinatorial formula for the Gromov-Witten invariants. These ideas easily generalize to the computation of Gopakumar-Vafa invariants, and their integrality confirms our computations. The two-dimensional gauge theory also leads to a simple combinatorial solution for the Donaldson-Thomas theory of the local elliptic threefold.
Finally, we describe the point of view from Chern-Simons gauge theory, a relation anticipated from open-closed string duality in the A-model with D-branes. The pertinent three-dimensional geometry is that of a torus bundle fibred over the circle. The partition function localizes onto a sum over flat connections, the critical points of the Chern-Simons action functional. We classify the flat connections and provide an explicit matching with two-dimensional instantons. The precise matching between Chern-Simons gauge theory and two-dimensional Yang-Mills theory relies on performing an analytic continuation of the Chern-Simons coupling k to imaginary non-integer levels, leading to some subtleties in the correspondence. The link to two-dimensional conformal field theory plays a crucial role here. This provides a very explicit demonstration of the formal equivalence [17,18] between Chern-Simons theory on a Seifert manifold and two-dimensional Yang-Mills theory on the base of the Seifert fibration.
The organization of this paper is as follows. In Sect. 2 we briefly review the proposed relationship between the OSV conjecture and the role played by two-dimensional Yang-Mills theory. In particular, we use nonabelian localization techniques to express the partition function of the gauge theory as a sum over instanton contributions and describe their role in reproducing the counting of microstates through the N = 4 gauge theory in four dimensions. The factorization into chiral and antichiral components in the large N limit is the subject of Sect. 3. In Sect. 4 we construct the relevant Calabi-Yau geometry and compute the topological string amplitude using the topological vertex gluing rules. In Sect. 5 we examine the various geometric invariants that characterize the background. We use two-dimensional Yang-Mills theory to compute the Gromov-Witten invariants and study their relation with Hurwitz numbers and Gopakumar-Vafa invariants, the integrality of the latter giving strong support to the validity of the conjecture. We also study their relation with the Donaldson-Thomas invariants of the background, for which we derive a closed combinatorial formula. Finally, in Sect. 6 we analyze in detail the relation between the Yang-Mills theory and Chern-Simons gauge theory on a torus bundle. Some technical details are collected in three appendices at the end of the paper.

Yang-Mills Theory and the D-Brane Partition Function
In this section we will state more precisely the conjecture of [2,3] in the case of the local elliptic curve. 3 This will lead to the introduction of two-dimensional Yang-Mills theory on the torus. We will review its instanton representation and modular properties. We also describe its relationship to the computation of the Euler characteristic of instanton moduli space in N = 4 gauge theory, clarifying some points which were missed in the analysis of [3].

Black Hole Entropy
Consider Type IIA superstring theory on R 3,1 × X p where the local Calabi-Yau threefold X p is the total space of the holomorphic rank 2 vector bundle with O T 2 (p) a holomorphic line bundle of degree p ≥ 0 over the torus T 2 (i.e. a holomorphic section of this bundle has exactly p zeroes) and O T 2 (−p) its dual. The restriction to non-negative p is possible without losing generality because of the reflection symmetry p → −p which interchanges the two summands of (2.1). The non-compact space X p may be regarded as the local neighbourhood of an elliptic curve embedded in a compact Calabi-Yau threefold, with the local Calabi-Yau condition in this case being c 1 (T X p ) = 0. We are free to twist the fibration (2.1) by any torsion-free holomorphic line bundle over T 2 without affecting the gauge and string theory physics. The low energy effective four-dimensional theory on R 3,1 is N = 2 supergravity. Its charged extremal black hole solutions are uniquely characterized through the attractor mechanism [6]- [8,32,33] by the magnetic and electric charges (m l , e l ), where l = 0, 1, . . . , n V with n V = h 1,1 (X p ) = dim H 1,1 (X p ) the number of vector multiplets in the low energy supergravity theory. This fixes the Kähler moduli k ∈ H 1,1 (X p ) to be proportional to the charge vector m l . Since the only compact holomorphic two-cycle of X p is the base T 2 , embedded in X p as the zero section of (2.1), four-dimensional BPS black holes are uniquely characterized by the sets of charges (m 0 , m 1 , e 0 , e 1 ). Motivated by insight from topological string theory [2,3], in the following we will choose the configuration (m 0 = 0, m 1 = p N, e 0 , e 1 ) with arbitrary e 0 , e 1 ∈ N 0 .
After taking into account the effects of supergravity backreaction, the black hole solution can be realized by wrapping N D4 branes on the non-compact four-cycle C 4 in X p which is the total space of the holomorphic line bundle O T 2 (−p) → T 2 , along with D2 branes wrapping the base torus T 2 and D0 branes. This brane configuration breaks the symmetry p → −p. Note that the number of D2 and D0 branes is not fixed, and that no D6 brane charge is turned on. The number of microstates of the four-dimensional black hole is given by the number of bound states that the D2 and D0 branes can form with the D4 branes. This number can be counted by studying the N = 4 topologically twisted U (N ) gauge theory living on the worldvolume of the D4 branes 4 with certain interactions that correspond to turning on chemical potentials for the D2 and D0 branes.
Dp branes wrapping a (p + 1)-manifold M p+1 couple to all Ramond-Ramond fields C (q) through anomalous couplings of the form [35] M p+1 q C (q) ∧ Tr e 2π α ′ F , where F is the gauge field strength living on the brane worldvolume. In particular, there is a coupling quadratic in F given by M p+1 C (p−3) ∧ Tr F ∧ F . This means that an instanton configuration excited on a four-dimensional submanifold of the worldvolume is equivalent to a D(p − 4) brane charge. Thus counting D4-D0 brane bound states is equivalent to counting instantons on the four-dimensional part of the D4 brane worldvolume that lies inside the local Calabi-Yau threefold. A similar reasoning applies to the chemical potential for the D2 branes which is related to the anomalous couplings C 4 C (3) ∧Tr F . To obtain the correct charges one then takes the Ramond-Ramond three-form field C (3) to be constant, i.e. proportional to the volume form of the wrapped submanifold T 2 . One thus concludes that the counting of BPS bound states is equivalent to introducing the observables where g s is the string coupling constant and ω T 2 is the unit volume form on T 2 (i.e. T 2 ω T 2 = 1). The chemical potentials for the D0 and D2 branes are then respectively given by φ 0 = 4π 2 /g s and φ 1 = 2π θ/g s .

Two-Dimensional Yang-Mills Theory
According to the conjecture of [2,3], the counting of the number of black hole microstates, or equivalently the computation of the N = 4 gauge theory vacuum expectation value of the observables (2.2), reduces to the evaluation of the partition function of U (N ) Yang-Mills theory on the base torus. In the more general case where the local threefold is a fibration over a genus g Riemann surface, the gauge theory carries a deformation that reflects the non-triviality of the holomorphic vector bundle. This deformation is tantamount to replacing, in the usual Migdal heat kernel expansion [36,37], the dimension of U (N ) representations with their quantum dimension. However, the case of the torus is special. Since in general the dimension appears to the power of the Euler characteristic 2−2g of the surface, the gauge theory at g = 1 is insensitive to the deformation. The only remnant of the non-triviality of the fibration is in the insertion of the four-dimensional mass deformation p Tr (Φ 2 ), where the scalar field Φ is the holonomy of the gauge field along the fibre at infinity in C 4 . The four-dimensional gauge theory localizes onto field configurations which are invariant under the natural U (1) scaling action along the fibre, leading to the action By integrating out Φ, one can recast (2.3) in the standard form where the role of the dimensionless Yang-Mills coupling is played by the combination g s p.
The partition function of U (N ) Yang-Mills theory on a torus can be expressed as the heat kernel expansion [36,37] where the sum over R runs through all irreducible representations of the gauge group U (N ) which can be labelled by sets of N increasing integers +∞ > n 1 (R) > n 2 (R) > · · · > n N (R) > −∞ giving the lengths of the rows of the Young tableau corresponding to R. The first and second Casimir invariants of R can be expressed in term of these integers as Note that when the degree p is positive, it can be absorbed into a redefinition of the string coupling constant g s . This fact is peculiar to the torus since the heat kernel expansion is not weighted by the (quantum) dimension of the representation. On any other Riemann surface, this redefinition would not be possible. We will nevertheless keep the explicit dependence on p in order to better describe later on the dependence of topological invariants and the relation with Chern-Simons gauge theory on Seifert fibrations.

The Nonabelian Localization Formula
Two-dimensional Yang-Mills theory has a dual description in terms of instantons [38] in which its modular properties are manifest. The sum over U (N ) weights n(R) = {n i (R)} in eq. (2.4) can be traded for a sum over conjugacy classes of the symmetric group S N on N elements [39,40]. The conjugacy classes are labelled by sets of N integers 0 ≤ ν a ≤ ⌊N/a⌋ which define a partition of N , ν 1 + 2 ν 2 + · · · + N ν N = N . A conjugacy class contains N !/ N a=1 a νa ν a ! elements, each of which gives the same contribution to the partition function and comes with parity factors (−1) νa . The heat kernel expansion can be recast in the form of a sum over instanton solutions by means of the Poisson resummation formula In this way one finds that the U (N ) Yang-Mills partition function on the torus in the instanton representation is given up to normalization by [40,41] (For simplicity we set the θ-angle to zero in the following unless explicitly stated otherwise.) We can simplify the form of this expression somewhat by introducing the elliptic Jacobi theta-functions (2.8) Then (2.7) can be written as (2.9) In this form the localization of the path integral onto critical points of the Yang-Mills action is manifest, and these formulas have a natural interpretation in terms of instantons. For this, let us recall how to construct general solutions of the U (N ) Yang-Mills equations on a compact Riemann surface Σ of genus g [42]. The Yang-Mills equations on Σ can be written as d A X = 0 where d A is the covariant derivative with respect to a gauge connection A on a principal U (N )-bundle P N → Σ, and X = * F with F = F A the curvature of A. This equation means that X is a covariantly constant section of the adjoint bundle ad(P N ), and thus it yields a reduction of the U (N ) structure group to the centralizer subgroup U X ⊂ U (N ) which commutes with X. As a consequence, any U (N ) Yang-Mills solution can be described as a flat connection of an associated U X -bundle which is twisted by a constant curvature line bundle associated to the U (1) subgroup of U (N ) generated by X. Flat connections in turn are uniquely characterized by their holonomies around closed curves on Σ, and can be concretely described in terms of group homomorphisms from the fundamental group of Σ to the structure group of the gauge bundle.
The moduli space of gauge inequivalent Yang-Mills connections can be conveniently described by introducing the universal central extension Γ R = π 1 (Σ) × Z R of the fundamental group π 1 (Σ) of Σ, with the center of the U (N ) gauge group extended to R. Then according to the above discussion, there is a one-to-one correspondence between gauge equivalence classes of connections solving the Yang-Mills equations on Σ and conjugacy classes of homomorphisms ρ : Γ R → U (N ) with ρ(π 1 (Σ)) ⊂ SU (N ). Explicitly, the gauge connection A (ρ) associated to ρ has curvature F (ρ) = X (ρ) ⊗ ω Σ , where ω Σ is the unit volume form of Σ and X (ρ) is an element of the Lie algebra of U (N ) defined by the map dρ : R → u(N ). For the purpose of evaluating the Yang-Mills action on classical solutions, we have only to find all possible X (ρ) . This is straightforward to do, since the homomorphism ρ furnishes an N -dimensional unitary representation of Γ R .
When the representation ρ is irreducible, X (ρ) is central with respect to the adjoint action of U (N ) and therefore its eigenvalues are all equal to a certain real number λ. The Chern class of a principal U (N )-bundle P N over Σ is always an integer, 1 2π Σ Tr F (ρ) = m ∈ Z, and one has 1 2π Tr X (ρ) = m which completely determines λ to be λ = 2π m N . On the other hand, if ρ is reducible then X (ρ) is generically central with respect to a subgroup of U (N ) of the form is a bundle map ad X (ρ) : ad(P N ) → ad(P N ), and we can decompose the bundle ad(P N ) under this action into a direct sum of sub-bundles each associated to a distinct eigenvalue of ad X (ρ) . This effectively manifests itself as a decomposition of the original U (N ) gauge bundle into eigenbundles associated to the distinct eigenvalues of X (ρ) itself as Since the individual Chern classes in this decomposition are necessarily integers, X (ρ) has eigenvalues λ 1 , λ 2 , . . . , λ r with multiplicities N 1 , N 2 , . . . , N r and It is now easy to understand eq. (2.7) in light of this discussion. The exponential factors are the Boltzmann weights of the Yang-Mills action on a solution determined by ν a eigenvalues λ ia = 2π m ia /a with multiplicity a, for a = 1, . . . , N , corresponding to the reduction in structure group U (N ) → U (1) ν 1 × U (2) ν 2 × · · · × U (N ) ν N . The full partition function sums over all classical solutions, with the Boltzmann factor of the Yang-Mills action accompanied by a fluctuation determinant according to the nonabelian localization principle [38,17]. The singular terms in eq. (2.7) as g s p → 0 arise precisely from these determinants and are in principle recovered by an integration over the moduli space of classical solutions. The only subtle point here is that distinct partitions in eq. (2.7) are not necessarily related to gauge inequivalent solutions. One has to identify, as coming from the same instanton, some contributions related to different conjugacy classes {ν a } of S N . Such a reorganisation of the instanton sum provides the effective form of the fluctuation determinants.

S-Duality and Instanton Moduli Spaces
To further understand the structure of the torus partition function and its relation to the N = 4 topological gauge theory in four dimensions, we have to describe the moduli space of classical instantons in order to be able to single out the contribution of the fluctuations to the nonabelian localization formula. For this, we recall the classification of unitary representations of the group Γ R . According to the Narasimhan-Seshadri theorem [43], for genus g > 1 there is associated to any pair of integers (N, m) a d-dimensional irreducible representation of Γ R , where d = gcd(N, m), giving the Yang-Mills ground state for gauge group U (N ) and with Chern class m. The genus one case is different, because the fundamental group π 1 (T 2 ) = Z 2 is abelian and so it has no irreducible representations for d > 1. Thus for m = 0 and N > 1 there are no irreducible representations of Γ R , corresponding to the well known fact that every flat connection on T 2 is reducible (recall that flat U (N ) gauge connections on Σ are described by group homomorphisms γ : π 1 (Σ) → U (N )). Only for (N, m) coprime do irreducible representations of the universal central extension Γ R exist. In this case the moduli space of Yang-Mills solutions is a smooth manifold. When reducible representations of Γ R occur, orbifold singularities appear in the instanton moduli space [40]. The result can be summarized as follows.
Again we let N = N a=1 a ν a be a partition of the rank N corresponding to the gauge symmetry breaking U (N ) whereT 2 is a dual torus. This result generalizes the moduli space of flat connections, with ν N = 1, given by M N,0 (1, 0) ∼ = Hom(π 1 (T 2 ), U (N ))/U (N ) ∼ = (T 2 ) N /S N , where the Weyl subgroup S N ⊂ U (N ) is the residual gauge symmetry acting by permuting the components of the maximal torus U (1) N . The symmetric orbifold structure in (2.14) arises from the non-trivial fixed points of the action of the symmetric group S νa on (T 2 ) νa , which is the subgroup of the stabilizer group of the conjugacy class ν of S N which permutes the ν a cycles of length a. The orbifold singularities for coincident instantons are directly related to the singular behaviour of the Yang-Mills partition function in the instanton representation in the weak coupling limit [40]. However, as mentioned already above, one needs to carefully reorganise the sum over partitions in the nonabelian localization formula to "instanton partitions", reflecting a bundle splitting of the type (2.11) into gauge inequivalent eigenbundles, in order to prevent the overcounting of distinct Yang-Mills stationary points. This consists in writing the integer pairs corresponding to (2.11) As the eigenvalues (2.12) are independent of the ranks d i , one restricts the counting of Yang-Mills critical points to those labelled by triples of integers (ν a , N a , m a ) which satisfy, in addition to the partition constraints above, the requirement that (N a , m a ) be distinct coprime integers. These additional constraints are implicitly understood in (2.14) and they ensure that one does not count as distinct those bundle splittings (2.11) which contain some sub-bundles that can themselves be decomposed into irreducible components. (See Sect. 9 of [40] for a more detailed treatment.) To see how this works in practice, let us consider the simple example of U (2) gauge theory on T 2 . The partition function may then be written out explicitly as gs p m 2 0 .
(2.15) The first term in (2.15) corresponds to solutions coming from the reduction U (2) → U (1) × U (1), while the second term receives contributions only from global minima with all eigenvalues equal and proportional to m 0 2 . In both sums there are connections contributing to the same value of the Yang-Mills action. For instance, by taking m 1 = m 2 = m ′ in the first sum and m 0 = 2m ′ in the second sum, both contributions represent the minimum value of the action for the Chern class m = 2m ′ . Are these connections gauge inequivalent? The answer is negative because, as discussed above, for g = 1 the solutions are irreducible only when the integers N and m are coprime. When the Chern class is an even integer, the minima therefore originate from completely reducible connections (of the type U (1) × U (1)). It is better to rewrite the partition function in the form where now every classical contribution appears together with the part coming from the quantum fluctuations. Note that reducible and irreducible connections are completely disentangled in this rewriting. When the Chern number m = 2m 0 + 1 is odd the two terms in (2.16) respectively come from instantons in the smooth moduli spaces Heuristically, with the appropriate symmetry factors, each factorT 2 , representing the oneinstanton moduli space, contributes a mode with fluctuation determinant −1/ √ 4g s p. On the other hand, when m = 2m ′ is even only the first term contributes, and we find again instantons in the smooth moduli space (2.18) with m = 2m ′ and m 1 = m 2 . The novelty now comes from the two gauge equivalent instanton contributions for m 1 = m 2 = m ′ in the singular moduli space The singular locus of the symmetric orbifold (2.19) is the disjoint union Sym 2T2 ∐T 2 with the disjoint sets corresponding to the identity and order two elements of the cyclic group S 2 = Z 2 , respectively. In principle the same analysis can be repeated for any N (see [40] for the case N = 3), with increasing complexity in deriving the explicit forms of the singular fluctuations. This partition function should reproduce instanton calculus for the N = 4 topologically twisted Yang-Mills theory on the non-compact four-cycle C 4 . In particular, it should compute the generating functional (at θ = 0) for Euler characteristics of the moduli spaces of self-dual U (N ) gauge connections on C 4 given by [44] where e 0 and e 1 are respectively the D4-D0 and D4-D2 electric charges, obtained from summing over different topological classes of gauge bundles in the N = 4 Yang-Mills amplitude with the observables (2.2) inserted, and Ω N (e 0 , e 1 ) is the index of BPS bound states with the given charges. One would thus expect that the final result respects the well known S-duality properties of N = 4 supersymmetric Yang-Mills theory, so that Z YM should be a modular form. Moreover, because the Euler characteristic is an indexed counting of classical solutions, we would not expect any contributions from quantum fluctuations. We see that apparently Yang-Mills theory on the torus disagrees with both expectations. Let us analyse these discrepencies in more detail, beginning with the modular structure. The explicit form of the instanton partition function in (2.9) is a sum of theta-functions each with a coupling dependent factor. This is a (finite) sum of modular forms, each transforming with different weights, according to the eigenbundle decomposition (2.11). As a result it is not immediate how to extract the information on the number of black hole microstates. In the dual black hole language the number of microstates with a given charge configuration arises as a combinatorial problem where one has to sum over all prefactors whose Boltzmann weights correspond to the same set of global charges in (2.20). In light of the above discussion, this is equivalent to organizing the sum over two-dimensional instantons into a sum over gauge inequivalent configurations. In doing so one has to face the effect of the singular fluctuations, depending explicitly on the Yang-Mills coupling, and therefore its interpretation as the Witten index of black hole states appears difficult.
On the other hand, the occurence of the bundle reduction (2.11) in the description of the two-dimensional gauge theory partition function is at the very heart of the interpretation problem. The same phenomenon has been found in [24] in studying the counting of black hole microstates on local P 2 . There it was suggested that the sectors corresponding to a non-trivial reduction in structure group should come from marginally bound states of D-branes, and only the instantons associated to the trivial partition with ν N = 1 should be considered. However, a direct comparison between four-dimensional gauge field configurations and two-dimensional instantons is presently out of reach because of our poor understanding of four-dimensional gauge theories on curved backgrounds and non-compact spaces.
Some of these unexpected features could also be related to the non-compactness of the four-cycle C 4 on which the supersymmetric gauge theory is defined. Recall that the twodimensional gauge theory is the localization under an appropriate U (1)-action of the full N = 4 topologically twisted gauge theory whose topological sectors are given by the black hole charges, as in (2.20). In this setup it is tempting to suggest that the g s -dependent factors in (2.9) arise as a consequence of imposing boundary conditions on the four-dimensional gauge field at infinity within each superselection sector separately. As we will see in Sect. 6, it is possible to give a geometrical interpretation of the g s -dependent factors as the fluctuations around a flat connection in Chern-Simons gauge theory on the boundary of C 4 , in complete analogy with what was found in [11] in the case of local P 1 .

Gauge String Theory on the Elliptic Curve
In preparation for our description in terms of closed topological strings on the local elliptic curve, in this section we will study the large N limit of U (N ) Yang-Mills theory on the base torus T 2 . We will pay particular attention to the role played by the U (1) factor of the gauge group, in light of the observations of [2]. We will find rather explicitly that the partition function has a natural interpretation in terms of open string degrees of freedom in the non-trivial U (1) charge sectors.

Large N Expansion
It is convenient to use the relation U (N ) = SU (N )×U (1)/Z N to decompose irreducible representations R of U (N ) in terms of SU (N ) representationsR and U (1) charges m = N r + |R|, where |R| is the total number of boxes in the Young tableau associated witĥ R and r ∈ Z. The quadratic Casimir invariant of R can be related to SU (N ) and U (1) invariants as where C 2 (R) = |R| N + κR − |R| 2 N . If we label by n i (R) the length of the i-th row of the Young tableau forR, with can be expressed uniquely [27] in terms of coupled repre-sentationsR =R +R− such that the Young tableau for R is given by joining a chiral tableau R + to an antichiral tableau R − as depicted in Fig. 1. The quadratic Casimir invariant of the representationR is given by and the total number of boxes inR is where n 1 (R + ) is the number of boxes in the first row of R + . The U (1) charge associated toR can be written as where ℓ = n 1 (R + ) + r. In the large N limit the quantities |R ± | and ℓ are all understood as being small compared to N . Given a coupled SU (N ) representationR, the quadratic Casimir invariant of the corresponding U (N ) representation R is given by Note that changing the sign of ℓ in (3.6) is equivalent to exchanging |R + | with |R − |. We will momentarily set θ = 0. By using (3.6) and introducing the 't Hooft coupling we can recast the torus partition function (2.4) in the form (3.8) The partition function can be naturally written as a sum over U (1) charge sectors, each sector ℓ ∈ Z being weighted by the factor e −λ ℓ 2 /2 determined by the energy of the charge. We are thus led to define where the expressions for the partition functions Z(ℓ) and Z ± (ℓ) can be read off from (3.8).
To analyse the contributions from a given charge sector, we follow the trick employed in [45]. Consider the function with λ and λ ′ regarded formally as independent variables. Then the ℓ dependence of the chiral partition function Z + (ℓ) can be generated by differentiating (3.10) with respect to The action of the translation operator in (3.11) implies that the free energies associated to In [45] it was shown that the free energy F + (λ, λ ′ ) admits the large N genus expansion where each coefficient function F g (λ ′ ) can be expressed in terms of quasi-modular forms of weight 6g − 6. We conclude that the chiral free energy is simply given by (3.13)

String Interpretation
The effect of the U (1) charge in (3.13) appears only as a shift in the argument of the forms F g (λ ′ ) weighted with a factor of 1 N . The occurence of odd powers of 1 N in their large N expansion suggests an interpretation in terms of open string degrees of freedom. For this, we expand the quasi-modular forms in a Taylor series at N → ∞ as (3.14) Each form F g (λ) in (3.14) can in turn be expanded for λ → ∞ as [41] where H g,d = H T 2 g,d (1 d ) are the simple Hurwitz numbers that count the connected, simple branched covering maps of degree d and genus g to the torus T 2 . Collecting together eqs. (3.13)-(3.15) we arrive finally at The expansion (3.16) can be given a very suggestive interpretation. If we interpret the integer b as the number of boundaries of a Gross-Taylor string worldsheet Σ, then we can define the total Euler characteristic χ = χ(Σ) = 2g − 2 + b at genus g and recast (3.16) in the form We can interpret (3.17) as a sum over simple branched covering maps of winding number d from a Riemann surface of Euler characteristic χ to the torus, where each boundary is mapped to a fixed point of T 2 . By the Riemann-Hurwitz theorem, these covering maps have 2g − 2 simple branch points which contribute a factor λ 1 (2g−2)! since the branch points are indistinguishable. Similarly, the boundaries contribute ( λ 2 ) b with the combinatorial factor 1 b! and with each weighted by the U (1) charge ℓ which corresponds to a boundary holonomy. The exponential factor e −λ d/2 plays the role of the Nambu-Goto action. Finally, the relative Hurwitz numbers H χ,d,b = H g,d d b count the number of inequivalent d-sheeted coverings of the torus by a Riemann surface with b boundaries and genus g, and it is given by the number of simple covering maps H g,d times the total number of ways d b in which one can map any of the b boundaries to the given fixed point of T 2 . Note that the open string degrees of freedom disappear in the ℓ = 0 sector (as then only the b = 0 term contributes to the sum) corresponding to turning off the boundary holonomies.
In order to write the total free energy, we have to sum the chiral and the antichiral contributions. From (3.8) we see that the antichiral free energy F − (ℓ) is obtained from the chiral free energy F + (ℓ) by reversing the sign of the U (1) charge ℓ. But from the form of eq. (3.16) it follows that, in the sum of the chiral and antichiral free energies, only the even powers of ℓ survive since they are the only ones which are insensitive to the sign of ℓ. This fixes the number of boundaries n to be an even integer. Therefore, the total free energy is given by and the full partition function (3.8) can then be rewritten as Finally, the effect of the θ-angle can be easily taken into account. It amounts to including in (3.8) the holonomy factor e i θ C 1 (R , q) = e i θ q = e i θ (|R − |−|R + |+ℓ N ) determined by the U (1) flux. This leads to the final form is the complex coupling constant, with t and t formally regarded as independent variables, and (3.25) Note that both free energy functions F ± have an explicit dependence on the real 't Hooft coupling λ through the factor λ χ in (3.25).
In the next section we will reconcile this string expansion with the A-model topological string theory on the geometry (2.1). In that instance the complex coupling (3.22) is the cohomology class t ∈ H 1,1 (T 2 ) of the complexified Kähler form ω T 2 on T 2 , as follows from the identification of closed and open string moduli required to match the black hole and closed topological string partition functions in the OSV conjecture [2,3]. Indeed, eq. (3.22) is just the attractor equation in this instance. The sum over U (1) charges ℓ corresponds to a sum over Ramond-Ramond fluxes coupled to the D2 branes wrapping T 2 [2,3], consistent with the observation above that the U (1) sector of the U (N ) gauge theory is a source of open string moduli.

Topological String Theory on the Local Elliptic Threefold
The chiral partition function of two-dimensional Yang-Mills theory on the torus can be interpreted as the topological string amplitude in the Calabi-Yau background (2.1) [2,3]. The aim of this section is to make this correspondence more precise and exhibit a rigorous construction of the relevant toric geometry. The perturbative topological string amplitude can be computed by means of topological vertex techniques and it is shown to agree with the chiral two-dimensional gauge theory partition function found in Sect. 3.2. As we discuss in detail below, the calculation is somewhat subtle and must be handled with care because, unlike the case of local P 1 studied in [12], the local elliptic threefold is not a toric manifold and so the standard topological vertex methods do not immediately apply. We will also describe, for completeness, an alternative derivation that follows the techniques of [26] where the topological string theory is interpreted as a two-dimensional topological quantum field theory.

The Formal Toric Geometry
We begin with a detailed construction of the local elliptic curve X p as a toric Calabi-Yau manifold. The idea is to start from the familiar toric description of the trivial Kähler geometry of C 3 and then compactify one of the complex coordinates to get the geometry C 2 ×T 2 , which is the total space X 0 of the trivial rank 2 vector bundle (2.1) with p = 0. The non-trivial fibrations X p with p > 0 will be recovered later on by using framing techniques.
A convenient way to describe C 3 as a toric manifold is to view it as a T 3 -fibration over R 3 . This is achieved by changing from complex coordinates z i on C 3 to polar coordinates z i = |z i | e i θ i along each of the three complex directions, giving the symplectomorphism where R 3 ≥0 denotes the positive octant of R 3 . The natural U (1) 3 -action on C 3 is given by shifts of the angular coordinates θ i in this parametrization. This fibration is encoded in the toric diagram on the left in Fig. 2, and the corresponding toric graph on the right is obtained by projecting the three-dimensional diagram onto a plane. In the diagram a generic point of the positive octant is associated with a nondegenerate T 3 fibre. When one or more coordinates |z i | 2 vanish, the fibration degenerates. For example, one cycle degenerates to a single point on each of the planes |z i | 2 = 0, while two cycles degenerate on each of the lines drawn in the diagram. All three cycles of the fibration are degenerate at the origin, which is the fixed point of the natural toric action on C 3 , and the T 3 fibre shrinks to a single point.
From this geometry we can construct the threefold (2.1) at p = 0 by compactifying one of the new coordinates, say |z 1 | 2 , according to the projection where τ = −t/2π i is the complex modulus of the dual elliptic curve. This projection is achieved by imposing the identifications |z 1 | 2 ∼ |z 1 | 2 + i τ n, n ∈ Z, and it is graphically implemented by gluing an edge of the toric diagram to itself as shown in Fig. 3. Note that now the U (1) action given by shifts in θ 1 is no longer degenerate since the locus |z 1 | 2 = 0 is identified with |z 1 | 2 = τ n for any n ∈ Z. While X 0 = T 2 × C 2 contains the algebraic three-torus (C × ) 3 as a dense open subset (where C × := C \ {0} is the punctured complex plane), and the natural action of (C × ) 3 on itself extends to X 0 , this toric action is free. 5 As a consequence, the toric graph is no longer trivalent since the projection π eliminates the fixed point of the toric action on the universal covering space C 3 . Because the fixed point locus is empty, and hence so is the set of vertices of the toric graph, the powerful techniques developed in [28] for the computation of topological string amplitudes on toric Calabi-Yau manifolds cannot be applied. This difficulty is overcome by realizing that this non-toric geometry can be canonically related to a formal toric Calabi-Yau threefold. Let be the blowup of X 0 at z i = 0. This amounts to excising the origin of X 0 and replacing it with a projective plane P 2 . It corresponds to a degeneration of the toric graph of X 0 obtained by blowing up an edge representing a projective line P 1 ⊂ P 2 at the origin. The toric action on X 0 can be lifted to X 0 in such a way that the natural projection (4.3) of the blowup is U (1) 3 -equivariant. Composition with the projection X 0 → T 2 determines an equivariant family of elliptic curves whose fibres over any point The blowup thus defines a toric scheme X 0 whose toric graph is depicted in Fig. 4. Since the trivalent graph describing the degeneration locus of the T 3 -fibration X 0 is non-planar, X 0 is a (regular) "formal" toric Calabi-Yau threefold in the terminology of [29]. Although the blowup produces an inequivalent Calabi-Yau space, the topological string partition function on X 0 is easily related to the desired one on the original background X 0 as follows. Let N g β (X 0 ) denote the genus g Gromov-Witten invariants of the elliptic threefold X 0 . Since H 2 (X 0 , Z) = Z[T 2 ], any Calabi-Yau curve class β is of the form β = d [T 2 ] with d ∈ Z and the corresponding invariant may be denoted N g d (X 0 ). On the other hand, the blowup X 0 has two non-trivial curve classes represented by the two internal edges in the toric graph of Fig. 4. The non-planar edge (labelled R) is given by the embedding of the torus T 2 in X 0 via the family of curves (4.4), while the planar edge (labelled R ′ ) is the projective line P 1 from the blowup at the origin. Thus and any curve class β ′ of X 0 may be expanded as . Then one has the equality [46] between Gromov-Witten invariants of X 0 and of its blowup X 0 . 6 The topological string amplitude on X 0 can be computed by using the degeneration gluing formula of [29]. The 6 A more invariant way of writing this identity is as N g β (X0) = N g ̟ ! (β) (X0) for all β ∈ H2(X0, Z), where ̟ ! is the Gysin pullback on homology induced by the natural projection (4.3) of the blowup. equality (4.6) then implies that this partition function agrees with the topological string amplitude on X 0 after blowing down the extra projective line using (4.3) to recover the original elliptic threefold. In practice this is achieved by regarding the complex Kähler class t ′ ∈ H 1,1 (P 1 ) of the auxilliary P 1 , which is the length of the corresponding edge in the toric graph, as a free parameter in the theory which can be smoothly continued to t ′ = 0 in the amplitude on X 0 .
To compute the topological string amplitude in the background X 0 , we will also need to specify the framings f on the U (1) 3 -invariant edges and vertices of the toric graph in Fig. 4. Since we will set the fields on the external edges of the graph to zero in order to recover the closed string geometry of X 0 (see Sect. 4.2 below for further discussion), it suffices to specify the framings on the internal edges. They are determined by the intersection numbers of the Calabi-Yau space [2]. Each edge defines a two-cycle in X 0 , which is bounded by two planes representing the projections of four-cycles in X 0 onto the toric base. There are two natural four-cycles in X 0 which are the total transforms ̟ ! (C 4 ), ̟ ! (C ′ 4 ) of the four-cycles in X 0 given by the total spaces of the two holomorphic line sub-bundles of (2.1), with ̟ ! the Gysin pullback on homology induced by the projection (4.3). The two intersection numbers of these cycles with the embedded T 2 give the framings of the two P 1 edges which are identified in the toric graph of Fig. 4. Since p = 0 here, the four-cycles Since the bundle is trivially fibred over T 2 , one finds the vanishing intersection numbers As a consequence, the internal R-edge carries the canonical framing. The other non-trivial four-cycle in X 0 is the exceptional divisor P 2 over z i = 0. The four-cycles C 4 and C ′ 4 are far away from the center of the blowup, and so By the Calabi-Yau condition, the embedding P 1 ⊂ P 2 ֒→ X 0 must be made such that the normal bundle to P 1 in X 0 is of degree −2, which finally identifies the remaining intersection number specifying the canonical framing of the internal R ′ -edge. The intersection products (4.7)-(4.9) also uniquely fix the geometry of X 0 near the two embedded curves. The normal bundle of the elliptic curve in X 0 is the trivial rank 2 holomorphic vector bundle with the geometry of the original Calabi-Yau background X 0 = C 2 × T 2 , while the normal bundle of the rational curve is with the geometry of the ALE-type space C×A 1 . The geometry of X 0 itself is given by first forming the disjoint union X 0 ∐ (C × A 1 ) of these local neighbourhoods. Each of the two vertices in the toric graph of Fig. 4 represents a local C 3 patch of the geometry. Using the gluing morphisms constructed explicitly in [29], we glue the normal bundles in the two C 3 patches together along their common, but oppositely oriented, T 2 and P 1 two-cycles with Kähler moduli t and t ′ , respectively. The two-cycles intersect each other precisely when their associated edges share a common vertex, and the transition functions between the charts corresponding to (4.10) and (4.11) are respectively (z 1 , with the corresponding curves defined in these coordinates by z 2 = z 3 = 0). This completely specifies the scheme X 0 . However, it is not clear how to obtain a description of such a formal toric geometry as a Kähler quotient C 5 // U (1) × U (1) with respect to a moment map for the torus action, i.e. as the Higgs branch of a gauged two-dimensional, N = (2, 2) supersymmetric linear sigma-model with U (1) × U (1) gauge symmetry. 7

The Topological String Amplitude
The perturbative topological string amplitude on the blowup X 0 can be computed with the topological vertex techniques of [28,29] which respect the torus symmetries of the space. Recall that the topological vertex rules amount to assigning to each trivalent vertex of the toric graph (representing a C 3 patch of the geometry) the amplitude CR 1R2R3 (q), with q := e −gs , which depends on three SU (∞) representationsR a as well as on the orientations and framings of the edges. Its explicit form is given by are the Littlewood-Richardson tensor multiplicity coefficients, WR 1R2 (q) is the SU (∞) Chern-Simons invariant of the Hopf link in S 3 , andR = • denotes the trivial representation with empty Young tableau. The topological string amplitude on any (formal) toric Calabi-Yau threefold can be computed according to a few simple gluing rules.
Given the toric graph associated to the toric geometry, one glues together two vertices through two edges carrying a representationR and its transposeR ⊤ with the Schwinger propagator (−1) |R| e −t |R| , where t is the Kähler parameter of the P 1 two-cycle associated to the gluing edge [28,29]. This procedure corresponds to gluing curves with holes along their boundaries with the opposite orientation as described in Section 4.1 above. Since the vertex itself represents an open string amplitude in C 3 , with the representationsR a labelling boundary holonomies, the edges come with a framing ambiguity. Due to the boundary conditions imposed on each edge, the topological string amplitude depends on a choice of integers. Geometrically, this corresponds to a choice of a particular compactification of the non-compact lagrangian submanifolds C × S 1 ⊂ C 3 , wrapped by topological Amodel D-branes, that determine boundary conditions in the construction of the vertex amplitude [28,48]. If we label an edge of the vertex as v = (p, q) ∈ Z 2 (corresponding to the degeneration of the plane-projected (−q, p) cycle of the T 3 fibration) and the location of the lagrangian submanifold wrapped by the D-brane with the framing vector f ∈ Z 2 , then the condition that the lagrangian submanifold is a compact S 3 cycle can be written as the symplectic product [28] f The framing ambiguity corresponds to the shift f → f − n v for any integer n. The effect of a change of framing by n units on one edge of a vertex labelled by a representation R is to multiply the vertex amplitude (4.12) itself by the factor (−1) n |R| q n κR/2 . We will momentarily only work with the amplitude in the canonical framing in which the expression above for the topological vertex is derived. The representations at the ends of unglued edges represent D-brane degrees of freedom corresponding to asymptotic boundary conditions at infinity. As explained in [3,49], the local Calabi-Yau geometry given by the sum of two line bundles over a genus g Riemann surface requires precisely |2g − 2| closed string moduli coming from infinity. In the genus one case, no D-branes are needed to enforce boundary conditions and so the free edges are labelled by the trivial representationR = •. In other words, we are building a purely closed string amplitude. The absence of fibre D-branes is directly related [3] to the fact that there are no omega-points in the Gross-Taylor string expansion on the torus. This fact is used implicitly in Sect. 4.3 below, and also in Sect. 5.2 where we will compare the two-dimensional string perturbation series with that of topological string theory.
With all of this in mind, the topological string amplitude for the blowup of the trivial fibration X 0 is given by where Q := e −t and Q ′ := e −t ′ with t ′ the auxilliary Kähler parameter. The required topological vertex in (4.14) can be represented as where sR(x i ) are the Schur functions whose definition and relevant properties can be found in Appendix A. We can thus write (4.14) as Consider now the identity [47] i,j≥1 (4.17) In this formula a given pair of positive integers (i, j) specifies the location of a box in the Young tableau for the representationR, and hR(i, j) = n i (R ⊤ ) − i + n j (R) − j + 1 is the hook length of the box (i, j). One then has the identity i,j≥1 which follows from (4.17) by taking the logarithm of both sides of eq. (4.18) and expanding. Finally, we can simplify the expression for the topological string amplitude (4.16) further by using the identity [50] sR Combining these identities together we end up with The first product in (4.20) is an irrelevant normalization factor which we will drop in the following. As explained in Section 4.1 above (see eq. (4.6)), we can now obtain the desired partition function of topological string theory on the trivial fibration X 0 = T 2 ×C 2 by using the blowdown projection (4.3). This is accomplished by setting the Kähler parameter t ′ of X 0 to zero (equivalently Q ′ = 1), and we arrive finally at which is the anticipated result from [2]. However, the free energy corresponding to the partition function (4.21) has no genus expansion. We will see this explicitly in the next section where we will find that the only non-vanishing geometric invariants of X 0 are those at genus g = 1. In Section 6 we will encounter this feature in an alternative way. Thus to recover two-dimensional Yang-Mills theory, and its corresponding non-trivial genus expansion, we must consider topological strings propagating in a non-trivial background geometry.
It is straightforward to implement in the amplitude (4.21) the effect of a non-trivial p > 0 fibration (2.1) over the torus T 2 . As explained above, the framing corresponds to a particular compactification of a lagrangian submanifold. Thus a change of framing is reflected in a modification of the target space geometry. More precisely, a change of the canonical framing by n = p units alters the intersection numbers of the cycles of the underlying Calabi-Yau threefold in (4.7) to 22) and the corresponding normal bundle to the embedding T 2 ֒→ X p is precisely the nontrivial fibration (2.1) over the two-dimensional torus [2]. The effect of a change of framing by p units in one of the gluing edges labelled by a representationR is to multiply the vertex amplitude (4.12) by a factor (−1) p |R| q p κR/2 . Note that we change the framing of only the non-planar edge, since otherwise the framed geometry of the planar edge would not survive the blowdown projection (4.3). The effect of this procedure on the final string amplitude is to modify eq. (4.21) to the expression where we have absorbed the parity factor (−1) p |R| into the shift t → t + π i p of the Kähler modulus, analogously to what was done in [12] for the local P 1 geometry (this is equivalent to shifting the θ-angle by π p units). Confronting eqs. (3.8) and (3.21) with (4.23), we find full consistency (up to overall normalization) with the conjectured topological string interpretation of the large N partition function of U (N ) Yang-Mills theory [2]. The basic chiral and antichiral blocks are obtained from the holomorphic topological string amplitude (4.23), while a sum over the U (1) charges is required by the non-perturbative completion provided by the D-brane partition function of Section 2. The peculiar dependence on the U (1) charge ℓ has been interpreted in [2,3] as coming from a source of Ramond-Ramond two-form flux through the base Riemann surface which is wrapped by D2 branes. It would be interesting to obtain a more direct open string understanding of this phenomenon, as suggested by the analysis of the amplitude in terms of open branched covering maps given in Sect. 3.

Topological Quantum Field Theory on the Elliptic Curve
For completeness, 8 we will now briefly describe another computation of the topological string amplitude which also proceeds largely in the spirit of the formal toric geometry techniques employed above. In [26] a practical algorithm was developed to build the amplitudes of a two-dimensional topological quantum field theory, very much akin to the gluing rules of ordinary two-dimensional Yang-Mills theory, corresponding to the local Gromov-Witten theory of curves embedded in a Calabi-Yau manifold. The main idea is to define a partition function that generates Gromov-Witten residue invariants of the local threefold via equivariant integration. Up to normalization, this partition function can be used to define a topological quantum field theory. The cutting and pasting of base Riemann surfaces corresponds to the cutting and pasting of the corresponding local Calabi-Yau threefolds, as either adding or cancelling of D-brane degrees of freedom associated to the boundaries. The operations of gluing manifolds according to the formal toric constructions in the topological vertex satisfy all the axioms of a two-dimensional topological quantum field theory.
Consider the geometric tensor category of 2-cobordisms, whose objects are disjoint unions of oriented circles and whose morphisms are given by oriented cobordisms together with a pair of complex line bundles (L 1 , L 2 ) each trivialized over the boundary of the cobordism. For a connected cobordism, one can label the isomorphism classes of (L 1 , L 2 ) by their levels which are the relative Euler numbers (deg L 1 , deg L 2 ), and under concatenation using the bundle trivializations these levels add. The partition function in question is then a functor from this category into the tensor category of SU (∞) representations. It associates to the 2-cobordisms, regarded as the building blocks of the base curve, the algebra of correlators of a topological quantum field theory [26]. One can consider the set of generators for the relevant 2-cobordisms and build through the appropriate gluing rules the most general generating function of Gromov-Witten invariants for any local threefold of this type. The fundamental amplitudes are the "caps" C (−1,0) , C (0,−1) with the topology of a disc and the "pants" P (1,0) , P (0,1) with the topology of a trinion, where the superscripts represent the levels of the 2-cobordisms. By gluing together these building blocks one can reconstruct the field theory amplitudes on a general local threefold over a genus g curve Σ of the form L 1 ⊕ L 2 → Σ, where the local Calabi-Yau condition is enforced by taking deg L 1 = p + 2g − 2 and deg L 2 = −p (one then has L 1 ∼ = O Σ (p + 2g − 2) and L 2 ∼ = O Σ (−p) up to twisting by degree 1 holomorphic line bundles).
In the case of elliptic curves with trivial fibration X 0 one can build the field theory amplitude by gluing together two pants of the opposite kind, and to get the overall bundle degree right one "closes" the remaining holes with the appropriate caps to cancel the overall Chern class. In the framework of the topological vertex, we can interpret the pant as the A-model vertex amplitude (4.12) itself and the cap as the vertex CR •• (q) with trivial representations at the ends of two edges, i.e. with a single stack of D-branes in C 3 . Thus the topological field theory approach, which is directly related to two-dimensional Yang-Mills theory [3], suggests the formal toric geometry whose toric graph is depicted in Fig. 5. Using topological vertex techniques, it is straightforward to show that the topological string amplitude on this geometry coincides with the amplitude computed in Section 4.2 above, provided that the two additional internal edges have the same Kähler length and the edge labelled R ′ is shrunk to zero size as before. The details of this calculation can be found in Appendix B.
This new geometry defines a non-singular, regular formal toric Calabi-Yau schemeX 0 which can be obtained as the blowup of X 0 at three points. When the two additional Kähler classes coincide, Gromov-Witten invariants of the threefoldX 0 coincide with those of the one-point blowup X 0 considered above. This is reminiscent of the relations construed in the construction of [12], whereby a toric variety was built in which the extra Kähler moduli -25 -

Invariant Theory of the Local Elliptic Threefold
The goal of this section is to compute and compare various symplectic geometry invariants of the threefold X p . We will consider the Gromov-Witten invariants, which count classes of holomorphic maps into X p , and their relation with the Hurwitz numbers that count inequivalent branched coverings of T 2 . The precise connection that we can make in this case between Gromov-Witten theory and Hurwitz theory owes to the facts that (a) the only nontrivial two-homology class of X p is the base elliptic curve T 2 itself; (b) the space X p carries an action of non-trivial torus symmetries as described in Sect. 4; and (c) X p has properties similar to those of a compact Calabi-Yau threefold. This yields a formal combinatorial solution for the Gromov-Witten theory of X p . We will also determine the Gopakumar-Vafa invariants of X p , which have a more physical origin in the counting of BPS states arising in a Type IIA compactification of X p and are therefore naturally integer-valued. Finally, we show how the two-dimensional gauge theory leads to a remarkably simple solution for the Donaldson-Thomas theory of X p , and compare it with the computation of the Gopakumar-Vafa invariants.

Computing Gromov-Witten Invariants
When the topologically twisted A-type sigma-model with target space X p is coupled to topological gravity, the topological string free energy F Xp g (t) is given by a sum over genus g worldsheet instanton sectors. The string path integral localizes onto the space of stable holomorphic maps from connected genus g curves to the target Calabi-Yau space X p lying in two-homology classes β ∈ H 2 (X p , Z). It is therefore given by an integration over the moduli space M g (X p , β) of these maps which generalizes the (stable compactification of the) moduli space M g of genus g algebraic curves. More precisely, there is a natural forgetful map M g (X p , β) → M g , and an element of M g (X p , β) is given by a point Σ ∈ M g together with its imbedding ψ : Σ → X p in the target space X p . The pushforward of the imbedding map fixes the homology class β : Since we consider only orientationpreserving holomorphic string maps ψ in the A-model, we can further restrict to positive degrees d. 9 It follows that the free energy of topological string theory on the elliptic threefold has a perturbative expansion of the form where the coefficients N g d (X p ) ∈ Q are the Gromov-Witten invariants of X p which count the number of holomorphically imbedded curves in X p of genus g and degree d.
The formal definition and properties of the rational numbers N g d (X p ) will be given in Sect. 5.2 below. Here we shall consider explicitly the powerful identification made above between the topological string amplitude on X p and the chiral partition of two-dimensional Yang-Mills theory on the base torus. We will illustrate how the modularity properties of the gauge theory can be exploited as an efficient tool to extract Gromov-Witten invariants of the local threefold. 10 By matching the two genus expansions (3.13) at ℓ = 0 and (5.1), and using the identifications (3.7) and (3.22) between the gauge coupling and the string moduli (here we set θ = 0), one has the relation F Xp g (t) = p 2 2g−2 F g (λ) . (5. 2) The chiral free energy F g (λ) of Yang-Mills theory on the torus T 2 was studied in detail in [41,45,51]- [54]. As mentioned in Sect. 3, the genus g contribution F g (λ) is a quasi-modular form of weight 6g − 6 under the action of the modular group P SL (2, Z) acting on the dual Teichmüller parameter τ = −t/2π i . This implies that they can be expressed as polynomials over Q in the holomorphic Eisenstein series for k = 2, 4, 6, where B k ∈ Q is the k-th Bernoulli number. The modular forms E 4 (τ ) and E 6 (τ ) can be expressed in terms of E 2 (τ ) and its derivatives as This leads to compact forms for the free energies given by with g ≥ 2 and ρ g , s kl g ∈ N, where η(τ ) is the Dedekind function. Note that the genus one contribution coincides with the p = 0 topological string amplitude (4.21) (up to normalization by the ground state energy corresponding to the empty Young tableau). Explicit formulas for F g (λ) up to genus g = 8 can be found in [45], where the relevant numerical coefficients ρ g and s kl g were computed explicitly. 11 As an explicit example, let us analyse in some detail the genus 2 and 3 free energy contributions, which are given respectively by We can substitute the explicit form (5.3) for the basic Eisenstein series E 2 (τ ) and expand the free energy up to the desired order in Q as From these formulas one can use the relations (5.1) and (5.2) to read off directly the Gromov-Witten invariants N g d (X p ) ∈ Q from the coefficient of Q d in the expansion of F g (λ).

Combinatorial Solution via Hurwitz Theory
We will now give a formal solution to the counting problem above by relating the Gromov-Witten invariants of the threefold X p to the simple Hurwitz numbers of the base torus. This relationship is immediately implied by the expansion (3.15). However, before spelling this out, it is instructive to understand why such a simplification of Gromov-Witten theory arises directly from the point of view of topological string theory, as this provides further insight into the conjectured nonperturbative completion to two-dimensional Yang-Mills theory. This is straightforward to do by appealing directly to the definition of the rational numbers N g d (X p ) [26] upon which the topological quantum field theory of Sect. 4.3 is based. Generally, the Gromov-Witten invariants of a nonsingular, projective complex algebraic variety X of complex dimension three are defined by integrals of tautological cohomology classes over the moduli spaces M g (X, β) against their virtual fundamental classes. By the Riemann-Roch theorem, the virtual dimensions are given by dim M g (X, β) vir = β c 1 (T X) . A stable map to X which is invariant under the toric action factors through the zero section of the fibration X → Σ and hence there is an isomorphism This implies that T -equivariant topological string theory on X reduces to a topological string theory on the two-dimensional target space Σ. The corresponding Gromov-Witten invariants are then related to the Hurwitz numbers counting covering maps to Σ. However, because of the finite-dimensional integration over e g,d T (X), one obtains in this way a qdeformation of the standard Hurwitz theory [26,12,14]. Recall that it is precisely this equivariance which localizes the N = 4 D-brane gauge theory in four dimensions to a two-dimensional gauge theory.
The elliptic threefold X = X p is special in this regard, as then c 1 (T X p ) = 0 and the virtual dimension (5.9) vanishes. In this case the fixed points (5.10) are isolated and the residue Gromov-Witten invariants are simply given by the degrees of the corresponding virtual moduli spaces as where the moduli space M g (T 2 , d) is precisely the Hurwitz space of simple branched covers of the underlying elliptic curve. Note that the isomorphism (5.10) is crucial for this correspondence between Gromov-Witten invariants and Hurwitz numbers, i.e. it is a feature of the equivariant topological string theory on X p defined with respect to the natural torus symmetries. This is the definition that is provided by the topological vertex constructions of Sect. 4 [29]. The invariants (5.11) are rational-valued because of the orbifold nature of the Deligne-Mumford moduli spaces involved. The equalities (5.10) and (5.11) show directly that this topological string theory coincides with that defined by the standard two-dimensional sigma-model with target space T 2 [5], with the contributions of T -equivariant Euler characters in (5.11) coinciding with the usual orbifold Euler characters of the analytically compactified Hurwitz spaces [56]. 12 The simple Hurwitz numbers H g,d ∈ Q of the torus may be extracted from the explicit form for the chiral free energy (3.16) of Yang-Mills theory on T 2 as derived from eq. (3.8). They are given by the formula [41] where H • g,d are the disconnected simple Hurwitz numbers which count reducible coverings of the torus and can be expressed through the combinatorial formula By comparing the free energy (3.16) in the trivial charge sector ℓ = 0 with the expansion (5.1) and the relation (5.2), we arrive at our desired closed formula for the Gromov-Witten invariants in the form (5.14) 12 The analogous formulas in the case of a curve Σ of genus g = 1 [26] make precise the observation of [23] that the Euler characters of configuration spaces of Riemann surfaces (whose orbifold singularity blowups yield Hilbert schemes of points in Σ) continue to appear in the large N expansion of q-deformed Yang-Mills theory on Σ. In this case one should introduce an additional Euler class of the tangent bundle to the moduli space in the moduli space integral in order to account for the |2g − 2| fibre D-branes arising from the large N expansion of the gauge theory.
We can understand better the geometrical meaning of this result by looking more closely at the framing dependence of (5.14). For p = 0, only the genus one invariants are non-zero and they count unramified coverings of the torus of degree d, or equivalently sublattices of Z ⊕ τ Z of index d which after taking into account automorphisms is the number This is consistent with the free energy computed in (4.21) and in (5.2,5.5), and it has also been independently derived directly in Gromov-Witten theory [57] by using basic constructions related to the virtual fundamental class. This structure arises because for p = 0 the elliptic curve is isolated in X 0 , and (5.15) represents the expected contributions [5] of isolated genus one curves and their multi-wrappings to the free energy F X 0 1 (t). From eq. (4.21) it follows that there is no contribution to F X 0 g (t) for g > 1, in accordance with [5], due to the absence of non-trivial two-cycles of higher genus in the background geometry and the fact that there are no bubbling contributions of genus one curves to higher genus curves.
In contrast, for p > 0 the Gromov-Witten invariants (5.14) are generically nonvanishing for all genera. In this case the elliptic curve is not isolated but belongs to a continuous family ψ z : T 2 (z) → X p , z ∈ C 2 of holomorphic maps determined by sections of the non-trivial fibration (2.1). Then the contribution to F Xp g (t) is simply the total number (modulo automorphisms and an irrelevant overall rescaling by p) of genus g branched covers of the torus. By composing covering maps with the holomorphic maps ψ z , one obtains a family of holomorphic maps from genus g surfaces to X p whose parameter space is M g (T 2 ) × C 2 , where M g (T 2 ) = d≥1 M g (T 2 , d) can be described [56] as the base space of an infinite-dimensional bundle whose total space parametrizes genus g holomorphic maps to T 2 . By taking the Euler class of C 2 to be 1, the free energy F Xp g (t) may alternatively be described [56] as the (orbifold) Euler character of a bundle over the moduli space of parameters M g (T 2 ) × C 2 for the family of genus g curves. Because the virtual dimension of the moduli space of maps M g (T 2 , d) is zero in the present case, this is again in agreement with general expectations [5]. There are no other contributions due to the isomorphism (5.10). A more physical picture of these features of the topological string expansion will be described in Sects. 5.3 and 5.4 below in a manner akin to the construction of the black hole partition function in Sect. 2.

Gopakumar-Vafa Integrality
Within the framework of Type IIA superstring theory, the rational invariants N g d (X p ) can be expressed in terms of the integer Gopakumar-Vafa invariants n g d (X p ) [58,59] which count four-dimensional BPS states of wrapped D2 branes in a Type IIA compactification on X p . The all genus topological string free energy (5.1) encodes the contributions of these states through the expansion 16) where n r d (X p ) is a twisted supersymmetric index in four dimensions which receives contributions only from BPS states of d D2 branes which wrap the embedded torus T 2 in X p . The quantum number r of these particles labels their left spin representation of the rotation group SO(4) ∼ = SU (2) × SU (2), where m denotes the irreducible mdimensional representation of SU (2). The integer k in (5.16) is the number of D0 branes used to form the given D0-D2 BPS bound state. A precise mathematical definition of these invariants is not yet known and the integrality of the numbers n g d (X p ), although obvious from their Type IIA definition, has no rigorous proof directly in the context of the topological string theory on X p . Analogously to [12], we will provide another non-trivial check of the conjecture of [2,3] by showing that the local elliptic threefolds X p satisfy the integrality conjecture. By assuming that the partition function of the chiral sector of Yang-Mills theory on the torus is equivalent to the partition function of topological string theory on X p , we will compute the Gromov-Witten invariants using the technique explained in Sect. 5.1 above and extract from them the Gopakumar-Vafa invariants by using an inversion formula. The displayed integrality of the closed BPS invariants obtained in this manner then provides further strong evidence that two-dimensional Yang-Mills theory indeed does provide a non-perturbative definition of the topological string.
Gopakumar-Vafa invariants are related to Gromov-Witten invariants by equating the instanton sum (5.1) to the index (5.16). This relationship was explicitly inverted in [60], and we will now briefly review the derivation. The idea is simply to match the coefficients of both series regarded as functions of Q and g s , and thereby determine n r d (X p ) recursively in terms of N g d (X p ). For this, we write k = n d ∈ N in (5.16) for fixed n and match the coefficients of the Q n term in each series. This gives the relation The final step consists of trading the sum over k for one over d/k, expanding the inverse sine function in a power series, and equating the coefficients of y 2r−2 on both sides of (5.19). In this way we arrive at where the rational number α r g is the coefficient of u r−g in the power series expansion of the function arcsin( 2g−2 , which may be determined explicitly through the recursion relations α r r = 1 , These tables exhibit the remarkable feature that each invariant n r d (X p ) is an integer for every p ∈ Z. The full set of Gromov-Witten and Gopakumar-Vafa invariants up to genus g = 6, spin r = 6 and degree d = 15 can be found in Appendix C, with the same integrality properties. It is also possible to obtain a formal combinatorial solution to the BPS state counting problem in terms of Hurwitz numbers by using (5.14) to write Given this rather explicit formula, it should be feasible to construct a combinatorial proof of the integrality of the BPS invariants of X p , but we have not been able to do so.
The physical and geometrical significances of this result can be understood by again closely analysing the framing dependence of (5.24). Consider first the case p = 0. Then only the g = 1 term survives in (5.24), and since α r 1 = δ r,1 the only non-zero invariant is where the last equality can be derived by applying Möbius inversion to the function f (n) = σ 1 (n) := d|n d. This result means that d D2 branes in representation I 1 , containing two spin 0 particles and one spin 1 2 particle, form a single bound state for all d and there are no stable bound states of D2 branes in the higher spin representations I r , r > 1. Geometrically, it arises as a consequence of the fact that, for D2 branes wrapping an isolated elliptic curve, only curves Σ whose genera g coincide with the arithmetic genus r = 1 realize that class.
Quantum mechanically, the configuration of D2 branes fluctuates over the D-brane moduli space M D (X 0 , d). We can algebraically deform the set of d D2 branes wrapping the isolated T 2 into a single large D2 brane wrapped around the cycle d times, as such a deformation defines a point in the same moduli space. One component of this moduli space then comes from the U (1) flux of the bound D0 branes, which is the moduli space M 1,0 (1, 0) of flat U (1) line bundles over T 2 . From eq. (2.14) it follows that this moduli space is the dual torusT 2 , which is just the jacobian torus of the elliptic curve. The D-brane moduli space in this case is thus M D (X 0 , d) = M 1 (X 0 , d) T ×T 2 . The supersymmetric quantum ground states correspond to cohomology classes in There is an isomorphism H 2 (T 2 , C) = ω T 2 · H 0 (T 2 , C). The Kähler class induces a Lefschetz operator which defines a representation of the group SU (2) on the cohomology ring H ♯ (T 2 , C) through the Lefschetz decomposition It follows that the full Hilbert space of ground states is given by its decomposition as an SU (2) representation. On the other hand, for p > 0 the Gopakumar-Vafa invariants (5.24) are generically non-vanishing for all arithmetic genera r. As the elliptic curve is no longer isolated inside the threefold X p , by composing with covering maps of T 2 there are contributions to the number of BPS states from all allowed genera g of the D2 branes with 1 ≤ g ≤ r and all degrees d ′ dividing their number d for which the Möbius function µ d d ′ is non-vanishing. The sum over Hurwitz numbers H g,d ′ at fixed g is generically expected from adding up all torus invariant bound states. The quantum states contributing at each genus g correspond to the jacobian torusT 2g (the moduli space of flat U (1) bundles on a genus g curve), whose complex cohomology ring admits a Lefschetz decomposition H ♯ (T 2g , C) ∼ = I g as a representation of SU (2). The spin r invariants (5.24) can thus be thought of as the virtual number of genus r jacobians contained in the D-brane moduli space M D (X p , d). This moduli space should be fibred over the geometric moduli spaces g≥1 M g (X p , d) T in (5.10) with fibreT 2g over each imbedded curve (Σ, ψ) ∈ M g (X p , d) T . The integers (5.24) then give the coefficients in the decomposition of the fibrewise representation of SU (2) on H ♯ (M D (X p , d), C) in the basis given by the cohomologies of the jacobian tori.
However, the full D-brane moduli space at p > 0 at present is not known. To specify a D2 brane wrapping a holomorphic curve Σ one needs to fix a holomorphic line bundle, as above, or more generally a semi-stable coherent sheaf over Σ. In [61] it was proposed to take M D (X p , d) as the normalized moduli space of degree k semi-stable sheaves on X p (with k corresponding to the D0 brane charges in (5.16)) of pure dimension 1 with Hilbert polynomial d k + 1, with the natural morphism onto the moduli space of support curves of sheaves of degree d in X p . In [62] it was suggested that the BPS invariants (5.24) could be defined in terms of Donaldson-Thomas invariants of this moduli space, at least in some special circumstances. In [63] a physical relation between the Gopakumar-Vafa and Donaldson-Thomas invariants was proposed in terms of the counting of black hole microstates in four and five dimensions. Understanding the connection between our formula (5.24) and Donaldson-Thomas theory could help shed light on the precise geometrical definition of Gopakumar-Vafa invariants for generic threefolds, and we briefly explore this connection in Sect. 5.4 below.
Note that for d = 1 and r > 1, all invariants (5.24) vanish, while again n 1 d (X p ) = 1 for all p ≥ 0 and all d ≥ 1. This owes to the geometrical fact that a simple branched covering of the torus by a curve of genus g > 1 requires at least two sheets (so that M g (X p , 1) T = ∅ for all g > 1). Physically, this means that there are no higher spin bound states of a single wrapped D2 brane. On the other hand, bound states of multiply wrapped D2 branes on a non-isolated T 2 appear to exist for all arithmetic genera r.

Donaldson-Thomas Theory
The topological A-model on the local Calabi-Yau threefold X p localizes onto a sum over worldsheet instantons that can be described as curves of particular genus embedded in the target space. However, there is another point of view that naturally arises in the counting of complex curves. Each curve can be characterized by a set of equations on the manifold for which the zero locus defines an ideal sheaf on X p . The two points of view are complementary. While the first one is natural in the context of worldsheet instanton contributions leading to the Deligne-Mumford moduli space of holomorphic curves in X p and Gromov-Witten theory, the second one is more apt to the counting of D-branes in a dual theory leading to the moduli space of ideal sheaves on X p and Donaldson-Thomas theory. This dual theory should provide the proper construction of the BPS invariants (5.24) as the multiplicities of SU (2) Lefschetz representations on the cohomology of the moduli space of sheaves on X p . Since X p is a local Calabi-Yau threefold fibred over T 2 , this cohomology should reduce to that of an appropriate moduli space of rank d bundles on T 2 , consistent with the expectation that the dual theory is realized as a six-dimensional topological U (1) gauge theory on X p [64,65]. We will verify these expectations presently.
Each ideal sheaf I on X p defines a subscheme Y ⊂ X p through the short exact sequence of sheaves given by where O Xp (resp. O Y ) is the structure sheaf of holomorphic functions on X p (resp. Y ). When Y contains the support curve of the sheaf, it is characterized by its homology class β = [Y ] = d [T 2 ] ∈ H 2 (X p , Z) and by the holomorphic Euler characteristic χ(O Y ) = m. The degree of Y may be characterized as the intersection number #(Y ∩ (X p ) z ) = d over a generic base point z ∈ T 2 . The set of isomorphism classes is the moduli space of ideal sheaves I m (X p , d) which is isomorphic to the Hilbert scheme of curves of the given topology in X p . Counting elements of I m (X p , d) corresponds physically to counting BPS bound states of a single D6 brane wrapping X p and d D2 branes wrapped on the holomorphic two-cycles [Y ] with |m| D0 branes. Generally, an application of the Grothendieck-Riemann-Roch theorem shows that the virtual dimensions of these moduli spaces are again given by the formula (5.9). The Donaldson-Thomas invariants of X p are defined as the degrees of the zero-dimensional virtual fundamental classes of I m (X p , d) through Analogously to (5.11), the toric action on X p canonically lifts to the moduli space of ideal sheaves and the integration is defined by virtual localization onto the isolated T -fixed point set I m (X p , d) T ⊂ I m (X p , d) as an equivariant residue [66,67]. Compared with (5.11), the Euler characteristic of the sheaf now plays the role of the genus of the curve. Any support curve Y ⊂ X associated to an element of I m (X p , d) T is preserved by the torus action and hence is supported on the base T 2 . The genus of Y may be defined as the integer g(Y ) = 1 − χ(O Y ) and can be negative. The invariants (5.29) are integer-valued since no orbifold is taken in the definition of the moduli space. These invariants can be encoded in the Donaldson-Thomas partition function The leading degree d = 0 term is Z DT 0 = 1 in this case since χ(X p ) = c 1 (T X p ) = 0 [66,67]. It was conjectured in [66], and proven in [67] for local Calabi-Yau threefolds fibred over a Riemann surface, that the Donaldson-Thomas partition function (5.30) coincides with the perturbative topological string partition function Z Xp = e F Xp after the analytic continuation g s → − i g s in the all genus expansion (5.1). 13 This continuation is a result of the relation [65] between the string coupling g s and the θ-angle of the noncommutative topologically twisted U (1) gauge theory on X p given by q = − e i θ . The noncommutative deformation of the present geometry can be understood in terms of the formal toric blowup X p → X p constructed in Sect. 4. Torsion-free sheaves on X p can be lifted to X p where they may be identified with line bundles. Most of the ensuing results in the rest of this section should therefore be understood as being derived on X p after the blowdown projection is taken, as described in Sect. 4.1. Indeed, one has a completely analogous equality as (4.6) for the corresponding Donaldson-Thomas invariants [68].
The main impetus into this identification is the observation [64,65] that the gluing rules of the topological vertex used to construct the topological string amplitude in Sect. 4.2 naturally correspond to torus invariant ideal sheaves in the threefold X p . In particular, the SU (∞) representationsR contributing to the chiral gauge theory partition function (4.23) on T 2 are in bijective correspondence through their Young diagrams with the sets where IR is a one-dimensional monomial ideal in the coordinate The homogeneous ideal IR is the restriction of an ideal sheaf IR ∈ I m (X p , d) T , with d = |R|, to the intersection of C 3 patches of the formal toric geometry of X p constructed in Sect. 4. This naturally ties the two-dimensional gauge theory to the melting crystal picture of [64].
By matching the partition functions (5.30) and (4.23) we can write down a formal combinatorial solution for the Donaldson-Thomas theory of X p . After a rearrangement of the expansion (4.23) into a sum over Young tableauxR with fixed numbers of boxes |R| = d and fixed quadratic Casimir invariants κR, one finds In particular, the Donaldson-Thomas invariants vanish whenever m / ∈ p Z. Once again, let us study the framing dependence of (5. To understand this result geometrically, we associate as above to any partitionR ⊢ d a monomial ideal IR in the fibre coordinates (z 1 , z 2 ) ∈ C 2 ⊂ X 0 . It defines a subscheme YR ⊂ X 0 supported on T 2 at z 1 = z 2 = 0 of degree d and Euler characteristic χ(O YR ) = 0 due to the triviality of the normal bundle (4.10). These are the only such subschemes, and each of these ideals defines an isolated point of the moduli space I 0 (X 0 , d) T . Eq. (5.32) now follows since there are Π(d) such points. On the other hand the moduli space I 1 (X 0 , 1) T , for example, consists of ideal sheaves of support Y = T 2 ∪ {z} with z ∈ X 0 \ T 2 . It follows [69] that I 1 (X 0 , 1) T is the equivariant blowup of X 0 along the elliptic curve T 2 , and so D 1 1 (X 0 ) = −χ(I 1 (X 0 , 1) T ) = −χ(X 0 ) = 0. Now let us turn to the cases p > 0. For a Young tableauR containing d boxes, the quadratic Casimir invariant can be written as [50]  Note that ifR is a partition of d, then so is its transposeR ⊤ and the bijectionR →R ⊤ sends (i, j) → (j, i) for each box (i, j) ∈R in (5.34). This is equivalent to the reflection symmetry mR(p) → mR ⊤ (p) = −mR(p), proving that the Donaldson-Thomas partition function (5.30) is invariant under the transformation q → 1/q exchanging D0 branes with antibranes as conjectured in [66]. Since the normal bundle to the non-planar edge in the formal toric geometry of X p is O T 2 (p) ⊕ O T 2 (−p), the formula (5.34) coincides with the general formula for the Euler characteristic χ(O YR ) derived in [66] using elementary calculations in toric geometry. Alternatively, this formula can be derived by calculating the six-dimensional instanton contributions to the deformed U (1) gauge theory on X p [65] (with the one-loop fluctuation determinants on the blowup X p given by the products in eq. (4.20)), demonstrating the equivalence between the two-dimensional and six-dimensional gauge theory descriptions of the topological string. The first few allowed charges are provided in the table (5.36) Compared to the Gromov-Witten and Gopakumar-Vafa invariants, we see that the counting of torus invariant bound states of D-branes in Donaldson-Thomas theory is provided by very simple formulas. The combinatorics, as well as the non-trivial framing of the geometry, come into play only in the enumeration of the total number of bound states at a given degree d and in the determination of the contributing configurations of D0 branes using the formula (5.34). The total number of bound states again exhibits an exponential behaviour in its growth at fixed large d. We can obtain a formal relationship between all of the invariants, as well as giving an implicit definition of Gopakumar-Vafa invariants in terms of the moduli spaces of ideal sheaves, by appealing to the Gopakumar-Vafa expansion (5.16) of the topological string free energy. By equating the exponentiation of this expansion with (5.30) we may express the Donaldson-Thomas partition function in terms of Gopakumar-Vafa invariants as [69] where we have used the fact that the genus zero BPS invariants n 0 d (X p ) all vanish along with n r 1 (X p ) = δ r,1 and n 1 d (X p ) = 1 for all d. As expected, the genus one contribution represented by the Dedekind function in (5.37) factors out separately in the partition function. Using the Donaldson-Thomas invariants computed above, eq. (5.37) gives a recursive procedure for computing the involved Gopakumar-Vafa invariants of Sect. 5.3 above. This has the virtue of formally making various aspects of the BPS invariants more natural within the context of Donaldson-Thomas theory.

Chern-Simons Theory on Torus Bundles
In this section we will take a somewhat different approach to analysing topological string dynamics on the local elliptic threefold X p . We will explore the relation between the two-dimensional Yang-Mills theory, describing the four-dimensional instanton counting explained in Sect. 2, and Chern-Simons gauge theory. While a complete description of the N = 4 gauge theory in four dimensions is presently out of reach, the three-dimensional gauge theory can be solved exactly and used to elucidate the connection between the two-dimensional gauge theory and its higher dimensional origins. This relation has been suggested in [3]. The basic idea is that the four-dimensional physics is captured, in this context, by a three-dimensional Chern-Simons theory that lives on the boundary of the non-compact four-cycle To understand the geometry of this three-manifold, it is convenient to introduce a hermitean metric on the fibres of the holomorphic line bundle. Then the four-manifold C 4 can be identified with the total space of the unit disk bundle D(L ⊗−p ) → T 2 , where L → T 2 is the canonical hermitean (monopole) line bundle over the torus. The bundle D(L ⊗−p ) contains those fibre vectors of L ⊗−p with norm ≤ 1, and its boundary is the unit circle bundle over T 2 . This gives the three-manifold ∂C 4 the structure of a Seifert manifold (the total space of a circle bundle over a Riemann surface). For instance, for the trivial fibration one has D( The emergence of the U (N ) Chern-Simons theory can be understood heuristically as follows. An instanton excitation on the four-manifold C 4 is described by the topological density Tr (F ∧ F ). Locally, on each contractible C 2 patch of C 4 , this closed 4-form is exact and can be written as the exterior derivative of the Chern-Simons 3-form Tr (A ∧ dA + 2 3 A ∧ A ∧ A). This formally means that the four-dimensional instanton counting problem should reduce to the evaluation of the Chern-Simons partition function with k ∈ N 0 . 14 This rather crude correspondence carries with it certain subtleties which we will explain in detail later on. Note that one should set the θ-angle in (2.2) to zero in order to work out the equivalence with Chern-Simons gauge theory, because there is no θ-angle in three dimensions. According to [17] (see also [18]), the partition function (6.2) naturally localizes onto a two-dimensional gauge theory on the base torus of the Seifert fibration T 3 p → T 2 . The purpose of this section is to give an explicit realization of this localization in terms of the previously studied Yang-Mills gauge theory on T 2 , and to match it to the problem of BPS state counting described in Sect. 2.4. This relates the closed topological string theory on X p to a dual open topological string theory on the cotangent bundle T * T 3 p .

Chern-Simons Gauge Theory on a Mapping Torus
We will now explicitly compute the Chern-Simons partition function (6.2), as a first step in connecting four-dimensional and two-dimensional physics with gauge theory in three dimensions. Later on this connection will be used to analyse the D-brane partition function of Sect. 2. We begin by considering Chern-Simons theory with gauge group SU (N ) on the trivial Seifert fibration over T 2 which is the three-torus T 3 p=0 ∼ = T 3 . Generally, the Chern-Simons path integral on any three-manifold of the form Σ × S 1 , with Σ a compact Riemann surface, can be readily computed in the hamiltonian formalism [70]. The idea is to construct the finite-dimensional Hilbert space H k (Σ) of the topological gauge theory on each time slice Σ and then study the propagation of physical states in the time direction I = [0, 1] with the vanishing Chern-Simons hamiltonian. The circle S 1 is built by identifying the endpoints of the unit interval I, i.e. by identifying the initial and final states. This is implemented by taking a trace over the quantum Hilbert space, giving finally the partition function In particular, the Hilbert space H k SU (N ) (T 2 ) is the space of integrable representations of SU (N ) at level k [70,71]. A complete orthonormal basis for this space is thus built through SU (N ) representationsR with at most k boxes in their associated Young tableaux. We will denote by |R a generic vector of this basis. This Hilbert space has dimension [71] dim H k SU (N ) T 2 = N − 1 + k k . (6.4) Next we consider SU (N ) Chern-Simons theory on the Seifert manifold T 3 p for p > 0. For this, it is convenient to have an alternative description of the three-manifold in question which exploits the uniqueness theorem for Seifert fibrations. The idea is that in the timeslicing construction above we have turned the (trivial) S 1 -bundle over T 2 "on its side" and effectively treated it as a T 2 fibration over S 1 . This can also be accomplished for the generic circle bundles T 3 p → T 2 with p > 0 by taking a closer look at its underlying Seifert structure. Excise a disk D 2 from the base T 2 of the fibration and denote the resulting surface by E. Then the circle bundle M p := E × S 1 has boundary ∂M p = ∂E × S 1 ∼ = S 1 × S 1 which is another two-torus. Each non-contractible circle in this torus is isotopic to a unique "linear" S 1 which lifts to a line y = −p x of slope −p in the universal cover R 2 → S 1 × S 1 . In M p , attach a solid torus D 2 × S 1 along its T 2 boundary to the torus ∂M p by the diffeomorphism which takes a meridian circle ∂D 2 × {y} of ∂D 2 × S 1 to a circle of slope −p in ∂M p . The slope −p uniquely specifies the resulting three-manifold. The S 1 -fibring of M p extends to a Seifert fibring of this three-manifold via the standard circle fibration of each attached solid torus. By the uniqueness of Seifert fibrations, this three-manifold coincides with the original T 3 p ∼ = S(L ⊗−p ).
We will match this Seifert structure to that of a particular torus bundle. Generally, a mapping torus is defined for any complex curve Σ and a diffeomorphism β : Σ → Σ as In the case where Σ is a two-torus, every diffeomorphism β : T 2 → T 2 is isotopic to a uniquely determined large diffeomorphism K ∈ SL(2, Z) which is essentially the map β * on H 1 (T 2 , Z) ∼ = Z 2 induced by β. The modular group SL(2, Z) is generated by the elements which satisfy the relations S 2 = (S T) 3 = 1 1. The torus bundle T 2 × K S 1 → S 1 is irreducible (i.e. every two-sphere in T 2 × K S 1 is contractible), exactly like our Seifert manifold T 3 p , since its universal cover is R 3 .
Consider now a Seifert fibring of T 2 × K S 1 determined by the modular transformation matrix K = K (p) , where Then the generic torus fibre of the T 2 -bundle T 2 × K (p) S 1 is isotopic to a vertical surface (a union of S 1 fibres), and so its complement in T 2 × K (p) S 1 is T 2 × I which has only the trivial product Seifert fibring up to isomorphism. Regarding T 2 × I as a trivial circle bundle, the linear transformation (6.7) preserves the slope in annuli whose boundaries have the same slope in both ends T 2 × {0} and T 2 × {1}. This is the same Seifert fibring as for our original three-manifold and so there is an isomorphism It is interesting to use this point of view to consider the distinction from the trivial fibration with p = 0. In that case K (0) = 1 1 (in P SL(2, Z)) and the generic torus fibre is a horizontal surface (transverse to the S 1 fibres), because T 3 0 is exactly the same three-manifold T 2 × S 1 in both of its fibre bundle descriptions which are given by the canonical projections onto the first and second factors.
We can apply this geometric construction to the evaluation of the Chern-Simons partition function on T 3 p . Generally, the identifications used to construct the mapping torus (6.5) imply that the initial and final states are identified by the diffeomorphism β in the quantum gauge theory. This modifies the result (6.3) of the functional integration to where O β is the operator acting on H k (Σ), induced by the gluing morphism β, which arises from the representation of the mapping class group of Σ on the physical Hilbert space.
Applying this formula to the modular transformation (6.7) we find In this formula we see the origin of the mass deformation p Tr (Φ 2 ) introduced in (2.3), which was the only term in the partition function accounting for the non-triviality of the fibration. In the Chern-Simons formulation the insertion of this operator corresponds to the presence of the gluing operator T −p . The three-dimensional gauge theory thereby naturally explains the occurence of the quadratic superpotential which was argued in [2] to arise in the four-dimensional topologically twisted gauge theory on C 4 as a result of integrating out a holomorphic section of the line bundle O T 2 (p) (having p zeroes). This fact has also been noticed using surgery techniques in [15,18,48,72,73], and it agrees with the topological string calculation of Sect. 4.2 wherein the amplitudes on non-trivial fibrations were constructed by insertions of the framing operator q p C 2 (R)/2 (which as we show below corresponds to T −p ) in the path integral for the trivial bundle. The lift O T to H k SU (N ) (T 2 ) of the modular transformation T in (6.6) is a diagonal operator in the Verlinde basis of integrable SU (N ) representations which can be expressed as [72] where ρ is the Weyl vector (the half sum of the positive roots of SU (N )) and Tr n(R) + ρ 2 = C 2 R + Tr ρ 2 (6.12) is given in terms of the natural inner product on the Lie algebra su(N ). We can read off the norm of the Weyl vector (the Freudenthal-de Vriess formula) by expressing (6.11) in terms of conformal invariants of the SU (N ) Wess-Zumino-Witten model at level k as [70,72] Q | O T |R = δQ ,R e 2π i (∆R−c/24) , (6.13) where are respectively the conformal weight of a primary field in the representationR and the central charge of the conformal field theory at level k. Since the contribution from the central charge is independent of the SU (N ) representation, it can be regarded as an overall normalization and the partition function (6.10) of SU (N ) Chern-Simons theory on the mapping torus T 3 p finally reads It remains to extend these calculations to gauge group U (N ), which is the one relevant for the counting of black hole microstates through the D-brane partition function. To start, as obtained in [74] using the free fermion representation of the Chern-Simons gauge theory, we have This dimension formula reflects the decomposition U (N ) = SU (N ) × U (1)/Z N , where N (k + N ) is the effective U (1) Chern-Simons coupling. As before, for p = 0 the partition function computes the dimension of the Hilbert space of physical states. The corresponding free energy is the logarithm of (6.16), as computed in [71], and it has a large N expansion beginning at order N . This fact was stressed in [74] as evidence that Chern-Simons theory on T 3 does not admit a closed string theory interpretation. Indeed, we will later on show that a closed string theory interpretation of Chern-Simons gauge theory on a torus bundle over the circle, if it exists, is provided by two-dimensional Yang-Mills theory interpreted as a topological string theory as in the previous sections. In the case of the three-torus with p = 0 all higher genus geometric invariants of the corresponding local Calabi-Yau background X 0 vanish and there is no closed string genus expansion, in complete agreement with the observations of [74]. A complete basis for the irreducible, integrable representations of the unitary group U (N ) at level k is given by Young tableaux R whose rows are labelled by a set of integers The range of the integer r can be determined from (6.16) by the dimension constraint (here we tacitly assume that k is even and N is odd).
Finally, using eqs. (3.1) and (3.2) we can compute explicitly the U (N ) Chern-Simons partition function in the form (6.15) as up to an overall normalization factor. The argument of the exponential in (6.22) can be written as Returning to the original U (N ) weight variables using eq. (6.18) we then have and so one finds that up to an irrelevant overall normalization factor the amplitude (6.22) reads In the generic case the centralizer subgroup U γ(h) is of the form (2.10) and we can repeat the above construction in each U (N i ) block. Thus γ(h) = r i=1 e −2π i m i /p N i 1 1 N i with Chern classes m i obeying 0 ≤ m i < p N i , and γ(h) −p lives in the center of the symmetry breaking pattern Z N 1 × · · · × Z Nr ⊂ SU (N 1 ) × · · · × SU (N r ). The decomposition of γ into irreducible representations is given by Except for the finite ranges of the Chern numbers m i , this classification is identical to the classification of Yang-Mills connections on T 2 that we found in Sects. 2.3 and 2.4. This owes to the algebraic fact that both classification schemes are based on central extensions (Γ R in two dimensions and π 1 (T 3 p ) in three dimensions) of the fundamental group π 1 (T 2 ) of the underlying two-torus. Heuristically, a flat connection in three dimensions can be lifted from a (not necessarily flat) Yang-Mills connection in two dimensions by assigning to it a fixed holonomy along the fibre generator h. We can make this correspondence more precise as follows [76].
0 be the standard one-monopole connection on the canonical line bundle L → T 2 . Its curvature F A 0 = dA 0 = 2π ω T 2 is proportional to the unit volume form on T 2 . The monopole connection A Letm be an integer with 0 ≤m < N . Regarding the monopole connection as a fixed fiducial background gauge field, a constant curvature instanton on T 2 corresponds to a principal U (N ) bundle P N → T 2 with first Chern classm and a Yang- The three-dimensional flat connection can be explicitly constructed in terms of the two-dimensional constant curvature connection in the following way. The pull-back of the bundle projection π : T 3 p → T 2 naturally lifts the two-dimensional data (P N , A) to threedimensional data ( P N , A ). Recall from eqs. (6.28) and (6.29) that the pull-back π * (L) of the line bundle L → T 2 is p-torsion. It follows that π * (L ⊗−p ) ∼ = T 3 p × C is the trivial line bundle over T 3 p with connection λ = 1 N π * A (−p) 0 (to which we have the freedom to add any trivial connection). We can now construct the bundle P N = π * (P N ) ⊗ π * (L ⊗−m ) whose curvature vanishes by construction. Moreover, the structure group of P N is SU (N ), because the determinant line bundle det P N = det π * (P N ) ⊗ π * (L ⊗−m N ) is endowed with a vanishing connection and the holonomy along the fibre is in the center of SU (N ) by construction.
To better understand this latter point, let κ be a connection on the principal U (1) bundle T 3 p → T 2 whose curvature two-form is the pull-back of the Euler form given by The one-form κ defines a contact structure on the Seifert manifold T 3 p [17,18]. Then the pull-back of the constant curvature F A on T 2 is given by and thus the pull-back of the irreducible instanton connection may be taken to be Since the integral of κ along any S 1 fibre over T 2 is given by [17,18] S 1 κ = 1, eq. (6.34) follows. We can also use the contact structure to compute the value of the Chern-Simons action in (6.2) for the given flat connection. Using the one-loop quantum shift in the Chern-Simons level k → k + N by the dual Coxeter numberc su(N ) = N of the SU (N ) gauge group [17,18], along with the fact that the connection (6.37) is irreducible, one finds This construction easily generalizes to generic reducible instantons on T 2 with centralizer subgroups (2.10). In this background the two-dimensional data (P N , A) decompose according to (2.11). The argument outlined above can be applied to each sub-bundle P N i with its constant curvature Yang-Mills connection A i to lift the two-dimensional reducible connection to a Chern-Simons critical point. The only essential difference is that now the holonomy along the circle fiber is no longer generally an element of the center of SU (N ) but respects the gauge symmetry breaking pattern, i.e. the holonomy is given by a block diagonal matrix whose i-th entry is of the form e 2π i m i /p N i 1 1 N i where N i is the rank of the corresponding subgroup and m i is the topological charge with 0 ≤ m i < p N i . The value of the Chern-Simons action on a reducible flat connection is a sum of contributions of the form (6.38) for each irreducible component.

The Nonabelian Localization Formula
To compare the Chern-Simons partition function (6.25) with the nonabelian localization onto flat connections on T 3 p , and hence with the partition function of two-dimensional Yang-Mills theory, we have to perform a modular transformation. An efficient way to do this is to resort to the integral representation introduced in [41]. This amounts to inserting the contour integral representation for the Kronecker delta-function given by where m, n ∈ Z and the line integral goes around the origin z = 0 of the complex plane in the counterclockwise direction. The effect of this insertion is to trade the constraint on the sums in (6.25) for an extra integration, and one finds  16 The two-dimensional and three-dimensional gauge theories are also compared in [18] from the point of view of their representations as the two-dimensional BF-theory with action (2.3), where they are shown to agree under the identification (6.44) for any local curve Σ.
Observe that while in the partition function (6.43) the degree p appears only in the combination g s p and can thus be absorbed in a redefinition of the string coupling g s , the dependence of the partition function (6.42) on p is non-trivial. By looking at the reciprocity formula (6.41) we see that after the modular transformation the integer p appears in the combination p m − 1 that limits the allowed topological charges, in complete agreement with the classification of flat connections carried out in Sect. 6.2 above. The difference lies in the fact that while the representations of the central extension π 1 (T 3 p ) depend sensitively on the the degree p of the Seifert fibration, those of the universal central extension Γ R ∼ = π 1 (T 3 p=−1 ) are independent of p. To further clarify this point, let us write the dual integer s in (6.43) as s =ŝ + p m l whereŝ = 0, 1, . . . , p m − 1 and l ∈ Z. One can then rewrite (6.43) in terms of the Jacobi theta-functions (2.8) as This formula demonstrates the connection between the Yang-Mills partition function on the two-torus and the Chern-Simons partition function on the mapping torus T 3 p . The rewriting of the integers s in (6.43), at the level of the Yang-Mills theory, is completely arbitrary due to the trivial p-dependence. It is just the identification of the Yang-Mills coupling with the (complex) Chern-Simons coupling that sets the correct periodicity. Note that substitution of (6.44) with k ∈ Z into (6.45) leads to a divergence coming from the theta-functions. This means that the continuation between the two partition functions is non-analytic, owing to the fact that for g s imaginary the model becomes periodic and the infinite sums collapse to an infinite number of copies of the finite sums over integrable representations of the gauge group. On the Chern-Simons side, the invariance of the path integral (6.2) under large gauge transformations necessitates that q = e −gs be a root of unity. However, the Reshetikhin-Turaev approach to Chern-Simons theory also makes sense for q real and consists in replacing the finite-dimensional Hilbert space of integrable U (N ) representations by the infinite-dimensional Hilbert space of all U (N ) representations that naturally arises in two-dimensional Yang-Mills theory. The very different natures of the Hilbert spaces for q a root of unity and q ∈ R is the source of the non-analyticity of the continuation, which can be thought of as a map between a rational and an irrational conformal field theory in two dimensions. The divergences arising in this continuation were also encountered in [15].
When the integration in eq. (6.42) is explicitly carried out, the constraints on the dual integers are implemented by a sum over partitons of the rank N and one obtains the formula A similar expression for the genus zero fibrations has been derived in [11]. In eq. (6.50), the Yang-Mills partition function on the two-torus is given by a sum over gauge inequivalent Chern-Simons flat connections. Each term is multiplied by a fluctuation factor that results from the mixing of two kinds of contributions. The first contributions are the characteristic theta-functions that arise when we compare Yang-Mills theory and Chern-Simons theory, as was found in [11]. The second contributions, as explained at length in Sect. 2.4, come from the one-loop fluctuation determinants around the classical solutions and they become explicit when we collect together the gauge inequivalent solutions. The same exercise can in principle be repeated for any N . The general structure is clear but unfortunately we have not been able to find closed expressions for the fluctuation integrals over the singular moduli spaces. Our lack of explicit knowledge of quantities associated to the singular moduli spaces for generic gauge group rank N also presents an obstacle to describing the large N geometric transition between the Chern-Simons gauge theory and closed topological string theory, as explicitly hinted to by the relations above. Recall that Chern-Simons gauge theory on a three-manifold M is equivalent at large N to the A-model on the cotangent bundle T * M . If M can be described as the total space of a T 2 -fibration over the interval I, then T * M has the structure of a T 2 × R-fibration over R 3 [48] and thus admits a natural description in terms of toric geometry. In the present case, the description of T 3 p as a torus bundle over the circle gives its cotangent bundle T * T 3 p the structure of a T 2 × R-fibration over S 1 × R 2 with no T 2 cycle degenerations. A formal toric geometry for T * T 3 p could now be constructed using blowup techniques as in Sect. 4.1, and it would be interesting to pursue this geometrical construction further. to the variables y i [50]. On the right-hand side of (A.3), Ξ x i acts as for every t. The operation Ξ is an involution of the ring Λ N . It is convenient to define the skew Schur functions sR /Q (x i ) as where NR QQ ′ are the fusion coefficients defined by It is immediate to see that

B. The Topological Quantum Field Theory Amplitude
The topological string amplitude associated with the formal toric geometry depicted in Fig. 5 can be computed by means of the topological vertex gluing rules described in Sect. 4.2. It is given by where Q i := e −t i with t i the auxilliary Kähler moduli corresponding to the three blowup lines in the toric graph of Fig. 5. The explicit expression (4.12) for the topological vertex can be written in terms of Schur functions as 2) We can then write the topological string amplitude as It is convenient to absorb the factors q κR ⊤ 2 /2 and q κR ⊤ 3 /2 by using Proposition 4.1 of [77] which asserts the identity q κR ⊤ /2 sR q −i+1/2 = sR − q i−1/2 .
Finally, we can repeatedly apply eqs. (A.3) to obtain This expression reduces up to a normalization factor to the amplitude (4.16) for the equal Kähler moduli t 2 = t 3 , i.e. Q 2 = Q 3 , and when the auxilliary edge shrinks to zero length t 1 → 0, i.e. Q 1 → 1.

C. Gromov-Witten and Gopakumar-Vafa Invariants
In this Appendix we will list the Gromov-Witten and the Gopakumar-Vafa invariants up to genus 6 and degree 15, as computed with the techniques outlined in Sect. 5.
The following tables collect the Gromov-Witten invariants N g d (X p ) ∈ Q: n r