The 3d Twisted Index and Wall-Crossing

We study the twisted index of 3d $\cN=2$ supersymmetric gauge theories on $S^1 \times \Sigma$ in the presence of a real FI parameter deformation. This parameter induces a 1d FI parameter for the effective supersymmetric quantum mechanics on $S^1$. Using supersymmetric localisation, the twisted index can be expressed as a contour integral. We show that the contour prescription is modified in the presence of the 1d FI parameter, leading to wall-crossing phenomena for the twisted index. In particular, we derive a general wall-crossing formula for abelian gauge theories. We also examine the origin of wall-crossing as change of stability condition in the algebro-geometric interpretation of the twisted index. These ideas are illustrated for abelian theories with $\cN=4$ supersymmetry and in a non-abelian example that reproduces wall-crossing phenomena associated to moduli spaces of stable pairs.


Introduction
This paper concerns the twisted index of 3d N = 2 gauge theories on S 1 × Σ, where Σ is a closed Riemann surface of genus g. The twisted index was first studied in the context of the Bethe/gauge correspondence [1], while contour integral formulae for the twisted index were derived using supersymmetric localisation for g = 0 in [2] and extended to g > 0 in [3,4]. This has subsequently found beautiful applications to exact microstate counting for supersymmetric black holes in AdS 4 [5][6][7].
It is natural to regard a twisted 3d N = 2 theory on S 1 × Σ as an N = (0, 2) supersymmetric quantum mechanics on S 1 . The twisted index is then identified with the Witten index [8] of the supersymmetric quantum mechanics. Provided the spectrum is gapped, the twisted index can be expressed as for any compact connected gauge group G. The summation is over the topological class d ∈ π 1 (G) of the principal G-bundle on Σ, weighted by a fugacity q for the topological global symmetry. The trace is over supersymmetric ground states H d in each topological sector, graded by any additional flavour symmetry G F with fugacity y. Gauged N = (0, 2) quantum mechanics exhibit wall-crossing phenomena in the space of 1d FI parameters, τ . This is an exact parameter and so the Witten index is independent of τ provided the spectrum remains gapped. However, it may jump across real codimension-1 loci where a non-compact Coulomb branch opens up and the space of supersymmetric ground states H d changes discontinuously. This wall-crossing phenomenon has found important applications. For example, D-particles in Type II superstring theory enjoy an effective description in terms of quiver quantum mechanics, and the BPS spectrum of boundstates jumps according to the quantum mechanical wall-crossing [9]. In [10] the quantum-mechanical wall-crossing was systematically studied from the point of view of supersymmetric localisation.
The purpose of this paper is to evaluate the twisted index on S 1 × Σ in the presence of a real 1d FI parameter τ and explore wall-crossing in this context based on different localisation schemes. The 1d FI parameter can in principle be induced by a real 3d FI parameter, but one can also treat it as an independent parameter. The dependence on this parameter is new and should be distinguished from the known dependence of the twisted index on the complexified 3d FI parameter ζ, which does not display wall-crossing phenomena [11]. One motivation to perform this study is to obtain an effective quantummechanical description that is valid for each topological sector d. This effective description should put the evaluation of the twisted index in the same realm of wall-crossing phenomena in quasi-map theory [12,13].
The first goal is to explain how the contour integral formulae derived in [2][3][4] are modified, if at all, in the presence of τ . For illustration, we will focus here on G = U (1).
The twisted index is expressed using a Jeffrey-Kirwan residue prescription, where the integrand g d (x, y) is a rational function that includes contributions from 1-loop determinants and a gaugino zero-mode integral. The summation runs over d ∈ Z and poles x * of the integrand. The Jeffrey-Kirwan residue depends on a charge Q * associated to each pole and an auxiliary parameter η = 0.
Following arguments akin to [10], we will show that in the presence of the 1d FI parameter τ ∈ R the charges Q + , Q − assigned to the poles at the boundary x → 0, ∞ are where k eff ± denote effective supersymmetric Chern-Simons levels and τ is related τ by a constant positive normalisation. This differs from the prescription of [2][3][4] when k eff ± = 0 and leads to the wall-crossing formula when τ crosses the integer d * ∈ Z from below. An important consequence is that all charges Q * are non-vanishing provided τ / ∈ Z. This means the twisted index is independent of the auxiliary parameter η for each individual flux, without needing to sum over d ∈ Z as in [2][3][4]. This feature is necessary if there is to be an effective supersymmetric quantum mechanics for each d ∈ Z. The original JK residue prescription of [2][3][4] is recovered in the limits τ → +∞ with fixed η > 0 or τ → −∞ with fixed η < 0, with the equivalence of these two limits amounts to the relation d∈Z q d = 0 for q = 0.
This opens up the possibility of an alternative localisation scheme leading to an effective supersymmetric quantum mechanics for each individual d ∈ π 1 (G). This is the approach to the twisted index taken in our previous papers [14,15]. For illustration, we continue with G = U (1). Provided τ / ∈ Z, the path integral localises to two types of configurations. The first are solutions of the vortex equations on Σ, * F A + e 2 (µ(φ) − τ ) = 0∂ A φ = 0 , (1.5) where φ is non-vanishing and the gauge group is broken to a discrete subgroup. Here φ denotes the scalar components of chiral multiplets and µ(φ) the moment map for the gauge action. The second are topological solutions where φ = 0 and the gauge group is unbroken. We denote the moduli space of solutions with fixed d ∈ Z by M τ,d . Algebraically, this parametrises a holomorphic line bundle E of degree d together with a holomorphic section φ of an associated holomorphic vector bundle, subject to a stability condition depending on τ . For example, existence of the solutions to the vortex equations (1.5) maps to 'τ -stability' for the pair (E, φ). This correspondence has been extensively studied in the mathematical literature [16][17][18][19].
In line with the existence of an effective supersymmetric quantum mechanics in each sector d ∈ Z, the twisted index can be expressed as a generating function where E τ,d is in general a complex of coherent sheaves encoding contributions from Fermi multiplet zero modes and Chern-Simons terms. The moduli space M τ,d should really be understood as an algebraic stack and equation (1.6) is an integral of virtual characteristic classes against the virtual fundamental class. Sticking with G = U (1), the moduli space M τ,d can jump accross the wall τ = d. From an algebraic perspective, this is due to a change of stability condition. If a non-compact Coulomb branch opens up, the twisted index can undergo wall-crossing. We show that this happens when k eff ± = 0, in agreement with the modified JK residue prescription (1.3). For abelian theories with N = 4 supersymmetry, which admit only vortex saddle points in our localisation scheme, we demonstrate precise agreement between the geometric picture (1.6) and the modified JK residue prescription in equation (1.2). The extension to more general N = 2 theories with topological saddle points is discussed in [20].
We also study the generalisation of these ideas for non-abelian G, although less systematically. We consider a class of theories with G = U (N ), in which M τ coincides with the moduli space of rank N stable pairs [17]. This is known to have an intricate chamber structure in the parameter space τ ∈ R. For N = 2, the moduli space has been constructed explicitly in [18] and further studied in [19,21]. We show that the twisted index recovers the Hirzebruch genus of the moduli space of stable pairs [22] and is consistent with wall-crossing. We also comment on the generalisation to N > 2.
The paper is organised as follows. In section 2, we summarise the Lagrangians used in supersymmetric localisation and discuss how the twisted index depends on the parameters appearing in them. In section 3, we revisit the Coulomb branch localisation scheme of [5][6][7] in the presence of the 1d FI parameter and derive the modified JK residue prescription and abelian wall-crossing formula. In section 4, we consider an alternative localisation scheme leading to the algebro-geometric interpretation of the twisted index and demonstrate compatibility with wall-crossing. In section 5, we consider the example of abelian N = 4 gauge theories, while in section 6, we explore a non-abelian example with a connection to the moduli spaces of stable pairs.

The Twisted Index
We consider a 3d N = 2 gauge theory on S 1 × Σ with twist along an closed orientable Riemann surface Σ of genus g using an unbroken R-symmetry. This setup preserves two supercharges Q,Q generating a supersymmetric quantum mechanics on S 1 . The supermultiplets are of the type obtained by dimensional reduction of 2d N = (0, 2) and we therefore refer to this as N = (0, 2) quantum mechanics.
In this section, we review how 3d N = 2 supermultiplets decompose under 1d N = (0, 2) supersymmetry and the Lagrangians used in supersymmetric localisation. We also discuss how the twisted index depends on parameters appearing in these Lagrangians, including the 1d FI parameter τ that plays an important role in this paper. We generally follow the notation of reference [4].

