Bethe/Gauge correspondence in odd dimension: modular double, non-perturbative corrections and open topological strings

Bethe/Gauge correspondence as it is usually stated is ill-defined in five dimensions and needs a"non-perturbative"completion; a related problem also appears in three dimensions. It has been suggested that this problem, probably due to incompleteness of Omega background regularization in odd dimension, may be solved if we consider gauge theory on compact $S^5$ and $S^3$ geometries. We will develop this idea further by giving a full Bethe/Gauge correspondence dictionary on $S^5$ and $S^3$ focussing mainly on the eigenfunctions of (open and closed) relativistic 2-particle Toda chain and its quantized spectral curve: these are most properly written in terms of non-perturbatively completed NS open topological strings. A key ingredient is Faddeev's modular double structure which is naturally implemented by the $S^5$ and $S^3$ geometries.


Introduction
The analysis of the Coulomb branch moduli space of vacua of four dimensional N = 2 SU (2) theories carried by Seiberg and Witten [1,2] 1 led to a huge number of new developments in the study and understanding of supersymmetric gauge theories. One of the most important consequences of this analysis is that it provides a clear way to relate the Coulomb branch of four dimensional N = 2 theories to complex algebraic integrable system [4][5][6]; in particular, in the pure SU (N ) case the Seiberg-Witten curve can be shown to coincide with the spectral curve of the classical N -particle Toda chain, while for a generic theory of class S [7] the associate system is a Hitchin system [8]. This remains true, with the appropriate modifications, if one considers N = 1 five dimensional gauge theories [9]: focussing again on pure SU (N ), its five dimensional Seiberg-Witten curve is the same as the spectral curve of the "relativistic" version of the Toda chain [10,11]. Subsequent developments [12,13] based on the study of four and five dimensional theories in the presence of Omega background made it possible to extend the correspondence between supersymmetric gauge theories and integrable systems to the situation in which the integrable system gets quantized (what is nowadays known as Bethe/Gauge correspondence [14]). Letting 1 , 2 be the parameters of Omega background, quantization of the integrable system requires considering the so-called Nekrasov-Shatashvili (NS) limit on the gauge theory side in which 2 → 0 while 1 remains finite (or viceversa); the remaining parameter 1 will play the role of the Planck constant . In a natural way, turning off the Omega background completely (i.e. sending also 1 ∝ → 0) brings us back to the Seiberg-Witten / classical integrable system correspondence discussed above. Bethe/Gauge correspondence in four and five dimensions is a fascinating subject still under development (see for example [15] for an overview of the current state of the art). In the four dimensional case (R 2 1 × R 2 ) many pieces of evidence for the validity of this correspondence have been collected, in particular numerical evaluation of the spectrum of quantum mechanical systems can be shown to agree with the results obtained via gauge theory, at least for quantum mechanical problems with single vacuum potentials [16]; in the case of periodic potentials such as Mathieu and Lamé systems the story is more complicated and may also require the use of resurgence techniques [17][18][19][20][21]. In five dimensions instead (R 2 1 × R 2 × S 1 ) it has been recently pointed out in [16,22,23] that Bethe/Gauge correspondence, as it is stated, is incomplete: for example the numerical spectrum does not coincide with the gauge theory results, and moreover gauge theory quantities in the NS limit are ill-defined for values of the Planck constant (i.e. 1 ) which should actually be perfectly admissible. Nevertheless the correspondence can be restored, and these problems solved, by properly considering the contribution of quantum mechanical instantons, non-perturbative in ; on the gauge theory side this translates into finding a "non-perturbative completion" of the five dimensional partition function in the NS limit, or of the refined closed topological string in the NS limit in geometric engineering language, as properly done in [16,23]. Another non-perturbative completion of refined topological strings, in principle different from the one of [16,23], has been proposed in [24]; the two proposals can been shown to be compatible [25] if one takes into consideration the observations in [26]. The idea of [24] involves considering the partition function Z S 5 of the gauge theory on the squashed S 5 [27][28][29][30][31][32][33]: thinking of S 5 as an (S 1 ) 3 fibration over a triangle, the integrand of Z S 5 is expected to factorize into three copies of the flat space partition function Z R 4 ×S 1 , each copy corresponding to one of the vertices of the triangle and the proposal is that Z R 4 ×S 1 provides the desired non-perturbative completion of Z (1) R 4 ×S 1 . In the following we will be interested in the "NS limit" of this geometry 2 : in this limit one of the three copies (say Z (3) R 4 ×S 1 ) drastically simplifies, and we remain with the statement that Z (2),N S R 4 ×S 1 is the non-perturbative completion of Z (1),N S R 4 ×S 1 . Following this line of reasoning while keeping in mind the lesson of [16,23] one can derive non-perturbatively corrected quantization conditions for the associated quantum integrable system which are more refined than the ones one would get by only considering Z (1),N S R 4 ×S 1 as originally suggested in [14] and basically correspond to the ones given in [26]. In this paper we will develop the idea of [24] further by analysing a class of codimension two and four defects for the N = 1 SU (N ) theory on S 5 ; these defects will wrap one of the three S 3 or S 1 respectively. In the NS limit only one S 3 and two S 1 survive, and our defects wrapping these submanifolds have a natural interpretation from the quantum integrable system point of view: they are eigenfunctions and eigenvalues of the commuting set of quantum operators defining the relativistic N -particle Toda chain as well as its Faddeev's "modular dual", related to the Toda chain by the exchange ↔ 1/ . A careful treatment of the problem inspired by [16,23] provides a non-perturbative completion of the prescription in [14] for computing eigenfunctions and eigenvalues of relativistic Toda: as we will see if one only considers defects in R 2 1 × R 2 2 × S 1 in the NS limit the eigenfunctions are ill-defined for some value of and ambiguous for all values of , while going to S 5 solves both problems at once. At the level of integrable systems, going to S 5 is equivalent to properly take into account the existence of the modular dual relativistic Toda chain, as done in [34] for the open relativistic Toda chain case (based on previous observations in [35,36]); remarkably, the modular double structure of the quantum system allows us to consider self-adjoint operators also for complex. The importance of the modular double structure has also been very recently remarked in [37]. An important point has to be stressed. Our analysis will initially correspond to the gauge theory version of the computations carried in [16,23], which have been performed via closed topological strings in the Calabi-Yau geometry engineering our five dimensional SU (N ) theory. However five-dimensional gauge theory quantities may be affected by problems of convergence in the instanton counting parameter Q 5d , and moreover they are hard to work with if one is interested in analysing their non-perturbative completions; this is why at the end we will have to re-express our results in terms of (open or closed) topological strings, which have better convergence properties and are easier to deal with. Nevertheless the gauge theory setting is also helpful because many quantities (such as the eigenfunctions) are easier to compute in this way and seems more convenient to study finite-difference equations since it involves series in a single parameter; hopefully this work will provide ideas on how to obtain the eigenfunctions of relativistic quantum mechanical systems directly from open topological strings.
The plan of the paper is the following. We start in Section 2 by reviewing what is known about relativistic Toda chains and their modular double structure; we then move to discuss Bethe/Gauge correspondence on flat space and argue that in odd dimension Bethe/Gauge correspondence is only well-defined on compact spaces. Going to compact spaces automatically implements the modular double structure of the underlying relativistic quantum mechanical system. Section 3 focusses on our main example, the quantum relativistic 2-particle open and closed Toda chain. While the known solution for the open Toda chain [34] admits a natural interpretation as a gauge theory on the squashed three-sphere, the closed chain requires to uplift the discussion to a particular limit of the squashed five-sphere. We will describe what gauge theory can say about non-perturbative completion of the eigenfunctions of the closed Toda Hamiltonians and of the operator associated to the quantization of its spectral curve, and comment on Fourier transformation of these eigenfunctions. At the end of the Section we rewrite our eigenfunctions in terms of open refined topological strings in the NS limit in order to properly analyse their non-perturbative completion. Section 4 contains a final discussion and various comments.
A related work which will consider a different approach to the problem of studying eigenfunctions of relativistic quantum integrable systems is in preparation [38].

Review of Toda chains and Bethe/Gauge correspondence
In this Section we review what is known about relativistic N -particle Toda chains (open and closed) from many different point of views: quantum integrable systems, supersymmetric gauge theories, topological strings. The goal of the Section is mainly to fix notations and contextualize the problem we want to solve.

