Exact relativistic Toda chain eigenfunctions from Separation of Variables and gauge theory

We provide a proposal, motivated by Separation of Variables and gauge theory arguments, for constructing exact solutions to the quantum Baxter equation associated to the $N$-particle relativistic Toda chain and test our proposal against numerical results. Quantum Mechanical non-perturbative corrections, essential in order to obtain a sensible solution, are taken into account in our gauge theory approach by considering codimension two defects on curved backgrounds (squashed $S^5$ and degenerate limits) rather than flat space; this setting also naturally incorporates exact quantization conditions and energy spectrum of the relativistic Toda chain as well as its modular dual structure.


Introduction
Apart from very special cases like the harmonic oscillator, it is often quite hard to solve a generic Quantum Mechanical system (i.e. computing eigenvalues and eigenfunctions in the appropriate Hilbert space), even if we just limit ourselves to consider systems with discrete spectrum: sometimes the solution can be found but cannot be expressed in a closed form, while some other time we simply don't know how to solve the problem with the standard tools of Quantum Mechanics. It would therefore be very interesting to develop new, more powerful tools to approach these problems. In recent years it has been realized that supersymmetric gauge theories may be thought of as a new framework to study (at least some class of) Quantum Mechanical problems [1]. The original proposal of [1] consists in considering four-dimensional gauge theories with N = 2 supersymmetry living on R 2 1 × R 2 2 , with 1 , 2 Omega background parameters regularizing the infinite volume of R 4 , in the so-called NS limit 1 = i , 2 → 0: in this limit the remaining parameter ∈ R + should be thought of as the Planck constant of some Quantum Mechanical system, while gauge theory observables will admit an interpretation in terms of various quantities of interest in the Quantum Mechanical problem such as eigenvalues or quantization conditions. Different Quantum Mechanical systems will be associated to different supersymmetric gauge theories, and this association can often be understood by matching spectral curves with Seiberg-Witten curves. It is then clear what the advantage of the gauge theory approach is: since we know how to compute gauge theory observables via supersymmetric localization, we can provide an explicit solution to the Quantum Mechanical system (although often not in closed form) once the dictionary between Quantum Mechanical quantities and gauge theories observables has been established.
Although it may be hard to prove it rigorously, the proposal by [1] can at least be checked against analytical results in those cases for which the solution to the corresponding Quantum Mechanical system is known, or against numerical results otherwise. A notable example is the N -particle Toda chain, which is in correspondence with four-dimensional pure N = 2 SU (N ) Yang-Mills. This system has been solved via a technique known as Separation of Variables in [2][3][4][5][6]; it was later shown in [7] that the Separation of Variables solution coincides with the gauge theory one proposed by [1].
Ordinary Quantum Mechanical systems are often associated to differential operators: in fact many of them can be obtained from a classical Hamiltonian H(x, p) with polynomial dependence (usually quadratic) on the momentum p, therefore canonical quantization p → −i ∂ x promotes the Hamiltonian to a differential operator H(x, −i ∂ x ). There may however be well-defined Quantum Mechanical systems, which we call "relativistic", arising from a classical Hamiltonian H(e x , e p ) with exponential dependence on the momentum p (which therefore is a periodic variable); these lead to finite-difference operators H(e x , e −i ∂x ) after canonical quantization. An interesting example is the N -particle "relativistic" Toda chain, which simply is the finite-difference version of the Toda chain mentioned above. Relativistic Quantum Mechanical systems are typically harder to solve than usual ones; in particular, differently from its "non-relativistic" (differential) counterpart, the general solution to the relativistic Toda chain is not known.
Always according to the proposal by [1], relativistic Quantum Mechanical systems may also be studied in the framework of supersymmetric gauge theory: the dictionary between Quantum Mechanical quantities and gauge theories observables should remain the same, and the only difference is that this time the gauge theory will have to be five-dimensional N = 1 and living on R 2 1 × R 2 2 × S 1 R (always in the NS limit), where R is related to the periodicity of p in an appropriate normalization. Since relativistic Quantum Mechanical systems are harder to solve than usual ones, one could hope to rely on the gauge theory approach when dealing with relativistic problems.
Unfortunately, this turns out not to be the case. In fact even if the analytic solution is not known, we can always find a numerical solution for the relativistic system of interest and compare it against the proposal by [1]: this was done in [8,9] for the relativistic Toda chain, and it was found that the energy spectrum predicted by [1] does not match with the numerical one. The mismatch is due to the fact that the gauge theory approach seems to give the exact WKB answer, but does not take into account possible non-perturbative corrections in , which turn out to be present and very important for the cases at hand; one should therefore understand how to refine the gauge theory proposal in such a way to include Quantum Mechanical instantons.
A more refined proposal, which seems to correctly include these non-perturbative corrections since it matches with numerical results, was put forward in [8] for the 2-particle relativistic Toda chain (as well as for other relativistic systems, see also subsequent works [10,11]), at least for what quantization conditions and energy spectrum are concerned. Differently from the original suggestion by [1], this refined proposal implies that we shouldn't simply consider observables of five-dimensional gauge theories on flat space but we should work with a full, non-perturbatively complete theory of topological strings; quite remarkably, the prescription of [8] also seems to agree with results in resurgence theory [12].
Another proposal which seems to properly take into account these non-perturbative corrections for the 2-particle case, again at the level of quantization conditions and energy spectrum, was given in [13]. The basic idea of [13] is to add an appropriate term to the "naive" quantization conditions one would get from [1] in such a way that the total, exact quantization conditions will be invariant under the exchange ↔ 4π 2 / (sometimes referred to as "S-duality"); this symmetry is particularly nice since it naturally fits with the modular duality property of relativistic systems. This second proposal was later extended to the general N -particle relativistic Toda chain in [9], where it was also checked that it gives an energy spectrum matching the numerical one (at least for the 3-particle case), and to other cluster integrable systems in [14]. Remarkably, although very different in spirit (and in formulae), the two proposals by [8] and [13], [9] are compatible and can be related to each other as shown in [15,16], at least for a large class of relativistic Quantum Mechanical systems.
Despite having two precise (and related) proposals for determining exact quantization conditions and energy spectrum of many relativistic Quantum Mechanical systems, and in particular of the relativistic Toda chain, a complete solution would also require knowing the eigenfunctions for the system. Not much is known about these eigenfunctions. For what the relativistic Toda chain is concerned, the general analysis of [17] in the Separation of Variables formalism reduces the problem of finding the relativistic Toda eigenfunctions to the problem of finding an appropriate solution to the Baxter equation associated to the system; however, it is not known how to find this solution to the Baxter equation. More recent works studying the eigenfunction problem for the 2-particle relativistic Toda chain (at least in some limit) are [18,19]; their approach is quite different from the one of [17], and in particular in [18] it is proposed to construct the eigenfunction in terms of a nonperturbatively complete theory of open topological strings, much in the spirit of [8] (as such, the proposal by [18] is actually more general and can be used to construct eigenfunctions of quantum mirror curves for all toric geometries). Nevertheless, a general construction for the relativistic Toda eigenfunctions is still lacking, either in the standard Quantum Mechanical approach or in a (refined) gauge theory/string theory approach.
In this work we will provide a gauge theory proposal for constructing the solution to the Baxter equation associated to the relativistic Toda chain, out of which the relativistic Toda eigenfunctions can be obtained via Separation of Variables. The idea is to start from the "naive" Baxter solution one would get from [1] and modify it by an appropriate term chosen is such a way that the final Baxter solution will be invariant under "S-duality" (i.e. ↔ 4π 2 / ), much like what done in [13] for the quantization conditions and as natural from the modular duality property of the relativistic Toda chain. A similar idea was considered in [20,21], but the results there are incomplete; here instead we will check our proposal against numerical results and find good agreement.
Our proposal, partially motivated by the work [22] and subsequent observations in [23], can be thought of as a refinement of the original one by [1] in which, instead of considering the NS limit of five-dimensional N = 1 gauge theories on the flat background R 2 1 × R 2 2 × S 1 R , we study the "NS limit" of the same theories but on the curved, squashed five-sphere background S 5 ω 1 ,ω 2 ,ω 3 with ω i squashing parameters (or some other background with the same "NS limit"). Exact quantization conditions, exact spectrum, exact eigenfunctions, "S-duality" symmetry, and the modular double structure of the relativistic Toda chain seem to be naturally unified in this framework; however it is not clear to us why this should be so, therefore at the moment considering gauge theories on S 5 ω 1 ,ω 2 ,ω 3 should mostly be regarded as a computational tool. This paper is organized as follows. Section 2 is dedicated to the ("non-relativistic") N -particle Toda chain, whose solution (eigenvalues and eigenfunctions) is known: after reminding the definition of the system (Section 2.1), we will review its solution both in the Separation of Variables framework (Section 2.2) and in the gauge theory framework of [1] (Section 2.3). Additional comments are collected in Section 2.4. Although pretty much everything is already known, the concepts and ideas reviewed in Section 2 will be useful in order to understand how to approach the relativistic case.
In Section 3 instead we will analyse the relativistic N -particle Toda chain. We will first recall its definition (Section 3.1) and study its solution via numerical methods (Section 3.2). We will then move to discuss how an analytic solution for this system can be constructed by considering gauge theories on S 5 ω 1 ,ω 2 ,ω 3 , especially for the 2-particle case: after recovering the exact quantization conditions of [13] and energy spectrum in our framework (Section 3.3), we will state our proposal for the solution to the Baxter equation and compare it against numerical results (Section 3.4). A number of remarks are discussed in Section 3.5. We conclude Section 3 with a discussion on the general N -particle case, where we provide some additional explicit check against numerical results for N = 3 (Section 3.6).
Section 4 contains our conclusions and a discussion on open problems; in Appendices A and B instead we collected the relevant formulae used to compute the gauge theory observable of interest.

Toda integrable systems
In order to understand how quantum mechanical problems can be solved in terms of gauge theory quantities, we briefly revisit in this Section the case of the N -particle Toda chain. This system has extensively been studied and the solution (eigenfunctions and spectrum) is explicitly known in the integrable system literature as reviewed in Section 2.2. The gauge theory approach to solving the Toda chain has also been studied in detail and was found to coincide with the integrable system community result; this will be reviewed in Section 2.3. The main purpose of this Section is to introduce the relevant concepts and conventions that will be used in the rest of the paper, as well as to provide a guideline for how to proceed in finding the solution to the relativistic Toda chain that will be discussed in Section 3; as such there will be no new results here, apart possibly from a few comments in Section 2.4.

Quantum Toda chain (open and closed)
The quantum N -particle Toda chain is a quantum mechanical system describing N particles on a line interacting via the Hamiltonian and we imposed the boundary condition 3) The value of the parameter Q allows us to distinguish between two very different cases: • Q = 0: open Toda chain (non-confining potential, continuous spectrum); • Q > 0: closed Toda chain (confining potential, discrete spectrum).
Independently with E = (E 1 , . . . , E N ) set of eigenvalues (continuous or discrete), satisfying the appropriate boundary conditions (after decoupling the center of mass) imposed by the form of the potential: • for the open Toda chain, Ψ E ( x, ) should vanish fast enough as x k − x k+1 → ∞; • for the closed Toda chain, normalizability requires Ψ E ( x, ) ∈ L 2 (R N −1 ).
In a slightly more compact notation, by defining the generating function for the Toda Hamiltonians which satisfies the commutation relation the spectral problem (2.6) is equivalent to requiring with the appropriate boundary conditions imposed, where is the generating function of the Toda eigenvalues. The polynomial t(σ, E) also enters in the definition of the spectral curve of the classical Toda chain: this is a Riemann surface embedded in (σ, y) ∈ C × C × given by out of which one can compute the action-angle variables of the classical Toda system. Canonical quantization of the (σ, y) variables turns equation (2.11) into a quantum operator known as Baxter equation (after a small redefinition of parameters); as we will see, solutions to the Baxter equation play a key role in constructing the eigenfunctions of the Toda chain.
Since it will turn out to be more natural from the point of view of gauge theory, let us mention here that one can also re-express the polynomial t(σ, E) in terms of an auxiliary set of variables a = (a 1 , . . . , a N ) or τ = (τ 1 , . . . , τ N ) for the open and closed case respectively as where e m ( x) are elementary symmetric polynomials in the variables x and a 1 + . . . + a N = τ 1 + . . . + τ N . Since the τ m variables should reduce to the a m ones at Q = 0 we expect that τ m = a m + o(Q); more in general we will often think of τ m = τ m ( a) as functions of the a m , so that also the closed Toda eigenvalues E m = e m ( τ ( a)) will indirectly be functions of the a m 's.

