Exact WKB methods in $SU(2)$ $N_f=1$

We study in detail the Schr\"{o}dinger equation corresponding to the four dimensional $SU(2)$ $\mathcal{N}=2$ SQCD theory with one flavour. We calculate the Voros symbols, or quantum periods, in four different ways: Borel summation of the WKB series, direct computation of Wronskians of exponentially decaying solutions, the TBA equations of Gaiotto-Moore-Neitzke/Gaiotto, and instanton counting. We make computations by all of these methods, finding good agreement. We also study the exact quantization condition for the spectrum, and we compute the Fredholm determinant of the inverse of the Schr\"odinger operator using the TS/ST correspondence and Zamolodchikov's TBA, again finding good agreement. In addition, we explore two aspects of the relationship between singularities of the Borel transformed WKB series and BPS states: BPS states of the 4d theory are related to singularities in the Borel transformed WKB series for the quantum periods, and BPS states of a coupled 2d+4d system are related to singularities in the Borel transformed WKB series for local solutions of the Schr\"odinger equation.


Introduction
This paper concerns a detailed exploration of the relation between Schrödinger equations and N = 2 supersymmetric gauge theories, from several different points of view. We focus on one particular example, the SU (2) theory with one fundamental hypermultiplet. In this introduction we briefly recall the main players in this story, describe the example we study, and indicate some of the highlights.