Relativistic open and closed Toda chains
The quantum relativistic 3 N -particle Toda chain (open and closed) was introduced by Ruijsenaars in [10]. This is simply a quantum mechanical system of N particles on a line with an interaction defined by the Hamiltonian 4 with boundary condition x N +1 = x 1 − ln Q imposed. Here x n , p n are coordinate and momentum operators of the N particles and satisfy the commutation relations [x m , p n ] = iδ m,n , while combinations of ω 1 , ω 2 ∈ R + are related to the Planck constant and the "speed of light" c; finally, we defined q = e 2πiω 1 /ω 2 . The parameter Q = e −8π 2 /(g 2 ω 2 ) ∈ R + has to be thought as a useful accessory parameter which allows us to distinguish between the open chain (Q = 0) and the closed chain (Q = 1); as we will see, gauge theoretical computations for the closed chain typically involve power series expansions in Q, so we prefer to keep this additional parameter in the definition of the Hamiltonian. An important point we want to stress is that there is a big qualitative difference between the open Toda chain and the closed one. In the open case Q = 0 the potential of the theory does not have a stable vacuum (it actually has a runaway direction), therefore the quantum theory will have a continuous spectrum and non-normalizable wave-functions, exactly as for the case of a free particle; on the other hand, as soon as Q > 0 the potential will acquire a stable vacuum, which implies a discrete set of energies at the quantum level and L 2 -normalizable wave-functions. Because of its integrability the Toda system admits N − 1 additional commuting operators H k , k = 2, . . . , N : for example with p N +1 = p 1 . Imposing H N = 1 is equivalent to decouple the center of mass of the system. In the context of Baxter T -Q relations and Quantum Inverse Scattering Method [40][41][42] it is often useful to collect all the quantum operators H k , k = 1, . . . , N into a generating function t N (w) (the transfer matrix) which is nothing but the trace of the monodromy matrix, constructed from the quantum Lax operator; for the case at hand these operators can be found for example in [43]. Commutativity of the H k is ensured by the condition If we decouple the center of mass of the system, solving the closed chain quantum problem means finding discrete eigenvalues E = (E 1 , . . . , E N −1 ) and generating function of the eigenvalues. For the open chain the problem is similar, but the spectrum is continuous and the eigenfunctions are not L 2 -normalizable. The description of the classical relativistic Toda system as an algebraic integrable system requires the introduction of the spectral curve for the model; this is a Riemann surface embedded in (w, y) ∈ C * × C * given by which allows us to compute the action variables as the periods of an appropriate differential. The spectral curve admits many different representations, related by change of coordinates; for example a slightly different realization (Baxter-like) is given by while another realization (toric CY-like) is As we will see in the following, it is from this spectral curve that we can see the connection among relativistic N -particle Toda, five-dimensional supersymmetric theories and topological strings. At the quantum level the spectral curve gets promoted to a finite-difference equation: by redefining w = e x , y = e p and quantizing the ( which is known as Baxter T -Q equation, a central object in the study of the solution to quantum mechanical problems in the framework of Quantum Inverse Scattering.

Modular duality
An interesting observation put forward in [34] (motivated by earlier works [35,36]) is the existence of a modular dual relativistic Toda system, which is not independent from the one we considered above since they are related by the exchange ω 1 ↔ ω 2 ; that is, there exists another set of N commuting quantum operators H k , the first one being (xn−x n+1 ) e ω 2 pn , q = e 2πiω 2 /ω 1 (2.11) which also commute with the operators H k of the original system. The boundary condition in this case is commutativity of the two sets of Toda operators H k , H k is encoded in the relations We will have a spectral curve also for the classical dual system, of the form in the realization (2.7). The appearance of the dual system is not something one can ignore since it origins from representation theory. It has long been known that the spectral problem of the non-relativistic Toda chain can be reduced to considering the representation theory of semisimple Lie groups [44]; it is therefore natural to extend this approach to the relativistic Toda system by studying the representation theory of quantum groups U q (g) based on the algebras g = sl(N ) or gl(N ). The analysis carried out in [34] shows that the correct treatment of the problem actually requires to consider the representation theory of the modular double U q (g) ⊗ U q ( L g) with L g Langlands dual of g. At the practical level, among other things this allowed the authors of [34] to construct unambiguous eigenfunctions of the relativistic Toda system (aka Whittaker vectors), at least for the open chain. In fact, differently from non-relativistic quantum mechanical systems in which the eigenfunctions are only defined modulo a constant, eigenfunctions of the Toda operators H k are only defined modulo a function of period iω 1 (i.e. a quasi-constant) which are unaffected by operators like e −iω 1 ∂x ; this ambiguity can be reduced to the usual overall constant normalization by requiring them to simultaneously be eigenfunctions of the H k 's as well. We will have to keep this in mind when we construct the eigenfunctions of the closed Toda chain with gauge theory techniques. As remarked in [34], the existence of the modular dual Hamiltonians allows us to make sense of the quantum mechanical problem also for ω 1 , ω 2 complex: in fact the Toda operators when ω 1 , ω 2 are real, while the combinations H k + H k and i( H k − H k ) are self-adjoint for ω 1 = ω 2 . Only in this sense it is reasonable to analyse the Toda system for complex, as done for example in [45] and as we will sometimes do in the following.

Bethe/Gauge correspondence
As observed in [4][5][6], there is a deep connection between classical algebraic integrable systems (such as the non-relativistic open and closed Toda chains) and four-dimensional N = 2 theories on R 4 : this is most easily seen by comparing the Seiberg-Witten curve of the 4d theory with the spectral curve of the corresponding non-relativistic classical integrable system. This connection can be extended to include five-dimensional theories and classical relativistic integrable systems [9]: in particular, the classical closed relativistic N -particle Toda chain (with center of mass factored out) is associated to the 5d N = 1 SU (N ) theory on In fact one can compare the Seiberg-Witten curve of the 5d SU (N ) theory [9,46] with the spectral curve of the N -particles Toda chain [11] and check that they coincide. For example, for N = 2 the Seiberg-Witten curve reads with Q 5d = e −8π 2 R/g 2 5d , while the 2-particles Toda spectral curve is with E 1 classical energy of the system. When the 5d Yang-Mills coupling g 5d is turned off, i.e. Q 5d → 0, our Seiberg-Witten curve (2.15) reduces to the spectral curve for the open Toda chain. In this correspondence the energy E 1 of the classical Toda Hamiltonian H 1 is mapped to the vacuum expectation value U of the trace in the fundamental representation of a 5d SU (2) Wilson loop wrapping the S 1 R circle.
One may expect this correspondence could be promoted to the quantum level, were we able to introduce a parameter playing the role of on the gauge theory side. In the case of four-dimensional theories, the proposal (named Bethe/Gauge correspondence) put forward in [14] is the following: we can start by considering the 4d theory on R 2 in the presence of the most general Omega background and compute its partition function [12,13] with a vacuum expectation values of the scalar fields in the Cartan part of the N = 2 vector multiplet. We can now take the so-called Nekrasov-Shatashvili limit 2 → 0, 1 fixed and construct the function which is known as effective twisted superpotential. This function can then be interpreted as the Yang-Yang function for the quantized version of the classical integrable system which was associated to our gauge theory in absence of Omega background; 1 naturally corresponds to the Planck constant . Therefore the equations determining the supersymmetric vacua in the Coulomb branch 5 coincide with the Bethe Ansatz Equations for the quantum integrable system: these fix the values of a i (which are parameters entering in the Bethe Ansatz for the eigenfunctions of the system) in such a way to ensure L 2 (R N −1 )−normalizability and single-valuedness of the eigenfunctions and determine the discrete spectrum of the system. On the gauge theory side eigenvalues and eigenfunctions are given by the vacuum expectation value of observables associated to appropriate codimension four and two defects respectively, evaluated at the vacua determined by (2.19), while the Hamiltonians of the integrable system coincide with the twisted chiral ring operators of the effective two-dimensional theory living on the decompactified R 2 . In the limit Q 4d → 0 the theory has a moduli space of supersymmetric vacua instead of a finite number of vacua, equations (2.19) degenerate, and therefore the parameters a i remain continuous: this corresponds to having a quantum mechanical system 5 As mentioned in [14] quantization of aD is related to a quantum mechanical problem with L 2 (R)−normalizable eigenfunctions such as our 2-particles Toda system where the potential is basically a hyperbolic cosine, while quantization of a will lead to a problem with quasi-periodic eigenfunctions such as a system with a cosine potential. The second case is extremely more involved: see [17][18][19][20][21] for a discussion on the spectral problem of the Mathieu equation, related to four-dimensional N = 2 SU (2) theory. whose potential has not a proper single vacuum, which implies a continuous spectrum and non L 2 -normalizable eigenfunctions.
As far as five dimensional theories are concerned, the situation is less clear. The proposal in [14] is, strictly speaking, only formulated for four dimensional gauge theories; still one can imagine that a similar story might also be valid in five dimensions. Let us follow this idea for the time being, and specialize to 5d N = 1 SU (N ) theories on Omega background R 2 1 ×R 2 2 ×S 1 R : from the discussion above, we expect the NS limit of this theory to be related to the quantum relativistic N -particle closed Toda chain we introduced earlier in this Section. From the partition function (2.20) we can recover the relativistic Toda Yang-Yang function W 5d by taking the Nekrasov-Shatashvili limit The supersymmetric vacua equations will fix the values of a i in such a way to ensure single-valuedness of the wave-function. Eigenfunctions and eigenvalues of the relativistic Toda Hamiltonians H k , k = 1, . . . , N − 1 have a precise description in terms of N = 1 SU (N ) gauge theoretical quantities [15,47,48]. The eigenvalue E The simultaneous eigenfunctions ψ n (x 1 , . . . , x N ) of the Toda Hamiltonians correspond instead to the NS limit of the 5d partition function Z 5d,(ρ) in the presence of a particular class of codimension two defects on R 2 1 ×S 1 R ⊂ R 2 1 ×R 2 2 ×S 1 R known as Gukov-Witten (full) monodromy defects [49,50], again evaluated at the vacuum labelled by n. In this case it is better to consider the U (N ) theory first and later decouple the U (1) factor. The possible U (N ) monodromy defects are in one to one correspondence with partitions ρ = (N 1 , N 2 , . . . , N r ) of N where 0 N 1 N 2 . . . N r and r j=1 N j = N ; the partition determines the Levi subgroup L = U (N 1 ) × U (N 2 ) × . . . × U (N r ) of U (N ) left unbroken by the defect. Given L, there is an additional label σ which specifies the N ρ = N !/(N 1 !N 2 ! . . . N r !) non-equivalent choices of embedding L into U (N ). At fixed σ the monodromy defect corresponds to prescribe a singular behaviour for the gauge field Monodromy defects can alternatively be described as coupling the 5d theory to a 3d N = 2 theory living on the defect [51]; the relevant quiver 3d theory for a generic partition ρ is represented in Figure 1 and contains a series of U (s i ) gauge groups of rank . . , r − 1 (so that the last, flavour node has rank s r = N ). The quivers for the special cases of full (ρ = (1 N )) and simple (ρ = (1, N − 1)) defects are shown in Figure 2. The full defect 3d theory can be thought of as the chiral limit of the T [U (N )] quiver. The N ρ possible embeddings correspond to the number of supersymmetric vacua of the 3d theory, while the parameters (m 1 , m 2 , . . . , m r ) are related to 3d Fayet-Iliopoulos parameters. The eigenfunctions ψ n (x 1 , . . . , x N ) therefore also correspond to the NS limit of the partition function Z 3d/5d of our 5d theory coupled to the 3d theory given by the left quiver in Figure 2, evaluated at the solution n of (2.22). If we turn off the 5d gauge coupling, i.e. we take the limit Q 5d → 0, we remain with just the partition function Z 3d of the 3d defect theory living on R 2 1 × S 1 R , which therefore will correspond to the eigenfunction of the open Toda chain; putatively, Z 3d will also correspond to the 3d blocks [52][53][54] that one can extract from the partition function on the squashed 3-sphere S 3 ω 1 ,ω 2 [55,56] or the S 2 × S 1 index [57][58][59].
U (s r−1 ) . . .  To summarize, if one extends the Bethe/Gauge correspondence of [14] to five dimensional theories on R 2 1 × R 2 × S 1 R and relativistic quantum integrable systems, one gets the following dictionary:  Table 1 This proposal has been tested "off-shell" (i.e. without imposing (2.22)) in [47,48] for the 5d N = 1 SU (2) theory 7 (see also [53] for the open case). In this case the codimension two defect associated to the eigenfunctions corresponds to the chiral limit of the 3d N = 2 * T [U (2)] theory, i.e. the quiver theory in Figure 3. In these papers the authors explicitly computed Z 3d/5d N S and W SU (2) N S at the first few orders in a series expansion in powers of the instanton counting parameter Q 5d and showed that Moreover they showed that the 3d blocks of the defect theory, which they extracted from the partition function on S 3 ω 1 ,ω 2 , exactly reproduce the limit Q 5d → 0 of Z 3d/5d which we call Z 3d . U (2) U (1) Nevertheless, this solution is not completely satisfactory: in fact apart from possible problems of convergence as series in Q 5d , the proposed eigenfunctions are only defined up to quasi-constants (functions periodic in ) and only make sense for complex while they present an infinitely dense set of poles at real, although H 1 is only self-adjoint for real . As noticed in [16,23] (based on [22]) in the context of ABJM theory and closed topological strings on local F 0 , similar problems also occur when considering the quantization conditions (Bethe Ansatz Equations) for the system: the putative Yang-Yang function one obtains from five-dimensional gauge theories in the NS limit via Bethe/Gauge correspondence (2.21) is only defined for complex and has an infinitely dense set of poles at real , and moreover the spectrum obtained by using (2.21) does not match with numerical computation of the eigenvalues 8 . In order to cancel these poles and get a spectrum which matches with numerical computations one has to consider contributions coming from quantum-mechanical instantons, i.e. terms of the form e −1/ . Although quantum-mechanical instantons are quite unexpected from the form of the Hamiltonian H 1 , their appearance is less surprising if one remembers that the only consistent relativistic quantum mechanical problem is the one involving also the modular dual Hamiltonian H 1 , and that the combined system also makes sense for complex (in which case one needs to consider the combinations H 1 + H 1 and i( H 1 − H 1 )). After properly taking into account the contribution of quantum-mechanical instantons, one finds that the exact quantization conditions are roughly of the form [16,23] The WKB part is nothing else but the old proposal (2.22), while the non-perturbative in part (np) is a function which only involves contributions of the form e −1/ . The new expression (2.28) makes sense also for real, has no poles in , and provides the correct spectrum of the Hamiltonian H 1 (as well as a good definition of non-perturbative completion of refined closed topological strings in the NS limit). The original expression for W np 5d given in [16,23] was actually quite involved; the important observation of [26] simplifies it by showing that W WKB 5d and W np 5d are actually the same function but written in terms of e and e −1/ respectively. This observation makes manifest the "S-duality" invariance of (2.28), i.e. invariance under the exchange ↔ 1/ . It is therefore clear that a naive extension of Bethe/Gauge correspondence to five dimensions along the lines we described earlier in this Section is incorrect, or at least incomplete. Let us try to understand why, and how the problems we encountered can or cannot be solved.

Bethe/Gauge correspondence on squashed S 3 and S 5
The first point we want to stress is that the instanton partition function in five dimensions is only defined for generic, not general, Omega background parameters 1 , 2 : with this we mean that it presents divergences for some specific values of these parameters (which we call "non-generic"). In particular, in the NS limit the partition function is not well defined precisely in the case of 1 corresponding to real; nevertheless at the level of ADHM quiver quantum mechanics this is expected since at these non-generic values there appear additional zero modes. It is probably because of this reason that the Bethe/Gauge correspondence proposal has not been explicitly extended to five dimensions in [14]. This actually seems to be a more general problem regarding Omega background in odd number of dimensions, since also three dimensional vortex partition functions present the same 8 On the other hand, as showed for example in [16] the Bethe/Gauge correspondence proposal in four dimensions seems to work well: in particular the numerical spectrum of the non-relativistic 2-particle closed Toda chain matches the spectrum one obtains from pure 4d N = 2 SU (2). feature. One could therefore imagine the problems arising in (2.22) are coming from the failure of Omega background in being a good regularization of the partition functions in 9 . If this is the problem, then a natural solution would be to study the partition function of our theory not on flat space in Omega background but on a compact manifold: by definition this partition function, were one able to properly compute it, will be well regularized. With applications to relativistic quantum mechanics in mind, one then has to look for a compact geometry such that the would-be is real: the simplest option turns out to be the squashed sphere S 5 , while S 4 × S 1 would correspond to having imaginary 10 . This is how the proposal for a non-perturbative completion of refined closed topological strings put forward in [24] should be interpreted. While this idea is certainly as good as simple, it might not be immediate to implement it rigorously. In order to better understand what the problems could be, let us first consider what happens in three dimensions; ours will be a general discussion, the details will be given in the next Section.
Let us work on the squashed three-sphere S 3 ω 1 ,ω 2 defined as and take for definiteness a 3d N = 2 gauge theory with gauge group U (1) and two chiral multiplets: this is the example we will discuss in more detail in Section 3.2. As we will see there, the partition function in this case reads The meaning of the various parameters entering this expression will be given in the next Section. The function S 2 is strictly related to the double sine function (see Appendix A), which is defined in terms of a contour integral. When Im (ω 1 /ω 2 ) > 0 the double sine admits a factorized form in terms of infinite products as in (A.11) which could also be used for Im (ω 1 /ω 2 ) = 0 and ω 1 /ω 2 irrational, while for Im (ω 1 /ω 2 ) = 0 and ω 1 /ω 2 rational one has to rely on the contour integral representation from which it is however possible to obtain a finite product representation as done in [60]. We anticipate that Z S 3 ω 1 ,ω 2 satisfies the finite-difference equation as well as its modular dual Of course, this is or is not a problem depending on what one wants to do. The partition function on R 4 1 , 2 × S 1 R is perfectly fine as it is if interpreted as an index; on the other hand if one is looking for a way to solve relativistic quantum mechanical systems in terms of gauge theories something else needs to be considered. 10 As we will see, q = e 2πiω 1 /ω 2 in S 5 plays the role of q = e 2πi in quantum mechanics; ω1, ω2 are geometric parameters of S 5 when ω1, ω2 ∈ R+ which leads to real. Similarly, reality of the geometric parameters of S 4 × S 1 would correspond to imaginary.
For ω 1 , ω 2 ∈ R + (which corresponds to having real) and all other parameters real the operators on the left hand side of (2.31), (2.32) are self-adjoint and (2.30) is a well-defined eigenfunction of them. This is in fact the solution to the relativistic 2-particle open Toda chain given in [34].
Although we have no reason to do so since everything is consistent and the problem is solved, let us now consider the case in which ω 1 , ω 2 are complex, say ω 1 = ω 2 ; this means that technically speaking we will no longer be on the squashed S 3 geometry. Then we can use (A.11) and evaluate the integral; as we will see, the result roughly factorizes as in terms of two copies of the partition function on flat space R 2 × S 1 R in the presence of Omega background; the two copies (untilded and tilded) correspond to the R 2 × S 1 R at the North and South poles of S 3 ω 1 ,ω 2 respectively and are related by the exchange by itself satisfies (2.31) but it presents quasi-constant ambiguities, i.e. it is only defined up to functions periodic in ω 1 ; the easiest solution to this problem involves considering the action of the modular dual operator (2.32) which will fix in an unique way the quasi-constant to be Z R 2 . At this point we have that the combination is an eigenfunction of our operator as well as its modular dual for ω 1 , ω 2 complex, but we have to remember that the operators (2.31), (2.32) are not self-adjoint by themselves unless the ω i 's are real: only linear combinations of (2.31) and (2.32) are self-adjoint, as discussed at the end of Section 2.2, and the combination (2.33) is a good eigenfunction for them. Let us now try to take the ω i → R + limit from our current situation. For ω i 's real Z R 2 are separately ill-defined and have an infinitely dense set of poles in ω 1 , ω 2 , so we will have to consider them together. Next, by an analytic continuation in q we can for example bring Z R 2 from the numerator to the denominator in (2.33) (something along the lines of (A.5)) to arrive at the combination 11 It would actually be quite hard to perform such an analytic continuation with the expressions provided by gauge theory; this is why at this point it is better to rewrite our expressions in an open topological strings like form. In this form it is also easy to show that (2.34) is free of poles at ω 1 /ω 2 rational; in order to see that (2.34) satisfies (2.31), (2.32) at ω 1 /ω 2 rational one has or to reconstruct double sine functions from open topological strings or to perform a careful limit along the lines of [60] (see also [61]). The conclusion is the following. The partition function on S 3 ω 1 ,ω 2 (2.30), which we know how to compute, is a good eigenfunction for the quantum operator (2.31) and its modular are intended as written in terms of q = e 2πiω 1 /ω 2 and q = e 2πiω 2 /ω 1 with Im ω1/ω2 > 0, which means |q| < 1 and | q| > 1. In order to approach Im ω1/ω2 = 0 we first have to analytically continue Z R 2 ω 2 ×S 1 ω 1 in q; here and in the following we denote the resulting expression, written dual for ω 1 , ω 2 real (or for linear combinations of these operators for ω 1 , ω 2 complex with ω 1 = ω 2 ) while the partition function on flat space in Omega background Z R 2 can never be a good eigenfunction for (2.31) by itself. If we want to reconstruct the true solution (2.30) from Z R 2 we have to do a few steps. First, we go to ω 1 , ω 2 complex with ω 1 = ω 2 and invoke modular duality; this brings us to (2.33). Second, we perform an analytic continuation in q in order to get the more proper expression (2.34): this second step involves rewriting our formulae in open topological strings like form, which also allows us to show that (2.34) is free of poles at ω 1 /ω 2 rational. Lastly, we take the limit ω 1 /ω 2 → R + ; in order to clearly see that (2.34) satisfies a finite difference equation (and its dual) also at ω 1 /ω 2 rational we express everything in terms of double sine functions or we take a careful limit ω 1 /ω 2 → Q + to get to expressions like the ones in [60].
We can now move to the squashed S 5 case. This space has a geometry and can alternatively thought of as an (S 1 ) 3 fibration over a triangle (see Figure 4), where the vertices correspond to the fixed circles S 1 (i) with respect to the U (1) 3 isometries of squashed S 5 and the edges correspond to squashed three-spheres. The partition function of 5d N = 1 theories on this S 5 has been discussed in some detail in [27][28][29][30][31][32][33]. As far as the 1-loop part of this partition function is concerned, the story is very similar to what we already saw for S 3 ω 1 ,ω 2 : the 1-loop part is given by triple sine functions, whose contour integral definition is valid for ω 1 , ω 2 , ω 3 real, while allowing ω 1 , ω 2 , ω 3 complex the triple sine will factorize into three copies of the 1-loop part of the 5d instanton partition function on flat space (one for each fixed S 1 (i) ). However, in this second case we can no longer talk about partition function on S 5 but of an analytic continuation of it. For the instanton part (which is not present in 3d) the situation is less clear: the expectation is that the integrand of Z S 5 will factorize into three copies of the complete (1-loop + instanton) flat space partition function Z R 2 , each copy corresponding to one of the vertices of the triangle, with Omega background parameters determined as in Table 2; this would lead to By performing an analytic continuation in the ω i 's, the integrand can be schematically rewritten in the form 12 where the primed functions are intended along the lines of what we said in Footnote 11. The proposal in [24] is that (2.37) is a good non-perturbative completion of Z (1) 12 Again, it is by no means obvious that such an analytic continuation can be performed by looking at the explicit expressions of the 5d partition function; this is something which is better seen by rewriting instanton partition functions, without and with defects, in (closed or open) topological strings-like form. We will see an example of this in Section 3.7. Table 2 or equivalently of refined closed topological strings: this is because the integrand of the S 5 partition function will always be well-defined since we are on compact space. This is formally correct, but there are a few points one has to take into account. First of all, no one really properly computed the instanton part of the S 5 partition function; we will have to assume (2.36) is correct and see what this implies. Second, instanton series in Q 5d may not be convergent (they are asymptotic for ω i 's complex and convergent for ω i 's real if we are not hitting a pole): problems of convergence can be solved by re-expanding the instanton partition function in a closed topological strings form around the large volume point. Third, expressions like the integrand of (2.36) are only valid for ω i 's complex, that is outside from the S 5 geometry, and one should show that they are pole-free for ω i 's real; in order to see this it would again be more convenient to write our expression in topological strings like form. Cancellation of poles has in fact been shown to happen in the particular case ω 3 → 0: as we see from Table 2 this corresponds to an NS limit for the flat 5d theories living on the first two fixed points, while for the third one the instanton contribution disappears. We therefore roughly remain with two copies of the NS limit of the flat 5d partition function, related by the exchange ω 1 ↔ ω 2 ; it turns out that the total twisted effective superpotential now contains two pieces, and the corresponding supersymmetric vacua equations are free of poles and compatible with the ones in (2.28) as shown in [25] 13 . The symmetry ω 1 ↔ ω 2 is nothing else but the "S-duality" invariance of (2.28), which in the squashed S 5 setting has a very natural explanation. This provides support to the proposal of considering (2.37) as the non-perturbatively completed partition function; let us however stress that in order to see analytic properties, pole cancellation and convergence it is necessary to rewrite (2.37) in topological strings form, although the computation of (2.37) and related observables may be easier to perform in gauge theory.
In the following we will analyse further the proposal of [24] by considering codimension two and four defects in the squashed S 5 geometry, in a generalization of the setting in Table  1. We will closely follow the set-up of [62]. We will place our codimension two monodromy defect, thought of as the 3d theory of Figure 1, on one of the three squashed 3-spheres inside S 5 , say S 3 (3) ; the codimension four defects will then be Wilson loops wrapping S 1 (1) 13 Although it does not happen for 5d SU (2), in general cancellation of poles involves an imaginary shift of the Kahler moduli / real scalar fields ai due to a B-field. Such a shift is known to be present in the 5d partition function, although we are not aware of any reference on this technical point. Figure 4: Left: S 5 as an (S 1 ) 3 fibration over a triangle. Right: the ω 3 → 0 limit. and S 1 (2) . As explained in [62], the integrand of the S 5 partition function in the presence of codimension two defects will conjecturally be of the form The integrand contains two copies of the flat 5d partition function with monodromy defect and one copy of the usual 5d partition function. In the ω 3 → 0 limit the last one becomes trivial, while the first two reduce to their NS limit and we remain with an integrand like which can be analytically continued to 3d/5d and Z (2) N S 3d/5d are related by the exchange ω 1 ↔ ω 2 ("S-duality"). The modular double structure of the associated quantum relativistic integrable system has a very natural interpretation in this setting: the twisted chiral ring operators of the two copies of the flat theory in the NS limit will give rise to two commuting sets of Hamiltonians H k and H k related by ω 1 ↔ ω 2 ; the combination (2.39) will then be a common eigenfunction for these two sets, with eigenvalues corresponding to NS Wilson loops at S 1 (1) and S 1 (2) respectively, again mapped between each other by ω 1 ↔ ω 2 . Alternatively, these finite-difference equations satisfied by (2.39) can be thought of as Ward identities for line operators at S 1 (1) and S 1 (2) . The usual caveats have to be taken into account. First, (2.39) may not be convergent as a series in Q 5d ; however we will see that it can be written in terms of refined open topological strings which have better convergence properties. Second, (2.39) is only valid for ω i 's complex, i.e. outside the S 5 geometry: going to open topological strings we can see that it is free of poles at ω 1 /ω 2 real ad rational and we can take the limit ω i → R + (with special care in the case ω i → Q + ).
We will focus on the 5d SU (2) theory and discuss the eigenfunctions for the associated modular double relativistic 2-particle closed Toda chain. In addition, we will discuss the eigenfunctions of the quantum operator which appears when quantizing the Seiberg-Witten curve: in gauge theory terms this corresponds to consider a different kind of codimension two defect (right side of Figure 5), which is simply the S-dual (in type IIB strings sense) to a simple monodromy defect. For the special case of SU (2) full and simple defects coincide, and we will study eigenfunctions for the quantized spectral curve and its S-dual; as we will see, at the level of integrable systems S-duality corresponds to Fourier transformation. In Table 3 we give a basic dictionary between the Toda system and the gauge theory on S 5 for the convenience of the reader. More details will be given in the next Sections.
exact Bethe Ansatz Equations S 5 supersymmetric vacua equations quantum Hamiltonians H k twisted chiral ring operators (copy (1)) dual quantum Hamiltonians H k twisted chiral ring operators (copy (2)) simple defect partition function Table 3 3

Relativistic 2-particle Toda
In this Section we will show how one can construct eigenfunctions and eigenvalues for the modular double relativistic 2-particle Toda (both open and closed) in gauge theory, in a way that takes into account also quantum mechanical instanton contributions (i.e. nonperturbative corrections in ). As mentioned in the previous Section, our discussion will develop further the ideas contained in [24] by following the set-up of [62]. We will first collect the gauge theory computations relative to the open and closed Toda chains as well as to their quantized spectral curve, in the meanwhile discussing Fourier transformation of the wave-function; later we will move to open topological strings formalism in order to check regularity of the solution.
A complete, well-defined solution to the open 2-particle chain (and more in general to the open N -particle chain) has been given in [34] in terms of representation theory of the modular double U q (sl(2, R)) ⊗ U q (sl(2, R)) as well as in the context of Quantum Inverse Scattering Method. As we will see, this solution exactly coincides with the gauge theoretical one.

A toy model
Before moving to more complicated cases, it is actually better to pause a moment and understand the problems we will encounter in a toy model strictly related to the quantum dilogarithm function which, as we will see, is the basic ingredient needed in the rest of the paper. Suppose we want to look for eigenfunctions of the finite-difference equation It is easy to see that (qe 2πx/ω 2 ; q) ∞ with q = e 2πiω 1 /ω 2 is annihilated by our finite-difference operator: However this solution is not satisfactory for many reasons. First of all it presents quasiconstant ambiguities: we can multiply it by any periodic function of x with period iω 1 and it will still be a solution. This would make the definition of norm of an eigenfunction meaningless, is in contrast with the usual quantum mechanical case in which the only ambiguity is an overall constant. Moreover, the function (qe 2πx/ω 2 ; q) ∞ is only convergent when |q| < 1; if |q| > 1 we can use the analytic continuation formula (A.5) and arrive at (e 2πx/ω 2 ; q −1 ) −1 ∞ , but we would like an expression which is valid at |q| = 1 (i.e. ω 1 , ω 2 real) since only in this case our finite-difference operator is self-adjoint. Unfortunately our solution is ill-defined at |q| = 1 since it presents poles when ω 1 /ω 2 is rational, as we can see from (A.5) i.e.
All these problems can be solved if we require the true wave-function to satisfy a second, "dual" finite-difference equation which is just our previous operator with the exchange ω 1 ↔ ω 2 . If we define q = e 2πiω 2 /ω 1 , surely ( qe 2πx/ω 1 ; q) ∞ and (e 2πx/ω 1 ; q −1 ) −1 ∞ will satisfy (3.4) for | q| < 1 and | q| > 1 respectively, while our previous solution will be a quasi-constant for (3.4). Therefore we can imagine the combination will be a good eigenfunctions for the operators (3.1), (3.4); nevertheless if we choose |q| < 1 this implies | q| > 1, so our combination has to be written more properly as It is easy to show that this combination is regular even at |q| = | q| = 1 since the poles at ω 1 /ω 2 rational cancel: in fact this is nothing else but the quantum dilogarithm (A.2). Nevertheless, the representation (3.6) is properly only valid when Im (ω 1 /ω 2 ) > 0; the limit Im (ω 1 /ω 2 ) → 0 can be taken without harm when ω 1 /ω 2 is irrational, but more care is needed when ω 1 /ω 2 is rational: we refer to [60,61] for more details on the proper treatment of the rational case. Just as an example, the proper treatment of the case ω 1 → 1, ω 2 → 1 leads to an expression like [60] Alternatively, after having realized that (3.6) is the quantum dilogarithm one can just work with its contour integral representation which is valid also at ω 1 /ω 2 rational.

Open Toda
We are now ready to discuss Toda chains. As we discussed in Section 2, the relativistic 2-particle Toda chain is naturally associated to the five dimensional N = 1 SU (2) gauge theory: this can be seen for example from the spectral curve of the classical Toda chain, which coincides with the Seiberg-Witten curve of our five dimensional theory. Bethe/Gauge correspondence tells us how this relation gets modified when we consider the quantum Toda chain. Here we start from the open chain (Q = 0): since Q = Q 5d = e −8π 2 R/g 2 Y M , at the level of gauge theory this corresponds to freezing the five dimensional gauge dynamics (i.e. g Y M = 0), so that we can just focus on the theory living on the 3d defect. We will first discuss the computation on flat space R 2 1 × S 1 R in order to point out its problems; later we explain how to solve these problems by going to curved space S 3 ω 1 ,ω 2 . As we will see, our discussion will not contain anything new conceptually with respect to the toy model we considered in Section 3.1.

Flat space analysis
In flat space R 2 × S 1 R we already know how to solve the Toda system in gauge theoretical terms: we just need to follow what we said in Section 2.3 (see the dictionary given in Table  1) in the Q 5d = 0 limit. In particular the eigenfunctions of our system will be given by the NS ramified instanton partition function Z 3d/5d for a full monodromy defect, in the limit in which the SU (2) five dimensional bulk theory is decoupled from the defect. This is expected to coincide with the 3d block B 3d (the "K-theoretical" vortex partition function on R 2 × S 1 R , or "K-theoretical" Givental's function [63]) for the 3d theory corresponding to our full monodromy defect, which in this case is a 3d N = 2 U (1) theory with two fundamental flavours and flavour symmetry SU (2) (as in Figure 3 after decoupling a flavour U (1)). The block B 3d can be extracted from factorization [52] of the squashed S 3 ω 1 ,ω 2 partition function All the details on the integration contour can be found in [34]. Here k ∈ Z is a Chern-Simons level, ξ the Fayet-Iliopoulos parameter, a/2 the flavour mass in the Cartan of SU (2), ω 1 , ω 2 the squashing parameters of S 3 ω 1 ,ω 2 parameterized as and S 2 (σ|ω 1 , ω 2 ) is related to the so-called double sine function s ω 1 ,ω 2 (σ) as See Appendix A for more details on the double sine function. Let us define and z = e −2πξ/ω 1 , q = e 2πiω 2 /ω 1 , µ = e 2πa/ω 1 (3.12) In order to extract the block from (3.8) we need to perform the integral and factorize the result. This has been done in many places in the literature, see for example [52]. Following this procedure we arrive at The expressions for Z (2) 3d,1l , Z 3d are obtained from (3.14), (3.15) by exchanging µ ↔ µ −1 , while those for tilded quantities coincide with (3.14), (3.15) written in terms of tilded variables (i.e. ω 1 ↔ ω 2 ). Modulo prefactors that are not relevant for our discussion, the blocks B (1) 3d , B (2) 3d associated to the two vacua of the theory are simply given by Z (1) 3d,1l Z (1) 3d and Z (2) 3d,1l Z (2) 3d respectively. These blocks are known to satisfy finite-difference equations, which can be recovered from quantizing the twisted chiral ring relations of the 3d theory [48,53,64]. More in detail, in order to obtain the finite-difference operators we proceed as follows. The factorization of the partition function as in (3.13) suggests that we can see Z as gluing two copies of the partition function on R 2 1 × S 1 R (i.e. two copies of B 3d ), the first one corresponding to the North pole ( 1 ∝ ω 1 , R ∝ 1/ω 2 ) and the second one to the South pole ( 1 ∝ ω 2 , R ∝ 1/ω 1 ). We then consider the Coulomb branch of the 3d theory at, say, the North pole; this can be described in terms of the 3d twisted effective superpotential W eff 14 . In our case where (x|ω 2 ) is a function such that The Coulomb branch vacua can be obtained by extremizing W eff , i.e. they are the solutions to exp 2π ∂W eff ∂σ = 1 (3.19) that is e 2πσ/ω 2 + e −2πσ/ω 2 − e 2πkσ/ω 2 e −2πξ/ω 2 = µ 1/2 + µ −1/2 (3.20) If we now define the momentum conjugate to ξ as equation (3.20) reduces to The left hand side of (3.22) is just a different, k-dependent reparameterization of the classical version of the relativistic 2-particle open Toda Hamiltonian (2.1) when the center of mass is decoupled, after properly rescaling the parameters; our original parameterization is recovered for k = −1. The right hand side of (3.22) represents the energy µ 1/2 + µ −1/2 of the classical system, which is just the VEV of the SU ( The associated quantum problem will therefore be finding the k-dependent (and a-dependent) function ψ Other equivalent formulations are and where p z acts as p z z = qz. One can easily check that the combinations Z As pointed out in [48], this was also known in the mathematical literature in the context of quantum K-theory on flag manifolds [63]; here we basically recovered the same result in gauge theory language.
Very often in the gauge theory literature Z 3d are considered as the eigenfunctions of the quantum relativistic 2-particle open Toda chain, or at least as formal eigenfunctions. Unfortunately, this does not make much sense in relativistic quantum mechanics, for the same reasons we discussed in Section 3.1: • First, ω 1 /ω 2 is related to and therefore all values of ω 1 /ω 2 ∈ R + should be allowed; actually these should be the only values one must consider, since the squashed S 3 ω 1 ,ω 2 metric (3.9) is only defined in this range and the quantum operator (3.24) is selfadjoint only for real. Nevertheless, it is easy to see that Z (i) 3d in (3.15) is ill-defined exactly for |q| = 1, in particular it has poles when ω 1 /ω 2 = r/s with r, s ∈ N.
• Second, eigenfunctions in quantum mechanics are defined modulo at most an overall constant, which can later be fixed to the appropriate value. On the other hand in our case, since we are dealing with a relativistic system which involves finite-difference operators e −iω 1 ∂ ξ , Z This is telling us that if we want to give our 3d defect theory an interpretation in the context of relativistic quantum integrable systems, it is not enough to consider it on flat space R 2 1 × S 1 R . Nevertheless, everything becomes consistent if we move to curved space, in particular to the squashed three-sphere S 3 ω 1 ,ω 2 .

Curved space analysis
As we mentioned in Section 2.4, the solution to the problems we just pointed out arises from properly taking into account the existence of the dual Toda system as done in [34].
The dual system naturally appears if we consider the 3d theory on the whole S 3 ω 1 ,ω 2 instead of just R 2 1 × S 1 R at the North pole, as noticed for example in [53,65]: in fact following the same steps as before the R 2 1 × S 1 R at the South pole will give a dual twisted effective superpotential leading to the (k-dependent) dual Toda Hamiltonian and the dual quantum problem 3d are formal eigenfunctions of the dual quantum problem, but they have the same problems as Z 1 with eigenvalues µ 1/2 + µ −1/2 and µ 1/2 + µ −1/2 respectively; this condition will fix the quasi-constant ambiguity completely. By noticing that 3d is a good candidate: in fact by considering the logarithm of this combination one can easily perform an analytic continuation in q of Z (i) 3d and show that the limit ω 1 /ω 2 → R + is regular, that is poles at ω 1 /ω 2 = r/s cancel. Otherwise one could just remember that our combination is the same as Z (k) S 3 ω 1 ,ω 2 in (3.8): this is written in terms of double sine functions and is therefore well defined at any ω 1 , ω 2 ∈ R + . We conclude that the true eigenfunction of the open Toda chain is In fact it is easy to show that, even without performing the integration, Z This is consistent with what is known by the integrable system community, since equation (3.8) is the same expression for the eigenfunction given in [34] in the so-called q-deformed Mellin-Barnes representation. In gauge theory language, equations (3.32) can be thought of as Ward identities for flavour line operators inserted at North and South poles as discussed in [65][66][67] (following [68][69][70]).
We conclude this section with the following comment. As noticed in [34], the Toda operators H 1 , H 1 are self-adjoint when ω 1 , ω 2 are real, but if we consider the whole modular double structure of the Toda system more possibilities are allowed: in particular when ω 1 = ω 2 the operators H 1 + H 1 and i( H 1 − H 1 ) become self-adjoint and we can study this quantum mechanical system for complex. Nevertheless, for ω 1 and ω 2 complex our geometry no longer is a squashed three-sphere and we can no longer talk about codimension two defects on S 3 ω 1 ω 2 ; this analytic continuation in gauge theory is probably related to changing the geometry to S 2 × S 1 or Lens spaces L(r, 1). In fact the modular double structure is a common feature of all of these 3d compact spaces, as recently discussed in [37]. A similar problem of analytic continuation in ω 1 , ω 2 , as well as the identification of two possible domains for self-adjoint operators, also appeared in [65] in the context of 3d-3d correspondence and complex Chern-Simons theory which are more closely related to the discussion in [37].

Open bispectral dual Toda (quantized spectral curve)
From now on, let us focus on (3.8) in the case of Chern-Simons level k = 0: we then have which as we have just seen is a simultaneous eigenfunction of the two operators with z = e −2πξ/ω 2 , p z = e −iω 1 ∂ ξ . If we compare these operators with the ones coming from the quantization of the spectral curve (2.8) and its modular dual in the limit Q → 0, that is or equivalently we notice that, modulo phases, (3.34) and (3.36) are (classically) related by the exchange of coordinate and momenta / Fourier transform, that is by a canonical transformation of variables. Equivalently, they can be seen as different quantizations of the same spectral curves according to what we define being coordinate and momenta at the classical level. From the point of view of integrable systems, this is known as bispectral duality; the analogue in gauge theory is S duality in type IIB string theory if we see the 3d theory as a defect for a 5d theory engineered via a (p, q)-web brane [47]. It is immediate to write down the simultaneous eigenfunction for (3.36). In fact, Z S 3 ω 1 ,ω 2 (ξ; a) is nothing but the Fourier transform of its integrand 15 , which will therefore be the eigenfunction we are looking for, with the same eigenvalues This is a simple consequence of the property (A.12) of the double sine function. Notice that the function (3.37) is nothing else but the partition function on S 3 ω 1 ,ω 2 of two free chiral multiplets, which is the defect theory of Figure 5 right (S-dual to a simple defect, although when N = 2 simple and full defects coincide). Clearly one could also consider taking two antichiral multiplets instead of chiral ones, both in this Section and in the previous one: we will not consider this explicitly here since everything goes the same way as for the chiral multiplets once the parameters are appropriately identified.

Closed Toda
Having reinterpreted the known solution [34] for the eigenfunctions of the open Toda chain in terms of gauge theory quantities, we can now move on and discuss the closed Toda chain. As we already mentioned, the eigenfunctions for the closed chain are expected to be related to the SU (2) ramified instanton partition function Z 3d/5d for a full monodromy defect (Figure 3) in the NS limit. In the previous subsections we did not need to compute this quantity directly, since when the five dimensional gauge theory is frozen we can just consider the theory living on the 3d defect; this time instead we really have to perform this computation. As we said in Section 2.4, gauge theories computations on flat space will only be valid outside the unit circle |q| = 1 and will be given by a perturbative series in the instanton counting parameter Q 5d which may not be convergent; in this and the next subsection we will limit ourselves to collect the gauge theory results on flat space and S 5 , leaving the discussion on convergence and pole cancellation for Section 3.7. For the moment we just remark that the NS limit of the VEV of the 5d gauge Wilson loop W SU (2) 16 is actually a well-defined quantity even along |q| = 1. All the relevant gauge theory quantities have already been analysed in [47,48] for theories on R 2 1 × R 2 × S 1 R ; here we will review their results and use them to study the squashed S 5 case.
Let us start by reviewing the known results on R 2 1 × R 2 2 × S 1 R in the NS limit. The partition function, as well as the vacuum expectation value of a supersymmetric Wilson loop in a fixed representation of the gauge group wrapping S 1 R , can be obtained in terms of equivariant characters for the action of global symmetries on the vector spaces entering the ADHM construction of the instanton moduli space. More details on the computation can be found for example in [47,48,62]; here we will just collect the final result. In particular for SU (2) the NS limit of the Wilson loop in the fundamental representation reads where this time q = e 2πR 1 , µ = e 2πRa , Q 5d = e −8π 2 R/g 2 5d . An alternative way to obtain (3.39) could be to consider the NS limit of a particular line defect introduced in [72,73], which is also known as qq-character X (w) in [74][75][76][77][78]: in fact this is defined as the generating function of Wilson loops in the Λ k antisymmetric representations in the case of an SU (N ) theory Since the NS limit of the Wilson loops in the antisymmetric representations coincide with the eigenvalues of the relativistic Toda chain, in the same limit X N (w) N S is nothing else but our generating function for the eigenvalues t N (w) (2.6). The techniques to evaluate the qq-character via 1d gauged quantum mechanics can be found in [79]. In our SU (2) case this simply gives (in the NS limit) with W SU (2) N S as in (3.39).
The computation of Z 5d,(ρ) , i.e. the SU (N ) partition function in presence of a monodromy defect, is slightly more involved and requires an orbifolding modification of the computation for Z 5d as described in [80,81]; technical details for the case at hand can again be found in [47,48,62]. The final result will be a series expansion in powers of the parameters where the monodromy parameters (m 1 , . . . , m r ) have been introduced in (2.25). As summarized in Table 1, we are interested in full defects for which n j = 1, j = 1, . . . , N ρ = (1 N ) ; in this case (in the NS limit) When the gauge group is SU (2) this reduces to where Z (1) 3d,1l basically coincides with (3.14) modulo prefactors 17 and Here z = z 1 in (3.42). The second defect partition function Z (2) 3d,1l Z (2) 3d/5d can obtained from the above one by exchanging µ ↔ µ −1 . As we can easily see, (3.45) reduces to the k = 0 parameterization of (3.15) in the Q 5d → 0 limit as expected.
As noticed in [47,48], order by order in Q 5d the SU (2) defect partition function Z 3d/5d is an eigenfunction for the relativistic 2-particle closed Toda Hamiltonian in the parameterization we have (3.48) or equivalently where z = e −2πRξ , p z = e − 1 ∂ ξ and p z acts as p z z = qz. The parameters are identified as in Table 4, where we can see that the 5d instanton counting parameter Q 5d corresponds to the auxiliary parameter Q for the closed relativistic Toda chain introduced in Section 2.1. By redefining z → −z we arrive at the finite-difference operator associated to local F 0 considered in [23]; this operator has been shown in [82,83] to be self-adjoint on L 2 (R) and with a discrete spectrum, and with inverse of trace class. Nevertheless we know that the defect partition function on R 2 1 × R 2 × S 1 R cannot be the whole story, since similarly to what we saw in Section 3.2 also Z (i) 3d/5d has quasiconstant ambiguities, is ill-defined on the unit circle |q| = 1 and has poles for −iR 1 = r/s 17 The partition function Z N S 5d,(1 N ),σ in principle also contains a five dimensional perturbative contribution, but this simplifies when taking the VEV (i.e. when dividing by the five dimensional partition function). Table 4 with r, s ∈ N. We already discussed many times how to fix these problems: we have to require the true eigenfunction to simultaneously be an eigenfunction of the dual closed Toda Hamiltonian with dual eigenvalue W SU (2) N S , i.e. (3.39) written in terms of tilded variables. Tilded variables are obtained by exchanging ω 1 ↔ ω 2 at the level of Toda system; looking at Table 4, this corresponds to map R ↔ 1 −i 1 on the gauge theory side. In gauge theoretical terms, considering the full modular double Toda system corresponds to place our theory on the ω 3 → 0 limit of the squashed S 5 as discussed in Section 2.4; this will produce the required completion of the monodromy defect partition function on flat space. Therefore we conclude that, similarly to (3.13) and along the lines of the proposal reviewed in Section 2.4, the function is the proper eigenfunction of the modular double Toda system. Along the unit circle |q| = | q| = 1 the story goes as we said in Section 3.2. As discussed in [45], convergence properties and cancellation of poles in the limit Im(ω 1 /ω 2 ) → 0 are most easily seen if we rewrite (3.50) in terms of open topological strings, thanks to which we can also understand how to perform the analytic continuation In this form the poles cancel almost tautologically, modulo properly taking into account the effect of the B-field on the Kahler parameters of the local Calabi-Yau geometry when necessary (for our local F 0 case the B-field can be chosen to be zero). We will postpone the open topological string analysis to Section 3.7.

Closed bispectral dual Toda (quantized spectral curve)
Let us now turn to the problem of the quantization of the spectral curve for the closed Toda system in the parameterization (2.8), that is or equivalently As we already noticed, this is nothing but the bispectral dual system to (3.51). We already saw in Section 3.3 that the eigenfunction of the system (3.54) in the Q = 0 limit is given by the partition function on the squashed three-sphere of a pair of free chiral multiplets ( Figure 5 right): In gauge theory, we can obtain the eigenfunction at Q = 0 as a series expansion in Q by coupling these two free chiral multiplets (which have a SU (2) a ×U (1) x flavour symmetry) to the 5d bulk SU (2) gauge group and compute the 5d instanton partition function Z 3d/5d (x; a) in the presence of this new codimension two defect [47,48]. This is equivalent to weakly gauge the SU (2) flavour symmetry of the two chiral multiplets. Again, this computation can be performed in terms of equivariant characters for vector spaces entering a properly modified ADHM construction, or equivalently in terms of 1d quiver quantum mechanics; we remind to [47,48] for more details and to Appendix C for the formulae we used. The final result reads with w = e 2πx/ω 2 and x equivariant mass parameter for the U (1) x flavour symmetry. Here we only wrote down the first term in the expansion: higher order terms can be easily computed but are just too complicated to be written down. Following the same arguments we presented already many times in this paper, and with the same caveats, we conclude that the non-perturbatively corrected eigenfunction of the system (3.54) is given by Cancellation of poles will be analysed in Section 3.7. We already discussed in Section 3.3 how the Q = 0 limit of (3.57) reduces to the Q = 0 limit of (3.50) after a Fourier transformation: in fact this is the expected behaviour for a wave-function under a canonical change of coordinates. At the level of gauge theory, this is the expected action of type IIB S duality. More can and has been done in the literature: in particular, in [47] the authors were able to show that the S 4 × S 1 index (as well as the "hemisphere index") of the 5d SU (2) theory in the presence of two 3d free chiral multiplets reduces to the one of the 5d SU (2) theory in the presence of the 3d (simple) defect given by Figure 3 after a Fourier transformation, which in gauge theory language corresponds to the action of S duality in type IIB strings. Although we will not check it explicitly, this motivates us to believe that the same thing will also happen in our squashed S 5 case (for ω 1 = ω 2 purely imaginary this is essentially the S 4 × S 1 check of [47]); this would be in line with the discussion in [84]. Nevertheless, we will have an almost explicit check of this statement in Section 3.7.

Comparison with exact spectrum from topological strings
Let us now stop for a moment and clarify better why in the gauge theory literature on 5d Bethe/Gauge correspondence the need for a non-perturbative completion of the flat space results was not noticed or not felt as important.
It is easy to show that the gauge theory results for the eigenvalues of the Toda system coincide with the exact ones obtained in [16,23] "off-shell", i.e. before imposing the quantization condition (2.28). First of all, remember that our eigenvalue is given by the Wilson loop (3.39) and is well-defined even when |q| = 1, differently from what happens for the eigenfunctions. If we expand the Wilson loop (3.39) around µ = e 2πa/ω 2 → ∞ we remain with W SU (2) N S = µ 1/2 + (1 + Q 5d ) µ −1/2 + Q 5d q −1 + 1 + q µ −3/2 In the open Toda case (Q 5d = 0) this simply reduces to as expected. The expansion (3.58) can be compared with the energy obtained from topological strings [16,23]. We start by considering the Calabi-Yau mirror to local F 0 which geometrically engineers our 5d N = 1 SU (2): this is described by the classical curve on the (x, p) plane, with z 1 , z 2 complex structure parameters of the geometry. By redefining coordinates and momenta we arrive at with m 0 = z 2 /z 1 and E = z −1/2 1 ; quantization of this curves leads to (3.48) with m 0 = Q 5d . If we now consider the quantum mirror map [85] (z 1 = z = E −2 , z 2 = m 0 z 1 = m 0 z and q = e i ) −t 1 = ln z 1 + Π A (z 1 , z 2 ) = ln z + 2z(1 + m 0 ) + z 2 3 + 3m 2 0 + 2m 0 (q + 4 + q −1 ) and we invert it we get, after identifying t 1 with the A-period (i.e. Q 1 = e −t 1 = e −a ) in the open Toda case (m 0 = 0). Comparison between (3.58) and (3.63) is immediate, as expected since the two objects should be the same by definition. The "on-shell" (numerical) spectrum will therefore also coincide, after the appropriate quantization conditions (2.28) are imposed. Clearly the numerical results will be wrong if one uses (2.22), i.e. if one only focuses on one copy of R 2 1 × R 2 × S 1 R instead of the whole S 5 , but since in the gauge theory literature most of the computations are done "off-shell" this problem was never really fully appreciated. Of course one could still have noticed something was missing by considering higher dimensional defects (as the eigenfunctions) or the partition function itself (i.e. the quantization conditions), since they are ill-defined for non-generic values of the Omega background parameters; nevertheless these problems do not affect much "off-shell" computations in 5d gauge theories if one sticks to generic Omega background.

NS open topological strings expansion
Let us turn again to the quantized spectral curves (3.54), and let us start by just considering the first one. The associated quantum operator is expected to have the , q = e 2πR 1 , t = e −2πR 2 and R is a representation of the symmetric group S N of N elements. In order to understand where this S N comes from and what the integers D s 1 ,s 2 R,d count, it is better to review the M-theory construction of open topological strings following [61,86]. We start from M-theory on the geometry with Y a local Calabi-Yau with isometries U (1) 1 × U (1) 2 × U (1) R . The Taub-Nut space T N is non-trivially fibered over S 1 : going around the circle, the T N coordinates (z 1 , z 2 ) are rotated according to This corresponds to the action of U (1) 1 × U (1) 2 . We can now add N M5 branes wrapping with C the z 1 plane inside T N and L a special Lagrangian 3-cycle in Y . The M5 branes partition function on this background is defined as the index ( This index is the one appearing in (3.66). There are two contributions to this index: the one coming from the light modes on the M5 branes, captured by refined Chern-Simons theory on L, and the one coming from the massive M2 branes BPS states associated to the interaction between the M5 branes. The parameters Q take into account the bulk M2 brane charges in H 2 (Y, Z), while U is the holonomy (in the representation R of S N ) of the gauge field on C × S 1 which arises from the M5 brane two-form B wrapping a non-contractible 1-cycle on L . To conclude, the integers D s 1 ,s 2 R,d count the number of BPS states of M2 branes of charge Q ∈ H 2 (Y, Z) with spin quantum numbers s 1 , s 2 and in the representation R of S N .

As we said, Z N S
top, open is expected to be the eigenfunction of the first quantum spectral curve in (3.54). We already know that this will not be enough and that also the action of the second quantum spectral curve in (3.54)  18 As usual, we can bring the second factor at the denominator by analytic continuation in q.
As we will see, this is indeed the case if we consider the NS limit t → 1 of the index (3.66), which in our case reads For convenience, we will split this free energy as according to m > 0, m = 0 or m < 0.
In order to reinterpret our gauge theory computations in terms of topological strings it is more convenient to reduce by a chain of dualities the previously discussed M-theory setting to a (p, q)-web brane system in the presence of additional D3 branes in type IIB. This is because we know from [47] how to engineer in type IIB the codimension two vortex defects we used: these come from partial Higgsing of a higher-rank theory without defects. For example the codimension two defect associated to the spectral curve (3.54) we studied in Section 3.5, i.e. a pair of chiral multiplets coupled to the SU (2) 5d group, can be obtained from partial Higgsing of the (p, q)-web engineering 5d SU (3) N F = 2: partial Higgsing is obtained by fine tuning the mass parameters so that we can move a D5 brane away from the (p, q)-web, along a direction transverse to the web. This D5 brane descends from the M5 brane wrapping (3.69) in the M-theory construction. By doing so we remain with pure SU (2) with additional D3 branes engineering the defect; see Figure 6. In [47] this has been called D (1) 0,1 defect; it also appeared long before in [87], where it was named type I brane. Similarly the codimension two defect associated to the spectral curve (3.51) we studied in Section 3.3, i.e. a U (1) theory with two chiral multiplets coupled to the SU (2) 5d group, can be obtained from partial Higgsing of the (p, q)-web engineering 5d SU (2) × SU (2), this time moving away an NS5 brane from the (p, q)-web: see Figure 7. This is known as D (1) 1,0 defect in [47] and type II brane in [87]. It is now clear how to map our gauge theory results to topological strings one. If we denote as Q 1 = e −2πt 1 /ω 2 the Kahler parameter of the fibre and Q 2 = e −2πt 2 /ω 2 = m 0 Q 1 the Kahler parameter of the base of the local F 0 engineering 5d SU (2), we have the identification The remaining problem would be to properly identify the correct flat open modulus x.
Luckily, as we already noticed in Section 3.6 while comparing eigenvalues, gauge theory quantities are (almost) naturally written in terms of flat open and closed moduli; this is also a consequence of our choice of Baxter-like parameterization for the Seiberg-Witten curve. In fact if we compare with [87] we find that we only have to take into account trivial open mirror maps: for the type D 0,1 defect this is 19 x = x + a/2 (3.78) in (3.71), while for the type D 1,0 defect we have in (3.72). If we now focus on the "holomorphic" part of the left hand side of (3.71) and perform an expansion in Q 1 , Q 2 and e 2π x/ω 2 small we see that we really get an expression of the form (3.73) which we can later decompose as in (3.75); the "antiholomorphic" part behaves in the same way. Some of the invariants D s 1 m,d 1 ,d 2 for F BPS + obtained in this way are listed in Tables 5, 6 The same thing also happens when we expand the left hand side of (3.72): in this case the invariants D s 1 m,d 1 ,d 2 are the same as the (3.71) ones but with the exchange Q 1 ↔ Q 2 as expected by Fourier transform / type IIB S duality. This provides strong evidence to the claim that (3.71) and (3.72) are related by Fourier transformation. In the limit q → 1 these invariants reproduce the ones in [87] for type I and II branes respectively 20 . For generic q and type D (1) 0,1 defect we reproduce the invariants given in [45]; the type D 1,0 defect was not analysed in [45] although it seems likely this can be done with the same techniques discussed in that work. The present discussion motivates the hypothesis that open topological strings as in (3.71), (3.72) are eigenfuctions of the modular double quantized spectral curves and their bispectral duals. As discussed in [45], expressions like (3.71), (3.72) will almost tautologically be free of poles, modulo the possible issue of B-field that would shift the Kahler parameters: this is however not a problem in the present example since the B-field can be chosen to be zero for local F 0 . More in detail, consider for example the logarithm of (3.71): this will split into two parts, which we call WKB ("holomorphic") and non-perturbative ("anti-holomorphic") Q nd e 2πm n x/ω 1 (3.83) which is more properly rewritten as Q nd e 2πm n x/ω 1 (3.84) since |q| < 1 and | q −1 | < 1 when Im (ω 1 /ω 2 ) > 0. The minus sign that appears in going from (3.83) to (3.84) realizes the analytic continuation in q we mentioned many times, that is going from expressions like Z Z written in terms of q, q to expressions like Z/ Z written 20 It is not yet completely clear to us how to treat type III branes in our language, which most likely will require us to consider dyonic operators as done in [88] (based on [68,70,89]) in a similar context.
in terms of q, q −1 . Notice that the integers D s 1 m,d in the two pieces coincide: this is essential in order to prove poles cancellation. Poles may arise if ω 1 /ω 2 = r/s with r, s integers when, say, n = ks with k another integer, but they will be cancelled by contributions coming from n = kr. In fact the pole part will be Poles will therefore cancel when s 1 is integer, while if it is half-integer it is necessary to shift the Kahler parameters by a B-field; this will be the same shift required in order to cancel poles in the exact quantization condition (2.28). In our case the spins seem to be all integer, which is consistent with the fact that a B-field is not needed for local F 0 .
To sum up, we have provided some evidence to the validity of the hypothesis that our expressions for the eigenfunctions (left hand side of (3.71), (3.72)) admit another representation in terms of open topological strings, from which we concluded that our eigenfunctions are regular and free of poles at ω 1 , ω 2 real. At this point, with some expert eye one can see that, were it not for a possible (−1) n(s 1 −1) sign missing, (3.83) can be completely rewritten in terms of quantum dilogarithms: in fact Although this is somehow in contrast with what suggested in [16,23,45], we propose it is more natural to think of the sign we were missing as the B-field contribution, which here appears naturally and restores ω 1 ↔ ω 2 symmetry. This might come from a missing sign operator in the definition of index (3.70). We therefore expect our eigenfunctions can be rewritten as modulo the x-independent part of (3.81). A similar expression will be valid for the Fourier transformed wave-function. Here the primed product means we have to exclude the contributions (m, d 1 , d 2 ) = (1, 0, 0) and (m, d 1 , d 2 ) = (−1, 1, 0) since they come from the double sine functions; alternatively we can write which more immediately resembles a Chern-Simons theory (light modes on the M5) with massive BPS states corrections (heavy M2 modes). As a side remark, let us point out that (apart from its interpretation in Chern-Simons theories) (3.87) may have connections to wall crossing along the lines of [61].
Although we did not try to check this because of the computational difficulty of instanton computations, we believe that expanding our eigenfunctions in open topological strings form will produce convergent series in an expansion in Q 1 , Q 2 (instead of the asymptotic Q 5d expansion we obtain from gauge theory); this may be also seen from the relation with extended Picard-Fuchs equations (see for example [90]) or from the quantum dilogarithm representation (3.87). Finally, one should be able to reproduce the exact quantization conditions (2.28) by imposing single-valuedness of our proposed eigenfunctions. As far as we understand the techniques for doing so are not yet developed; we refer to [45] for a first step in this direction.

Comments on fully refined open topological strings
The integers listed in Tables 5, 6, 7 have been computed in [45] for the D by definition will be of the form This quantity, which is known as V (X) in [23,85], is actually pretty easy to compute starting from the quantization of the curve (3.60) as an expansion in z 1 , z 2 and then inverting the quantum mirror map. Developing this idea further, one could do more. This same quantity is known as the NS limit of Y(x) in the qq-character literature [74][75][76][77][78] and can be computed in gauge theory in terms of a series expansion in Q 5d . Actually one can compute Y(x) for generic 1 , 2 [76]; this is still expected to be a ratio of the sort Although this more general Q a has not a good definition yet 21 , Y(x) has and can be evaluated: see for example [79] for more details. Now, since the fully refined open topological string partition function will involve the expression after taking into account the open mirror map. We will only take this as an observation, since the relation (3.91) for t generic is still under study. It would be interesting to come back to this point in the future.

Comments
Let us sum up the main points discussed in this paper. We saw that eigenfunctions of relativistic quantum mechanical operators such as Toda chains can be thought of as 5d partition functions in the presence of various 3d defect theories; three classes of 3d theories are of special importance to us: In the special SU (2) case full and simple monodromy defects coincide. Although formally the 5d partition function on flat space R 2 1 × R 2 × S 1 R with a defect living on R 2 1 × S 1 R is an eigenfunction for the corresponding quantum operator when is complex (in which case the quantum operator is however not self-adjoint and the eigenfunction, as a series in Q 5d , is not convergent), it has various problems: for example it suffers from quasi-constant ambiguities, and it is ill-defined and presents poles for real. These problems can be solved if one considers placing the 5d theory on the squashed S 5 ω 1 ,ω 2 ,ω 3 sphere in a particular limit (ω 3 → 0); the 3d defect theory will now wrap a squashed three-sphere S 3 ω 1 ,ω 2 inside S 5 ω 1 ,ω 2 ,0 . By doing so we naturally reproduce the modular double structure of the relativistic Toda system proposed in [34], which seems to be a general property of relativistic quantum operators probably due to their relation to representation theory of quantum groups. The modular double structure doubles the equations our eigenfunctions have to 21 Work in progress by N.Nekrasov will clarify the role of this observables in gauge theory. satisfy, thus fixing the quasi-constant ambiguity, and gives exact quantization conditions which take into account the contribution of quantum mechanical instantons; moreover it allows us to consider self-adjoint operators even for complex. Once written in open topological string form, it is easy to perform analytic continuations in the ω i 's and see that these non-perturbatively complete eigenfunctions coming from S 5 ω 1 ,ω 2 ,0 no longer have poles for real once the appropriate B-field is taken into account; convergence properties are also improved in this form. In this paper we used both the gauge theory formalism, in which we know how to treat defects of various codimension and which are computationally easier since they involve a single expansion parameter Q 5d and do not require mirror maps inversion, and the topological string formalism in which all quantities are better defined. It would be interesting to understand if the topological string formalism is enough by itself: however we should first clarify how to compute eigenfunctions in this setting; we hope this work will turn out to be helpful to this scope. On this point it could be important to remember the Higgsing construction of our 3d defects reviewed in Section 3.7, which is basically telling us that the eigenfunctions of interest (open topological strings) may be recovered from closed topological strings on a bigger local Calabi-Yau three-fold: since [16,23] already provide a good non-perturbative completion of closed topological strings, this idea could be a good direction to follow. A similar idea also appeared in [91] in the context of Wilson loop computations for ABJ theory: as far as we understand the claim there is that ABJ Wilson loops, related to open topological strings on local F 0 , can be recovered from closed topological strings on the same local F 0 . It would be very interesting to understand the meaning of this claim on the gauge theory side. Understanding the Fermi gas approach to [16,23] in gauge theory context would also be very interesting. At the moment there is little we can say. The most promising approach would be the free fermion representation of the spectral determinant (as well as of ABJM Wilson loops) [91,92]: the same gl(∞) algebra structure has in fact been noticed in topological strings context [85,93,94] (I-brane systems), in gauge theory context [13] (dual instanton partition function), equivariant quantum cohomology of moduli space of torsion free sheaves on CP 2 [95] and in many other related settings. A hint on how to proceed may be obtained by considering the four-dimensional limit, in which the same structure also appears and is strictly related to Painlevé (or tt * ) equations. The story goes as follows: Painlevé equations arise as isomonodromy condition of a system of linear ordinary differential equations or, equivalently, as flatness condition of a particular connection (in gauge theory terms, this is related to the tt * connection of the Hitchin system associated to a four dimensional theory; see for example [96] for a discussion on the relation between gauge theory and Painlevé equations). The solution of this system of linear ODE admits an expression as a correlator of a c = 1 CFT of fermions and "monodromy fields" [97] which via Weyl's theorem can be rewritten in terms of Fredholm determinants and Fredholm minors [98] (see also [99]). This has been studied in more detail in [100,101] in the particular case of Painlevé P III 3 , which is related to four dimensional N = 2 pure SU (2) theory; these results have later been used in [102] to give a proof of the conjecture of [23] in a particular limit (the "four dimensional" limit). Proving the conjecture in full generality would require a modification of this line of reasoning which probably would imply some relation between finite-difference Painlevé equations and q−Virasoro correlators; unfortunately both subjects are not yet well defined nor understood. Finally, it would also be important to have a good non-perturbative completion of gauge theory and topological strings with both 1 and 2 turned on: this is required if one wants to study time-dependent relativistic quantum mechanical systems. Clearly the squashed S 5 with ω 3 > 0 seems a good direction to follow, but a careful analysis has yet to be performed. as well as We also introduce the double sine function s ω 1 ,ω 2 (x), which is defined as the regularization of the infinite product The double sine is related to the quantum dilogarithm as and therefore satisfies s ω 1 ,ω 2 (x)s ω 1 ,ω 2 (−x) = 1 (A. 10) and admits the infinite product representation when Im (ω 1 /ω 2 ) > 0. The double sine also satisfies and similar relations with ω 1 ↔ ω 2 . In the main part of this note we often use the slightly more compact notation

B Appendix B -Tables
In this Appendix we list the integers D s 1 m,d 1 ,d 2 discussed in Section 3.7. The number inside the parenthesis indicates the spin (s 1 ).

C Appendix C -Instanton partition functions with defects
As shown in [47,48], the instanton part of the partition function for a 5d N = 1 U (N ) theory in the presence of a codimension two defect represented by N 3d chiral fields we discussed in Sections 3.3 and 3.5, which is S-dual to a simple defect, admits the contour integral representation Written in terms of σ s = e 2πRφs , q 1 = e 2πR 1 , q 2 = e 2πR 2 , µ j = e 2πRa j , w = e 2πRx this becomes The contributing poles correspond to the usual Young tableau coming only from the Z 5d k part: for example for SU (2) at lowest k they are • k = 1: poles at σ 1 = µ 1 √ q 1 q 2 / σ 1 = µ 2 √ q 1 q 2 • k = 2: poles at σ 1 = µ 1 √ q 1 q 2 , σ 2 = µ 1 This coincides with the residue prescription in [76] if we reduce to the 4d limit. The 1-loop part will just be given by with N j=1 a j = 0. These are the formulae that produce expression (3.57) in the main text.
One could also consider 3d anti-chiral multiplets, which corresponds to changing x into −x; in this case we have to identify w = e −2πRx , the 1-loop part becomes Z 3d (x) = N j=1 S 2 (−x − a j |ω 1 , ω 2 ) (C. 9) and (C.5) receives other contributions coming from poles of Z 1d k piece, in addition to the poles corresponding to Young tableaux; for SU (2) at lowest k they are This is the residue prescription given in [47,48].

D Appendix D -Comments on N -particle Toda
In this Appendix we will give a few comments on the general relativistic N -particle open and closed modular double Toda chain; in particular we want to point out how, in the open Toda case, the eigenfunction of the quantum spectral curve that appears in Sklyanin separation of variables [34] coincides with the one given by gauge theory 22 . We could choose many different parameterizations for the quantized mirror curves; let us stick for definiteness to the Baxter-like form (2.10), that is The notation is the following: ψ(x 1 , . . . , x N |γ 1 , . . . , γ N ) depends on N coordinate variables (x 1 , . . . , x N ) and N auxiliary variables (γ 1 , . . . , γ N ) such that γ 1 + . . . + γ N = 0 when we decouple the center of mass; the eigenvalues in this case will be E 1 = µ 1 + . . . + µ N with µ i = e 2πγ i /ω 2 , and similarly for E 1 and higher order energies. The authors of [34] showed that if one starts with the solution ψ(x 1 , . . . , x N −1 |γ 1 , . . . , γ N −1 ) of the N 2 sinh π ω 1 (γ s − γ t ) · 2 sinh π ω 2 (γ s − γ t ) (D.7) is an eigenfunction of the N particle open Toda chain if the unknown integral kernel Q a ( γ) satisfies Baxter's equations with {e s } standard basis in R N . These equations can clearly be factorized and reduce to (D.1) in the limit Q = 0 for each γ s ; the solution for each factor will be given by N copies of the double sine function. In this way one can reconstruct the N particle eigenfunction ψ(x 1 , . . . , x N |γ 1 , . . . , γ N ) starting from the 1 particle one ψ(x 1 |γ 1 ) = e 2πiγ 1 x 1 /(ω 1 ω 2 ) . Separation of variables is very natural in terms of gauge theories on S 3 ω 1 ,ω 2 . We know that the simultaneous eigenfunctions of the open Toda Hamiltonians are given by the partition function on S 3 ω 1 ,ω 2 of the full monodromy defect theory (Figure 2 left). Induction procedure from N − 1 to N particles corresponds to promote the U (N − 1) flavour group to a 3d gauge group, couple it to N − 1 chiral multiplets with flavour symmetry U (N ), dress the partition function with the appropriate Chern-Simons, mixed Chern-Simons and Fayet-Iliopoulos terms, and then integrate over the previous flavour masses. The chiral multiplets with U (N ) flavour symmetry are exactly the defects giving the eigenfunction of the quantized spectral curve (Figure 5 right). Notice that their S-dual theories ( Figure 5 left) are not always well-defined: these are U (1) theories with a chiral in the fundamental representation of the flavour symmetry U (N ), which presents parity anomalies for N odd; most likely this parity anomaly is related to the necessity of introducing a B-field in the Kahler parameters when considering the closed Toda theory in order to ensure poles cancellation in the exact quantization conditions. As far as the N -particle closed Toda system is concerned, gauge theory tells us that Sklyanin separation of variables has to be completed by the operation of promoting the 3d defect theory SU (N ) flavour group to a 5d gauge group. It would be interesting to analyse this point in more detail: separation of variables in the open case allows us to study the SU (N ) defect theory by only knowing the result for the Abelian theory and the integration kernel Q a (x), so one could try to see if something similar happens also in the closed case and if this can be of some help. On the gauge theory side there is no much conceptual difference between closed N -Toda and what we already saw in the 2-particle case: the only problems correspond to having more complicated formulae and being careful with the B-field, which as we just discussed we expect to be present for N odd.