Preliminaries
We consider a theory with compact connected gauge group G. Principal G-bundles on the Riemann surface Σ are classified topologically by the fundamental group π 1 (G). The UV topological symmetry is then which is also the centre of the Langlands dual group, Z( L G). Here we are assuming that dF = 0 identically, excluding theories with monopole operators in the superpotential. Given d ∈ π 1 (G), we denote the corresponding homomorphism Hom(G T , U (1)) by q → q d for any element q ∈ G T . Our canonical example will be G = U (N ), in which case π 1 (G) ∼ = Z, G T ∼ = U (1) and the notation q d is obvious.
After twisting on Σ, this decomposes into two 1d N = (0, 2) supermultiplets: • A vector multiplet (σ + iA 0 , λ,λ, D 1d ) for the group Aut(P ) of smooth gauge transformations of a principal G-bundle P on Σ. It is important in the following that the 1d auxiliary field is D 1d = D − 2F 11 .
• A chiral multiplet (A1,Λ1) valued in Ω 0,1 (Ad P ) where Ad P = P × G g is the associated vector bundle in the adjoint representation. More invariantly, the chiral multiplet parametrises the complex structure∂ A on Ad P induced by the gauge connection.
The supersymmetric Yang-Mills Lagrangian for the vectormultiplet is and coincides with the sum of the standard vectormultiplet and chiral multiplet Lagrangians for the 1d N = (0, 2) supermultiplets above. We can introduce a supersymmetric Chern-Simons term with level k ∈ H 4 (BG, Z). The Lagrangian is written schematically as where Tr is shorthand for a positive-definite bilinear form on g. For example, for G = U (N ) with N > 1 there are two independent levels associated to the simple and abelian summands in g = u(N ). We can also introduce a 3d FI parameter ζ valued in the Lie algebra of the topological symmetry G T . The Lagrangian can be written as where we use that g T = Z(g * ) ⊂ g * and the natural pairing between g and g * . As discussed further below, this is complexified by a background Wilson line for the topological symmetry along S 1 . We now consider a 3d N = 2 chiral multiplet Φ = (φ, ψ α , F ) transforming in a faithful unitary representation R of G and R-charge r. After the topological twist this decomposes into two 1d N = (0, 2) supermultiplets: Here we write for the associated vector bundle in the representation R, twisted by a power of the canonical bundle K Σ , if necessary choosing a spin structure on Σ. The chiral multiplet Lagrangian is then and coincides with the standard Lagrangians for the above 1d N = (0, 2) supermultiplets together with a J-term superpotential J =∂ A φ. Suppose there is a flavour symmetry G F acting on the chiral multiplets. Then we can introduce real mass parameters m ∈ t F by coupling to a background vectormultiplet for G F and turning on a constant expectation value for the real scalar. As discussed further below, this is complexified by a background Wilson line around S 1 .
Integrating out charged massive chiral multiplets generates an effective Chern-Simons level k eff (σ) that depends in a piecewise constant fashion on σ. For G = U (1) and chiral multiplets Φ j transforming with weights Q j , where m j denote the real mass parameter of Φ j . In this situation, the bare Chern-Simons level k is allowed to be a half-integer provided k eff (σ) is integer valued. More generally, in the presence of charges chiral multiplets we require that k eff (σ) ∈ H 4 (BG, Z) in order to cancel the parity anomaly.
Finally, the vectormultiplet Lagrangian (2.2) and chiral multiplet Lagrangian (2.6) are exact with respect to both of the supercharges Q,Q. On the other hand, the Lagrangians for the supersymmetric Chern-Simons term, FI and real mass parameters are not exact for any combination of these supercharges.

The 1d FI Parameter
The Lagrangian (2.4) for the 3d FI parameter ζ is not equal to the standard Lagrangian for a 1d FI parameter due to the relation D 1d := D − 2F 11 between the vectormultiplet auxiliary fields in one and three dimensions. Instead we find where the first term is the exact Lagrangian of a 1d FI parameter, while the second term is not exact and will weight contributions from different magnetic fluxes on Σ. For supersymmetric localisation it is convenient to treat the parameter in L 1,ζ as independent. We will call this parameter τ , and the Lagrangian L 1,τ . This is an exact deformation which does not preserve 3d N = 2 supersymmetry, similar to those used in [23][24][25] to localise the path integral of A-twisted 2d N = (2, 2) gauge theories onto vortex solutions. It will play the same role here in section 4.
From the perspective of supersymmetric quantum mechanics and localisation, τ and ζ can be considered to be independent from each other. The former is real and exact, while the latter can be complexified by a Wilson line for the topological symmetry and is not exact. However, to recover 3d N = 2 supersymmetry at the end, we must set τ = ζ.

Parameter Dependence
As above, it is natural to regard a twisted 3d N = 2 theory as an N = (0, 2) supersymmetric quantum mechanics. From this perspective, the twisted index is identified with the Witten index of this supersymmetric quantum mechanics [8]. Provided the spectrum is gapped, the twisted index can be expressed as In this expression, the summation is over the topological class d ∈ π 1 (G) of the principal Gbundle on Σ and the trace is then over supersymmetric ground states H d in each topological sector. The parameters appearing in this expression are where m, ζ denote the mass and FI parameters and a F , a T are background holonomies for the associated global symmetries G F , G T along S 1 . The parameters y, q are then valued in the complexified maximal tori T F,C , T T,C and the twisted index is a meromorphic function of them. Note that the dependence on q arises from the second non-exact contribution to the Lagrangian (2.8). This contribution, as well as the piece of the Lagrangian containing the real mass m, are not exact with respect to any combination of the supercharges generating the N = (0, 2) supersymmetric quantum mechanics and are naturally complexified. The twisted index depends explicitly on m, ζ as a meromorphic function of the complexified parameters y, q.
In contrast, the Lagrangian L τ containing an independent 1d FI parameter τ is exact with respect to the linear combination Q+Q. Standard arguments ensure the twisted index is invariant under small deformations of τ , but may jump across codimension-1 walls where the spectrum of the supersymmetric quantum mechanics is not gapped. Importantly, the locations of the walls depend on other parameters of the theory such as e 2 and Vol(Σ). This wall-crossing can be studied following the localisation techniques developed for gauged supersymmetric quantum mechanics in [10]. This is the route we follow in section 3.

Coulomb Branch Localisation
In this section, we reconsider the Jeffrey-Kirwan (JK) contour integral formula for the twisted index, which was derived using the Coulomb branch localisation scheme in [2][3][4]. We show that the 1d FI parameter τ modifies the residue prescription for singularities at the boundary of the moduli space of supersymmetric saddle points in this localisation scheme and provide a general formula for G = U (1).
This modification ensures that the contour integral formula is well-defined and independent of the auxiliary parameter in each individual topological sector d ∈ π 1 (G), at least away from codimension-1 walls in the parameter space of τ . This is a pre-requisite for the existence of an effective supersymmetric quantum mechanics whose Witten index captures the contribution from each topological sector; this observation will be important in section 4. Furthermore, it leads to wall-crossing of the twisted index, for which we provide a general formula in the case G = U (1).

Contour Integral Formula
The Coulomb branch localization scheme of [2][3][4] starts from the Lagrangian with parameters e 2 , g 2 multiplying the exact terms. Schematically, one sends e 2 → 0 to localise onto saddle points of the vectormultiplet Lagrangian and then g 2 → 0 to evaluate the contributions from fluctuations of chiral multiplets. This is problematic: additional chiral multiplet zero modes and the non-compactness of the moduli space of vectormultiplet saddles mean that the e 2 → 0 limit is subtle. A careful analysis, following the similar computations in two dimensions [26,27], leads to a Jeffrey-Kirwan contour integral formula for the twisted index. The contour integral formula for the twisted index is The summation is over the cocharacter lattice Λ G of G and Tr : Λ G → π 1 (G) denotes the natural projection onto the fundamental group. The contour integral is in the complexified maximal torus of G, parametrised by Finally, the integrand is constructed from a 1-loop contribution Z(x, m) and the Hessian H(x) g , which arises from integration over the 1-form gaugino zero modes. They also depend on flavour parameters y which are suppressed in the notation.
The computation requires a choice of contour Γ. As discussed in [2][3][4] and building on computations in two dimensions [26,27], the contour is fully determined by zero mode integral over the components of the auxiliary field of the 1d vectormultiplet. The contour for the auxiliary field is given by where the vector δ ∈ t deforms the contour away from the real slice. After performing the integral over the auxiliary field, the contour Γ is given by a JK residue prescription. This requires choosing an auxiliary parameter η ∈ t * , which determines a choice of the vector δ through relations including η · δ < 0. Let us spell this out for G = U (1). In this case, the JK residue operation is where η = 0 is an auxiliary parameter and Q = 0 is the JK charge. The the twisted index can then be expressed where for G = U (1) the first summation is over d = m ∈ Z. The second summation runs over poles x * ∈ C * of the integrand with JK charges defined as follows.
• First, there are poles at interior points solving equations of the form x Q y Q f = 1, which arise from chiral multiplets of U (1) charge Q and flavour charge Q f . The associated JK charge is simply Q.
This is ill-defined as it stands when k eff ± = 0. References [2][3][4] adopt a further regulator such that the pole at x = 0, ∞ is not taken when k eff + , k eff − = 0. A consequence is that while the twisted index is independent of η after summing over d ∈ Z, this is not always the case in individual topological sectors. This is not compatible with the existence of an effective supersymmetric quantum mechanics in each topological sector and resolving this issue is one motivation for introducing the parameter τ below.
There is a similar but more intricate story for non-abelian G. At genus g > 0, one difficulty is that the integrand of (3.2) has poles at x α = 1 for non-zero roots α, for which the JK residue operation is ill-defined. The prescription adopted in [2][3][4] is to exclude such poles, which is again problematic for independence of η in individual topological sectors. Resolving this issue is beyond the scope of this paper.