Quantum periods
Consider a Schrödinger equation, of the form with a confining potential V (x). Then a well-known problem is to identify the bound state energies, i.e. the values E( ) for which there exists a solution ψ(x, ) on the real line x ∈ R such that ψ(x, ) decays exponentially as x → ∞ and as x → −∞.
More generally, we may consider an equation (1.1) where x and are allowed to be complex, and V (x) is a holomorphic or meromorphic function. Then the potential may not be confining on the real line, but we can pick a more general contour where it is confining, and then ask for the existence of a solution which is exponentially decaying at both ends of the contour. This problem again determines some discrete energies E( ), which we may think of as generalized bound states, or resonances.
One of the important insights of the exact WKB method [1][2][3][4][5] is that the (generalized) bound state energies can be usefully expressed as solutions of an exact quantization condition. The exact quantization condition is an algebraic equation in terms of quantities X γ = exp Π γ labeled by cycles γ on the spectral curve [1] (1. 2) The Π γ are the quantum periods. 1 Up to a factor of , they can be thought of as an -deformation of the classical periods Z γ = γ V (x) − E dx; indeed, they are defined 2 by Borel summation of the series −1 is the exponent in the WKB construction of solutions to the Schrödinger equation (1.1).
There is a connection between some Schrödinger equations (1.1) and N = 2 supersymmetric gauge theories placed in the Nekrasov-Shatashvili (NS) limit of the Ω-background. In this connection the spectral curve (1.2) is identified as the Seiberg-Witten (SW) curve of the field theory, V (x) − E dx is the Seiberg-Witten differential, and is identified with the Ω-background parameter 1 . In particular, the classical periods Z γ control the central charges and masses of BPS states, while the quantum periods Π γ can be computed in terms of the Nekrasov-Shatashvili instanton partition function. 3 This connection has been derived from various different points of view, including direct gauge theory computations and class S constructions using the AGT correspondence; see e.g. [9][10][11][12][13][14][15][16]. Some recent papers which discuss quantum periods and their relation to four dimensional N = 2 theories are [8,[17][18][19][20][21][22][23][24][25][26][27][28][29]. 1 In the exact WKB terminology these quantities are also called Voros symbols. More recently they 1. 2 The SU (2) N f = 1 equation In this paper we consider a specific example of (1.1): This equation corresponds to N = 2 supersymmetric Yang-Mills theory with gauge group SU (2) and N f = 1; 4 Λ ∈ C × is the dynamical scale, m ∈ C is the hypermultiplet mass, and E ∈ C parameterizes the Coulomb branch.

Computing the quantum periods
Much of the utility of the quantum periods comes from the fact that they can be understood and computed from many different points of view. In Sections 3-6 below we compute the quantum periods of the equation (1.3), at various points of the parameter space, in four different ways: 1. Padé-Borel summation (Section 3): As we have explained above, the Π γ are defined by Borel summation of integrals −1 γ Y (x, ) dx. We compute this series numerically to high order in , and then use the method of Padé-Borel summation to produce numerical approximations Π PB γ of Π γ .
2. Wronskians (Section 4): The equation (1.3) admits three distinguished solutions ψ 1 , ψ 2 , ψ 3 which have exponential decay along three distinguished directions in the xplane; e.g. when , Λ > 0 these directions are x → −∞, x → ∞ − 1 2 iπ, x → ∞ + 1 2 iπ respectively. The X γ can be expressed directly in terms of combinations of Wronskians of the solutions ψ i and their images under the monodromy operation of continuation x → x + 2πi; see e.g. (4.10)- (4.12) below for examples of such formulas. 5 By direct numerical integration of (1.3) we can thus compute numerical approximations X SS γ of X γ . 3. TBA equations (Section 5.1): The X γ are (conjecturally) solutions of certain integral equations given in [7,30], closely related to the ODE/IM correspondence [31]. These equations are formulated in terms of the classical periods (central charges) and the BPS state spectrum of the theory. We solve these integral equations numerically, for parameters lying in the strong coupling region (in this region the BPS spectrum is finite, which makes the equations much simpler to deal with), and thus obtain numerical approximations Π TBA γ of Π γ . 4. Instanton counting (Section 6): As we have recalled above, the Π γ can be computed from the Nekrasov-Shatashvili instanton partition function in the SU (2) N f = 1 4 There are many different choices of convention for writing the equation corresponding to this theory; our convention matches that of [14]. 5 One can think of these combinations of Wronskians as slight generalizations of the Fock-Goncharov or Fenchel-Nielsen coordinates on moduli spaces of flat connections.
-3 -theory. We carry out this computation numerically, summing the instanton series to sufficiently high order in Λ, to obtain approximations Π inst γ of Π γ .
Various relations between these methods have been proven or conjectured in the literature. Although the details are complex one can roughly summarize as follows: • The equivalence between methods 1 and 2 is a theorem, following from results in the exact WKB literature, as explained most precisely in [6]; see also [8] for a different route to deriving this equivalence, closer to our point of view in this paper. The recent [32] gives a sharp treatment of the necessary facts from exact WKB.
• The equivalence between methods 2 and 3 is proposed in [7,33] and closely related to the ODE-IM correspondence [31]; it is not yet a mathematical theorem as far as we know.
• The equivalence between methods 2 and 4 would follow from a combination of the proposal of [10] (proven in some cases in [15]) and the results in [8,34].
Combining these theorems and conjectures one arrives at the conclusion that all four methods should give the same results, but it is not yet a theorem in full generality. Moreover, the translation between the various methods is somewhat intricate, particularly as their equivalence is formulated in different chambers of the moduli space.. Thus in this work we set ourselves the task of working out the translation carefully in the case of the SU (2) N f = 1 theory, computing at various points in the parameter space with all four methods, and comparing the results. We find good agreement: within the precision we are able to obtain, the results match. See Table 1 for some sample numerical results.
Various numerical comparisons of this sort have been made before in the literature; for example see [35] for comparisons between methods 1, 3, 4 in the pure SU (2) theory, and [19,31,36] for methods 2, 3 in Argyres-Douglas theories (note method 4 is not available in Argyres-Douglas theories at the moment, since it relies on the Lagrangian description of the theory). See also [23] for computations in the pure SU (3) theory using method 2 and comparisons to the WKB series.
In making these comparisons, we need to be careful about the analytic structure of the quantum periods. As we review in Section 2, there is a wall-and-chamber structure in the parameter space; the quantum periods are analytic in each chamber but jump when one crosses a wall. Thus, in comparing a result computed in one chamber with the analytic continuation of a result computed in a different chamber, one has to take account of extra contributions from the walls separating the chambers. These extra contributions take the form of Kontsevich-Soibelman/cluster transformations associated to BPS states of the bulk N = 2 theory; their concrete form is in (2.1)-(2.3) below. We use them explicitly in Section 7 when comparing instanton counting expressions with other methods.

Fredholm determinant
Another approach to studying the Schrödinger equation (1.3) runs through the Fredholm determinant where O is the Schrödinger operator, with trace class inverse, acting on L 2 functions along the contour where we have a confining potential. This determinant has zeros exactly at the (generalized) bound state energies, so computing it in particular determines these energies. Moreover, it was argued in [35] that in some examples D(E, ) can be computed explicitly by using a particular limit of the TS/ST correspondence [37,38], which allows to express Fredholm determinants using topological string data. This construction has been tested in several works (see for instance [39] and reference therein). A proof in one particular example and in a special limit was given in [40] using Painlevé equations. Recently more general corollaries of this construction have been proven in [41]. Nevertheless a mathematical proof in full generality is still missing.
In Section 8 we apply this approach in the example of (1.3). In particular, we give a formula (8.12) for the Fredholm determinant in terms of the instanton-counting quantities introduced in Section 6.
We also consider a TBA integral equation for D(E, ), introduced by Zamolodchikov in [42]. In general this TBA equation seems to be unrelated to the system of TBA equations obeyed by the quantum periods. However, there is one special situation where there is a relation. Namely, suppose we set E = 0 and m = 0. In that case the TBA equations obeyed by the quantum periods simplify, reducing to a single equation, which matches with the Zamolodchikov TBA. We describe this in Section 8.2. A very similar phenomenon was noticed in the pure SU (2) theory in [35]. We do not have a conceptual explanation for it, in either case; it would be very interesting to find one.

Quantization condition
The equation (1.3) does not have a confining potential on the real line if we take Λ and to be real. However, if we take real, arg Λ = − π 6 , and look along the line Im x = − π 3 , then we do have a confining potential (which may be real or complex, depending on the phase of m), so we can formulate the bound state problem. It turns out that for m ∈ iR >0 , the case of a real convex confining potential, this condition can be formulated very simply: it is where γ [1,0,0] is the cycle connecting the two classical turning points, shown in Figure 11 below.
In this paper we give two different routes to deriving this exact quantization condition. One, in Section 4, goes through the connection between quantum periods and Wronskians of solutions. The other, in Section 8, uses the connection between quantum periods and Fredholm determinants, combined with the relation between Fredholm determinants and instanton counting. Happily, both methods independently give the quantization condition (1.5); this provides a nice cross-check of our computations.

Comments
We comment on a few interesting points and future directions here: • The result of instanton counting agrees directly with the quantum period only at a particular locus of the parameter space, which we call the instanton locus. This locus lies on one of the walls in the wall-and-chamber decomposition of the parameter space. The results of [10,34], translated to our language, amount to a determination of the instanton locus in the SU (2) N f = 4 theory, and similarly [35] determines the chamber in the pure SU (2) theory. For the SU (3) N f = 6 theory the instanton locus was found in [43]. In all of these examples, the instanton locus lies at weak coupling, with chosen so that arg is the phase of the central charge of the vectormultiplet.
In this paper we identify the instanton locus in the SU (2) N f = 1 theory. We find that this locus is determined by requiring that the parameters (Λ, m) define a positive, convex and confining potential along some line in the x-plane. As for the parameter, we find that it again follows the same pattern as above.
For generic complex values of the parameters, instanton counting will agree with Borel summation only after we implement an appropriate Kontsevich-Soibelman (KS) transformation. 6 This is described in Section 7.
• We work out explicitly the transformation relating the quantum periods at weak coupling to the analytic continuation of the quantum periods from strong coupling; see (7.18)- (7.20). This transformation can be viewed as a relation between specific sorts of Fock-Goncharov-type and Fenchel-Nielsen-type coordinates, generalizing a similar (simpler) one which appears in the pure SU (2) theory and was used recently in [35,44].
• As we remarked above, the singularities of the Borel transform of Π γ are expected to appear at the central charges of BPS particles in the N = 2 field theory. This phenomenon was explored numerically in [35] for the pure SU (2) theory, and we do the same in the SU (2) N f = 1 theory here. We also discuss a related statement for the singularities of the Borel transform of the WKB solutions of the Schrödinger equation (1.3): namely, these appear at the central charges of BPS solitons in a certain 2d-4d coupled system. (In practical terms this means considering integrals of the Seiberg-Witten differential along open paths instead of closed ones.) This is discussed in Section 3.4 and Appendix C.2.
• The coupled 2d-4d system should also lead to other methods of computing local solutions of the Schrödinger equation directly, by appropriate 2d-4d extensions of the methods we use here to compute quantum periods. Indeed, an extension of the TBA integral equations which should compute the solutions has been described in [7]; it arises as the conformal limit of the 2d-4d equations of [45]. One should also be able to compute the solutions by a version of the Nekrasov-Shatashvili instanton counting in the presence of the surface defect, see for instance [14] or [15] for more recent work. It would be interesting to work this out carefully in some examples.
• In this paper we study the four-dimensional field-theoretic framework which, on the operator theory side, corresponds to studying a differential equation. It would be interesting to generalise this approach to the five-dimensional field theory setup and the corresponding difference equations, considered e.g. in [46]. One would expect this to make contact with exponential networks [47][48][49][50] and BPS states of local CY threefolds [51], see also [52,53]. It would also be interesting to understand the structure of the exact solution for the spectral theory of such difference equations proposed in [37,38,54,55]. are the quantum periods we obtain by Padé-Borel summation, small section, TBA and instanton counting methods respectively; all of them are approximations to the true Π γ . For each point of parameter space which we study, we list results from all methods which we were able to apply at that point. We emphasize that Π γ denotes the canonical piecewise-analytic function discussed in Section 2 below; e.g. this is the quantity one would obtain directly by Borel summation without any further transformations.

Analytic structures
In what follows we are going to compute the quantum periods by various different methods and compare them. To make this comparison correctly one needs to take account of a certain wall-and-chamber structure in the parameter space, which we review here.

Walls and chambers
We consider a complex four-dimensional parameter space, consisting of the complex couplings (m, Λ), the Coulomb branch modulus u, and a complex mass parameter = 0, which could be interpreted as an Ω-background parameter.
In this space one has various real-codimension-1 walls 7 defined as follows. A point (m, Λ, u, ) is on a wall if and only if the 4d field theory with couplings (m, Λ), at the point u of its Coulomb branch, has a BPS one-particle state for which the central charge Z has arg(−Z) = arg( ), i.e. Z/ ∈ R − . In this case we say that the wall supports the BPS state. Generically, each wall will support only BPS states which are mutually local with one another, i.e. their charges obey γ, γ = 0. The walls divide the parameter-space up into chambers.
To get some feeling for this structure let us consider slicing it along various directions. If we hold the parameters (m, Λ, u) fixed and let only vary, then the walls reduce to rays in the -plane. Each BPS state which exists in the theory at (m, Λ, u) is supported by a ray in the -plane whose angle is arg(−Z). Since Z is determined by the electromagnetic and flavor charge γ of the state, we may also denote it as Z γ . See Figure 1 for the walls in the -plane at two different points in (m, Λ, u) space.
As (m, Λ, u) are varied, the quantities Z γ vary, and thus the rays move in the -plane. To capture this behavior it is useful to draw a different slicing, where we show one real direction in the (m, Λ, u) parameter space, and also show the phase arg . See Figure 2 for an example of this in the SU (2) N f = 1 theory, and Figure 14 for an example in the simpler pure SU (2) theory. Each of these figures can be thought of as a graph of the evolution of the phases of the central charges of BPS particles as we move along a curve in the Coulomb branch. Note again that when the phases collide some BPS bound states can form or decay, and thus we have different numbers of BPS states in different regions of the Coulomb branch: finitely many at strong coupling, infinitely many at weak coupling.
Finally we could consider holding (m, Λ, ) fixed and letting u vary. In that case we get a collection of walls on the Coulomb branch. See Figure 15 for an example in the pure SU (2) theory.

Chamber structure for quantum periods
The importance of this chamber structure for us is that the quantum periods Π γ (m, Λ, u, ) are piecewise analytic functions on the parameter space: precisely, they are analytic in each 7 The walls have many different names in the literature. They have been called "BPS walls" [56] and "walls of the first kind" [57]. Their projections to fixed ϑ are also identified with the walls of the scattering diagram in the sense of [58,59]. The projections of the walls to fixed (u, m, Λ) are the "BPS rays" [56] or "active rays" [60]. These walls are not the same as the walls of marginal stability for 4d bulk BPS states, aka "walls of the second kind" in [57]. Indeed, each of the BPS walls is labeled by a single BPS state or a collection of BPS states with mutually local charges, while the walls of marginal stability are places where mutually non-local BPS states interact.
-10 -   There is a wall in the direction ϑ whenever there exists a BPS particle of charge γ with ϑ = arg(Z γ ). (Generically each wall corresponds to a single particle, but in Figure 1b each of the horizontal rays actually represents several BPS particles with the same phase: a vectormultiplet and two hypermultiplets. This accidental degeneracy would be broken for m = 0.) In Figure 1b, the rays accumulate around ϑ = 0, which is the phase corresponding to the vectormultiplet. This kind of accumulation happens generically in theories with higher-spin BPS particles.
chamber, but jump at the walls. This structure shows up in a different way in each method of computing the quantum periods: 1. In the Borel summation method, the jumps occur because of the need to move a contour of integration across a singularity in the Borel plane.

Figure 2:
The BPS walls when we fix Λ = 1, m = 0, Im(u) = i 10 . The horizontal axis is Re(u); the vertical axis is arg(− ) ∈ [−π, π]. There are 2 special points at around u 1 ≈ −0.6 + i 10 and u 2 ≈ 0.675 + i 10 where the wall of marginal stability is encountered. For Re(u) ∈ (u 1 , u 2 ) (strong coupling) we have 3 hypermultiplets and their antiparticles, so there are 6 walls in total shown in this region. For u < u 1 or u > u 2 (weak coupling), we have infinitely many hypermultiplets. The hypermultiplet walls accumulate around the vectormultiplet wall. We list the electromagnetic charges of the particles next to their corresponding walls.
To keep track of the analytic structure, and having in mind the possibility of analytic continuation from one chamber to another, it is convenient to introduce new functions Π (m 0 ,Λ 0 ,u 0 , 0 ) γ (m, Λ, u, ) which are defined by analytic continuation of Π γ from a basepoint (m 0 , Λ 0 , u 0 , 0 ). Thus our convention is: when we write Π γ (m, Λ, u, ) without a basepoint superscript, we mean the canonical piecewise-analytic function; when we write it with a basepoint superscript, we mean the function defined by analytic continuation from the basepoint. 8 Since the dependence on 0 is only through arg 0 we also sometimes use the notation ϑ = arg 0 and write e.g. Π ϑ γ instead of Π 0 γ . The question now naturally arises: what is the relation between the analytic continuations from different chambers? To understand this, it is sufficient to understand what happens for two chambers separated by a single wall. To be definite, let us hold (m, Λ, u) fixed for a moment. Then the wall is just a ray in the -plane, at some arg = ϑ * . Now we consider the relation between Π ϑ γ and Π ϑ γ for two different phases ϑ, ϑ with ϑ < ϑ * < ϑ .
In this case the relation takes the form [33,61] Here: • The sum runs over the charges γ of BPS states supported at the wall.
• σ can is a factor defined in [33], with the property that σ can (γ) = −1 whenever γ is the charge of a BPS hypermultiplet, and σ can (γ) = 1 whenever γ is the charge of a BPS vectormultiplet.
At first (2.1) seems to have a puzzling asymmetry: why did we write X ϑ γ on the right instead of X ϑ γ ? But since the BPS states supported at a generic point of the wall are all mutually local, 9 (2.1) says that Π ϑ µ = Π ϑ µ when µ is any charge supported at the wall. Thus we have X ϑ γ = X ϑ γ , so it did not matter which we wrote on the RHS. The simplest and most generic case is a wall supporting a single BPS hypermultiplet of charge γ; in that case we have Ω(γ) = 1, σ can (γ) = −1, and thus the transformation becomes 10 Π So far we have been discussing Π γ in the open chambers, but it will be important below sometimes to consider Π γ on the walls as well. On a wall, we define Π γ to be the average of the limits of its values from the two sides of the wall. Thus, the analogue of (2.1) for comparing the value on the wall to the value on one side of the wall just involves an extra factor 1 2 : More generally we may consider varying all the parameters (m, Λ, u, ). For example, looking at Figure 2, we see that while holding (m, Λ) fixed, we could cross any given wall either by varying arg while holding u fixed or by varying u while holding arg fixed. Irrespective of which parameters we vary, the transformation associated to the wall is the same, given by (2.1).

Borel summation
In this section, we briefly review the exact WKB method and Padé-Borel summation, applied to the Schrödinger equation For the moment, we do not impose any reality conditions on the parameters (m, Λ, E) or the variable x in (3.1). Sometimes it is also useful to make the coordinate transformation and redefine ψ(z) = (z) − 1 2 ψ(z), after which (3.1) becomes Here z is a coordinate on the punctured Riemann surface C = CP 1 \{0, ∞}. In the rest of the manuscript we go from x to z interchangeably. Which variable we are using should be clear from the context.

All-orders WKB
The starting point is the all-orders WKB analysis. Let us make the following ansatz for a solution of (3.1): Then (3.1) implies that Y (x, ) should satisfy the Ricatti equation We can solve (3.6) formally as a power series in using the ansatz where Y 0 = ± P (x). We denote the two choices of sign by Y 0,(1) and Y 0, (2) . All the higher order terms depend on which Y 0,(i) we choose, so we denote the solutions It is convenient to split the formal series expansion (3.7) into even and odd components as (3.9) Then one finds that (3.10)

Borel summation of the local solutions
An important point is that the all-orders WKB method does not provide actual analytic solutions, but formal power series. Indeed the coefficients in (3.7) grow factorially as Y n ∼ n! for n 1.
(3.11) Therefore, (3.7) is purely a formal expression with zero radius of convergence. Borel summation gives a way to convert this type of asymptotic series into an analytic function (for lying in some half-plane). This works as follows. We consider the Borel transform of the formal series Y (z, ),Ŷ which is a convergent series for sufficiently small |ζ|. The Borel summation s(Y ) is then defined by the Laplace transform Note that in the integral (3.13), we need to analytically continueŶ (z, ζ) along the integration ray, beyond the region where the sum (3.12) converges. It is known that such an analytic continuation exists, and the integral (3.13) converges, for generic choices of arg( ) [32,63]. In numerical computations, we approximate the desired analytic continuation by taking finitely many terms in the series (3.12), and then taking a Padé approximant of the resulting polynomial; this gives a rational function, meromorphic in the whole ζ-plane. Substituting this rational function forŶ (z, ζ) in (3.13), we obtain an approximation to the desired s(Y )(z, ). This method of approximation is known as Padé-Borel summation.
For some special values of arg( ), it may happen that the integral in (3.13) is not well defined, becauseŶ (z, ζ) has singularities along the integration contour. In this case, we say that Y (z, ) is not Borel summable, and consider instead the lateral Borel summation (3.14) In this paper we will never use lateral Borel summation directly; rather we always use the median summation, which is defined as One powerful way of understanding the singularities in the Borel plane, and the corresponding behavior of Borel summation, is by exploiting the connection between the operators (3.1), (3.4) and Seiberg-Witten theory, which we now review.
It is well known that the classical limit of (3.4) corresponds to the Seiberg-Witten curve for four dimensional SU (2) theory with N f = 1 by identifying E = 2u; see for instance [14] which has the same conventions we do. We recall that this Seiberg-Witten curve can be represented as − − → C. For generic u, the quantity P (z) in the parentheses has 3 zeros; we call them z 1 , z 2 , z 3 ; then {0, z 1 , z 2 , z 3 } are the branch points of the covering.
For any value of parameters, the electromagnetic and flavor charge lattice Γ can be represented as a rank 3 sublattice of H 1 (Σ, Z), where Σ is obtained by filling in the punctures of Σ. We will choose a basis of Γ for each value of parameters that we study, and thus represent the charges concretely as γ [m,n,µ] . In each case we fix a pure magnetic charge and a pure flavor charge In each case we take γ f to be the homology class of a loop surrounding only the irregular singularity z = ∞ and no other turning points or singularities.
Some examples of charges in the bases we use are shown in Figure 3 and Figure 4a. Note that when the parameters (u, m, Λ) change, the positions of branch points also change; thus we have to analytically continue the branch points and the corresponding cycles. The specific choice of basis shown in Figure 4a is well adapted for comparison with the instanton counting method: the vectormultiplet has charge γ a , while the derivative of the prepotential corresponds to the charge γ a D . We discuss this in more detail in Section 6.
(3.20) 11 The flavor charge doesn't contribute to the intersection number. Hence we neglect flavor charge and represent it by * .
where λ is the Seiberg-Witten differential.

A strong coupling point
As an example we can take the parameters to be m = −1/10, Λ = 1, u = 0. In this case we are in the strong coupling region and there are only 3 BPS hypermultiplets, with charges γ ±[1,0,0] , γ ±[0,1,1] and γ ±[−1,−1,1] . These charges are shown in Figure 3. The corresponding central charges are Let us discuss separately the central charge corresponding to the flavor mass Z γ [0,0,1] . In the limit z → ∞, we have λ ≈ ± −(Λ − m z ) 2 dz. Hence there is a singularity at ∞ whose residue gives ∓2πm. Integrating around the loop γ [0,0,1] shown in Figure 3 then we have We use orange crosses to denote the turning points of the SW differential. They are branch points of the covering Σ → C. The orange wavy lines represent the branch cuts. The blue dot denotes the singularity at z = 0. There is another singularity at z = ∞.
In the strong coupling region, we have 3 BPS states corresponding to the blue, green and yellow cycles. The pure flavor charge is plotted as a large red loop.

A weak coupling point
Let us now consider an example inside the weak coupling region where we have infinitely many BPS states. We can take u = 2, Λ = 1 5 and m = 0. There, the BPS spectrum of the theory consists of: • Two hypermultiplets with charges γ [0,1,1] and γ [0,1,−1] . Each of them has central charge 1 2 Z γa 12 . Their two charges sum to the charge of the vectormultiplet.
• Hypermultiplets with charges We show the charges of the BPS states γ a , γ a D , Figure 4.

Stokes graphs and Borel poles for the local solutions
To discuss Borel summation of the all-orders WKB series, it is useful to first introduce ϑ-Stokes graphs W ϑ . (If ϑ is not specified, we assume ϑ = arg( ).) The ϑ-Stokes graph is made of ϑ-Stokes curves on the punctured sphere C. Each ϑ-Stokes curve of type ij (where (i, j) = (1, 2) or (2, 1)) is an oriented trajectory starting at a turning point, along which the 1-form e −iϑ (Y 0,(i) − Y 0,(j) )dz is real and positive. Stokes graphs are also known as spectral networks, and we will use both names in this paper. Some examples of Stokes graphs appear in Figure 8, Figure 9, Figure 10, Figure 11 below.
The local WKB solutions in each domain of C\W ϑ are defined by The space of solutions of (3.4) is a 2-dimensional vector space; ψ (1) and ψ (2) form a basis of this vector space in each domain of C \ W ϑ . The solution ψ (i) jumps at a Stokes curve of type ij (while ψ (j) does not jump there.) This jumping is a manifestation of the Stokes phenomenon.
To understand this jumping phenomenon better, note that the Borel summation in (3.22) is only well defined if the Borel transformŶ (i) (z, ζ) has no singularities in the ζplane along the ray of integration (0, e iϑ ∞). The positions of the singularities ofŶ (i) (z, ζ) in the ζ-plane depend on z (as well as E, Λ, m). It is known [32,63] thatŶ (i) (z, ζ) can only have singularities along the rays ζ ∈ (0, e iϑ ∞) for specific ϑ, namely those ϑ such that 12 In the massive case, their central charges would be Zγ [0,1,±1] = 1 2 Zγ a ∓ 2πm. . We can see this from Figure 4c which shows how the spectral network looks when we slightly vary ϑ. This spiraling walls will be more and more less spiraling when ϑ is varying away from ϑ = 0. In this process, there will be infinite saddle connections corresponding to hypermultiplets. These infinite saddle connections correspond to the hypermultiplets γ a D + nγ a and γ [−1,−1,1] + nγ a , where n = 0, 1, ... is the winding number of the paths inside the ring domain in Figure 4b.
z lies on a ϑ−Stokes curve of type ij. This gives an explanation of the fact that ψ (i) (z) is well defined only for z away from ϑ-Stokes curves of type ij.
So far we have described the arguments of singularities ofŶ (i) in the Borel plane, but not their magnitudes. We can make a more precise statement: if z lies on a ϑ-Stokes curve of type ij, thenŶ (i) (z, ζ) has a singularity at where z 0 is the branch point where the Stokes curve begins. This statement appears in the exact WKB literature: see in particular [64], where it is explained in terms of the rules for propagation of singularities derived from microlocal analysis.
We made some numerical verifications of this statement in the SU (2) N f = 1 theory, by choosing a point z and computing Padé approximants to partial sums of the series Y (i) (z, ζ) up to N terms. In the N → ∞ limit, the poles of the Padé approximant lie along curves in the ζ-plane, and the endpoint of each curve is one of the singularities of the truê Y (i) (z, ζ). At finite N one sees some approximation to this structure, and can read off an approximation of the position of the desired singularities. We find that they indeed lie at the expected positions (3.23). See Figure 5 and Figure 6 for two examples. In Appendix C.2 we present some similar checks in the pure SU (2) theory.
In terms of quantum field theory, the quantity 2 z z 0 λ has a simple meaning, as follows. We consider the 4d SU (2) N f = 1 theory coupled to a certain N = (2, 2) supersymmetric surface defect S(z), where the parameter z ∈ C is identified as the coupling of the defect S(z), as discussed in [45,65]. This surface defect has 2 vacua corresponding to the sheets i, j. Then z lies on the ϑ-Stokes curve of type ij exactly if the defect S(z) admits a BPS soliton with phase ϑ which interpolates from vacuum i to vacuum j. In this case 2 z z 0 λ is the central charge of the BPS soliton. In short: singularities of the Borel transform Y (i) (z, ζ) appear at the central charges of BPS solitons in the surface defect theory S(z). The number of singularities depends on the value of z; this is the wall-crossing phenomenon for BPS solitons [45,66].
This proposal is parallel to the proposal of [35] that singularities in the Borel transform of the quantum periods appear at the central charges of BPS particles in the 4d theory. (We will explore that phenomenon in the SU (2) N f = 1 theory below.) Indeed, taking the conformal limit of the analysis of [30,45,66], one concludes that Stokes jumps of the local solutions are induced by BPS solitons, in complete parallel to the way that Stokes jumps of the quantum periods are induced by 4d BPS particles.  .7) for u = 2, m = 0, Λ = 1/5 and z = e i , with N = 50 terms in the series. There are infinitely many poles of Y (2) , corresponding to the central charges of solitons supported at z. Only finitely many of them are visible in our approximation. (Again, for Y (1) the singularities would be at the opposite points ζ = −ζ i .) Right: cutoff Stokes graphs at ζ = ζ 1 , ζ 2 , ζ 3 , ζ 4 , as in Figure 5 above.

