Expanding the Bethe/Gauge Dictionary

We expand the Bethe/Gauge dictionary between the XXX Heisenberg spin chain and 2d N = (2,2) supersymmetric gauge theories to include aspects of the algebraic Bethe ansatz. We construct the wave functions of off-shell Bethe states as orbifold defects in the A-twisted supersymmetric gauge theory and study their correlation functions. We also present an alternative description of off-shell Bethe states as boundary conditions in an effective N = 4 supersymmetric quantum mechanics. Finally, we interpret spin chain R-matrices as correlation functions of Janus interfaces for mass parameters in the supersymmetric quantum mechanics.


Introduction
The aim of this paper is to extend the dictionary between quantum integrable systems and supersymmetric gauge theories introduced and studied in [1][2][3], the so-called Bethe/Gauge correspondence. We focus on an elementary example of this phenomenon: the correspondence between the XXX 1 2 Heisenberg spin chain and a family of 2d N = (2, 2) supersymmetric gauge theories. Some basic aspects of this correspondence are summarized in figure 1. A fundamental entry in the dictionary is the identification of the eigenstates of the spin chain Hamiltonian with massive vacua of the supersymmetric gauge theory. The spin chain is a quantum integrable system, whose spectrum is encoded in the Bethe equations [4], Here, σ a denote the rapidities of excitations, m i are inhomogeneities, q determines a quasiperiodic boundary condition and is Planck's constant.
On the supersymmetric side of the correspondence, m j and are complex mass parameters associated to flavour symmetries of the gauge theory in figure 1, while q is the exponential of a complexified FI parameter. For generic values of the mass parameters, the theory has a low energy description as a U (1) k gauge theory with an effective twisted superpotential W (σ) depending on complex vectormultiplet scalars σ a . This function is determined exactly by a one-loop calculation. The equations for supersymmetric vacua, exp ∂ W ∂σ a = 1 , a = 1, . . . , k , (1.2) coincide with the Bethe equations for the spin chain (1.1). The ring generated by gaugeinvariant functions of the vectormultiplet scalars σ 1 , . . . , σ k modulo the relations (1.2) is the twisted chiral ring of the supersymmetric gauge theory. The twisted superpotential itself can be identified with Yang-Yang function of the spin chain.
A powerful approach to computing a wide range of observables in quantum integrable systems is the algebraic Bethe ansatz, as explained in [5]. In this paper, we will understand how elements of this approach arise in the Bethe/Gauge correspondence. For this purpose, we will perform exact computations in the original supersymmetric gauge theory shown in figure 1, rather than the effective abelian description. In particular, we will interpret aspects of the algebraic Bethe ansatz in terms of correlation functions in the A-type topological twist of the supersymmetric gauge theory, using techniques from supersymmetric localization [6,7]. Investigations of the Bethe/Gauge correspondence in this context have appeared in [8,9]. The remainder of the introduction is dedicated to summarizing our results.
An important part of the algebraic Bethe ansatz is the construction of off-shell Bethe states |σ 1 , . . . , σ k , which are elements of the spin chain Hilbert space depending on auxiliary parameters σ 1 . . . , σ k . The inner product f |σ 1 , . . . , σ k with another state |f is a symmetric function f (σ 1 , . . . , σ k ) of the auxiliary parameters, which can be identified with a gaugeinvariant function of the vectormultiplet scalar in the supersymmetric gauge theory in figure 1. then sets up a correspondence between states in the spin chain Hilbert space and invariant functions of σ 1 , . . . , σ a modulo relations, such that the inner product f |g on the spin chain Hilbert space coincides with the two-point correlation function of f (σ 1 , . . . , σ k ) and g(σ 1 , . . . , σ k ) in the A-twisted theory on CP 1 . This is illustrated in figure 2.
f ( ) g( ) hf |gi = Figure 2: The inner product on the spin chain Hilbert space corresponds to two-point correlation functions in the A-twisted supersymmetric gauge theory on CP 1 .
In order to investigate this relation, it is convenient to introduce an orthonormal 'updown' basis for the spin chain Hilbert space. The basis elements are labelled by subsets I = {i 1 , . . . , i k } ⊂ {1, . . . , N } such that |I is the state with spin ↑ at positions i 1 , . . . , i k and spin ↓ everywhere else. We can then introduce the wavefunctions of off-shell Bethe states in this basis, S I (σ 1 , . . . , σ k ) ∝ I|σ 1 , . . . , σ k , (1.4) which provide a set of generators for the twisted chiral ring. Nekrasov has proposed a physical definition of the corresponding twisted chiral ring elements as 'orbifold defects' [10]. In this paper, we explain how to implement this orbifold construction in the A-twisted supersymmetric gauge theory to compute correlation functions of the twisted chiral operators (1.4) . We furthermore demonstrate that these operators are orthonormal with respect to the A-model two-point functions, corresponding to the fact that I|J = δ I,J in the spin chain Hilbert space.
In the algebraic Bethe ansatz, the eigenstates of the spin chain Hamiltonian are obtained by evaluating the off-shell Bethe state |σ 1 , . . . , σ k on a solution of the Bethe equations (1.1). The functions S I (σ 1 , . . . , σ k ) evaluated on solutions of the Bethe equations are therefore the wavefunctions of the eigenstates in the 'up-down' basis |I . We will show that this wavefunction can be obtained directly from the supersymmetric gauge theory by computing the A-model in a cigar geometry with a vacuum corresponding to I at infinity. More precisely, we first introduce an Ω-background and then compute a normalized correlation function that is finite in the limit → 0. This is shown in figure 3. The parameter q determines the quasi-periodic boundary condition for the spin chain. Apart from the final step of evaluating the off-shell Bethe states on solutions of the Bethe equations, the steps in the algebraic Bethe ansatz are independent of the parameter q. It is therefore sufficient to understand these aspects in the limit q → 0, which corresponds to discarding instanton corrections in the A-twisted supersymmetric gauge theory. In this limit, correlation functions can be understood in a finite-dimensional N = 4 supersymmetric quantum mechanics with boundary conditions preserving the same pair of supercharges as the A-twist. In particular, each twisted chiral operator generates a boundary condition in the supersymmetric quantum mechanics, and two-point functions are computed by interval partition functions -as shown in figure 4. In particular, we will provide two independent constructions of the boundary conditions generated by the operators S I (σ 1 , . . . , σ k ), either by coupling Neumann boundary conditions to additional degrees of freedom or as 'thimble' boundary conditions. The setup described above is compatible with turning on background holonomies for flavour symmetries. In the supersymmetric quantum mechanics description, background flavour holonomies around the circle become 'real mass parameters' for flavour symmetries. The ordering of the holonomy eigenvalues or real masses can be identified with an ordering of sites on the spin chain. It is therefore natural to consider 'Janus' interfaces which permute the ordering of the masses. We will show that A-model correlation functions of such Janus interfaces in between the elements S I (σ 1 , . . . , σ k ) reproduce matrix elements of the spin chain R-matrix. The Yang-Baxter relation is interpreted as the statement that a given permutation of real mass parameters can be decomposed in a number of ways into elementary Janus interfaces permuting a pair of real mass parameters. Finally, the Bethe/Gauge correspondence provides a physical realization of a parallel developments in geometry and representation theory, and many of the objects we consider here have already appeared in this context. The starting point is the statement that the twisted chiral ring is the equivariant quantum cohomology ring of the vacuum manifold of the supersymmetric gauge theory, T * G(k, N ). The A-model correlation functions considered here can be formulated in the language of quasi-maps to the vacuum manifold. In particular, the functions S I (σ 1 , . . . , σ k ) were introduced in work of Maulik and Okounkov [11] as the 'stable basis' in the quantum equivariant cohomology (see [12] for connections to Bethe wavefunctions). This paper is largely motivated by understanding these mathematical constructions in the language of supersymmetric gauge theory.
The paper is organized as follows. In Section 2 we collect some relevant properties of the Heisenberg spin chain. In Section 3 we describe 2d N = (2, 2) supersymmetric gauge theory and explain how to calculate their A-twisted sphere and cigar partition functions using supersymmetric localization. Section 4 focuses on the definition of the distinguished twisted chiral operators and their correlation functions. In Section 5 we reduce the problem to a 1d quantum mechanics and explain how the twisted chiral operators can arise from appropriate boundary conditions in this quantum mechanics. Finally, in Section 6 we show how the spin chain R-matrices can be obtained as correlation functions of twisted chiral operators in the supersymmetric gauge theory. Our conventions and more technical details of the calculation are postponed to the Appendix.