Modification due to τ
We now introduce the 1d FI parameter τ and consider the Lagrangian in the limit t → 0 with e 2 finite. We will show below that this changes the residue prescription for the boundary contributions to the twisted index. For simplicity, we focus on G = U (1). In this case, the JK charges associated to the poles at x = 0, ∞ become is a normalised 1d FI parameter. These charges differ from the previous JK residue prescription when k eff ± = 0. Importantly, with the new prescription the charges Q ± are always non-vanishing provided τ / ∈ Z. Therefore, away from these walls the JK residue prescription is independent of η in each individual topological sector d ∈ Z, before the summation over fluxes. On the other hand, whenever k eff ± = 0 it introduces the potential for wall-crossing in the topological sector d ∈ Z across the wall τ = d.
The argument follows that outlined in appendix B of [14]. As previously, the boundary contribution is determined by the zero mode integral of the auxiliary fieldD. In the new localisation scheme, the boundary contribution to the twisted index is where δ is a regulator for theD integral that satisfies ηδ < 0. The first line of the integrand is the 1-loop and gaugino zero mode contribution in the presence ofD. When evaluated atD = 0, it reduces to the integrand of (3.2).
To evaluate this contribution, we need to compute theD-integral in the limit t → 0 with t 2 σ → ±∞. This integral is performed by rescalingD → t 2D such that in the limit t → 0, it is determined by the dominantD-linear contribution to the exponential. The result can be expressed where the charge Q ± is determined by the dominating contribution to theD-linear term in the exponential. If k eff ± = 0, this term dominates and we find Q ± = ∓k eff ± , in agreement with [2][3][4]. However, when k eff ± = 0 we find instead Q ± = d − τ . This is summarised in the residue prescription (3.10).

Wall-Crossing Formula
The dependence of Q ± on τ leads to wall-crossing of the twisted index when k eff ± = 0. Let us again take G = U (1) and consider the change in the twisted index as the normalised 1d parameter crosses an integer value τ * := d * ∈ Z. A straightforward consequence of the residue prescription (3.10) is where → 0 + . We will explore this wall-crossing formula in a large class of examples in section 5 and demonstrate precise agreement with the geometric interpretation of the twisted index to be introduced momentarily in section 4.

Relation to Previous JK Prescription
Let us now use the wall-crossing formula to examine the precise relationship with the original JK residue prescription introduced in [2][3][4].
The original prescription differs in its treatment of the poles at x = 0 and x = ∞ when k eff + = 0 and k eff − = 0 respectively. In these case, the original prescription is to not include the residue at these points. This prescription is not consistent, meaning not independent of the auxiliary parameter, in each topological sector d ∈ Z. However, it is consistent after summing over topological sectors provided for q = 1 is re-summed to zero. An example is that an expression of the form d∈Z q d represents a formal delta function and vanishes for q = 1.
On the other hand, the residue prescription (3.10) is well defined in every topological sector independently provided τ / ∈ Z. However, the original residue prescription can be recovered by formally sending either τ → +∞ with η > 0, or τ → −∞ with η < 0. The equivalence of these two limits amounts to same condition that the sum over topological sectors (3.15) is re-summed to zero.
We will not write down a wall-crossing formula for a general compact connected group G, although this can be studied following techniques from [10]. As mentioned above, one obstacle to doing this systematically is additional poles at x α = 1 for roots α. Instead, in section 6 we explore the twisted index of the simplest non-abelian examples with G = U (N ) that display wall-crossing phenomena.

Higgs Branch Localisation
Introducing the 1d FI parameter τ opens up an alternative localisation scheme leading to an algebro-geometric interpretation of the twisted index as proposed in [14]. In this section, we review how to compute the twisted index in this localisation scheme and explain how wall-crossing arises from change of stability condition in the algebro-geometric context. This is explored further in examples in sections 5 and 6.

Localisation and Saddle Points
We now consider the Lagrangian which is obtained from that used in the Coulomb branch localisation scheme (3.9) by setting g = t. The strategy is to consider the limit t → 0 with e 2 fixed. The first step is to enumerate the saddle points in this limit. Up to boundary terms, the bosonic part of the Lagrangian (4.1) can be expressed as a sum of complete squares where µ(φ) ∈ g * is the moment map for the action of G on the unitary representation R.
In the limit t → 0, we can ignore ζ for the purpose of enumerating saddle points. However, we keep the Chern-Simons level k in anticipation of saddle points where |σ| becomes large as t → 0. After integrating out the auxiliary field and imposing reality conditions on the physical fields, the saddle points are Equivalently, they are time-independent solutions to * where we have translated to an index free notation. These equations admit a rich spectrum of solutions depending on τ and the choice of theory. For G = U (1) there is a trichotomy of solutions mirroring the three classes of supersymmetric vacua in flat space considered in [11]. We summarise them below.

Vortex Solutions
These are solutions where σ remains finite in the limit t → 0. The Chern-Simons level k can be omitted from equations (4.4) leaving with constant σ. Integrating the first equation over Σ leads to a constraint: to avoid solutions where φ vanishes identically and σ can become infinitely large, we require that τ = d in the topological sector with flux This in turn implies σ = 0 and therefore equations (4.5) reduce to abelian vortex equations on Σ.

Topological Solutions.
These are solutions where |σ| → ∞ such that the combination σ 0 = t 2 σ remains finite and non-zero as t → 0. This requires φ = 0 identically and the U (1) gauge symmetry is unbroken. Integrating out the massive fluctuations of φ generates a shift k → k eff ± when ± σ 0 > 0. The problem is therefore reduced to Integrating over Σ, there is a unique solution for σ 0 provided τ = d and the further conditions k eff ± = 0 and sgn(k eff ± ) = ± sgn(d − τ ) are satisfied.
In summary, in the topological sector d ∈ Z, there may be vortex and topological solutions for τ = d, while Coulomb solutions can arise on the wall τ = d. For a general compact connected group G, equations (4.4) admit a rich variety of solutions combining characteristic features of the three classes introduced above.
We can introduce real mass parameters m ∈ t F for the flavour symmetry G F acting on the chiral multiplets. This modifies the equation σ · φ = 0 to where it is understood that σ, m act in the appropriate representations of G, G F . This has no effect on the above description of topological and Coulomb solutions where φ = 0, but restricts vortex solutions to configurations that are invariant under the infinitesimal flavour transformation generated by m.