Borel summation for quantum periods
Given γ ∈ Γ, we define the WKB quantum period Π WKB γ ( ) as the integral of the even part of the WKB series (3.9) along γ: In particular, We are now ready to define the quantum periods, by Borel summation:

The one-loop sign
One might wonder why we do not define the WKB period as the integral of the full WKB series (3.7). The odd part is a total derivative, according to (3.10). Hence the only contribution of the odd part comes from the monodromy of log Y even around the contour of integration on Σ. By expanding the log one sees that this monodromy comes just from the leading term in Y even , i.e. it is the same as the monodromy of log √ P . Since √ P is single-valued on Σ, this monodromy is a shift by 2πiω for some ω ∈ Z. Thus we have Including this contribution would lead to an extra sign exp −1 Y odd = (−1) ω in the exponentiated WKB series. This sign is subtle, for two distinct reasons: • It picks up a factor −1 when the contour of integration on Σ is moved across a branch point, so it is not (quite) a function of a homology class γ ∈ H 1 (Σ, Z).
• It is not coordinate invariant: for a loop which goes around the cylinder, computing in the z-plane and the x-plane lead to different signs.
For our immediate purpose, it is convenient simply to avoid these issues, by taking only the even part as we did in (3.24); then the resulting Π γ is canonical, well defined as a function of the homology class (charge) γ, and additive. However, we will meet this sign again in Section 4.1 below, and we discuss it from a more invariant point of view in Appendix B.