Spin Chain Primer
In this section we collect some basic information on the Heisenberg XXX 1 2 spin chain, where all spins transform in the fundamental representation of su (2). Many of the statements we present here and in subsequent sections have a natural generalization to spin chains with higher representations, as well as to higher rank algebras. Our notation is designed to match that of supersymmetric gauge theory and therefore differs from standard integrability conventions.

Heisenberg Spin Chain
In order to define the Heisenberg spin chain we need to specify a Hamiltonian and a Hilbert space on which it acts. The Hilbert space of the spin chain is the N -fold tensor product of the fundamental representation of su (2), (2.1) We introduce standard basis elements | ↑ and | ↓ for each spin chain site C 2 . There is then a natural basis for V that is labelled by subsets We define an inner product by demanding that the basis vectors at each site are orthonormal and naturally extending this definition to V. Any operator A : V → V can be represented a 2 N × 2 N matrix of its expectation values between tensor products of | ↑ and | ↓ . The (twisted, homogeneous) Heisenberg spin chain is defined by the Hamiltonian, with the twisted boundary condition, Later on, we will also introduce inhomogeneities for each spin chain site. The Hamiltonian commutes with the operator counting up spins and therefore the Hilbert space can be decomposed into a direct sum of spaces with fixed number of excitations, The spectrum of the Heisenberg spin chain can be then found using the celebrated Bethe ansatz. In particular, the eigenvalues of the Hamiltonian H are obtained from the dispersion relation where we sum over the rapidities 1 of excitations σ a , a = 1, . . . , k, which are solutions to the Bethe equations There is a natural generalisation of the homogeneous spin chain described above to include inhomogeneities m i at each site of the spin chain 2 . In that case we denote the spin chain Hilbert space as 9) and the Bethe equations turn into

R-matrices
There are many independent ways to arrive at the Bethe equations (2.10). Usually, the most powerful method is the algebraic Bethe ansatz, which is based on the construction of an R-matrix. For the inhomogeneous spin chain, this is an operator acting on two sites, It has rational dependence on m j −m i and satisfies the regularity property R ij (0) ∼ P ij where P ij is the permutation operator, together with the Yang-Baxter equation (shown graphically in figure 5a) where R ij acts non-trivially only on C 2 m i and C 2 m j . An explicit form of the R-matrix is where m ji = m j − m i and we fixed the normalisation by the unitarity condition (shown graphically in figure 5b) R 12 (m)R 21 (−m) = I . (2.14) 1 It is common to use the letter u to denote rapidities. In this paper we use the letter σ instead in order to make connection with the gauge theory side of our story in the following sections. 2 It is common to use the letters vi to denote inhomogeneities. In this paper we use the letters mi instead in order to make connection with the gauge theory side of our story in the following sections.

Bethe States
We now introduce an auxiliary space C 2 σ with spectral parameter σ and define the monodromy matrix where each R i0 (σ − m i ) acts non-trivially only on the auxiliary space and C 2 m i . This is a 2 × 2 matrix in the auxiliary space where each matrix element is an operator acting on the Hilbert space (2.9). Namely, each matrix element of M (σ) in the auxiliary space can itself be represented by a 2 N × 2 N matrix. For a given k, we define an off-shell Bethe state by where |Ω = | ↓ . . . ↓ . Additionally, for given subset I = {I 1 , . . . , I k } of {1, . . . , N }, we define the functions S I (σ) as the overlaps of off-shell Bethe state |σ 1 , . . . , σ k with the basis vectors: Here we have introduced a normalization factor which is independent of I. These functions can be computed explicitly with the result, It can be shown that the states |σ 1 , . . . , σ k become eigenstates of the spin chain Hamiltonian provided σ a are evaluated on a solution σ J a of the Bethe equations. The functions S I (σ J ) are then (up to normalization) the wavefunctions of the Bethe eigenstates in the position basis |J . In the following sections, we will explain how to construct such wavefunctions in the Bethe/Gauge correspondence.

Setup
In this section, we review the computation of correlation functions in A-twisted supersymmetric gauge theories on CP 1 and a cigar. We review two approaches to computing such correlation functions using supersymmetric localization. The first leads to a contour integral in the complex Cartan subalgebra of the gauge group. The second is via equivariant localization on the moduli space of quasi-maps into the vacuum manifold. This will provide a foundation for the results presented in the following sections.

The Model
We consider 2d N = (2, 2) supersymmetric gauge theories with R-symmetry U (1) V × U (1) A that flow to sigma models onto cotangent bundles to complex Grassmannians, T * G(k, N ). Such a theory has gauge symmetry G = U (k) and flavour symmetry G f = P SU (N ) × U (1) . The field content is depicted in figure 6 and can be summarized as follows: • A vectormultiplet containing bosonic fields (A µ , σ, D) transforming in the adjoint representation of U (k), where A µ is the gauge field, σ is a complex scalar and D is an auxiliary scalar.
• Chiral multiplets (Φ, X, Y ) transforming as shown in the table below.
• A complex twisted chiral parameter t = θ 2π + ir, combining a real FI parameter r > 0 and theta angle θ.
Our conventions are summarized in Appendix A.
For positive FI parameter, r > 0, the theory flows to a sigma model onto the moduli space of solutions the vacuum equations 3) k N X Y Figure 6: Quiver modulo constant gauge transformations. We define to be the moment map for the gauge symmetry. It can be shown that solutions require Φ = 0 and σ = 0, and that the remaining equations reproduce the hyper-Kähler quotient construction of T * G(k, N ) where r is the Kähler parameter of the base Grassmannian G(k, N ). We refer to this as the vacuum manifold V. It is useful to provide an algebraic description of the vacuum manifold. For r > 0, we can replace the D-term equation (3.1) by the stability condition that the matrix X has maximal rank and divide by complex gauge transformations, From this perspective, X defines a k-plane in C N corresponding to a point in the base Grassmannian G(k, N ). For example, in the case k = 1, we have T * CP N −1 with homogeneous coordinates [X 1 , . . . , X N ] on the base. For negative FI parameter r < 0, the roles of X and Y would be interchanged. We can also introduce complex mass parameters for the flavour symmetry G f by coupling to a background vectormultiplet and introducing non-zero vacuum expectation values (m 1 , . . . , m N , ) to the complex scalar in the vectormultiplet in a Cartan subalgebra T f ⊂ G f . Note that we must have j m j = 0. In the presence of complex masses, equations (3.3) are replaced by :

Sphere Partition Function
We will now consider correlation functions in the Ω-deformed A-model on C = CP 1 , introduced in [6,7]. We introduce homogeneous coordinates [z : w] on CP 1

Contour Integral
Partition functions in the Ω-deformed A-model can be computed exactly using supersymmetric localization for the supercharge Q = Q − + Q + [6,7]. This reduces the path integral to a contour integral over the complex Cartan subalgebra of G parametrized by the eigenvalues (σ 1 , . . . , σ N ) of the vectormultiplet scalar σ.
In order to express the contributions to the integrand of the contour integral from the various multiplets, it is convenient to introduce the following function is Barnes' gamma function. Due to the functional equation Γ 1 (x + ) = x Γ 1 (x), this ratio of Barnes' gamma functions is in fact a rational function of σ. The contribution to the integrand from a chiral multiplet of charge r under the U (1) V vector R-symmetry and charge q f under a U (1) f flavour symmetry is Z (q f n−r) (q f σ), where σ is the vectormultiplet scalar and n ∈ Z is the quantized flux through CP 1 .
Coming back to the model introduced in section 3.1, partition functions are expressed as a contour integral over the complex vectormultiplet scalar σ = (σ 1 , . . . , σ k ) together with a summation over the flux n = (n 1 , . . . , n k ) ∈ Z k . The contributions to the integrand from the chiral multiplets are where we introduce a shorthand notation σ ab = σ a − σ b and n ab = n a − n b . There is an additional contribution from the vectormultiplet (n a − n b ) 2 . (3.11) The partition function is then given by combines the contributions from the vector and chiral multiplets. We include an additional sign (−1) P with P = k 2 + (k + N + 1) a n a , where the factor k 2 fixes a sign ambiguity in the contributions from the chiral multiplets [6] and (k + N + 1) a n a is an additional sign that can be absorbed into the definition of q. The contour γ is given by the Jeffrey-Kirwan prescription, which reduces for r > 0 to the contour surrounding poles at for all i = 1, . . . , N and = 0, . . . , n a coming from the contributions from the chiral multiplets X a i in the fundamental representation of the gauge group. The summation over fluxes can therefore be restricted to the region n ∈ Z k ≥0 . We will often use the shorthand notation n := a n a .
The partition function is enriched by inserting twisted chiral operators annihilated by Q − and Q + at {±}. We will consider gauge-invariant functions f ( σ) of the vectormultiplet scalar. As explained in [6,7], there are then additional contributions