Moduli and τ -Dependence
We denote the bosonic moduli space of solutions to equations (4.4) modulo gauge transformations by M τ . From the perspective of N = (0, 2) supersymmetric quantum mechanics, this moduli space parametrises chiral multiplet zero modes. This decomposes as a disjoint union of topologically distinct sectors The moduli space has an intricate dependence on τ and may jump discontinuously across co-dimension one walls in the parameter space g T . If a non-compact Coulomb branch opens up on this wall, the twisted index may undergo wall-crossing. We therefore distinguish two types of discontinuity.
• Type I. The moduli space M τ,d jumps discontinuously across a wall where a Coulomb branch opens up and the twisted index can undergo wall-crossing. For G = U (1) there is such a discontinuity at τ = d when k eff + = 0 or k eff − = 0 or both.
• Type II. The moduli space M τ,d jumps discontinuously without a Coulomb branch opening up and the twisted index remains unchanged. For G = U (1) there is such a discontinuity at τ = d when both k eff + = 0 and k eff − = 0. This is consistent with the wall-crossing formula (3.14) in predicting when wall-crossing of the twisted index can occur in theories with G = U (1). To illustrate the difference between the two types of discontinuity, we consider a couple of examples. First consider G = U (1) with a pair of chiral multiplets X ± of charge ±1 and vanishing R-charge. In this case, k eff and a chiral multiplet X of charge +1 and vanishing R-charge. In this case, k eff ± = k ± 1 2 and as usual k = 1 2 and k > 1 2 behave differently.
• If k = 1 2 , there are vortex solutions when τ > d, topological solutions when τ < d and a Coulomb branch at τ = d. The discontinuity is therefore type I.
• If k > 1 2 , there are both vortex and topological solutions when τ > d, topological solutions only when τ < d, and no Coulomb branch at τ = d. The disccontinuity is therefore type II.

Algebro-Geometric Construction
In order to match the wall-crossing formula (3.14) precisely, we should evaluate the twisted index in the current localisation scheme. This leads to an effective N = (0, 2) supersymmetric quantum mechanics for each d ∈ π 1 (G), which is schematically a sigma model whose target space M τ,d parametrises chiral multiplet zero modes. The contribution to the twisted index is captured by the Witten index of this supersymmetric quantum mechanics: schematically the index of a Dirac operator on M τ,d .
To make this precise, it is useful to introduce an algebraic description of the moduli space M d,τ as parametrising the following data: • A holomorphic sections of the associated bundle K This is supplemented by 'τ -stability', which depends in a piecewise constant fashion on τ . From an algebraic perspective, the discontinuities across walls in the parameter space of τ arise from a change of this stability condition.
Let us first assume τ is chosen such that there are only vortex saddle points where G is completely broken and the moduli space M τ,d is smooth. Then the effective supersymmetric quantum mechanics is a sigma model, with target space M τ,d parametrising the N = (0, 2) chiral multiplet zero modes. The contribution to the twisted index is where E τ,d is a complex of coherent sheaves on M τ,d encoding N = (0, 2) Fermi multiplet zero modes and supersymmetric Chern-Simons terms. The examples presented in section 5 are of this type. More generally, the gauge group may not be completely broken at points on M τ,d and it should be understood as an algebraic stack. For example, for topological solutions in theories with G = U (1) it is the Picard stack of holomorphic line bundles on Σ of degree d. Nevertheless, the supersymmetric field theory equips the moduli space M τ,d with a perfect obstruction theory and equation (4.11) must be understood in a virtual sense. This more general setup is studied in [20].
Finally, in the presence of mass parameters m ∈ t F everything should be understood equivariantly with respect to G F . If the moduli space M τ,d is non-compact away from walls where a Coulomb branch opens up, it is necessary to turn on such mass parameters. In such cases, provided the fixed locus of the infinitesimal T F transformation generated by m is compact, equation (4.11) is defined by equivariant localisation to this fixed locus.

Abelian N = 4 Theories
In this section, we explore the wall-crossing formula (3.14) for 3d N = 4 supersymmetric QED with N hypermultiplets and demonstrate a precise match with wall-crossing in the algebro-geometric construction summarised in section 4, expanding on the proposal of [14]. 1

Twisted Index
From a 3d N = 2 perspective, we have G = U (1) and chiral multiplets transforming in the following representations, where the final two columns are the representations under the N = 2 flavour symmetry In the above table, r = 1, 0 denotes a choice of integer N = 2 R-symmetry inside the The two choices r = 1, 0 generate distinct twisted theories on S 1 × Σ, which we refer to the H-twist and C-twist respectively. In both cases, the contribution to the twisted index can be expressed in the standard form, and for convenience we have introduced a shift q → (−1) N q. The fugacities y 1 , . . . , y N , t obey N j=1 y j = 1 and parametrise the complexified maximal torus of the N = 2 flavour symmetry.
We now specify the residue prescription. First, there are poles at x = y j t −1/2 , y j t 1/2 for all j = 1, . . . , N arising from the chiral multiplets X, Y . They are therefore assigned JK charges +1, −1 respectively. Second, since the effective Chern-Simons level vanishes identically with N = 4 supersymmetry, k eff + = k eff − = 0 and the poles at x → 0, ∞ are assigned charge Q ± = d − τ . This residue prescription can be summarised as follows: • η > 0: sum the residues at x = t −1/2 y j for all j = 1, . . . , N , together with the residues at x = 0 and x = ∞ if τ < d.
These two choices are equivalent away from τ = d by Cauchy's theorem and the residue prescription is independent of the auxiliary parameter η for each d ∈ Z.
The twisted index can potentially now jump across the wall at τ * := d * according to the formula with → 0 + . We must therefore evaluate the residues at x → 0, ∞. First note that due to a cancelations between the the two chiral multiplets, the Hessian H(x) has a simple zero as x → 0, ∞. Combining with the behaviour of the 1-loop determinant we can draw the following conclusions: • H-twist (r = 1): There is no wall-crossing for g > 0. For g = 0, we find the following closed formula for wall-crossing of the twisted index, where → 0 + . The appearance of the Hirzebruch genus of the complex projective space P |N d * |−1 can be understood from the algebro-geometric interpretation of the twisted index discussed below.
• C-twist (r = 0). There is no wall-crossing for g = 0 and g = 1. For g > 1, there is wall-crossing if N > 1. We look at some individual cases below.

Geometric Picture
We now show that the wall-crossing formula agrees with the algebro-geometric interpretation of the twisted index summarised in section 4. In the case of N = 4 supersymmetry, the algebro-geometric interpretation of the twisted index was studied in our previous paper [14], to which we refer the reader for further background.
First note that k eff (σ) = 0 identically so there are no topological saddle points in the localisation scheme of section 4. The vortex saddle points are solutions to the equations where d ∈ π 1 (U (1)) = Z is the degree of the gauge bundle on Σ.
Provided τ = d, we have σ = 0 and the moduli space M τ,d has an algebraic description parametrising the data: • a holomorphic line bundle L of degree d, supplemented by a stability condition arising from the top equation of (5.8). The latter depends in a piecewise constant fashion on τ . This is the moduli space of 'τ -stable' twisted quasi-maps to the Higgs branch, M H = T * CP N −1 . However, as discussed in section 4.2, when τ = d ∈ Z there are saddle points where X j = Y j = 0 for all j = 1, . . . , N and a non-compact Coulomb branch opens up. The stability condition for the algebraic description of M τ,d can jump across this wall, which is the source of wall-crossing of the twisted index in this localisation scheme.
Let us return to computing the contribution to the twisted index for τ = d. The moduli space M τ,d is not necessarily compact, so the evaluation of the twisted index is problematic. This is remedied by turning on real mass parameters m 1 , . . . , m N and m t valued in a Cartan subalgebra T F of the N = 2 flavour symmetry. This modifies the bottom line of (5.8) to The outcome is that vortex saddle points now must now be invariant under the flavour transformation generated by m 1 , . . . , m N and m t . For generic masses, the moduli space of such configurations is compact. The moduli space of vortex solutions in the presence of generic mass parameters has an algebraic description as the fixed locus of the induced T F,C -action on M τ,d . This is straightforward to evaluate explicitly. Let us define d ± := ±d + r(g − 1). Then we find that We can see here clearly that the moduli space can jump accross the wall τ = d.
The contribution to the twisted index from M τ,d is then expressed via equivariant localisation as a sum of contributions from each component of the fixed locus 13) where N d,i denotes a virtual normal bundle to M d,i arising from the fluctuations of massive chiral and Fermi multiplets in the N = (0, 2) supersymmetric quantum mechanics, the details of which depend on r = 1, 0. In either case, this can be interpreted as a virtual equivariant Euler characteristic (or rather index of Dirac operator) of M τ,d defined via virtual localisation. The contributions to the integral (5.13) can be evaluated explicitly using intersection theory on symmetric products and converted into a contour integral using techniques from [18,28]. The relevant computations are performed in [14]. The result is that this contribution can be expressed as where the contour Γ is given by • τ > d: evaluate the residues at x = t −1/2 y j , j = 1, . . . , N • τ < d: evaluate minus the residues at x = t 1/2 y j , j = 1, . . . , N This coincides with the JK residue prescription of section 5.1, where the auxiliary parameter is chosen such that sign(η) = sign(τ −d). It therefore correctly reproduces the wall-crossing of the twisted index. We now present some interesting features in each twist.

