Defects and Quantum Seiberg-Witten Geometry

We study the Nekrasov partition function of the five dimensional U(N) gauge theory with maximal supersymmetry on R^4 x S^1 in the presence of codimension two defects. The codimension two defects can be described either as monodromy defects, or by coupling to a certain class of three dimensional quiver gauge theories on R^2 x S^1. We explain how these computations are connected with both classical and quantum integrable systems. We check, as an expansion in the instanton number, that the aforementioned partition functions are eigenfunctions of an elliptic integrable many-body system, which quantizes the Seiberg-Witten geometry of the five-dimensional gauge theory.


Introduction
Supersymmetric gauge theories provide a rich source of inspiration for various branches of mathematics. From a practical viewpoint, they can also provide a powerful set of techniques to solve challenging mathematical problems using physics. The interplay between supersymmetric gauge theories and mathematics is enhanced by introducing defects that preserve some amount of supersymmetry.
In this work, we study 5d U (N ) N = 2 supersymmetric gauge theories with codimension two and codimension four defects and how they are connected to the quantization of the integrable system associated to its Seiberg-Witten geometry [1,2]. We focus on a class of codimension two defects preserving N = 4 supersymmetry in three dimensions. They can be described either as Gukov-Witten monodromy defects [3,4] or by coupling to a class of 3d N = 4 supersymmetric gauge theories. We will concentrate on the surface defect obtained by introducing the most generic monodromy for the gauge field, or alternatively by coupling to the 3d N = 4 theory T [U (N )] [5]. The codimension four defects are described by supersymmetric Wilson loops.
As a preliminary step towards understanding and computing with surface defects, we will first find a reformulation of the twisted chiral ring of a canonical deformation of the T [U (N )] theory on S 1 × R 2 , building on the work of [6]. We will show that the twisted chiral ring relations are equivalent to the spectral curve of an associated classical N -body integrable system, known as the complex trigonometric Ruijsenaars-Schneider (RS) system.
In addition, this provides a reformulation of the equivariant quantum K-theory of the cotangent bundle to a complete flag variety, via the Nekrasov-Shatashvili correspondence [7,8]. We will also explore the connection with quantum K-theory for more general linear quiver gauge theories. This classical integrable system can be quantized by turning on an equivariant parameter for rotations in R 2 , otherwise known as the three-dimensional Omega background S 1 × R 2 . As it is technically simpler, we will first consider the squashed S 3 partition function of T [U (N )] theory using results from supersymmetric localization [9,10]. The partition functions on S 1 × R 2 can then be obtained by factorization of the S 3 partition function [11,12]. We show that these supersymmetric partition functions are eigenfunctions of the quantized trigonometric Ruijsenaars-Schneider system with the Planck constant proportional to . The corresponding eigenvalues are given by supersymmetric Wilson loops for background U (N ) flavor symmetries. The twisted chiral ring relations, or equivalently the spectral curve of the classical integrable system, are reproduced in the semi-classical limit → 0.
In coupling the three-dimensional theory T [U (N )] theory as a surface defect in 5d U (N ) N = 2 gauge theory, the twisted chiral ring relations are deformed by an additional complex parameter Q, which is related to the 5d holomorphic gauge coupling. According to [13] it is expected that this deformation provides a presentation of the Seiberg-Witten curve of the 5d theory on S 1 × R 4 . The Seiberg-Witten curve of the 5d U (N ) N = 2 supersymmetric gauge theory is known to correspond to the spectral curve of the N -body elliptic Ruijsenaars-Schneider system [14]. This is indeed a deformation of the trigonometric RS system by an additional complex parameter Q.
In order to test this relationship, we will compute the 5d Nekrasov partition function of N = 2 U (N ) supersymmetric gauge theory on S 1 × R 4 1 , 2 in the presence of surface defects wrapping one of the two-planes S 1 × R 2 1 . This computation is performed by treating the surface defect as a monodromy defect and applying the orbifolding procedure introduced in [15,16]. In order to check that the Gukov-Witten monodromy defect is reproducing the same surface defect as coupling to T [U (N )] theory, we check that this computation reproduces the S 1 × R 2 1 partition function of T [U (N )] theory in the limit Q → 0 where the coupling to the 5d degrees of freedom is turned off. In particular, we note that the Gukov-Witten monodromy parameters are identified with the Fayet-Iliopoulos parameters of the 3d gauge theory supported on the defect.
After performing this preliminary check, we study the full Nekrasov partition function on S 1 × R 4 1 , 2 as an expansion in the parameter Q. In the the Nekrasov-Shatashvili limit 2 → 0, we will show that the expectation value of the most generic surface defect is formally an eigenfunction of the elliptic RS system. Furthermore, we find that the corresponding eigenvalues are given by the expectation values of supersymmetric Wilson loops wrapping S 1 in the 5d gauge theory. This computation provides a quantization of the Seiberg-Witten geometry.
We will also study another type of codimension two defect by coupling directly to 3d hypermultiplets [17,18]. We focus on the simplest example where two free hypermultiplets of U (2) flavor symmetry are coupled to the bulk gauge field of the 5d U (2) N = 2 gauge theory. We will show that the partition function of this coupled system solves an eigenfunction equation of the so-called two-body dual elliptic Ruijsenaars-Schneider system. Indeed, the S-transformation of the 3d theory in [19] relates this partition function to the partition function of the U (2) gauge theory with a monodromy defect.
The paper is organized as follows. In Section 2 we will relate the twisted chiral ring of T [U (N )] to the spectral curve of the classical trigonometric Ruijsenaars-Schneider system and discuss connections to equivariant quantum K-theory. In Section 3 we show that partition functions on squashed S 3 and S 1 × R 2 are eigenfunctions of the corresponding quantized integrable system. Then in Section 4 we explain how to compute the expectation values of surface defects in N = 2 U (N ) gauge theory on S 1 × R 4 and demonstrate that they are eigenfunctions of the elliptic RS system. Later in Section 5 we present a cursory discussion of various limits and degenerations of the results presented in this paper. Finally, in section Section 6 we summarize the connections of this work to integrable systems and discuss areas for further research.

Twisted Chiral Rings
In this section, we will study 3d N = 4 linear quiver gauge theories on S 1 ×R 2 , deformed by hypermultiplet masses, FI parameters, and with the canonical N = 2 * mass deformation.
It was observed by Nekrasov and Shatashvili [7,8] that the equations determining the supersymmetric massive vacua on S 1 × R 2 , or the twisted chiral ring relations, can be identified with Bethe ansatz equations for a quantum XXZ integrable spin chain.
We will focus for the most part on the triangular quiver gauge theory: T [U (N )]. We will reformulate the statement of its twisted chiral ring in terms of the spectral curve of a classical N -body integrable system known as the complexified trigonometric Ruijsenaars-Schneider system. Alternatively, it can be viewed as a lagrangian correspondence that diagonalizes this classical integrable system. This reformulation will be important when we come to couple this theory as a codimension two defect in five-dimensions.
We will explain how the corresponding statements for more general linear quivers can be obtained by a combination of Higgsing and mirror symmetry, and demonstrate this in a simple example. We will also briefly discuss connections to results in the mathematical literature on the equivariant quantum K-theory of the cotangent bundles to partial flag manifolds.

The Nekrasov-Shatashvili Correspondence
Three-dimensional theories with N = 4 supersymmetry have SU (2) H ×SU (2) C R-symmetry and flavor symmetries G H × G C acting on the fields parametrizing the Higgs and Coulomb branches respectively. For the purpose of this paper, it is important to turn on a canonical deformation preserving only N = 2 supersymmetry. The corresponding U (1) R is the diagonal combination of Cartan generators of SU (2) H ×SU (2) C . The anti-diagonal combination becomes an additional flavor symmetry U (1) with real mass parameter . Furthermore, we turn on real deformation parameters by coupling to N = 2 vectormultiplets for G H × G C and giving a vacuum expectation value to the real scalar. In a UV description, these deformation parameters enter as real hypermultiplet masses denoted typically by m and FI parameters denoted by t. We refer to this setup as N = 2 * supersymmetry. We refer the reader to [6] for a more complete description of this setup.  Here, we focus on theories with a UV description as a linear quiver with unitary gauge groups. Our notation is summarized in figure 1. It is convenient to introduce a U (1) symmetry acting trivially such that the Higgs branch symmetry is given by U (M 1 ) × · · · × U (M L ).
The corresponding mass parameters are denoted by {m M j }. Similarly, we introduce an additional topological U (1) so that the Coulomb branch symmetry manifest in the UV description is U (1) L+1 with corresponding parameters {t 1 , . . . , t L+1 }. The physical FI parameter at the j-th gauge node is t j+1 − t j . This symmetry can be enhanced by monopole operators up to a maximum of U (L + 1) in the IR.
We will focus on he twisted chiral ring of the effective 2d N = (2, 2) theory obtained by compactifying on a circle of radius R. In this case, the real deformation parameters are complexified by background Wilson lines wrapping the circle and behave as twisted masses in the language of N = (2, 2) supersymmetry.
For generic deformation parameters there is a discrete set of massive supersymmetric vacua on S 1 ×R 2 each with an associated effective twisted superpotential W (i) (m, t, ). This is a holomorphic function that is independent of superpotential and gauge couplings. In the UV theory one can integrate out three-dimensional chiral multiplets to find an effective twisted superpotential W(m, t, , s) for the dynamical vectormultiplets. The supersymmetric vacua are then solutions to exp 2πR which can be identified with the twisted chiral ring relations of the effective two-dimensional theory.
The effective twisted superpotential of the generic linear quiver shown in figure 1 is given by (2. 2) The first term includes contributions from the FI parameters at each node together with phase δ i = M i + N i−1 + N i + N i+1 − 1 1 . The second term includes the 1-loop contributions from the KK tower of chiral multiplets. The basic building block of the 1-loop contributions is the contribution (m) from a three-dimensional chiral multiplet of mass m, which is a solution of the differential equation 2πR ∂ m (m) = log(2 sinh πRm). We refer the reader to [6] for an explicit expression. The final term is included to ensure that mirror symmetry acts straightforwardly in the presence of the spurious U (1) symmetries.
As the imaginary components of the twisted mass parameters are periodic, it is convenient to introduce exponentiated parameters (2.3) With this notation, the equations for the supersymmetric vacua are (2.4) for all i = 1, . . . , L. It was observed by Nekrasov and Shatashvili [7,8] that these equations can be identified with the Bethe equations of a quantum integrable XXZ spin chain. A complete dictionary for linear quivers can be found in [6].
In order to write down the twisted chiral ring it is necessary to introduce a generating function for the gauge invariant combinations of the σ (i) α 's. For this purpose, we introduce an auxiliary parameter u and monic polynomials The equations for supersymmetric vacua (2.4) can be expressed in terms of these polynomials as where the polynomials are understood to be evaluated at u = σ (i) α for α = 1, . . . , N i . We defined ∆ i = M i + N i+1 + N i−1 − 2N i to be the 1-loop contribution to the scaling dimensions of monopole operators charged under i-th gauge group. The superscripts on the polynomials are shorthand for multiplicative shifts of the arguments by η, for example The twisted chiral ring relations for gauge invariant combinations of σ (i) α 's are given by expanding equations (2.6)