Solution via Separation of Variables
Explicit solutions to both the open and closed Toda chain spectral problems (2.6) are wellknown in the integrable system literature. Historically the first step was done by Gutzwiller in [2,3], where he provided expressions for the N = 2, 3, 4-particles closed Toda chain eigenfunctions in terms of linear combinations of the open Toda chain ones and also obtained quantization conditions and spectrum for these systems. His works already contained the basic idea underlying what is today known as quantum Separation of Variables method, later developed in more detail by Sklyanin [24], see also [25]. The Separation of Variables method reduces the problem of finding eigenfunctions of the N -particle Toda chain to the problem of finding solutions of a one-dimensional Baxter equation; Gutzwiller's quantization conditions follow from certain analytic requirements on the solution to the Baxter problem. Separation of Variables has later been used in [4,5] to provide a solution to the N -particles Toda problem (both open and closed) at any N ; in this framework the Toda eigenfunctions admit an explicit expression in terms of multiple contour integrals. Finally, additional technical problems were rigorously solved in [6]. In this Section we will quickly review the general N solution by [4,5]; we will later see in Section 2.3 how this solution can be recovered in terms of gauge theory quantities.
For what the open Toda chain is concerned, it is shown in [4,5] that, in terms of the auxiliary variables a, the eigenfunction Ψ a ( x, ) for the N -particle open Toda chain with the appropriate boundary conditions can be expressed in a recursive way as starting from the eigenfunction of the 1-particle problem Ψ a 1 (x 1 ) = e ia 1 x 1 / , for an appropriate contour of integration C; it is also possible to show that (2.13) is an entire functions of the a parameters. Here µ( σ, ) is an integration measure, is sometimes referred to as the Harish-Chandra function for the open Toda chain, or wavefunction in separated variables; the function q(σ, a, ), and consequently Q( σ, a, ), formally satisfies the one-dimensional finite-difference Baxter equation for the open Toda chain (i) N q(σ + i , a, ) = t(σ, E( a))q(σ, a, ), (2.16) with t(σ, E( a))) as in the first line of (2.12).
Moving to the N -particle closed Toda chain, its eigenfunctions Ψ a ( x, , Q) can be obtained from the eigenfunctions of the (N − 1)-particle open Toda chain via an expression similar to (2.13), the only difference being in the function Q( σ, a, , Q); more precisely we have (modulo normalizations) 2 17) where this time and q(σ, τ , , Q) satisfies the one-dimensional finite-difference Baxter equation for the closed Toda chain (suppressing the implicit a dependence) with t(σ, E( τ )) as in the second line of (2.12). It is important to remark that this equation is nothing else than the quantization of the classical spectral curve (2.11) if we identify To sum up, Separation of Variables reduces the problem of finding eigenfunctions Ψ a ( x, , Q) to the closed Toda chain (2.6) to the problem of finding solutions q(σ, τ , , Q) to the Baxter equation (2.19); this is a great simplification since the Baxter equation is a 1-dimensional problem. However, q(σ, τ , , Q) cannot just be any function formally satisfying (2.19): in fact as discussed in [4,5], our expression (2.17) is a solution to the closed Toda spectral problem only if the solution q(σ, τ , , Q) to (2.19) is entire in σ and goes to zero fast enough as |σ| → ∞; among other things, these additional conditions help us fixing the quasi-constant ambiguity affecting q(σ, τ , , Q) (being a finite-difference equation, any formal solution to (2.19) is only defined modulo i -periodic functions). It turns out that these conditions are only satisfied when the auxiliary parameters a m (or equivalently τ m ) have certain special values, from which quantization of the energies E m ( τ ) follows.
More in detail, in Gutzwiller's approach to the study of entire solutions to (2.19) one first considers the half-infinite determinants K (∓) (σ, τ , , Q) given by , (2.21) from which two linearly independent entire solutions q (∓) 0 (σ, τ , , Q) can be constructed: , . (2.23) Despite being entire, these solutions do not go to zero fast enough at both σ = ±∞. To obtain the desired asymptotic behaviour, we use the fact that solutions to (2.19) are only defined up to i -periodic functions; we can then multiply q (∓) 0 (σ, τ , , Q) by an i -periodic factor which modifies the asymptotics as needed. The simplest choice is to consider which can also be written as By the analysis of [7], the zeroes of H(σ) coincide with the parameters a m we introduced earlier 3 . However step (2.24) does not come without a price: although our new functions q (∓) (σ) satisfy (2.19) and go to zero fast enough at both σ = ±∞, they are no longer entire but meromorphic since they present poles at σ = a m + i n m , n m ∈ Z. To solve this 3 The definition H(am) = 0, m = 1, . . . , N implicitly relates the am variables to the τm ones, taking into account the constraint N m=1 am = N m=1 τm. Let us also remark that because of i -periodicity, H(am + i nm) = 0 for any nm ∈ Z.
problem and construct a solution q(σ) which is both entire and with the desired asymptotic behaviour, we may consider a linear combination with ξ some constant chosen in such a way to cancel the poles, that is A necessary condition for this to be valid is that the Wronskian vanishes at σ = a m + i n m ; this is however satisfied since computation of the Wronskian shows that and σ = a m + i n m are exactly the zeroes of the Hill determinant. To sum up, the solution to the Baxter equation (2.19) of interest to us is the linear combination (2.27), which is entire and with the appropriate asymptotic behaviour provided that the constant ξ is chosen in such a way that . (2.31) It turns out that these conditions are only satisfied for particular values of a = (a 1 , . . . , a N ); as such, these are interpreted as quantization conditions for the spectrum of the closed Toda chain and were first obtained in [2,3].
Having solved the Baxter equation, from q(σ, τ ( a), , Q) we can construct Q( σ, τ ( a), , Q) according to (2.18), and with this we have all the ingredients entering in the expression for the N -particle closed Toda chain eigenfunctions (2.17); the only problem left at this point consists in performing the integrations. This can be easily done by evaluation of residues. To give an idea of the procedure, let us first consider integrating over for shortness, we can split the integral as (2.32) where the contour C + contains the poles a m + i n m for n m 0, m = 1, . . . , N while C − contains the poles a m + i n m for n m < 0. The two integrals can be computed by residues, and by using (2.28) the result can be expressed in terms of the function q (+) 0 only. Integration over other variables is performed along the same lines; the final result has the form of an infinite linear combination of (N − 1)-particle open Toda chain eigenfunctions: is the usual Vandermonde determinant and we introduced the vectors a (m) = (a 1 , . . . , a m−1 , a m+1 , . . . , a N ) and n (m) = (n 1 , . . . , n m−1 , n m+1 , . . . , n N ). More precise formulae and additional technical details on the computation and properties of the closed Toda chain eigenfunctions in the Separation of Variables formalism can be found in [4,5].

Solution via gauge theory
As mentioned in the Introduction, starting with the seminal work [1] it has been gradually understood that supersymmetric four-dimensional N = 2 gauge theories in flat space in the presence of non-trivial Omega background parameters 1 , 2 can provide an alternative framework for solving stationary quantum mechanical problems with discrete spectrum such as Toda chains. More precisely, such quantum mechanical problems are related to supersymmetric gauge theories when we consider the so-called NS limit 1 = i , 2 = 0: in this limit the second Omega background parameter is sent to zero, while the first one plays the role of the Planck constant (here and in the following we will be assuming ∈ R + ).
Different quantum mechanical systems are associated to different gauge theories: for example, for N -particle Toda chains the relevant gauge theory is pure N = 2 SU (N ) Yang-Mills, where the instanton counting parameter Q 4d = e −8π 2 /g 2 4d is identified with the parameter Q introduced in (2. 3) (open Toda chains therefore appear when the Yang-Mills coupling constant g 4d is sent to zero). A partial solution (i.e. quantization conditions and spectrum) to the Toda chain in terms of gauge theory quantities was provided in [1], while eigenfunctions were later discussed in [7] where it was also shown that gauge theory results coincide with the known solution we reviewed in Section 2.2. Here we will recall the main results of [1,7] for the case of interest, slightly reinterpreting them in a way more suitable for generalizations.

Quantization conditions and energy spectrum
Let us start by considering quantization conditions and spectrum. When applied to pure N = 2 SU (N ) Yang-Mills, the proposal of [1] provides new explicit expressions for quantization conditions and energy spectrum of the N -particle closed Toda chain; these may look very different from the ones we already know from Section 2.2, but it is actually possible to show that they are in fact equivalent [7].
More in detail, for what quantization conditions are concerned the idea is to start by considering the pure N = 2 SU (N ) gauge theory partition function on R 2 Here we divided the partition function into its perturbative part (classical + 1-loop) and instanton part, while a = (a 1 , . . . , a N ) are the vacuum expectation values of the adjoint scalar field φ in the N = 2 vector multiplet; on the Toda system side, these will be identified with the auxiliary parameters a we introduced in (2.12) (i.e. with the zeroes of the Hill determinant (2.26)). The NS limit of (2.34) is divergent, but the effective twisted superpotential W 4d ( a, 1 , Q 4d ) defined as 1 is instead finite; this can also be separated into its perturbative and instanton part as Replacing 1 = i , the proposal by [1] states that the quantization conditions for the Toda chain are equivalent to the set of supersymmetric vacua equations The equivalence between gauge theory quantization conditions (2.38) and Gutzwiller's quantization conditions (2.31) was later shown to be true in [7].
Moving to the spectrum of the Toda system, [1] suggests that the energies E m should correspond to the NS limit of the vacuum expectation value of gauge-invariant operators built out of φ, that is The proposal of [1] therefore provides a detailed prescription on how to compute the energy spectrum of the closed Toda chain by means of gauge theory quantities; as discussed in [7], this prescription is equivalent to Gutzwiller's one. Conjecturally the gauge theory prescription should also work for other quantum mechanical system, which will be associated to different gauge theories. of H 2 at level n = 0, 1, 2 for different Q, .

Numerical study
The gauge theory solution proposed by [1] can also be explicitly tested against numerical results, as done for example in [9] for the 2-particle Toda chain. In order to give a better idea on how the prescription of [1] works in practice, and also because we will need to do something similar later in Section 3, let us quickly review the numerical tests performed by [9]. Let us consider the 2-particle closed Toda chain and decouple the center of mass for simplicity; then E 1 = 0, that is a 1 = −a 2 = a. We can use the Hamiltonian H 2 of (2.5) to define the quantum mechanical problem; when the center of mass is decoupled this reduces to This is a problem defined on x ∈ R, and given the form of the potential we expect a discrete energy spectrum and L 2 (R)-normalizable eigenfunctions; we can then try to diagonalize (2.42) in terms of an orthonormal basis on L 2 (R) such as the harmonic oscillator one, given by for a harmonic oscillator of mass m and frequency ω 4 , where H k (x) are Hermite polynomials. Although for diagonalization we should in principle consider an ∞ × ∞ matrix, from a practical point of view one computes the matrix elements ψ k 1 | H 2 |ψ k 2 up to a certain order and evaluates numerically the eigenvalues of this finite matrix; the parameters m, ω can be fixed by expanding (2.42) at small x. The expectation is that the numerical eigenvalues thus obtained should approach the exact ones by increasing the size of the matrix. In the same way, one can construct numerical eigenfunctions (normalized in such a way to have norm 1) by considering eigenvectors of this finite matrix. Examples of numerical results for the energy of the ground state and the first two excited states at various values of Q and can be found in Table 1, while Figure 1 shows the corresponding eigenfunctions (symmetric with respect to x = log Q 1/2 ); for numerical computations we considered 400 × 400 matrices. Let us now try to reproduce the numerical results in Table 1 from the proposal by [1]. In order to do this we first need the twisted effective superpotential (2.36). This can be 4 Here we are considering a harmonic oscillator with Hamiltonian H = p 2 2m + 1 2 mω 2 x 2 .   easily computed from the formulas collected in Appendix A.1; we find that the instanton part is given by a series expansion in Q 4d starting as At fixed Q 4d , and energy level n 0 this equation will be solved for a particular positive real value of a which we call a (n) ; for the examples considered in Table 1, a 12-instanton computation produces the values listed in Table 2. Having determined the a (n) , all we have to do is to substitute them into the expression for the energy (2.41); this will again be a series in Q 4d starting as 5 Adding more instanton corrections to (2.47) the gauge theory results approach the numerical ones better and better, and already a 12-instanton computation reproduces the numerical results of Table 1, thus providing some evidence for the validity of the proposal by [1].  Table 2: Quantized values of a (n) at level n = 0, 1, 2 for different Q 4d , .

Eigenfunctions
Having discussed quantization conditions and energy spectrum, it now remains to understand how eigenfunctions of the Toda chain can be realized in gauge theory. Although this point was not discussed in [1], subsequent works [28][29][30] and [7] showed that these eigenfunctions should correspond to the partition function of four-dimensional pure N = 2 SU (N ) Yang-Mills in the presence of particular codimension two defects, again in the NS limit 2 → 0, 1 → i (from this point of view, local operators (2.39) associated to the eigenvalues can be thought as codimension four defects). It turns out that there are many different codimension two defects one can consider, and most of them can be realized in different ways; here we will only discuss defects which admit a realization as two-dimensional N = (2, 2) theories coupled to our four-dimensional N = 2 SU (N ) Yang-Mills theory. Three two-dimensional N = (2, 2) theories are of particular interest to us: I) The quiver theory of Figure which as we already mentioned can be thought of as a quantized version of the classical spectral curve (2.11) if σ is chosen as coordinate and y = (i) N e −pσ as conjugate momentum, that is III) The theory of N chiral (or antichiral) multiplets coupled to a U (1) gauge multiplet of Figure 2c, associated to the function q FT (σ) which can be roughly though of as a "Fourier-transformed" version of q(σ); that is, q FT (σ) will be an eigenfunction of the quantized version of the curve which is obtained from the spectral curve (2.50) via a canonical change of variables σ → p σ , p σ → −σ. For the special case N = 2, this coincides with the type I defect. In our following discussion we will mostly focus on defects of type I and II living on a disc D 1 of radius −1 = i −1 1 coupled to our four-dimensional theory on D 1 × R 2 2 , and review how the NS limit of the partition function in the presence of these defects provide expressions for the Baxter and Toda eigenfunctions equivalent to the ones discussed in Section 2.2. 6