{+}
: to the integrand in equation (3.12). We denote a correlation function with f ( σ) inserted at {+} and g( σ) inserted at {−} by Importantly, the contributions from n a > 0 vanish unless certain conditions are satisfied. For example, in the abelian case instanton corrections to f (σ), g(σ) S 2 vanish unless the combined degree of the polynomials is greater than or equal to 2N − 1. This follows from the fact that for n > 0 the only potential pole outside of the contour is at σ → ∞, which only exists if deg(f ) + deg(g) ≥ 2N − 1. This phenomenon can be understood as the condition to cancel the U (1) A axial anomaly. In all cases, the partition function 1 S 2 receives contributions only from n = 0 and is therefore independent of q.
Moreover, correlation functions involving particular combinations of twisted chiral operators vanish, reflecting the structure of the twisted chiral ring. For example, in the abelian case for any f (σ) and g(σ). In the limit → 0, we recover the twisted chiral ring relations, which coincide with the equivariant quantum cohomology ring of the vacuum manifold V = T * CP N −1 .
In the limit → 0, the general twisted chiral ring relations of a non-abelian theory that hold inside correlation functions are This coincides with the quantum equivariant cohomology ring of V = T * G(k, N ) and the Bethe equations (2.10) for an inhomogeneous XXX 1 2 spin chain of length N with quasiperiodic boundary conditions.

Counting Quasi-maps
We now consider alternative approach to computing correlation functions in A-twisted gauged linear sigma models introduced in [13,14] in terms of vortex counting. This approach was derived rigorously from supersymmetric localization in [6]. The mathematical formulation of this construction involves equivariant integrals over holomorphic 'quasi-maps' to the vacuum manifold V, which may be computed by equivariant localization [15,16]. This provides the link with recent mathematical work on the Bethe/Gauge correspondence [12].
In this approach, we first set the complex mass parameters (m 1 , . . . , m N , ) and the Ω-deformation to zero, and consider configurations preserving both Q − and Q + . Such configurations are given by The solutions of such 'generalized vortex equations' are known as freckled instantons [17,18]. The moduli space of solutions has an algebraic description by dropping the D-term equation (3.20) in favour of a stability condition and dividing by complex gauge transformations. This leads to a description in terms of stable 'quasi-maps' from C = CP 1 into the vacuum labelled by the vortex number or flux n ∈ Z through CP 1 , which coincides with the degree of the quasi-map. Now turning on the mass parameters (m 1 , . . . , m N , ) and the Ω-deformation parameter deforms the equations (3.23)-(3.24) that determine σ by replacing where (m 1 , . . . , m N , ) are understood to mean the infinitesimal T f flavour transformation generated by these parameters and L V is the Lie derivative along the vector field V generating U (1) rotations. This restricts the system to the fixed points of the corresponding T f action on the moduli space M. This can be understood as working equivariantly with respect to the action of T f × U (1) on the moduli space M with equivariant differential Q = Q − + Q + . In particular, localization of the path integral to Gaussian fluctuations around Q − ,Q + -invariant configurations is equivalent to computing the following sum of equivariant integrals where [M n ] vir is the virtual fundamental class. The correlation functions f ( σ), g( σ) S 2 correspond to computing the equivariant integrals of certain virtual equivariant cohomology classes [f ] and [g] on M n . We will first explain how to compute the partition function in this manner in the abelian case, before considering the general case.

Abelian Case
We first set the mass parameters (m 1 , . . . , m N , ) and Ω-deformation to vanish. Assuming r > 0, we then have σ = Φ = 0 and the remaining equations become Solutions are labelled by the flux through C = CP 1 and we denote the corresponding moduli space by M n . It is convenient to introduce the following algebraic description of the moduli space M n . We first remove the D-term equation (3.28) and replace it for r > 0 by the stability condition that X j = 0 for all j = 1, . . . , N except at a finite number of points on CP 1 . In addition, we divide by complex gauge transformations that leave the remaining equations (3.29) invariant. A point in M n is now specified by N holomorphic sections (X j , Y j ) of O(n) ⊕ O(−n), such that j X j Y j = 0 and the sections X j are not all zero. It is now straightforward to compute the moduli spaces explicitly: • If n < 0, the moduli space is empty M n = ∅.
• If n = 0, we recover the algebraic description of the vacuum manifold M 0 = V = T * CP N −1 .
• If n > 0, we have Y j = 0 and the moduli space is parametrized by N holomorphic sections X j of O(n). Using a complex gauge transformation to set Az = 0, the holomorphic sections are homogeneous polynomials The moduli space is therefore parametrized by the N (n + 1) coordinates x j,r that are not all zero, modulo residual constant C * gauge transformations preserving Az = 0. We therefore find that M n = CP N (n+1)−1 .
We now consider the fluctuations around a point on the moduli space M n for n ≥ 0. On general grounds such fluctuations decompose into chiral and Fermi multiplets with respect to the supersymmetry algebra generated by Q − andQ + . A 2d N = (2, 2) chiral multiplet of U (1) V charge r transforming as a section of a line bundle L contributes:

Fermi multiplets:
Here, K C is the canonical bundle of the Riemann surface C. For us, K C = O(−2). This can be summarized by the statement that the fluctuations of a 2d N = (2, 2) chiral multiplet contribute H • (C, K r/2 C × L) to the 'virtual tangent bundle' of the moduli space. Turning on (m 1 , . . . , m N , ) and corresponds to working equivariantly with respect to the action of T f × U (1) on M n . Let us consider the fluctuations from each chiral multiplet in turn for n > 0, leaving the special case n = 0 until the end.
• The fluctuations from each X j transform in H • (C, O(n)). There are therefore N (n + 1) chiral multiplets corresponding to fluctuations of the coordinates x j,r in equation (3.31) and no Fermi multiplets. Under a G × G f × U (1) transformation generated by parameters (σ, m 1 , . . . , m N , , ), they transform with weight There are therefore no chiral multiplets and N (n − 1) Fermi multiplets corresponding to fermion zero modes in the vortex background. They transform with weight ). There is therefore a single Fermi multiplet transforming with weight − .
In addition there is a contribution −H • (O) from the vectormultiplet. Combining these contributions, the equivariant index of the virtual tangent bundle is where −1 comes from the vectormultiplet. The moduli space M n = CP N (n+1)−1 has isolated fixed points under a generic T f × U (1) transformation generated by (m 1 , . . . , m N , , ), which correspond to the N (n + 1) coordinate lines. We can label the fixed points by the pair (i, r) with i = 1 . . . , N and r = 0, . . . , n. The fixed points correspond to sections The contribution to the partition function from fluctuations around each fixed point of M n is encompassed in the virtual localization formula where we have introduced the replacement rule e : i n i e w i → i w n i i to compute the equivariant Euler character. This result is most neatly expressed as the following contour integral where the contour surrounds the poles corresponding to the fixed points . This exactly reproduces the coefficient of q n for n > 0 in the contour integral formula (3.12). Note that the Jeffrey-Kirwan residue corresponds to computing residues at poles of the integrand corresponding to fixed points of M n .
Let us now consider the special case n = 0. The moduli space now corresponds to constant maps to the vacuum manifold V = T * G(k, N ) with bosonic fluctuations from both X and Y . As above, the equivariant localization expression is neatly expressed as a contour integral where the contour surrounds the poles at σ = m j − 2 from the contribution of X j . This is a regular equivariant integral of 1 over the vacuum manifold V = T * G(k, N ). The extension to include twisted chiral operators inserted at {±} will be discussed in detail in section 4.