H-twist
We have already observed that there is no wall-crossing of the twisted index for g > 0.
Correspondingly, while the moduli space M d− τ jumps discontinuously across the wall τ = d, its contribution to the twisted index (5.13) is unchanged It is interesting to turn the problem around and ask which fluxes d contribute to the twisted index for a given τ . The description of the fixed locus of the total moduli space M τ splits into three characteristic regions: In region (i) it is clear that the twisted index vanishes for d < 1 − g since the moduli space is empty. In region (ii) it is similarly clear that the twisted index vanishes for d > g − 1.
Since the twisted index is invariant under wall-crossing, this is true for any τ . We therefore conclude that when g > 0 the twisted index truncates to a finite Laurent polynomial in q supported in degrees 1 − g < d < g − 1. This is indeed the case. When g = 0, the moduli space M τ in the absence of mass parameters has an explicit description as a disjoint union of projective spaces: Therefore a component of the moduli space disappears or appears as we vary τ from d * + to d * − . This should reproduce the wall-crossing formula (5.7). To see this, we note that the twisted index computes the generating function of Hirzebruch-genera of the components of the moduli space, denotes the 'symmetrised' Hirzebruch χ y -genus.
In particular, we find the wall-crossing formula with → 0 + , which agrees with the expression (5.7) obtained from the contour integral formula.

C-twist
The description of the fixed locus of the total moduli space M τ can again be split into two characteristic regions: The contribution (5.13) from each topological sector can be converted to a contour integral in full agreement with (5.2). However, without performing any computations, we see immediately that the twisted index may only receive contributions from powers q d with d ≥ 0 when τ > 0 and d ≤ 0 when τ < 0. Since the twisted index can only undergo wallcrossing if g > 1 and N > 1, this implies that in all other cases there is only a non-vanishing contribution proportional to q 0 . This is indeed the case. It is also interesting to note that in the limit t → 1, the twisted index should reproduce the Rozansky-Witten invariant of the Higgs branch M H in the same chamber as τ [14]. Correspondingly, in this limit the contributions from d = 0 cancel for any genus g and there is no wall-crossing.

A Non-Abelian Example
In this section, we study non-abelian examples with G = U (N ) that exhibit wall-crossing phenomena. The relevant moduli spaces M τ in such theories have an algebraic description parametrising pairs (E, φ) consisting of a rank N holomorphic vector bundle E and a holomorphic section φ. These data are subject to a stability condition known as 'τ -stability' [16][17][18]. We will also encounter the moduli space M τ (Λ) of τ -stable pairs with fixed determinant Det(E) = Λ. These moduli spaces have been studied extensively [18,19,21]. In particular, the Poincaré polynomial of M τ was computed in [18] for N = 2 and the Hodge polynomials for N = 2, 3 were computed in [22,29].
As discussed in section 4, the twisted index will compute the holomorphic Euler characteristic of M τ , valued in a holomorphic vector bundle E. For concreteness, we construct supersymmetric gauge theories that gives rise to E = O and E = T * M τ . The second case, which arises from a theory with N = 4 supersymmetry, computes a symmetrised version of the Hirzebruch χ y -genus. Applied to such theories, the contour integral formula from section 3 provides an alternative method to compute such geometric invariants and their wall-crossing formulae.