in u.
In what follows, it will be useful to introduce another slightly less familiar reformulation of the twisted chiral ring 2 . We first rescale the FI parameters by τ i = τ i η i−1 j=1 ∆ j to absorb the dependence on ∆ j . Then we introduce the polynomial equations where Q i (u) are auxiliary polynomials of rank M i + N i−1 − N i + N i+1 . To recover equations (2.6) for the supersymmetric vacua we shift the argument this polynomial equation by η ± and evaluate both at roots σ (i) α of Q i (u). Dividing one equation by the other, the combination ( τ i+1 − τ i ) and the auxiliary polynomials Q i (u) cancel out and we reproduce (2.4).
The twisted chiral ring relations are given by expanding equations (2.7) in u.
Finally, 3d N = 4 theories have a remarkable duality known as mirror symmetry [20,21]. This can be understood from brane constructions in Type IIB String theory [22], where it is realized as the S-duality. Mirror symmetry acts in quite a non-trivial manner on the data (N i , M i ) of the linear quiver, which is spelled out in reference [6]. Mirror symmetry interchanges mass parameters and FI parameters of the quivers and also acts non-trivially on the N = 2 * mass deformation. Schematically, we have 3 .
where the check symbol designates parameters of the dual theory.

Quantum/Classical Duality
As mentioned above, the equations for supersymmetric vacua can be identified with the Bethe equations for a quantum integrable spin chain. Remarkably, the same system of equations are related to a second, classical integrable system of interacting relativistic particles in one dimension -the complexified trigonometric Ruijsenaars-Schneider system [6].
This correspondence is most straightforward to understand in the case of the triangular quiver T [U (N )] (see Fig. 2) -this will be our main example throughout this paper. The effective twisted superpotential (2.2) of this theory is given by where δ j = j −1 4 and we define s (N ) α = m α and t N +1 = 0 to simplify notation. For this theory, the Higgs and Coulomb branch symmetries are both U (N ) and we have corresponding exponentiated mass µ j and FI parameters τ j with j = 1, . . . , N . This theory is invariant under mirror symmetry with the transformation µ j ↔ τ j , η ↔ η −1 .
By introducing the conjugate momenta to µ j and τ j we provide canonical coordinates on two copies M µ and M τ of the cotangent bundle to (C * ) N with the following holomorphic symplectic forms This is the phase space of our complex classical integrable system. The defining equations for the conjugate momenta (2.10) sweep out a complex Lagrangian in the product L ⊂ M µ × M τ with holomorphic symplectic form Ω µ − Ω τ and generating function given by the on-shell twisted effective superpotential W(m i , t j , ).
It is straightforward to find an explicit description of the Lagrangian L for T [U (2)] theory. The supersymmetric vacua equations read as follows The conjugate momenta for the FI terms are as follows and for the masses (2.14) Given the above definitions of conjugate momenta vacua equation (2.12) can be presented in two equivalent ways. First, as and, second, as In (2.15) the combinations appearing on the left are the Hamiltonians of the complex trigonometric RS system for two particles with positions τ 1 , τ 2 and momenta p 1 τ , p 2 τ . The right hand sides are independent of the momenta p 1 µ , p 2 µ so the Lagrangian correspondence L diagonalizes the system. From this perspective, W(m a , t a , , s α ) evaluated on supersymmetric vacua are solutions of the relativistic Hamilton-Jacobi equation. The evident symmetry under µ j ↔ τ j and η ↔ η −1 means this Lagrangian also diagonalizes the same system with the coupling inverted η → η −1 .
To eliminate dynamical vectormultiplet scalars σ α from the supersymmetric vacuum equations in favor of the conjugate momenta p j µ or p j τ in the case N > 2 is rather non-trivial task. Below we demonstrated that one can do this in two equivalent ways. First as 17) and, second, as In both relations above where eigenvalues of L are related to masses µ j , and to the latter relation as presented in the 'magnetic' frame, in which, using mirror frame variables, the eigenvalues of L are identified with FI parameters τ j .
As we mentioned above, in order to understand why (2.17) and (2.18) are true it is convenient to re-formulate the supersymmetric vacuum equations arising from this twisted superpotential. We introduce monic degree-j polynomials Q j (u), Q j (u) for each node j = 1, . . . , N of the quiver. Note that we treat the matter polynomial in a uniform manner, that is we define m a = σ (N ) a and hence P (u) = Q N (u). With this definition, we have Q Q equations (2.7) Note that in this case ∆ j = 0 and there is no need to redefine τ j . The original supersymmetric vacuum equations are obtained by shifting arguments in the above by η ± , evaluating at the roots σ (j) α of Q j (u) and eliminating the auxiliary polynomials Q j (u). They can be expressed uniformly as α .

Electric Frame
Firstly, we explain how to eliminate the σ (j) α in favor of the momenta conjugate to the FI parameters (2.17). For this purpose, we will set up an inductive procedure to solve the Q Q equations recursively node by node. We first note that by the definition (2.10) and hence by evaluating the Q Q equation at u = 0 we can immediately solve for the constant terms in the polynomials Q j (u) andQ j (u) as follows Now, given the polynomials Q i (u) and Q i (u) for i ≤ j we can determine Q j+1 (u) from the QQ equation (2.20). Then, by shifting j → j + 1 in the same equation and evaluating it on the j roots σ (j) α of Q j (u) we have just enough data to determine the j unknown coefficients in Q j+1 (u).
To illustrate this process, let us perform the first interation explicitly. It is convenient to introduce the monic degree one polynomials q i = u − p i τ . Then from equation (2.23) we have Q 1 (u) = q 1 (u) and Q 1 (u) = q 2 (u). Then, from equation from (2.20) with j = 1, we find Now, evaluating equation (2.20) with j = 2 on the root of the polynomial Q 1 (u) it is straightfoward to compute the coefficient of the linear term in Q 2 (u) and hence find We can now immediately compute the polynomial Q 3 (u) using equation (2.20) with j = 2 We have implemented this procedure to many orders in j and found experimentally that the solution can be expressed as follows. We introduce the following j × j matrices where we define q i = u−p i τ and we remind the reader that superscripts are not exponentials but shifts of the argument by η. Then the solution is given by a ratio of Vandermonde-like Solutions of this form for similar functional equations have appeared in the integrability literature. We expect that these techniques could be used to prove the solution we have found (see e.g. [23]).
Since all polynomials q i are monic of degree one the above ratios can be simplified and by inverting the matrix M 1,...,N , the ratio of determinants can be reexpressed as a single spectral determinant is the Lax matrix of the N -body complex trigonometric RS system. At the final stage of the recursion, the polynomial Q N (u) becomes the matter polynomial providing us with the required relation (2.17). By expanding both sides of (2.17) in u we find explicitly the Hamiltonians Thus we can explicitly write the full set of conserved charges for trigonometric RS system where r = 0, 1, . . . , N .

Magnetic Frame
Let us now look at the other presentation of twisted chiral ring (2.18). Now we want to eliminate σ (j) α in favor of the momentum conjugate to the masses, p µ j . In this case, it will not be possible to provide an argument that lands directly on the Lax matrix formulation of the complex trigonometric RS model. Instead, we attempt to verify the mirror equations I⊂{1,...,N } |I|=r i∈I j / ∈I 33) related to those above by τ j ↔ µ j and η ↔ η −1 .
Let us first consider the first independent Hamiltonian with r = 1. The momentum conjugate to the masses (2.10) can be expressed in terms of the polynomials Q j (u) as where we remind the reader that σ It is now straightforward to see that the first Hamiltonian can be expressed as a contour integral where the contour C N surrounds the roots of Q N (u) i.e. the masses µ α . Our proposition is that this contour integral evaluates to τ 1 + · · · + τ N .
We prove this proposition by induction. To perform the inductive step, we contract the contour C N such that it surrounds the roots σ N −1 α of Q − N −1 (u), u = 0 and u = ∞, then eliminate the dependence on Q N (σ (N −1) α ) using the supersymmetric vacuum equations (2.21), and then express the result once again as contour integral. Performing these steps, we find as required. In the second line above contour C N −1 surrounds only roots of Q N −1 (u).
The argument for the Hamiltonian appearing at order u r proceeds in a similar manner.
We first express the Hamiltonian as a contour integral I⊂{1,...,N } |I|=r . (2.37) where the contour C N surrounds the poles arising from the denominators Q N (u m ). Note the critical role of the numerator factor m =n (u m −u n ) in ensuring that the non-zero residues are labelled by sets i 1 < · · · < i r . This contour integral is the path integral of a supersymmetric gauged quantum mechanics on the circle, an observation we explain further below. Our claim is that this contour integral evaluates to To prove this statement, we again proceed by induction. The inductive step depends on the following contour integral identity

Line Operators and Interfaces in N = 4 SYM
Many of the computations presented in the preceding section, in particular the connections to classical integrable systems, have a useful interpretation in terms of interfaces between copies of four-dimensional U (N ) N = 2 * theory.
The starting point for this construction is the moduli space of vacua M of U (N ) There is always a region at infinity in the moduli space where the gauge group is broken to the maximal abelian subgroup U (1) N and complex coordinates (α i , p α i ) valued in (C * ) 2N corresponding to complexified electric and magnetic Wilson lines in each abelian factor, complexified by vectormultiplet scalars. Classically, we would have 2N , which is the phase space of the complex trigonometric RS system [6].
The quantum corrected moduli space M in the appropriate complex structure is given by the space of GL(N ) flat connections on a torus with puncture. This can be described by the holonomies A and B around the two cycles of the torus, which must obey ABA −1 B −1 = E where E has eigenvalues η −2 , . . . , η −2 , η 2N −2 . Remarkably, these equations can be solved in terms of coordinates (α i , p α i ) such that