Non-Abelian Case
With gauge group U (k), we again pass to an algebraic description of the moduli space M of solutions to equations (3.20)-(3.22) by removing the D-term equation in favour of a stability condition and dividing by complex gauge transformations. We therefore consider only with the stability condition that the k × N matrix X has maximal rank away from isolated points on C = CP 1 and modulo complex GL(k, C) gauge transformations. A point in M n is then specified by: • Holomorphic sections X and Y of associated vector bundles V × W and V × W where W C × C N is a trivial vector bundle associated to the fundamental representation of the P SU (N ) flavour symmetry.
• Stability condition that rk(X) = k except at isolated points.
According to a theorem of Grothendieck, on C = CP 1 we can decompose This leads to a stratification of the moduli space for flux n ∈ Z into components labelled by integers (n 1 , . . . , n k ) ∈ Z k with a n a = n. The moduli space is empty if n a < 0 for any a = 1, . . . , k.
We therefore restrict attention to the region n a ∈ Z ≥0 . Fluctuations around a point on the moduli space M n decompose into chiral and Fermi multiplets with respect to the superalgebra generated by Q − andQ + . Following the discussion above, the contributions can be summarized by the equivariant index (3.42) where we have introduced yet another trivial line bundle W C × C associated to the fundamental representation of the flavour symmetry U (1) . The first three contributions arise from the fluctuations of the chiral multiplets X, Y and Φ respectively. The final contribution −H • (V ×V ) is the contribution from the vectormultiplet.
The equivariant index is straightforward to write down explicitly for any n ∈ Z k ≥0 . Let us write the formula for the case when n a ≥ 1 for all a = 1, . . . , k, and n a = n b for a = b: .
The moduli spaces themselves for k > 1 are singular and do not admit an explicit description as in the abelian case. It is nevertheless possible to compute the equivariant fixed points in terms of the algebraic data and apply the virtual localization formula to compute the partition function. The fixed points are labelled by a decomposition n = {n 1 , . . . , n k }, a choice of vacuum I = {I 1 , . . . , I k } ⊂ {1, . . . , N } and a vector s = {s 1 , . . . , s k } where s a ∈ {0, 1, . . . , n a }. The vectormultiplet scalar takes the following value at this point and the virtual localization formula is .
This reproduces coefficient of q n for n > 0 in the contour integral formula (3.12) where the data { n, I, s} enumerate poles of the integrand chosen by the Jeffrey-Kirwan description. The case n = 0 should again be treated separately and reproduces a regular equivariant integral over the vacuum manifold V = T * G(k, N ).

Vortex Partition Function
We will also consider the vortex partition function or 'cigar' partition function with a fixed vacuum v I at infinity. We can equivalently view this as a sphere with the boundary condition that the system sits in the vacuum v I at {−}, as shown in figure 8. In section 4.3, this partition function will be used to construct the wavefunctions of spin chain Bethe eigenstates. As above, we present the partition function both as a contour integral over the complex Cartan subalgebra of the gauge group and its interpretation in terms of counting quasi-maps that are 'based' at {−}. Figure 8: We consider the vortex partition function on a cigar with U (1) J isometry and vacuum v I at infinity. This can also be viewed as a sphere with a fixed vacuum at {−}.

Contour Integral
Let us first consider the abelian case. The partition function with the vacuum v i at {−} can be expressed as a contour integral in the vectormultiplet scalar σ, for all j = 1, . . . , N and ∈ Z ≥0 . The contour γ i selects only those poles with j = i arising from the 1-loop determinant for the chiral multiplet X i that has a non-zero expectation value in the vacuum v i .
The classical and 1-loop contributions can be factored out by normalizing by the value of the partition function at q → 0 The result, is the vortex partition function with vacuum v i at infinity. This can be generalized to the non-abelian case with vacuum v I , The same integrand appears in the computation of the hemisphere partition function with the boundary condition supported on the whole of V = T * G(k, N ) [19,20]. However, the contour γ I surrounds only the poles arising from the 1-loop determinant of the chiral multiplets X i for all i ∈ I. As above, we can extract the corresponding vortex partition function V I (q), which we will not write down explicitly. We will denote the correlation function of a twisted chiral operator f ( σ) at {+} in the background with a supersymmetric vacuum v I at infinity {−} by f ( σ) v I . In the limit that we remove the Ω-deformation, → 0, such correlation functions have the common asymptotic behavior where W ( σ) is the effective twisted superpotential and σ I a (q) = m Ia − 2 +O(q) is the particular solution of the Bethe equations (2.10) associated to the fixed vacuum v I at infinity. Therefore, normalizing by the vortex partition function, we find that is independent of and it evaluates the twisted chiral operator at a particular solution of the Bethe equations corresponding to a fixed vacuum v I . In section 4.3, evaluation of this expectation value for a particular class of functions f ( σ) will be used to construct the wavefunctions of spin chain Bethe eigenstates.

Counting Quasi-maps
The vortex partition function can also be expressed as an equivariant integral over the moduli space of vortices with vacuum v I . The algebraic description of this moduli space is in terms of 'based' quasi-maps to the vacuum manifold V such that the point {−} is mapped to a fixed vacuum v I . Let us denote the moduli space of based quasi-maps by M v I with components M n,v I labelled by a flux n ∈ Z. It is straightforward to relate equivariant integrals over the moduli spaces M n and M n,v I as follows.
Let us first consider the abelian case with a vacuum v i at the fixed point {−} and flux n > 0. In the notation of equation (3.31), the vacuum condition fixes the coordinates x j,0 = δ ij . Here, a complex gauge transformation has been used to set the non-zero coefficient to 1. Therefore, the moduli space is M n,v i = C N n , parametrized by the remaining coordinates x j, for j = 1, . . . , N and = 1, . . . , n. This has a single equivariant fixed point at the origin, with compensating gauge transformation σ = σ i,0 = m i − 2 − n 2 . Clearly, the vacuum condition removes bosonic fluctuations corresponding to the coordinates x j,0 . On the other hand, there are now additional fermionic zero modes. The result can be summarized by adding a contribution −T v i V to the virtual tangent bundle. The result is that where Z (n) N,k (σ) is the same integrand that appeared in the computation of the sphere partition function (3.12) and the contour γ i,n computes the residue at the pole σ = σ is the equivariant weight of the tangent space T v I V.

Factorization
Although not strictly necessary for this paper, we note that partition functions on the sphere can be decomposed into vortex partition functions, Intuitively, the sphere is 'pinched' to form a pair of spheres with identified marked points, as shown in figure 9. The path integral is then decomposed into a product of integrals over moduli spaces of quasi-maps restricted to land on a fixed point v ∈ V at each marked point, which is then integrated over the vacuum manifold V. In the presence of mass parameters (m 1 , . . . , m N , ) and , this becomes an equivariant integral over V and equivariant localization reproduces the above equation.

Defect Operators in 2d
In this section, we consider in more detail the correlation functions of twisted chiral operators constructed from invariant functions of σ. In the presence of the mass parameters (m 1 , . . . , m N , ), the twisted chiral ring coincides with the equivariant quantum cohomology of the vacuum manifold V = T * G(k, N ). In computing correlation functions, twisted chiral operators can be interpreted as equivariant cohomology classes on the moduli spaces M n of quasi-maps to V.
We will study a distinguished set of generators for the twisted chiral ring, which coincide with the stable basis in equivariant cohomology introduced in [11] and coincide with the wavefunctions of off-shell Bethe states. In section 4.1, we focus on abelian theories, reviewing the dictionary between polynomials in σ and equivariant cohomology classes, and introducing the stable basis elements in the case of V = T * CP N −1 . In Section 4.2, we consider a systematic physical construction of the stable generators using an orbifold construction proposed by Nekrasov [10] and explain how to implement this construction in the A-model to recover the functions S I ( σ). Finally, in section 4.3 we show that the correlation functions of the stable basis in a cigar background reproduce on-shell Bethe wavefunctions.