Padé-Borel computation of quantum periods
The coefficients Π n γ in (3.26) can be efficiently computed by using the differential operator technique, parallel to [35,67,68]. We first note that 13 the Y 2n (z, u, m)dz term can be expressed as where d(· · · ) denotes a total derivative term in z. Therefore Π n γ satisfies We also emphasize that the quantum period for the flavor charge Π γ [0,0,1] is not subject to quantum corrections, as discussed for instance in [68] (see also Appendix A for a direct computation). In other words, In particular Π n γ f = 0, ∀n > 0, which implies the constraints 14 Given the form of the relation (3.29) it is relatively straightforward to compute the coefficients b n i up to n = 80, at any particular point (Λ, m, u); we show samples of the first few b n i in Table 2. Then we compute the three quantities Π 0 γ , ∂ u Π 0 γ and ∂ m Π 0 γ by direct numerical integration. Thus we obtain 80 terms of the series Π WKB γ . Then following the same Padé-Borel summation technique discussed in Section 3.4, we get the approximate quantum period Π PB γ . In this way one can get many digits of precision; see Table 1 for some sample results.
Let us comment briefly on the singularities of the Borel transformΠ γ . As predicted in [35],Π γ is expected to have singularities at ζ = Z γ when γ is the charge of a BPS 13 We have been neglecting moduli parameters in the equation and solutions in former discussion. Recall we have Coulomb branch vev u and flavor mass m. So Y 2n (z) is actually Y 2n (z, u, m). 14 We tested explicitly that this relation holds also for the other periods.  Table 2: The first few b n i , for u = 0, m = −1/10, Λ = 1.
particle existing in the theory at the particular point in moduli space that we are studying, and γ, γ = 0. In Figure 7 we show numerical checks of this phenomenon at strong and weak coupling; we indeed find the poles at the expected places. These singularities are responsible for the fact that Π PB γ is only piecewise analytic, as we reviewed in Section 2.
4 Computation by small sections

Rules for writing down Wronskians
In this chapter we explain how to use Wronskians of local solutions of (1.3) to compute quantum periods, following a general formalism laid out in [8,33].
The basic ingredients needed are: 1. Three solutions ψ 1 , ψ 2 and ψ 3 of (1.3), which decay exponentially along three paths approaching the irregular singularities of the equation at z = 0, z = ∞.

Global structure of the Stokes graph
We need to discuss a bit about the global structure of the Stokes graph (see e.g. [33] for more).
Recall that the Stokes curves of type ij are examples of WKB curves of type ij, i.e. curves along which e −iϑ (Y 0,(i) − Y 0,(j) )dz is real and positive. When any WKB curve of (a) type ij approaches an irregular singularity, it asymptotes to one of the distinguished Stokes directions around the singularity with the same implicit label ij. In a local coordinatez, each Stokes direction is a ray going intoz = 0, characterized by the property that atz → 0 along the ray To determine these directions explicitly it is sufficient to consider the leading-order behavior of (Y 0,(i) − Y 0,(j) ). Moreover, because the integral diverges asz → 0 we see that the choice ofz 0 is unimportant. We will show examples shortly, and see that in the SU (2) N f = 1 theory there is one Stokes direction going into z = 0 and two going into z = ∞.
We can also consider generic WKB curves; each such curve is determined given a point -24 -z ∈ C\W it goes through. Generic WKB curves never intersect each other, nor do they intersect the Stokes curves; the Stokes curves and generic WKB curves together make up a foliation of the Riemann surface C.
For generic ϑ, following any generic WKB curve in either direction leads asymptotically to one of the Stokes directions around one of the irregular singularities, and likewise for following a Stokes curve in the forward direction. For special ϑ, ϑ = arg(−Z γ BPS ) with γ BPS the charge of a BPS particle, there are two other possibilities. First, we can have a saddle connection, a Stokes curve connecting two turning points; this corresponds to a BPS hypermultiplet. Explicit examples are shown in Figure 4b and Figure 4c. Second, we can have a ring domain, a 1-parameter family of closed WKB curves; this corresponds to a BPS vectormultiplet. A ring domain has two boundaries; each boundary is generically a single Stokes curve emanating from a turning point and returning to the same turning point, but in special cases (such as the m = 0 case in Figure 4b) it can be broken into multiple saddle connections between multiple turning points.