Quantum Equivariant K-theory
From the work of Nekrasov and Shatashvili [7,8] it is known that the twisted chiral ring of 3d N = 4 quiver gauge theories on S 1 × R 2 should provide a representation of the equivariant quantum K-theory ring of the Higgs branch. For generic linear quivers the Higgs branch is a quiver variety introduced by Nakajima [24][25][26]. For our main example T [U (N )] this is the cotangent bundle to the N -dimensional complete flag variety.
It is also known from the work Givental and collaborators [27][28][29] that there is a deep connection between equivariant quantum cohomology / quantum K-theory and classical many-body integrable systems. The results of this sections can be interpreted in this light: the equivariant quantum K-theory of the cotangent bundle to a N -dimensional complete flag is determined by the N -body trigonometric RS integrable system. Later in [30] the results of Givental and Lee were proved using different methods which utilize the action of quantum groups. This method is also applicable to affine quiver varieties of type-A.
We can therefore formulate the following The T -equivariant quantum K-ring of the cotangent bundle to the complete N-dimensional complex flag variety is given by where ideal I is given by relations (2.32) and T is the maximal torus of U (N ) × U (1) with equivariant parameters µ 1 , . . . µ N for U (N ) and equivariant parameter η for U (1). The correspondence between physical and geometrical parameters is summarized in Table 1. Note that we have kept equivariant parameters appropriate for U (N ) (rather than SU (N )) global symmetry. For SU (N ) symmetry one needs to add additionally impose the conditions p 1 τ · · · · · p N τ = µ 1 · · · · · µ N = 1 so that one equivariant parameter and one generator are excluded.
In the limit η → 1 twisted chiral ring relations (2.32) have the simple solutions p i τ = µ σ(i) for any permutation σ. In terms of trigonometric RS model, this limit describes N non-interacting relativistic particles. In terms of 3d gauge theory, this describes the point in the parameter space where the supersymmetry is enchanted from N = 2 * to N = 4.
Recently we became aware of reference [31] where quantum K-rings of flag varieties were discussed. The conjecture the authors make about the quantum K-ring is in agreement with Proposition 2.1.

More Genetic Quiver Varieties
So far we have considered only the triangular quiver T [U (N )] which has the property of being self-dual under three-dimensional mirror symmetry. We now briefly discuss how aspects of more general linear quivers can be studied through a combination of Higgsing and mirror symmetry.
For generic hypermultiplet masses and FI parameters, there are only discrete massive supersymmetric vacua on S 1 × R 2 . However, by tuning the mass parameters m a (or FI parameters t a in the mirror frame) one can open up a Higgs branch. Moving out onto this branch and flowing to the infrared we can partially Higgs the theory to obtain a new quiver.
Using Type IIB brane constructions one can develop an algorithm for constructing a generic quiver from T [U (N )] by repeating this procedure together with mirror symmetry. In terms of the parameter space of hypermultiplet mass deformations, Higgsing corresponds to restriction to a certain subvariety specified by the Higgs branch locus of the original quiver theory (see [6] for examples). Below we shall illustrate the idea using couple of simple examples. Higgs theory we impose we impose the condition from which we find p 1 τ = p 2 τ = µ from the definition of the momenta (2.13). Equivalently, inserting the condition (2.42) into the spectral curve (2.15) we find which determines p 1 τ = µ. After Higgsing T [U (2)] theory becomes free, hence its chiral ring relations are trivial.

Higgsing T [U (3)]
The twisted chiral ring of T [U (3)] theory computes the equivariant quantum K-ring of T * F 3 .
In what follows we shall study vacua of T [U (3)] theory subject to a Higgsing condition similar to (2.42) and compute quantum K-ring for the Nakajima quiver variety corresponding to the Higgsed theory. From 3d mirror symmetry it can be shown that the quantum K-ring of the latter variety is canonically isomorphic to the quantum K-ring T * P 2 .
The T [U (3)] theory corresponds to the three-particle trigonometric RS model which is described by the Hamiltonians given in (2.32). As we Higgs the 3d theory we impose (see where σ (2) 1 is one of the Coulomb branch parameters for the U (2) gauge group (second node of the quiver). The theory is therefore reduced to the A 2 quiver with labels (1, 1)(1, 1); its mirror is A 1 quiver with labels (1, 3), or in other words (which lead to T * P 2 ), the U (1) theory with three flavors. and NS5 branes switch roles, and D3 branes are self dual. The newly obtained structure of two NS5 branes and three D5 branes describes U (1) theory with three flavors.
Let us first describe the chiral ring relations for the A 2 quiver. Constraint (2.44) affects the r.h.s. of (2.32) by imposing the relationship between the masses and the l.h.s by restricting some of the conjugate momenta p τ as follows which are consistent with the definition of the conjugate momenta for (1, 1)(1, 1) quiver, where µ = ηµ 2 is the mass of the hypermultiplet on the first node of the quiver. Therefore the only difference between chiral rings on the T [U (3)] (or (3, 2)(1, 0)) theory and the (1, 1)(1, 1) theory -one simply imposes (2.44) on the mass parameters Using the twisted effective superpotential we can compute conjugate momenta to mass parameters where we have substituted σ (1) 1 = σ 1 and σ (2) 2 = σ 2 . We can see that the above expressions reproduce the corresponding conjugate momenta for the A 2 quiver with labels (1, 1)(1, 1) up to rational function µ . Note that −A provides a contribution of the free fundamental hypermultiplet of mass m 3 − m 2 to the effective twisted superpotential. We can interpret contact term (2.51) as coming from the global symmetry of the Higgs branch of T [U (3)] theory. After Higgsing the dependence on µ 1 (the position of particle 1 on the right of Fig. 3) and its momentum disappears.
Let us now explicitly describe the quantum K-ring of T * P 2 using vacua equations.
Since A 2 quiver with labels (1, 1)(1, 1) is mirror dual to U (1) theory with three flavors we can use vacua equations of the latter theory to derive the desired chiral ring relations. In the mirror variables one gets together with momenta conjugate to the FI parameters and hence p 2 p 3 = τ 1 τ 2 τ 3 . We can expand the vacuum equations in powers of σ and then eliminate σ using p 2 := p. By doing so (2.52) becomes where we defined and χ a stand for characters of the a-th antisymmetric tensor representation of sl N (for the trivial representation s 0 = 1). Interestingly, the above formula provides the classical limit of an N -th order difference equation for the q-hypergeometric We can therefore make the following Corollary 2.2 T -equivariant quantum K-ring of T * P N is isomorphic to

57)
where ideal I is given by relation (2.56).
Therefore, by redefining p a → η 1−a p a we obtain that the ideal given in (2.56) is reduced to which is in the agreement with the known result about classical K-rings and cohomology rings of complex projective spaces. Note also that the dependence on η drops out suggesting that the action of U (1) η is trivial in this case; which confirms the known fact that equivariantly T * P N retracts to P N . 5 It can presumably be interpreted as Ward identity for line operators.

3d Partition Functions
In Section 2, we explained how twisted chiral ring of T [U (N )] theory is encoded in the spectral curve of a classical integrable system of N interacting relativistic particles called the trigonometric RS system.
In this section, we will quantize this classical integrable system by studying theories on a curved three-dimensional background. For most of this section, we concentrate on squashed S 3 , where the quantization parameter is identified with squashing parameter traditionally denoted by b (and, as we explain below, also b −1 ). In this background, the conjugate momenta to τ i and µ i are promoted to difference operators p i τ and p i µ and the spectral curve becomes an operator equation, which annihilates the partition function.
From the squashed S 3 partition function, we will obtain the partition function of T [U (N )] on S 1 × R 2 by factorization.

S 3 Partition function
Let us begin by summarizing the supersymmetric partition function of 3d N = 4 gauge theories on squashed S 3 , as computed using supersymmetric localization in [9,10,32].
This partition function depends on a squashing parameter b > 0 and real mass parameters valued in the Cartan subalgebra of the global symmetry group G. The latter are introduced by coupling to a background N = 2 vectormultiplet for G and giving a vacuum expectation value to the real scalar. For the most part we consider U (N ) flavor symmetries and use shorthand notation m = (m 1 , . . . , m N ).
As in the previous section, it is convenient to introduce exponentiated mass parameters.
The conjugate momenta now become elementary difference operators. For a U (N ) global symmetry we define in this section They obey the following relation where q = e 2πib 2 . We will also introduce a second set of exponentiated mass parameters whose variables denoted by µ j , p j µ and q. They are defined in exactly the same fashion except we replace b → b −1 .
The partition function can also depend on real FI parameters for U (N ) gauge groups.
The real FI parameter t associated to a U (N ) gauge group is a real mass parameter for the topological U (1). The corresponding exponentiated FI parameters τ , τ and momenta p τ , p τ are defined as above.
As in Sec. 2, it will be important to turn on a real mass parameter m for the diag- dimensions. It is convenient to introduce the notation together with the exponentiated parameters We will not need to consider the conjugate momentum for this symmetry.
Let us now summarize the building blocks of the squashed S 3 partition function of 3d N = 2 * quiver gauge theories. They are built from bifundamental hypermultiplets, vectormultiplets and FI parameters, Turning off the N = 2 * mass deformation ε → b + , the contributions from the adjoint N = 2 chiral multiplet cancel in pairs and we recover the familiar N = 2 vectormultiplet measure involving only the hyperbolic sine function. It is important to include these contribution when m = 0.
Here we are using the double sine function S(z) = S 2 (z|b, b −1 ) −1 . This is meromorphic in z with simple poles at z = mb + nb −1 for n, m ≤ 0 and simple zeroes for n, m ≥ 1. The most important properties we will need are The S 3 partition function is related to a quantization of the Lagrangian submanifold L of section 2.2. The relevant quantization parameter is related to the squashing parameter by = 2πb 2 (for the parameters µ, p µ ,. . . ) and = 2πb −2 (for the parametersμ,p µ ,. . . ).
In the semi-classical limit b → 0, the S 3 partition function schematically has asymptotic behavior where W(σ) is the effective twisted superpotential with the radius R replaced by the squashing parameter b. In this limit, the conjugate momenta become p µ = e 2πb∂mW and hence matching their semi-classical counterparts.

't Hooft Operators
The building blocks for 3d N = 4 quiver gauge theories have an interesting interplay with a system of commuting difference operators, which quantize the classical Hamiltonians studied in section. We will consider two sets of operators acting on the mass parameters m = (m 1 , . . . , m N ) of a U (N ) symmetry. The first set is defined by respectively. As shown in references [35,36], the expectation value of a supersymmetric 't Hooft loop in the r-th anti-symmetric representation of U (N ) can be massaged into the with a similar equation for T r (m).
The wavefunction G(m, , τ ) is expected to be the partition function of U (N ) N = 4 SYM on a hemisphere of squashed S 4 with Dirichlet boundary conditions at the boundary.
There is a global U (N ) symmetry at the boundary whose real mass parameter is m. The boundary is identified with the squashed S 3 geometry we consider in this section. The supersymmetric partition function on S 4 is computed by including contributions from each of the hemispheres, reintroducing a 3d N = 4 vectormultiplets with partition function ν N (m) and gauging.
The operators T r (m) obey some remarkable properties in the way they interact with the S 3 partition function of 3d N = 4 vectormultiplets and bifundamental hypermultiplets.
Each of these properties can be understood in terms of the action of 't Hooft loops on interfaces in 4d N = 4 SYM.