Open Toda chains
Let us proceed step by step and start by discussing the eigenfunctions for the open Toda chain and its Baxter equation. Since this case corresponds to Q = Q 4d = 0, on the gauge theory side it means that we are decoupling the four-dimensional gauge interaction, so that we only remain with the two-dimensional theory on the defect. The partition function on the disc for type II defects, that is N free chiral/antichiral multiplets, is simply [31][32][33] where is interpreted as the inverse radius of the disc while σ and a m are twisted masses associated to the Cartan of the flavour symmetry U (1) × U (N ); going to SU (N ) by decoupling an overall U (1) factor sets the constraint N m=1 a m = 0 and corresponds to decoupling the center of mass from the point of view of the open Toda chain. As we can notice, (2.52a) is nothing else than the separated variables wavefunction q(σ, a, ) which appeared in (2.15) and therefore formally satisfies the open Toda Baxter equation (2.53) similarly, (2.52b) formally satisfies (i) −N q (ac) (σ − i , a, ) = t(σ, E( a)) q (ac) (σ, a, ).
(2.54) 6 Considering all possible vacua in R 2 1 × R 2 2 is equivalent to considering D 1 × R 2 2 , while a single vacuum in R 2 1 × R 2 2 is only a formal eigenfunction since it does not satisfy the correct asymptotic behaviour (see comments near (2.62)).
As a comment let us remark that, as in Section 2.2, these are just formal solutions since they have poles; proper solutions q (c) 0 (σ, a, ), q (ac) 0 (σ, a, ) can be obtained by removing an appropriate i -periodic factor according to (decoupling the center of mass) (2.55) For example, using the properties of the Gamma function we obtain which is free of poles being an entire function.
Moving to type I defects, their disc partition function can also be evaluated explicitly and for the quiver theory of Figure 2a consisting of chiral multiplets it is given by [31][32][33] (2.57) A similar expression can be obtained considering antichiral multiplets instead of chiral ones.
Here σ It is easy to see that (2.57) can be re-expressed in a recursive form equivalent to (2.13); recursion in gauge theory language simply means that the length N quiver theory can be obtained from the length N − 1 one by gauging the U (N − 1) flavour symmetry and coupling it to a set of N chiral multiplets.
We therefore conclude that, at least as far as open Toda chain are concerned, gauge theory and Separation of Variables give the same result; then by [4,5] we know that (2.57) is the correct eigenfunction of the open Toda chain with the proper asymptotic behaviour. To consider an example, the eigenfunction of the 2-particle open Toda system (with center of mass decoupled) decreases very fast at x → ∞ while it oscillates at x < 0 as we can see from Figure 3.
Considering antichiral multiplets instead of chiral, we would have obtained which is an eigenfunction of with behaviour at x = ±∞ opposite to the one of (2.58). Let us remark that Ψ a ( x, )) are related to q (c) (σ, a, ) (or q (ac) (σ, a, )) in (2.52) by Separation of Variables as discussed in Section 2.2. Notice also that (2.58) (and similarly its antichiral analogue), when interpreted as a partition function on the disc D 1 , is equivalent to the sum over all vacua of the vortex partition function (i.e. partition function on R 2 1 ) of the two-dimensional theory as as can be seen by performing the integration; both terms in this sum formally satisfy (2.59), but separately they do not have the correct asymptotic behaviour and only their combination is a proper eigenfunction (see also footnote 6).

Closed Toda chains
We can now proceed to discuss the eigenfunctions for the closed Toda chain. In this case Q = Q 4d > 0; our two-dimensional theories are then coupled to the four-dimensional one and we therefore expect instanton corrections to the previous expressions given by series in powers of Q 4d .
Let us focus here on defects of type II, i.e. N free chiral/antichiral multiplets; the partition function of this 2d-4d coupled system will be where q (c) (σ, a, ) and q (ac) (σ, a, ) are the ones in (2.52), the factor Q − iσ 4d is introduced for later convenience, are q (c),NS inst (σ, a, , Q 4d ) and q (ac),NS inst (σ, a, , Q 4d ) are the NS limit of the instanton corrections coming from coupling to the four-dimensional gauge theory. These corrections can be computed by using the contour integral formulae (A.7), (A.8) in Appendix A.1 according to will be given by linear combinations only for particular values of the a m parameters determined by (2.31), or equivalently by (2.38) in gauge theory language [7]. We have therefore recovered the known solution of the Baxter equation for the closed Toda chain in terms of gauge theory quantities. 7 Let us study in detail an example and consider the 2-particle closed Toda chain with center of mass decoupled (i.e. a 1 = −a 2 = a). In this case the Baxter equation reads Our gauge theory solution will in general not be normalized to 1 since we were not able to find the correct normalization factor from gauge theory arguments. with E 2 (a, , Q 4d ) as computed in (2.47). This Baxter equation can also be written as and can be thought as the quantized version of the classical Hamiltonian which is the Fourier-transform of the 2-particle Toda Hamiltonian H 2 This is only true for the 2-particle Toda chain, since as we mentioned earlier in this case type III defects coincide with type I ones. The (not normalized) solution to the Baxter equation (2.68) will be a linear combination where, from the formulae in Appendix A.1, This linear combination will be an entire function of σ only for a satisfying the quantization condition (2.46) and ξ determined by (2.31); for the values of a (n) in Table 2 we find ξ = −(−1) n . On the other hand, singularities do not disappear when a = a (n) , as shown for example in Figure 4. In order to check these claims (which were however proven in [7]), we can compare the gauge theory solution with numerical results; to do this it is actually more convenient to consider the rescaled function  which satisfies the more symmetric problem Numerical eigenvalues and eigenfunctions for the quantum problem (2.74) can be determined with the procedure described in Section 2.3.2. Numerical eigenvalues are the same as the H 2 ones (Table 1), as expected since the two problems are related by a Fourier transformation; numerical eigenfunctions (normalized to 1) are however different and are shown in Figure 5a and 6a (blue). The gauge theory solution (2.73) to the Baxter equation, computed up to 6-instantons and evaluated at the values of a (n) in Table 2, is instead shown in Figure 5b and 6b (orange) where we plotted Re[ q(σ)], Im[ q(σ)], Re[ q(σ)] for n = 0, 1, 2 respectively, the other imaginary/real/imaginary component being identically zero. 8 As we can see, numerical and gauge theory results seem to agree well and are hard to distinguish by the naked eye; moreover, the singularities at σ = ±a (n) of the gauge theory results seem    to disappear already at 6-instantons. This is however an artifact, since singularities are only expected to disappear when considering all instanton contributions: in fact some of them are visible in Figure 5c and 6c (red) which show the difference between numerical and gauge theory results, while when they are not visible we just need to "zoom" more near the singular point. What really happens is that divergences tend to close when we add more and more instanton corrections: an example of this behaviour for the level n = 1 solution Figure 7, where we can see how the singularity becomes less pronounced when moving from 4-instanton formulae (left) to 6-instanton formulae (right).
Having determined the solution to the N -particle Baxter equation, we can now compute the (not normalized) common eigenfunctions Ψ a ( x, , Q 4d ) of the N -particle closed Toda Hamiltonians in terms of the eigenfunctions of the (N − 1)-particle open Toda chain by using formula (2.17) obtained from Separation of Variables, as reviewed in Section 2.2. For the 2-particle case (2.17) reduces to where e ixσ is the 1-particle open Toda eigenfunction and q(σ, a, , Q 4d ) is as given in (2.71); when a = a (n) satisfies the quantization conditions (2.38) (and therefore q(σ, a, , Q 4d ) is entire) this satisfies always with E 2 (a, , Q 4d ) as in (2.47). The integral can be explicitly evaluated as explained in Section 2.2. As shown in Figure 8, at generic a = a (n) this expression does not correspond to a true eigenfunction since it does not go to zero at both x → ±∞ but oscillates in one direction. On the other hand, for the values of a = a (n) in Table 2 we obtain the eigenfunctions shown in Figure 9b and 10b, where again we divided gauge theory results by their norms in order to perform comparison. The difference between numerical and gauge theory results is shown in Figure 9c and 10c; as we can see the difference is very small already for gauge theory expressions evaluated up to 6-instantons.

Comments
In Section 2.3 we reviewed how the NS limit of various quantities one can compute in the four-dimensional pure N = 2 SU (N ) gauge theory admit an interpretation in terms of the N -particle quantum Toda chain, and we performed some check against numerical results for the N = 2 case. In particular we discussed how the disc partition function of the twodimensional N = (2, 2) theories corresponding to defects of type II and I precisely coincide with the eigenfunctions of the open Toda chain Baxter equation or with the eigenfunctions of the open Toda chain Hamiltonians as computed in [4,5] via Separation of Variables. Similarly, the partition function of the two-dimensional type II theory coupled to the fourdimensional SU (N ) gauge theory provides a solution to the closed Toda chain Baxter equation (that is, the operator arising from quantizing the spectral/Seiberg-Witten curve) which is the same as the one found in [2][3][4][5] as already discussed in [7]; from this solution to the Baxter equation we can then construct eigenfunctions for the closed Toda chain Hamiltonians via Separation of Variables.
There are a few comments we would like to make before closing this Section.
(c) Difference Figure 10: Level n = 0, 1, 2 2-particle Toda eigenfunction Ψ a (x) at Q = 1 • The first comment regards the eigenfunction Ψ a ( x, , Q 4d ) of the closed Toda chain Hamiltonians H m . In Section 2.2 and 2.3 we computed this eigenfunction via Separation of Variables, but this is actually not the most natural way to proceed in gauge theory: the gauge theory prescription would rather involve the computation of the NS limit Z (I),NS 2d/4d ( x, a, , Q 4d ) of the partition function of the two-dimensional type I theory coupled to the four-dimensional SU (N ) gauge theory. Contour integral formulae for the instanton corrections to the partition function of this 2d-4d coupled system are given by (A.14), (A.15) in Appendix A.1; the perturbative part is instead given by (2.58). In the 2-particle Toda case, this would lead to This expression is nothing else but the 2-particle open Toda chain eigenfunction (2.62) in which we replaced the vortex partition function by the NS limit of the instantonvortex partition function of the 2d type I theory coupled to the 4d theory (A.14). Both the first and second line of (2.77) independently satisfy (2.76) formally for any a, in constrast to the expression (2.75) arising from Separation of Variables which is a solution only for a = a (n) . Nevertheless it is expected that only when we consider first and second line together, and only when evaluated at the values of a = a (n) satisfying the quantization condition (2.46), they provide a proper eigenfunction of the Toda Hamiltonian with the correct L 2 (R) asymptotic behaviour. Therefore we expect that the two expressions (2.75) and (2.77), although different for generic values of a, will coincide for a = a (n) satisfying the quantization condition (mainly due to (2.28)).
Unfortunately we were not able to show this equality even at the numerical level, mainly because of the difficulty in calculating a sufficiently large number of terms for the series Z (I),NS 2d/4d ( x, a, , Q 4d ); however it should be possible to prove it analytically by using the results of [34].
• The second comment concerns the quantization condition (2.38), and in particular the one for the SU (2) theory (2.46). Instead of the NS limit, let us now consider the unrefined limit 1 = − 2 = i of the pure N = 2 SU (2) partition function: In this limit the perturbative part reduces to a product of exponential terms and Barnes G-functions, so we can rewrite Z unref 4d (a, , Q 4d ) as We can now consider the Zak transformof Z unref 4d (a, , Q 4d ), also known as dual partition function [27]: This object has received much attention recently due to its relation to the theory of Painlevé equations: in fact it has been shown in [35][36][37][38] that τ (a, , Q 4d , η) is the short-distance (i.e. small Q 4d ) expansion of the τ -function associated to the Painlevé III 3 equation. This means that (2.80) is a solution to a non-linear ordinary differential equation in Q 4d , the τ -PIII 3 equation; the parameters a and η are two integration constants/initial values for this equation, while can be considered as an overall scale which can be reabsorbed in the definition of the other parameters. From the point of view of gauge theory the interpretation of η is not completely clear; however based on [27] and on the analysis of the similar PVI case (associated to four-dimensional N = 2 SU (2) N F = 4 super-QCD) performed in [39][40][41] we expect η to coincide with the a-derivative of the twisted effective superpotential W 4d (a, i , Q 4d ), which is a quantity computed in the NS limit instead of the unrefined one: If this is the case then η = 2π n when the quantization condition (2.46) is satisfied; due to periodicity, this is equivalent to setting η = 0. What is relevant to the present discussion is that (2.80) admits another interpretation when η = 0 (mod 2π ): as shown in [42] based on [43], τ (a, , Q 4d , 0) coincides with the spectral/Fredholm determinant of an ideal Fermi gas whose partition function is given by an O(2) (or polymer) matrix model; this spectral determinant can also be obtained by taking a particular 4d limit of the spectral determinant associated to the local F 0 toric Calabi-Yau geometry which was introduced and analyzed in [8]. As such, the zeroes of τ (a, , Q 4d , 0) should contain information about the spectrum of the Fermi gas. The procedure to determine this spectrum was fully explained in [42]: by defining a = a + i 2 , the equation admits solutions for real a (n) at fixed value of , Q 4d , where n labels the n-th zero; the energy of the n-th energy level of the Fermi gas is then given by evaluated at a (n) . What does this have to do with the Toda system? Equation (2.82) defines quantization conditions for a; it turns out that the values a (n) thus determined coincide with the ones for a (n) listed in Table 2 obtained from (2.46) at same fixed , Q 4d . There exist therefore two different ways to express the same quantization conditions for the closed Toda chain from gauge theory: A) the first one is given in terms of W 4d (a, i , Q 4d ), computed in the NS limit; B) the second one is given in terms of τ (a, , Q 4d , 0) computed in the unrefined limit. This is reminescent of a similar situation occurring in five dimensions: the condition of vanishing of the spectral determinant associated to the local F 0 geometry (i.e. pure N = 1 SU (2) Yang-Mills) studied in [8], which involves the unrefined limit of the 5d partition function (+ non-perturbative corrections in ), seems to be equivalent to extremizing the twisted effective superpotential which is obtained from the NS limit of the 5d N = 1 SU (2) partition function (+ non-perturbative corrections in ) [13]. This equivalence in five dimensions has been proven in [16] by making use of the 5d blow-up equations of [44,45]; it is then natural to expect that by considering an appropriate 4d limit of [16], or by using the 4d blow-up equations of [46,47], the equivalence between four-dimensional NS and unrefined quantization conditions should follow.
Regardless of how we express them, these quantization conditions determine the discrete energy levels of two different quantum systems: the 2-particle closed Toda chain via (2.47); a Fermi gas associated to the O(2) matrix model via (2.83).
Some relation between the "off-shell" closed Toda chain energy (2.47) and the "offshell" Fermi gas energy (2.83) already appeared in the mathematical literature in the context of wild nonabelian Hodge correspondence and integrable systems associated to Hitchin moduli spaces in different complex structures (I and J respectively), see [48], [49] and references therein. In that context however (2.83) is usually interpreted not as the energy of a Fermi gas, but as the energy of the relativistic open Toda chain (the energies being identical modulo overall factors), a quantum mechanical system with continuous spectrum which will be discussed in Section 3; consequently = R −1 is not thought of as the Planck constant but as the "speed of light" of the relativistic system. Moreover, from the point of view of N = 2 gauge theories in four dimension, (2.83) is interpreted as a Wilson loop wrapping S 1 R for a 4d gauge theory placed on R 3 ×S 1 R (the most natural setting for studying Hitchin systems from a gauge theory point of view [50]). It might be worth to investigate if the usual mathematical interpretation of (2.83) being related to the relativistic open Toda chain should be kept or replaced by an interpretation in terms of Fermi gases with discrete spectrum as suggested from the results of [42].
As a final comment, let us mention that the relation between (2.47) and (2.83) might be clearer if we start from considering the relativistic closed Toda chain (or fivedimensional gauge theories) and take an appropriate limit, as already suggested in [49]; we will come back to this point in Section 3.5 after having studied in some detail this relativistic system.

