Quantum integrability of $\mathcal{N}=2$ 4d gauge theories

We provide a description of the quantum integrable structure behind the Thermodynamic Bethe Ansatz (TBA)-like equation derived by Nekrasov and Shatashvili (NS) for $\mathcal{N}=2$ 4d Super Yang-Mills (SYM) theories. In this regime of the background, -- we shall show --, the instanton partition function is characterised by the solution of a TQ-equation. Exploiting a symmetry of the contour integrals expressing the partition function, we derive a 'dual' TQ-equation, sharing the same T-polynomial with the former. This fact allows us to evaluate to $1$ the quantum Wronskian of two dual solutions (for $Q$) and, then, to reproduce the NS TBA-like equation. The latter acquires interestingly the deep meaning of a known object in integrability theory, as its two second determinations give the usual non-linear integral equations (nlies) derived from the 'dual' Bethe Ansatz equations.


Introduction
The proposal [1] by Nekrasov and Shatashvili (NS) to associating quantum integrable systems to N = 2 4d Super Yang-Mills (SYM) theories in a particular regime of the Omega background has led numerous new insights in gauge theories. But also the possibility of applying the correspondence to solve some peculiar relativistic quantum integrable systems [2,3,4,5,6]. The Omega background is known to depend on two parameters ε 1 and ε 2 that regularise the infinite volume of Euclidean space-time while preserving supersymmetry. Importantly, the ordinary background R 4 is recovered in the limit ε 1 , ε 2 → 0 and yields the celebrated Seiberg-Witten (SW) theory [7,8], whose BPS sector is described by a classical integrable system (cf. for instance [9] and references therein). Furthermore, Nekrasov and Shatashvili investigated the regime ε 2 → 0 while ε 1 stays fixed and observed a quantisation of the SW integrable systems with ε 1 as Planck constant [1].
In fact, it is important to distinguish two different integrable structures in the NS regime of Super Yang-Mills theories. The first one describes the moduli space of quantum vacua of the gauge theory. It is obtained by minimising with respect to the Higgs field vacuum expectation values (vevs) the full prepotential: the latter, in fact, is formed by a perturbative (one loop) part and a non-perturbative part (sum on instantons). On the Coulomb branch, the Higgs field is given by the scalar field of the N = 2 gauge vector multiplet, and the corresponding vevs are usually denoted by a l (the index l running over the number of colors). In the SW limit, the minimisation reproduces their fundamental period relations [7,8], linked to classical integrable systems [9]. These are the systems quantized in the proposal of Nekrasov and Shatashvili [1,10] where the Coulomb branch vevs play the role of Bethe roots.
Yet, here we are interested in a second integrable structure, involving only the non-perturbative instanton contribution to the prepotential. In [1], this contribution is written in terms of an integral equation 1 , of the same form as a Thermodynamic Bethe Ansatz (TBA) equation as initially obtained with temperature by Yang and Yang [11] or with finite size of a relativistic field theory (upon mirror transformation) by Al. B. Zamolodchikov [12] 2 .
In this paper, we aim at providing a microscopic description of the degrees of freedom giving rise to this equation. In this description, the Coulomb branch vevs a l will be considered as free parameters, playing the role of inhomogeneities. On the other hand, Bethe roots will appear as the heights of the instanton stacks, more precisely as the heights of the columns of the Young diagrams describing these stacks.
One of the interesting aspects of this second type of integrable structure is its intricate connection with the further affinization of the algebras behind standard quantum integrable models [20,21,22,23]. In the present case of 4d N = 2 gauge theories, the relevant algebraic structure has been constructed by Vasserot and Schiffmann in [24]. It is built upon the Double Degenerate Affine Hecke algebra, and is called Spherical Hecke central (SHc) algebra. It really corresponds to the affinization of the Yangian algebra of non-relativistic/isotropic integrable systems like the XXX spin chain [25]. 3 The results presented in this paper were largely inspired by the work of Poghossian et al. [33,34,35] in which the NS regime is described by a TQ-like equation (in fact the hv equation below 4 ). Until now, the relation between this TQ-like equation and the TBA-like equation of Nekrasov and Shatashvili remained unclear. This is one of the main questions that motivated the present work. The two key ingredients of the answer are the presence of a genuine (with Q entire) TQ equation and of a reflection symmetry leading to its 'dual' TQ-equation. The corresponding hv equations are obtained by sending the cut-off to infinity in the thermodynamical limit upon suitable regularisation (which introduces the pole structure in v). Then, the TBA-like equation is recovered by taking the quantum Wronskian relation of these two equations. Eventually, its second determinations [36] in the upper and lower half-planes, respectively, do coincide with the counting functions of the non-linear integral equations (nlies) derived from the two dual sets of Bethe Ansatz equations (cf. for instance [37,38,39]). In conclusion, the NS non-linear integral equation is given a physical meaning very different from a thermodynamic set-up. Of course, the Bethe equations can be associated to the two dual TQ-equations.
The paper is organised as follows. Starting from the instanton partition function of the gauge theory localised in the Omega-background, we observe an invariance under the deformation of integration contours. This invariance provides alternative expressions for the instanton partition function, and the qq-character. The later is defined as a correlator of the gauge theory, it is a polynomial of degree equal to the number of colors. These quantities will be defined in section two. Then, the NS limit ε 2 → 0 will be performed in section three using a minimization procedure, namely a saddle point approximation of the sum over instanton configurations. In this limit, the qqcharacter reproduces the Baxter T-polynomial of the TQ-equation. The dual TQ-equation is obtained from the reflection symmetry mentioned previously. In this procedure, we will introduce some cut-offs interpreted as the number of roots in each Bethe string. Then, we will perform the thermodynamical limit, sending these cut-offs to infinity. In this limit, the Baxter TQ-equations are replaced by some equations, here called 'hv' equations, involving non-polynomial quantities. Finally, we will show that the quantum Wronskian relation of these equations reproduces the NS TBA-like equation. In addition, the section three also contains a brief discussion on non-linear integral equations and the second determinations of the TBA-like equation. The latter is definitively associated to nlies equivalent to some Bethe Ansatz equations rather than to a thermodynamic procedure on Bethe Ansatz equations, a fully different physical meaning.