Interfaces
The first important property of the difference operators is that they are self-adjoint with respect to the measure ν N (m) on the Cartan subalgebra of U (N ) defined by the N = 4 vectormultiplet contribution. As a preliminary step we show that the vectormultiplet measure obeys the difference equation together with the same equation for the tilded variables. Let us now pick two functions f (x) and g(x) and assume that they have no poles in the region −b < Im(x) < b. Then by deforming the contour integration x i → x i − b for each mass parameter in the set i ∈ I and using the above result, a short calculation shows that .
together with an isomorphic equation involving T r (m). Firstly, acting on the partition function of bifundamental hypermultiplets with the momenta p i µ (1) and p i µ (2) and using the difference equation obeyed by the double sine function we have Using these results the first line of equation (3.14) is a consequence of the rational function identity I⊂{1,...,N } | I |=r i∈I j / ∈I This has been proven for precisely the same purpose in reference [37]. An isomorphic argument applies for the equation involving the operators T r (m). Thus we see that the partition function of U (N ) × U (N ) hypermultiplets intertwines the quantum hamiltonians associated with the fundamental and anti-fundamental representations of U (N ).
We now consider the more interesting case of U (N ) × U (N − 1) bifundamental hypermultiplets. The partition function obeys together with an isomorphic equation involving T r (m). This equation is a consequence of the identity I⊂{1,...,n} | I |=r i∈I j∈{1,...,n}/I In terms of representations of U (N ) we have where we have denoted r-th anti-symmetric tensor power of the fundamental representation by Λ is the quantum dimension of the representation Λ where we have used T 0 (−m (2) ) = 1.

T [U (N )]
Let us now consider the partition function of T [U (N )], which we denote by Z U (N ) (m, t).
It depends on mass parameters m = (m 1 , . . . , m N ) for the Higgs branch symmetry U (N ) H and FI parameters t = (t 1 , . . . , t N ) for the Coulomb branch symmetry U (N ) C . As before, the FI parameter associated to the U (j) gauge group is t j − t j+1 . 7 We thank Davide Gaiotto for suggesting this interpretation.
This theory arises on an interface between two copies of the N = 2 * theory in four dimensions with gauge groups U (N ) and holomorphic couplings related by the S-duality It is expected that Wilson loops and 't Hooft loops are interchanged by the S-duality transformation τ → −1/τ . Therefore, we expect that acting with a 't Hooft loop one one side of the interface is equivalent to acting with a Wilson loop on the other. Concentrating on the minuscule representations, this can be turned into the mathematical statement In words, the partition function should be an eigenfunction of the 't Hooft loop difference operators whose eigenvalue if the expectation value of a Wilson loop. This is the quantized counterpart of the 'gauge invariant' formulation of the Bethe equations for supersymmetric vacua which we have found earlier. As always, in the context of the S 3 partition function there is an isomorphic statement for the tilde parameters.
We shall prove this conjecture by induction on the rank of U (N ) following an argument presented in. The initial condition is the three-sphere partition function of T (U (1)). This is simply an FI parameter t for a background U (1) vectormultiplet with mass parameter m, It is immediate that this partition function obeys the difference equations p µ = τ and p µ = τ as required. The partition function of T [U (N )] is now defined recursively by symmetry. The contour is a small deformation away from the imaginary axis.
Let us now act with the difference operator T r (x). This passes through the exponential prefactor leaving behind a phase τ r N . It now acts on the bifundamental hypermultiplet contribution Q N,N −1 (m, s) and can be exchanged for the sum of difference operators T r (−s) + T r−1 (−s) according to the intertwining relation (3.20). Finally, we integrate by parts inside the integral to find the sum of difference operators T r (s) + T r−1 (s) acting on = m j . They are mass parameters for the nodes of a triangular quiver. We also introduce FI parameters t j with j = 1, . . . , N . The solution is then given by the formula where again the choice of the contour is explained later in Sec. 3.5.
Finally, we note that this mathematical argument has a pleasing interpretation in terms of interfaces. We can think of T [U (N )] as obtained by colliding a series of symmetry breaking interfaces between a sequence N = 2 * theories with gauge groups U (j), j = 1, . . . N − 1 together with boundary FI parameters. Our argument simply brings the 't Hooft loop through the sequence of interfaces one-by-one.
T [U (N )] is self-dual under mirror symmetry. A more precise statement is that the S 3 partition function obeys the symmetry property This symmetry is extremely non-trivial from the integral expression that we have presented and we will not attempt to prove it directly. However, we note that it is equivalent to saying that the partition function is simultaneously an eigenfunction of Hamiltonians acting on the masses and FI parameters, The classical limit of trigonometric RS relations in the electric (2.17) and magnetic (2.18) frames is reproduced from the above relations in the q → 1 limit.

Holomorphic Blocks
The squashed S 3 partition function of T [U (N )] is simultaneously an eigenfunction of two sets of difference operators T r (m) and T r (m) related by the transformation b ↔ b −1 . On the other hand, asking for an eigenfunction of a single set of difference operators, say T r (m), leads to a basis of solutions called holomorphic blocks [11,12].
Let us denote the holomorphic blocks by B j where the index j = 1, . . . , N ! labels the supersymmetric vacua of the theory on S 1 × R 2 . i.e. the number of solutions of the Bethe equations. The S 3 partition function can be reconstructed from the holomorphic blocks as follows The holomorphic blocks can be computed a priori, up to some non-perturbative ambiguities, by systematically building formal solutions of the relevant difference equations and finding a basis of contours C j for the integrals.
Here we follow a less sophisticated approach and derive the holomorphic blocks from

T [U (2)] Theory
Let us start with the simplest example, the partition function of T [U (2)]. The partition function is The integrand has two sets of simple poles at The integral contour can be chosen to enclose either set of poles, but the result is independent of this choice. We take residues from the first set of poles. The residue sum is (3.33) Using the identity (B.6), one can evaluate the residue of the double sine function Plugging this residue and using the identities (B.6) we find The result takes the form of the Higgs branch representation which is given by sum over the contributions from two supersymmetric vacua labelled by i = 1, 2. Also, the second line shows the factorization into the vortex and anti-vortex partition functions.

T [U (N )] Theory
Now we turn to the partition function of the T [U (N )] theory. We shall perform the integral recursively starting with the recursive expression . This partition function differs by a prefactor e 2πt N N i=1 m i from the true partition function of the T [U (N )] theory defined in the previous section. We shall multiply this prefactor to the last expression after integration.
The contour integrand has infinite simple poles and zeros from various contributions and also from the function Z U (N −1) . We should first ask how the integral contour goes around those poles. We choose the contour along the real axis assuming that the mass parameters m as well as the squashing parameter b are real parameters. We then take residues from the poles above the real axis. One can also pick up the poles in the other side but the result will be the same.
Although pole structure seems to be complicated as they can be developed by various terms, it turns out that the relevant poles can arise only from the contributions of the bifundamental hypermultiplets Q N,N −1 . Indeed, we find that poles from Z U (N −1) are completely cancelled by zeros of the vector multiplet contribution and poles from the vector multiplet are also cancelled by zeros of Z U (N −1) and Q N,N −1 . Namely ν N −1 Z U (N −1) has no relevant pole inside the contour. We will see this after computing Z U (N −1) explicitly.
However, before we get Z U (N −1) , we first assume that this is the case and evaluate the integral by picking up poles only from the hypermultiplet.
The contribution Q N,N −1 has simple poles at Summing over residues from these poles we obtain and similarly for k. Here s * stands for the integral variables s i evaluated at each pole and they replace the mass parameters in the partition function Z U (N −1) . In this expression, the (semi-)positive integer numbers k i and k i correspond to the vortex and anti-vortex numbers of the U (N − 1) gauge group, which will become clearer later when we write the full partition function as a factorized form.
There is the summation over σ in the Weyl group W N and an overall factor 1/(N − 1)! corresponding the the Weyl factor of the U (N − 1) gauge group. Combining these two, one notices that the number of supersymmetric vacua added to each recursion step is N .
Therefore the total number of supersymmetric vacua of the T [U (N )] partition function is N ! which is in a perfect agreement with the quaternionic dimension of the Higgs branch.
We can use the above formula to compute the function Z U (N −1) at s * . Using the Weyl group W N −1 , one can set σ (N −1) = 1 and obtain Here we have redefined the vortex numbers of the U (N − 2) gauge group as k = {k The second line and the residues in the third line can be further simplified using the equations in (3.34) and (B.6) as follows: We can consecutively apply this procedure and evaluate the partition functions Z U (n) (s * ) for lower n < N − 2 in the similar manner. Upon the redefinition of the vortex numbers i } one can see that the partition function takes the same form as Z U (N −1) but just the rank is reduced to n − 1.
Finally we combine all integrated subpartition functions and find Here we have multiplied the prefactor e 2πt N N i=1 m i which we omitted in (3.36). This is the Higgs branch representation of the S 3 partition function of the T [U (N )] theory. We note that the partition function is factorized by the vortex and anti-vortex partition functions, Z V and Z AV respectively, as well as the perturbative contributions.
We still need to check the our assumption that the vector multiplet and the function Z U (N −1) do not develop nontrivial poles in the contour integral. To see this, it is convenient to first fix σ = 1 in Z U (N −1) using the Weyl group of the U (N − 1) gauge symmetry and perform the contour integral starting with s 1 and so on. We then noticed that the 1-loop is completely cancelled by the vector multiplet contribution ν N −1 (s) of the U (N − 1). Thus the function Z U (N −1) (s) can have poles only from the vortex and anti-vortex series. Furthermore, we find that possible poles from the vortex series are s i = m j + i ε * 2 + inb + imb −1 with n, m > 0 and they are also cancelled by zeros of the vector multiplet contribution at The remaining poles are at s i = s j + iε + ipb + iqb −1 with p, q ≥ 0 and i > j in ν N −1 (s), which are also cancelled by zeros of Q N,N −1 (s) at Therefore the integral contour involves no pole from the vector multiplet contribution and the function Z N −1 . This proves that the relevant poles can come only from the contributions of the bifundamental hypermultiplets, and therefore the Higgs branch representation of the partition function (3.37) is correctly derived.