Relativistic Toda integrable systems
In Section 2 we reviewed in some detail how the N -particle closed Toda chain can be solved, both via the Separation of Variables technique and via gauge theory, and we provided some numerical check of the solution. In this Section instead we will study the solution of the "relativistic" generalization of the Toda system: that is, we will consider a version of the Toda chain in which the differential operators appearing in the ("non-relativistic") Toda Hamiltonians H m (2.4) (arising from quantizing polynomials in the momenta) get replaced by appropriate finite-difference operators, which arise from quantizing exponentials of the momenta. While exact quantization conditions and spectrum for this "relativistic" system have been discussed in detail in [8,9,13], it is not yet clear how to construct proper eigenfunctions for the relativistic closed Toda chain or its Baxter equation in full generality, although various particular cases were considered in [18,19] (eigenfunctions for the relativistic open Toda chain have instead been constructed in [17]). Here we propose a solution to this problem via gauge theoretical arguments similar to the ones used in Section 2.3, appropriately modified to take into account the novel features appearing in the problem at hand; we will mainly focus on constructing solutions to the relativistic Toda Baxter equation based on analogy with the non-relativistic case, and we will check our proposed solution against numerical results.

Quantum relativistic Toda chain (open and closed)
The "relativistic" generalization of the quantum N -particle Toda chain is a quantum mechanical system of N particles on a line interacting via the Hamiltonian (in conventions similar to [17]) 9 Here x m , p m are position and momentum of the m-th particle (rescaled with respect to the ones we used in Section 2.1) and satisfy the commutation relations This Hamiltonian is self-adjoint on L 2 (R N −1 ) when the parameters ω 1 , ω 2 ∈ R + 10 ; these are related to the Planck constant and an additional parameter that can naively be thought as the "speed of light" of the relativistic system, and we defined The "non-relativistic" Toda Hamiltonians H m (2.4) are recovered from (3.1) by taking an appropriate ω 1 → 0 limit. As for the Toda chain, we impose the boundary condition to better distinguish between the open and closed chain: • Q rel = 0: open relativistic Toda chain; • Q rel > 0: closed relativistic Toda chain.
Similarly to the Toda case, relativistic open chains have a continuous spectrum while relativistic closed chains admit a discrete spectrum. Relativistic Toda chains are also integrable systems, their N commuting Hamiltonians being e ω 1 pm , (3.5) 9 We will use Hm and Em to denote Hamiltonians and energies of the relativistic Toda system in order to distinguish them from the ones of the Toda chain. 10 It is possible to define a good quantum mechanical problem also for ω1, ω2 ∈ C, ω1 = ω2 as considered for example in [19]; in this case it is often chosen for definiteness Im(ω1/ω2) > 0, i.e. |q| < 1. Taking the limit Im(ω1/ω2) → 0 from this regime leads us to the relativistic Toda chain under consideration.
with p N +1 = p 1 . Decoupling the center of mass in this case is equivalent to impose H N = 1.
Despite the many similarities with the non-relativistic Toda chain, a peculiar and very important property of the relativistic Toda chain is the existence of its modular dual version (see [17], based on [51,52]); this is defined by the set of N commuting Hamiltonians with boundary condition and where we introduced 11 The dual Hamiltonians H m are not really independent from the original ones since the two sets are related by the exchange ω 1 ↔ ω 2 ; however because of this relation the original and dual set of Hamiltonians commute with each other by construction: This means that the eigenfunctions of the relativistic Toda chain will also be eigenfunctions of the dual system; we therefore expect them to be symmetric under ω 1 ↔ ω 2 . Among other things, the existence of the modular dual system plays a key role in eliminating some of the ambiguities of the relativistic Toda chain solution: in fact differently from ordinary quantum mechanics in which eigenfunctions are solutions to a differential equation and as such are only defined modulo an overall constant, eigenfunctions of finite-difference operators like the relativistic Toda one (3.5) are only defined modulo an iω 1 -periodic function (much like the solution to the non-relativistic Toda chain Baxter equation (2.19)); this ambiguity can however be reduced to the usual overall constant normalization by requiring them to be eigenfunctions of the dual relativistic Toda operators (3.6) as well. 12 To sum up, our spectral problem in this case consists of constructing common eigenfunctions Ψ rel E, E ( x, ω 1 , ω 2 ) of the relativistic Toda Hamiltonians H m and dual Hamiltonians 11 More in general, tilded variables will always denote quantities in the modular dual system; these are related to the analogous quantities in the original model by the exchange ω1 ↔ ω2. When considering ω1, ω2 ∈ C, ω1 = ω2 the canonical choice Im(ω1/ω2) > 0 implies | q −1 | < 1. 12 Of course there may still be ambiguities given by doubly-periodic functions in iω1, iω2.
are the corresponding eigenvalues (with E N = E N = 1 after decoupling the center of mass), satisfying the appropriate boundary conditions: • for the relativistic open Toda chain, Ψ rel • for the relativistic closed Toda chain, normalizability requires Ψ rel More precise statements about the relativistic Toda spectral problem can be found in [17].
Similarly to what we did in Section 2.1, we can rewrite this spectral problem in a more compact notation: if we define and introduce the generating functions of the relativistic Hamiltonians the spectral problem (3.10) becomes where are the generating functions of the relativistic Toda and dual Toda eigenvalues. These generating functions also enter in the definition of the spectral curves of the classical relativistic Toda chain and its dual: these are Riemann surfaces embedded in (w, y) or ( w, y) ∈ C × ×C × defined by the equations Similarly to what we saw in Section 2, quantization of the spectral curves (3.16) will provide the Baxter equations associated to the relativistic Toda chain and its modular dual, whose solution will be necessary in order to construct the relativistic Toda eigenfunctions in the context of Separation of Variables. We may also re-express t rel (σ, E), t rel (σ, E), which are polynomials in w, w, in terms of auxiliary sets of variables (a 1 , . . . , a N ) or (τ 1 , . . . , τ N ) for the open and closed case respectively as The auxiliary variables a m , τ m are the same ones we used in the four-dimensional case (2.12) and are such that a 1 + . . . + a N = τ 1 + . . . + τ N ; sometimes it will be useful to write them via the combinations As in the four-dimensional case, the τ m = τ m ( a) variables can be thought as functions of the a m ones and reduce to these when Q rel , Q rel are set to zero (i.e. m 0 → ∞); therefore also the relativistic closed Toda and dual Toda eigenvalues can be thought as functions of the a m 's, and in fact this is the most natural parametrization of the spectrum if we look for a solution constructed via gauge theory.

Numerical study of spectrum and eigenfunctions
Before moving to discuss how the relativistic Toda chain can be solved in the framework of gauge theory, let us pause a moment to perform a numerical study of this system; numerical eigenvalues and eigenfunctions computed in this Section will be later used to provide some check of the validity of our proposed gauge theory solution. As explained in Section 2.3.2, numerical analysis is performed by diagonalizing the Hamiltonian H of interest in terms of some orthonormal basis in the appropriate Hilbert space; for definiteness we will choose We then compute the matrix elements ψ k 1 | H|ψ k 2 up to a certain k 1 , k 2 and evaluate numerically the eigenvalues of this finite-dimensional matrix; these eigenvalues should approach the ones of our Hamiltonian H when increasing the size of the matrix. Numerical (normalized) eigenfunctions are then obtained by looking at the eigenvectors of this matrix. In actual computations we usually consider 300 × 300 matrices and fix m and ω by expanding H. Let us show how this works in the case of a relativistic 2-particle Toda chain with center of mass decoupled (that is a 1 = −a 2 = a 2 or µ 1 = µ −1 2 = µ 1/2 ); as for the non-relativistic case, we will be interested in two different operators: • The first one is the operator associated to the Baxter equation for the system and its dual version (see (3.80) in Section 3.4), which can be obtained by quantizing the where the energies E 1 , E 1 depend on ω 1 , ω 2 , m 0 and a (a will be discretized because of the quantization conditions). The two Baxter operators are related by the exchange ω 1 ↔ ω 2 and commute with each other; the solution q(σ) ∈ L 2 (R) should then be their simultaneous eigenfunction and as such should be symmetric under ω 1 ↔ ω 2 , and is also expected to be an entire function based on the analogy with the non-relativistic chain. For numerical computations it is actually more convenient to consider the function q(σ, a, ω 1 , which is a simultaneous eigenfunction of the more symmetric equations   of (3.23) at level n = 0, 1, 2.
Expanding (3.23) and comparing with the harmonic oscillator Hamiltonian we can fix the values of m, ω, to be used in numerical computations: (3.24) Examples of numerical results for the energy and dual energy of the ground state and the first two excited states of equations (3.23) at various values of ω 1 , ω 2 , m 0 can be found in Table 3, while Figure 11, 12 show the corresponding eigenfunctions.
As we can see from the plots, already by considering 300 × 300 matrices there is a very small difference between the numerical eigenfunction obtained from diagonalizing (3.23a) and the one obtained by diagonalizing (3.23b), supporting the expectation that there should be only one common eigenfunction q(σ) symmetric under the exchange ω 1 ↔ ω 2 . 13 • The second one is the operator corresponding to the relativistic 2-particle Hamiltonian H 1 itself (3.5), together with its dual H 1 (3.6); after a redefinition of variables the spectral problem (3.10) reads energies E 1 , E 1 are the same as for the Baxter problem even for m 0 = 0. Our Ψ rel a (x, ω 1 , ω 2 , m 0 ) ∈ L 2 (R) should be a simultaneous eigenfunction of (3.25a), (3.25b) since these operators commute, and as such is expected to be symmetric under ω 1 ↔ ω 2 . For numerical computations it may be more convenient to work in terms of the variable x = x + m 0 2 which makes the problem more symmetric. The numerical spectrum obtained by diagonalizing (3.25a), (3.25b) in the harmonic oscillator basis coincides with the one in Table 3 as expected; numerical eigenfunctions (symmetric with respect to x) for the ground state and the first two excited states are as in Figure 11 in the example where m 0 = 0, while in the example with m 0 = − ln 3 2π they are plotted in Figure 13.
The N -particle problem can be approached numerically in a similar way (see [9] for the N = 3 case and [14] for a related computation concerning other finite-difference systems).

Solution via gauge theory: quantization conditions and energy spectrum
As quickly reviewed in Section 2.3, the N -particle (non-relativistic) closed Toda chain can be completely solved in terms of various observables of the four-dimensional N = 2 SU (N ) Yang-Mills theory on R 4 1 , 2 (or D 1 × R 2 2 ) in the NS limit 1 = i , 2 = 0 (with ∈ R + ).
Schematically, the dictionary between Toda chain quantities and four-dimensional gauge theory observables is as follows: Quantization conditions ⇐⇒ Extremization of W 4d ( a, i , Q 4d ) (NS limit) Energy spectrum E m ⇐⇒ Codimension 4 defects Tr φ m NS (NS limit) Baxter eigenfunction q(σ) ⇐⇒ Codimension 2 defects (type II, NS limit) Toda eigenfunction Ψ a ( x) ⇐⇒ Codimension 2 defects (type I, NS limit) It is then a natural question to ask if it is possible to find a solution for the N -particle relativistic closed Toda chain via similar gauge theory arguments. In this Section we will discuss what gauge theory can say about quantization conditions and energy spectrum, while leaving the study of the eigenfunctions to Section 3.4.

The naive proposal: five-dimensional gauge theory on flat space
A first attempt to answer this question was done in [1], where it was suggested (based on previous observations [53]) that the relativistic version of the Toda chain may have something to do with the five-dimensional uplift of the pure SU (N ) theory: more precisely, it was proposed to consider the five-dimensional N = 1 SU (N ) Yang-Mills theory on flat space R 4 1 , 2 × S 1 R in the NS limit 1 = iω 1 , 2 = 0 with ω 1 ∈ R + . The radius R = ω −1 2 ∈ R + of the extra circle will play the role of the (inverse) speed of light, so that when R → 0 we recover the Toda chain discussed in Section 2. The details of the proposal are the same as in the four-dimensional case. Let us start by fixing notations: in the following we will denote q 1 = e 2πR 1 , q 2 = e 2πR 2 , Q 5d = e −2πRm 0 , µ m = e 2πRam (m = 1, . . . , N ), (3.26) where a m are the vacuum expectation values of (the Cartan part of) the adjoint scalar field in the N = 1 vector multiplet and m 0 = 4π 2 /g 2 5d is related to the five-dimensional Yang-Mills coupling constant. We can now consider the partition function on R 4 1 , 2 × S 1 R : Sometimes it will also be useful to rewrite this partition function as where the prepotential coincides with the refined closed topological string prepotential resummed à la Gopakumar-Vafa once expanded around large Kahler parameters t m , m = 1, . . . , N given by the F 0 5d term is a cubic polynomial in a, m 0 , while the F BPS 5d term only depends on the number of BPS states N d j L ,j R of given left, right spins j L , j R of our theory and can be expressed as where we used the notation d = (d 1 , . . . , d N ) and Q = (Q 1 , . . . , Q N ) with Q i = e −2πRt i . The NS limit of the partition function can be used to define the five-dimensional version of the twisted effective superpotential W 5d ( µ, q 1 , Q 5d ) as which is also equal to the NS limit of the refined closed topological string prepotential: The twisted effective superpotential can be separated into its perturbative (classical + 1-loop) and instanton part 34) or can also be divided as where (from (3.31)) At this point if we identify and µ with the parameters appearing in (3.19), the quantization conditions for the relativistic Toda chain proposed by [1] would be equivalent to the set of supersymmetric vacua equations Finally, although not discussed in [1] we could expect from what happens in the fourdimensional case that eigenfunctions of the relativistic Toda Hamiltonians or of the associated Baxter equation should be given by the NS limit of the five-dimensional partition function in the presence of codimension two defects of type I (Figure 2a) or II (Figure 2b) we may expect the type II defect partition function with chiral multiplets to satisfy the relativistic closed Toda chain Baxter equation (see (3.80) in Section 3.4). It is sometimes useful to rewrite the type II defect partition function as where the prepotential 3d/5d (w, µ, q 1 , q 2 , Q 5d ) = F Q nd w mn , (3.45) which in the NS limit 2 → 0 reduces to where D s 1 m,d = s 2 D s 1 ,s 2 m,d . As we can see, the proposal by [1] is nothing else than the naive five-dimensional uplift of the four-dimensional gauge theory solution of the (non-relativistic) Toda chain which 14 The standard definition of the open topological string partition function does not contain the term m = 0 in the sum, which is a constant in σ (or w); we will however include this constant term since it naturally appears from gauge theory formulae.
we reviewed in Section 2.3, and reduces to it in the limit R → 0 15 . However, it turns out that this naive proposal is incorrect, or at least incomplete. For example, as shown in [8] the "naive" quantization conditions (3.39) cannot be the correct ones: in fact it is easy to see from (3.36) that these are divergent when ω 1 , ω 2 ∈ R + with ω 1 /ω 2 ∈ Q + , and even if we use these quantization conditions for ω 1 /ω 2 irrational the energy spectrum we obtain from (3.40) does not match with numerical computation of the eigenvalues [8]. Similarly the "naive" Baxter eigenfunction (3.42), although formally satisfying the Baxter equation [30,55], cannot be the correct one since it diverges at ω 1 /ω 2 ∈ Q + ; finally, the proposal by [1] only focusses on the relativistic Toda operators H m without taking into account the existence of the modular dual operators H m [20,21]. All these problems imply that if we want to solve the relativistic closed Toda system by means of gauge theory, we should consider something more elaborated than N = 1 SU (N ) theories on R 4 1 , 2 × S 1 R in the NS limit.