Abelian Theories
In abelian theories, twisted chiral operators f (σ) are polynomials in the vectormultiplet scalar σ. Turning on complex mass parameters, we restrict to polynomials that are homogeneous in the parameters (σ, m 1 , . . . , m N , ). Recalling that these parameters have U (1) A charge +2, a homogeneous polynomial of degree d will correspond to an equivariant form on V of degree 2d.
Let us first consider the case of vanishing flux, where we have constant maps into the vacuum manifold, V = T * CP N −1 . Consider the homogeneous polynomial corresponding to the equivariant weight of the coordinate X j . This is a polynomial representative of the equivariant cohomology class Poincaré dual to the submanifold is a polynomial representative of the cohomology class Poincaré dual to the complex codimension r submanifold {X 1 = · · · = X r = 0} ⊂ T * CP N −1 . Similar comments apply to polynomials that are products of weights of X j 's and Y j 's. Let us study the special case N = 2 more systematically. Recall that the vacuum manifold is found by solving the moment map constraints  It is convenient to exhibit the vacuum manifold as an S 1 fibration over R 3 induced the the action of U (1) m . The base is parametrized by the invariant real and complex moment maps for U (1) m , while the fiber is parametrized by To each individual chiral multiplet there is a holomorphic lagrangian in T * CP 1 defined by the vanishing of the corresponding coordinate, where F 1 , F 2 denotes the fibers of T * CP 1 at the points v 1 ,v 2 on the base CP 1 . These holomorphic lagrangian submanifolds are illustrated in figure 11. The equivariant weights of the coordinates then provide polynomial representatives of the Poincaré dual cohomology classes.
In particular, we have [  A general cohomology class is represented by a polynomial f (σ) of degree at most 2. This can be reduced to a polynomial of degree 1 using the q → 0 limit of twisted chiral ring relations, It may then be expressed uniquely as where the coefficients are rational functions of m and . For example, Note that we could have alternatively chosen the complementary pair of cohomology classes [F 1 ] and [CP 1 ∪ F 1 ] whose polynomial representatives are obtained from S 1 (σ) and S 2 (σ) by the replacements m → −m and σ → −σ.
The above discussion has a natural extension to N > 2. The basis generalizing (4.10) is given by More generally, we will introduce a stable basis for each permutation π of {1, . . . , N }. They correspond to the holomorphic lagrangians obtained by setting to zero the coordinates X π(j) for j = 1, . . . , i−1 and Y π(j) for j = i+1, . . . , N . The corresponding polynomial representatives S (π) i (σ) are obtained by permuting the mass parameters (m 1 , . . . , m N ) in expression (4.14). A more systematic approach, including the generalization this basis to the non-abelian case, is presented in section 4.2. Now let us consider correlation functions with flux n > 0. Let us take a polynomial f (σ) corresponding to an equivariant submanifold Z ⊂ V. Inserting this operator at the point {+} on CP 1 leads to an additional contribution f (σ − n 2 ) to the integrand of the correlation function. This corresponds to the equivariant cohomology class on the moduli space of quasimaps, M n = CP N (n+1)−1 , that is Poincaré dual to the subspace of quasi-maps that land in Z ⊂ V at the point {+}.
Let us demonstrate this in more detail. We recall that the moduli space M n = CP N (n+1)−1 is parametrized by the coefficients {x j, } of the sections where the coordinate x j,0 has equivariant weight σ − m j + 2 − n 2 .

Orbifold Construction
We now consider a more systematic definition of the stable basis of twisted chiral operators using an orbifold construction proposed by Nekrasov [10]. We will explain how to implement this construction in A-model correlation functions, reproducing the wavefunctions of off-shell Bethe states. Our approach mirrors similar computations for orbifold-type codimension-two defects in higher dimensions [21][22][23][24].

Chiral Multiplet
As a warm-up, we will first consider the case of a chiral multiplet. The contribution to the partition function of a chiral multiplet of U (1) V R-charge r = 0 is whose coefficients have equivariant weights where σ| ± = σ ∓ n 2 is the value of the complex vectormultiplet scalar at {±}. It is convenient to encode these contributions in the equivariant indices where zeta-function regularization of infinite products Γ 1 (x) ∼ ≥0 (x + ) −1 is understood. The total partition function (4.19) combining the contributions from {+} and {−} is of course a rational function, reflecting the fact that there is a finite number of global holomorphic sections of O(n) on CP 1 .
We now perform an orbifold construction at either of the fixed points {+} or {−} by choosing a subgroup Z N ⊂ U (1) J and turning on a discrete holonomy g = ω i−1 for the U (1) f flavour symmetry for some choice of i = 0, . . . , N − 1 where ω N = 1. The introduction of this orbifold is implemented at the level of the equivariant index by replacing and then averaging over the transformation → + 2πis for s = 0, . . . , N − 1, keeping the expectation value σ| ± fixed. Applying this operation to the equivariant indices (4.22) in the region −N < q f (i − 1) < N we find that Otherwise, the partition function is multiplied by an additional factor q f σ| ± . In this case, the orbifold construction is then equivalent to inserting the twisted chiral operator q f σ.
Let us now explain this procedure by implementing the orbifold construction directly on the mode expansion. We focus on the fixed point {+} and set the coordinate w = 1 with the understanding that φ transforms with weight σ| + = σ − n 2 under U (1) f flavour transformations. This is natural because σ| + is the vacuum expectation value of the complex scalar at {+}. With this understanding, the chiral field is expanded (4.26) In the presence of the orbifold, the chiral field should transform under Z N transformations as φ(z) → g q f φ(ωz), where g = ω i−1 . It is therefore convenient to define a deformed field φ(z) := z q f (i−1) φ(z), which absorbs the effect of the discrete holonomy and transforms in the standard wayφ(z) →φ(ωz). This has an expansion The modes that are invariant under the Z N action are φ + such that q f (i − 1) + =˜ N for some˜ ∈ Z. Projecting onto Z N -invariant modes and redefining the complex coordinate z → z 1/N , it is straightforward to see that where we have defined φ + := φ + N −q f (i−1) . Therefore the effect of the orbifold on the mode expansion is trivial if −N < q f (i − 1) ≤ 0. However, in the region 0 < q f (i − 1) < N the orbifold has removed the mode φ + 0 and we should therefore multiply the integrand of the partition function by the corresponding equivariant weight q f σ| + .

Gauge Theory
We now consider the supersymmetric gauge theory introduced in section 3.1 and introduce a Z N orbifold with discrete holonomy that breaks the U (k) gauge and P SU (N ) gauge and flavour symmetry to a maximal torus [10]. The construction depends on the following data: • A permutation π of {1, . . . , N }, which specifies the discrete holonomy for the flavour symmetry, (4.29) • An ordered subset I = {I 1 , . . . , I k } ⊂ {1, . . . , N } with I a < I b for a < b, which specifies the discrete holonomy for the gauge symmetry, We first perform the orbifold construction at the point {+}. We will denote the twisted chiral operator introduced by this orbifold construction at {+} by S The orbifold construction is implemented by shifting the complex flavour and gauge parameters according to the discrete holonomy, (4.32) and averaging over the transformations → + 2πis for s = 0, . . . , N − 1. This operation leads to a modification of the equivariant index by and therefore to an insertion of (4.34) in the integrand of the partition function. In writing this expression, we have symmetrized over σ 1 , . . . , σ k as the operator is inserted inside a contour integral that is symmetric in these parameters. Note that in the abelian case k = 1 with I = {i}, the above expression reduces to the abelian formula (4.14) considered above. This formula can be understood graphically as explained in figure 12. In order to read off the numerator of (4.34) one draws a k × N table and indicates the positions of {I 1 , . . . , I k } by . Then one fills in the cells to the right (light grey) with equivariant weights −σ a + m i + 2 corresponding to fields Y i a , and the cells to the left (dark grey) with weights σ a − m i + 2 corresponding to fields X a i . Finally, one multiplies all the weights in the table. The denominator of (4.34) is universal for all I for a given k.
Performing the orbifold construction at {+} with a holonomy labelled by a general permutation π inserts the operator S  We now perform the same computation at {+} using a zero mode analysis, highlighting the additional features that appear compared with a single chiral multiplet. For simplicity, we restrict ourselves here to the zero flux sector. The computation in the general flux sector is obtained by replacing σ a → σ a | + = σ a − na 2 everywhere with σ| + fixed under the orbifold action.
In absence of the orbifold defect, we can expand the fields X, Y and Φ around the point {+} as holomorphic functions of z, Note that since the adjoint chiral multiplet Φ has U (1) V charge +2, the expansion of this field starts at O(z) in the twisted theory.
In the presence of the Z N orbifold with discrete holonomies (4.29) and (4.30) at {+} we can introduce the deformed fields which transform under Z N transformations by replacing their argument z → ωz. We now project onto modes in the expansion that are invariant under Z N . For example, the invariant modes in the expansion of X a i are parametrized by (x ) a i with I a −i+ =˜ N for some˜ ∈ Z. Replacing z → z 1/N and relabelling the coefficients, the invariant parts of the expansions are The orbifold defect has completely changed the zero mode structure at {+}, as one can see from the above expansions. Note that before orbifolding, each component of X and Y had a zero mode at {+}, while Φ vanished there. However, the orbifold has eliminated some of the fluctuations of X and Y at {+} with equivariant weights corresponding to the equivariant weight at a fixed point of F k . This combines with the contribution from Φ to form the equivariant weight of the cotangent bundle T * F k . The symmetrization over σ 1 , . . . , σ k together with these denominator factors can be interpreted as an equivariant integral over the moduli space T * F k of the defect. The appearance of a hyper-Kähler moduli space is expected since in the absence of the mass parameter the defect preserves a N = (0, 4) supersymmetry. Combining these contributions reproduces the function S I (σ) obtained in equation (4.34).

Bethe Wavefunctions
The These wavefunctions arise in the supersymmetric gauge theory from expectation value of the stable basis elements S I (σ) in the cigar background with vacuum σ J at infinity, as in equation (3.51). More precisely, we compute the limit → 0 of a normalized correlation function with S I (σ) inserted at the tip of cigar and vacuum v J at infinity, We have already mentioned that this evaluates the function S I (σ) at the solution to Bethe equations (2.10) associated to the vacuum v J , with expansion σ J a = m Ja − 2 + O(q). We emphasize that the Bethe wavefunctions S I (σ J ) can be found directly from the gauge theory computation without solving any Bethe equations.

Quantum Mechanical Description
In this section, we provide an alternative viewpoint on A-model computations on CP 1 in terms of supersymmetric quantum mechanics. We replace CP 1 by a long cylinder capped off by Atwisted cigars. In the cylindrical region, the theory preserves 2d N = (2, 2) supersymmetry and we can reduce on S 1 to obtain an effective N = 4 supersymmetric quantum mechanics. The capped regions become boundary conditions in the supersymmetric quantum mechanics preserving the supercharges Q − , Q + . This setup is summarized in figure 13.
In principle, we can find a finite dimensional N = 4 supersymmetric quantum mechanics for each flux sector n ∈ Z individually. Here we restrict ourselves to a description to the zero flux sector n = 0, or equivalently the limit q → 0. As we have emphasized in the introduction, much of the representation theoretic apparatus of the algebraic Bethe ansatz does not depend on the choice of quasi-periodic boundary condition specified by q, and should therefore have a description in this supersymmetric quantum mechanics.
After a description of the N = 4 supersymmetric quantum mechanics and a general description of how to translate insertions of twisted chiral operators to boundary conditions, we I ( σ). The first involves a combination of Neumann or Dirichlet boundary conditions coupled to boundary degrees of freedom. The second involves the notion of a thimble boundary condition.

N = 4 Quantum Mechanics
Let us first consider the N = 4 supersymmetric quantum mechanics obtained from the zero flux sector n = 0 of our 2d N = (2, 2) theory, which is obtained by plain dimensional reduction of section 3.1 on a circle. In the absence of mass deformations, the supersymmetric quantum mechanics has U (1) V ×SU (2) A R-symmetry with U (1) A ⊂ SU (2) A as the Cartan subalgebra. We denote the euclidean coordinate of the supersymmetric quantum mechanics by τ . We refer the reader to appendix A.2 for further details on our conventions for supersymmetric quantum mechanics.
The U (k) vectormultiplet now contains scalar fields σ A transforming in a triplet of the SU (2) A R-symmetry. The complex combination σ = σ 1 + iσ 2 is the two-dimensional scalar and σ 3 arises from the integral of the two-dimensional gauge field around S 1 . The fermion gauginos λ now transform as a spinor of SU (2) A . The lagrangian for the vectormultiplet (A τ , σ A , λ, D) is where τ A denote the SU (2) A gamma matrices and we have suppressed contractions over SU (2) A spinor indices. A chiral multiplet consists of a complex scalar φ and fermions ψ transforming as a spinor of SU (2) A with lagrangian We have N fundamental chiral multiplets X, N anti-fundamental chiral multiplets Y , and an adjoint chiral multiplet Φ. There is also a cubic superpotential W = Tr(ΦXY ). The supersymmetric quantum mechanics has a vacuum manifold determined by solutions to the equations which coincide with configurations annihilated by all four supercharges. As in the twodimensional theory, with r > 0 solutions are forced to have σ A = 0 and the vacuum manifold is V = T * G(k, N ). The supersymmetric quantum mechanics has flavour symmetry G f = P SU (N ) × U (1) . We can turn on SU (2) A triplets of mass parameters (m A 1 , . . . , m A N , A ) of mass parameters by coupling to a background vectormultiplet with a vacuum expectation value for σ A in T f . The σ components of these mass parameters are the complex masses (m 1 , . . . , m N , ) introduced in two dimensions. In section 5.4, we will also want to turn on real mass parameters (m 3 1 , . . . , m 3 N ) which arise from turning on background holonomy for the P SU (N ) flavour symmetry around the S 1 .
In the presence of such mass parameters, equations (5.5) are deformed to For generic values of the mass parameters, this lifts the vacuum manifold to the isolated fixed points of the T f action on V.

Empty Boundary Condition
Before constructing boundary conditions in the supersymmetric quantum mechanics that correspond to the inserting S (π) I (σ) at the tip of the cigar, we first consider the empty boundary condition associated to a cigar without any insertion. Our discussion of such boundary conditions has much in common with the description of B-type boundary conditions in 2d N = (2, 2) gauge theories [19,20,25].
The appropriate boundary condition for the vectormultiplet can be determined as follows. First, as we are considering the sector with vanishing flux and σ 3 ∝ S 1 A, we should impose the Dirichlet boundary conditions σ 3 | = 0. The remaining boundary conditions, are determined by preserving the 0d N = (0, 2) supersymmetry algebra generated by Q 1 = Q − and Q 1 = Q + at the boundary. Let us now consider the boundary conditions for the chiral multiplets. A 1d N = 4 chiral multiplet can be decomposed into a chiral multiplet (φ, ψ 2 ) and a Fermi multiplet ψ 1 with superpotential E ψ (φ) = D τ φ in terms of the boundary N = (0, 2) supersymmetry algebra generated by Q − and Q + . A basic boundary condition therefore involves Neumann for the chiral component and Dirichlet for the Fermi component, The components (φ, ψ 2 ) transform as a N = (0, 2) chiral multiplet at the boundary. We call this a 'Neumann' boundary condition. In the presence of a bulk superpotential, this boundary condition must be supplemented by a choice of matrix factorization. The boundary condition corresponding to the empty cigar can now be described as follows. We first impose Neumann boundary conditions for X, Y and Φ. We then couple to a 0d Fermi multiplet η with the same charges as Φ and boundary superpotentials This provides a matrix factorization of the bulk superpotential, W | = E η · J η . Note that the boundary superpotential E η = Φ| effectively modifies the boundary condition for Φ from Neumann to Dirichlet. This is compatible with the zero mode analysis in section 4.2. In particular, the chiral fields X(z) and Y (z) were non-zero at z = 0 corresponding to a Neumann boundary condition, whereas Φ(0) = 0 reproducing a Dirichlet boundary condition. The 'empty' boundary condition is compatible with any vacuum configuration in V. It will therefore flow to Neumann boundary conditions in the supersymmetric sigma model supported on the whole of V. In particular, the partition function on an interval with the empty boundary condition at each end reproduces the n = 0 contribution to the CP 1 partition function, , (5.11) which is the equivariant integral of '1' over V. From this perspective, the denominators arise from the N = (0, 2) chiral multiplets X, Y . The contributions coming from two Fermi multiplets η at two boundaries cancel the contribution from the chiral multiplet Φ and provide the factor (−1) k 2 a,b (σ a − σ b − ) in the numerator. The remaining numerator factor a =b (σ a − σ b ) is the vector multiplet contribution. The contour γ is chosen by following the Jeffrey-Kirwan prescription.

Stable Boundary Conditions
We now consider the class of boundary conditions that arise from inserting S I (σ) at the tip of the cigar. Flowing to a supersymmetric sigma model to the vacuum manifold V, such boundary conditions are supported on holomorphic lagrangian submanifolds in V that are fixed by T f . In this section, we provide an elementary description of these boundary conditions in the supersymmetric gauge theory by coupling the empty boundary condition to additional boundary degrees of freedom. The construction is similar in spirit to the exceptional Dirichlet boundary conditions introduced in [26].
Let us first consider the abelian case. Following the arguments of section 4.1, let us first consider the boundary condition obtained by inserting the homogeneous polynomial σ−m j + 2 at the tip of the cigar, corresponding to the equivariant weight of the coordinate X j . In the vanishing flux sector, this is a polynomial representative of the equivariant cohomology class Poincaré dual to {X j = 0} ⊂ T * CP N −1 . This boundary condition is described in the supersymmetric quantum mechanics by coupling the empty boundary condition to a 0d N = (0, 2) Fermi multiplet χ j with the same charges as X j with boundary superpotentials The 0d N = (0, 2) chiral multiplet part of X j will receive a mass from the superpotential at the boundary modifying the boundary condition for X j from Neumann to Dirichlet. This boundary condition is therefore supported on the subspace {X j = 0} ⊂ T * CP N −1 of the vacuum manifold. In the computation of partition functions, the boundary Fermi multiplet χ j provides an additional contribution 13) in the numerator of the integrand. This reproduces the effect of inserting the twisted chiral operator f (σ) = σ − m j + 2 at the tip of the cigar.
It is now straightforward to write down the boundary condition corresponding to inserting the twisted chiral operator S I (σ) with I = {i} in abelian theories. We deform the empty boundary condition by introducing (N − 1) boundary Fermi multiplets χ j for j = i with the boundary superpotentials 14) The charges of the Fermi multiplets are uniquely determined by their superpotentials. The boundary condition is now supported on the subspace X j = 0 for j < I , Y j = 0 for j > I , (5.15) of the vacuum manifold V. A partition function with this boundary condition will include an additional contribution compared to the empty boundary condition, from the additional contributions of the Fermi multiplets χ j . Therefore, this boundary condition reproduced the computation with S I (σ) inserted. Note that due to the symmetry (χ j , E j , J j ) ↔ (χ j , J j , E j ), we could equivalently have coupled to boundary fermi multiplets with J-type superpotentials. This boundary condition can be easily generalized to non-abelian theories in a manner consistent with the zero mode analysis of section 4.2. The boundary condition for S I ( σ) with I = {I 1 , . . . , I k } should be supported on the subspace of V defined by X a j = 0 for j < I a , Y j a = 0 for j > I a . (5.17) These constraints can be implemented by introducing k(N − 1) Fermi multiplets denoted by χ a j for j < I a and χ j a for j > I a with superpotentials (E χ ) a j = X a j for j < I a , (E χ ) j a = Y j a for j > I a , (5.18) together with J χ = 0.
Recalling that I a ≤ I b if and only if a ≤ b, these constraints imply that the complex moment map for the gauge symmetry is upper triangular at the boundary, Therefore the matrix factorization requires that we introduce only k(k+1)