Givental J-functions
Since the Higgs branch of 3d N = 2 * quiver theories can be identified with the cotangent bundle of the corresponding Nakajima quiver varieties, the vortex partition function thereof, which is the generating function of the BPS states on Higgs branch, gives the Givental J-function of the corresponding variety [29,38].
The corresponding quiver variety for T [U (2)] theory is T * P 1 . According to (3.35) the corresponding vortex partition function of the T [U (2)] theory in one of the vacua (when, where we used the definition of the Q-hypergeometric function (see App. B).

Difference Equations in Electric Frame
It is instructive to explicitly demonstrate that holomorphic blocks, which we have computed above, satisfy difference relations in the electric frame (i.e. second relation in (3.30)). We theories.

T [U (2)] Theory
We can explicitly check that (3.39) satisfies the following difference relation and where momenta operators act as p i τ τ j = q δ ij τ j p i τ . Note that the operator in the left hand side of the above equation differs from T 1 for trigonometric RS model (2.15) by prefactors which depend on µ 1 , µ 2 and η. We can remove those factors by redefining where θ(a, q) = (a, q) ∞ (qa −1 , q) ∞ is one solution of the difference equation p a θ(a, q) = −a −1 θ(a, q). Our theta function conventions are given in App. A.3. Then Z V obeys the following set of eigenfunction difference equations and τ 2 with parameters q and η. In [39] it was shown that Macdonald polynomials with proper normalization are eigenfunctions of difference operators of tRS type.

T [U (3)] Theory
The Thus in one of the vacua the partition function satisfies the following difference equation Again, in order to convert the above equation into the momentum conservation of the three-particle trigonometric RS model we redefine the vortex partition function as The prefactors again correspond to factorization of the FI terms.
We have checked in the series expansion in the FI parameters that (3.44) with the above redefinition is the true eigenfunction of the tRS model. We have also verified that it is an eigenfunctions of the quadratic tRS operator T 2 . Interestingly, one can reproduce the entire vortex partition function using the perturbation theory in FI parameters given the difference relations of the form (3.44).

5d/3d Partition Functions
The three-dimensional T [U (N )] theory can be coupled to maximally supersymmetric U (N ) Yang-Mills theory in five dimensions to form a surface defect. Following references [13,40], if the surface defect is supported on the subspace S 1 × R 2 ⊂ S 1 × R 4 , we expect that the twisted chiral ring of T [U (N )] is deformed by an additional parameter that we denote by Q. This parameter is related to the dimensionless combination of the five-dimensional gauge coupling g 2 and the radius R of S 1 by the formula   In principle, one should be able to perform an exact localization computation for the coupled 5d/3d system. This computation is beyond the scope of the current paper 8 .
Instead, we will use an alternative description of the surface defect as a monodromy defect labelled by the partition [1 N ], whose partition function can be computed using ramified instanton counting [15,16]. We emphasize that this equivalence has a conjectural status.
Therefore, we first check that the partition function in the presence of a defect holomorphic blocks of T [U (N )] in the limit Q → 0, The complete partition function depends on two quantization parameters, 1 and 2 .
At finite Q we will consider the Nekrasov-Shatashvili limit 2 → 0 of the normalized expectation value of the defect We will be able to check to a finite order in the instanton expansion in Q that (4.5) form a basis of solutions to the quantum elliptic RS Hamiltonians. We should emphasize that these are so far formal solutions: we have neither specified a measure nor checked normalizability with respect to it. This point is discussed further below.
We shall momentarily discuss the construction of expectation values (4.5), but first we need to build up the necessary ingredients for instanton calculus in the presence of monodromy defects.

Instanton Counting
Below we review only essential ingredients for our computations further in this section. We refer the reader to [42][43][44].
Let us consider the hyper Kähler quotient construction for the instanton moduli space (4.9) The summation (i, j) ∈ λ I refers to a sum over the boxes of Young tableaux λ I . For example, the Young tableaux has three boxes with the labels (1, 1), (1, 2) and (1, 3).
Next we introduce equivariant Chern character (4.10) Using we can now consider the equivariant character of the tangent space to the universal bundle over the instanton moduli space at a fixed point λ, where m is a mass parameter for the adjoint hypermultiplet. The equivariant character can always be written in the following form where we sum the exponents of the weights at all the fixed points. From this we compute the five-dimensional instanton partition function (4.14) In what follows we use exponentiated parameters µ j = e a j , e 1 = q and e m = η −2 q. Since we will mainly be interested in the limit 2 → 0 we will not need to introduce a parameter for 2 . The coefficients in the expansion are then rational functions of these exponentiated parameters.

Ramified Instantons
Let us now consider ramified instanton counting, namely we want to compute instanton partition function in the presence of a monodromy defect [3]. It was shown in [15,16] that the desired answer can be obtained by applying a simple orbifolding procedure to the above computation.
The possible monodromy defects are labelled by a partition ρ = [n 1 , n 2 , . . . , n s ] where we choose to order n 1 ≥ n 2 ≥ . . . ≥ n s and s i=1 n i = N . This determines the subgroup L = U (n 1 ) × U (n 2 ) × · · · × U (n s ) of U (N ) gauge group which is left unbroken by the defect.
The gauge field has a singularity 9 in the complex plane orthogonal to the defect which can be described as follows , · · · , m s · · · , m s ns ) .

(4.16)
There is an additional label σ which determines how L is embedded into U (N ). Each σ corresponds to permutation of the monodromy parameters m that are not simply permutations within each block, that is σ ∈ W/W L where W L is the Weyl group of L. The number of such permutations is clearly N ρ = N !/(n 1 ! . . . n s !).
To compute the ramified instanton partition function, we quotient the standard construction of the instanton moduli space we have reviewed earlier in Sec into eigenspaces of the Z s -action. Our convention is that the generator of Z s acts on the vector space W j by W j → ω j W j . In the sector with instanton number k, we must make an additional choice of the decomposition of the other vector space Then the boxes in the i-th column of λ j,α contribute to the instanton number k i+j−1 . If i + j − 1 > N then we count modulo N . We can denote the sector associated to a fixed point λ by k j ( λ).
For example, let us consider U (2) theory in the two-instanton sector k 1 + k 2 = k = 2, so we need to describe three spaces M 2,1,1 , M 2,2,0 , M 2,0,2 . They are correspondingly generated by the following tuples of Young tableaux Let us now compute the equivariant character of the tangent space to the ramified instanton moduli space at a fixed point T λ M ρ,k 1 ,...,ks . Let us denote this character by χ ρ, λ ( a, 1 , 2 ), whilst the character of unramified case is as above χ λ ( a, 1 , 2 ). According to the decomposition of space W we have introduced the following notation for the equivariant parameters a = {a j,α } , j = 1, . . . , s , α = 1, . . . , n s . Then we compute the character of the ramified moduli space of instantons via averaging over the orbifold action, therefore the answer is automatically invariant, which we can always write using a summation over weights Analogously to the unramified case we define In addition, for N = 1 * theories there is the additional equivariant mass parameter m. We claim that this mass parameter is invariant under the orbifold action. Finally, the ramified instanton partition function is given by Note that the product of instanton parameters for each sector is equal to the unramified instanton parameter which is also implied by the last equality in (4.18).

U (2) Theory
We shall consider N = 1 * theory with gauge group U (2) in great detail. In this case, there is It is convenient to make the following replacements in order to satisfy (4.25). We shall immediately see physical meaning of both choices. As we have already mentioned, variable Q can be identified with the holomorphic scale the five-dimensional bulk theory while z can be understood as a ratio of the FI parameters of the 3d defect theory coupled to the bulk 5d theory z = τ 2 τ 1 . Let us compute the instanton contributions to the Nekrasov partition function (4.24) and send Q → 0 in order to decouple the five-dimensional degrees of freedom. The first few terms are where we identify q = e 1 . Note that the dependence on the equivariant parameter 2 in the plane orthogonal to the defect has dropped out in this limit. The two expressions are related by µ 1 ↔ µ 2 . It is straightforward to recognize them as q-hypergeometric series

Wilson Loops
An essential ingredient of our construction is the computation of the vacuum expectation values of supersymmetric Wilson loops wrapping S 1 . Using the language of equivariant characters we can easily modify formula (4.14) in order to insert the fundamental Wilson loop operator inside (4.31) The additional character χ (E) λ (4.10) in the numerator represents the contributions from a heavy charged BPS particle propagating around S 1 . It turns out that the numerator has the same universal divergence as the denominator in the limit 2 → 0. Thus the expectation value is finite and we can denote it by Remember that this is the Wilson loop expectation value of U (N ) gauge group, which differs from that of the SU (N ) gauge group by the overall U (1) contribution. The overall U (1) contribution can be interpreted as a contribution from a heavy free BPS particle and one can compute it using the Wilson loop expectation value of unit charge in the abelian gauge theory [45]. The U (1) contribution is given by The fundamental Wilson loop expectation value of SU (N ) gauge group is then given by with a condition i µ i = 1. For later convenience we define which will be used in the difference equations below.
Let us consider some examples. For U (2) N = 1 * theory with a fundamental Wilson loop around S 1 we find the following expectation value given by In order to insert a Wilson loop in the r-th skew symmetry power of the fundamental representation of U (N ) we must modify the computation. It will be discussed elsewhere.

U (2) Theory
Turning on the parameter Q, the partition function in the presence of the defect is no longer finite in the limit 2 → 0. The divergence exponentiates and the anomalous dimension is universal, that is, it is the same divergence without the defect. The saddle point equations arising from the anomalous dimension will fix the mass parameters µ 1 and µ 2 to be some discrete solutions. For now we will ignore this issue and concentrate on the normalized expectation value of the surface defect with unconstrained µ 1 and µ 2 .
As the divergence is universal, the normalized expectation value of the monodromy defect is well defined in the limit 2 → 0. We introduce the notation Z . (4.38) The first few terms of the expansion are (4.39) One may check that the above expressions reduce to the vortex partition functions in the limit Q → 0. It is very important that we have a regular expansion in Q 1 and Q 2 and hence at higher orders in the Q expansion there are negative powers of z = τ 2 /τ 1 . It appears that D (+) and D (−) are related by interchanging the mass and FI parameters (µ 1 , τ 1 ) ↔ (µ 2 , τ 2 ).
As a regular expansion in Q 1 and Q 2 we have checked up to order O(Q n 1 1 Q n 2 2 ) with n 1 + n 2 = 5 that the above normalized expectation values obey the following difference equations µ 1 η where E (1) is the normalized expectation value of a Wilson loop in the fundamental representation of U (2) in the limit 2 → 0 which we have computed earlier in (4.36) and N (1) is the inverse of the overall U (1) contribution defined in (4.35). Therefore if we impose the traceless condition i µ i = 1, the eigenvalues of the difference equations are the fundamental Wilson loop expectation value of SU (2) gauge group.
As before, we can define new partition functions [1,1] , which obey the same difference equations (4.42) The same non-uniqueness caveats as before holds also here. One should also check that the perturbative contributions obtained from orbifolding factorize nicely into contributions from the defect and the bulk. At this point we claim to have found formal eigenfunctions and eigenvalues of the two-body elliptic (complexified) Ruijsenaars-Schneider integrable system, at least as a series expansion.