Exact quantization conditions and spectrum
Exact quantization conditions for the 2-particle relativistic closed Toda chain have been proposed in [8]; these conditions arise from requiring a certain spectral determinant to vanish, and share some similarity with (2.82) (in fact they reduce to (2.82) in an appropriate four-dimensional limit [42]). This spectral determinant can be written in terms of a particular combination of both the unrefined ( 1 = − 2 = i ) and the NS limits of the five-dimensional partition function (3.27); the key property of this combination is that it involves non-perturbative (in ) contributions, i.e. terms of the form e 1/ , chosen in such a way that the resulting quantization conditions are free from divergences at ω 1 /ω 2 ∈ Q + . When substituted in (3.40) (modulo subtleties which will be discussed later), the values of a m solving these exact quantization conditions provide an energy spectrum that matches with the numerical one.
It has later been realized in [13] (and proven in [16]) that the exact quantization conditions for the 2-particle relativistic Toda chain proposed by [8] can be equivalently expressed in a different way which only involves the NS limit of the partition function (3.27); this different expression can be written as ∂ ∂a m W 0 ( a, m 0 , ω 1 , ω 2 ) + W BPS ( µ, q, Q rel ) + W BPS ( µ, q, Q rel ) = 2πin m .

(3.47)
For what the general N -particle relativistic Toda chain is concerned, exact quantization conditions in the form (3.47) and its spectrum were studied in [9] and were checked to match with numerical results for N = 3. Here the function W 0 is a cubic polynomial in a, m 0 which contains W 0 5d in (3.35) as well as some additional piece, while the function W BPS basically coincides with W BPS 5d in (3.35) modulo a correction due to the B-field, i.e. a vector B such that for all those d, j L , j R whose BPS invariant N d j L ,j R is non-zero; more precisely, with such a modification we have The B-field is therefore irrelevant for N even, while when N is odd it has the effect of changing sign Q 5d → −Q 5d , Q 5d → − Q 5d in (3.36); alternatively, because of (3.48) one can think of the effect of the B-field not as changing the sign of Q 5d , Q 5d but as identifying . We can roughly think of (3.47) as the naive quantization conditions (3.39) corrected by a non-perturbative contribution which depends on tilded variables. The remarkable property of (3.47) is its S-duality symmetry, that is its invariance under the exchange ω 1 ↔ ω 2 : in fact it turns out that W 0 is invariant under this exchange, while the second and third terms in the left hand side of (3.47) are mapped into each other. S-duality tells us that perturbative (or WKB) and non-perturbative sectors contribute in the same way to the quantization conditions. S-duality also fits naturally with the existence of the modular dual relativistic Toda system, since this is related to the original relativistic Toda chain by the exchange ω 1 ↔ ω 2 and the two systems should admit a common solution.
To sum up, as we already saw happening in four dimensions (Section 2.4), also for the 2-particle relativistic Toda chain (and its dual) the quantization conditions admit two different representations: A) The one of [13], [9] given by (3.47), manifestly invariant under S-duality and written in terms of the NS limit of the five-dimensional partition function (corrected by the B-field when necessary) + non-perturbative (in ) corrections; this is the fivedimensional analogue of (2.46); B) The one of [8] (which we only mentioned), equivalent to requiring a certain spectral determinant to vanish, where this spectral determinant can be written in terms of the unrefined limit of the five-dimensional partition function + non-perturbative (in ) corrections; this is the five-dimensional analogue of (2.82).
A similar statement can be formulated for general N , although the situation in this case is slightly more involved. 16 As shown in [16] (see also [15]), these two representations are 16 The approach of [8] was extended to quantum spectral curves of higher genus in [10,11]. These works treat the quantum spectral curve as a quantum mechanical operator and not as the Baxter equation of an integrable system: for the case at hand, this implies they only provide 1 quantization condition instead of N − 1. It is however possible to recover the remaining quantization conditions, as explained in [15,16].
not independent but can be related via the five-dimensional blow-up equations of [44,45]. It might however be possible to give an alternative explanation for the compatibility of these two representations by considering hyperKahler moduli spaces of double-periodic monopoles. In fact, while four-dimensional N = 2 SU (N ) theories are theories of class S and as such they can be related to hyperKahler moduli spaces of Hitchin systems [50], fivedimensional N = 1 SU (N ) theories are instead associated to hyperKahler moduli spaces of double-periodic monopoles [56,57]. It is important to remark that, differently from the Hitchin system moduli spaces, double-periodic monopoles are self-dual under Nahm transform. Being hyperKahler, these moduli spaces admit many possible complex structures usually labelled by a parameter ζ ∈ CP 1 , and we can denote a basis of complex structures as I, J, K. As suggested in [49], relativistic closed Toda chains may appear differently according to the complex structure under consideration; based on what happens in the four-dimensional case [42,58], one would be led to associate quantization conditions in the representation A) to complex structure I and quantization conditions in the form B) to complex structure J. It would certainly be interesting to understand this point in more detail.