2
Fermi multiplets at the boundary, with components η a b for a ≥ b, with boundary superpotentials ( This leads to additional bosonic fluctuations at the boundary from the components Φ a b with a < b. In addition, the boundary condition breaks complex gauge transformations G C = GL(k) to the Borel subgroup B of upper triangular transformations. There are therefore additional bosonic fluctuations at the boundary parametrizing F k = G C /B, which is complex version of the breaking of U (k) to its maximal torus described in section 4.2. As mentioned there, these fluctuations combine with those of Φ a b | for a < b to form the cotangent bundle T * F k , whose hyper-Kähler structure is a reflection of the fact that the boundary condition preserves a N = (0, 4) supersymmetry in the limit → 0.
In the computation of interval partition functions, this boundary condition leads to an additional contribution compared to the empty boundary condition, . (5.20) Here, the numerator factors are the contributions from the boundary Fermi multiplets χ a j and χ j a . The denominator factors arise from additional bosonic zero modes of Φ a b | for a < b and from the breaking of the gauge symmetry. As mentioned in section 4.2, the denominator factors combine to form an equivariant weight of the tangent bundle at a fixed point of T * F k , and symmetrizing over σ 1 , . . . , σ k , the result can be interpreted as an equivariant integral over this boundary moduli space.

Thimble Boundary Conditions
In this section, we turn on real mass parameters (m 3 1 , . . . , m 3 N ) valued in the Cartan subalgebra of the P SU (N ) flavour symmetry. These parameters arise from a background flavour holonomy around S 1 in the two-dimensional setup. In the presence of real mass parameters, there is a natural class of boundary conditions for the supersymmetric quantum mechanics preserving Q − , Q + , which are analogous to thimble boundary conditions in 2d N = (2, 2) theories [27][28][29]. We will need a slight generalization of the standard notion appropriate for theories with multiple isolated vacua connected by gradient flows [26]. We will adapt this construction here to the context of 1d N = 4 supersymmetric quantum mechanics. We expect this to provide a physical counterpart to the construction of stable envelopes [11].
In the presence of real mass parameters {m 3 1 , . . . , m 3 N }, the configurations of the supersymmetric quantum mechanics preserving Q − , Q + are (5.21) These equations can be reformulated as the gradient flow equations and µ R and µ R,m denote the moment maps for the gauge and flavour symmetry respectively. The notation X refers to one of the fields {X, Y, Φ, σ 3 } and g XX † is the inverse metric on the space of fields inherited from the Lagrangian. Note that inside of gauge invariant combinations of the fields X and Y , we have and therefore gauge invariant combinations of X and Y will grow or decay along the τ direction according to their charge under the flavour transformation generated by m 3 . This is gradient flow on the vacuum manifold V for the Morse function h m = m 3 · µ R,m . A preliminary definition of a left thimble boundary condition B I on τ ≥ 0 can now be given as follows: it is a boundary that is equivalent for the computation of correlation functions preserving Q − , Q + to the placing theory on τ ≥ −∞ with a fixed isolated vacuum v I at τ → −∞. The support of such a boundary condition is in the first instance the submanifold of points in V that can be reached by an infinite gradient flow from the vacuum v I at τ → −∞. This submanifold clearly depend on the ordering of the real mass parameters. Suppose that the real masses are ordered as m 3 π(1) < · · · < m 3 π(N ) for some permutation π, then we denote this submanifold by V (π) I . However, in passing from τ = −∞ to τ = 0, we will need to allow for a sequence of domain walls preserving Q − , Q + that interpolate between different isolated vacua connected by gradient flows. In order to formalize this notion, we can introduce a partial ordering on the set of isolated vacua {v I } depending on the permutation π, by the requirement there exists a π-gradient flow v I → v J ⇒ v I < π v J , (5.25) and extending transitively, namely if v I < π v J and v J < π v K then also v I < π v K . Allowing for sequences of domain walls interpolating between vacua, the support of a left thimble boundary condition B I is V (π) We claim that the thimble boundary condition B I in the presence of mass parameters ordered by the permutation π corresponds to boundary condition constructed in section 5.3 associated to inserting S (π) I (σ). Let us illustrate this construction with an abelian example: k = 1 and N = 2 with V = T * CP 1 -see table 1. Introducing a real mass parameter m 3 for the U (1) m flavour symmetry, we have Note that in the graphical representation of V = T * CP 1 in figure 10, the Morse function is proportional to the coordinate along the horizontal axis. The gradient flows are therefore straightforward to understand in this graphical representation. The permutation π = {1, 2} corresponds to m 3 < 0 and the permutation π = {2, 1} corresponds to m 3 > 0. In the graphical representation, the direction of flow for increasing τ is from left to right for π = {1, 2} and right to left for π = {2, 1}. The vacua are therefore ordered such that v 1 < π v 2 for π = {1, 2} and v 2 < π v 1 for π = {2, 1}. First, it is straightforward to see that V where F i denotes the fiber of V = T * CP 1 at the fixed point v i . We therefore generate thimble boundary conditions with support Finally, let us attempt to make a general statement. We expect that the left thimble boundary condition B I generated by real mass parameters m 3 π(1) < · · · m 3 π(N ) is equivalent for the purpose of computing correlation functions preserving Q − , Q + to the boundary condition in section 5.3 corresponding to S (π) I (σ). Since τ → −τ transforms the gradient flow equations in the same way as m 3 j → −m 3 j , the right thimble boundary condition for the same mass parameters reproduces the function S

The R-matrix
In this section we return to studying the Heisenberg spin chain and the question of how the R-matrix arises in the study of supersymmetric gauge theory. In particular, we will examine the two-point functions of stable basis elements S (π) I ( σ) in the A-twisted supersymmetric gauge theory on the sphere. These correlation functions are in fact independent of q and can therefore be interpreted as the partition function of a supersymmetric quantum mechanics of section 5 on a interval with thimble boundary conditions at either end.

Orthonormality of Stable Basis
Let us first consider the two-point correlation functions of basis elements S The appearance of the reflection ι here is natural from the orbifold construction. The orbifold construction at {+} producing S (π) I ( σ) has flavour holonomy (g F ) i j = ω π(i)−1 δ i j . This is compatible with turning on flavour holonomy in a neighbourhood of {+} of the form e iθ i δ i j such that θ π(1) < · · · θ π(N ) . Translating to {−} without allowing these holonomy eigenvalues to cross, the compatible orbifold construction leads to functions S (ι·π) I ( σ). Similarly in the supersymmetric quantum mechanics, introducing constant real masses ordered such that m 3 π(1) < · · · < m 3 π(N ) leads to left thimble boundary conditions generating S (π) I ( σ) and right thimble boundary conditions generating S (ι·π) I ( σ). This observation motivates to define an inner product, where the conjugation sends σ a → −σ a , m i → −m i . In particular, S (π) ( σ) and therefore the stable basis elements for a given permutation π are orthonormal, S (π) By construction, this inner product depends only on the functions f ( σ) and g( σ) modulo the twisted chiral ring relations. Under the correspondence outlined in the introduction 1, this corresponds to the inner product on the spin chain Hilbert space 3 , with sites ordered according to the permutation π. In particular, equation (6.3) corresponds to the orthonormality of the up-down basis of the spin chain, I|J = δ I,J .

R-matrix from Janus Interface
The natural next step is to consider the inner product of stable basis elements for different permutations π and π . These correlation functions are again independent of q. Let us therefore consider this problem from the perspective of the supersymmetric quantum mechanics of section 5. Consistency of such a correlation function requires that the mass parameters (m 3 1 , . . . , m 3 N ) vary as a function of τ across an interval, such that they are ordered by the permutation π at the left boundary and by π at the right boundary. This is an exact deformation and therefore correlation functions do not depend on the particular profile of this variation. In particular, we can say that such a correlation function requires the presence of a 'Janus interface' J π,π for the real mass parameters. The inner product S (π) is computing the partition function of the supersymmetric quantum mechanics on a interval with the interface J π,π between thimble boundary conditions generated by the vacua v I on the left and v J on the right. In order to develop the connection between such correlation functions and spin chain quantities, let us consider the simplest example corresponding to a spin chain of length N = 2. In that case we have two distinct permutations, {1, 2} and {2, 1}, and three supersymmetric theories with k = 0, 1 and 2. The correlation functions One can immediately recognize this table as the matrix elements of the spin chain R-matrix (2.13) acting on C 2 m 1 ⊗ C 2 m 2 , up to a sign. Summarizing this example, there are two sets of correlation functions S In order to extend this correspondence to supersymmetric gauge theories with N > 2, we will need to introduce the notion of a Weyl R-matrix depending on a pair of permutations π + , π − , In order to define it, let decompose the π + · π −1 − as a convolution of elementary transpositions of two elements (i j), π + · π −1 − = (i 1 j 1 ) · (i 2 j 2 ) · . . . · (i L j L ) . (6.10) We now define 12) where N (π + ,π − ) IJ = (−1) |π −1 is a sign. We have performed extensive checks of this relation in numerous examples. In the supersymmetric quantum mechanics setup of section 5, the matrix elements of the Weyl Rmatrix are therefore identified with the partition function of a Janus interface J π + ,π − between thimble boundary conditions generated by the vacua v I and v J . We end this section with an example of a Weyl R-matrix. Let us fix the spin chain length N = 5 and choose permutations π + = {1, 4, 3, 5, 2} and π − = {1, 2, 3, 4, 5}. We can decompose the permutation π + · π −1 − = (25) · (34) · (24) · (23) and therefore define which can be straightforwardly computed from the matrix elements of the elementary Rmatrices, R ij (m ji ). This R-matrix can be depicted as in figure 16. Equivalently, the same matrix elements can be computed from the correlation functions