U (3) Theory
The generalization to many-body system is straightforward -one needs to compute ram- We are interested in the normalized partition function in the presence of a monodromy defect in the limit 2 → 1. As discussed in the previous sections, this limit is well defined and we end up with a finite expression. The partition function is expanded as + (µ 1 , µ 2 , µ 3 and z 1 , z 2 , z 3 cyclic permutations) + · · · , (4.43) where z 1 = τ 2 τ 1 , z 2 = τ 3 τ 2 , z 3 = τ 1 τ 3 Q. We have also assumed that |z 1 |, |z 2 |, |z 3 | < 1 in the expansion. In the decoupling limit Q → 0, this partition function precisely reproduces the vortex partition function of the T [U (3)] theory in (3.37) in one of the vacua, after a relabelling (µ i , τ i ) → (µ −1 i , τ −1 i ). Let us define a new function as which holds only for U (3). The difference equations have been checked in a series expansion in z i 's up to O(z n 1 1 z n 2 2 z n 3 3 ) with n 1 + n 2 + n 3 = 5. The difference equations are the eigenvalue equations of the three-particle eRS integrable system. Therefore we found that the monodromy defect partition functions are eigenfunctions of the integrable Hamiltonians and the Wilson loops in rank 1 and 2 antisymmetric representations are their eigenvalues. In the decoupling limit Q → 0 one can also notice that these equations reduce to the equations for three-body tRS Hamiltonians in (3.44).

Comments on Normalizability of Wavefunctions
The complexification plays a crucial role here. Indeed, normally one may expect that elliptic system has a discrete spectrum, whereas our eigenfunctions are parametrized by parameters variables µ 1 and µ 2 . The point is that we have found only formal eigenfunctions in that they may not be normalizable wavefunctions. In solving the additional Bethe equations arising from the saddle point analysis of the effective twisted superpotential W of the defect theory coupled to the 5d theory in the divergence log Z → 1 2 W + O(1) we will fix the parameters µ 1 and µ 2 to discrete set of values. It is possibly the case that for these values we obtain normalizable wavefunctions and hence obtain a discrete spectrum.
The quantum elliptic Ruijsenaars-Schneider model in connection with supersymmetric gauge theories has been discussed in the the literature before. For instance, in [46], some approximate solutions to the elliptic RS eigenvalue problem are labeled by a discrete parameter. We therefore expect that extremization of eigenfunctions (4.38) with respect to the mass parameters µ i (putting the solution on shell) will resolve the normalizability issues. We plan to discuss it elsewhere.

5d Theory Coupled to 3d Hypermultiplets
We now consider a different type of co-dimension two defect in five dimensions. We shall couple 3d hypermultiplets to the 5d maximal supersymmetric SU (N ) gauge theory. The 3d hypermultiplets have U (1) × SU (N ) flavor symmetry and we couple this SU (N ) symmetry to the bulk gauge symmetry. Our motivation is that the U (2) gauge theory with this type of defect turns out to be related to the U (2) gauge theory with a monodromy defect of type ρ = [1 2 ] by bispectral duality.
In this section, however, we carry out the computation using U (N ) and we set N i=1 µ i = 1 to get the results for SU (N ). Naively U (N ) and SU (N ) are the same under the constraint N i=1 µ i = 1 as the diagonal U (1) part decouples in the field theory limit. However, this is no longer true in the instanton computation. The subtle issues related to the U (1) part in the 5d partition functions are discussed in [47][48][49]. Here we assume that the U (1) part does not affect the gauge theory dynamics and its contribution to the partition function can be subtracted by hand.
In order to compute the partition function in the presence of this 3d defect we shall follow the prescription given in [18]. The defect introduces an additional three dimensional vector bundle on the instanton moduli space of the 5d gauge theory. The 3d fields of the defect theory are in the fundamental and anti-fundamental representations of the SU (2) bulk gauge group and thus the corresponding bundles are the universal bundle and its conjugation, respectively. The equivariant characters of the 3d hypermultiplets can be computed using the equivariant character χ (E) of the universal bundle at k instantons. We We find from the above character formulae the extra contribution of the 3d fields to the k instanton partition function in the integral expression. It is given by There are subtleties in the perturbative contribution related to the boundary condition on ∂(S 1 × R 2 1 ) ∼ = T 2 due to the presence of the Omega background. The superpotential and the Chern-Simons term in the 3d theory are in general not invariant under the supersymmetry in the presence of a boundary [50,51]. We will discuss the latter in the next subsection when we gauge the 3d flavor symmetry. The partition function of 3d theories on solid torus S 1 × D 2 with specified boundary conditions was recently computed in [52] using localization. We will compute the 1-loop determinant for the 3d hypermultiplets using character formula (4.47) and the appropriate boundary conditions. The terms independent of the instanton number k give the perturbative contributions. See App. C for detailed 1-loop computations. The 1-loop determinant of the 3d hypermultiplets is given by The prefactor comes from regularization. Note that this 1-loop contribution includes the prefactor e mx 1 which amounts to the mixed Chern-Simons term between the background U (1) flavor gauge field and R-symmetry current.
The full partition function of the N = 1 * theory in the presence of the 3d hypermultiplets is given by Z 5d 1−loop and Z 5d k are the 1-loop and k instanton partition function of the original 5d theory without the 3d fields, (4.51) One can obtain the instanton part using the quantum mechanics on the instanton moduli space. For the N = 1 * theory with U (N ) gauge group, the Witten index of the N = (4, 4) ADHM gauged quantum mechanics gives the instanton partition function, which was computed in [53] using localization. When we couple the 3d fields, the supersymmetry reduces to N = (2, 2) and one can deduce from (4.48) that there would be extra degrees of freedom, a chiral and an anti-chiral multiplets, added to the quantum mechanics.
The contour integral (4.50) over ρ i can be evaluated using the Jeffrey-Kirwan (JK) residue prescription introduced in [54,55]. The JK prescription has also been applied to the localization of the index in quantum mechanics, which we will briefly review now. See [49,56,57] for more detailed explanations.
We can first define a hyperplane in the φ plane for each charge vector Q i ∈ R k of the multiplets where the integrand in Z k (4.50) becomes singular , (4.53) where Q i 1 , · · · , Q i k are in Q(φ * ).
We will choose a reference vector η arbitrarily in R k . This vector η should not be confused with N = 1 * mass parameter. The JK residue defined in [54] is: where 'Cone' denotes the cone formed by the k independent charge vectors. The result turns out to be independent of the choice of η. The JK prescription can be applied when the projective condition is satisfied [54]. This turns out to be the case with our Z k . The partition function now takes the form of where W is the Weyl group of the U (k) gauge group. At two instanton sector, we have nontrivial poles due to the 3d factors at (ρ 1 = pητ, ρ 2 = µ 1 ), (ρ 1 = pητ, ρ 2 = µ 2 ), (ρ 1 = pητ, ρ 2 = q −1 ρ 1 ), (ρ 1 = pητ, ρ 2 = pη 2 ρ 1 ) (4.56) apart from the poles in the Young tableaux classification. Summing over all JK residues at the these poles, one can compute the two instanton partition functions Z k=2 in the presence of the 3d matter fields. We expect that the Jeffrey-Kirwan method also works for higher instanton sectors Z k>2 .
Let us now define the normalized partition function of the 3d-5d coupled system and take the limit 2 → 0 Here we turned on the classical mixed Chern-Simons term e − mx 1 to cancel the induced Chern-Simons term. This normalized partition function obeys the difference equation where, as before, we denoted by p τ the difference operator satisfying p τ τ = qτ p τ so that p τ becomes the conjugate momentum of τ . The factor N (1) is given in (4.35) and E (1) is the Wilson loop expectation value in (4.36). We have checked this relation by expanding both sides up to two instanton order.
One can also recast the above difference equation as an eigenfunction equation To verify this equation we should expand both sides first in Q and later in 1 η . We have checked for some lowest orders in these expansions. Therefore we have computed the spectrum of the two-body dual elliptic Ruijsenaars-Schneider Hamiltonian (l.h.s. of (4.59)), whose eigenvalue is the expectation value of the Wilson loop (4.36) and the eigenfunction, up to a normalization, is the partition function of the 5d N = 1 * theory coupled to two free 3d hypermultiplets (4.57).

S-Transformation
We will now show that S-transformation which is an extension of the S-duality in three dimensions can relate two different types of defects in five dimensions: a monodromy defect and a defect of 3d hypermultiplets. More precisely, we will act the S operation on the partition function Z 3d/5d of (4.50) and show that the result agrees with the partition function of the U (2) gauge theory in the presence of a monodromy defect.
Let us first review the S transformation in three dimension. There is a natural SL(2, Z) action on 3d CFTs with U (1) symmetry [19]. This action maps a theory to other theories which could be inequivalent to the original theory. It is sufficient to understand two generators T and S in the SL(2, Z) action. The T transformation simply shifts by one unit the Chern-Simons level of the background gauge field A for the U (1) symmetry. The S transformation is more complicated. Firstly we gauge the U (1) global symmetry and make the background gauge field A as a dynamical gauge field. The theory then has a new global symmetry whose conserved current is the magnetic flux of A. Secondly we introduce a mixed Chern-Simons term AdB at unit level with background gauge field B for the new global symmetry.
When the theory is on the manifold with boundary, the S transformation should be carefully taken. If there exists the effective Chern-Simons term of the background gauge field A, the naive gauging procedure fails to work due to the gauge anomaly. The Chern-Simons term makes the gauge invariance anomalous on the boundary. To keep the gauge invariance one need to couple relevant boundary degrees of freedom such that the flavor anomaly of the 2d theory compensates the gauge anomaly on the boundary. In addition, the mixed Chern-Simons term introduced by the S transformation also breaks the gauge invariance. The 2d theory should be chosen to cancel this anomaly as well.
In the partition function, the gauge invariance is associated to the periodicity of the holonomy parameter, a ∼ a + 2πi. The Chern-Simons coupling induces the terms violating this periodicity. To cancel these gauge non-invariant terms, we should multiply the elliptic genus of the proper 2d theory. We will now see this with our example. The N = (0, 2) theory on the boundary T 2 consists of two fermi and one chiral multiplets. We refer the reader to [50,58] for details of elliptic genera of the N = (0, 2) theories.
The regularized elliptic genus is summarized in App. C. We introduce the boundary theory whose the elliptic genus is given by with u = e y . One can check that the prefactor precisely cancels the gauge non-invariant terms of the 3d theory on the boundary.
The integral can be evaluated using the residue theorem with an appropriate pole prescription. We propose that the integral contour encloses the poles at τ = q −k η −1 µ I , k ≥ 0 which come from the 1-loop determinant of the 3d fundamental chiral multiplet. It may be possible to justify this pole prescription by the JK-like residue prescription, but we will not attempt to do it. Let us focus on the residues at poles of τ = q −k η −1 µ 1 . Applying the residue theorem, we obtain . The S transformation can be promoted to five dimensions. It acts on the U (1) flavor symmetry of the 3d theory on the defect as we did above in the decoupling limit. The S transformation on the surface defect partition function is defined as in [18] The contour is chosen to enclose the poles at τ = q −k η −1 µ I , k ∈ Z. We note that the instanton contribution also has poles at τ = q k η −1 µ I for negative integer k < 0 and the contributions from the residues at these poles are crucial to compare with the partition function of the dual theory.
We sum over all residues of the poles at τ = q −k η −1 µ 1 and find The instanton partition function after S transformation is expanded in u and Q/u and the first few terms are given by Remarkably, having identified the parameter as u = τ 2 /τ 1 , this instanton partition function reproduces the ramified instanton partition function Z which is independent of the mass and FI parameters 10 . We have confirmed this relation up to u 2 (Q/u) 2 order. This result provides a strong evidence that the two types of defects, the monodromy defect and the defect of 3d hypermultiplets, are dual to each other under the S transformation: i.e. bispectral dual. One can also obtain the second ramified partition function Z (−) [1 2 ] from the sum over residues at the second set of poles τ = q −k η −1 µ 2 . The S transformation exchanges the mass parameter and the corresponding momentum as follows: obeys the difference equation which is in perfect agreement with the eigenfunction equation of the 2-body elliptic Ruijsenaars system in (4.42).