A more refined proposal: five-dimensional gauge theory on curved space
As we have just discussed in Section 3.3.3, there are two main differences between the naive quantization conditions (3.39) proposed by [1] and the exact quantization conditions (3.47) in the form B) (related to the ones in form A)) proposed by [13], [9]: • Naive quantization conditions are missing the non-perturbative contributions in ; • Naive quantization conditions are missing the correction due to the B-field.
Is there a way to solve these two problems in a gauge theory framework?
A possibility would be to consider five-dimensional gauge theories on curved spaces, rather than on the trivial flat background R 4 1 , 2 × S 1 R . In fact as noticed in [23] and further elaborated in [15], exact quantization conditions in the A)-form (3.47) seem to be compatible with a proposal put forward in [22]: this proposal states that the non-perturbative completion of the refined closed topological string partition function (that is, the five-dimensional partition function (3.27) for the cases of interest to us) is given by the integrand of the partition function of our gauge theory on a squashed S 5 ω 1 ,ω 2 ,ω 3 background. In an "NS-like" limit ω 3 → 0 this geometry will reduce to S 3 ω 1 ,ω 2 × R 2 , and the supersymmetric vacua equations derived from the (integrand of the) S 5 ω 1 ,ω 2 ,ω 3 partition function seem to reproduce (3.47). This interpretation naturally incorporates the symmetry ω 1 ↔ ω 2 of the exact quantization conditions in the form A), as well as of the relativistic Toda and dual Toda chain; let us however remark that there might be many five-dimensional geometries which reduce to S 3 ω 1 ,ω 2 × R 2 in some limit, and since it feels a bit unnatural to consider the integrand of a partition function instead of the partition function itself one might prefer to consider some non-compact five-dimensional geometry which could eliminate the problem of integration. Although this will be important if one wants to discuss non-perturbative completions of refined topological strings at generic values of Omega background parameters, we will not be concerned with this problem since we expect all possible different five-dimensional geometries to give the same answer when reduced to S 3 ω 1 ,ω 2 × R 2 ; therefore in the following we will always start from the integrand of the partition function on S 5 ω 1 ,ω 2 ,ω 3 , keeping in mind that this might not be the most appropriate starting point.
Apart from this caveat, let us try to see in more detail if the proposal by [22] effectively leads to (3.47) in the limit ω 3 → 0 or not; the discussion here mostly follows Appendix E of [21]. We start by considering the squashed S 5 ω 1 ,ω 2 ,ω 3 geometry; this geometry can be parametrized as and admits a U (1) 3 isometry group. Alternatively, we can think of S 5 ω 1 ,ω 2 ,ω 3 as an (S 1 ) 3 fibration over a triangle: the three vertices of the triangle correspond to the three circles S 1 (i) of radii ω −1 i , i = 1, 2, 3 fixed under the action of the U (1) 3 isometry group, while the three edges correspond to three squashed three-spheres S 3 ω i ,ω j , i = j. The partition function of N = 1 gauge theories on S 5 ω 1 ,ω 2 ,ω 3 has been discussed in [59][60][61][62][63][64][65]; in the case of a pure N = 1 SU (N ) theory without Chern-Simons term, it can schematically be written as with m 0 = 4π 2 /g 2 5d as defined in (3.37). The classical term of the integrand is given by while the one-loop part reads (|ω| = ω 1 + ω 2 + ω 3 ) where α ∈ ∆ + are the positive roots of SU (N ) and S 3 (x|ω 1 , ω 2 , ω 3 ) is the triple sine function defined in Appendix B. By making use of the properties of the triple sine function it is possible to show that the S 5 ω 1 ,ω 2 ,ω 3 one-loop term (3.54) factorizes into the product of three R 4 1 , 2 ×S 1 R one-loop terms: therefore at least for what the 1-loop terms are concerned, the (integrand of the) S 5 ω 1 ,ω 2 ,ω 3 partition function can be thought as the product of three copies of the R 4 1 , 2 × S 1 R partition function (3.27), where each copy is associated to one of the three fixed circles of the U (1) 3 action and 1 , 2 , R are identified with ω 1 , ω 2 , ω 3 differently for each of the three copies according to  Table 4: Identification S 5 ω 1 ,ω 2 ,ω 3 squashing parameters -gauge theory parameters.
term it is expected that Z inst S 5 factorizes into the product of three copies of the instanton partition function Z inst 5d ( a, 1 , 2 , R, m 0 ) on flat space where again 1 , 2 , R are identified with ω 1 , ω 2 , ω 3 differently for each of the three copies as in Table 4; however this expectation is still conjectural. 18 . Now, according to the proposal of [22] we should consider the integrand of the partition function (3.52), that is 56) It is actually more convenient to rewrite (3.56) in a slightly different form, by separating the BPS states contribution from the contribution due to classical terms; in practice we rearrange the various terms as The Z 0 S 5 part is simply (3.59) contains the S ω 1 ,ω 2 ,ω 3 functions (defined in Appendix B) coming from (3.54) together with the instanton terms (3.55). The BPS part can be more compactly written as (3.60) 18 We prefer to indicate the dependence on the gauge coupling via m0 rather than via the five-dimensional instanton counting parameter Q 5d = e −2πRm 0 since Q 5d depends on R and will therefore be different for each of the three copies.
in terms of three copies of the function (3.31), where as usual 1 , 2 , R are identified with ω 1 , ω 2 , ω 3 for each of the three copies as in Table 4. The t i parameters are the flat Kähler moduli and mass parameters used in [8,9] and correspond to linear combinations of the a i parameters and Yang-Mills coupling m 0 = 4π 2 /g 2 5d as in (3.30), that is We now want to take the "NS limit" of (3.57); what we mean by this is the following. As we saw, Z int S 5 roughly factorizes into three copies of the partition function on flat space R 4 1 , 2 × S 1 R . Let us focus for the moment on the second copy and take the NS limit here: since 2 = iω 3 in this copy, this means that we have to take the limit iω 3 → 0, and as a consequence the squashed S 5 ω 1 ,ω 2 ,ω 3 geometry reduces to S 3 ω 1 ,ω 2 × R 2 . What happens to the other copies? For what the first copy is concerned, the limit we are considering corresponds again to an NS limit because of the symmetry 1 ↔ 2 of the partition function on flat space; on the third copy instead we are sending R → ∞, which implies that F BPS 5d,(3) → 0. 19 We therefore expect the "NS limit" of (3.57) to roughly reduce to two copies of the flat space twisted effective superpotential (3.32), related by the exchange ω 1 ↔ ω 2 ; it is however important to notice that these two copies will be slightly modified with respect to (3.36) because of the non-trivial identifications in Table 4, and the modification exactly coincides with the effect of the B-field thus giving (3.49). Being more precise, in complete analogy with the definition in (3.33) we can define the twisted effective superpotential on S 5 This can be decomposed according to given in terms of the flat-space function W BPS 5d ( a, 1 , R, m 0 ) appearing in (3.35); let us however stress once more that the non-trivial identifications for the i parameters lead to the B-field corrected formula (3.49).
To sum up, from the "NS limit" of the proposal by [22] we obtain the putative quantization conditions ∂ ∂a m W S 5 ( a, ω 1 , ω 2 , m 0 ) = 2πin m , n m ∈ Z, m = 1, . . . , N. As we can see, the two problems that were affecting the naive quantization conditions (3.39) are now solved in (3.65): 19 Large-volume formulae like (3.31) are only valid for ti → ∞.
• The non-perturbative corrections (restoring S-duality) arise from a second copy of the flat space twisted effective superpotential, related to the first copy by ω 1 ↔ ω 2 , naturally incorporated in the S 3 ω 1 ,ω 2 × R 2 geometry; • The B-field is taken into account by the identification in Table 4.
Working out the explicit expressions, in particular the non-BPS term W 0 S 5 in (3.63), it is not hard to verify that (3.65) precisely coincides with the known exact quantization conditions. Let us consider for example the pure 5d N = 1 SU (2) theory; this will be associated to the 2-particle relativistic Toda chain and its dual, whose Hamiltonians can be written as (by redefining variables) By setting a 1 = −a 2 = a 2 the parameter a = a 1 − a 2 gets identified with the Kahler modulus t, while m 0 is interpreted as a mass parameter in the language of topological strings. Formula (3.65) for a 1 gives The same equation is obtained from taking the derivative with respect to a 2 . Notice that the factor (−1) (2j L +2j R +1)n coming from the identification in Table 4 exactly coincides with the effect of introducing the B-field. It is easy to check that the quantization conditions (3.67) coincide with the exact ones given in [13]; as such they are manifestly "S-dual" (i.e. invariant under the exchange ω 1 ↔ ω 2 ) and free of poles at ω 1 /ω 2 ∈ Q + .
Having obtained exact quantization conditions for the N -particle relativistic Toda chain from the partition function of N = 1 SU (N ) gauge theories on S 3 ω 1 ,ω 2 × R 2 , we can now move on to discuss how to compute its energy spectrum. As we said in (3.40), the expectation is that energies will correspond to the NS limit of Wilson loops in an appropriate  representation wrapping a circle [30,55,66]. The background S 3 ω 1 ,ω 2 × R 2 naturally admits two such circles, of radii ω 1 and ω 2 : this is because S 3 ω 1 ,ω 2 can be thought of as a non-trivial S 1 fibration over S 2 which contains two special circles at the north and south pole of S 2 . It is then natural to identify Wilson loops wrapping these two circles with the energies E m and dual energies E m of the relativistic Toda chain and its dual.
For example, in the 2-particle case we only have Wilson loops in the fundamental representation, so that 20 (3.68) These are invariant under the exchange q ↔ q −1 , q ↔ q −1 and, differently from what happens with the quantization conditions, do not present any divergence at |q| = 1, | q| = 1 since they are one-dimensional observables; moreover, they coincide with the (inverse) quantum mirror map of [8]. If we now fix the value of ω 1 , ω 2 , m 0 and substitute the solution a (n) of (3.67) for n 0 into the expressions for W , ,NS in (3.68), we should be obtaining the exact spectrum for the 2-particle quantum relativistic Toda chain and its modular dual.
A few examples of energies for different values of ω 1 , ω 2 , m 0 , obtained via a 5-instanton computation, are listed in Table 5; already at 5-instantons these can be seen to coincide with the energies in Table 3 obtained by a numerical study of the operators (3.66). Using the values of a (n) generated by the naive quantization conditions (3.39) would instead produce an energy spectrum which does not match with the numerical one.
We therefore conclude that it is possible to obtain exact quantization conditions and energy spectrum for the relativistic closed Toda chain and its modular dual while remaining in the framework of gauge theory (in the NS limit); the big difference with respect to the naive proposal (3.39) is that differently from what happens in the four-dimensional case, in five dimensions we have to consider a curved background S 3 ω 1 ,ω 2 × R 2 instead of the flat one R 2 1 × R 2 × S 1 R , thing which naturally takes into account the existence of the modular dual relativistic Toda system. As a consequence, we expect that in order to obtain exact eigenfunctions we should be considering codimension-two defects living on S 3 ω 1 ,ω 2 instead of the naive D 1 × S 1 R ; this is what we are going to verify next.

Solution via gauge theory: eigenfunctions
As we mentioned at the beginning of Section 3, while eigenfunctions for the N -particle relativistic open Toda chain have been constructed in [17], much less is known about the eigenfunctions of the relativistic closed Toda chain (or the associated Baxter equation) apart from the works [18,19]. Here we will propose a solution to this problem via gauge theory. Based on the analogy with the "non-relativistic" (or four-dimensional) case reviewed in Section 2.3.3, and from what we have seen in Section 3.3.3, the eigenfunctions we are looking for should correspond to partition functions on S 3 ω 1 ,ω 2 × R 2 (rather than flat space D 1 × R 2 × S 1 R ) of codimension two defects of type II or I wrapping S 3 ω 1 ,ω 2 coupled to the five-dimensional N = 1 SU (N ) theory. Here we mostly focus on studying the solution to the Baxter equation for the case N = 2 and compare it against the numerical results obtained in Section 3.2; in Section 3.6 we will comment on the general N case and provide some check for N = 3.

Open relativistic Toda chains
Let us start by looking for simultaneous eigenfunctions Ψ rel a ( x, ω 1 , ω 2 ) of the N -particle relativistic open Toda chain and its dual. The solution to this problem is known from Separation of Variables [17] and can be expressed recursively as starting from the eigenfunction of the 1-particle problem Ψ rel a 1 (x 1 , ω 1 , ω 2 ) = e ia 1 x 1 /ω 1 ω 2 . Here the integration contour C is as in (2.57), µ( σ, ) is an integration measure, is the wave-function in separated variables, where S 2 (σ|ω 1 , ω 2 ) is defined in Appendix B.
• The S 3 ω 1 ,ω 2 partition function for defects of type I with chiral multiplets (plus Chern-Simons and mixed Chern-Simons terms) 21 reads  As we can see, the defects we are considering are the same ones we used in Section 2.3.3 for constructing the non-relativistic open Toda chain eigenfunctions; the only differences are the dimensionality of the defect theories (three dimensions versus two dimensions) and the background in which these theories live (S 3 ω 1 ,ω 2 versus the disc D 1 ).