Exponentially decaying solutions
Following the discussion above, in each Stokes direction going into a singularity, we get for free a corresponding exponentially decaying solution (up to a constant). Recall that the ansatz we use in the WKB method is Now suppose z approaches an irregular singularity along a Stokes direction with label ij.
Since we require Re(e −iϑ ) > 0, ψ (j) is exponentially small compared to ψ (i) when z approaches the singularity. Moreover, since Y (i) = −Y (j) we can also write this ratio as Thus ψ (j) is exponentially decaying as z goes into the singularity along a Stokes direction with label ij.
We look at the two singularities separately: Given a phase ϑ, we have 1 Stokes direction. Figure 8 is an example at ϑ = 0; then the Stokes direction at z = 0 is 0 + with label 12. The exponentially decaying solution along Stokes direction is 2. When z → ∞, we usez = 1 z , and then Y 0,(i) − Y 0,(j) dz ∼ ± iΛ z . Given a phase ϑ, there are 2 Stokes directions with opposite labels. In Figure 8, which is at ϑ = 0, -25 -the Stokes directions at z = ∞ are ∞ e πi/2 with label 12 and ∞ e −πi/2 with label 21. The exponentially decaying solution along Stokes direction 21 is 16 6) and the exponentially decaying solution along Stokes direction 12 is Now suppose we look at a generic WKB curve. In one direction it goes into a Stokes direction with label ij, and in the other direction it goes into a Stokes direction with label ji. Thus the two WKB solutions ψ (i) , ψ (j) along this curve can also be described as the exponentially decaying solutions in these two Stokes directions.
The Stokes graph W ϑ separates C\W ϑ into domains. In each domain, all generic WKB curves run between the same pair of asymptotic Stokes directions. Thus the basis of exponentially decaying solutions which we obtain in a given domain is the same no matter which generic WKB curve we consider. When we move across a Stokes curve to a different domain, one or both of the asymptotic Stokes directions along generic WKB curves changes, and thus the basis of exponentially decaying solutions jumps. This is consistent with the fact we reviewed in Section 3.4, that the basis of solutions ψ (1) , ψ (2) is well defined up to constant multiple in each domain, and jumps (due to the presence of singularities in the Borel plane) when we cross a Stokes curve from one domain to another.
In some cases a generic WKB curve goes to the same asymptotic Stokes direction at both ends. This might seem like a contradiction: there is only one exponentially decaying solution at that Stokes direction, so how will we get a basis of solutions from exponentially decaying solutions along this WKB curve? The resolution is that we need to be careful about the global monodromy: when we speak of the two-dimensional space of global solutions of the equation, we really mean the space of solutions on the complement of some branch cut ("monodromy cut") in the z-plane. When we transport a solution across this cut we transform it by the action of the monodromy M or M −1 . We will see examples below.
Inside ring domains, the Stokes curves do not go to any irregular singularity. Thus we cannot find a basis of solutions there using our exponential-decay prescription. Instead, the appropriate basis consists of the eigenfunctions of the monodromy around the ring, as described e.g. in [34].
As we have just reviewed, in each domain of C \ W we have a distinguished pair of solutions determined up to scalar multiple. We will call the exponentially decaying solutions approaching singularities ψ 1 , ψ 2 and ψ 3 as indicated in (4.5), (4.6), (4.7). Then, see Figure 8, Figure 9, Figure 10, Figure 11 for some examples of explicit local bases. Some convenient rules for writing down the local bases of solutions in all domains are [8]: 1. We use the notation (ψ, ψ ) to represent a local basis of solutions (ψ (1) , ψ (2) ) labeled by the two sheets of the covering Σ → C. ψ and ψ are swapped when crossing a branch cut: (ψ, ψ ) → (ψ , ψ) (4.8) 2. We choose a monodromy cut for the differential equation as discussed above, and when we cross this cut, the basis gains a factor of the monodromy matrix M .
3. When we cross a Stokes curve of type ij, the solution ψ (j) is unchanged, while ψ (i) generally changes.
(This can be understood as: shifting the exponentially growing solution by a multiple of the exponentially decaying solution gives another exponentially growing solution. But we will not use this point of view explicitly, and will simply treat ψ (i) on the two sides of the wall as different solutions.) 4. When we cross a double wall, both ψ (1) and ψ (2) generally change.
5. In a ring domain, the local basis of solutions is not constructed directly from the exponentially decaying solutions; rather they are eigenfunctions of the monodromy matrix M . (Thus, strictly speaking, they are not single-valued solutions on the ring domain, but rather on the complement of a monodromy cut.) In terms of these local bases, the quantum period associated to a cycle γ is obtained as a product of factors as follows. Let [ψ, ψ ] denote the Wronskian of the two solutions ψ and ψ .
1. When γ crosses a single Stokes curve of type ij on sheet i, from side L to R, add a 2. When γ crosses a double Stokes curve on sheet i, add a factor to the product. (This factor is ambiguous as written, because we have not specified a branch of the square root. This sign can in principle be determined following a rule given in [8], but this rule is cumbersome in practice; in this paper we will not try to implement it, and just live with this sign ambiguity in cases involving double Stokes curves. All formulas in this paper which involve a square root of a product of Wronskians have to be understood as having this sign ambiguity; in numerical comparisons we just fix the sign by hand when necessary.) 3. When γ crosses a monodromy cut in a ring domain, add a factor µ or 1 µ to the product, where µ, 1 µ denote the eigenvalues of the monodromy operator M .
-27 -4. We include an overall sign factor exp(− 1 4 γ dP P ), where P (x) is the potential in the cylinder coordinate, given in (3.2). (This factor was not included in the rules in [8]; we saw it in Section 3.6, and we discuss it more in Appendix B.) Combining all factors as described above when going along some loop γ, we obtain the Wronskian expression X SS,ϑ γ . The result only depends on the homology class γ, although the individual factors may well depend on the precise choice of representative.

Quantum periods in strong coupling region
As an example we can choose the parameters to be u = 0, m = −1/10 and Λ = 1. The corresponding spectral network W ϑ=0 is shown in Figure 8. By applying the rules given in Section 4.1 we obtain the following Wronskian expressions for the quantum periods: , (4.10) For completeness we also show the Wronskian expression for the period corresponding to flavor mass: (4.13) Alternatively we can consider W ϑ=arg(1+ i 10 ) as shown in Figure 9. The resulting expressions are , (4.14) These periods are related by 17 (4.17) 17 We emphasize again that we have not fixed the branch of the square root.  We evaluated these Wronskians numerically; some results are shown in Table 1. -29 -

Quantum periods in weak coupling region
Now let us consider the point u = 2, m = 0, Λ = 1/5 in the weak coupling region. We use the spectral network W ϑ=0 shown in Figure 10. Again using the rules of Section 4.1, we obtain Wronskian expressions for the quantum periods: where µ is the eigenvalue of the monodromy matrix M chosen by comparing with the same quantum period gotten in other method. ψ 4 and ψ 5 are eigenfunctions of M such that M ψ 4 = 1 µ ψ 4 and M ψ 5 = µψ 5 . For completeness, we also show . (4.21) For later convenience we also show the X γ for a few other charges:

Quantization condition
In this section we study the quantization condition for the operator (1.3), in the particular situation where the potential is real, convex and confining along some path in the z-plane. In this case the bound states correspond to solutions decaying exponentially when approaching both ends of the path. Such a solution exists when the solutions decaying on Stokes directions at the two ends of the path are linearly dependent. We will see below that the resulting quantization condition for the energy spectrum takes the simple form (4.25) As an example we take The corresponding spectral network and local solutions for W ϑ=0 at u = 2 are shown in Figure 11. More generally, keeping Λ and m fixed, we allow u to vary in a range on R containing u = 2 so long as the spectral network maintains the same topology. The locus we are considering is in the weak coupling region and at the special phase ϑ = 0, which is the phase of the central charge of the BPS vectormultiplet; thus we see a ring domain in Figure 11.
With the parameters (4.26), the Schrödinger equation (1.3) becomes If we choose a path parametrized by then (4.27) becomes with real convex confining potential along t ∈ R. Bound states are solutions ψ(t) decaying as t → ±∞. The corresponding path in the z plane is    This is the exact quantization condition. It has a discrete set of solutions {E n } n≥0 , which give the bound state energies for (4.29).
For completeness, we also show another quantum period at this point (although this one does not participate in the quantization condition): . In this section we briefly review the TBA of [7] (conformal limit of the GMN TBA [30,33]), focusing on the example of the SU (2) N f = 1 theory. As we will see, this system of integral equations provides us with another way to compute quantum periods.
We consider spectral coordinates X TBA where Ω(γ , u) denotes the BPS index of BPS states with charge γ and where r γ = : The reason for considering the equation (5.1) is that it guarantees that the X TBA γ will have the expected → 0 asymptotics X γ ∼ exp(Z γ / ), and also the expected jumps as the phase of is varied.
-33 -and write In the weak coupling region, because of the infinite tower of BPS states, (5.1) leads to an infinite tower of coupled TBA equations which are hard to solve. Therefore, in this section we will simply focus on the solution to (5.1) in the strong coupling region, where the BPS spectrum consists of hypermultiplets with charges Using this definition we rewrite (5.1) as If the TBA has singularities along a given direction, then we simply denote where + stands for e i0 + and − stands for e i0 − . Following [7,35,69], we expect that where we are using the definition (3.26).
We solved the TBA equations numerically to test this hypothesis; the results are in Table 1. Notice that the convergence of the TBA is a bit slow, it may be possible to obtain a few more digits by implementing explicitly some boundary condition at Λ → ∞ similar to [35].