Gauge Theories with Chiral Matter and 4d Reduction
In this section we discuss chiral limits of our 5d/3d construction. Gauge theories in three dimensions which we have considered so far included both chiral and antichiral matter fields whose masses were split via the twisted mass of the axial U (1) subgroup of the N = 4 Rsymmetry. Since the supersymmetry is already broken down to N = 2 by this axial mass, nothing prevents us from examining the possibility of more extreme mass splitting when some of the mass parameters become large. This is the goal of the current section where we shall study chiral limits of three-dimensional theories and their 5d/3d completions along the lines of the previous sections.

Complete Flags and Open Toda Chains
The chiral version of the quiver theory from and then take the limit such that εη = 1 to get the following For flag manifold we have N j = j, so, after additional scaling we get We have just described how to obtain a chiral theory which lives on a complete flag from the theory supported on T * F N . In order to derive other chiral theories corresponding to non complete flags one needs start from theories of type T [U (N )] ρ (see App. B, where we complete the corresponding vortex partition functions) and take a limit similar to (5.3).

Chiral Limit of T [U (2)]
The simplest example of a complete flag variety is P 1 . Let us see how to describe its quantum cohomology starting from T * P 1 . From [6] we get The set of the above three equations can be rewritten as Performing scaling limits in (5.2) and (5.5) we get for (5.7) where Λ is the dynamically generated scale. By expanding the quadratic expression in σ in the l.h.s. of the above expression and using the definition of the momenta we arrive at where we put p 1 τ = p. One can recognize in the above equation equivariant quantum K-ring relation for P 1 (cf. (2.56) for N = 2).

Effective Twisted Superpotential
Equivalently we can derive the above equations from the first principles by considering N = 2 supersymmetric gauge theories in three dimensions built around a triangular quiver.
Let us fix and integer N ≥ 2. Similarly to (2.9) we introduce real mass parameters s The effective twisted superpotential for theory in Fig. 4 reads Each line of the above formula corresponds to chiral multiplets, vectormultiplets, FI terms and Chern-Simons terms respectively, which become manifest in this form of the twisted superpotential 11 .
The vacuum equations can be readily derived from (5.13) and read as These equations describe (5.6) for the complete N -flag. As in the T [U (N )] case they may appear to be slightly complicated, but it is favorable to express them the in functional form similarly to (2.20). Using the recursive nature of conjugate momenta p 1 1 , and so on it is easy to see that they are recovered from the following functional equations Recall that each function (s) contains a Chen-Simons term s 2 /4 which is generated in one loop, and it is the same for chiral and anti-chiral fields. After we take the chiral limit from (2.9) and anti-chiral fields become infinitely massive, quadratic contributions remain in the last line of (5.13).
where Q j (u) is monic monomial of degree one. As before, these equations serve as a powerful toll for deriving the Lax matrix of Toda systems from the vacuum equations.
Again, let us consider N = 2 for simplicity. There is a single equation By evaluating the equation at u = 0 it is straightforward to see that Q 1 (u) = u − p 1 τ and Q 1 (u) = u − p 2 τ and therefore (5.17) Thus we have recovered the Q-Toda Hamiltonians.
Now we can graduate on to N = 3 case. We have two equations We can recycle the information from the N = 2 case so that Q 1 (u) = u − p 1 τ and Q 1 (u) = u−p 2 τ . Furthermore, by evaluating the second equation at u = 0 we find that Q 2 (u) = u−p 3 τ . Recall that Q 2 (u) is the matter polynomial of the N = 2 example. Thus we have 19) which are Hamiltonians of the three-body relativistic Toda system.

Open Toda Lax Matrix
Now we systematize the above computation in the general case N > 2 to find the Lax matrix of the open relativistic Toda chain. We should find the matrix L(u) with non-zero 20) and then M (u) = det(L(u)) analogously to (2.17). Thus we have constructed the limit when trigonometric Ruijsenaars-Schneider model is reduced to relativistic Toda lattice using gauge theories. We therefore claim that the twisted chiral ring of quiver theory in Fig. 4 is described by the functional equations

Pure Super Yang Mills Theories with Defects and Closed Toda Chains
for j = 1, . . . , N − 2 and with Q 0 (u) = 1, whereas at the final node there is a modification of the equation to For example, for N = 3 we would find Again, later we shall replace z = τ 2 τ 1 . The normalization factors of √ µ 1 µ 2 are included to remove fractional powers of µ 1 and µ 2 in the formulae for the Nekrasov partition function in the presence of the defect, which we shall address later in this section. The same normalization will be used for the difference equations. Note that they would cancel if we move to the center of mass frame i.e. consider gauge group SU (2) instead of U (2).

Open Toda from Decoupling Limit
Analogously to Sec. 4.3 we discuss the decoupling limit first, so we send Q → 0 and decouple the five-dimensional degrees of freedom 12 . In this limit we expect to find contributions that can be accounted for by degrees of freedom supported on the defect. The answer should be consistent with chiral limits (5.3,5.5) of holomorphic blocks and vortex partition functions which we have computed earlier in the paper. Indeed, this turns out to be the case.
For example, in order to find the vortex partition function for P 1 sigma model we can start with Givental J-function (3.39) for T * P 1 and perform the chiral limit in order to see that , (5.26) which leads us to the formula for equivariant K-theoretic J-function for P 1 from [29]. At the last step we rescaled z → z/µ 2 . The above result can be understood as hypergeometric series of type 0 F 1 .
Equivalently, from the computation of the ramified instanton partition functions in the Q → 0 limit using notations (5.25) we get 27) which are related by interchanging µ 1 ↔ µ 2 . The above solutions represent the nonperturbative contributions to the two independent holomorphic blocks of U (1) theory with two chiral multiplets. 12 One can also study 'chiral' version of Sec. 3, namely study 3d partition functions of chiral quivers and prove that they satisfy Q-Toda difference equations. This approach (albeit without reference to gauge theories in three dimensions) was pursued in [59].
In order to remove the dependence on µ 1 and µ 2 on the left we must include contributions to the classical action from FI parameters. These are exactly the same ambiguities we have addressed in (3.42). We could choose, for example where, we recall, θ(a, q) obeys p a θ(a, q) = −a −1 θ(a, q). Now both of the functions Z (±) obey the same difference equations which are the Hamiltonians of the two-body open Q-Toda integrable system. The holomorphic blocks in this example were discussed in detail in [12].
In [60] the K-theoretic J-function of the flag variety was shown to be the (universal) eigenfunction of the relativistic Toda system for any simply laced group and in [61] the analysis was extended to non-simply laced groups.

Closed Toda Chain
Turning on the parameter Q, the partition function the presence of the defect diverges in the limit 2 → 0 since we have degrees of freedom propagating in this plane. However, the divergence exponentiates and is universal i.e. it is independent of the presence of the defect. Thus the expectation value of the defect is finite in the limit The first few terms in the expansion are We can see that, unlike the elliptic RS eigenfunctions, these two functions are no longer related by µ 1 ↔ µ 2 at higher order in the Q expansion. This fact is not surprising since one needs to scale Q as we obtain the above expressions via taking the limit from the elliptic RS eigenfunctions. Yet, the expressions are symmetric if one interchanges z = τ 1 /τ 2 with Qτ 2 /τ 1 . Starting from (4.39) and taking the limit described after (5.1) we arrive to the above expressions provided that Q is also rescaled as follows as → 0. In addition to the above scaling one can redefine the FI parameters as then the elliptic RS eigenfunctions take the form of (5.32).
We have checked to order O(Q n 1 1 Q n 2 2 ) with n 1 + n 2 = 5 that (5.32) obey the difference equations We now multiply R (±) by the same factors as in (5.29). From a three-dimensional perspective they were contributions to classical action from FI parameters. The final result is that both functions obey Thus we can see how turning on the parameter Q in the difference equation controls the five-dimensional instanton corrections. We have found formal eigenfunctions of the twobody closed Q-Toda Hamiltonians. Note that the spectrum should be discrete, whereas we have continuous parameters µ 1 and µ 2 . Again, as in the non chiral case, they should be fixed by Bethe equations coming from the divergent prefactor. It could be that this is related to normalizability of the wavefunctions.  13 We changed k to −k for convenience Let us write Bethe equations for 3d N = 2 * U (N ) theory with M flavors

Kapustin and Willett
As we know these are quantum ring relations for T * (Gr(M, N )). For simplicity let us consider N = 1 and M = 3 first. The variables in the above equation then can be rescaled as follows to get which is the chiral ring relation for T (3, 2, 1).