Instanton partition function and qq-characters 2.1 Instanton partition function
In this paper, we will provide a description of the NS regime for 4d N = 2 Super Yang-Mills theories with a gauge group U (N c ), and N f matter fields in the fundamental (or anti-fundamental) representation. For technical reasons, our analysis is restricted to the cases N f < 2N c for which the theories are asymptotically free. In the NS regime, the theories depend on the Omega background parameter ε 1 while the second parameter ε 2 is sent to zero. The gauge theory is taken on the Coulomb branch, and the vacuum expectation values (vevs) of the scalar field in the gauge multiplet are denoted a l with the index l running over the number of colors N c . Masses of the matter fields are denoted m f with f running over the number of flavors N f . These parameters a l and m f are encoded in the roots of the gauge and matter polynomials defined respectively as .
We have also introduced the rational potential Q(z) that plays an essential role in the integral formulation of the instanton partition function. The instanton partition function is obtained after localization as an instanton expansion in terms of the (renormalized) exponentiated gauge coupling q [40]. 5 It takes the form of a sum over the n-instantons sectors of coupled integrals, where we denoted ε + = ε 1 + ε 2 . We have also employed the shortcut notation φ ij = φ i − φ j . The integration contour Γ goes on (−∞, +∞) and circles the upper half-plane while avoiding the infinity. In this expression, the background parameters ε 1 and ε 2 have a positive imaginary part, and the Coulomb branch vevs are assumed to be real with a small positive imaginary part, as in a l + i0, so that poles at φ i = a l are taken inside the contour, but not those at φ i = a l − ε + . The kernel K that couples the integration variables depends only on the background parameters, it is a rational function that can be written in a factorized form, The scattering factor S(z) plays a key role in the quantum algebra behind the qq-characters [23], it obeys the property S(−z) = S(z−ε + ). Finally, the variables φ i are assumed to be real in the kernels K(φ ij ), so that poles φ i = φ j +ε α (α = 1, 2) are inside the contours, but not the poles at φ i = φ j − ε α . The contour integrals in the expression (2.2) can be evaluated using Cauchy theorem as a sum of residues. The poles in the instanton sector n are in one-to-one correspondence with the box configurations of N c Young diagrams Y = (Y (1) , · · · , Y (Nc) ) having a total number of boxes | Y | = n. Precisely, the poles are located at the positions φ x = a l + (i − 1)ε 1 + (j − 1)ε 2 associated to the boxes x = (l, i, j) of coordinates (i, j) in the lth Young diagram Y (l) . The corresponding residue can be factorized into contributions of gauge and matter multiplets, and the instanton partition function written formally as where Y are N c -tuples Young diagrams, and a, m vectors of dimension N c and N f respectively, encoding the dependence in Coulomb branch vevs and fundamental multiplets masses. The vector and fundamental contributions to the residues obey a set of recursion equations that describes the insertion or removal of an instanton in the stack described by the configuration Y , Here, Y + x (resp Y − x) denotes the Young diagram Y with the box x added (removed). Accordingly, the sets A( Y ) and R( Y ) contains the boxes that can be added to or removed from the Young diagrams Y . These equation have been referred to as discrete Ward identities, they first appeared in the study [20] of the representation of the Spherical Hecke central algebra [24] on instanton partition functions. They were written in the form (2.5) in [22,23] where a short derivation can also be found. The original expressions for the contributions Z fund. and Z vect. are fairly complicated. Yet, it is possible to write simpler expressions by solving the discrete Ward identities. The fundamental contribution is simply the product of matter polynomials evaluated at the location of the residues. The vector contribution is slightly more complicated, . (2.7) In the following, we will not need these expressions, but only work at the level of the Ward identities (2.5).