A special point
We now move to another interesting point. It has been noted that the GMN TBA equations often simplify at particularly symmetric points of the Coulomb branch. In particular, in the pure SU (2) theory at u = 0, the two GMN TBA equations collapse to a single equation [7,35]. Moreover, it was observed in [35] that this single equation coincides with the one used by Zamolodchikov in [42] to compute the Fredholm determinant of the (modified) Mathieu operator; see also [70] for related work. We will see that a similar phenomenon happens in the SU (2) N f = 1 theory at the point m = 0, u = 0. This point is special because the distribution of central charges of BPS states has Z 6 symmetry: see Figure 12.
Since the flavor charge does not play a role in the TBA in the massless case, in the following we will omit this third component and use the notation γ [a,b] for the charges. The BPS spectrum then consists of 3 hypermultiplets with central charges 19 Therefore the 3 TBAs at u = 0 = m read dθ , dθ .

-35 -
If we make the ansatz˜ these 3 equations collapse to a single one, dθ . (5.21) This equation has appeared before in the work of Zamolodchikov; see [42, eq. (4.1)] for b = 1/ √ 2, where it is used to compute Fredholm determinants. We discuss this in more detail in Section 8.2 below.

Computation by instanton counting
Another interesting way of computing the quantum periods is by using the NS limit of the instanton counting partition function [9,10,16,71,72]. As compared to the other methods presented above, the instanton counting has the advantage of providing analytic expressions in (E, , m, Λ). Nevertheless, the set of spectral problems which we can currently treat within this method is more limited. For example, we do not know how to approach spectral problems associated to non-Lagrangian theories such as the ones in [7,20,31]. 20 In this section we use the instanton counting approach to analyze the spectral problem (3.1).

Definitions
The main quantity that appears in this approach is the Nekrasov-Shatashvili free energy of the SU (2) N f = 1 theory: where the coefficients c n have a closed form definition in terms of combinatorics of Young diagrams; we refer to [28,Appendix. A] for the definition and a more exhaustive list of references. For example, the first few terms read

(6.2)
It is important to note that (6.1) is exact in ( , a, m) and it is a well-defined convergent sum in the parameter Λ. Strictly speaking this convergence property has not been proven mathematically (the proofs of [75][76][77] do not apply to the 2 = 0 background); nevertheless, there is considerable numerical evidence for it. In addition one should note that the convergence is for 2ia/ / ∈ Z, since at these values the NS free energy diverges; see for example [78] for a discussion of the structure of these poles. Note also that in four dimensions these poles have a physical meaning, and they should not be confused with the unphysical poles appearing in the five-dimensional uplift of the Nekrasov partition function which were first discussed in [79].
We define a(E, , m, Λ) implicitly via the quantum Matone relation [80,81], This relation defines a only up to an overall sign. We work in the convention where we pick the sign such that Re a ≥ 0. If Re a = 0, then we take Im a > 0. We also define (see for instance [72])  Another important observation, due to [16,72], is that the series expansion coefficients a (n) and a (n) D coincide with the WKB coefficients Π (n) γ of the quantum periods in equation (3.26) if the cycle γ is suitably chosen. Hence instanton counting provides an exact, analytic resummation of the WKB series.

Quantum periods
Now we want to describe the relation between a, a D and the quantum periods Π γ as we have defined them.
As we reviewed in Section 2, the Π γ are piecewise analytic; to make an honest analytic function from them we have to fix a basepoint (ϑ, u 0 , m 0 , Λ 0 ). Thus, to compare them to a, a D we need to pick such a basepoint. Experimentally, we find that the right basepoint to choose (within the weak coupling region) is one leading to a Schrödinger equation Moreover, inspired by [8,10,34,35,43], we expect that instanton counting corresponds to Fenchel-Nielsen coordinates, namely to spectral coordinates at where Z γa is the central charge of the vectormultiplet in the BPS spectrum at weak coupling. Hence we propose the identification (E, , m, Λ) = a(E, , m, Λ), (6.14) 22 To get a convergent expression for a (n) and a (n) D in the strong coupling region one should use the holomorphic anomaly equation as in [82]. 23 In this case x ∈ e −iπ/3 R+ -38 -as well as (E, , m, Λ) = a D (E, , m, Λ), (6.15) where the charges γ [1,0,0] and γ [0,2,0] are taken relative to the basis in Figure 11. 24 We also have as usual the exact formula We will denote by C inst the locus specified by (6.12), (6.13).

Comparisons
In the last few sections we have described four different ways of understanding, and numerically computing, the quantum periods in the SU (2) N f = 1 theory. Our expectation is that all four methods are approximating the same functions Π γ , so that our four numerical computations should agree, up to the inherent numerical error in the various methods. The results of various such comparisons are reported in Table 1. In this section we discuss in more detail some examples, and some subtleties that arise in making the comparison.

Instanton counting versus small section method
We first compare instanton counting with the SS method of Section 4, i.e. we compare Π inst with Π SS .
We recall that when we use the SS method we need to specify two set of parameters: • One set of parameters ϑ, u 0 , m 0 , Λ 0 (7.1) specifying the spectral network W that we use in the computation.
• One set of parameters , u, m, Λ (7.2) specifying the values at which we evaluate the spectral coordinates X SS γ .
In Section 4 we always used (u 0 , m 0 , Λ 0 ) = (u, m, Λ) and hence we only needed to specify the parameter ϑ. This is the reason why we used the notation W ϑ instead of W ϑ,u 0 ,m 0 ,Λ 0 . For comparing with instanton counting, it is more convenient to choose (ϑ, u 0 , m 0 , Λ 0 ) lying in the instanton locus C inst . The spectral network which appears then is the one we used -39 -in Section 4.4, and the concrete Wronskian formulas we use are the ones in that section as well.
As an example, we take We evaluate Π γ [1,0,0] by using instanton counting and compare with the result from the SS method (concretely, (4.32)). We find good agreement:  More comparisons are shown in Table 1. In that table, though, we report the canonical Π γ , or said otherwise, we take (ϑ, u 0 , m 0 , Λ 0 ) = (arg , u, m, Λ). Thus, in particular, the quantities Π inst γ appearing in that table are in general not equal to a, a D ; rather they are related by the appropriate KS transformations to move to the correct chamber. We discuss this procedure in more detail in the next section.

