TBA Equations and Quantization Conditions

It has been recently realized that, in the case of polynomial potentials, the exact WKB method can be reformulated in terms of a system of TBA equations. In this paper we study this method in various examples. We develop a graphical procedure due to Toledo, which provides a fast and simple way to study the wall-crossing behavior of the TBA equations. When complemented with exact quantization conditions, the TBA equations can be used to solve spectral problems exactly in Quantum Mechanics. We compute the quantum corrections to the all-order WKB periods in many examples, as well as the exact spectrum for many potentials. In particular, we show how this method can be used to determine resonances in unbounded potentials.

1 Introduction The one-dimensional time independent Schrödinger equation, describing a non-relativistic particle with energy E in a potential V pqq, 2 ψ 2 pqq`pV pqq´Eqψpqq " 0 (1. 1) has always been an inexhaustible source of useful toy models in physics. However, solving it exactly is a tricky and subtle matter, depending on the form of the potential. Solving (1.1) for generic potentials is still an active research subject, even though almost a hundred years have passed since his first inception [1]. Applying perturbation theory on (1.1) yields a profusion of different perturbative series -corresponding to different classical configurations -which are divergent most of the time. Resumming and organizing these divergent series into a non-perturbative and coherent picture of the quantum system of interest was achieved mainly during the late 70s and 80s through Exact asymptotics: the seemingly paradoxical idea that drastically divergent series can be used to perform fully exact computations. Providing a comprehensive and impartial bibliography or a complete review of this rich subject is far outside the scope of the present work. We will instead briefly present some of the key developments we deem directly relevant for the understanding of this paper. In order to fix the notations, we will also provide a lightening review of the exact WKB method in section 2.1. One of the pioneering work using WKB techniques in order to investigate divergences in the anharmonic quartic oscillator is from Bender and Wu [2]. Yet, a better starting point for the "exact" story is Balian-Bloch's idea that we can reconstruct Quantum Mechanics from the complex classical trajectories [3]. Leveraging this idea with resumming techniques (Borel resummation), one can develop an exact version of the WKB method. UsingÉcalle's Resurgence theory [4], the exact WKB method can be further refined and anchored to rigorous grounds. This resurgent program was first applied on one-dimensional Quantum Mechanics mainly by Voros [5][6][7][8], then was further refined by Delabaere, Dillinger and Pham [9][10][11] and led to powerful exact results, like exact connection formulae and exact quantization conditions (EQC). These EQC are relating the resummed WKB periods to the energy of the quantum system, thus allowing to solve exactly the spectral problem that is (1.1) provided that we know the exact periods. The road map is pretty straightforward in principle: given a quantum system, compute the all order WKB periods, resum them, then extract the spectrum from the EQC.
We were stuck with this three step program until more recent progress. Dorey and Tateo realized in [12] that certain quantities in Quantum Mechanics were satisfying functional equations arising in the seemingly unrelated topic of integrable models. Indeed, these functional equations are strongly reminiscent of solutions of the non-linear integral equations appearing in the context of the thermodynamic Bethe ansatz (TBA). One can find a fairly modern review in e.g. [13]. This correspondence between ordinary differential equation (in the form of the Schrödinger equation for this instance) and integrable models is called the ODE/IM correspondence. By solving these TBA equations, one can (among other quantities) obtain the resummed WKB periods, thus taking care of the step one and two of our recipe above in one go. However, the method presented in [12] is quite limited: one can only apply it on pure potentials of the form x 2M (and is then generalized to potentials of the form |x| α ). See [14] for a more recent review, from Dorey, Dunning and Tateo, extending the ODE/IM correspondence to some other interesting examples beyond pure potentials (like V pxq " x 2M`l pl`1q x 2 ). In QM, when one want to reconstruct the exact WKB periods using only classical periods, asymptotic behaviors and discontinuities of the functions obtained by Borelresummation of the quantum-periods, a Riemann-Hilbert problem arises. A generalization of the ODE/IM correspondence presented above can be realized as the fact that the solutions of the aforementioned Riemann-Hilbert problem are precisely given in term of a TBA system. Actually, this description of the WKB periods in the language of monodromy and resurgence theory is known since Voros' work [7] and is named "analytical bootstrap". However, it did not led to alternative computational methods in QM before these ideas were promoted to the method described in this paper, first developed by Ito, Mariño and Shu in [15], reformulating [16] in a pure quantum mechanical and resurgent framework.
In order to understand what motivated [15], a good starting point is the seminal works of Gaiotto, Moore and Neitzke [17,18] in the context of four-dimensional N " 2 gauge theories. They are deriving integral equations solving a Riemann-Hilbert problem in term of the X map defined in [17], the discontinuities of which are given by Kontsevich-Soibelman symplectomorphisms when crossing a BPS ray. See the Kontsevich-Soibelman wall-crossing formula, originally proposed in [19]. These integral equations can in fact be restated as a version of the TBA in [20], as pointed out by Zamolodchikov (see appendix E in [17]).
To connect these results with standard Quantum Mechanics, the final step is to realize, as Gaiotto in [16], that the conformal limit of the TBA equations for the Hitchin system obtained in [17,18] leads to TBA equations that are solving Schrödinger-type spectral problems. Moreover, they have applications outside Dorey and Tateo's ODE/IM correspondence, limited to pure potentials. See [21] for recent numerical experiments testing the predictions of [16].
Before finishing this introduction, we want to establish yet another fascinating connection: the Hitchin problem studied in [17,18] is related to the geometrical problem of computing minimal surfaces in AdS, as explained by Alday and Maldacena in [22] and as precised below. See also [23]. The study of minimal surfaces in AdS is motivated by the study of the holographic dual QFT through gauge/gravity duality, since we can then leverage integrability and compute interesting quantities (see [24]). To be more accurate, computing the minimal surfaces in AdS delimited by a particular polygonal contour on the boundary allow us to compute the scattering amplitude or Wilson loop expectation value. Provided that these models are integrable, we can write a Hitchin system leading to a system of TBA equations. A precise example would be the quantum sigma model describing strings in AdS 5ˆS 5 , the classical limit of which consists of strings moving in AdS 5 1 and is integrable. This model is corresponding (through AdS{CF T ) to fourdimensional N " 4 super Yang Mills, integrable in the planar limit. Another interesting example, more closely related to the TBA system of interest in this paper, is the study of minimal surfaces in AdS 3 delimited by a polygonal closed contour on the boundary. This problem simplifies and reduces to the Z 2 projection of a SU p2q Hitchin problem arising in [17,18] in the context of four-dimensional N " 2 gauge theories, as described in the previous paragraph. They are numerous interesting papers on the subject, including (but not limited to) [22,23,[25][26][27].
As we already explained, the conformal limit of the TBA equations in [17,18] brings us back to the TBA equations in [15]. Therefore, this property is transposed to the TBA equations arising in the context of minimal surfaces in AdS 3 (explicitly written in their integral form in [23,27] for example). Additionally, the TBA equations in [15] are obtained using the generalized ODE/IM correspondence and work in principle for any polynomial potential. Consequently, when restricting to pure potentials, one should be able to recover the TBA equation of the standard ODE/IM correspondence found in [12,14] as a special case. The relations between all the aforementioned TBA equations are contained in the diagram of figure 1.
In section 2, we review the general theory of [15]. The exact WKB method will be presented, and a rigorous link between the TBA system and the Schrödinger problem (1.1) will be established in two different way. First, we will derive the TBA equations as solutions of a Riemann-Hilbert problem. Then, we will be directly deriving functional equations from (1.1), leading to the appropriate TBA system. This section is not containing any original work per sei, but is containing the necessary information to make this paper self contained ODE/IM ODE/IM generalization Minimal surfaces in AdS TBA in [12] TBA in [15] AdS 3 TBA in [23] d " 4, N " 2 gauge theory Special case Conformal limit Figure 1: Implication diagram for the TBA systems mentioned in the introduction.
as well as to fix the notations. In section 3, we explain how to analytically continue the TBA equations obtained in section 2 outside the regime where all the turning points are real i.e. outside the so called "minimal chamber"; this procedure is called "wall-crossing". We provide (inspired by Toledo's work in [27]) a fast and simple diagrammatic procedure that allows us to carry out wall-crossing from any chamber to any other. In addition, we will also use this procedure in order to write the quantum mechanical TBA system originating from the ODE/IM generalization for arbitrary degree polynomial potentials in the maximal chamber. We then justify and clarify how it is implying the TBA system originating from the standard ODE/IM correspondance as a special case. In section 4, we present some of the results obtained solving the TBA equations numerically and we compare them to known quantities computed using more standard Quantum Mechanical techniques. In appendix A, we discuss the methods used in order to solve the TBA integral equations numerically. In appendix B, we describe how to extract exact quantization conditions from connection formulae. Finally, in the appendices C and D, we provide the standard quantum mechanical techniques we used to verify our TBA results. In appendix C, we explain how one can compute the quantum corrections to the WKB periods using differential operators. In appendix D, we describe how to extract the bounded or resonant spectrum from a Hamiltonian with polynomial potential by expressing it in the harmonic oscillator basis.

WKB periods and TBA equations
In this section, we will prove constructively -reviewing the ideas of [15] -that the spectral problem (1.1) can be related to a TBA system. A summary of the exact WKB method will be presented in section 2.1. For a comprehensive review of the WKB method, see also [28]. We will then construct the TBA system in 2.2 and 2.3, by looking at Voros' Riemann-Hilbert problem arising from the resurgent analysis of (1.1) for the former, and writing functional equations arising by massaging (1.1) directly for the later.

The WKB method and resurgent Quantum mechanics
The one-dimensional time independent Schrödinger equation (1.1) can be written as 2 ψ 2 pqq`p 2 pqqψpqq " 0 (2.1) where ppqq " a E´V pqq is the classical momentum. The Ñ 0 limit cannot be taken directly in (2.1) since it clearly become algebraic in this limit. Nonetheless, we can write the following ansatz for the wavefunction ψpqq " expˆi ż q Qpqqdq˙(2.2) By plugging (2.2) into (2.1), we transform it into the Riccati equation for Qpqq: We can solve (2.3) by writing Qpqq as a (formal 2 ) power series in , Solving for the Q k pqq recursively, one finds Q n`1 pqq " 1 2Q 0 pqq˜i Q 1 n pqq´n ÿ k"1 Q k pqqQ n`1´k pqq k¸, with Q 0 pqq " ppqq (2.5) By splitting the formal series (2.4) in odd and even powers of , such that Qpqq " P pqqQ odd pqq, i.e.
P pqq " ÿ kPN p k pqq 2k , with p 0 pqq " ppqq and Q odd pqq " ÿ kPN Q 2k`1 pqq 2k`1 (2.6) one realizes that (2.3) splits into two equations. The odd equation is allowing us to solve Q odd pqq in terms of P pqq alone. In fact, one finds that Q odd pqq is a total derivative: and one can reexpress the problem without this redundancy. The WKB ansatz (2.2) becomes then ψpqq " 1 a P pqq expˆi ż q P pqqdq˙(2.8) Geometrically, we can interpret P pqqdq as a meromorphic differential on the so called "WKB curve": y 2 " 2pE´V pqqq (2.9) In this paper, we will treat the case where V pqq is a polynomial of degree d. In this case, (2.9) is a hyperelliptic curve defining a Riemann surface Σ WKB of genus X d´1 2 \ . This curve is characterized by a set of moduli (the energy E and the parameters of the polynomial V pqq). The basic objects appearing in the WKB method are the quantum periods or WKB periods. They consist of the periods of the meromorphic differential P pqqdq integrated along the one-cycles γ P H 1 pΣ WKB q: As P pqq, the quantum periods can be expressed as (formal) power series in 2 : For an efficient algorithm computing the coefficients Π pnq γ , see appendix C. As stated in the introduction, the formal series used as basic objects in Quantum Mechanics are almost always divergent. This is the case with the WKB periods which are typically diverging like double-factorials: Thus, we need to promote them into a meaningful function using resummation techniques.
In this paper, we will use the Borel resummation [29] procedure as defined below. First, we define the Borel transform of the WKB periods aŝ such that this new power series has finite radius of convergence 3 . The Borel resummation of a series is the Laplace transform of its Borel transform. In the context of the quantum periods, one gets These definitions are coming from the well known integral definition of the Gamma function 4 . The integral (2.14) is called Borel summable if it converges for sufficiently small. Let us denote that (2.13) can be analytically continued in the complex ξ-plane. It can display various type of singularities (poles and branch cuts typically). Now, let us assume that a singularity is present on the positive real axis. Then, the Borel resummation (2.14) will hit it and will be undefined for any : it will not be Borel summable anymore! This happens everywhere in Quantum Mechanics. In order to circumvent this apparent problem and "dodge" the singularities, we will now introduce some of the key ingredients of resurgence.
If diverging series occurring in the context of differential equations can appear undefined hence useless, they are containing in fact a lot of useful information on the system of interest. In the same spirit, if singularities in the Borel complex ξ-plane are obstacles to Borel summability, their discontinuities are containing a crucial amount of information nonetheless: it's not a bug, it's a feature! These discontinuities are the result of the Borel transform of the all-order WKB periods after all. In fact, we will show in the following that they are involving only the WKB periods and are relating them together. First, let's 3 Usually, we define the borel transform of f pzq " ř f pnq z n asf pξq " ř nPN 1 n! f pnq ξ n , which has finite radius of convergence if and only if f is of Gevrey-1 type, i.e. f pnq ă |C n n!|. But we can recover our case by a simple change of variable z Þ Ñ 2 (at the cost of introducing new monodromies in the complex z-plane). 4 Indeed, Γpn`1q " n! " ş R`ξ n e´ξdξ such that 1 " 1 generalize (2.14) by allowing to integrate along any direction in the complex plane. The directional Borel resummation along the direction ϕ is defined as the directional Laplace transform of the Borel transform: where ş e iϕ R`d enotes an integration path between 0 and e iϕ 8 i.e. along the complex ray forming an angle ϕ with the real axis. As before, (2.15) is Borel summable -along the direction ϕ this time -if and only if the integral (2.15) converges. Now, let's assume that the Borel transformationΠ γ has a singularity along the direction ϕ. Then, the value of the directional Borel transform will jump when we cross ϕ: there will be a discontinuity. It defines two possible directional Borel resummation: just above and just below the critical angle ϕ, or which are called the lateral Borel resummations. From them, we can define the median Borel resummation, which is the average of the lateral resummation above and below ϕ: One can also measure the previously mentioned discontinuity by subtracting them: Let's note that the B ϕ˘a nd disc ϕ can be regarded as operators acting on formal power series Π P W KB. From this point of view, one can define the Stokes automorphism by the commutativity of the diagram 5 where S denotes the space of "proper functions" leading to resurgent solutions of the Schrödinger equation through (2.8). In other words, In the following, we purposefully gloss out most of the technical details. The reader can find rigorous statements and proofs in [11]. In essence, we can define connection paths relating the W KB elements between different Stokes regions. The action of the connection cycle γ is simply a multiplication by a Voros symbol. A special subset of Voros symbols are Voros multipliers V γ . At the end of the day, they simply end up being the exponent of our WKB periods: In the literature, the inverse convention (the S arrow is swapped, corresponding to our S´1) is often used. This is the case in [11] for example, but we are following the conventions in [15].
These definitions lead to the Delabaere-Pham formula (theorem 2.5.1 in [11]), that is expressing a relation between Voros multipliers, thus between quantum periods. Let's consider the case where all the d turning points of the potential are on the real axis, and the d´1 cycles are encircling classically allowed and classically forbidden regions in succession (one can find such an example in figure 2a and 2c). We call this subspace of the moduli the minimal chamber for reason we will develop later. In this regime, we will be interested in the φ " 0 direction and will be omitting the index φ. The Delabaere-Pham formula then yields where xγ b , γ a y is the intersection of cycles 6 . As an application of (2.22), let's look at a " 1, corresponding to the first cycle from the left (the first red cycle in figure 2c for example).
In this case, xγ 2 , γ 1 y "`1 is the only non trivial cycle intersection and (2.22) reduces to Applying the operator identity (2.23) on our WKB periods yields an alternative formulation of the Delabaere-Pham formula: disc pΠ γ 1 q p q "´i logˆ1`expˆ´i Π γ 2 p q˙˙(2.24) As a result, Π γ 1 is not Borel summable along the direction φ " 0. This is an inevitable consequence of (2.24), that is measuring the precise discontinuity when we cross the real axis, hence revealing the presence of singularities along this ray. (2.24) also contains a very resurgent statement: this discontinuity in the Borel resummation of the quantum period Π γ 1 is entirely encoded in another quantum period, Π γ 2 . This is the same situation for the general case (2.22), which is linking all the quantum periods together (as long as they don't have a null intersection of cycle), through their Voros symbol and the action of the Stokes automorphism.
One of the goals of the resurgent analysis of Quantum Mechanics is the complete determination of the discontinuity structure of the quantum periods we just outlined. However, in order to solve Schrödinger spectral problems exactly, one need to find a way to use the all-order resumed quantum periods in a meaningful way. This needed key ingredients typically takes the form of functional equations relating all the WKB periods together, i.e.
Q pV γ 1 , . . . , V γr q " 0 (2.25) which are called exact quantization conditions. A standard way to derive them is to consider that the wave function is decaying at˘8 along a ray in the complex plane, applying the Voros-Silverstone connection formula at each turning points, as is done in [28] for example. We will provide a brief presentation of this method in appendix B. An alternative and equivalent way to derive EQC is to relate Stokes regions, crossing Stokes lines around turning points as is done in [6,[9][10][11] (Knoll-Schaeffer connection method). For a recent paper exploring the connections between EQC arising in the exact WKB context and the other nonperturbative approach to Quantum Mechanics, i.e. saddle point analysis in the Euclidean path integral formulation, see [30]. Typically, there are multiple EQC corresponding to different lateral Borel resummations. A very non-trivial check for this kind of EQC is to see if we can go from one EQC to the others by the use of the Delabaere-Pham formula (2.22). We will show a concrete example of this in the context of the cubic oscillator in section 4.1.1.
The periods are depending on but also on the moduli of the WKB curve, including the energy. This means that the constraint (2.25) is selecting a codimension onewe will assume discrete 7 -submanifold in the moduliˆ space. If we fix every moduli parameters excepted the energy, the EQC (2.25) is drawing an infinite discrete family of curves, parametrized by p , Eq and labeled by the quantum number n. Normally, one wants to compute the energy spectrum as a function of : E n p q, slicing the p , Eq plane along the vertical axis, leaving an infinite tower of energies. But one can notice that nothing is preventing us from doing the contrary, reversing last relation, thus extracting the "Planck spectrum" n pEq. In fact, as we shall soon see, the unknown functions intervening in the TBA equations -main actors of the present paper -are functions of the variable θ "´logp q. It is then more natural to adopt the later convention and compute what we will be calling the "Voros spectrum" θ n pEq, as in [15]. To connect a TBA result with a standard quantum mechanical control result, we can simply check that where E is to be tough as a parameter of the WKB curve and E (c) p q is the control computation that take a value as an input and output the standard energy spectra. For our purpose, we will use the methods decribed in appendix D, basically diagonalizing the Hamiltonian in the harmonic oscillator basis, in order to compute the spectra E (c) n numerically and control our results. In section 4, we will typically present tables of the levels E (c) n , normalized to 1 in the sense that we divide them by the WKB curve parameter E, using the Voros level m, i.e. 1 such that we can check that its diagonal is indeed respecting within the numerical precision.

The TBA equations as a solution of a Riemann-Hilbert problem
The goal of this paper is to provide an exact non-perturbative solution to the Schrödinger spectral problem 1.1 for arbitrary polynomial potential. As we already mentioned, if the degree of V pqq is d, the WKB curve (2.9) for this problem is a hyperelliptic curve defining a Riemann surface Σ WKB of genus X d´1 2 \ . At first, let us assume we are in a very special region of the moduli space: the "minimal chamber", in which all the turning points of V pqq are real and distinct. An example of such a configuration can be found in the figure 2a, with the relevant cycles shown in figure 2c. We shall extend the result found here later, in the section 3, by analytical continuation. In the minimal chamber, we can always organize our turning points q i , i P t1, . . . , du such that The only relevant d´1 periods in this regime are obtained integrating along the cycles γ a,a`1 , a P t1, . . . , d´1u, where γ i,j denotes a cycle encircling the tuning point q i and q j . In the following, γ i,j will often be omitted in expressions of the form Q γ i,j , preferring Q i,j for shortness of notation.
In order to make the computation more tractable, we will use the "masses" conventions, defined below, as long as we are in the minimal chamber (i.e. in the rest of this section), following the conventions in [15]. The name masses is reminiscent of similar quantities in two-dimensional integrable theories and is borrowed for this reason. The masses m a,a`1 are defined as following, depending on the parity of a: with the branch cut prescriptions and the cycle orientations chosen so that (2.30) are all real and positive. Note that we are however switching for an equivalent "periods" formulation (i.e. using the classical periods Π p0q γ ), following the conventions in [27], once we are analytically continuing the problem outside of the minimal chamber.
The starting point for deriving the TBA equation is the Delabaere-Pham formula (2.22). The WKB periods in the classically allowed region (corresponding to the red cycles in figure 2c) are not Borel summable, as stated by (2.22), and the discontinuity is expressed only in terms of the other periods. In the minimal chamber, (2.22) simplifies considerably and involves only the (at most 2, 1 for the extremities) "tangent periods" corresponding to encircling the classically forbidden region (corresponding to the blue cycles in figure 2c). In the language of Stokes automorphisms, (2.31) which translates into disc pΠ 2k´1,2k q p q "´i x2k´2, 2k´1y logˆ1`expˆ´i Π 2k´2,2k´1 p q˙i x2k, 2k´1y logˆ1`expˆ´i Π 2k,2k´1 p q˙˙(
Note that this formula is intended to work only on a ray of the complex plane, the real axis in this case. Nonetheless, remember that we are considering a formal power series in 2 , such that a similar formula also holds for the negative real axis. Finally, we can repeat this analysis almost verbatim along the imaginary axis (positive and negative) : let's notice that a rotation Ñ i is simply exchanging the classically allowed and classically forbidden region, hence exchanging the odd and the even cycles in (2.31) and (2.32). Thus, we can unify these Delabaere-Pham formulae in one unique formula along the direction φ " π{2 by defining the "pseudo-energies" or " -functions" as where θ " expp´ q. Notice that, because of (2.33), if we find the -functions, we also find the Borel resumed all order WKB periods. The resulting unified Delabaere-Pham formula is then disc π{2 a,a`1 " L a´1,a pθq`L a`1,a`2 pθq (2.34) with L a,b pθq " log p1`exp p´ a,b pθqqq and, because of the intersection cycles, L 0,1 pθq " L d,d`1 pθq " 0. A similar formula can be obtained along the´π{2 direction. The equation (2.34), together with the asymptotic property a,a`1 pθq´m a,a`1 exppθq " Opexpp´θqq as θ Ñ 8 (2.35) produce a Riemann-Hilbert problem, the solution of which is given by a,a`1 pθq " m a,a`1 exppθq´K ‹ L a´1,a pθq´K ‹ L a`1,a`2 pθq (2.36) where the convolution ‹ with the kernel K is defined as One can very easily notice that the TBA system (2.36) is indeed the "conformal limit" (i.e. 2 coshpθq Þ Ñ exppθq) of the AdS 3 TBA system (appearing in e.g. [23,27]), as stated in the introduction. Since the "wall-crossing" procedure follow the same pattern in both cases, this fact will stay true outside the minimal chamber.