Yang-Baxter Equation
As explained in the previous section, we have performed extensive checks that the Weyl Rmatrix R (π + ,π − ) IJ (m 1 , . . . , m N ) corresponds to matrix elements of a Janus interface J π + ,π − in the supersymmetric quantum mechanics setup of section 5.
In the same manner that the Weyl R-matrix R (π + ,π − ) IJ (m 1 , . . . , m N ) is constructed from elementary R-matrices according to a decomposition π + · π −1 − = (i 1 j 1 ) · . . . · (i L j L ), the Janus interface J π + ,π − is a composition of elementary Janus interfaces J ij that interchanges the real masses m 3 i and m 3 j , J π + ,π − = J i 1 j 1 · . . . · J i L j L . (6.16) This can be understood since deformations of the profile m 3 1 (τ ), . . . , m 3 N (τ ) for the real mass parameters are exact in Q − , Q + . We are therefore free to choose a profile consisting of a sequence of 'jumps' where pairs of mass parameters m 3 i and m 3 j are interchanged. Each of these jumps can be regarded as an elementary Janus interface J ij . Inserting the complete set of states provided by the stable basis S (π) I ( σ) in between each elementary Janus interface then reproduces the decomposition (6.11) of the Weyl R-matrix. Equation (6.16) can therefore be understood as a basis-independent statement of this decomposition.
The fact that the Weyl R-matrix is independent of the choice of decomposition into elementary transpositions followed from the Yang-Baxter equation (2.12) and the unitarity condition (2.14). From the perspective of supersymmetric quantum mechanics, this property is guaranteed since different decompositions of a profile m 3 1 (τ ), . . . , m 3 N (τ ) into elementary jumps are related by exact deformations. In particular, we have J ij · J ik · J jk = J jk · J ik · J ij , (6.17) and J ij · J ji = I , (6.18) where I is an identity interface preserving the order of the real mass parameters. This is a basis-independent statement of the Yang-Baxter equation and unitarity relation. The standard equations for R-matrices are recovered by inserting the complete set of states provided by the stable basis S (π) I ( σ) in between each elementary Janus interface.