Stable Pairs
Since they are perhaps more unfamiliar than moduli spaces of abelian vortices, we begin with a short review of the moduli spaces of τ -stable pairs from an algebraic perspective. How these moduli spaces arise from supersymmetric gauge theory is discussed in subsequent sections.
We focus for concreteness on N = 2. Let us consider a rank-2 holomorphic vector bundle E over Σ with fixed determinant ∧ 2 E = Λ, where Λ is a holomorphic line bundle of degree d > 0. In addition, we have a non-zero holomorphic section φ ∈ H 0 (E). A pair where we define τ as in the abelian case (3.11). A pair is τ -stable if these inequalities hold strictly. We denote the moduli space of such stable pairs by M τ (Λ). The correspondence between stable pairs and vortices is summarised in appendix A. Let us assume d > 0. The moduli space M τ (Λ) is non-empty if and only if Furthermore, the τ -stability condition is constant and equivalent to τ -semistability within each of the chambers labelled by integers i ∈ {0, 1, . . . , d−1 2 }. We can therefore reasonably introduce the notation M i (Λ) for the moduli space of τ -stable pairs in each of these chambers. 2 As τ crosses the integer values in d 2 ≤ τ ≤ d, the moduli space jumps. We summarise the chamber structure in Figure 1.
It is possible to give an explicit algebraic description of M 0 (Λ). First, a consequence of the definition is that stable pairs in M 0 (Λ) are equivalent to non-split extensions of O by Λ. In other words, they are holomorphic vector bundles E that fit into a sequence and are not of the form E ∼ = Λ ⊕ O, together with a section φ ∈ H 0 (O). The space of all extensions is H 1 (O ⊗ Λ −1 ). Removing the split extensions (whose cohomology class is For example, the Hodge polynomials of the moduli spaces M i (Λ) for N = 2 are computed by this method in [22], with the result The Hirzebruch genus is a found by substituting v → −1, w → −t in the above expression, Finally, if we do not fix the determinant line bundle Λ, the moduli space M i,d fibres over the Picard variety Pic d (Σ) parametrising Λ. The Hodge polynomial is obtained by inserting an additional factor associated to the base, (6.8) This vanishes in the limit v → −1 and therefore χ −t (M i,d ) = 0.
Finally, it will be important to give a description of the tangent space to M τ (Λ) as a deformation-obstruction complex: given a stable pair (E, φ) there is an exact sequence where the maps are induced by multiplication by φ. Here EndE is the bundle of endomorphisms of E, while End 0 E is the bundle of trace-free endomorphisms. Colloquially, H 0 (E) corresponds to deformations of the section φ, while H 0 (EndE) accounts for gauge transformations acting on φ. Similarly, H 1 (End 0 E) corresponds to the deformations of the bundle E, while H 1 (E) are obstructions due to the fact that φ should remain holomorphic. The trace-free condition has its origin in the fact that we are fixing the determinant of E (trace elements can be identified with the tangent space to the Picard variety parametrizing Λ = DetE).

Gauge Theory Construction
We now construct a supersymmetric gauge theory whose twisted index localises to the moduli space M τ of rank-N stable pairs. A natural candidate is G = U (N ) with the following chiral multiplets and superpotential W = tr(ϕXY ) .
The moduli space of solutions decomposes as a disjoint union of topological sectors labelled by d ∈ π 1 (U (N )) = Z. In the following, we focus on N = 2.

Fixed Loci
We now introduce a real mass parameter m t for the U (1) t symmetry, which has the effect of reducing the moduli space to the fixed locus of this symmetry. We show that for τ > d/2, this coincides with the moduli space of stable pairs M τ,d .
First, let us assume that Then taking the trace of the first equation in (6.12) and integrating over Σ implies that X is non-vanishing. Then the equation X · Y = 0 requires that Y = 0 and σ · X = 0 ϕ · X = 0 (6.14) imply both σ and ϕ are generically at most rank one.
Second, let us introduce a mass parameter m t such that the remaining equations in (6.12) are modified by the substitution σ → σ + m t and the action in the relevant representation is understood. This leaves the conclusions of the above paragraph unchanged. However, the equations [σ, ϕ] = m t ϕ D A σ = 0 , (6.15) together with the first line of equation (6.12), imply there are potentially two distinct classes of solutions: (i) X = 0, ϕ = 0 (E irreducible): Let us first consider solutions with ϕ = 0. In this case, as reviewed in appendix A, the bundle E cannot split for generic values of τ . Since σ is covariantly constant and σ · X = 0, it is forced to vanish (otherwise the bundle would split holomorphically). There is therefore a component of the fixed locus defined by the following equations with Y , ϕ and σ all vanishing. This coincides with the moduli space M τ,d of stable pairs of degree d.
(ii) X = 0, ϕ = 0 (E reducible): Let us now consider solutions with ϕ = 0. In this case σ must have a non-zero constant fixed expectation value and the gauge group is broken to U (1) × U (1) accordingly. The vector bundle then splits holomorphically, Without loss of generality, suppose X ∈ L 1 . Then where ϕ 12 is a section of L 1 ⊗L −1 2 of degree 2m−d. Note that the constant expectation value for σ is completely fixed by σ · X = 0 and [σ, ϕ] − m t ϕ = 0. We then find two abelian vortex equations * F A 1 + e 2 |X| 2 + 2|ϕ 12 together with∂ A 1 X =∂ A 1 ,A 2 ϕ 12 = 0. Integrating the second equation over Σ shows that solutions exist provided d − m − τ > 0. On the other hand, ϕ 12 can be nonvanishing only when 2m − d > 0 such that the degree of L 1 ⊗ L −1 2 is non-negative. These two equations imply τ < d/2, which violates our assumption. Therefore this component of the fixed locus is empty.
The moduli space of saddle points in this supersymmetric gauge theory for τ > d/2 can therefore be identified with the moduli space M τ,d of rank 2 stable pairs. Note that in the opposite region τ < d/2, we find X = 0 and the moduli space is instead parametrised by non-vanishing Y 's. The first component of the fixed locus with ϕ = 0 can be described as solutions to the equations There is a potential second component to the fixed locus with ϕ = 0, but a similar analysis shows that this is empty for generic τ .

Wall-crossing
As discussed in appendix A, at integer values τ ∈ Z, the vector bundle E can split holomorphically as (6.17) even when ϕ vanishes. At these values of τ , the off-diagonal components of the connection vanish identically. As a consequence, D A σ = 0 has a family of non-trivial solutions with constant σ = diag(0, σ 2 ) , σ 2 ∈ R , (6.21) which implies that a non-compact Coulomb branch opens up at this point. Therefore, the supersymmetric observables may jump as τ varies from m + to m − for m ∈ Z in d/2 < m < d.
We can derive further constraints directly from the BPS equations. Suppose that the holomorphic section X is contained in the subbundle L 1 . Then integrating the D-term equation (A.17) over Σ gives the following two relations: and therefore the index can jump at this point.

Tangent space
Once we pick a point p on the moduli space M τ,d , the massless fluctuations of the 3d N = 2 multiplets decompose into 1d N = (0, 2) multiplets, which organise into the structure of the virtual tangent space around p. First of all, fluctuations of the 3d chiral multiplets (X, Y, ϕ) decompose into 1d chiral and Fermi multiplets: is the associated holomorphic vector bundle of the principal gauge bundle P and R φ is the representation of the multiplet φ = (X, Y, ϕ). Explicitly we have where H 0 (EndE) parametrises the infinitesimal holomorphic gauge transformations, and H 1 (EndE) corresponds to the deformation of the vector bundle. Together with massless fluctuations of the ϕ multiplet (the last line of (6.24)), they form a 1d N = (2, 2) vector and a chiral multiplet respectively. Note that part of these fluctuations get masses from the Yukawa couplings. One can show that the massless fluctuations correspond to the cohomology of the following pair of complexes [14]:

(6.27)
Here α 0,1 is the map defined by a multiplication by (X, −Y ), and β is the map that takes an inner product with (Y, X). The cohomology of the complexes can be identified with the virtual tangent space of the moduli space. Let us focus on the chambers τ > d/N . On the fixed locus of the U (1) t symmetry, we have Y = 0 and each of the complex splits into two pieces: One can show that α 0 is injective and α 1 is surjective when X is non-vanishing. [18] This implies that the cohomology of the two complexes on the left can be identified with the space T , which fits into the exact sequence This coincides with the tangent space of the moduli space of stable pairs, T = T M τ,d . On the other hand, from Serre duality the remaining two complexes on the right of (6.28) can be identified with the shifted cotangent space −T * M τ,d on the fixed locus.
To summarise, the massless fluctuations give rise to the virtual tangent bundle, which decomposes into on the fixed locus. The second term is the moving part of the virtual tangent bundle, which has weight +1 under the U (1) t action. The Hilbert space of supersymmetric ground states of the N = 2 quantum mechanics for a fixed degree d is the Dolbeault cohomology valued in the exterior powers of the cotangent bundle: The twisted index is therefore a generating function of Hirzebruch-genera of the moduli spaces, 4 where the 'symmetrised' Hirzebruch genus is defined in equation (5.21). The twisted index of the theory (6.10) with fixed degree d vanishes. This is due to the existence of a fibration over the Jacobian, which is the moduli space of τ -stable pairs with the determinant line bundle Λ fixed. Since the Hirzebrich genus of the Jacobian base identically vanishes, a standard argument shows that the twisted index will also vanish 5 In order to compute something non-trivial from the gauge theory side, we work with the moduli space (6.34) with the determinant Λ fixed in what follows. This can be done by freezing by hand the massless fluctuations corresponding to the direction tangent and co-tangent to the Jacobian. They are generated by the trace of the 1d N = (0, 2) chiral and Fermi multiplets tr(δĀ), tr(Λ) ∈ H 1 (EndE) and tr(η ϕ ) ∈ H 1 (EndE) * (6. 35) respectively. Below we will perform the path integral inserting a delta function that retains only the traceless part of these multiplets. The remaining massless degrees of freedom now corresponds to where T M τ (Λ) fits into the exact sequence (6.9). Note that this is different from considering the G = SU (N ) version of the theory, which would also remove the trace-free part of the 1d N = (0, 2) vector multiplet contribution H 0 (EndE). 4 Here ∧ • is the symmetrised exterior algebra defined by ∧ Nc < N f .

Decoupling Limits and Generalisations
It is interesting to consider the limit |m t | → ∞ where the supermultiplets Y and Φ charged under the U (1) t symmetry are integrated out.
• First, in the limit m t → −∞ (corresponding to t → ∞), the top exterior power of the cotangent bundle dominates in the expression (6.31) and the space of supersymmetric ground states becomes The fermions in the massive supermultiplets generate the CS-levels 6 • Second, in the opposite limit m t → ∞ (corresponding to t → 0), the space of supersymmetric ground states become and integrating out massive fermions generates CS-levels More generally, one can consider an N = (0, 2) quantum mechanics whose space of supersymmetric ground states can be identified with the cohomology valued in E = K p+1/2 , where K be the determinant line bundle over M τ,d . For this purpose, we consider the following 3d N = 2 theory: together with the CS levels where k U (1)R is the mixed CS level between the U (1) ⊂ U (N ) G and the U (1) R R-symmetry. The level should be an half-integer, p + 1 2 ∈ Z, such that the line bundle K p+1/2 is welldefined. This is compatible with the above |m t | → ∞ limits of the N = 4 theory.
As above we work with the moduli space M τ (Λ) with fixed determinant line, by removing the trace of the fluctuation of 1d N = (0, 2) chiral multiplet tr(δĀ), tr(Λ) ∈ H 1 (EndE) (6.44) in the path integral of effective quantum mechanics. As before, we focus on N = 2. 6 The SU (N ) effective levels are obtained from the formula where T2(R) is the quadratic index of the representation R, normalised in a way that T2(fund.) = 1.

Branches of the moduli space for rank 2 theories
Unlike the N = 4 theory in section 6.2, the relevant BPS equations in the N = 2 theory with generic CS levels (6.43) has contribution from non-zero effective levels k eff (σ). Let us first consider the rank 2 case with E = O, where the bare CS levels are given by If τ is generic in the region τ > d 2 , there are again two branches of solutions: (i) X = 0, E is irreducible: In this branch, the vector bundle bundle E does not split holomorphically and we have σ = 0 by the argument above (6.16). Therefore the underlying bosonic moduli space is again given by the rank 2 stable pairs M τ (Λ), parametrised by solutions (A, X) to the equations (6.16). We call this branch the stable pair branch or the irreducible branch.
(ii) X = 0, E is reducible: In this case, the BPS equations have solutions with non-zero σ = diag(σ 1 , σ 2 ), which breaks the gauge group into U (2) → U (1) 1 × U (1) 2 . This allows the solution with the vector bundle E splitting holomorphically into L 1 ⊕ L 2 . Without loss of generality, let us assume that X is a non-zero section of L 1 . Then the equation σ · X = 0 sets σ 1 = 0. Since σ 2 can still be non-zero, a part of the fluctuation of the X multiplet becomes massive and generates the effective CS level for the U (1) 2 unbroken gauge symmetry. The semi-classical D-term equation is then where k eff ± σ is a diagonal matrix valid in the region sign(σ 2 ) = ±1 with σ 1 = 0. 8 Taking the trace and integrating the equation over Σ, we find that this branch exists only in the region τ > d/2. In the region σ 2 > 0, each diagonal component gives the relation In what follows, we omit the subscript 0 from σ0 to avoid clutter in the notation. 8 The bare CS levels for U (1)1 × U (1)2 can be obtained from the expression (6.45). The U (2) gauge group breaks into U (1)A × U (1)B in this chamber, where U (1)B is the maximal torus of SU (2) factor and U (1)A is the U (1) factor in U (2). This gives the relation U (1)1,2 = 1 2 [U (1)A ± U (1)B] respectively. It is straightforward to check that the CS levels in this basis are k 11 = k 22 = 1 2 (k U (1) + k SU (2) ) and k 12 = k 21 = 1 2 (k U (1) − k SU (2) ). Since σ2 is non-zero, only k 22 gets a correction after integrating out X multiplet fluctuation. This gives the expression (6.47).
where m = deg(L 1 ). From the second equation, we find that the branch is empty at generic value of τ . On the other hand, in the region σ 2 < 0, we have We call this branch the reducible branch.
In constrast to the case with k eff = 0, non-compact Coulomb branch does not appear at τ ∈ Z in this region. In branch (ii) the expectation value of σ is completely determined by the BPS equations and the moduli space remains compact. As τ crosses the integer values in this region, the states associated with branch (i) can appear/disappear according to the wall-crossing phenomena described in section 6.2. However, branch (ii) also can undergo a wall-crossing at the same time, which is expected to compensate the change of the index. Therefore, the wall at τ ∈ Z is of type II, and the index of the full gauge theory remains constant in this region. When τ is precisely at the critical value τ = d 2 , the equations have non-trivial solutions with X = 0. Since k eff,U (1) = 0 for σ U (1) < 0, the moduli space at this point has a noncompact direction parametrised by negative σ U (1) . This is a type I wall, where the twisted index can jump. If τ goes below the critical value, i.e., τ < d 2 , we encounter another branch: (iii) X = 0: In this branch, the bosonic moduli space is parametrised by solutions (A, σ) The vacua at this branch are described by the Chern-Simons theory with the following effective levels: In the flat space limit, the space of supersymmetric vacua consists of isolated points with a mass gap. We call this branch the topological branch.
In Figure 2, we summarise the chamber structure of this theory in the space of τ .

General CS level
The chamber structure of the theory with p = ±1/2 is qualitatively different from that of the case with p = ±1/2. First of all, branch (i) remains the same and can be again identified with the moduli space of stable pairs with σ = 0, which is non-empty in the chambers in d/2 < τ < d.
In branch (ii), where the vector bundle is reducible, the effective levels are given by Taking the trace and integrating the D-term equation over Σ, we find that branch (ii) is potentially non-empty for all values of τ , unlike the case with p = − 1 2 . Integrating each component of the D-term equation now gives in the region sign(σ 2 ) = ±1 respectively. In this case, we find that solutions exist in the region pσ 2 < 0 in the sectors d−τ < m. On the other hand, in the region pσ 2 > 0, solutions exist in the sectors d − τ > m. Finally, branch (iii), which corresponds to the topological branch, can be described as solutions to (6.50) with By taking the trace of the D-term equations, we find that the solutions can potentially exist for all values of τ . Note that the value of σ is fixed in all regions and therefore all the walls are type II. We expect the twisted index to be independent of τ .

Twisted Index and Wall-Crossing
Now we are ready to discuss the twisted indices of the gauge theories we studied in the last subsection. We propose a generalisation of the wall-crossing formula (3.14) to the rank-2 theories and show that it reproduces the Hirzebruch genus at each chambers (6.7). We also compute the twisted indices of the theory (6.42) and show that it reproduces the holomorphic Euler characteristics valued in a power of the determinant line bundle for the rank 2 stable pairs.
Twisted index of the theory (6.10) for N = 2 can be written as the integral formula where the summation is over the degree d ∈ Z of the principal bundle P : As discussed in section 3.1, the first term is the contribution from the contours around the selected poles of the integrand at finite u * , while the second term is the contribution from the boundary of the classical Coulomb branch |u i | 2 → ∞, which encodes the dependence on the stability parameter τ . The one-loop determinant can be written as where n = 2(g − 1) + m 1 + m 2 . Note that we removed the contribution from the the trace of the Fermi multiplet tr(η ϕ ) ∈ H 1 (O) as discussed in (6.35), by multiplying the factor (1 − t) −g in the first line. The factor H(x 1 , x 2 ) g in the integrand can be obtained by integrating out the zero modes of the chiral multiplets (Ā,Λ), which correspond to unbroken U (1) 2 ⊂ U (2) flat connections on Σ in the Coulomb branch. Removing the contribution tangent to Jac d [Σ] in M τ,d can be implemented by inserting the delta function in the field space δ(tr(Λ))δ(tr(Ā)) · δ(tr(Λ))δ(tr(A)) . (6.58) Using the Lagrange multipliers, it is straightforward to show that, for G = U (N ), the result can be written as where H ab = ∂W eff (u) ∂u a ∂u b , a = 1, · · · , N (6.60) is the hessian of the second derivative of the twisted effective superpotentials of the 3d theory on S 1 . Here | η−linear means taking the coefficient of the η-linear term. Explicitly, , (6.61) where ∆ is the set of all roots in g. For the rank 2 case, it reads Having discussed the integrand, we now turn to the contours. The contours in the expression (6.56) are determined by the zero mode integrals for the auxiliary fieldD, as briefly summarised in section 3.1. If we choose η = (1, 1), one can show that the only poles in the bulk that pass the JK-residue condition are at {x 1 = 1, x 2 = t} and {x 2 = 1, x 1 = t}. However, the residues of these poles vanish due to the zeros in the numerator of the integrand. Therefore, the contribution from the contour at finite u (the first term of (6.56)) is identically zero and the index gets contribution from the boundary term only. 9 The index can be written as and all the other contributions vanish after closing theD contour. The integrals around these poles depend on the parameter τ . Due to the Weyl symmetry, the contribution from the two singularities are the same after summing over m. Let us examine the iterative residue integral around the first pole in (6.64). Using the condition m 1 + m 2 = d, we redefine (m 1 , m 2 ) = (m, d − m) and sum over m ∈ Z to obtain the index at a fixed degree d. Suppose that g m (x 1 , x 2 ,D 1 ,D 2 ) is the product of the one-loop and the classical contributions of the path integral computed around a background witĥ D turned on, which reduces to the integrand of (6.56) when evaluated atD = 0. After performing theD 1 integral and taking into account the Weyl symmetry, we are left with the expression + res 65) 9 The residue of pole at x1 = x2 can be non-zero but they are excluded in the prescription as explained Performing theD 2 integral after rescalingD 2 → s 2D 2 , we arrive at the expression + res Let us fix a generic τ in the region d/2 < τ < d. Note that the pole at x 1 = 1 exists only when m ≥ 0. The index can be written as where we defined By the residue theorem on the x 2 -plane with x 1 fixed, we can rewrite the index as This expression reflects the fact that the fixed locus under the action of the U (1) t symmetry is at σ 1 = σ 2 = 0, as discussed in section 6.2. The index (6.70) is expected to compute the Hirzebruch genus of the moduli space M τ,d (Λ) of rank 2 stable pairs in all of the chambers in d/2 < τ < d. Notice that the bounds agree with the discussion in 6.2.2.
In the chamber d − 1 < τ < d, the index gets a contribution from the m = 0 sector only. The corresponding moduli space is the projective space M 0 (Λ) as discussed in section 6.1. In this case the singularity at x 1 = 1 is a simple pole and the expression (6.70) can be explicitly evaluated: This agrees with the description (6.5). Although we will not provide a general proof of the equivalence between (6.70) and (6.7) in all chambers, it is possible to check for many values of d and g that these two expressions agree in all chambers for d/2 < τ < d 10 .