Definition of the qq-character
In addition to the partition function, another quantity will be helpful to characterize the NS regime of the theory. Actually, this quantity has been introduced by Nekrasov in full generality [41,42] (see also [21,43]) under the name of qq-character. It provides a generalization of the quantum group q-characters defined in [44] for Yangians, and in [45] for quantum affine algebras. This quantity possesses the crucial property of being a polynomial in the spectral variable z, which derives by implementing the non-perturbative Schwinger-Dyson equations (as loop equations on a suitable resolvent). In fact, the qq-character is defined as a trace over the instanton configurations, where the function Y Y (z) defined in (2.7) depends on the detailed content of the Young diagrams.
Moreover, it enjoys another expression in terms of contour integrals, This expression of the qq-character reproduces the initial definition (2.8) after an evaluation of the contour integral by Cauchy theorem. The prescription for the integration is to consider z with a small positive imaginary part, so that it is inside the integration contour Γ, but to exclude the point z + ε + by circulating it (clock-wise) with the small circle C z+ε + . In this way, we take only the extra pole at φ i = z in the integration contour, not the one at φ i = z +ε + . Evaluation of the residues brings two different types of terms, corresponding to the sum of the two terms in the RHS in the first equation of (2.8). The first term is obtained when no variable φ i takes the extra pole value φ i = z, so that the residues contribute as When n > 1, the second possibility is that one of the variables φ i takes the value φ i = z, bringing the residue New poles appear at φ i = z − ε α for α = 1, 2, but they are outside the contour Γ since z is assumed to be slightly above the real axis. Hence, the remaining pole configurations are in one-to-one correspondence with the | Y | = n − 1 boxes in the N c -tuple of Young diagrams. Summing over the instanton sectors gives the second term in the RHS of the first equation in (2.8): (2.12)

Reflection symmetry
The instanton partition function Z inst. turns out to be invariant under a Z 2 -symmetry that can be seen from a deformation of contours in the integral expression (2.2). Explicitly, the contour Γ is deformed on the Riemann sphere into the contribution of the point at infinity and the contourΓ that circles the lower half-plane (excluding infinity). Defining the following quantity 6 The corresponding residues can be easily worked out, they factorize in front: 14) The quantity Z inst. can also be evaluated by Cauchy theorem, with poles still in bijection with the boxes of the N ctuple Young diagrams Y , but now located at the dual positionsφ As a result, we find the weak coupling expansion with: .

(2.16)
It turns out that the dual quantities Z inst. , Z fund. ( m, Y ) and Z vect. ( a, Y ) can be obtained from the original ones using a simple Z 2 -symmetry. This symmetry consists in a sign flip of the Omega-background parameters ε 1 , ε 2 , followed by a shift of the Coulomb branch vevs a l → a l − ε + . As a result, the poles located at z = φ x in the upper half-plane are mapped to the dual position z =φ x in the lower half-plane. Under this symmetry, the gauge polynomials A(z) and A(z + ε + ) are exchanged, and the argument of the scattering factor is shifted/reversed: , but this is no longer true for a higher number of colors.
The deformation of the contour can also be applied to the integral expression (2.9) of the qq-character. The new contour does not contain the pole at φ i = z, but instead it includes the extra pole at φ i = z + ε + that had been subtracted from Γ previously: In the case N f = 2N c − 1, the contribution of poles at infinity is the same as in the case of the instanton partition function, and the extra factors cancel. The evaluation using the Cauchy theorem follows the same lines as what was done in the previous section, and where the average is taken with respect to configurations of poles Y located in the lower half-plane. Shifting the spectral parameter z → z − ε + , it is possible to rewrite this second expression of the qq-character in a form that makes the Z 2 -symmetry more explicit: Thus, the Z 2 -symmetry described previously simply exchanges χ(z) and χ(z − ε + ).
In the limit β = 1 of the background where ε + = 0, the instanton positions are given by the simplified expression φ x = a l + ε 1 (i − j) and the Z 2 -symmetry corresponds to exchange Young diagrams with their transposed. In the Seiberg-Witten limit ε 1 , ε 2 → 0, the Z 2 -symmetry is trivially realized, so that φ x andφ x condense to form the same branch cut.
Before ending this discussion on the Z 2 -symmetry, we would like to mention that it is closely related to another reflection symmetry that consists in the following transformation: In the SU (2) case, this symmetry coincides with the reflection symmetry of Liouville theory that exchanges the operators of charge α and Q − α. This second symmetry exchanges A(z) ↔ (−1) Nc A(−z + ε + ) but the scattering factor S(z) remains invariant. It acts on the poles location by sending φ x → −φ x andφ x → −φ x , which leads to the following transformation for the instanton contributions: are exchanged so that the qq-character χ(z) transforms into (−1) Nc χ(−z − ε + ). Hence we observe that the action of this second Z 2 -symmetry is very similar to the previous one, up to extra minus sign factors and a reflection of the spectral variable z. Although the physical interpretation of the second Z 2 -symmetry is more straightforward, it is in fact more convenient to work with the first one because of the absence of these extra signs.
3 The structures of integrability in the Nekrasov-Shatashvili limit 3