Closed relativistic Toda chains
What about the relativistic closed Toda chain? According to the analysis of [17], Separation of Variables tells us that eigenfunctions of the N -particle relativistic closed Toda chain can be obtained from the eigenfunction of the (N − 1)-particle relativistic open Toda chain via Here Q( σ, τ ( a), ω 1 , ω 2 , m 0 ) = N −1 j=1 q(σ j , τ ( a), ω 1 , ω 2 , m 0 ), (3.79) and q(σ, τ ( a), ω 1 , ω 2 , m 0 ) satisfies the one-dimensional Baxter equation for the relativistic closed Toda chain and its dual with t(σ, E( τ ( a)))), t(σ, E( τ ( a)))) as in the second line of (3.17), (3.18). As we already mentioned, these equations can be thought as the quantized versions of the classical spectral curves (3.16). Always according to [17], the function ( Let us focus here on the N = 2 case. Let us decouple the center of mass and set the auxiliary variables as a 1 = −a 2 = a 2 . For what the relativistic open chain is concerned, we know from (3.73) that when the five-dimensional gauge theory is decoupled (that is g 2 5d = 0 or equivalently m 0 = ∞) the S 3 ω 1 ,ω 2 partition function of a type II defect with chiral multiplets formally satisfies while the S 3 ω 1 ,ω 2 partition function of a type II defect with antichiral multiplets formally satisfies are nothing but the m 0 → ∞ limit of (3.68). 22 Because of the properties of the double sine function, our expressions (3.81), (3.83) are not entire but present poles. This is not a problem, and is not unexpected either: in fact we encountered a similar situation in Section 2.3.3, where instead of double sine functions we had Gamma functions. In that case we found that, by moving the Gamma functions from the numerator to the denominator, (2.52) can be rewritten as the product of an entire function times a function giving a lattice of poles at σ = ±a + in , n ∈ Z. Although not necessary for our purposes, let us just mention that something along the same lines can be done also for the case at hand: more precisely, after introducing the θ-function which is periodic in iω 2 and quasi-periodic in iω 1 and is such that where we remind that Expressions (3.88) are actually only valid for Im(ω 1 /ω 2 ) > 0, but can also be used when Im(ω 1 /ω 2 ) = 0 with ω 1 /ω 2 / ∈ Q + (in the case ω 1 /ω 2 ∈ Q + instead we can only use the original formulae (3.81), (3.83) written in terms of double sine functions). In this form we can easily see the similarity between (3.88) and (2.55): in particular the terms at the numerator give an entire function, while the quasi-periodic θ-functions at the denominator generate a lattice of simple poles at σ = ± a 2 + imω 1 + inω 2 , m, n ∈ Z and play the same role of the sinh functions at the denominator of (2.55) in the non-relativistic Toda case.
Let us now move to the relativistic 2-particle closed Toda chain. Here we should look for an entire L 2 (R) solution q(σ, a, ω 1 , ω 2 , m 0 ) to the relativistic closed chain Baxter and dual Baxter equations (3.80), that is where the energies E 1 , E 1 are given by (3.68). Sometimes it will be more convenient to consider the function which should be an entire solution of the more symmetric equations studied numerically in Section 3.2. Again, based on the analogy with the non-relativistic case (2.71) and the analysis of [17] we expect a linear combination of the form q(σ, a, ω 1 , ω 2 , m 0 ) ∝ q (ac) (σ, a, ω 1 , ω 2 , m 0 ) − ξq (c) (σ, a, ω 1 , ω 2 , m 0 ) (3.93) to be the correct eigenfunction of the Baxter and dual Baxter problem (modulo an overall σ-independent factor), where ξ ∈ C and, similarly to (2.63), q (c) (σ, a, ω 1 , ω 2 , m 0 ) = q (c) (σ, a, ω 1 , ω 2 )q (c),inst NS (σ, a, ω 1 , ω 2 , m 0 ), should be the "NS limit" of the partition function of the five-dimensional N = 1 SU (2) theory on S 3 ω 1 ,ω 2 × R 2 in the presence of a type II codimension-two defect on S 3 ω 1 ,ω 2 with chiral/antichiral multiplets, in line with the discussion of Section 3.3.3. More precisely we expect (3.94) will have the correct asymptotic behaviour, but will not be entire functions if taken separately (because of the poles coming from the θ-functions/double sine functions); nevertheless their linear combination should be an entire function, even if only for those values of a satisfying the exact quantization conditions (3.67).
In order to check this expectation, we need to compute the functions (3.94); since we already know the perturbative part from (3.81), (3.83), all it remains to understand is how to include instanton corrections. According to [66], and similarly to what suggested for the S 5 ω 1 ,ω 2 ,ω 3 partition function, the instanton contributions q (c),inst NS , q (ac),inst NS should factorize into the product of two copies of the type II defect instanton partition function Z (c),inst 3d/5d,NS or Z (ac),inst 3d/5d,NS on flat space R 2 1 × R 2 × S 1 R , with 1 , R and ω 1 , ω 2 identified as in the first two lines 23 of Table 4. The functions Z (c),inst 3d/5d,NS , Z (ac),inst 3d/5d,NS can be computed as discussed in [30,55]; we collected the relevant formulae in Appendix A. In terms of the flat space variables A few properties of the function (3.96) should be mentioned: • The flat space defect instanton partition function (3.96) presents poles at −iR 1 ∈ Q + (or ω 1 /ω 2 ∈ Q + ): these are the same poles that were affecting the "naive" quantization conditions (3.39) one would obtain from considering gauge theories in flat space. Moving to curved background S 3 ω 1 ,ω 2 × R 2 we get two copies of this function, related by the exchange ω 1 ↔ ω 2 , and the expectation is that their poles will cancel each other (similarly to what happens for the exact quantization conditions (3.67)).
• The function (3.96) (and similarly (3.97)) can also be written in the form Z (c),inst 3d/5d,NS (w, µ, q 1 , Q 5d ) = exp −F (c),inst 3d/5d,NS (w, µ, q 1 , Q 5d ) , (3.99) Here d 2 is taken to run over N, while d 1 is allowed to take values in N/2. 24 This expression is almost the same as the BPS part of the open topological string partition function (3.46), except for the fact that the BPS states associated to the 1-loop factor in (3.42) (which in the present setting would correspond to (qwµ 1 2 ; q) ∞ (qwµ − 1 2 ; q) ∞ in the numerator of (3.88)) are missing in (3.99). 23 The "NS limit" on S 5 ω 1 ,ω 2 ,ω 3 we are considering corresponds to sending ω3 → 0; in this limit only the first two fixed points remain, corresponding to north and south pole of S 3 ω 1 ,ω 2 in S 3 ω 1 ,ω 2 × R 2 . 24 This is in contrast to the usual conventions in the literature, see for example [20], in which σ is shifted by a/2 in such a way to have d1 integer; as a consequence, our BPS invariants D s 1 m,d 1 ,d 2 will be different from the ones in the literature.
At this point, after moving from flat space variables (3.95) to curved space ones (3.89) and using the identifications in Table 4, according to [66] we should have with instanton contributions as in (3.109) will be either purely real or purely imaginary and with definite σ ↔ −σ parity if we choose ξ = −(−1) n for the level n eigenfunction: this is as expected, due to the symmetry σ ↔ −σ of the problem (3.92). We now have all the ingredients entering our proposed solution (3.110) to the Baxter and dual Baxter equations associated to the 2-particle relativistic Toda chain. It is easy to check that the two functions entering in the linear combination (3.110) separately are at least formal solutions to (3.92) perturbatively in Q rel , Q rel ; however, there are a few problems we should face: • First, we have to check that poles at ω 1 /ω 2 ∈ Q + of the function (3.96) will cancel if we consider two copies of it in the combinations (3.109); • Second, it is not clear that our proposed solution (3.110) will be entire and L 2 (R) for the values of a = a (n) satisfying the exact quantization conditions and for some appropriate value of ξ (which we fixed to ξ = −(−1) n due to the symmetry σ ↔ −σ of the problem (3.92)). The first point can be addressed easily, since it has already been shown in [20] that the combinations F (c),inst 3d/5d,NS (w ± , µ, e 2πi q, Q rel ) + F (c),inst 3d/5d,NS ( w ±1 , µ, e 2πi q, Q rel ) (3.111) appearing in (3.109) are free of poles at ω 1 /ω 2 ∈ Q + ; a key ingredient for the poles cancellation argument of [20] is the term (−1) 2ns 1 in (3.103), which arises due to the identification of Table 4 (or alternatively to the B-field). 26 Since the perturbative contributions (3.81), (3.83) do not present poles at ω 1 /ω 2 ∈ Q + because of the definition of double sine function, we can conclude that (3.110) will be free of divergences at ω 1 /ω 2 ∈ Q + . However, we should still understand if our proposal (3.110) is an entire and L 2 (R) function when the quantization conditions are satisfied. One observation is that the poles in σ coming from the instanton contributions (3.109) seem to be cancelled by the zeroes of the numerators in (3.88), thus leaving only the poles coming from the θ-functions in (3.88) as possible singularities of q(σ, a, ω 1 , ω 2 , m 0 ). It seems however hard to show analytically that these poles actually disappear at the particular values a = a (n) determined by the exact quantization conditions (3.67) since we do not have a closed form or TBA-like expression for the instanton contribution (3.109); for the same reason it would be hard to prove L 2 (R)-normalizability. We will therefore content ourselves with performing some numerical check of our proposal: more precisely, as we did in Section 2.3.3, we plot our proposed solution q(σ, a, ω 1 , ω 2 , m 0 ) (computed up to 4 instantons) for σ ∈ R and compare the resulting plot against the Baxter eigenfunctions obtained via numerical methods in Section 3.2. 27 For example, in Figure 14b we fixed ω 1 = 1 √ 2 , ω 2 = 1, m 0 = − ln 3 2π and plotted our proposed gauge theory Baxter solution Re[q(σ)], Im[q(σ)], Re[q(σ)] for energy levels n = 0, 1, 2 respectively (the other real or imaginary component being zero), evaluated at those a (n) solving the exact quantization conditions (see Table 5) and for ξ = −(−1) n ; Figure 14c instead represents the difference between gauge theory and numerical solutions (Figure 14a). 28   , m 0 = 0 is presented in Figure 15. By the naked eye, numerical (blue) and gauge theory (orange) Baxter solutions seem to agree: in particular, the singularities at σ = ±a (n) /2 of our proposed gauge theory solution seem to disappear 29 already with a 4-instantons computation, in contrast to what we would get without considering instanton corrections (Figure 16), or without considering both copies of the defect instanton partition function in (3.109) (Figure 17, in which we did not consider the contribution coming from the second copy with tilded variables), or by using a value for a not satisfying the exact quantization conditions (Figure 18). In reality the singularities are still there, as they should disappear only when considering all instanton contributions, but we may need a bigger resolution in our plots to see them. For example these singularities can be seen in the plot of the difference (red) between level n = 0 numerical and gauge theory solutions in Figure 14c, but we need to consider lengths of order ∼ 10 −9 to notice them; the same plot for levels n = 1, 2 seems not to have singularities, but this simply means we need an even bigger resolution (so we should more appropriately think of these red plots as indicating the difference between numerical and gauge theory solution away from singular points). More precisely what we should expect is that, by adding more and more instanton corrections, the gauge theory solution approaches the exact one better and better, the singularities are smoothed away and the discontinuities get smaller and smaller. An example of this behaviour is shown in Figure 19 for the level n = 1 solution in the case ω 1 = 2 − 1 4 , ω 2 = 2 1 4 , m 0 = 0: while the numerical (blue dots) solution is smooth around σ = a (1) /2, the gauge theory one (orange dots) diverges, but this divergence gets milder and tends to disappear by increasing the number of instantons (from 3 to 4 in this example), and we need to "zoom" more in order to see it. This is completely analogous to what we saw happening in Section 2.3 for the non-relativistic Toda chain, and provides a few numerical checks of the validity of our proposal. 29 Clearly one of the two poles can always be eliminated by appropriately choosing ξ; however, the expectation is that both poles disappear only when a = a (n) satisfies the exact quantization conditions.

Additional remarks
There are a number of points which deserve further comments.
• As we discussed, our proposed solution (3.110) is free of poles at ω 1 /ω 2 ∈ Q + thanks to the argument of [20]; nevertheless, we were only able to plot it for ω 1 /ω 2 / ∈ Q + . The problem is not in the double sine functions, which admit nice representations when ω 1 /ω 2 ∈ Q + [72], but it is due to the complicated expressions for the instanton corrections which make it hard to study these particular values of the ω i 's. In fact, already in order to show the absence of poles it is more convenient to rewrite the instanton corrections in an open topological string form; this alternative form is however not very good for plots since it is not exact in w but is a Laurent series. It would be important to be able to study at least the self-dual point ω 1 = ω 2 = 1, m 0 = 0 in order to compare our proposal to the eigenfunction given in [18,19]. In any case, we think that this issue can be solved by a better computer analysis of (3.110).
(3.112) 30 As we already mentioned (see footnote 10) it is possible to define good quantum mechanical problems both at ω1, ω2 ∈ R and at ω1 = ω2 ∈ C [17]. This is very similar to our proposed solution (3.110), but instead of using the function Z (c),inst 3d/5d,NS appearing in (3.109) as instanton correction we are using Z (c),inst 3d/5d,NS (which only differ by a constant factor). Because of the symmetry σ ↔ −σ we can choose ξ = ±1; then (3.112) will be either purely real or purely imaginary since under complex conjugation ω 1 and ω 2 get exchanged. 31 At this point we notice that the coefficients c n (E 1 , q, Q rel ) of the w ∼ 0 expansion of (qwµ can be written directly in terms of the energy E 1 (and q, Q rel ) rather than the auxiliary variable µ; for example

(3.114)
This series was shown in [19] to be convergent for |q| < 1 (and m 0 = 0) and was a key ingredient in their construction of the 2-particle Toda eigenfunction at ω 1 = ω 2 .
In fact it is easy to realize, after this observation, that (3.112) coincides with the solution of [19] (modulo constant factors), where the θ-functions in (3.112) due to the double sine functions coincide with the contribution of the Wronskian of two special solutions to the main functional equation analysed in [19]. We therefore expect our proposed solution (3.110) to be an eigenfunction of both the quantum mechanical problem at ω 1 , ω 2 ∈ R and the quantum mechanical problem at ω 1 = ω 2 ∈ C, after the appropriate normalization factors (or values of ξ) are taken into account.
(3.116) These are quantization conditions for the parameter a: only when a = a (n) satisfies (3.116) our solution (3.110) will be free of singularities in σ. By consistency, (3.116) should then be equivalent to the exact quantization conditions (3.67); let us try to see if this is the case. First of all, by making use of the properties of the double sine function we can rewrite (3.116) as at a = a (n) . (3.117) Moving to logarithms (and multiplying by 2i) we obtain at a = a (n) . It is easy to recognize that the first line of (3.118) precisely reproduces the classical part of the exact quantization conditions (3.67) as well as the contribution coming from the BPS states with a full matching between (3.67) and (3.118) will therefore be obtained if  [20] based on previous works [69][70][71]. Although it may be difficult to prove (3.119), we were able to check its validity up to 4-instantons; it is therefore plausible for (3.116) to coincide with the exact quantization conditions (3.67) as expected.
• Assuming our proposal (3.110) is the entire L 2 (R) solution to the Baxter and dual Baxter equations associated to the 2-particle relativistic closed Toda system, the simultaneous eigenfunction Ψ rel a (x, ω 1 , ω 2 , m 0 ) of the relativistic Toda and dual Toda Hamiltonians will be the (not normalized) eigenfunction satisfying 32 This is the analogue of (2.75) for the non-relativistic Toda chain. In the nonrelativistic chain, performing the integral leads to an expression like (2.33); going to the relativistic system, the integral will produce a double infinite sum over n, n ∈ Z involving a + inω 1 + in ω 2 , which should reduce to a single sum over n ∈ Z when ω 1 = ω 2 = 1. This sum would be the same as the one appearing in the expression for the 2-particle relativistic Toda eigenfunction discussed in [18], although the summands we are considering are different: in our case we only have NS limits of partition functions in the presence of codimension 2 defects, while in [18] both the NS and the unrefined limits are needed. It would be interesting to understand if the two expressions are actually the same, maybe because of some identity relating different limits of codimension two defect instanton partition functions.
In addition, as we already mentioned for the non-relativistic case, (3.120) is expected to coincide with (a linear combination of) type I defect partition functions when evaluated at those values a = a (n) satisfying the exact quantization conditions: it would be interesting to check this explicitly. The ideas in the work [34] may be helpful in this respect, although their focus is mostly on four-dimensional theories.
• Finally, we would like to come back to a comment we made in Section 2.4. As we mentioned there, quantization conditions for the (non-relativistic) 2-particle closed Toda chain seem to be expressible in two different but equivalent ways: the first one is related to the NS limit of the four-dimensional N = 2 SU (2) partition function, while the second one is related to its unrefined limit. Independently on how we express them, these quantization conditions seem to determine the spectrum of two different quantum mechanical systems, that is the 2-particle closed Toda chain and a Fermi gas, whose "off-shell" energies are given by (2.47) and (2.83) respectively.
As hypothesized by [49], the relation between these two systems may be clearer if we start from five dimensions / from the 2-particle relativistic closed Toda chain and take an appropriate limit. According to what we discussed until now, a practical way to realize this suggestion might be to take the four-dimensional limit of our fivedimensional N = 1 SU (2) theory on S 3 ω 1 ,ω 2 ×R 2 and see what happens. This limit will break the symmetry ω 1 ↔ ω 2 ; one possibility would be to send ω 2 → ∞ while keeping all other parameters fixed, and remembering that when going to four dimensions the gauge coupling scales according to (3.122) If we further redefine a → 2a, ω 1 → , we find that the "off-shell" relativistic Toda and dual Toda energies E 1 , E 1 (3.68) reduce to (3.123) As we can see, the four-dimensional limit of E 1 reproduces the (non-relativistic) 2-particle closed Toda energy E 2 (a, , Q 4d ) (2.47), while the four-dimensional limit of E 1 reproduces the Fermi gas energy (2.83) modulo overall factors. In addition, relativistic Toda exact quantization conditions will reduce to the non-relativistic Toda ones (in the A)-representation according to the notation of Section 2.4); in this way we may be able to obtain the energy spectrum of both systems in an unified way.
It is important to stress that the interpretation of the four-dimensional limit of E 1 can be a bit tricky. The limit (3.122) basically sets Q 5d → 0 in E 1 , but this also happens when we consider the dual relativistic open Toda chain, which has the same "off-shell" energy of our Fermi gas although its energy spectrum is continuous. However, in our opinion it makes more sense to think of (2.83) as the energy of the Fermi gas when considering it as arising from the four-dimensional limit ( 3.6 A further example: the 3-particle case Up to now a large part of our discussion has been valid for general N , but most of the details (especially about the solution to the Baxter equation) were only given for N = 2.
Since this case might be a bit too special, we will consider N = 3 in this Section; we will thus be able to see the importance of the B-field, which is trivial for N = 2. However, increasing N makes all gauge theory computations more cumbersome, and all we were able to do is considering instanton corrections up to order 3 for all the relevant gauge theory quantities; we therefore expect our results to be less precise than the ones we obtained for N = 2.
Let us start by considering quantization conditions and spectrum for N = 3, which were already studied in [9]. First of all, in this case we have three auxiliary parameters a 1 , a 2 , a 3 (the Coulomb branch parameters of our five-dimensional SU (3) theory); decoupling the center of mass corresponds to imposing a 1 + a 2 + a 3 = 0, and this is usually done by moving to the variables a 12 = a 1 − a 2 , a 23 = a 2 − a 3 , We will also often use the notation As we discussed in Section 3.3.3, exact quantization conditions are obtained by extremizing the effective twisted superpotential (3.63) which is computed from the "NS limit" of the (integrand of the) partition function on S 5 ω 1 ,ω 2 ,ω 3 ; the non-BPS part in (3.63) is easily extracted from (3.58), while the BPS part is written in terms of the function (3.49) corrected by the B-field (arising in this setting from the identifications in Table 4). We then obtain j L ,j R numbers can be found for example in [15]); exact quantization conditions (3.65) will therefore reduce to solving the equations in terms of the a 12 , a 23 variables at fixed ω 1 , ω 2 , m 0 and for chosen levels n 12 , n 23 ∈ N. These quantization conditions precisely match with the ones given in [9]. Energies E satisfying the quantization conditions (3.127). These Wilson loops are basically the same as the ones in flat space, modulo taking into account the effect of the B-field: more precisely, if we denote the (NS limit of the) fundamental and antisymmetric Wilson loops in flat space , NS (a 12 , a 23 , 1 , R, m 0 ), W SU (3) , NS (a 12 , a 23 , 1 , R, m 0 ), (3.129) ones, and the agreement gets better and better by considering more instanton corrections. 34 Let us now move to discuss the solution q(σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) to the Baxter and dual Baxter equations (3.80) (with center of mass decoupled), which in the N = 3 case read  According to the discussion in Section 3.4, this solution should involve the NS limit of the partition function of codimension-two defects of type II wrapping S 3 ω 1 ,ω 2 . As usual, we first consider the m 0 → ∞ limit (relativistic open Toda chain); the S 3 ω 1 ,ω 2 partition function for a type II chiral/antichiral defect in this limit is given for general N in (3.73), which for N = 3 and decoupling the center of mass reduces to Moving to the closed chain, we expect the solution to (3.134) to be the linear combination q(σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) ∝ q (ac) (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) − ξq (c) (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) (3.136) modulo an overall (complex) σ-independent term and for some value of ξ ∈ C, where q (c) (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) = q (c) (σ, a 12 , a 23 , ω 1 , ω 2 )q (c),inst NS (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ), q (ac) (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) = e 2iπm 0 σ ω 1 ω 2 q (ac) (σ, a 12 , a 23 , ω 1 , ω 2 )q (ac),inst NS (σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ), (3.137) are the instanton-corrected version of the open chain ones (3.135). Again, the instanton contributions are expected to be given by two copies of the NS limit of the type II defect instanton partition function Z (c),inst 3d/5d,NS or Z (ac),inst 3d/5d,NS on flat space R 2 1 × R 2 × S 1 R , which can be computed with the formulae in Appendix A. The results are too involved to be shown here: let us just mention that, in terms of the flat space variables q 1 = e 2πR 1 , w = e −2πRσ , µ 12 = e 2πRa 12 , µ 23 = e 2πRa 23 , Q 5d = e −2πRm 0 , (3.138) 34 Numerical results are obtained by considering 350 × 350 matrices as in Section 3.2; see [9,14] for more details on numerical computations. these function are related as Z (ac),inst 3d/5d,NS (w, µ 12 , µ 23 , q 1 , Q 5d ) = Z (c),inst 3d/5d,NS (w, µ 12 , µ 23 , q −1 1 , Q 5d ); where the proportionality factor is independent of σ. In addition, the defect instanton partition function admits an open topological string like representation as where we moved from flat space variables (3.138) to curved space ones following Table 4 (here q = e 2πiω 1 /ω 2 , q = e 2πiω 2 /ω 1 ). By using the representation (3.141), it is immediate to apply the argument of [20] and show that the combinations appearing in (3.143) are free of divergences at ω 1 /ω 2 ∈ Q + . To sum up, our proposed solution to the Baxter and dual Baxter equations (3.134) associated to the 3-particle relativistic closed Toda chain is given by the linear combination (3.136), which involves the perturbative part (3.135) and the instanton contributions (3.143), modulo an overall complex σ-independent term and with ξ ∈ C determined as in (2.31); this is expected to be entire only at the values a 12 = a (n 12 ,n 23 ) 12 , a 23 = a (n 12 ,n 23 ) 23 satisfying the exact quantization conditions (3.128). As usual, in order to check this proposal we plot it and compare against numerical results; for this purpose it is actually more convenient to consider the related function q(σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ) = e − iπm 0 σ ω 1 ω 2 q(σ, a 12 , a 23 , ω 1 , ω 2 , m 0 ), (3.144) 35 As in (3.99), not all BPS states are contained in the instanton contributions: some of them arise from the double sine functions in (3.135).  since it satisfies a more symmetric problem. Figures 20 and 21 show the ground state (n 12 , n 23 ) = (0, 0) eigenfunction obtained via numerical methods (blue) and via our gauge theory proposal (3.136) (orange) 36 for ω 1 = 1 √ 2 , ω 2 = 1 and m 0 = 0 or m 0 = 1 respectively; as we can see from the left-most plots (red) the difference between numerical and gauge theory result away from singular points is quite small already considering 3-instanton expressions, 37 while divergences tend to close by considering more and more instanton corrections. Eigenfunctions for excited states can also be easily obtained from (3.136), but comparison against numerical results becomes harder since excited stated are more problematic to treat numerically.
For general N , we expect a similar story to be true: the simultaneous solution to the Baxter and dual Baxter equations for the N -particle relativistic closed Toda chain will be given by a linear combination q(σ, a, ω 1 , ω 2 , m 0 ) ∝ q (ac) (σ, a, ω 1 , ω 2 , m 0 ) − ξq (c) (σ, a, ω 1 , ω 2 , m 0 ), (3.145) modulo an overall σ-independent term and with ξ ∈ C determined by (2.31). 38 Here we 36 The orange plot shows the gauge theory function Re [q(σ)] divided by its norm; the overall complex σ-independent term has been fixed numerically in such a way to have Im [q(σ)] = 0. 37 Here we fixed ξ in such a way to cancel the singularity at σ = 0, so that only the other two singular points are visible. Moreover, the asymmetry in the red plots is due to numerical results, which are obtained not from diagonalizing (3.134) but from considering a closely related operator: see [9,14] for more details. 38 It would be desirable to have an explicit gauge theory expression for this σ-independent term and for ξ in such a way that the resulting eigenfunction will be normalized to 1, but we weren't able to find it yet.

Conclusions
In this paper we proposed a gauge theory approach to solve the problem of constructing an entire, simultaneous solution to the Baxter and dual Baxter equations associated to the N -particle relativistic closed Toda chain, out of which relativistic Toda and dual Toda eigenfunctions can be obtained via Separation of Variables techniques, and we tested our proposal against numerical results finding good agreement. Our proposal basically consists of considering various defects for the five-dimensional N = 1 SU (N ) theory on the squashed S 5 ω 1 ,ω 2 ,ω 3 background in the "NS limit" ω 3 → 0, rather than the flat R 2 1 ×R 2 2 ×S 1 R background in the NS limit 2 → 0 usually considered in the literature. From this set-up, which seems to automatically incorporate the effect of the B-field and "S-duality" ω 1 ↔ ω 2 (related to the existence of the modular dual system), we were able to extract exact quantization conditions, exact spectrum and exact Baxter eigenfunctions in an unified setting; it is however not clear if the S 5 ω 1 ,ω 2 ,ω 3 background is the most appropriate one to start with, since any other background that reduces to S 3 ω 1 ,ω 2 × R 2 in some limit may be equivalently good. In any case it is important to notice that, although usually stated otherwise, the type II defect partition function on flat space R 2 1 × R 2 × S 1 R turns out not to be the correct solution to the Baxter equation by itself, but a second copy of it (containing nonperturbative contributions) is needed.
We should stress that, although it seems to match numerical results for the cases we checked, at this stage our proposal can only be regarded as a proposal, and we do not know of any way to demonstrate it. What is more, even assuming this proposal turns out to be correct, at the moment it is not clear to us why considering gauge theories on curved backgrounds should work. Our motivation to do so came from realizing that the known eigenfunctions of the relativistic open Toda chain given in [17] coincide with the S 3 ω 1 ,ω 2 partition function of some particular three-dimensional theory: based on this fact, on what happens in the non-relativistic (or four-dimensional) case, and on the existence of the modular dual structure of the relativistic Toda chain, we were naturally led to consider gauge theories on S 3 ω 1 ,ω 2 × R 2 ; nevertheless, a good explanation for this has yet to be found. One could say that starting from the (integrand of the) partition function on S 5 ω 1 ,ω 2 ,ω 3 may be meaningful because this was suggested in [22] to provide a non-perturbative completion of the topological string partition function, but this claim itself is simply another proposal. A deeper understanding of this point is surely desirable.
Another important remark is that, as we mentioned at various points in this paper, there seem to be two different gauge theory/topological string approaches to solve the 2particle relativistic Toda chain (and, with the appropriate modifications, also the N -particle one): in both of them non-perturbative contributions are essential to get correct results, but these contributions appear in different ways. The first approach is the one followed in this work and, similarly, in [13], [9] among others: this is based on considering formulas which are manifestly S-duality invariant, in agreement with the modular double structure of our problem, and only involves the NS limit of the refined topological string partition function (closed or open). The second approach instead, followed by [8,18] among others, is based on the study of spectral (Fredholm) determinants and minors associated to an operator which basically is the inverse of the Baxter equation; these determinants and minors can be expressed in terms of (closed or open) refined topological string partition function, but these expressions involve both the unrefined and the NS limit. At least for what quantization conditions and spectrum are concerned, the two approaches are related [15,16]; it would be interesting to understand if this continues to be true at the level of eigenfunctions.
It is also worth noticing that these two approaches seem to have an analogue in four dimensions, although in this case they will be related to different Quantum Mechanical systems: the first approach simply reduces to the original gauge theory proposal of [1] for solving the non-relativistic Toda chain, which only involves the NS limit of four-dimensional gauge theory observables; the second approach instead is more related to the work [42], where the spectral determinant for a Fermi gas associated to the O(2) matrix model is expressed solely in terms of the unrefined limit of the four-dimensional partition function. It is possible that these two systems descend from the relativistic Toda and dual Toda chains respectively as we discussed in Section 3.5, but further investigation is needed.
Finally, it would be very interesting to understand if our proposal for the solution to the Baxter and dual Baxter equation can be extended to include purely topological string cases like local P 2 , which are not associated to any gauge theory. This seems to be the case since our proposal can be written in terms of the NS limit of the refined open topological string partition function, which can be computed even for cases without a gauge theory interpretation; we hope to be able to discuss this point in more detail in the near future.

A Instanton partition functions with defects
In this Appendix we collect the relevant contour integral formulae computing the instanton contributions to the partition functions of 4d and 5d theories in the presence of various codimension two defects.

A.1 Four-dimensional theories
The perturbative part of the partition function for a four-dimensional N = 2 SU (N ) theory living on R 2 1 × R 2 2 is given by (A. 2) The instanton part instead reads where a = (a 1 , . . . , a N ) and , (A. 16) for { φ} = ( φ (1) , . . . , φ (N ) ); more details on the computation of this partition function can be found for example in [29].
Thermodynamic Bethe Ansatz (TBA) formulae When considered in the NS limit 2 → 0, 1 = i , some of these instanton partition functions admit a TBA expression, which is typically easier to work with. For example, by defining the function ϕ(µ) via These formulae are equivalent to the NS limit of the type II defect instanton partition function with chiral/antichiral multiplets respectively.

A.2 Five-dimensional theories
The instanton part of the partition function for a five-dimensional N = 1 SU (N ) theory living on R 2 1 × R 2 2 × S 1 R is given by the contour integral formula .
Moving to defects, it was shown in [30,55] that the instanton part of the partition function for a 5d N = 1 U (N ) theory in the presence of a type II codimension-two defect

B Special functions
In this Appendix we collect the definition and main properties of the double sine and triple sine functions, which naturally appear when considering partition functions of supersymmetric gauge theories on curved spaces.