Instanton counting versus Borel summation
Let us now look at Borel summation. As we have recalled in Section 2, Borel summation always produces the canonical Π γ , i.e. the ones at (ϑ, u 0 , m 0 , Λ 0 ) = (arg , u, m, Λ). Therefore, if we pick (arg , u, m, Λ) ∈ C inst , then instanton counting and (median) Borel summation should agree. This is the analogue of what was done in [35]. However, for generic values of the parameters we need to implement an appropriate KS transformation.
As an example we can take We consider the period Π γ for γ = γ a D = γ [1,0,0] . The point (7.5) is not on any wall; in particular, the WKB series Π WKB γ at this point is Borel summable, without requiring median summation, and gives Π γ at the point (7.5). However, since the point (7.5) / ∈ C inst , to compare this Borel sum with instanton counting we have to work out the transformation between Π (7.5) and Π C inst . For that purpose we choose a particular path connecting these two points, and apply the transformations (2.1)-(2.3) for all the BPS states which we encounter along this path.
As a first step, we vary along a path from (7.5) to an intermediate chamber Some of them can be seen explicitly in Figure 7d. Note that there will be infinite BPS states in Figure 7d if we take infinite terms Π n in the series expansion 26 . We get At the practical level, we can neglect the last sum since the largest contribution in this infinite series can be approximated by which is much smaller than the accuracy we can reach with Borel summation of 80 even terms.
As a second step on our path we go from (7.6) to C inst , by turning on a small m ∈ iR + . In this procedure only −Z γ [0,1,−1] and −Z γ [0,1,1] contribute to (2.1)-(2.3). We sketch this in Figure 13. We have Now combining (7.10) and (7.12), we have where ≈ means that we are neglecting second line of (7.10). The final contribution from each KS transformation are listed in Table 3.
Here we mention some technical problems encountered in the Padé-Borel method and show how we can nicely overcome such obstacles by taking advantage of the KS transformation and the knowledge about the underlying gauge theory. Let us consider for example Figure 7f and Figure 7d. The red dot on the positive real axis represents the two hypermultiplets with central charges Z γ [0,1,−1] = Z γ [0,1,1] , indeed in this example Z γ [0,0,1] = −2πm = 0. However, there should also be a singularity at the central charge of the vectormultiplet γ [0,2,0] . Nevertheless, we do not see it explicitly in the Borel plane because the singularity at Z γ [0,1,−1] = Z γ [0,1,1] spans a full series of poles which mix with the poles corresponding to Z γ [0,2,0] . As a consequece the discontinuities at Z γ [0,1,1] = Z γ [0,1,−1] and Z γ [0,2,0] will also mix. However in our computations, in particular when implementing the KS transform as in Table 3, we need to take this singularity into account even if we do not see it explicitly in the Borel plane. It could be that by combining Padé-Borel with some more advanced techniques we might be able to see these three singularities separately. A more general phenomenon also appears when m = 0. For example, when we study the Padé-Borel transform for γ [1,0,0] at (7.14). Such transform has two series of poles close to the real axis, see Figure 7g Figure 7i, when the series of poles for finite number of terms from the two hypermultiplets seems rotated to slightly different direction from real axis, the interference still makes the vectormultiplet hard to be seen. The mixing of these poles makes it impossible to find a path of integration for the lateral Padé-Borel summation around arg( ) = 0 which is not affected by the poles of 2 hypermultiplets and take half effect of the vectormultiplet. We overcome this technical obstacle by taking advantage of the KS transformation. We take the direction of integration to be R + e i/10 so that we are in the chamber ϑ = 1/10. Padé-Borel summation work in this chamber and then we use KS transformation to transform it back to chamber (7.14). The leading contribution to such transformation comes from the hypermultiplet with charge γ [0, 1,1] . The results are shown in Table 4.  with a D . The parameters used for E, , m, Λ are those in (7.14).
We conclude this part with a comment on the poles of the four dimensional NS free energy. As anticipated earlier the NS free energy (and in particular the a D = Π C inst On the other hand we know that at such values of (E, Λ, m, ) Borel summation gives a well defined number for Π γ [1,0,0] (E, Λ, m, ). The reason for such different behaviour is due to the fact that when (7.15) holds, the KS transform for the vector multiplet is singular. Hence the transformation between instanton and Borel chamber is singular.

Comparison in strong coupling region
In the strong coupling region the relation between instanton counting and small section method is much more complicated. The reason is that the topology of the spectral network at strong coupling is very different from the one making contact with instanton counting, namely (6.12). Indeed, if we follow a path from the instanton locus to strong coupling which avoids singularities in the Coulomb branch, we will have to cross an infinite number of walls, and thus encounter an infinite tower of transformations (2.1)-(2.3). To avoid such a complicated calculation, we can use the following procedure. with the instanton counting result (6.14), (6.15) we deduce that for some ψ 1,1 which we do not need to determine for our purpose. Even though these expressions have been derived at weak coupling, by analytic continuation they hold at strong coupling as well. Therefore the spectral coordinates at strong coupling, given in  Notice that the r.h.s. of (7.18)- (7.20) provides an analytic solution to the GMN TBA at strong coupling (after we implement (7.25)).
We conclude this section with a brief comment on Painlevé equations. It was suggested in [44], based on [77], that the transformations between Fock-Goncharov and Fenchel-Nielsen coordinates are useful in the study of the connection problems in Painlevé equations. From this point of view the transformations (7.22)-(7.24) could play and interesting role in the study of the connection problem for Painlevé III 2 .

From Topological String
A convenient way to encode the spectral properties of a given trace class operator O −1 is by using the Fredholm determinant Such object is also interesting from a physical point of view since it is an entire function in E which is usually identified with the Coulomb branch parameter. The computation of these determinant is a challenging question. In some situations we can use (numerical) TBA techniques or WKB analysis [2,3,42,83,84]. However if the operator O has an interpretation in terms of quantum mirror curve to toric CY manifolds, then its Fredholm determinant can be computed explicitly and exactly [37,38,85]. Such construction was -45 -originally formulated only in some particular slice of the moduli space where the operators have a positive discrete spectrum with bound states. This was later generalised in [24,86,87] to include operators with complex eigenvalues and in particular resonance states. The operator we are studying in this paper (3.1) does not correspond to a quantum mirror curve to toric manifolds. Nevertheless it can be obtained from such construction after implementing the geometric engineering limit [88,89], similar to what was done in [35] for the (modified) Mathieu example.
We are interested in the toric CY geometry that engineers the SU (2) 4d N f = 1 theory, namely local F 2 blown up at 1 point as in [88]. We denote this geometry as local BF 2 . The the quantum mirror curve for this CY is where a i are expressed by using the Batyrev coordinates z i as Topological string partition function on toric CY manifolds corresponds to Nekrasov function for five dimensional gauge theory on S 1 × R 4 1 , 2 , see for instance [90]. Hence it is useful to use the parametrisation where Λ is the instanton counting parameter of the five dimensional gauge theory, H is a coulomb branch parameter, m plays the role of a mass parameter and R is the radius of S 1 . This parametrisation will be useful later. The operator we study in the setup of [37,38] is We think of O BF 2 as an operator on functions in L 2 (R) which admit an analytic continuation on the strip ±i . Then, according to [37,38], we have where ρ = O −1 BF 2 and we use the following dictionary a 1 = e µ+iπ , a 4 = e µ 1 +iπ , a 5 = e µ 2 , a 2 = e µ 3 .
The quantity J in (8.6) is the topological string grand potential associated to the local BF 2 geometry. A self-contained definition is given for instance in [39, eq. (93)] or [37,Sec. 3.1].
-46 - We now implement the geometric engineering limit on (8.6). Let us first look at the operator O BF 2 . In this limit we rescalê and take R → 0. After removing the overall R 2 factor, we are left with the following operator The numerical study of this operator is a bit involved. Hence it is convenient shift the momentum according to 30p →p − 3 2 log Λ + 1 2 log m + i 2 (8.10) to write it as Implementing the R → 0 limit on the r.h.s. of (8.6) is long and cumbersome. Therefore we just report the results (the details of the computation are available upon request). It would be actually great to find a way to compute such determinants directly within the four dimensional theory. However so far this is not possible so we have to start from the topological string setup and then implement the geometric engineering limit. After some computations the final result is as defined in (6.8). We tested (8.12) numerically, see for instance Table 6. The term A( , m, Λ) is fixed by the normalisation -47 - The quantization condition for the spectrum of the operator (8.11) is then given by One can easily test that this quantization condition produce the correct numerical spectrum of (8.11), see for instance Table 5. See also [72] for a WKB analysis. Note that if in perfect agreement with (4.33). For completeness let us note that one can go from (8.11) to the operator (3.1) by using x → −p.

From Zamolodchikov's approach
In [42] Zamolodchikov proposed a parametric family of TBAs which can be used to compute Fredholm determinant of a class of operators. Such class include the (modified) Mathieu operator as well as the massless N f = 1 operator (see below) 31 . Let us first summarise Zamolodchikov results by following his conventions in [42]. We look at the following operator For the massive case one should use [91], which generalise [42]. We thank Daniele Gregori for pointing out this reference.
It is easy to see that if we set as well as where O 4d is defined in (8.19). Following [42] we define Then we consider the TBA As pointed out in [42], if we want to use this TBA to compute Fredholm determinants we have to supply (8.29) with appropriate boundary conditions as θ → −∞. More precisely we ask that (θ) ≈ QP θ − C(P )/2, θ → −∞ , where C(P ) = log 16 bP To implement such boundary conditions on the TBA (8.29) we define (recall that we are L 0 (θ, P ) = 6 √ 2P log e θ + e 2θ + 1 e θ + e 2θ L 1 (θ, P ) = 2 2e θ + 1 C(P ) (e θ + 1) (e θ + e 2θ + 1) Then the relevant TBA is The claim of [42] is that where (θ, P ) is the solution to (8.35). It follows that As a final remark we notice that Zamolodchikov's TBA (8.29) is identical to the conformal limit of the GMN TBA (5.21) at This is why the r.h.s of (8.41) precisely matches the r.h.s. of (7.23).
As discussed in Section 5.1, the point (8.43) is quite special in the sense that the GMN TBA collapse into one equation. This type of behaviour, and the corresponding link with the Zamolodchikov's TBA for Fredholm determinants, was also observed in the example of the Mathieu operator [35]. However, we do not know if it is always possible to obtain a TBA for Fredholm determinants starting from the conformal limit of the GMN TBA at the special point where it collapses.

A The flavor period
Here we show (3.30). Recall that the definition of the WKB flavor periods is By using the fact that Y satisfy the Riccati equation (3.6), we find the following structure where # denotes numerical factors and I n = {c 0 , . . . , c n | n i=0 c i = 2n and n i=0 ic i = 2n}. We also use it is easy to see that the last integrand has residue equal to zero aroundz = 0, unless n = 0. Therefore

B Abelianization and signs
In this appendix we briefly relate the definition of quantum periods in the main text to the notion of abelianization of flat connections as considered in e.g. [8,34,61], with particular attention to the role of the one-loop sign.
We work in the more general setting of a Riemann surface C with a spin structure, a complex projective structure, and a holomorphic quadratic differential φ 2 , which we can write locally as φ 2 = P (z)dz 2 . The Schrödinger equation can be recast as the equation for covariantly constant sections of a flat SL(2)-connection in the 1-jet bundle of sections of K −1/2 C over C: in local coordinate patches this looks like The WKB solutions ψ (i),ϑ (z) = exp −1 z z 0 λ(z) (i),ϑ dz are solutions of another differential equation, can be interpreted as a GL(1)-connection ∇ ab,ϑ in a line bundle over Σ, or more precisely over the complement of the Stokes graph W ϑ . ψ (i),ϑ (z) is a flat section for ∇ ab,ϑ .
∇ ab,ϑ can be extended over the lift of Stokes curves to Σ, by gluing as follows. The gluing maps for extending ∇ ab,ϑ across lifted Stokes curves of type ij to sheet i of Σ can be computed in terms of Wronskians of solutions on the two sides of the Stokes curve: When extending over a double wall (where Stokes curves of types ij and ji overlap) the gluing matrix takes the form where ρ 2 − αβ = 1.
After the gluing, ∇ ab,ϑ is flat on Σ\{branch points}, and has monodromy −1 on loops circling only one branch point on Σ. We call ∇ ab,ϑ an almost-flat connection over Σ, since it is flat except for the monodromy −1 around branch points. Thus we have replaced an SL(2)-connection on C by an almost-flat GL(1)-connection on Σ. This replacement is an example of the abelianization of flat connections; we call it almost-flat abelianization. We can think of it as a map where M(C) denotes a moduli space of flat SL(2)-connections over C and M al (Σ) a moduli space of almost-flat GL(1)-connections over Σ. This form of abelianization was used in [34].
One awkward feature of almost-flat abelianization is that the holonomy of ∇ ab,ϑ along homology classes of paths on Σ obtains a −1 contribution when we move a loop across a branch point. In other words, the small loops going once around a branch point on Σ cannot be considered as trivial. We need a Z 2 extensionΓ of the charge lattice to take care of these extra monodromies. Then we could define X al,θ γ forγ ∈Γ as It is not convenient to work with X al,θ γ directly. Rather, we want to work with variables labeled by the actual charge lattice γ. Fortunately, given a chargeγ ∈Γ which extends γ ∈ Γ one can define a sign τ (γ), in such a way that the combination depends only on γ, and the resulting X γ obey X γ X γ = X γ+γ . They can be thought of as functions on the moduli space M(Σ) of flat GL(1)-connections over Σ.
The sharpest definition of τ (γ) is as follows. Given the spin structure and the quadratic differential φ 2 on C, there is a canonical GL(1)-connection in the bundle K . Pulling this connection back to Σ gives an almost-flat connection in the bundle π * K −1/2 C . The holonomy of this connection around a loopγ ∈Γ is the sign τ (γ). To compute τ (γ) in practice, one can use local coordinate patches z on C, and local choices of √ dz, both pulled back to Σ. Having done so, the connection form in each patch is simply the pullback of − 1 4 dP P , where φ 2 = P (z)dz 2 , but there are potential additional signs from comparing the local choices of √ dz on patch overlaps.
In the particular case we consider in the main body of the paper, we are taking the standard spin structure on the cylinder: this is the one we obtain by choosing a global √ dx on the plane, then declaring that the shift x → x + 2πi acts on the spin structure by √ dx → √ dx, and taking the quotient. It follows that in this paper we can compute τ (γ) as exp(− 1 4 γ dP P ), without any extra signs, provided that we work in the cylinder coordinate, i.e. we use the representation φ 2 = P (x)dx 2 . In that form, this sign appeared in Section 3.6 and Appendix B.
given by the functions X γ comes from a version of abelianization which we could call modified abelianization. Modified abelianization is the version which was used e.g. in [33]. The difference between modified abelianization and almost-flat abelianization is just the sign τ (γ). (There is yet another version of abelianization, twisted abelianization, which was used in [61]; that one plays no role in this paper.) -53 -C Some miscellany in the pure SU (2) theory

C.1 Projections of the BPS walls
Here we show two projections of the BPS walls in the pure SU (2) theory, whose SW curve can be represented as In the strong coupling region, the BPS spectrum is given by two hypermultiplets and their antiparticles [92]: ± γ a+a D = ±γ [1,1] , ±γ a D = ±γ In Figure 14 we show the projection to a slice in the arg(− )-Re(u) plane, with all the other variables held fixed; this is the analogue of Figure 2 in the SU (2) N f = 1 theory. In Figure 15 we show the projection to a slice in the u-plane, with all the other variables held fixed.

C.2 Borel plane poles of WKB solutions
We have seen that in Section 3.4, the singularities in the Borel transformŶ (z, ζ) correspond to central charges of solitons on the surface defect parametrized by z. We want to test this also for the simpler example of the pure SU (2) theory. In this case the relevant Schrödinger equation is (we take Λ 2 = 1/2) The results are shown in Figure 16 and Figure 17. We find perfect agreement with the statement presented in Section 3.4.

C.3 Relation between Fock-Goncharov coordinates and Fenchel-Nielsen coor-
dinates in the pure SU (2) theory In Section 7.2 we use the analytic continuation of exponentially decaying solutions, as well as the Wronskians expressions for the quantum periods, to relate Fock-Goncharov coordinates to Fenchel-Nielsen coordinates in the SU (2) N f = 1 theory. This enables -54 - Figure 14: The BPS walls when we fix Λ = 1 and Im(u) = i 10 . The horizontal axis is Re(u). There are two special points around at u 1 ≈ −1 + i 10 and u 2 ≈ 1 + i 10 where the wall of marginal stability is encountered: arg(Z γ [1,1] ) = arg(Z γ [0, −1] ). For Re(u) ∈ (u 1 , u 2 ) (strong coupling) we have 2 hypermultiplets and their antiparticles, so there are 4 walls in total shown in this region. For Re(u) < Re(u 1 ) or Re(u) > Re(u 2 ) (weak coupling), we have infinitely many hypermultiplets. The hypermultiplet walls accumulate around the vectormultiplet wall. We list the electromagnetic charges of the particles next to their corresponding walls. us to compare quantum periods gotten by instanton counting (which are Fenchel-Nielsen coordinates) with all the other Fock-Goncharov coordinates.
Here we work out the relation between Fock-Goncharov coordinates and Fenchel-Nielsen coordinates in the case of the pure SU (2) theory.
For Fenchel-Nielsen coordinates we use the same spectral network W as in [8], this is shown in Figure 18a. More precisely, the Fenchel-Nielsen coordinates for the ring domain and the hypermultiplet are X FN γe/2 and X FN γm respectively (see Figure 18a). We also denote X FG γ h the Fock-Goncharov coordinate corresponding to the hypermultiplet shown in Figure 18b.
By using the spectral networks in Figure 18 we can obtain the Wronskian expressions for these coordinates 32 . We get X FN γe/2 = µ, (C.6)  Figure 15: The u plane for the pure SU (2) SYM theory with Λ = 1. The wall of marginal stability is shown as an orange dashed curve passing through the magnetic and dyonic singularities at u = ±1. We plot arg(Z γ (u, Λ = 1)) = π/4 for different γ. The notation [i, j] stands for a path obeying arg(Z γ [i,j] (u, Λ = 1)) = π/4. In the strong coupling region we have only two paths corresponding to arg(Z γ [0,−1] (u, Λ = 1)) = π/4 and arg(Z γ [1,1]  where M ψ 1 and M ψ 2 are the exponentially decaying solutions approaching 0 − and −∞ respectively; we refer to [8] for the details. Following the same techniques described in Section 7.2, we get

D Fredholm determinant: numerical tests
In this part we present some numerical test of formula (8.12) and its corollary (8.18). 33 Once again, we do not choose a branch for the square root or fix the sign. 34 The fact that [35, eq. (5.44)] could be interpreted as a change of coordinates between Fenchel-Nielsen and Fock-Goncharov was also noted in [44].  There are infinitely many poles ofŶ (2) , corresponding to the central charges of solitons on the surface defect parameterized by z. Only finitely many of them are visible in our approximation. (Again, for Y (1) the singularities would be at the opposite points ζ = −ζ i .) Right: cutoff Stokes graphs at ζ = ζ 1 , ζ 2 , ζ 3 , ζ 4 , as in Figure 16 above.   Figure 18: The spectral networks used for writing the Wronskians for Fenchel-Nielsen and Fock-Goncharov coordinates. The Seiberg-Witten curve is given in (C.1). In Figure 18a we choose Λ = 1, u = −9/8. In Figure 18b we choose Λ = 1, u = 13/20.
We start by providing some tests of the quantization condition (8.18). Some results are shown in Table 5.  Table 5: First energy level of (8.11) for = 1, m = 1/20, Λ = 1 (left) and = 1, m = 2i, Λ = e −iπ/6 (right). Nb denotes the order at which we truncate the instanton counting expression (6.1). The numerical value in the last line is obtained by using numerical diagonalization of the operator.
We now want to test the expression (8.12) for the Fredholm determinant. In principle we can compute the spectrum E n numerically and evaluate the full determinant where the first few terms reads We call Z(N ) fermionic spectral traces to distinguish them from the standard spectral traces Z defined in (D.1) . We can invert the above relation and find (1), (2), (1) In Table 6 we test that the specral traces computed numerically match with the analytic expression obtained from (D.5). Note that numerically it is hard to compute Z 1 and Z 2 because they converge quite slowly. Hence we compute Z 3 and Z 4 .  Table 6: Left: the third and fourth spectral traces as computed from (D.5) for m = 0, = 1, Λ = 1 5 e − 1 6 (iπ) . Right: the third spectral trace as computed from (D.5) for m = 1/20, = 1, Λ = 1 7 . We denote by Nb the order at which we truncate the NS partition function (6.1). The numerical result is obtained by numerical diagonalization of the operator (8.11).