.1 Minimization procedure
It is now well-known how to perform the Nekrasov-Shatashvili limit ε 2 → 0 on the expression (2.4) of the partition function as a sum over Young diagrams [21,22,23]. However, for a matter of completeness, we will recall it here. The justification of this procedure has been given in [21]. The main idea behind it is that the sum over Young diagrams becomes dominated by a single (N c -tuple) diagram Y * , in a sort of discrete saddle point. This diagram contains infinitely many boxes, arranged in columns of infinite height, but keeping a fixed number n l of columns in each diagram Y * (l) . The critical diagram must obey the saddle point equation expressing that the small variation corresponding to add (or remove) a box has no cost at first order in ε 2 : Obviously, this equation can only be satisfied by infinitely large diagrams. Using the discrete Ward identity (2.5), this condition takes the form q Next, we assume that a box x can be added to every column of Y * . The associated pole locations are φ i is the length of the column to which x is added, here the ith column of the lth diagram. We will denote these quantities u r with the double index r = (l, i). They will later play the role of Bethe roots. Under this assumption, below each box in A( Y ) is a box in R( Y ) that can be removed, with approximately the same pole location (up to a negligible ε 2 shift). This is true, except for a subset of boxes in A( Y ) that are located at the extreme right of the diagram, i.e. in the nearest empty column of each diagram Y * (l) . The pole location corresponding to these boxes will be denoted ξ l = a l + n l ε 2 . Then, the product in the saddle point equation (3.2) can be replaced by We recognize here a set of Bethe equations, with a total number M = l n l of Bethe roots. These are well-defined Bethe equations and they can be solved exactly in q for a small number of Bethe roots. Although the previous system of Bethe equation is well-defined for a finite number of roots M , and finite cutoffs ξ l , one should keep in mind the perturbative aspect of the problem in the application to the NS regime of the gauge theory. By construction, in the relevant solution, the Bethe roots are arranged in N c strings, each of length n l and spaced of ε 1 . Hence, in the limit q → 0, the solution becomes trivial as u r tends to u (0) r = a l + (i − 1)ε 1 for r = (l, i). 7 Formally, the prepotential in the NS limit F NS can be reconstructed from the solution of the Bethe equations using the formula Employing an argument due to Poghossian [33], it is shown in appendix A that the subleading correction to u r is of order O(q i ) for r = (l, i). It implies that solutions with n l or n l + 1 roots in the lth string will only differ at the order O(q n l +1 ). Thus, in order to recover the exact prepotential, it is necessary to consider the thermodynamical limit where the number n l of roots in each string (i.e. the number of columns in each Young diagram composing Y * ) is infinite. More precisely, in order to compute the prepotential at the order O(q N ), it is necessary and sufficient to consider N roots in each string, in which case M = N c N . This fact is illustrated in appendix A in the simple case of a pure U (1) gauge theory. In a sense, the integer variables n l play the role of cut-offs that must be sent to infinity at the end of our computation. The thermodynamic limit will be discussed in more details in the next subsection.
A Baxter TQ-equation can be written for the set of Bethe equations (3.3) 8 The derivation is done in appendix A. This equation is well-defined for a finite number of roots: both t(z) and q(z) are polynomials, and the expansion in z provides enough constraints to determine them from the knowledge of M (z) and Ξ(z). Actually, the TQ-equation (3.6) can also be derived from the definition (2.8) of the qq-character by taking its NS limit [23]. In this limit, the trace of well-behaved operators is dominated by a single term, where Y * is the solution to the saddle point equation described previously. In particular, the operator Y Y (z) defined in (2.7), and its inverse, produce ratios of the Baxter Q-polynomial, Denotingχ(z) the polynomial of degree N c obtained by taking the NS limit of χ(z), we find from (2.8), leading to identify t(z) =χ(z)Ξ(z). This identification is in agreement with the q-perturbative study of the TQequation (3.6) done in appendix A where it is shown that t(z) = h(z)Ξ(z) + O(q 1+min l n l ). Terms of order O(q 1+min l n l ) are negligible in the thermodynamical limit where all n l are sent to infinity, and we will later identifȳ χ(z) = h(z).