4d/2d Construction
For completeness we exhibit 2d analogues of some properties of 3d theories we have used in the main text. Quantum cohomology of complete flag varieties and their cotangent bundles in connection with monodromy defects were discussed in [63]. Here we discuss chiral limit of the twisted chiral ring of (2, 2) * theory in two dimensions.
Supersymmetric vacua equations can be obtained from (2.4) and read as follows Now we make some shifts s We now take the limit → ∞ combined with m (j) is kept fixed. In order to keep the whole expression finite the FI couplings have to run thereby generating a scale Λ j for each gauge group, so we have the following chiral ring which is the quiver generalization of a CP N sigma model. We can also write the above equation in Baxter form where For a complete flag case only M 1 = Q 0 is nonzero, the rest M i vanish and vacua equations (5.43) can be written as using auxiliary polynomial Q i . It is assumed that Q N = 1. Following [13] we rewrite the above equation using Toda Lax matrix L where and it also follows that Interestingly the momenta in Toda are the auxiliary polynomials Q i and the coordinates are dynamical scales Λ i at each gauge group.

Equivariant Quantum Cohomology
One of the motivating results for this note is the famous theorem by Givental and Kim, which we list below for completeness. where ideal I Toda is generated by the coefficients of the following polynomial In the Lax matrix above we have identified momenta p i and (exponential of) relative coordinates between Toda particles τ i = e t i −t i+1 with dynamical scales Λ i and polynomials Q i respectively in (5.47). This theorem can now be viewed as an important limiting case of our construction. In order to obtain the above result from Proposition 2.1 we need to first, shrink the compactification radius R → 0, and, second, take the chiral limit in mass parameters (5.3).
A detailed analysis of twisted chiral rings of (2, 2) and (2, 2) * quiver theories in two dimensions in the context of ramified instanton counting and equivariant quantum cohomology was done in [63]. In particular, two-dimensional vortex partition functions for the theories on two-dimensional defects inside four-dimensional N = 2 and N = 2 * gauge theories were computed, and the identification with Givental J-functions was presented. One can also obtain these expressions by taking the 2d limit of 3d holomorphic blocks (3.37).
Note that currently in mathematical literature all necessary tools for computing quantum cohomology of vector bundles over complex projective spaces and their generalizations is already available. Thus using the results of [64] one can derive quantum J-function for the cotangent bundle to the flag variety in the framework of [65] (see [63] for details).
Further connections to integrability in N = (2, 2) * theories were studied in [66], in particular, Q Q-type relations, similar to (2.7) were examined using cluster algebra methods.

Coupled 4d/2d Systems
Using the results of the previous section we can compute twisted chiral rings of two dimensional quiver theories coupled to four dimensional N = 2 * gauge theory by taking the radius of the compact circle in the 5d computation to zero. Classical analysis has been conducted in [13], in particular, the 4d analogue of the deformed twisted chiral ring relation (4.2) was constructed in the cited paper for the SU (N ) N = 2 * theory.
6 Summary and Outlook

Integrable Systems
In this section we outline how the results of this paper fit into the wider context of integrable many-body systems.
There exists a correspondence between the spectral curves of a family of many-body integrable systems (Calogero-Moser-Sutherland [67][68][69], Ruijsenaars-Schneider [70], and Double-elliptic [71][72][73][74]) and Seiberg-Witten curves of supersymmetric gauge theories with adjoint matter in four, five and six dimensions (see [72] and references therein). These are the examples that we have focussed on in this paper.
Recently, in [75] this correspondence was extended and systematized to a large class four dimensional quiver gauge theories of finite and affine ADE type. Later in [44] the five and six-dimensional versions of the Seiberg-Witten geometry together with its quantum deformation are also discussed. arrows. Thus the right column describes elliptic models, whose ellipticity parameter plays a role of the bulk (4,5, or 6-dimensional) instanton fugacity Q. When we send Q → 0 bulk degrees of freedom decouple and we are left with the corresponding defect theories which are located in the middle column. These models are trigonometric in coordinates. Next, one may take a limit when the adjoint mass vanishes. Provided that an appropriate scaling is chosen (see [6]), one obtains a family of rational models from the → 0 limit.

Calogero-Ruijsenaars-Dell Family
Equivalently, one can take the limits row-wise. First, starting from the Dell model and its descendants in the last row take a limit R → 0 thereby shrinking one of the extra compact direction of the 6d theory. This limit moves us to the RS family. Further on, shrinkage of the other circle (again, with a properly chosen scaling of parameters) R → 0 descends us further to the CMS family. One can use the arrows we described above to navigate through the diagram starting from Dell.
Recall that the Finally, we were able to find the spectrum of the two-body dual eRS model using the U (2) 5d gauge theory coupled to 3d free hypermultiplets (4.59). By applying the Stransformation (4.64) we have shown that the eigenfunctions of the elliptic RS model (4.71) can be reproduced from the eigenfunctions of the dual model.

Toda Family
In Sec. 5 we have discussed 3d quiver gauge theories with chiral matter and pure 5d SYM theories with defects which support chiral quiver theories. We have found quantum spectra of relativistic open (5.30) and closed (5.36) Toda chains. In the limit when the compactification radius of the 3d theory becomes small we recover nonrelativistic Toda chains (see Sec. 5.4). The classification is presented in Fig. 6. In the last row of the table one can find elliptic Toda systems which were studied in [76].

Gaudin-Spin Chain Family
For completeness we also discuss the quantum integrable models whose Bethe equations reproduce the twisted chiral rings of the supersymmetric gauge theories appearing (after decoupling Q → 0) on codimension two surface defects in the four, five and six-dimensional theories we have discussed above. This is illustrated in Fig. 7 and can be compared to Fig. 5.
The spin chain family (XXX, XXZ, and XYZ) in the middle column of Fig. 7 Figure 5. Classification of integrable many-body systems according to their periodicity properties in coordinates q (columns) and momenta p (rows). dimensions two, three, and four respectively. The Gaudin family in the first column can be obtained from the spin chain family by turning off the 'Planck constant', which in our construction is represented by the adjoint mass (see [6] for the details about XXX and XXZ models). We refer the reader to [77] and references therein for the discussion about XYZ spin chain and XYZ (elliptic) Gaudin model. The limit → 0 should be supplemented by scaling of anisotropy parameters such that m i remain constant.
To the best of our knowledge there are no known quantum models with elliptic dependence on twists which could be consistently placed in the right column of Fig. 7. Moreover, our analysis involving defects in higher dimensional gauge theories with adjoint matter fields does not immediately suggest any candidates for such models. Their existence, is certainly an intriguing question on its own and should be pursued independently 14 .

Open Problems
Let us now articulate what we believe to be some important questions unanswered by the present work. We list them below in the random order.
14 Some work understanding these integrable models is being done in [78][79][80] Figure 7. Classification of integrable models of Gaudin and spin chain type according to the periodicity properties in twists t (columns) and anisotropies m (rows). Blue double arrows describe bispectral dualities between the models in the table.
• In this paper we have conjectured the structure of formal eigenfunctions of the elliptic Ruijsenaars-Schneider model and (in the 2-body case) its bispectral dual. We have checked our conjectures by expanding the eigenfunctions (instanton partition functions of 5d theories with codimension two defects) to first several orders. It should be possible to prove these conjectures. We understand that work in this direction is being pursued in [81].
Further understanding of the role of Cherednik algebras in gauge theories is due.
• We have analyzed in this paper five-dimensional theories with defects. An immediate generalization would be to study six dimensional (1, 1) theory with a four dimensional defect and use it to find formal eigenfunctions of the double-elliptic (Dell) model. It would be interesting to understand the action of bispectral duality in this case.
• In the presence of monodromy defects, it is known that the Alday-Gaiotto-Tachikawa [83] correspondence is modified to conformal blocks of affine algebras. Understanding of five-dimensional gauge theories with surface defects might lead to new ideas in quantum affine algebras (see, e.g. [84][85][86][87] for a related study of q-Toda degenerate conformal blocks).
• There is a notion of regular and irregular monodromy defects in gauge theories. In this paper we have only addressed the regular case and computed instanton partition functions in the presence of such monodromy defects. One may wonder what happens in the case of irregular singularities.
• The Calogero-Moser-Sutherland family of integrable models is connected to the Korteweg -de Vries/Benjamin-Ono/Intermediate Long Wave hierarchy [78,79,[88][89][90][91] in the limit of large number of particles. One may study generalizations of the correspondence to the Ruijsenaars-Schneider family. Some work in this direction has already been done in [92][93][94].
• In this paper we discussed the relationship between the many-body trigonometric Ruijsenaars-Schneider system and Bethe ansatz of quantum XXZ spin chains. It is a legitimate question to ask how the correspondence is generalized to the related elliptic many-body system.

A Conventions of Special Functions
We summarize our conventions on various functions we have used in the main text.

B Factorization of T ρ Partition Functions
The T [U (N )] ρ theory is the 3d N = 4 quiver gauge theory with gauge group U (N 1 ) × · · · × U (N L ) and N fundamental hypermultiplets for the last gauge group (see Fig. 8). In this appendix we shall compute the Higgs branch representation of the ellipsoid partition function for T [U (N )] ρ theory. The partition function is given by ij +m ij +ik S(ε + is , Z AV = Z V ((z, µ, η, q) → ( z, µ, η, q)) .

(B.9)
The result consists of the classical and 1-loop determinant and non-perturbative parts and the non-perturbative contribution factorizes into the vortex and anti-vortex series.

C Perturbative 5d Partition Functions
In this appendix, we briefly discuss perturbative partition functions and regularization issue. We will compute the 1-loop determinants of 5d theory on S 1 × C 2 and 3d theory on S 1 × C where S 1 denotes the time circle. We will also consider the elliptic genus of 2d theory which can arise as a boundary theory of the 3d theory.
Let us start with the 1-loop determinants of 5d theories. We can use the equivariant indices for the vector and hypermultiplets where α are the roots and ρ are the weights of the gauge group and m is the equivariant parameter for the flavor symmetry. The denominator factors is understood as a power series expansion in terms of e 1 and e 2 . When we compute the 1-loop determinants using these equivariant indices, there is an issue related to the boundary condition on ∂C 2 , which has not been clarified yet. We will not attempt to clarify this issue in this paper, but we will adopt the following prescription. For the multiplets in the complex representations in the gauge group, we will simply use the above equivariant indices and compute the corresponding 1-loop determinants. However, for the real multiplets, we will first take average of the equivariant index with its charge conjugation and then compute the 1-loop determinant. This prescription respects the invariance of the real multiplets under the charge conjugation. We also remind the reader that the equivariant indices implicitly have the factor t∈Z e 2πi β t for the Kaluza-Klein momenta along the temporal circle. In what follows we set β = 1 for convenience, which can be restored by scaling other chemical potentials.
The equivariant index of the chiral multiplet with R-charge ∆ is (1 − e ρ(a)+m q 1−∆/2 q n ) . (C.11) The prefactors involve the 1-loop corrections to the (mixed-) Chern-Simons terms by the matter fields.