χ(M τ , K n )
Let us now consider the twisted index of the theory (6.42) with p ∈ Z + 1 2 . This can be written as 72) where the contribution from the CS level and the one-loop is 73) and the one-form gaugino contribution is (6.74) As before, let us redefine (m 1 , m 2 ) → (m, d − m) and sum over m ∈ Z for given d. For each m, the index gets a contribution only from the boundary term, since the only rank-2 singularity of the integrand at finite u is at the boundary of the Weyl chamber x 1 = x 2 = 1.
As discussed in section 6.3, the moduli space of the gauge theory consists of various branches depending on the value of τ . We focus on the region d/2 < τ < d, where the moduli space contains branch (i), which can be identified with the moduli space of the rank 2 stable pairs M τ (Λ). In this region, the twisted index receives contribution from the contour integrals around the singularities at (6.64). In the presence of the effective CS levels (6.46), contribution from the first singularity in (6.64) is determined by theD 2 integral (6.65) on the asymptotic components of the σ 2 integral, where F (s,D 2 , m, τ ) is now given by 11 Taking the limit s → 0 sufficiently fast so that s 2 σ → ∞, we find that theD 2 -integral on the contour at σ 2 → −∞ identically vanishes. We have I m 1;0 , (6.77) 11 The notation (k eff (σ)σ) 2 denotes for the second component of the diagonal matrix (6.52).
where we defined I m a;b = res Let us first focus on the chamber d/2 < τ < d, where the moduli space consists of two branches (i) and (ii). Using the residue theorem on the x 2 -plane with x 1 fixed, this expression can be recast into From the discussion in section 6.3, we expect that the two terms on the RHS are contributions from branch (i) and branch (ii) respectively. This agrees with the fact that σ 1 = σ 2 = 0 on the branch (i), while in branch (ii), the solutions exist only at σ 1 = 0, σ 2 → −∞.
These branches are non-empty in the sectors 0 ≤ m ≤ d − τ − 1.
By an explicit computation, one can check that the contribution from branch (ii) is identically zero in this chamber. On the other hand, the contribution from branch (i) is expected to reproduce the holomorphic Euler characteristic of the moduli space of stable pairs Note that the index does not undergo a wall-crossing in the chambers d/2 < τ < d, as expected from the analysis in section 6.3. If we vary τ below the critical point, τ < d/2, the sectors d/2 < m < d − [ τ ] start to contribute and the residue integrals in these sectors are in general non-zero. This implies that the index changes discontinuously as τ crosses the wall at τ = d/2. Let us comment on the theories with |p| > 1/2. Performing theD integrals, one can show that the index can be written as a sum of two contributions where I 1 (τ, d) is the contribution from the contours around σ 1 = 0 and σ 2 → ±∞. The relevant component of the effective level on these contours is Note that this expression is completely independent of τ , which is expected from the discussion in section 6.3. Depending on the sign of p, we can rewrite the integral as and We again claim that the term I m 1;1 is contribution from branch (i), and the term I m 1;∞ and I m 1;0 are contributions from branch (ii). This decomposition is motivated by the fact that in the sectors 0 ≤ m ≤ d − τ − 1, the solutions for σ 2 is in the region pσ 2 → ∞, while in the sectors m ≥ d − τ , the solutions for σ 2 is in the region pσ 2 → −∞.
The term I 2 (τ, d) in (6.83) is the contribution from the contour which encircles the poles at σ 1 → ±∞ and σ 2 → ±∞. Note that for |p| > 1 2 , this term can be potentially non-zero, unlike the previous examples. It is natural to identify I 2 (τ, d) as the contribution from branch (iii). This term is also completely independent of τ , which agrees with the absence of the type I wall in the entire τ -space, as argued in section 6.3.
One can explicitly compute the contribution from branch (i) in the chamber d − 1 < τ < d, which can be identified with the projective space M 0 (Λ). In this case, only the m = 0 term contributes to the index. The pole at x 1 = 1 is a simple pole and one can explicitly compute the integral: (6.88) Performing the x 2 integral, we find with n = p + 1 2 . This formula precisely agrees with the holomorphic Euler characteristic of the moduli space M 0 (Λ) It would be very interesting to provide an explicit geometric interpretation of the contributions from branches (ii) and (iii), based on the analysis in section 6.3. We leave this for a future work.