The TBA equations as a generalization of the ODE/IM correspondence
In this section, we repeat the arguments presented in [15] with a few changes of notation. We want to study the Schrödinger equation (1.1) provided that the potential is a degree d polynomial. Getting rid of the q d´1 term by a shift and scaling u d Þ Ñ 1, it is always possible to rewrite (1.1) in the canonical form´ where u is the vector of u a , a P t1, . . . , d´1u. (2.39) is analogous to the " 1 Schrödinger equation˜´B obtained by the scaling First, let's study the equation (2.40). It is connecting with the usual ODE/IM correspondence in the particular case where b 0 ‰ 0 but b a " 0 for a ‰ 0 (i.e. the potential is a pure polynomial). The WKB expansion of (2.40) yields for the exponentially decaying solution at positive infinityỹ pbq d even (2.43) and the coefficients B n pbq defined such that which acts on the coefficients B n pbq as With the use of Symanzik rotation, we can extend the solution (2.42), valid in S 0 , to the d`2 sectors S k defined as Explicitly, the extended solutionsỹ k arẽ A general property of Wronskians is that the Wronskian of two solutions is independent of z:W where we remind that the Wronskian of two differentiable functions is defined as W pf pzq, gpzqq " f pzqg 1 pzq´f 1 pzqgpzq. Furthermore, it is not too hard to evaluate (2.49) when k 2 " k 1`1 " k`1:W k,k`1 pbq " Now, let us introduce f rns pz, bq as a short hand notation for the function with rotated arguments f rns pz, bq " f pω´n 2 z, ω´n 2 pd´aq q (2.51) such that one can proveW and deduce the following Plücker type relation .
We will now introduce the Y -functions associated with (2.40) as By the definition (2.54),Ỹ a " 0. Becauseỹ n`d`2 pzq 9ỹ n pe´2 πi zq "ỹ n pzq, we also havẽ Y d " 0. As a result, we have d´1 Y -functions leading to a Y -system of the A d´1 -type, reproducing in the pure potential case the Y -system of the usual ODE/IM correspondence, as stated above.
However, because of the rotated arguments (introduced through the f rns notation), the moduli in the r.h.s of (2.55) are not the same than in the l.h.s. and the Y -system is not closed. In order to circumvent this problem, let's go back to the equation (2.39), including the extra parameter . First, we can relate the solutionsỹpz, bq and ypq, u, q using the scaling (2.41): Noticing that the Symanzik rotation (2.45) are just a rotation of , i.e. that one can extend the solution ypq, u, q to other sectors of the complex plane using y k pq, u, q " ypq, u, e iπk q (2.58) The associated Wronskian, W k 1`1 ,k 2`1 pu, q "W k 1`1 ,k 2`1 pbq, is then W k 1`1 ,k 2`1 pu, q " ´2 d`2 W py k 1 pq, u, q, y k 2 pq, u, qq (2.59) and we can define the Y -functions as Y 2n pu, q "ˆW´n ,n W´n´1 ,n`1 W n,n`1 W´n´1 ,´n˙p u, q Y 2n`1 pu, e´i π{2 q "ˆW´n´1 ,n W´n´2 ,n`1 W n,n`1 W´n´2 ,´n´1˙p u, q (2.60) such that they satisfy the functional equations Y a pu, e iπ{2 qY a pu, e´i π{2 q " p1`Y a`1 pu, qq p1`Y a´1 pu, qq (2.61) with Y 0 pu, q " Y d pu, q " 0 as in the Y -system (2.55). This time, unlike (2.55), the Ysystem (2.61) is involving the same u k parameters on both sides.
The ultimate goal of this section is to derive the TBA equations (2.36). Now that we found the Y -system (2.61), we need to convert it into a TBA system. To achieve this, we still need to make the -functions and masses (2.30) appear. Let us look at the low behaviour of the Y -functions. In a sense we shall make very precise soon, the small regime in this section corresponds to the large θ regime in the previous section. We should then have an equivalent formulation of the asymptotic property (2.35) containing the masses and -functions. In order to evaluate the asymptotic behaviour of the Y -functions, we need the Wronskian which means we need the asymptotic solutions. Proceeding to the WKB expansion of y k at small , one gets y k pq, u, q " p´1q where¯denotes in which Riemann sheet q lives and s k P S k . Using this form of y k pq, u, q, one can evaluate the Wronskian W k 1`1 ,k 2`1 pu, q then the Y -functions using (2.60). Their asymptotic behavior for Ñ 0, valid for |argp q| ă π, is where we omitted the dependencies on the moduli u k . The Y -system translates to a,a`1 pe iπ{2 q` a,a`1 pe´i π{2 q " log p1`Y a´1 p qq`log p1`Y a`1 p qq " L a´1,a p q`L a`1,a`2 p q (2.65) We can conclude by setting " e´θ , Y a " e´ a,a`1 pθq (2.66) which is coherent with L a,b pθq " log p1`exp p´ a,b pθqqq as it has been already defined previously. Convoluting (2.65) with the kernel Kpθq defined in (2.37) and using the analyticity of yields the TBA system (2.36) and complete our derivation.

Preamble on notations
In order to make the equations in the present section more readable, we will group the couple of indices into one "edge" index: quantities of the form Q i,j will sometime be written as Q paq , where paq is to be understood as the ordered couple pi, jq with j ą i, corresponding to a cycle encircling the turning points q i and q j . The orderedness of paq is due to the fact that the quantities Q i,j are typically antisymmetric since they are involving integration over cycles, i.e. Q i,j "´Q j,i . Later, when developing the theory of TBA graphs, the indices paq will be representing oriented edges. The natural way to represent such edges, because of their antisymmetric nature, is the structure we just mentioned. In other words, we have a one to one map between quantities Q pi,jq and Q pj,iq , hence then can be used interchangeably and we make the choice to use the canonical form where j ą i.
In previous sections (where we were in the context of the minimal chamber), we used notation of the form Q i,i`1 , notation that seems more cumbersome than it should be since one could use a unique index i instead. But later, when we lose the ordering property of the turning points (2.29) (because some of them are sent into the complex plane), we will find out that new relevant cycles are appearing into TBA systems and having two indices will be helpful in order to link together arbitrary turning points instead of limiting ourselves to consecutive ones. Additionally, we introduce this edge index notation Q paq because it will be useful for writing more general TBA system in a concise way, especially when summing (so we can sum over the appropriate set of edges). For example, the TBA system (2.36) can be written as where paq " pi, i`1q and i P t1, . . . , d´1u are labeling the d´1 relevant cycles in the minimal chamber and where s paq d " tpi´1, iq, pi`1, i`2qu " tpa´1q, pa`1qu is the set of the edges "tangent" to the edge paq and where we defined addition on the element paq, pa`nq, as a short hand for pi`n, j`nq. This notation will be especially useful when the kernel depends on two distinct cycles (thus will have two edges indices). As we shall soon see, we can write these kind of TBA in the following compact form: where K paq,pbq is a carefully selected kernel, paq " pi, i`kq, i P t1, . . . , d´ku, k P t1, . . . , d´1u and S d the set containing the dpd´1q{2 possible nonequivalent oriented edges. When there is no kernels or sums and that the two indices are explicitly specified, we will prefer Q i,j to Q pi,jq for shortness of notation.
Of course, one could use four indices, writting K ijkl instead of K paq,pbq " K pi,jq,pk,lq , but when we leave the edges unspecified (as mute variable in sums for example) the edge index notation is a little bit more compact, natural and reminiscent of a traditional vector-matrix multiplication. Alternatively, as in [15], one could use only one index and write quantities Q paq as Q a , with a P t1, . . . , dpd´1q{2u, which is even more compact, but at the cost of transparency (it is harder to see which turning points are involved once we are grouping the edges paq consisting of pairs into only one larger list). In our opinion, the ordered pair paq " pi, jq with j ą i is the most natural way to describe more complicated TBA equations and related quantities, especially in the so-called maximal chamber regime, for which the TBA system is the most intricate.

Analytical continuation of two TBA equations in the mass representation
The equations (3.1) hold as long as we are in this special region of the moduli space where all the masses are real -or equivalently where all the turning points of V pqq are on the real axis -i.e. in the minimal chamber. We can analytically continue the TBA system outside this region of the moduli space. Doing so, the d´1 masses are acquiring a complex part, and we can decompose them into their usual polar form: m paq " m paq e φ paq , paq " pi, i`1q and i P t1, . . . , d´1u We also introduce the shifted functioñ such that˜ paq pθq " m paq in the large θ limit. Rewriting (3.1) with the shifted functions yields˜ paq pθq " m paq exppθq´ÿ where we are convoluting with the kernel K paq,pbq pθq " Kpθ`ipφ pbq´φpaq qq " 1 2π As long as φ paq´φpa˘1q ă π{2, the modified TBA system (3.5) holds and the analytical continuation is trivial. However, notice that we are hitting a pole once we cross φ paq´φpa˘1q " φ paq,pa˘1q " π{2 and we have to modify the TBA system in order to incorporate this non-trivial contribution.
Let us proceed to the analytical continuation of two consecutive TBA equations as an exercise. Let's say the˜ paq and˜ pa`1q equations, with paq " p1, 2q. As φ paq,pa`1q crosses π{2 (hence φ pa`1q,paq crosses´π{2), we pick the pole contribution from the kernel and modify the˜ paq and˜ pa`1q accordingly: where the subscript˘indicates a shift of˘iπ{2 in the argument, i.e.
f˘pθq " f˘ˆθ˘i π 2˙( 3.9) The resulting system of d´1 TBA equations is not closed anymore. On could close the TBA system by adding the two additional equations corresponding to˜ 1 ,2`θ`i φ p1,2q,p2,3q´i δȃ nd˜ 2 ,3`θ`i φ p2,3q,p1,2q`i δ˘, thus obtaining a TBA system with d`1 equations. But there is a clever way to close this system using d equations instead, as it was done in [17]. By redefining a new set of Y -functions (related to the -functions through Y paq " e´ paq , see (2.66)) one can absorb the new source terms in the LHS. This set of new Y -functions is Rewriting (3.5) with the new functions, then omitting the superscript n, one find that the two concerned TBA and their neighbor (there is only one in this case: p3, 4q) are modified: The rest of the system stays the same. In order to get the additional TBA equation, one need to consider the sum (3.7)`(3.8), evaluated at θ Þ Ñ θ`iφ p1,3q,p1,2q and θ Þ Ñ θ`iφ p1,3q,p2,3q´i π{2 respectively, yielding 3 . This last definition for the mass is better understood in the period representation where Π 1,3 " Π 1,2`Π2,3 .
As an application, let's write the TBA system for the cubic potential (d " 3) in the maximal chamber: 1,2 pθq " |m 1,2 | exppθq´K p1,2q,p2,3q ‹L 2,3 pθq´Kp 1,2q,p1,3q ‹L 1,3 pθq 2,3 pθq " |m 2,3 | exppθq´K p2,1q,p1,2q ‹L 1,2 pθq´K p2,1q,p1,3q ‹L 1,3 pθq 1,3 pθq " |m 1,3 | exppθq´Kṕ 1,3q,p1,2q ‹L 1,2 pθq´K p1,3q,p2,3q ‹L 2,3 pθq The mass representation has the advantage that it is convenient to use in the minimal chamber, and it is easy to define the branch cuts and orientations prescription: all the masses are real and positive by definition in the minimal chamber. Furthermore, the kernel takes a particular simple form in this regime. But it also have some drawbacks: the masses are pairing in an unnatural way. Worse, we have these shifted kernels K˘after wall-crossing, which require additional data in the form of the matrix xpaq, pbqy˘. Notice that one can encode all the TBA system in any chamber writing the TBA equations in the compact form by defining the kernel to be K paq,pbq pθq " 1 2π xpaq, pbqy I cosh`θ`iφ pbq,paq`x paq, pbqy˘˘( 3.14) All the data of the TBA system is contained in two matrices. On one hand the matrix xpaq, pbqy I , encoding the intersection of cycles; it is symmetric and can take the values 0, 1 or 2. On the other hand, xpaq, pbqy˘, encoding the shifts on the argument of the kernel K˘; it is antisymmetric and can take the values˘iπ{2 or 0. By using the period representation, one can encode any TBA system using a unique antisymmetric matrix xpaq, pbqy with values 2,˘1 or 0. For this reason, we shall now depart from our present conventions (the one in [15,23]) in order to adopt the period formulation (used in [27]).

Analytical continuation of two TBA equations in the period representation
Instead of the masses (2.30), we are now going to use the classical periods where we omitted the superscript p0q and where ű paq denotes an integration along the cycle encircling the two turning points contained in the edge index paq. We slightly change our conventions for the contours orientations and branches prescriptions: we chose them such that the periods corresponding to cycles encircling the allowed (resp. forbidden) region is real (resp. imaginary) and positive. Equivalently, it simply comes down to multiply the even masses of the form m 2k,2k`1 by i in our previous representation. We want to write our complex periods in the polar coordinates: In the minimal chamber, the argument ϕ paq is either 0 or π{2 with the prescription adopted above, such that ϕ paq " φ paq or ϕ paq " φ paq`π {2 depending if paq is selecting a classically allowed or forbidden region. In order to take into account the fact that the periods are already complex in the minimal chamber, we have to define an index-dependent kernel from the start: which is obviously equivalent to the kernel (2.37) in the minimal chamber 8 with the appropriate choice of sign for the intersection (antisymmetric) matrix xpaq, pbqy; for now it can only take the value˘1 (the cycles are intersecting) or 0 (no intersection of cycles). If we rewrite the TBA equations for a system in the minimal chamber in the following waỹ where s d " tpi, i`1qu with i P t1, . . . , d´1u (i.e. the set of all the relevant couplings in the minimal chamber), then the system (3.18) is equivalent to the system in (3.5) if the intersection matrix is a tridiagonal antisymmetric matrix xpa`kq, pa`k`1qy " p´1q k " ´xpa`k`1q, pa`kqy; xpaq, pbqy " 0 otherwise. A graphical representation of such matrices can be fond for d P t3, . . . , 8u in figure 7: the pd´1qˆpd´1q matrix in the uper left corner (delimited by the black lines) is p´1q d´1 xpaq, pbqy. The sign of the intersection matrix xpaq, pbqy is correlated to the sign of ϕ paq,pbq .
We just reformulated our minimal chamber TBA system using the classical periods instead of the masses. Let us now proceed to its analytical continuation. This time, because of the modified kernel (3.17), we hit a pole when ϕ paq,pa`1q crosses 0, i.e. when the phases of the periods align (this fact will be important for the diagrammatic procedure in section 3.5). As for the masses case, we will focus on the paq " p1, 2q case that is coupling 1,2 and˜ 2,3 together. Appart from the small convention modifications, we can reproduce the story of the previous section verbatim. Deforming the contour and picking the pole leads to additional source terms.

3.20)
As before, they can be absorbed by defining new Y -functions (hence new -functions through Y paq " e´ paq ): except that the˘superscrip in (3.21) is no longer describing a shift by˘iπ{2 as in (3.10) but a shift by˘iϕ p1,2q,p2,3q "¯iϕ p2,3q,p1,2q . Besides, one can notice that in the additional source terms in (3.19) and (3.20) as well as in the new Y -functions definition (3.21), one does not need this˘iπ{2 shift anymore. Plugging (3.21) into (3.19) and omitting the superscript n, one gets the reformulated version of (3.11) and the new TBA equation involving˜ 1,3 and the additional period Π 1,3 " Π 1,2`Π2,3 is obtained by adding˜ 1,2 and˜ 2,3 , with the appropriate shifts. One finds In fact, the lack of˘iπ{2 shifts allow us to rewrite the general analytic continuation of the couple p˜ pi,i`1q ,˜ pi`1,i`2q q leading to the additionnal TBA equation˜ pi,i`2q "˜ pcq in a nice and compact manner: where the paq P A and A is the set including the four couples pi`k, i`k`1q with k P t´1, 0, 1, 2u. The rest of the TBA system is unchanged. As a final simplifying remark, let's notice that we only selected the explicitly non-zero kernels in the system above. If we allow for null kernels (through the intersection matrix xpaq, pbqy), one can simply defines the set of the r relevant coupling in the minimal chamber: s d " tpj, j`1qu with j P t1, . . . , du, and extend it with the new pair pcq " pi, i`2q. The system (3.24) reduces tõ where paq P s d Y pcq such that it is unifying the d TBA equations into the same expression.
All the terms that are not appearing explicitly in (3.24) are put to 0 through the intersection matrix xpaq, pbqy included into the definition of the kernel (3.17). In the next section (section 3.4), we will prove that we have at most dpd´1q{2 TBA equation for the maximally involved TBA system describing the resumed WKB periods of a degree d polynomial. In other words, it means that one can encode any TBA system in the (at most) dpd´1q{2ˆdpd´1q{2 dimensional intersection matrix. We will explain how to find this matrix graphically in the section 3.5, then we will proceed to write it for an arbitrary degree d polynomial.

Number of TBA equation and the associated region in the moduli space
In the minimal chamber, for a polynomial with d roots, they are only d´1 relevant pairings of these turning points, corresponding to the d´1 couples of successive turning points i.e. of the form pi, i`1q. This is the a priori minimal number of TBA equation 9 one need to solve in order to resum the quantum periods, hence the "minimal " in minimal chamber. One can see the wall-crossing procedure presented above as a way to form (TBA equations that are involving) the desired additional pair of turning points, hence period. By repeating the process, one can continue to produces the desired periods until one obtains the appropriate TBA system. For a number of TBA equation ą d´1, we will designate the corresponding region in the moduli space as the intermediate chamber. However, this process can't continue forever. Indeed, after the d´1 pairs of the form pi, i`1q, one can add the pairs of the form pi, i`2q, pi, i`3q etc. until one reaches the last possible pair: p1, dq. Thus, all the possible non-equivalent pairs can be labeled by pi, i`kq with i P t1, . . . , d´ku, k P t1, . . . , d´1u. We call this set S d , and it has exactly ř d´1 n"1 n " dpd´1q{2 elements. We will call a TBA system with exactly this number of TBA equation in the maximal chamber.   In (a-b), we plot the triple well potential (blue curve) along with the energy (green line) and real turning points (black dots). In (a), the energy is below the wells and there are 6 real turning points since the potential is a sextic polynomial. If we increase the energy above the wells, we end up in the case (b) where the turning points are moved into the complex plane. In (c-d), we plot Im ppxq for the different energy configurations and the associated relevant cycles along wich we are integrating in order to get the periods. The branch cuts are drawn as black squiggly lines and the turning points as black dots. In (c) we draw the cycles of the periods corresponding to the classically allowed (resp. forbidden) region as dashed red (resp. blue) cycles. The cycles in (c) are corresponding to the red cycles in (d) after analytical continuation. The cycles in (d) are squished into lines between turning points for clarity.
We explain in section 3.3 that we can encode any TBA system using a (at most) dpd´1q{2ˆdpd´1q{2 dimensional matrix. Indeed, it is always possible to write any TBA system in the form˜ and paq P S d . Of course, if the system is not in the maximal chamber, we can select the appropriate subset of S d and the system (3.26) reduces to a simpler one.

Wall Crossing as a diagrammatic procedure
In the previous sections (3.3 and 3.2), we derived in great detail the standard procedure to follow in order to analytically continue the TBA equations outside the minimal chamber. However, this process can be quite cumbersome to carry on multiple times using only φ (2,3), (3,4) φ (1,2), (2,3) φ (3,4), (4,5) φ (4,5),(5,...) algebra, especially when the degree of the polynomial of interest is large (the number of times we have to wall-cross is increasing with the square of d for the maximal chamber). For example, if one was supposed to analytically continue the TBA system for the sextic potential from the minimal chamber to the maximal chamber, one would need to repeat the wall-crossing process ten times! In order to make this process simple, tractable and less prone to errors, it is a good idea to abstract it into a diagrammatic procedure. The purpose of this section is to provide simple rules that accomplish just that, inspired by Jonathan Toledo's thesis [27]. The diagrammatic rules could in principle accommodate the mass formulation of the TBA equations. Yet, we found the diagrammatic process easier to carry on using the period formulation. We shall then use it in the following.
First, let us define how to associate a TBA system with a diagram. The starting point is Toledo's idea consisting of drawing the successive periods in the minimal chamber configuration as two dimensional vectors pRe Π paq , Im Π paq q, starting with Π 1,2 placed at some origin point, then arranging the next vectors of periods tail to tip, i.e. the endpoint of a given period vector is the starting point of the next. In the minimal chamber, this construction produces some kind of "stair" diagram, because we alternate between classically allowed and forbidden regions, such that if ϕ paq " 0, then ϕ pa`1q " π{2 etc. Therefore, the angle difference ϕ paq,pa`1q "˘π{2 @a in the minimal chamber. The diagram should look like the figure 3 at this point.
We can abstract this construction a little bit further. Indeed, the length Π paq , if intervening into the associated TBA equation through the Π paq exppθq term, will not be relevant to derive the TBA system (the length of the periods vector is always confined in the "length" term, the structure of which stays unchanged whatever the TBA system is). All we need to find using this diagrammatic procedure is the intersection matrix xpaq, pbqy. Furthermore, the global orientation is inconsequential, and one can even "locally" transform the angles ϕ paq,pa`1q , but at a crucial condition. As we have already stated, as we are deforming the integral contour, the kernel (3.17) hits a pole when ϕ paq,pbq " 0, and we want to keep that property of paramount importance. Therefore, we are allowed to Figure 4: Four TBA equations in the "stair" configuration with arbitrary TBA graph attached at the end points vertices i´1 and i`3 (green and blue disks). We are analytically continuing from the left TBA graph, where ϕ pi,i`1q,pi`1,i`2q ‰ 0, then we cross the 0 angle, where the periods are aligning (red dashed line); appling the Wall-crossing rule, we end up with an additional TBA equation for pi,i`2q (red full line) in the TBA graph on the right. If the discs are other "stairs", this is corresponding to the morphing from the minimal chamber as presented in section 3.3.
transform these angles as long as the transformed difference of angles f paq,pbq pϕ paq,pbq q is 0 exactly when the untouched difference of angles is 0 and nowhere else 10 . We can throw all these transformed diagrams into the same class of equivalence, which defines a new, more abstract, diagrammatic object. The later is a lot more flexible but just as useful at the task of deriving the morphed TBA equations. If this diagrammatic object has a little bit more structure than a graph (because of the angle property), we will call it the TBA graph nonetheless, by abuse of notation and with the purpose of using some graph lingo, like edge and vertex. In this regard, each turning point is symbolized by a vertex q i and each TBA equation is symbolized by an edge paq " tq i , q j u " pi, jq. With this in mind, it is time to state the very simple first diagrammatic rule: the connection rule.
1. Connection rule: the intersection matrix xpaq, pbqy "˘1 if and only if the edges paq and pbq are connected (i.e. they share a common vertex).
The precise sign depends on the sign of ϕ paq,pbq . One can check that the TBA graph in figure 3 is indeed reproducing the TBA system in the minimal chamber: since the edge paq is connected to the edges pa˘1q, we find this tridiagonal antisymmetric structure we found previously (the anti-symmetry of the intersection matrix is a direct result of the anti-symmetry of ϕ paq,pbq ).
Now that we are armed with the TBA graph and its first rule, let us show how and under what additional rules it is reproducing the wall-crossing procedure. As stated before, Figure 5: Analytical continuation crossing two consecutive period alignments around the same "pivot" vertex. The blue and green discs are arbitrary TBA graphs. Crossing the second alignment angle produces an intersection from which we can extract an additional entry of the intersection matrix through the intersection rule. Notice that we could have generalized this diagram, having k green discs (linked or not) instead of only two. One would have obtained k additional TBA equations after morphing the TBA equation attached to the blue disc around the "pivot" vertex, k´1 of which would be intersecting the further right TBA equation with linked green disc, k´2 would be intersecting the second TBA from the right etc.
nothing really dramatic happens as long as ϕ paq,pbq is not crossing 0. But when it does, we get an additional function. To be precise, when ϕ pi,i`1q,pi`1,i`2q cross 0, we get an additional TBA equation involving the new pi,i`2q . This new pseudoenergy is coupled with four of the "neighbour" TBA, as defined in (3.24). That's the whole story of section 3.3. Let us reproduce this procedure by stating the second diagrammatic rule: the wall-crossing rule.
2. Wall-crossing rule: when the edges pi, jq and pj, kq cross their common alignment line, one add the new edge pi, kq to the TBA graph.
Of course, pi, jq and pj, kq are aligning exactly when ϕ pi,jq,pj,kq " 0. This means that, with the addition of this rule, the TBA graph is at least modified at the right time. Now we can use the connection rule to verify if we are reproducing the correct TBA. Before applying the wall-crossing rule, we are in the following situation: two connected edges, pi, jq and pj, kq, are aligning. They are themselves possibly connected to other edges through the vertex i and k, but let's assume for now that the edges pi, jq and pj, kq have only one neighbor each, pm, iq and pk, nq (this is the case in the minimal chamber for example, where m " i´1, j " 1`1, k " 1`2 and n " i`3). Applying the wall-crossing rule, we draw an additional edge pi, kq. Now, we can read the new TBA system by applying the connection rule hence updating the intersection matrix. The TBA equation associated to the new edge is coupling the four neighbor together and no other. This is the case in (3.24). Only the four neighbor are morphed by this wall-crossing. This is still the case in (3.24). The whole story of section 3.3 is in fact reproduced by the diagrammatic process presented in We stated a "construction rule" (the wall-crossing rule), that is allowing us to analytically continue a TBA graph, and a "reading rule" (the connection rule) that provides a way to read a TBA graph and make it corresponds to a TBA system. However, we still miss an ingredient in the reading side to complete the story and have a correct correspondence between TBA graphs and TBA systems. The third and last diagrammatic rule is taking care of this missing element and complete the translation. We purposefully put an important detail under the rug until now: there are some˘2 elements appearing in the intersection matrix for some TBA systems. This is a new effect that is not predicted by our current set of rules. As an exercise, one can start by working out the simpler case where this new effect takes place: the quartic potential (d " 4). After the first wall-crossing, we are in the situation described diagrammatically by a triangle with an unique leg, corresponding to the TBA system (3.24) and containing 3`1 " 4 equations (this is the starting configuration of figure 5 with empty discs). By repeating the wall-crossing procedure algebraically two more times, one obtains the following TBA system corresponding to a quartic potential in the maximal chamber: where we omitted the θ dependence on the convolutions and the tildes for shortness, and where we factored out the intersection matrix xpaq, pbqy in the definition (3.17) for clarity.
Here, all the terms are correctly predicted by our two diagrammatic rules, except two terms with coefficient˘2 (in red). If we repeat this exercise with other TBA systems, the same phenomenon occurs each time we have to wall-cross two (or more) successive edges attached to the same vertex, thus creating intersecting graphs. To take these coefficient 2 terms into account, one can add the third and final diagrammatic rule to our current set: the intersection rule.
3. Intersection rule: the intersection matrix xpaq, pbqy "˘2 if and only if the edges paq and pbq are intersecting.
Let us review the diagrammatic process explained and justified above in a compact paragraph. The rule two -the wall-crossing rule -is a "construction rule". One could start with any TBA graph and apply it as much as needed in order to end up with the required morphed TBA graph. Once this process is finished and the final TBA graph is obtained, one can read it using the "reading rules" one and three -the connection and intersection rules -encoding the intersection matrix thus encoding the full TBA system.  Figure 6: Analytical continuation of the TBA system corresponding to a sextic (d " 6) potential, from the minimal chamber (far left) to the maximal chamber (far right). There are multiple possible analytical continuations that lead to the maximal chamber; in this specific example, we chose to analytically continue around the "pivot vertex" 2, i.e. when ϕ p1,2q,p2,3q " 0, then the "pivot vertex" 3 etc. Because of the wall-crossing rule, we are obtaining one additional equation at step one, two at step two etc. After four of these steps, we are finally in the maximal chamber. The TBA system is then consisting of 15 TBA equations, corresponding to the maximal graph with 6 vertices (graph on the far right).
As an example, let's apply this procedure on some polynomials potential: from the cubic up to the octic potential and from the minimal chamber all the way to the maximal chamber. The first step is to find the associated TBA graph. A specific example is provided for the sextic polynomial in figure 6, and we end up with the maximal graph with 6 vertices. This is always the case for any polynomial of degree d, with one exception if we are talking about stricto sensu graphs: the quartic. In proper graph theory, the maximal graph formed by 4 vertex is planar, hence having no intersecting edges. This is not possible with our TBA graphs defined above because of the alignment property. Otherwise, the TBA graph of a degree d polynomial in the maximal chamber is equivalent to a complete graph with d vertices.
Now that we have obtained the TBA graph, we can read the TBA system encoded in it by applying the connection and intersection rule. Remember that the intersection matrix is antisymmetric, therefore one only has to find a little bit less than half of the matrix elements 11 . First, let us use the connection rule to set all the matrix elements that are equal to˘1. Read row after row (or column after column) -starting from the colomn (or row) k`1 if you are considering the row (or column) k, i.e. one square after the diagonal in case you want to save time by computing only the independents elements -if there is only one shared vertex in the associated column (resp. row) entry, put a 1 12 . In the sextic case, if we are considering the row p1, 2q for example, look for every edge that is containing either 1 or 2 (but not both) in the corresponding column, i.e. p2, 3q, p1, 3q, p2, 4q, p1, 4q, p2, 5q, p1, 5q, p2, 6q and p1, 6q. This specific example is contained in figure 7 (first line/row of the sextic potential). At this point you are already done with d TBA equation, since the 11 Since the matrix is a NˆN antisymmetric matrix with null diagonal and N " dpd´1q{2, one need to identify exactly dpd´1qpd 2´d´2 q{8 independent matrix elements. 12 If both are the same, this is obviously a diagonal element, which is 0.
concave hull of the polygon formed by the d vertices provides necessarily non-intersecting edges 13 . Furthermore, every row (column) should have exactly 2pd´2q entries set to one at this point: since every vertex is shared between d´1 edges in the maximal chamber, each edge formed by a given couple of vertices will be connected to d´2 different edges through each of its two vertices. With the explication above, one can see that the matrix elements for the signless connection matrix (the˘1 part of the full intersection matrix without taking into account the sign) is then simply given by: with i P t1, . . . , d´ku, j P t1, . . . , d´lu, and k, l P t1, . . . , d´1u. An example of this structure for d P t18, 19u can be observed in figure 11 by looking at the teal and orange entries as 1, 0 otherwise. In order to take care of the˘2 elements, chose a row (or column) associated to an edge inside the convex polynomial hull but not on the boundary (hence with intersection), then check all the columns (or rows) -after the diagonal and not already set to one. Put a two if the column edge and the row edge are intersecting in the TBA graph. Let's consider the sextic example once more: if one start with the row corresponding to the edge p2, 5q, one have to put a 2 in the column corresponding to the edges p3, 4q, p1, 5q, p2, 6q and p1, 6q. Finding the exact number of intersection for any edges, i.e. the number of elements set tȏ 2 in a given row/column, is a little bit more involved than finding the number of matrix elements set to˘1. Let us open a parenthesis about it in the next paragraph.
First, note that because of the Z d symmetry, this problem is not affected by which particular vertex we chose as the starting point for an edge, such that there are only d´1 non-equivalent edges in the resulting equivalence class. We will denote them as rks " pv 0 , v 0`k q with k P t1, . . . , d´1u and where v 0 is inconsequential. For our labeling purpose, the non-equivalent edge rks is obtained by connecting the starting vertex with the vertex we reach after k "jumps" along the convex polygonal hull formed by all the vertices (or equivalently, this jump can be seen as a rotation of 2πi{d with respect to the center of the polygon). Furthermore, because of the reflection symmetry, we will ultimately only need "half" of them: P d´1

2
T to be precise (we could also have started directly with the D d dihedral symmetry). This new equivalent class is obtained by identifying a "jump" in the clockwise and anticlockwise direction, and we will still denote the elements of this class by rks, but this time with k P t1, . . . , P d´1 2 T u. Each of them have a unique number of intersections. A simple recursive observation allows us to fully count them: if we call I k,d the number of edges intersecting with rks for a maximally connected polygonal containing d vertex, then I k,d`1 " I k,d`k´1 and I k`1,d " I k,d`1 the first time a new k is appearing 14 (i.e. each time P d´1 2 T increases), starting with I 2,4 " 1. Of course, I 1,d " 0 since r1s is always on the convex polygonal hull. These recursion relations imply that I k,d " pk´1qpd´k´1q. As an example, this formula predicts that for the TBA system corresponding to an octic potential in the maximal chamber we have either 0, 5, 8 or 9 13 The is why the first non trivial intersecting case is the quartic in the maximal chamber: the cubic has only d " 3 " dpd´1q{2 TBA equations.
14 It also happens to be a perfect square: I k`1,d " k 2 the first time k`1 is appearing.
terms with coefficient˘2 in a given TBA equation (corresponding to r1s,r2s,r3s and r4s resp.). This is what is observed in figure 7.
We know how to count them, but we still want to determine the exact matrix elements of this signless pure intersection matrix (i.e. without the connection part described in (3.28)). In order to achieve that, let us fix a labeling for concreteness. Let's say for simplicity that all of our vertices are the dth roots of the unity. Instead of labeling the vertices by complex numbers in the complex plane, we label them by the n in e 2πn{d . One can then define rks v " pv, v`kq in order to label the class of d´1 edges containing v 0 among its vertices. Because edges are non ordered pairs, i.e. pv, v`kq " pv`k, vq, we have the identifications rks v " rd´ks v`k . Another useful property is that the pure signless intersection matrix xrns v , rms v`k y intersection is transposed under the reflection k Þ Ñ d´k, i.e. xrns v , rms v`d´k y intersection " xrms v , rvs v`k y intersection (we used that fact during the counting of the crossings in the previous paragraph). Now, let's fix the matrix elements. The edges of the form rks v will never intersect among each other @k P t1, . . . , d´1u since they share the same starting point but are ending on a different endpoint. Furthermore, any edge on the convex polygonal hull, i.e. such that it can be written as r1s v or rd´1s v will never intersect with any edge. As a result, the pure signless intersection matrix will have a factor xrns v , rms v`k y intersection 9 p1´δ n,1´δn,d´1 qp1´δ m,1´δm,d´1 q. Additionally, because of the non ordered properties, two equivalent edges (of the form rks v " rd´ks v`k ) will never intersect since they are the same edge. The pure signless intersection matrix hence takes a factor xrns v , rms v`k y intersection 9p1´δ n,k qp1´δ m,d´k q. The procedure is splitting the pd´1qˆpd´1q matrix xrns v , rms v`k y intersection (at k fixed and arbitrary v) in four sub-matrices, delimited by the cross of zeroes introduced by the factor p1´δ n,k qp1´δ m,d´k q: where the subscript is indicating the size of the sub-matrix (of course, if one of the component is of size ď 0, the "cross" is not really splitting our matrix into 4 sub-matrices but only one square sub-matrix of size d´1 if k P t1, d´1u or d´2 if k P t2, d´2u). By studying this geometric problem (using recursions for example), one can convince himself that the rectangular matrices R piq " 0, when U is the upper triangular matrix and L the lower triangular matrix. Putting all these results together, we get the matrix elements xrns v , rms v`k y intersection "p1´δ n,1´δn,d´1 qp1´δ m,1´δm,d´1 qp1´δ n,k qp1´δ m,d´k q d´k´3 ÿ lxďly ly"0 δ n,k`1`ly δ m,2`lx`k´3 ÿ lyďlx lx"0 δ n,2`ly δ m,d´k`1`lx‹ ‹ ‚ (3.30) or, going back to the pair of vertices notation, themselves denoted by the dth root of the unity : xpv, v`nq, pw, w`mqy int. "p1´δ v,w qp1´δ n,1´δn,d´1 qp1´δ m,1´δm,d´1 q p1´δ n,ppw´vq mod dq qp1´δ m,d´ppw´vq mod dq q d´ppw´vq mod dq´3 ÿ lxďly ly"0 δ n,ppw´vq mod dq`1`ly δ m,2`lx ppw´vq mod dq´3 ÿ lyďlx lx"0 δ n,2`ly δ m,d´ppw´vq mod dq`1`lx¸(

3.31)
For the following, it will be useful to relabel our vertices, still considering them as the dth roots of the unity, but instead sorting them according to their real part then imaginary part. Doing so, 0 Ø d, d´1 Ø d´1, 1 Ø d´2 etc. and we get the following dictionary, given by the bijection An example of this structure for d P t18, 19u and the labeling defined above can be observed in figure 11.
The remaining elements (i.e. not set to˘1 or˘2 after application of the connection and intersection rules) of the triangular part of the intersection matrix xpaq, pbqy are set to 0. In order to determine the signs, you can multiply every element in this resulting triangular matrix with signpϕ paq,pbq q. Once this is done, copy in xpbq, paqy the opposite of the result in xpaq, pbqy and the full intersection matrix xpaq, pbqy is finally xpaq, pbqy " sign`ϕ paq,pbq˘` xpaq, pbqy connection `2 xpaq, pbqy intersection ˘ ( 3.33) as stated earlier by the connection and intersection rules. The associated TBA system is given by (3.26). This process is carried on for polynomials of degree d P t3, . . . , 8u in the maximal chamber and the resulting intersection matrices can be found in figure 7. In order to have a broader view of the general structure for arbitrary d, one can also look at the matrices depicted in figures 10 and 11 for larger d (d P t18, 19u in that case).

Simplifying a TBA system using symmetries
In the precedent sections, we assumed our polynomials of interest were completely general. Let us now assume they have some sort of symmetry. This symmetry will relates somefunctions together and reduces the TBA system to a simpler one, with less TBA equations.  Figure 7: The TBA graph and intersection matrices xpaq, pbqy for the cubic up to the octic (d P t3, . . . , 8u) in the maximal chamber. The intersection matrix is read from the TBA graph according to the diagrammatic rules of section 3.5. Orange, red, teal, blue and white are color coding respectively`1,`2,´1,´2 and 0. The intersection matrices are organized such that the dpd´1q{2 entries paq are, from top to bottom (resp. pbq, from left to right) pi, i`kq, i P t1, . . . , d´ku and k P t1, . . . , d´1u; we denote an increment of k by a black line. For example, the 6 entries for the quartic reads in this order: p1, 2q, p2, 3q, p3, 4q, p1, 3q, p2, 4q, p1, 4q, and the element xp2, 3q, p1, 4qy "´2.
The tilde on the or L-functions is omitted in the following. Let us consider an important class of polynomials in order to illustrate this fact: the symmetric polynomials (i.e. with the q Þ Ñ´q symmetry). In that case, because the turning points/classical periods/masses on one side are the same than on the other side, we can pair the -functions using i,i`k pθq " d´i´k`1,d´i`k pθq (3.34) By substituting the redundant -functions into the TBA system, one gets a simpler and reduced TBA system. Alternatively, one can simplify the TBA system by considering the reduced intersection matrix obtained from the full intersection matrix by deleting every row and column corresponding to the same equivalent TBA equation except from one, adding the value of of each deleted matrix element to the corresponding still existing matrix element in the reduced matrix. This intersection matrix can also be read from the TBA graph by identifying the equivalent TBA equations together. We provide two examples of such computation for the symmetric sextic and symmetric octic in the figure 8. Let us explicitly write the resulting reduced TBA system for the quartic potential. Starting from (3.27), we identify 1,2 " 3,4 and 1,3 " 2,4 since the corresponding periods/masses are also equal. We can simply substitute these identifications into (3.27) and  Figure 8: The color codded TBA graph and reduced intersection matrices xpaq, pbqy for the symmetric sextic and octic potentials in the maximal chamber. We paired the equivalent TBA equations through (3.34). This identification is denoted in the TBA graph by edges of the same color, resulting in 1 independent TBA equations in the maximal chamber case (parallel lines). Concerning the intersection matrix: yellow, orange, orange-red, dark red, light teal, cerulean, dark blue, purple and white are color coding respectively`1,`2,`3,`4,´1,´2,´3,´4 and 0. The intersection matrices are organized in the same way as figure 7, with the exception of the redundant -functions that are deleted. obtain 1,2 pθq "|Π 1,2 | exppθq`K p1,2q,p2,3q ‹ L 2,3`2 K p1,2q,p1,3q ‹ L 1,3`Kp1,2q,p1,4q ‹ L 1,4 2,3 pθq "|Π 2,3 | exppθq´2K p2,3q,p1,2q ‹ L 1,2´2 K p2,3q,p1,3q ‹ L 1,3´2 K p2,3q,p1,4q ‹ L 1,4 1,3 pθq "|Π 1,3 | exppθq´2K p1,3q,p1,2q ‹ L 1,2`Kp1,3q,p2,3q ‹ L 2,3´Kp1,3q,p1,4q ‹ L 1,4 1,4 pθq "|Π 1,4 | exppθq´2K p1,4q,p1,2q ‹ L 1,2`2 K p1,4q,p2,3q ‹ L 2,3`2 K p1,4q,p1,3q ‹ L 1,3 (3.35) where we factored out the intersection matrix xpaq, pbqy coefficients as in (3.27), i.e. the kernel is (3.17) without the intersection matrix or for clarity. Notice that in this symmetric reduction procedure, the periods/masses are exactly equal, such that the kernels are also equal, which allows us to keep that compact intersection matrix formulation of the TBA system. This is not always the case for other symmetries as we shall see. Similar statements (with appropriate modifications on the rules linking the pseudoenergies together) can be made for other symmetries. Important examples are antisymme-  Figure 9: The color codded TBA graph (taking into account the dihedral symmetry) resulting in the reduced TBA system for a monic potential of degree d for d P t3, . . . , 8u.
One can observe the P d´1 2 T different colors corresponding to the independent -functions. If one does not take into account the symmetry under reflection and only consider the Z d symmetry, one has d´1 colors instead, corresponding to the equations in [12]. try, potentials leading to a PT-symmetric Hamiltonian or -the most restrictive one and the subject of the rest of the next section -the D d dihedral symmetry of pure potentials.

Geometric and preliminary observations
In order to link our result to Dorey and Tateo equations -which is next section's goalwe still have to investigate how the TBA system simplifies when the potential is pure, i.e. in the form V pqq " aq d . In that case, we are always in the maximal chamber (as long as d ą 2) since the turning points are forming a regular convex d-gon in the complex plane. If one draw all the possible cycles between the turning points of the d-gon, the resulting graph is a complete graph like the one in figure 7. We can apply the same arguments presented in section 3.5 when we were computing the number of intersections of a given edge in a complete graph on the absolute value of the periods: because of the dihedral symmetry of the problem, we can group the dpd´1q{2 absolute values of the periods in P d´1 2 T nonequivalent elements, denoted by the equivalent classes of edge rks with k P t1, . . . , P d´1 2 T u, resulting in the independent pseudo-energies denoted by rks 15 . The rks can be read from the reduced TBA graph with P d´1 2 T color, like the ones in figure 9. Unlike the symmetric case, the periods/masses are not exactly equal: their absolute values are, but their phases 15 The Z d symmetry leaves d´1 independent TBA equations, equivalent to the equations in [12] as we shall see. The reflection reduces this number to P d´1 2 T .
are not the same. For this reason, we cannot simply reduce the intersection matrix as described in the symmetric case since some kernels will not have the same complex shift. We can however group the sum of the kernels having same L-functions as a common factor into a new kernel. Doing so, the TBA system for a pure potential takes the form rks pθq " Π rks exppθq`r d´1 2 s ÿ l"1 K rks,rls ‹ L rls pθq (3.37) where K rks,rls is the sum of kernels with common factor L rls , i.e.
K rks,rls pθq " Where the sum ř bPrls is to be understood as a sum over every edge pbq that is in the equivalence class rls (same color in the TBA graph). In other words, instead of a dpd1 q{2ˆdpd´1q{2 intersection matrix of coefficients, we can encode the reduced TBA system with a P d´1 2 TˆP d´1 2 T matrix of kernels K rks,rls pθq. Since the ϕ rks,rls are always some multiple of π{d in the pure case (see the next subsection for an exact statement), the resulting sum of kernels simplifies (in particular, it is always a real function).

3.41)
As an additional example, the matrix of kernels for the pure sextic (3 colors) yields Kpθq "¨?

Exact classical periods for pure potentials
A pure potential V pxq " aq d with energy E ą 0 has a momentum given by (2.9), i.e. a 2pE´aq d q. By the rescaling q Þ Ñ`E a˘1 d q one can rewrite the classical periods in a friendly manner, where γ denotes a path encircling two turning points. With the previous scaling, the turning points are simply listed by the dth roots of unity, i.e. q k tp " e 2πik{d , with k P Z, such that the previous integral (3.43) resolves to We can factorize the only building block we need,

3.45)
in order to express all of our classical periods as For the following, let us fix the labeling of the turning points for concreteness: the indices 1 . . . d are listing the sorted turning points, ordered from the smallest to largest real part first, then imaginary part. We want to relate this labeling with the dth root of unity q k tp " e 2πik{d . The one with largest real part, q d , is obviously q 0 tp " 1. Then we can identify q d´2n " q n tp and q d´2n´1 " q´n tp until we run out of turning point after d´1 labeling if d is odd. If d is even, the smallest turning point is q 1 " q d{2 tp "´1. Grouping all these results together, we get the dictionary q n " expˆi π 2d´2 d`1`p´1q d`n p2n´1q¯˙(3.47) relating q n and q k tp through the bijection (3.32). With this labeling, we can rewrite our exact classical periods as The last result is analytically explaining the geometric observation that there are P d´1 2 T differently colored -functions in figure 9: since the absolute value of the periods is given by and, in particular, realizing that we can identify the equivalence classes as rns " n,n`1 @n P t1 . . . P d´1 2 T u (or, alternatively, that rks " n,n`2k @n P t1 . . . du and @k P t1 . . . is indeed describing P d´1 2 T different periods. With (3.48), we entirely described all the exact classical periods Π paq intervening in the TBA graph for arbitrary pure potentials of degree d. With (3.49) and (3.50), we gave precision on the exact form of their absolute values. To complete the picture, let us work their explicit arguments, i.e. the angles ϕ paq : ϕ n,n`k " p´1q d π 4d´p´1 q k`n p2d`2k`2n´1q`4d`2p´1q d`p´1 q n p2n´1q¯(3.52) such that the exact periods can be written in the polar form as Π n,n`k " ? 8πEˆE a˙1 (3.53)

Intersection matrix for general d
Thanks to the computations above, we know the exact sign matrix signpϕ paq,pbq q for arbitrary d. On can write it as signpϕ pi,i`kq,pj,j`lq q " sign´i log´e´i For example of this sign matrix at large d (so the repeating structure can be observed), one can look at figure 10. In order to get the full exact intersection matrix (3.33) for polynomials in the maximal chamber, one just need to put together the the signless connection matrix (3.28) and signless intersection matrix (3.31). For explicitness' sake, let us rewrite them in our labeling system: xpi, i`kq, pj, j`lqy connection "δ i,j`δi,j`l`δi`k,j`δi`k,j`l´2 δ i,j δ i`k,j`l (3.56) where, after simplification, As an important note, if we initially derived the formulas (3.54) or (3.55) for the specific case of pure potentials, let us remark than it also applies to a larger class of polynomials. As long as one is in presence of some set of roots of E´V pqq "not to far" from the dth roots of the unity, in the sense that as long as identifying the two sets of roots is not modifying the sign of (3.54), the intersection matrix is invariant under the deformation from the pure potential case to the more difficult case of interest. By using the appropriate classical periods and labeling system, on can solve TBA systems of the form (3.26) with the same matrix of intersection we derived above in the context of pure potential. For example, d{2-wells problems with energy above the maximas. Using (3.33) with the sign matrix derived here, we are indeed reproducing the structures found in figure 7.

Restricting the TBA equations to pure polynomial potentials
Putting ( and where the full intersection matrix xpi, i`kq, pj, j`lqy is given by (3.33), with the intersection and connection part given explicitly in our prescription by (3.56) and (3.57). The TBA system (3.59) is containing dpd`1q{2 equations, but most of them are redundant : as explained in section 3.7.1, we can associate a TBA graph to this pure polynomial potential Orange, teal and white are color coding`1,´1 and 0 respectively. The sign matrix is organized such that the dpd´1q{2 entries paq are, from top to bottom (resp. pbq, from left to right) pi, i`kq, i P t1, . . . , d´ku and k P t1, . . . , d´1u; we denote an increment of k by a black line. Figure 11: Structure of the (full, signed) intersection matrix (3.33) for polynomials of degree 18 and 19 respectively. Orange, red, teal, blue and white are color coding respectively`1,`2,´1,´2 and 0. Orange and teal (resp. red and blue) entries are the non-null entries of the signless connection (resp. signless intersection) matrix (3.28) (resp. (3.31)). We used the same organization conventions as in figure 10.
system, which is the fully connected polygonal with d vertices, and the identifications are given by the edges with same lengths. In the dth-root of unity prescription, it means that the edge (or TBA equation or -function) pv, v`kq " rks is in the equivalence class rks @v P t1, . . . , du. We can go back to our real/imaginary prescription using the bijection (3.32): in this prescription, the equivalence class is given by the relation pi, jq " r|v ji |s (with v ij " v i´vj and v i " p2d`1`p´1q d`i p2i´1qq{4). Equivalently, one can also look at pi, i`kq directly in the real imaginary prescription: if k is odd, then it is a member of " i`k´1 2 ‰ , if k is even then it is a member of rk{2s. In any prescription, this leaves us with d´1 TBA equations that are equivalent to Dorey and Tateo equations after simplification. However, these equations can still be paired with the reflected edge of same length, such that we can enlarge the equivalence class adding the relation rd´ks " rks. At the end of the day, we are left with P d´1 2 T independent TBA equations pk,k`1q pθq " rks pθq " K pk,k`1q,pj,j`lq ‹L pj,j`lq pθq (3.61) in the real/imaginary prescription, with k P t1, . . . , P d´1 2 T u. The expression (3.61) can be further simplified realizing than the sum is involving equivalent L-functions (of course, since the rks are members of the same equivalence class, so do the L rks " log`1`exp`´ rks˘˘) . We can use the linearity of the integration and factorize these equivalent L-functions into a common factor of a new kernel, sum of the old ones, as we already outlined in (3.38). Doing so, we get the following simplified TBA system, involving only member of the equivalence class, as expected then exemplified from (3.37), where the matrix of kernels is given by K rks,rls pθq " ÿ pa,bqPrls xpk, k`1q, pa, bqy 2πi sinh´θ`log´e´i π d v k,a,k`1,b¯¯(

3.63)
If one want to rewrite (3.63) in a more concrete fashion, one has to explicit the sum over the edges pa, bq which are members of the equivalent class rls, i.e. find how to generate the set rls over which we will be summing. Let us work before the reflection pairings rks " rd´ks for now. The rules above, telling in which equivalence class an arbitrary edge pi, i`kq is, need to be inverted. Using these rules, it is easy to see that the equivalence class r1s is the set, r1s " tp1, 2qu Y˜d´2 etc. and it follows that the sum spawn over nd one can write the matrix of kernels (3.63) involved in the TBA system (3.62) as K rks,rls pθq " thus taking into account the reflection symmetry rd´ks " rks we glossed out until now, and with φ the matrix of kernels one would obtain considering d´1 TBA equations, 2πi sinh´θ`log´e´i π d v k,n,k`1,n`2l¯¯(

3.65)
We purposefully called it φ since it analogous to the matrix of kernels (3.68) found in Dorey and Tateo equations (3.67). However, notice that φ IMS k,l pθq ‰ φ k,l pθq; it is only when we are applying the reflection symmetry that we have K rks,rls pθq " K DT rks,rls pθq element-wise. For example, one can notice that φ IMS d´1,d´1 pθq " 0 and φ IMS k,l pθq " 0 @k P t1,¨¨¨, 2l´d´1u and @l P t P d 2 T`1 ,¨¨¨, d´1u (a triangle of zeroes of height d´3 and length P d´3 2 T ), when φ is symmetric and non zero @k, l P t1,¨¨¨, d´1u (excepted for some specific values of θ) as one can see from the definition (3.68). Nonetheless, we expect φ IMS k,l pθq`φ IMS k,d´l pθq " φ k,l pθqφ k,d´l pθq element-wise, since it is equivalent to the statement K rks,rls pθq " K DT rks,rls pθq.

Dorey and Tateo equations as a special case
Let us present a lightning review of the main result of [12] (a more recent and complete review about the ODE/IM correspondence can be found in [14]). The starting point is to consider an integrable massive quantum field theory associated with the A d´1 Lie algebra and d´1 massive particle species. The scattering theory is factorisable with two particle S-matrix elements: where θ is the rapidity. Using TBA techniques, one can find the following system consisting of d´1 pseudo-energies a pθq that are solving a pθq " m a r coshpθq`d´1 where r is linked with the finite-size scaling of the system of interest and with kernel φ ab pθq " i B θ logpS ab pθqq (3.68) Dorey and Tateo's conjecture is that the T -functions (cousins of the Y -functions which are the exponentiated pseudo-energies) coincide with the spectral determinant of the quantum system of interest -a pure potential of the form q d -after taking the "conformal limit" of (3.67). For all of our purposes, we can write (3.67) in this limit as This system is very reminiscent of the TBA system (3.37) we wrote earlier for a pure potential. In fact, this is the "A d´1 reduction" of our maximal system. Furthermore, "half" of the -functions are redundant, because of the "reflection" identification a " d´a . This identification is actually the missing reflection symmetry we need to quotient out in order to end up with the reduced system (3.37). Indeed, by applying this identification on (3.69), one find rks pθq " Π rks exppθq`r and φ a,b defined in (3.68). As we already stated, the matrix of kernels (3.71) should be equal element-wise to (3.64) @θ. Let us work out the monic cubic in detail as a simple concrete example. In that simple case, the scattering matrix and matrix of kernels for the A 2 equations are pplying (3.71), we find By reading the monochromatic TBA graph of the monic cubic in figure 9 (or simply computing (3.64), given explicitly), one indeed finds the following TBA equation: pθq " |Π| exppθq`? 3 π ż R sinh`2pθ´θqs inh`3pθ´θq˘L pθqdθ (3.73) As an exercise, an interested reader can compute K DT for the quartic (resp. sextic) and find that it is indeed matching the matrix provided in (3.40) (resp. (3.42)). We wrote a program that is computing the exact matrices of kernels K and K DT for arbitrary d. We were able to prove a symbolic and exact equality for d P t3, . . . , 14u. We also computed systematically their numerical differences Kpθq´K DT pθq . Taking the maximum of this numerical difference @θ and @ matrices entries, we were able to verify that it is at most of the order 10´1 000 for d P t1, . . . , 230u. In order to achieve the general proof, the only remaining step is to demonstrate the identity, K rks,rls;d pθq " K DT rks,rls;d pθq which we will not provide in the present work. This identity is purely mathematical at this point, and we know the l.h.s. and r.h.s. for arbitrary parameters l, k and d.
3.9 Computing the WKB periods using the -functions.
The pseudo-energies are encoding the all order WKB periods. Thus, one should in principle be able to extract the quantum corrections to the classical periods Π pnq for any n from the pseudo-energies. For simplicity, let us start working in the minimal chamber, in the mass representation. We know that the asymptotic behavior of the -functions at large θ is given in this case by paq pθq " m paq exppθq. In fact, the all-orders expansion of (2.36) at large θ yields The same derivation can be reproduced mutatis mutandis for any given TBA system. In the general form (3.26) with kernel (3.17), a similar computation yields the following quantum correction to the periods:

Examples
In the following, we apply the TBA machinery developed in the previous sections in order to solve the Schrödinger spectral problem (1.1) for various potentials, computing numerically their WKB periods at arbitrary order and Voros spectra.
The two first examples (cubic and quartic potentials) are already covered in [15] with an important and interesting exception: we computed resonant (thus complex) Voros' spectra for cubic potentials when only the periods are computed in [15]. Anyway, these examples are to be thought of as warm-up exercises and trivial checks for the analytical continuation procedure described above. The next example, a general complex quintic potential, is an application going beyond genus one. We compute all the WKB periods for this generic unphysical potential in order to check if our method still holds with this complicated and non-symmetric case. In the sextic example, we are solving the triple well problem for energies below (resp. above) the wells, corresponding to a sextic potential in the minimal (resp. maximal) chamber configuration.

The cubic potential
The first natural example beyond the harmonic oscillator is the cubic oscillator of the form which has been extensively studied for this precise reason. However, because the potential is odd, a lot of subtleties are arising. Let us study them in the point of view of the TBA equations and resurgence. As long as 0 ă E ă 1 54g 2 , we are in the minimal chamber (i.e. we are in presence of three real turning points). A particular cases of which will be studied in the next section. In the last section dedicated to cubic potentials, we will basically promote the coupling constant g to a complex number, hence forcing the turning points to rotate in the complex plane, outside the real line. In fact, we will focus on PT-symmetric cubic potential, since it is a beautiful and interesting example, well studied in the literature and relatively easy to study in the context of TBA equations and resurgence. Of course, the methods developed here can accommodate more general cubic polynomials.
This particular exercise was already covered (partially 16 ) in [15]. In the recent [31], they are covering the cubic case from the point of view of abelianization.

The cubic oscillator in the minimal chamber
The cubic oscillator (4.1) with g and E P R respecting 0 ă E ă 1 54g 2 seems to be the simplest non-trivial example of a polynomial potential in the minimal chamber, with its only two very simple TBA equations: However, the Hamiltonian of the cubic oscillator (4.1) for g real is clearly unbounded and the resulting spectrum is resonant (see appendix D.2 for a brief description). Let us focus on two examples: g " 1 with E " 1{200, in order to connect with the results of [15], and g " 1{10 with E " 1, because in this case the non-perturbative effects are stronger and it will be easier to show, within our precision, that the corresponding level E n of the standard spectrum (i.e. spectrum evaluated at n " expp´θ n q) is purely real, even if the spectrum of such resonant state is a priori complex, as discussed in D.2.
Solving the TBA system (4.2) numerically, using the results of appendix A, one can then compute the WKB periods using (3.78). Our results can be found in the table 1 and is compared with the WKB periods computed with standard quantum mechanical techniques described in appendix C.
Using Voros-Silverstone connection formulae, developped in appendix B, one can extract the exact quantization conditions associated to this problem. Depending on the choice of lateral Borel resummation, one finds where the B˘are the lateral borel resumations defined in (2.16) (the sign˘is encoding the choice of lateral resummation). We can go from one EQC to the other by the use of the Stockes automorphism, using Delabaere-Pham formula, as explained in section 2.1.
In that case, it is very easy to show, so let's do it explicitly as an exercise. Rewriting V˘" e˘i B˘pΠ 1,2 qpθq and V np " e´i BpΠ 2,3 qpθq , the EQCs are given by 1`V˘`1 2 p1˘1qV np " 0 (4.4) In this notation, Delabaere-Pham formula takes the form This general procedure provides a non-trivial check that our EQC are working. In order to relate the all order resummed periods involved in the EQC (4.3) with the -functions, we simply use (2.33). The analytical structure of the EQS's inverse can be observed in figure 12, the poles of which are corresponding to the zeroes of the EQC. Solving (4.3) using the appropriate lateral Borel resummation prescription yields the Voros spectrum, which can be checked numerically with great accuracy using the complex dilatation method described in appendix D.  (4.1) in the minimal chamber, i.e. with g " 1, E " 1{200 and with g " 1{10, E " 1 respectively, computed using the -functions obtained by solving the appropriate TBA system numerically using the iterative integration method with 16000 and 8000 Gaussian distributed points respectively, and cutoff P r´75, 22s and P r´75, 18s respectively, as described in appendix A (TBA). These values are compared with exact values obtained using the differential operator method described in appendix C (Diff. Op.).

The PT cubic potential
The next example is the maximal chamber extension of the potential (4.1). Let us focus on the interesting PT cubic potentials. For concreteness, let us chose V pqq " iq 3´i q , E " 1 (4.6) Of course, (4.6) can always be linked back to (4.1) by the appropriate rescalings and shifts in the energy and q, and by promoting the coupling constant g to a complex number.
This potential is an interesting one to study since it is the special case of V pqq " iq 3´i λq (with λ " 1), which has a been a rich playground for investigating spontaneous PTsymmetry breaking caused by non-perturbative effect arising in that case for λ positive and sufficiently large, producing intricate patterns of coalescing levels at the so-called Bender-Wu branch-points (see [2,[32][33][34][35]). The TBA system for this cubic in the maximal chamber is consisting of 3 TBA equations,  Figure 12: Inverse of the EQC (4.3) plotted in the complex θ-plane for g " 1 with E " 1{200 (left) and g " 1{10 with E " 1 (right) respectively. The color is encoding the argument of this function, the poles of which are the zeroes of the EQC, thus are selecting the resonant Voros spectrum for the associated WKB curve parameters. The imaginary part of the zeroes are non-perturbatively close to ikπ. When k is even, they are related to the same , with positive real part and non-perturbatively suppressed imaginary part. When k is odd, it corresponds to the same than in the previous case except it has a negative real part. However, one can recover the appropriate control spectrum in table 2 by changing the dilatation angle appropriately (taking it close to the real negative axis instead of the real positive axis). encoded in the intersection matrix xpaq, pbqy "¨0´1´1 1 0 1 1´1 0‹ through (3.26) -with kernel (3.17) -as can be read from Fig. 7 (in that case, paq, pbq P S 3 with S 3 " tp1, 2q, p2, 3q, p1, 3qu). Explicitly: ż RL 1,2 pθq dθ sinh`θ´θ`iϕ p1,3q,p1,2q˘´1 2πi ż RL 2,3 pθq dθ sinh`θ´θ`iϕ p1,3q,p2,3qT his TBA system can be read from the d " 3 maximal TBA graph in figure 7.
Once the -functions are extracted from the TBA system above, one can compute the quantum corrections to the periods using (3.78). Our results can be found in the table WKB curve parameters: g " 1, E " 1{200 θ 1 " 4.5720059951096`0.0000262355612 i θ 2 " 5.68181569531799´1. Table 2: Voros Spectrum of the θ n for n ď 4 solving the EQC (4.3) for the potential q 2 {2´gx 3 with g " 1 and g " 1{10 respectively, together with the -normalized to one -control spectrum of energies obtained for these values of n " expp´θ n q using the complex dilatation method described in the appendix D (using dilatation angles slightly above or below the real positive axis with the appropriate˘prescription for the EQC). The -functions involved are obtained numerically using the iterative integration method with 16000 and 8000 Gaussian distributed points, with cutoffs P r´75, 22s and P r´75, 18s respectively. Since the energy (as a WKB curve parameter) was chosen too be E " 1{200 and E " 1, the diagonal elements of this table should be 200E " 1 and E " 1, according to (2.26). For g " 1 and E " 1{200, the non-perturbatively small imaginary part is inaccessible with our precision for the third and forth levels of the Voros spectrum (the two first levels are well within our precision though). This is why we are providing a second example with g " 1{10 and E " 1, for which the non-perturbative effects are stronger.
3 and is compared with the WKB periods computed with standard quantum mechanical techniques described in the appendix C.
Ultimately, we want to find the Voros spectrum for this Hamiltonian. In order to compute this spectrum, we need to find the θ n " expp´ n q that are solving the exact quantization condition found using the techniques in the appendix B: 2 cosˆ1 Π p pθq˙`expˆ´1 Π np pθq˙" 0 (4.8) where 1 Π p and 1 Π np are respectively the real and imaginary part of the all order resummed period 1 B pΠ 1,2 q, obtained using (2.33). In that case, it is Borel summable and we can compute it without using the median resummation. Explicitly, here we used ϕ 1,2 "´ϕ 2,3 and ϕ 1,3 " 0. This function (thus the functions Π p and Π np ) can be computed provided the pseudo-energies 2,3 pθq and 1,3 pθq. We compute them numerically solving the TBA system above using the methods in appendix A. The Voros spectrum of the θ n resulting from the solutions of (4.8) can be found in the table 4, together with the control energies obtained using appendix D, which is providing a numerical check of the theory developed in the previous sections.

The quartic potential
Our next example is the double well corresponding to the potential which was already analyzed in [15]. When´1{32 ă E ă 0, we are in the minimal chamber regime since we have 4 distinct and real turning points (energy below the wells). When the energy increase beyond E ą 0, we are left with only two real turning points, corresponding to the maximal chamber regime (energy above the wells). We chose E "´1{64 and E " 1 in the examples below.

Symmetric quartic in the minimal chamber
The TBA system for a symmetric quartic potential in the minimal chamber is simply where the convolution with the kernel K is defined in (2.37) and where we used the symmetry (3.34). The corresponding (bi)chromatic TBA graph is  Table 3: WKB periods for the PT-cubic potential (4.6), computed using the -functions in turn obtained by solving the appropriate TBA system numerically. We used the iterative integration method with 7000 Gaussian distributed points and cutoff P r´75, 17s described in appendix A (TBA). We compare our results with the exact values obtained using the differential operator method described in appendix C (Diff. Op.).
After solving this TBA system, one can compute the WKB periods using (3.78). Our results can be found in the table 5 together with standard quantum mechanical results (described in the appendix C) for comparison. The relevant EQC for this system is obtained using the techniques in the appendix B and we find e´i BpΠ 2,3 qpθq`´1`e˘i B˘pΠ 1,2 qpθq¯2 " 0 (4.11) The pseudo-energies obtained from the TBA system above are encoding the median resummation B med defined in (2.17). Therefore, we still have to extract this quantity from (4.11). Solving the EQC for B˘pΠ 1,2 q, one finds where V1 ,2 " exp`´i B˘pΠ 1,2 q˘, V 2,3 " exp`´i B pΠ 2,3 q˘and the σ˘P t1,´1u are encoding the choice of square root. In fact, one can show that σ˘"˘p where p is the parity. Using (2.17), it follows that  Table 4: Voros Spectrum of the θ n solving the EQC (4.8), together with the control spectrum of energies obtained for these values of n " expp´θ n q using the complex dilatation method described in the appendix D. The -functions involved are obtained numerically using the iterative integration method with 7000 Gaussian distributed points and cutoff P r´75, 17s. Since the energy (as a WKB curve parameter) was chosen too be E " 1, the diagonal elements of this table should be E " 1 according to (2.26). Increasing θ, one can observe the aforementioned coalescing of levels and spontaneous breaking of the PT symmetry.
thus, 1 B med pΠ 1,2 q " πk´i 2 log˜1`i σ`aV 2,3 1`iσ´aV 2,3¸" πk`p arctan`aV 2,3˘( 4.14) with k P Z and p P t´1, 1u the parity, such that The all order Bohr-Sommerfeld quantization approximation dictates the perturbative behavior and fix the parity of k. Indeed, when we set V 2,3 Ñ 0 (effectively neglecting exponentially suppressed terms), one finds cosˆ1 B med pΠ 1,2 q˙" p´1q k " cos pπp2n`1qq "´1 (4.16) (because n P N) and k must be an odd number. Then, (4.15) yields the Zinn-Justin's EQC:  Table 5: WKB periods for the symmetric quartic potential (4.9) with E "´1{64 computed using the -functions obtained by solving the appropriate TBA system numerically using the Fourier discretization method with 2 14 points and cutoff P r´21, 21s (TBA FD), the iterative integration method with 14000 Gaussian distributed points and cutoff P r´75, 22s (TBA II) -both described in appendix A -compared with exact values obtained using the differential operator method described in appendix C (Diff. Op.).
where the all order resummed periods involved in the EQC above are obtained using (2.33): B pΠ 2,3 q pθq " 2,3 pθq where P`ş R˘" lim δÑ0´ş´δ 8`ş 8 δ¯i s the Cauchy principal value. In conclusion, the rusummed WKB periods can be computed provided the -functions, which can be done numerically as explained in appendix A. The Voros spectrum of the quantum mechanical system of interest can then be extracted form the all-orders WKB periods by solving (4.17). This is what has been done numerically in table 6, and we found a precise numerical check -by using a standard technique in QM described in appendix D together with (2.26) -of the methods described in the present paper.

Symmetric quartic in the maximal chamber
We already figured out the explicit TBA system associated to a symmetric quartic potential in the maximal chamber with (3.35) (where the tildes have been omitted). Alternatively, one could look at the following TBA graph with four colors, 1.00026781752251 1.00000000000000 Table 6: Voros Spectrum of the θ n solving the EQC (4.17), together with the -normalized to one -control spectrum of energies obtained for these values of n " expp´θ n q using the complex dilatation method described in the appendix D on the shifted potential q 4 {2´q 2 {4`1{32. The -functions involved are obtained numerically using the iterative integration method with 12000 Gaussian distributed points and cutoff P r´75, 22s. Since the energy (as a WKB curve parameter) was chosen too be E "´1{64, the shifted potential has an energy E " 1{64 and the diagonal elements of this table should be 64E " 1 according to (2.26). We can observe that the purely non-perturbative splitting of levels is correctly reproduced. where the matching colors are parallel lines, as it is typically the case because of the symmetry (3.34).
The quantum corrections to the periods we found using this TBA system together with (3.78) are found in table 7, and is compared with values obtained using standard quantum mechanical computations presented in appendix C.

The quintic potential
For the quintic example, we purposefully choose a generic potential with no simplifying symmetries, i.e.
V pqq " iq 5`1 2 q 2´1 10 q , E " 1 (4.29) in order to check if our TBA machinery is accommodating for this difficult example. In this case we are in the maximal chamber and there are 10 TBA equations, encoded in the TBA graph or equivalently the intersection matrix of figure 7. The results for the first four quantum correction to the periods can be found in the table 9 and compared to the exact digits in table 10. We did not compute the EQC and Voros spectrum for this highly unphysical example. 1.6193800753561 0.9999999999999 Table 8: Voros Spectrum of the θ n solving the EQC (4.26), together with the control spectrum of energies obtained for these values of n " expp´θ n q using the complex dilatation method described in the appendix D. The -functions involved are obtained numerically using the iterative integration method with 6000 Gaussian distributed points and cutoff P r´75, 18s. Since the energy (as a WKB curve parameter) was chosen too be E " 1, the diagonal elements of this table should be E " 1 according to (2.26).

The sextic potential
For the next example, we will be looking at the triple well potential For 0 ă E ă 4{27, we are in the minimal chamber regime since we have 6 real turning points (energy below the wells). When E ą 4{27, we have two real turning points (the other four are complex and responsible for complex instantons) and we are in the maximal chamber (energy above the wells). We chose E " 1{16 and E " 1 in the examples below.

Symmetric sextixc in the minimal chamber
The (tri)chromatic TBA graph encoding the TBA system for the symmetric sextic potential is 1 2 furthermore, because of our choice of potential, we can add the additional symmetry 2 1,2 " 3,4 (red = 2 black in the TBA graph) such that we only have two independent -functions to compute.
As in the previous examples, one can use (3.78) and compute the WKB periods. We found they are matching with the exact results , found for the sextic potential in C. We  Table 9: WKB periods for the quintic potential (4.29) computed using the -functions obtained by solving the appropriate TBA system numerically using the iterative integration method with 3000 Gaussian distributed points and cutoff P r´75, 15s. compared the quantum corrections to the periods to the order Op 12 q and the results are matching within approximately 9 digits when using the iterative integration method with 12000 Gaussian distributed points and cutoff P r´75, 19s. In order to not overcharge the present paper and because we already shown similar results, we do not provide the table of the WKB periods, the ultimate goal being the Voros spectrum.
As in the quartic case, the periods corresponding to cycles along the classically allowed regions i.e. p1, 2q and p3, 4q, are not Borel summable and must therefore be resummed using the same procedure as before. Using the results of the appendix B, the EQC in terms of the lateral resummed periods is where Vp " V1 ,2 " V5 ,6 , pVp q 2 " V 3,4 , V np " V 2,3 " V 4,5 and V p˘q a,b " e i B p˘q pΠ a,b q .
Proceeding as usual, i.e. solving for Vp then rewriting an EQC for the median-resummed  Table 10: WKB periods for the quintic potential (4.29) computed using the differential operator method described in C. All the presented digits are exact. period, one finds the "Zinn-Justin"-type EQC: Where the zeroes of the two factors are selecting the levels localized in the outer or inner wells. As in our previous examples, we can relate the Borel resummed periods to our -functions using the Delabaere-Pham formula (2.33), which leads to relations of the 1.4536124515081 0.99999999999840 Table 11: Voros Spectrum of the θ n solving the EQC (4.32), together with the -normalized to one -control spectrum of energies obtained for these values of n " expp´θ n q using the method described in the appendix D on the potential (4.30). The -functions involved are obtained numerically using the iterative integration method with 12000 Gaussian distributed points and cutoff P r´75, 19s. Since the energy (as a WKB curve parameter) was chosen too be E " 1{16, the diagonal elements of this table should be 16E " 1 according to (2.26). One can observe the non-perturbative spliting of the levels 2 and 3 mod 4, corresponding to the energies of states localized in the outer wells, as one can observe from the degeneracies of the EQC (4.32) when neglecting the non-perturbative contribution, or from the analysis in [36,37].
Solving the EQC (4.32) numerically yields the Voros spectrum presented in table 11, together with the energies computed with the associated value of using a standard technique in QM.

Symmetric sextic in the maximal chamber
The TBA system for the symmetric sextic in the maximal chamber can be read from the figure 8.
As usual, one can use (3.78) and compute the WKB periods. For the same reasons as in our precedent examples, we will not provide such big tables in the present paper. The quantum corrections obtained using the TBA procedure are reproducing the exact WKB periods of appendix C to approximately 10 digits of precision when using the iterative integration method with 4000 Gaussian distributed points and cutoff P r´75, 16s and up to order Op 12 q.
As in the maximal quartic case, the period Π 1,6 is not Borel summable. We must therefore follow the same procedure we went through before. Using the results of the appendix B, one can find the EQC for the sextic potential in the maximal chamber as a function of the lateral resummed periods. For compactness, we express the EQC in term of the Voros multiplier-like quantities Vp and V np : where Vp " pV1 ,2 q Proceeding as usual, i.e. solving for Vp then rewriting an EQC for the median-resummed period, one finds the "Zinn-Justin"-type EQC for the sextic potential in the maximal chamber: " 0 (4.34) One can relate the resummed periods in the EQC (4.34) and our -functions similarly to the quartic potential in the maximal chamber case, except it is involving a more complicated TBA system. Explicitly, we get 1,42 π P˜ż R L 2,3 pθqdθ sinh`θ´θ˘i B pΠ 2,3 q pθq " 2,3 pθq where we used ϕ 1,2 " ϕ 3,4 "´ϕ 1,3 "´ϕ 2,5 , ϕ 1,4 "´ϕ 1,5 , ϕ 2,4 " ϕ 1,6 " 0. Solving the EQC (4.34) numerically yields the Voros spectrum presented in table 12.

Conclusion and outlook
After reviewing briefly the theory underlying the present work in section 2, we presented in section 3.5 a very useful diagrammatic method that is allowing us to analytically continue a TBA system into a more complicated one (wall-crossing), inspired by Toledo's thesis [27] in the context of minimal surfaces in AdS. In the next couple of sections, we used this diagramatic method in order to obtain some general results, especially for maximal chamber configurations for which we cannot wall-cross anymore. Indeed, in this section, we uncovered the general structure of TBA systems in the maximal chamber and explicitly computed the associated intersection matrix (encoding the TBA equations) for arbitrary degree polynomial potentials. In section 3.6 and 3.7, we simplified the general TBA system using the symmetries of the potential. In particular, in 3.7, we are putting an emphasis on 1.7447971706055 0.99999999999894 Table 12: Voros Spectrum of the θ n solving the EQC (4.34), together with the control spectrum of energies obtained for these values of n " expp´θ n q using the complex dilatation method described in the appendix D on the potential (4.30). The -functions involved are obtained numerically using the iterative integration method with 4000 Gaussian distributed points and cutoff P r´75, 16s. Since the energy (as a WKB curve parameter) was chosen too be E " 1, the diagonal elements of this table should be E " 1 according to (2.26).
pure polynomial potential of the form V pqq " aq d , preparing for the section 3.8, where we are giving some very strong arguments indicating that Dorey and Tateo TBA equations, appearing in the seminal paper [12], are indeed a special case of the TBA equations in [15]. In section 4, we applied the theory developed previously to interesting Quantum Mechanical problems (from the cubic oscillator to the sextic triple well). We were able to verify numerically it was matching with alternative technique to a great accuracy for every examples, demonstrating that the TBA equations are not only a powerful and exact analytic tool, but are also providing useful computational techniques. We derived the exact quantification conditions in term of the (lateral then, when imposed by the lack of Borel summability, median) Borel resummed periods, and together with the TBA results, we were able to solve very subtle spectral problems.
Of course, the techniques we presented in this paper can be used in the context of Quantum Mechanics in order to solve a large class of spectral problems. But, as a side effect, they can also be useful in holography. Indeed, one can reverse the conformal limit in figure 1 by substituting exppθq Þ Ñ 2 coshpθq in the mass/period term, hence obtaining TBA equations of the form which is the TBA system governing the area of minimal surfaces in AdS 3 delimited by a polygonal closed contour (with 2d`4 sides) as described in [22,23,26,27].
Concerning the unresolved issues, there is still at least a small one in this paper. We found the exact TBA system for pure polynomial potentials of arbitrary degree, and it should in principle be equivalent to the Dorey and Tateo TBA system in [12]. We made a lot of progress in order to make that equivalence clear by boiling it down to a pure mathematical identity. We provided strong evidence that the conjecture of equivalence was holding, by systematically testing it up to large degrees; but there is still a lack of a definitive proof that the identity K rks,rls;d pθq " K DT rks,rls;d pθq holds in order to close this matter definitively.
An obvious amelioration we could bring to the method described in this paper would be to extend its validity outside polynomial potentials. The original ODE/IM correspondence in [12,14] was already accommodating for an angular momentum term 91{q 2 for example. Accommodating this particular centrifugal term in the context of the quantum mechanical generalized ODE/IM correspondence was done recently in [38]. In [31], they are using the integral equation in [16] (that can be interpreted as a generalization of the ODE/IM correspondence) in order to accomodate for the Mathieu (and modified Mathieu) equation (i.e. with V pqq9 cospqq and V pqq9 coshpqq respectively) in the context of abelianization. A related analysis was carried out in [39], where they are explicitly deriving TBA equations for the modified Mathieu operator, notably in the resurgent framework presented in this paper. Each time we are extending the generalized ODE/IM correspondence to even more complicated potentials, we are getting closer to the exact resolution of the general Schrödinger equation (1.1).

A Solving the TBA equations numerically
In this section, we will discuss the two main methods we used in order to solve the TBA integral equations numerically and extract the -functions. The basic idea in both of the methods is to start from the asymptotic exponential behavior at θ Ñ 8, where L pnq a pθq " log´1`exp´´ pnq a pθq¯¯. For d ď 4, i.e. potentials defining a WKB curve (2.9) the Riemann surface of which has genus 0 or 1, the pnq -functions are converging to the exact -functions in the n Ñ 8 limit. For genus ą 1 however, (A.2) is converging to 2 different values according to the parity of n. Thus, one can use the modified recurrence relation pnq a pθq " in order to mix even and odd parity and make the pnq -functions converge to the appropriate -functions in the n Ñ 8 limit. Note that (A.3) is converging more slowly than (A.2).

A.1 Fourier discretization
A convenient way to compute convolutions numerically is to use the discrete Fourier transform as in [15]. For this purpose, we discretize our functions and kernels into finite dimensional vectors in an interval (defined by a cutoff) then Fourier transform the resulting vectors, knowing that convolutions are transforming into products under Fourier transformation according to the convolution theorem, i.e.
We get back the discretized version of the convolution function by inverse Fourier transform.
In the limit where the number of points and cutoff go to infinity, we recover the exact functions. However, this method has some shortcomings. Indeed, the discrete convolutions are forced to be periodic functions, which is introducing errors around the cutoff. Also, in our implementation of the algorithm, we need a power of 2 number of uniformly distributed sampling points to get the correct phase. There surely are some fancy ways to circumvent these problems. For example, it is possible to fix the behavior at θ Ñ´8 by adding to the TBA equation of the form the (by construction) null term Solving (A.6) yields the condition L 1 pθq " pf 1 pθ`iπ{2q`f 1 pθ´iπ{2qq{2. Furthermore, we want to impose the asymptotic behavior f 0 pθq`f 1 pθq " ‹ at large negative θ, where ‹ is the know value of the the -function at θ Ñ´8 17 , and f 0 pθq`f 1 pθq " |Π| exppθq at large positive θ. Since f 0 pθq " |Π| exppθq already, we must have f 1 pθ Ñ 8q Ñ 0 and f 1 pθ Ñ´8q Ñ ‹ . In other words, we can chose any "step"-like function we please for f 1 as long as it is going to 0 at positive infinity and ‹ at negative infinity. For example, if we chose the sigmoid function f 1 pθq " ‹ {p1`c exppθqq, it implies that the appropriate kernel is L 1 pθq " 2 ‹ {p1`c 2 expp2θqq. 17 It is easy to show that the Y -functions are obeying a functional equation at large negative θ which solves to Y ‹ a " sinpπa{pd`2qq sinpπpa`2q{pd`2qq sin 2 pπ{pd`2qq , and ‹ a "´logpY ‹ a q, where d is the degree of the polynomial. See [15,23].

A.2 Numeric integration and interpolation
Another way to solve the TBA equations numerically and efficiently is to sample the convolution pK ‹ Lqpθq at some discrete set of points by integrating numerically, then interpolate the resulting values in order to build the -function. This can be easily implemented in Mathematica using the NIntegrate and Interpolation build-in functions. Just like the previous example, we can introduce a cutoff and a number of points, and the numerical -function are converging to the exact ones in the large cutoff and number of points limit. See for [23,40] for examples. In this paper, we used similar code, but with two little twists. First, because of the exponential behavior of the -function at large θ: it is very time consuming to extend the cutoff in the positive theta direction. In order to optimize the algorithm, it is then interesting to have two different cutoff, in the negative and positive direction. Extending the cutoff in the negative direction does not cost too much additional time. Finally, we can distribute our sample points anyway we want with this method. Since the extremities (near the cutoff) are contributing less than the center (near θ " 0), we decided to distribute our points according to a Gaussian distribution. In the main text, we will refer to this method as the Iterative Integration or II method.

A.3 -functions in the complex plane
Using the methods mentioned above, one gets a function interpolated on the real line. For some computations, it is useful to have access to complex arguments, analytically continuing these data in the full complex plane. A brute force solution would be to interpolate the -functions on a grid, but this is very costly. Fortunately, it is unecessary and quite easy to analytically continue these data in the complex θ plane by simply using the associated TBA equation and integrate at shifted kernels. This is in fact what we are doing in the main text when we are evaluating pθ`iπ{2q when we want to relate the -functions and the resummed WKB periods. Explicitly, such that we only need the knowledge of the function L pbq " log`1`exp`´ pbq˘˘o n the real line, at the cost of an integration. For some values of θ I , one can encounter singularities. It is possible to avoid them using the Cauchy principal value. The typical form of these analytically continued -functions are drawn in figure 13.

B Deriving the Exact Quantization Conditions
Using connection formulae -arising from the necessity of having recessive or dominant WKB functions in different regions of the complex q-plane, together with the need to connect these regions in a coherent way -it is possible to derive powerful and exact quantization conditions. One viable road for deriving EQC is to use Voros' matrix approach, known as the Knoll-Schaeffer connection method, later refined by Delabaere, Dillinger and Pham [6,[9][10][11], looking at the Stokes lines (i.e. the codimension one loci on the complex q-plane defined by Reppq " 0) in order to find the EQC of interest. However, in this paper, we used an equivalent method: the Voros-Silverstone connection formula described in [28], which we are going to summarize (with much less detail) in the following section.

B.1 The Voros-Silverstone connection formula
Near a turning point q tp (defined by ppq tp q " 0 or equivalently V pq tp q " E), the potential appearing in the Schrödinger equation can be approximated as and q tp is a first order turning point if k ‰ 0, which will be assuming to be the case in the following. Also, we will assume that the classicaly allowed region (where V pqq ă E) is to the right of the turning point (i.e. q ą q tp ) when the classically forbidden region is to the right of the turning point, such that k is positive. Locally, the Schrödinger equation is corresponding to a linear potential problem. This problem has an exact solution: the wavefunction is a linear combination of the Airy functions where φpqq " ppqq 2 " 3 ? 2mkpq´q tp q. Of course, since φpqq is linear, we can also write in order to prepare the wavefunction for the following. Also, doing so, we are taking this problem in the more general context of the uniform WKB method, where we use the ansatz ith P pqq defined in the WKB context presented in the section 2.1, defined as a formal power series in (2.6), one can restate the two previous asymptotic expansions in a WKB friendly manner. In the classically allowed region, In the classically forbidden region, one has to be careful with the choice of signs and branch cut implementation. The resulting asymptotic expansion is ψpqq " 1 bP pqq´2 b e 1 Π q,q tp`p a˘ibqe´1 Π q,q tp¯( B.8) whereP pqq is obtained from P pqq by a multiplication of˘i (it is of the formP pqq " ppqq`Op 2 q withppqq " a 2mpV pqq´Eq when the standard momentum is ppqq " a 2mpE´V pqqq as in the main text) andΠ a,b " ş b aP pqqdq. Putting (B.7) and (B.8) together, we get the Voros-Silverstone connection formula that is allowing us to connect the wavefunction before and after the crossing of a turning point in the case where we are going from the classically forbidden region to the classically allowed region when increasing q, as assumed earlier. We can repeat this analysis verbatim in the case we are going from the classically allowed region to the classically forbidden region, and one finds a similar formula: B.2 Worked out example: the quartic potential Let us illustrate the general method for deriving the EQC used in the present paper by explicitly finding the EQC for the quartic case in the minimal chamber (double well with energy bellow the wells). Then, we will extend this result to the maximal chamber configuration (double well with energy above the wells and, also, pure quartic) by deforming the path of the cycles, transforming the periods in order to accommodate the EQC obtained using the Voros-Silverstone formula. The method presented below for the quartic example can of course be generalized without too much effort to more complicated potentials.

B.2.1 Minimal chamber
In the minimal chamber, we can order the turning points that are all along the real line by q 1 ă q 2 ă q 3 ă q 4 . This is defining five regions, I "s´8, q 1 r, II "sq 1 , q 2 r, III "sq 2 , q 3 r, IV "sq 3 , q 4 r and V "sq 4 , 8r. The wavefunction must decay at infinity. It fix the behavior of ψpqq in the region I and V : where A and B are normalization constants. (B.11) and (B.12) are simply the wavefunction in the classically forbidden region described in (B.9) and (B.10) respectively, q tp " q 1 and q 4 respectively, a " A and B respectively, and b " 0 in both cases. Now, our goal is clear: we want to connect (B.11) and (B.12) together by the repeated use of (B.9) and (B.10), alternating between classically allowed and forbidden region until we have two expression for the same wavefunction. We have multiple possible equivalent way to do that. We could straightforwardly alternate between (B.9) and (B.10) and get (B.11) from the region I to the region V for example (which also yields the EQC (B.20), as it should be). In this notes, we chose to go from I to III and from V to III for (B.11) and (B.12) respectively, meeting in the middle. Using (B.9), we are going from I to II and we find ψ II pqq " iA a P pqq´e´i Πq 1 ,q´i π 4´e i Πq 1 ,q`i π 4¯( B.13) " iA a P pqq´e i Πq,q 2´i Πq 1 ,q 2´i π 4´e´i Πq,q 2`i Πq 1 ,q 2`i π 4¯( B.14) In the last step, using Π a,c " Π a,b`Πb,c , we made the exponentiated period Π 1,2 " Π q 1 ,q 2 appear explicitly, which we could rewrite as a Voros multiplier (2.21). It is a general fact that these EQC are in general functions of these exponentiated periods, as stated in (2.25). Now, we are in the classically allowed region II and we want to cross q 2 ending up up in the classicaally forbidedn region III. The appropriate connection formula is (B.9); setting a " A sin`1 Π 1,2˘a nd b " A cos`1 Π 1,2˘y ields which is (4.11) indeed in the symmetric case, i.e. when Π 1,2 " Π 3,4 .

B.2.2 Maximal chamber
We can easily deform our minimal chamber problem into a maximal chamber one by analytical continuation. By increasing the energy above the wells such that the turning points are no longer close to the real line or by sending the coupling constant in front of the quadratic term to zero, we are deforming the problem into the maximal chamber. Doing so, the periods in the symmetric case are transforming as Π 2,3 Þ Ñ´Π 2,3 , Π1 ,2 Þ Ñ 1 2 Π1 ,4¯i 2 Π 2,3 (B.21) which yields (4.20) when applied to (4.11).
C Computation of the quantum periods and differential operators In section 4, we compare the quantum corrections to the WKB periods obtained from the TBA side to standard QM results. The goal of this appendix is to present the standard QM computation we we used: the differential operators approach. We must note there are alternative methods one could have used in order to obtain the all-order WKB periods and check with the TBA results. Namely, the Holomorphic Anomaly equation [41][42][43], originating from topological strings.

C.1 Classical periods
The basic ingredients for finding the quantum corrections to the periods Π pnq paq are the classical periods Π p0q paq . Even if one does not knows how to compute the exact classical periods in closed form for a given polynomial, one can still use the differential operators technique shown below numerically. However, it is always nice to have closed form results, so let us explicitly write the classical periods for the quartic and sextic potentials. In those cases, one can use Ramanujan's theory of elliptic functions in order to express our classical periods as the hypergeometric function 2 F 1 through the identity 2 F 1ˆ1 p , 1´1 p , 1; z˙" 2 π ż arcsinp ? zq 0 cos´´2 p´1¯θā z´sin 2 pθq dθ (C.1) as shown in [36]. We also are providing the exact classical periods in closed form for pure potential in section 3.7.2.

C.1.1 Quartic
For the quartic of the form V pqq " gq 4´q2 and energy E, we found with a general u d´1 though, since the previous analysis is not harder to work out doing so and the resulting parameter allows us to put the b pnq k coefficient we want to zero very easily.
As we said previously, it is not necessary to work out the classical periods in closed form in order to compute the quantum corrections: Π p0q is a function of the moduli (including the energy) u k which can be computed numerically as the integral of the momentum (2.11), such that the derivative of the classical period can in turn be computed numerically using the definition of the derivative B u k Π p0q " lim hÑ0 Π p0q p. . . , u k`h , . . .q´Π p0q p. . . , u k , . . .q h then choosing a finite but small h, thus obtaining thousands of stable digits in seconds for the quantum corrections to the periods of any potentials, once the coefficients b pnq k are computed.

D Numerical method in standard Quantum Mechanics
There is a plethora of numerical techniques in standard Quantum Mechanics we can use in order to solve the spectral problem described by (1.1). In the present work, we focus on bounded and resonant states in the context of polynomial potentials, for which expressing the Hamiltonian in the harmonic oscillator basis is easy and for which the truncation to a finite size Hamiltonian and diagonalization yield a good numerical approximation to the spectra and eigenvectors. This technique will be described in detail during the next section. The second section of this appendix extend this numerical method to resonant or Gamov states using the complex dilatation method. where xψ i |q k |ψ j y " 0 if |i´j| ą k or if i´j`k is odd, xψ i |q k |ψ j y " ? i!j!`m ω ˘´k {2 ? 2 i`j L ijk ÿ l"0 2 1 2 pj´i´k`2lq`i´l k!pi´j`k´2l´1q!! l!pi´lq!pj´i`lq!pi´j`k´2lq! (D.5) otherwise, L ijk " min`i, " 1 2 pi´j`kq ‰˘a nd rxs the integer part of x. In order to get the exact spectrum, one must in principle diagonalize the infinite dimensional operator with elements H ij , i, j P N. However, if only a numerical approximation is needed, it is sufficient to compute the Hamiltonian truncated to a finite dimension N , i.e. the N 2 elements H pN q ij with i, j P 0, . . . , N . Since we are recovering the appropriate eigenvalue problem in the large N limit, i.e. lim N Ñ8 H pN q " H, the numerical approximation for an eigenvalue E n!N is getting closer and closer to the exact value as N increase. Furthermore, since the matrix elements are mostly zeroes for N " d 18 , it is possible to use sparse matrix technique in order to solve the eigenvalue problem with algorithms that are a lot faster than their dense counterpart. As a result, we were able to compute hundreds of eigenvalues E n p q with a thousand of stable digits within minutes, given a fixed polynomial potential with reasonable maximum degree d.

D.2 Resonant states and the complex dilatation method
We can accommodate the method described in the previous section for potentials that are no longer bounded but have resonances. In Quantum Mechanics, we are typically sorting states into two distinguished classes: the scattering states and the bounded states. However, in many situations, we encounter scattering states that happen to be long lived; for example, a particle localized around a local minima of an unbounded potential: classically, the particle is confined in the well, but ultimately tunneling effects allow the particle to escape after a sufficiently long time. The spectrum resulting of such a problem is resonant i.e. its levels has a nonzero imaginary part and are described by wave functions called Gamov states. The physical interpretation being that, provided an energy in the form E " E R˘i Γ{2 with Γ small enough, the Gamov state can be considered as a "quasibound state", exponentially decaying because of the factor exp p´Γt{2 q arising when we are considering its time evolution. In other words, the exponential decay law of a resonant state -arising because of the imaginary part of the energy associated with it -is identifiable with the exponential decay law of a metastable state with lifetime τ " 1{Γ. One can interpret the resonances as the poles of the resolvent G " pH´Eq´1, that can be written as a function of the wave vector k through the Jost functions, arising when k is analytically continued in the lower complex plane Im k ă 0. For the full story, see [28].
In order to extend the numerical method described above to resonant states, let's first describe the action of the group of dilatation on R n with element U θ on a wavefunction ψ: pU θ ψqpqq " e θn{2 ψpe θ qq (D.6) Since we are interested in the one dimensional case, we will chose n " 1 in the flowing. U θ is a unitary transformation, acting on the Heisenberg operatorsq etp as U θq U´1 θ " e θq and U θp U´1 θ " e´θp (D. 7) which implies that its action on the Hamiltonian, if of the standard form H "p 2 2m`V pqq, is This can be easily realized in the previous method since it is equivalent to the very simple transformation Hp , mωq Þ Ñ Hp , e´2 θ mωq, such that our previous formulae still hold. 18 To be precise, the truncated Hamiltonian is a symmetric band matrix with a bandwith of d`1 such that the number of a priori nonzero elements are increasing linearly with N (as p3`2dqN´p1`dqp2`dq in fact), which loses to N 2 eventually such that the matrix density goes to zero in the large N limit. Now, let's promote θ to a complex number. As a result, U θ |ψy may not be in L 2 pRq anymore. At the condition that cos p2 Im θq ą 0 however, the dilated wavefunction of the form pU θ ψqpqq " e θn Ppe θ qq exp´´αe 2θ q 2¯( D. 9) with P a polynomial stays in L 2 pRq. Physically, we can interpret this rotation of the Hamiltonian in term of the analytical continuation of the wave vector k " |k|e´I m θ . As a result, the complex dilated resolvent Gpθq " pHpθq´Eq´1 provide an analytical continuation of the resolvent in the complex band 0 ą k ą Im´θ, whose poles are the resonances. It is equivalent to diagonalize the complex dilated Hamiltonian Hpθq, which can be done numerically using the previously described method. For example, in table 4, we are using the method described in the previous section with the Hamiltonian rotated by the transformation ω Þ Ñ e iπ 16 ω.