Thermodynamical limit
In order to regularize the infinite product of Bethe roots defining the Q-polynomial, we introduce the function q 0 (z) that corresponds to the limit q → 0 of q(z), It obeys the important property This polynomial q 0 (z) can be used to define the ratiov(z) = q(z)/q 0 (z) that tends to v(z) in the thermodynamic limit. As a consequence of the TQ equation (3.6) and the property (3.10), it obeys the following difference equation: (3.11) 8 Taking the pure gauge case N f = 0, it is possible to send ξ l to infinity while keeping the number of roots fixed (although it doesn't make much sense in our model). The divergent factors ξ l can be absorbed by the introduction of an essential singularity at the infinity for the Q-polynomial: t(z) → l ξ l t(z) and q(z) → l ξ −z/ε 1 l q(z). Then, this equation reduces to the Baxter TQ-equation relevant for the Toda system with twisted periodic boundary conditions, t(z)q(z) = q(z + ε1) − qq(z − ε1). (3.5) We will not take this approach here. The connection between the Toda chain and the NS NLIE has been studied in [46].
It is shown in the appendix A that the T-polynomial in the n l → ∞ limit behaves as where h(z) is a monic polynomial of degree N c that coincides with the limit of the qq-character. In this limit, the functions h and v obey a difference equation that is reminiscent of a TQ-equation, 9 However, it is noted that v(z) is no longer an entire function here, it exhibits some poles at z = a l + (i − 1)ε 1 with l = 1 · · · N c and i ∈ Z >0 . Introducing the rational potential Q(z) defined in (2.1) (with ε + → ε 1 ), we can write the "hv" equation:

Dual TQ and hv equations
The same saddle point procedure can be applied to the dual expression of the qq-character given in (2.19). In the NS limit, the vev of the functionŶ Y (z) becomes Note however that the N c -tuple Young diagram extremizing the summations of the gauge and gauge brackets will be different. Thus, the Bethe roots u r and the dual onesû r=(l,i) = a l − iε 1 − ε 2λ (l) i will be unrelated. From the expression (2.19) of the qq-character, we deduce a new (dual) tq-equation, related to the previous one under the Z 2 -symmetry described above, (3.17) witht(z) =χ(z)Ξ(z + ε 1 ). This is again a well-defined TQ-equation, where all the quantities are polynomials. Interestingly, it takes a form similar to the original TQ-equation (3.6), with the sign of the pseudo-period ε 1 reversed, and the polynomial Ξ(z) replaced byΞ(z). In fact, the minimization procedure would provide a set of Bethe equations in which the same replacement occurs. The procedure to perform the thermodynamical limit is the same as in the case of the original TQ-equation. We introduce the functionq 0 obtained in the q → 0 limit ofq, 9 A similar equation has been obtained in a seemingly different manner in [33,34]. In order to make a precise connection, one can introduce the function ω(z) = v(z − ε1)/(v(z)A(z)) and show that it obeys (3. 13) and write (3.17) for the ratioq/q 0 →v. As n l is sent to infinity, we obtain the dual hv equation The resemblance with the original hv-equation strikes even more: the ratio h(z)/A(z + ε 1 ) has been shifted by −ε 1 while the sign of the pseudo-period has been reversed in the arguments of the function v(z).

Quantum Wronskian and Non-Linear Integral Equation
The relation between the NS TBA-like equation and a quantum Wronskian has already been mentioned in [46].
However, it appears that the underlying quantum systems are different. Furthermore, the presence of a reflection symmetry bringing a second TQ-equation is essential in our derivation, and this ingredient seems to be missing in [46]. In order to establish the invariance of the quantum Wronskian, we start from the two hv-equations derived previously, (3.20) These two equations can be solved for h(z), and we find the two equalities After multiplication of both sides by v(z)v(z + ε 1 )/A(z + ε 1 ), the second equality can be written in the form Defining the quantum Wronskian to be we have thus shown that W (z) = W (z + ε 1 ). By construction, v(z) andv(z) are perturbative series in q, and meromorphic in z at each order of q. It implies that W (z) is a constant that can be determined from the fact that v(z) ∼ 1 andv(z) ∼ 1 while Q(z) ∼ z N f −2Nc at infinity. Hence, we have In order to make contact with the NLIE derived by Nekrasov and Shatashvili [1] (see also [16,17]), we need to introduce the kernel function and the integration contour Γ which is the one involved in the integral expression of the Nekrasov partition function [40]. This contour circles the upper half-plane, including the real axis but excluding the point at infinity. In the evaluation of contour integrals, the Omega-background parameters ε 1 and ε 2 are considered with a positive imaginary part. In general, the result takes the form of a rational function of these parameters and it can be easily analytically continued. In addition, the Coulomb branch vevs are assumed to possess a small imaginary part so that a l belong to the contour Γ while a l − ε 1 do not. As a result, the Bethe roots u r and the string positions u r belong to the deformed contourΓ circling the lower half-plane and such that Γ ∪Γ = {∞}. This trick is used in appendix B to show perturbatively in q that where the spectral parameter z has a small positive imaginary part as above. Introducing the function the quantum Wronskian equation can be written in the form of a non-linear integral equation, which is exactly the one proposed by Nekrasov and Shatashvili. By construction, its solution is Z 2 -symmetric and because of the analogy with Yang-Yang-Zamolodchikov TBA equation (except for the integration contour), it has been called pseudo-energy.

The NLIE procedure and the second determination
A procedure based on the Cauchy theorem [38,39] can be applied to the TQ-equation (3.6), defining the counting functionη(z) and the associated resolvent r(z) Using the TQ-equation, the resolvent is expressed in the form .
We deduce from this expression that the resolvent has poles with residues +1 at z = u r (Bethe roots) and at the zeros of t(z) (holes) that were denoted e ↓ l , e ↑ l in appendix A. In addition, poles with residues −1 are present at z = u r −ε 1 , z = ξ l and z = ξ l − ε 1 . Taking the integral with a contour C(u r , u r − ε 1 ) that the surrounds the Bethe roots and their shifted value, we can write Here we will assume Im z < −Im ε 1 in order to avoid the branch cut singularities of the logarithm. Taking the log of the definition (3.29) and replacing the RHS of the previous equation, we find The next step is to take the thermodynamic limit in order to write an integral equation for the quantity 2iπη(z) obtained as the limit of 2iπη(z): The equality in the RHS has been obtained after the introduction of q 0 (z) in (3.29) to turn Ξ(z) into the gauge polynomial A(z). Then, the ratios q(z)/q 0 (z) have been replaced byv(z) that tends to v(z) in the thermodynamic limit. In this limit, the holes e ↑ l = ξ l + O(q n l +1 ) will tend to coincide with the singularities of r(z) at z = ξ l . Likewise, the holes e ↓ l will become very close to the Bethe roots u l,1 − ε 1 that are inside the integration contour. In order to avoid the integration contour being pinched between poles, it is necessary to include the holes within the integration contour. At the same time, it will be more convenient to also add the singularities at z = ξ l and z = ξ l + ε 1 in order to modify the driving term, and write where the new integration contour, denoted formally Γ − ε 1 , corresponds to the contour Γ shifted downward by −Im ε 1 so that it encompass all the singularities of the resolvent r(z). It is now possible to take the thermodynamic limit both in the driving term and in the contour integral. Using an integration by part, the resulting integral equation for the thermodynamical counting function 2iπη(z) reads where the spectral parameter is assumed to satisfy Im z < −Im ε 1 , i.e. it lies outside the contour Γ − ε 1 . The same procedure can be applied to the dual TQ-equation, and we find that the thermodynamical counting function defined as obeys the integral equation whereΓ surrounds the lower half-plane, andΓ + ε 1 is shifted upward by Im ε 1 . The NLIE established by Nekrasov and Shatashvili is defined for the range −Im ε 1 < Im z < Im ε 1 of the spectral parameter. It is possible to consider the second determination of the function ε(z) in the half-planes Im z < −Im ε 1 and Im z > Im ε 1 , denoted respectively ε − (z) and ε + (z). They are obtained by considering the RHS of the integral equation (3.28) for a spectral parameter z outside of the principal domain |Im z| < Im ε 1 . Accordingly, the integral kernel of NLIE G(z − w) picks up an extra pole, either at w = z + ε 1 or at w = z − ε 1 : (3.38) In the RHS of these two formulas, the pseudo-energy ε(z) is analytically continued to the lower or upper half planes Im z < −Im ε 1 and Im z > Im ε 1 respectively. The analytic continuation is provided using the definition (3.27) expressed in terms of the function v(z) andv(z) satisfying the quantum Wronskian equation (3.24). When expressed in terms of the function v(z) andv(z), the RHS of the two formulas in (3.38) reproduce the formulas obtained in (3.33) and (3.36), and expressing η(z) andη(z) in terms of v(z) andv(z) respectively. It shows that the two thermodynamical counting functions η(z) andη(z) are equal to the two second determinations of the pseudo-energy (modulo 2iπ), namely 2iπη(z) = −ε − (z)[2iπ] and 2iπη(z) = −ε + (z)[2iπ].
We would like to end this section with a practical remark. After deformation of the integration contour for the NLIE (3.35) the counting function η(z) is seen to satisfy the following functional equation, where h(z) is the limit of the qq-character χ(z). Thus, once the qq-character is known, 10 these equations can be solved perturbatively in the gauge coupling parameter q, 11 (3.41) and H 0 (z) = −1. Inverting the relation between η(z) and the second determination ε − (z), this method provides one of the most efficient way to compute the pseudo energy ε(z):

Summary and discussion
In this paper, we have presented the integrable structure behind the TBA-like equation by Nekrasov and Shatashvili [1], which arises when evaluating the ε 2 → 0 limit of the sum over instanton configurations. In fact, this regime is a natural quantisation/regularisation of SW theory [7,8] as ε 1 is still finite and is characterised by a set of Bethe equations with a polynomial Baxter TQ equation. Exploiting the reflection symmetry realised as a deformation of the integration contours, a dual TQ equation has been written. In the thermodynamical limit, the two TQ equations produce a dual pair of difference equations respectively, the hv-equations, albeit the v functions are no longer entire. Yet, their quantum Wronskian reproduces the TBA-like equation above [1] for a sort of pseudo-energy. In addition, we have investigated the non-linear integral equations obeyed by the counting functions for the Bethe roots. Very interestingly, these counting functions coincide with the two second determinations of the NS pseudo-energy. The reflection symmetry introduced here is very close to the reflection symmetry of Liouville vertex operators. But it is possible to give it another algebraic interpretation. Lifting up the theory to a five dimensional background compactified on S 1 , the corresponding N = 1 gauge theory is covariant under the action of the Ding-Iohara-Miki algebra [26,27] in the instanton sector [28,29,30,31,32]. This q-deformation of the SHc algebra simplifies the identification of the action of symmetries by lifting some degeneracies. In this context, the Z 2 -symmetry presented here is expected to coincide with the reflection σ H defined in [47], and that acts on the Drinfeld currents as follows: 12 This symmetry maps the algebra DIM q 1 ,q 2 to DIM q −1 , the inversion of the parameters q 1 , q 2 corresponding to a sign flip of the parameters ε 1 , ε 2 in the degenerate case. Similarly, the inversion of the spectral parameter becomes a change of sign z → −z as the radius of S 1 is set to zero. In the correspondence with (p, q)-web diagrams of IIB string theory, the symmetry σ H acts as a reflection of the diagram with the axis in the direction associated to D5-branes. This fact seems coherent with the interpretation as a reflection in Liouville theory. Yet, some further investigations are required to properly establish all these claims. We hope to address this issue in a near future.
In a companion paper [48], we investigated the double deformation of the Seiberg-Witten relations: at finite ε 1 and ε 2 , we managed to identify the symmetry exchanging the two 'sheets' of the Seiberg-Witten curve. This symmetry is different from the one described here, and the solutions v(z) andv(z) of the two dual hv-equations reproduce the same solution of the SW curve equation in the limit ε 1 → 0. In fact, the difference between these two reflection symmetries is more easily understood in the five dimensional uplift theory. In this case, the exchange of the two SW sheets has been identified with the action of another reflection symmetry of the DIM generators, denoted by σ V in [47]. 13 In the (p, q)-brane language, σ V may be interpreted as a reflection with axis in the direction associated to NS5-branes.
In this paper, we have confined our discussion to the TBA-like and the non-linear integral equations, second determinations of the former. Still, it should be also possible to relate the prepotential in the limit ε 2 → 0 to the Yang-Yang functionals associated to our systems of Bethe roots. Importantly, the prepotential obeys somedeformed Seiberg-Witten relations (with = ε 1 ) [49,50], which, in their turn, shall be obtainable as NS limit of the 'doubly-quantised' qqSW relations (ε 2 = 0) found in [48] in the full omega background. Therefore (and with crucial importance), the rôle of the Seiberg-Witten differential upon quantisation seems to be played by the counting function η(z): this very intriguing point is currently under investigation.
Finally, if we have found a system of Bethe equations underlying the TBA-like equation, yet a physical model is still missing. The question of finding an Hamiltonian (and a more complete transfer-matrix) describing this system is still open. In fact, this quantum system could be obtained using the R-matrix found in [51], after taking the limit ε 2 → 0. We hope to come back to this point soon.
Thus the Bethe equations imply δ l,n l = o(q). Then, we take l and i such that 1 ≤ i < n l , and consider the expansion of Since Ξ(u (l,i) )Ξ(u (l,i) + ε 1 ) remains finite, by the equality (A.1), and (A.2) that gives the order of the RHS, we deduce that δ l,i = δ l,i+1 + o(q). By recursion, since δ l,n l = o(q), we have δ l,i = o(q) for all l, i with i > 1.
For i = 1, the RHS of the Bethe equation is of order O(q) since the product M q remains finite, while the LHS is proportional to δ l,i − δ l,i+1 according to (A.5). It implies that δ l,1 = O(q). Thus, the induction hypothesis is true for k = 1.
Assuming the hypothesis true at rank k, the induction follows the same steps. Using the decomposition of the product (A.2), it is shown that when i > k + 1, the RHS of the Bethe equations is of order o(q k+1 ) and it is of order O(q k+1 ) when i = k + 1: Taking i = n l , due to (A.3) the LHS of the Bethe equations is equal to δ l,n l times a function of order one which is non-vanishing. It implies that δ l,n l = o(q k+1 ). Then, we consider k + 1 < i < n l and use the property (A.5) to show that the LHS of the Bethe equation is equal to (δ l,i − δ l,i+1 ) times a non-vanishing function of order one. This shows that δ l,i = δ l,i+1 +o(q k+1 ) and by induction δ l,i = o(q k+1 ) for all l and i > k +1. Finally, we take i = k +1 and due to the same property (A.5) the LHS of the Bethe equation is again equal to (δ l,k+1 − δ l,k+2 ) times a non-vanishing function of order one. But now the RHS is of order O(q k+1 ), implying δ l,k+1 = δ l,k+2 + O(q k+1 ) = O(q k+1 ). This finishes the proof of the hypothesis at rank k + 1 and the induction.
A.2 Explicit solution in the case N = 1, N f = 0 In the case of a pure U (1) gauge theory, the NS prepotential has the simple form F N S = q. The Bethe equations can be solved explicitly for a small number of roots. For two roots, we find after a bit of algebra, with α(q) solving the following cubic equation, It can be solved order by order in q, thus providing a series for α(q) which leads to .
Taking the sum of ε 1 (u r − u The solution of the Bethe equations involving three roots can be obtained perturbatively in q, (A. 10) We observe that the expansion of u 1 (q) and u 2 (q) coincide with the two-roots solution up to the order O(q 2 ), and differ at the order O(q 3 ). And now, the sum of ε 1 (u r − u (0) r ) reproduces the expansion of the exact prepotential up to the order O(q 3 ).

A.3 Derivation of the TQ-equation
The Bethe equations (3.3) can be rewritten in the following form, Consider the decomposition of the following functions over their poles at z = u r and z = ∞, where q(z) denotes Baxter's Q-polynomial and the subscript + the positive powers of z in the expansion at infinity. We observe that the two functions have the same poles, and the same residues at z = u r . They only differ by their singularities at z = ∞, which is a polynomial of degree 2N c that we denote t(z). Thus, we have obtained the TQ-equation (3.6), with the T-polynomial given by t(z) = Ξ(z)Ξ(z + ε 1 ) q(z + ε 1 ) q(z) (A.13)

A.4 Perturbative analysis of the T-polynomial
The T-polynomials is a monic polynomial of degree 2N c , and we denote the roots e ↑↓ l with l = 1 · · · N c . In the limit q → 0, q(z) tends to q 0 (z) and due to the property (3.10), t(z) tends to the product Ξ(z)A(z + ε 1 ). This provides the position of the holes at first order in q, e ↑ l = ξ l + O(q), e ↓ l = a l − ε 1 + O(q). (A.14) These holes may be interpreted as the companion roots of the strings corresponding to u (l,i) with l fixed. Actually, it is possible to show that ξ l is a zero of t(z) with a much better approximation, that is t(ξ l ) = O(q n l +1 ). This is due to the fact that ξ l is an exact zero of Ξ(z), and since u (l,n l ) = ξ l − ε 1 + δ l,n l and δ l,n l is of order O(q n l ) we have also q(ξ l − ε 1 ) q(ξ l ) = δ l,n l δ l,n l − ε 1 s =(l,n l ) Thus, the RHS of (A.13) for z = ξ l is indeed of order O(q n l +1 ). Setting n = min l n l , we define h(z) as the monic polynomial with roots at z = e ↓ l , so that t(z) = Ξ(z)h(z) + O(q n+1 ).

B Analytic properties of the v-functions and contour integration
We will work perturbatively in q. At first order, v(z) = 1 + O(q) and the logarithm can be expanded formally as log(v(z)) = ∞ n=1 q n l n (z). (B.1) By construction, each function l n (z) has poles only at the values z = a l + (i − 1)ε 1 for i ∈ Z >0 , so that they all lie in the contour of integration Γ. Consider the integral We can deform the integration contour on the sphere. At z = ∞, v(z) = 1 + O(1/z), taking the logarithm and expanding, we deduce that l n (z) = O(1/z) and there is no pole at infinity. The integrals can be written with a contourΓ that surrounds the lower-half plane, avoiding the real axis and the point at infinity, The variable z is assumed to lie slightly above the real axis, and the first integral has no pole inside the new integration contour. The second integral has only one pole, located at w = z − ε 1 , and with the residue −l n (z − ε 1 ): q n l n (z − ε 1 ) = − log(v(z − ε 1 )).

(B.4)
A similar argument can be employed to treatv(z). We decompose log(v(z)) = n=1 q nl n (z), (B.5) where the functionsl n (z) have poles at z = a l − iε 1 for i ∈ Z >0 , i.e. nowhere in the integration contour Γ. Considering the first integral has only one pole inside Γ at w = z + ε 1 , while the second integral has no pole at all. As a result, q nl n (z + ε 1 ) = − log(v(z + ε 1 )). (B.7)