Higher rank generalization
The Hirzebruch genus of the moduli space of rank N pairs for N > 2 can in principle be computed using the U (N ) gauge theory description (6.10) (or (6.42)). We have where the one-loop contribution is simply The expression for H({x i }) is given in (6.59). Again, I boundary is the contribution from the classical Coulomb branch boundary which encodes the dependence in τ . The geometry of the boundary is in general complicated and we leave the detailed analysis to future work. For N > 2, the index (6.91) gets contribution from infinitely many GNO flux sectors labeled by m for finite τ and d, unlike the rank-2 case studied above. It would be interesting to work out the details and compare the χ −t genus computed in [29] for the moduli space of rank-3 pairs and generalise the formula to the moduli space of higher rank pairs. will be denoted by V d . Here F is the curvature of the connection A and∂ A is the holomorphic structure on L determined by d A and the complex structure on Σ. We will also denote by G be the group of gauge transformations, G := Hom(Σ, U (1)). By definition the moduli space of vortices is M d := V d / G . In this paper we make use of the Hitchin-Kobayashi correspondence to express the moduli space of solutions algebraically. First, we notice that by integrating the first vortex equation in (A.1), a necessary condition for the existence of solutions is τ ≥ 2πd e 2 Vol (Σ) . (A.5) We assume the strict version of this inequality in what follows. It is then clear that the section φ cannot vanish everywhere on Σ, which is is the simplest instance of a stability condition.
The general strategy of the Hitchin-Kobayashi correspondence for vortices on Σ is to replace (A.1) with its respective stability condition, and then to take the quotient of the solution to the remaining one by complex gauge transformations G C = Hom(Σ, C * ). The precise statement in this case [34] is that given a pair (A, φ) such that φ is a non-vanishing holomorphic section of L, in each complexified gauge orbit there exists one pair satisfying (A.1), which is unique up to U (1) gauge transformations G. Furthemore, provided the strict version of (A.5) holds, any solution can be written in this way.
The relation to the classical Hithchin-Kobayashi correspondence comes from the fact that (A.1) can be viewed as an equation for a hermitian metric h, intead of a connection A. This is because given a complex structure∂ A and a hermitian metric L there is a unique connection A, the Chern connection, compatible with both structures. The proof relies on this point of view, and can be applied also to the case of more general gauge groups. Finally, we remark that this construction can be viewed as an infinite-dimensional analogue of the Kempff-Ness theorem, applied to the Kähler quotient M d = N d // G.
The Hitchin-Kobayashi correspondece implies that the moduli space of solutions to the vortex equations can be parametrized by pairs (L, φ), where L is a holomorphic line bundle of degree d and φ is a non-vanishing holomorphic section of L. Denoting the degree of the line bundle by d, there is a map from this space to the symmetric product of the curve Sym d Σ. In fact, this parametrizes degree d divisors on Σ, and the map is given by taking the divisor of zeros of φ D = p 1 + . . . + p d . The connection A is then defined uniquely. Thus, we have an isomorphism We notice that the map j has remarkable properties. Whenever d ≥ 2g − 1 it is a holomorphic fibration with the projective space of global sections PH 0 (C, L) ∼ = CP d−g as fibres.
A.2 U (N ) vortices with fundamental matter We now extend our discussion about the Hitchin-Kobayashi correspondnece to U (N ) vortices with fundamental matter. Let E be a holomorphic vector bundle with structure group U (N ), endowed with a d-bar operator∂ E . Let φ ∈ H 0 (Σ, E), that is As explained in the section about Abelian vortices, it is convenient to view the vortex equation as an equation for the metric h. For fundamental matter, we have the u(N ) *valued equation In analogy to the U (1) case, we would like to derive a stability condition from this equation. Our presentation is based on [16]. We again integrate over Σ and we get µ(E) ≤ e 2 τ vol (Σ) 2π , (A.11) where for any bundle E µ(E) := deg(E) rank(E) is the slope. This is a first necessary condition, which we are now going to refine. Suppose there is a given holomorhic subbundle E ⊂ E. As smooth complex vector bundles, we have E = smoothly E ⊕ E/E , (A.12) but this might not be true holomorphically. In fact, let ( e 1 , e 2 ) be a holomorphic unitary frame so that e 1 is a basis for E . Let D A be the metric connection, with respect to the metric h. We have Here A is the metric connection that arises from the restriction of h and∂ E to E and A ⊥ gives a connection on the complement of E . B is a (1, 0)-form which is interepreted as the second fundamental form of the embedding E → E (that is, it computes the extrinsic curvature of E in E) and A † is its conjugate transpose. 12 In obvious notation, we can compute Importantly, a quick computation in local coordinates shows that where the only important thing to keep in mind is that B is of type (1, 0). Now, we can also write (A.10) in local coordinates as * F + * B ∧ B † * *  is stable or E = hol E ⊕ (E/E ) with φ ∈ H 0 (Σ, E ). In the latter case, the pair (E , φ) satisfies the inequality µ(E ) < e 2 τ vol(Σ) 2π and the holomorphic bundle E/E satisfies µ E/E = e 2 τ vol(Σ) 2π .
In [16] the converse is also proven. Finally, we consider the |τ | → ∞ limit. In this limit, the stability condition simplifies drastically. First of all, notice that in this limit the lower bound is obviously satisfied. As for the upper bound, it is easy to see that it immediately implies that φ cannot be contained in any subbundle of E. But this means that generically φ has maxiaml rank. This discussion can be generalized to matter fields in both the fundamental and antifundamental representation at no cost. The result in the large τ limit remains the same. For other representations, more sophisticated techniques are needed [32,35].