Discussion
In this paper, we have investigated aspects of the correspondence between XXX 1 2 Heisenberg spin chains and 2d N = (2, 2) supersymmetric gauge theories. We have focussed on reproducing components of the algebraic Bethe ansatz for spin chains from correlation functions in A-twisted supersymmetric gauge theory and their reduction to partition functions in N = 4 supersymmetric quantum mechanics. In particular, we have provided a concrete construction of the wavefunctions of off-shell Bethe states as orbifold defects in A-twisted supersymmetric gauge theory, and as thimble boundary conditions in supersymmetric quantum mechanics. We have also developed a new interpretation of the spin chain R-matrix as the matrix elements of Janus interfaces for mass parameters, leading to a novel and basis-independent presentation of the Yang-Baxter equations.
Let us conclude with some directions for further research: • First, there are some important components of the algebraic Bethe ansatz that we have omitted from our presentation. One example is the generators of the Yangian symmetry of the spin chain. Unlike the R-matrix, Yangian generators have non-vanishing matrix elements between spin chain states with different number of excitations. On the supersymmetric side of the correspondence, this will correspond to correlation functions of interfaces that change the rank of the gauge group, U (k) → U (k ). It is straightforward to construct such interfaces in the supersymmetric quantum mechanics description of section 5, following methods introduced in [30]. However, we expect a complete discussion of Yangian representation theory and the algebraic Bethe ansatz will arise from 'tri-partite' interfaces in supersymmetric quantum mechanics relating theories (k, N ), (k , N ) and (k , N ) with different gauge and flavour symmetries [31].
• Secondly, in this paper we have considered only su(2) spin chains with the fundamental representation at each site. It would be interesting to extend the results presented here to more general groups and representations, by studying more general supersymmetric quiver gauge theories.
• Finally, it would be interesting to extend our results to trigonometric or elliptic spin chains, corresponding to three and four dimensional supersymmetric gauge theories. The corresponding localization techniques for correlation functions of twisted theories on S 2 × S 1 or S 2 × T 2 have been developed in [7,32,33]. where D µ = ∂ µ + iA µ and it is understood that vectormultiplet fields act in the appropriate representation of G.
The standard Yang-Mills Lagrangian for a vector multiplet is .21) and FI term L F I = Re d 2θ (−tΣ) = −rD − 2θF zz (A. 22) The chiral multiplet Lagrangian is and superpotential term Writing a general supersymmetry transformation as 25) we find that The charges of the supersymmetry generators under U (1) J rotations and the axial U (1) A and vector U (1) V R-symmetries are shown below: