BPS quivers of five-dimensional SCFTs, Topological Strings and q-Painlev\'e equations

We study the discrete flows generated by the symmetry group of the BPS quivers for Calabi-Yau geometries describing five dimensional superconformal quantum field theories on a circle. These flows naturally describe the BPS particle spectrum of such theories and at the same time generate bilinear equations of q-difference type which, in the rank one case, are q-Painlev\'e equations. The solutions of these equations are shown to be given by grand canonical topological string partition functions which we identify with $\tau$-functions of the cluster algebra associated to the quiver. We exemplify our construction in the case corresponding to five dimensional $SU(2)$ pure Super Yang-Mills and $N_f = 2$ on a circle.


Introduction
A crucial problem in quantum field theory (QFT) is understanding its non perturbative aspects in the concrete terms of exact computations. QFTs can be embedded in string theory/M-theory via geometric engineering [1]. Specifically, it can be obtained as the low energy limit of a compactified string theory in a large volume limit, which is needed to decouple its gravitational sector. When QFT is obtained in this way, the nature of exact dualities gets unveiled through the geometric properties of the string theory background behind it: the string theory on the non-compact Calabi-Yau (CY) background geometry encodes the spectral geometry of integrable systems whose solutions allow to obtain exact results. This is possible because the non-perturbative sector of string theory, described by D-branes, gets transferred through this procedure to the geometrically engineered QFT. The set-up engineered by M-theory compactification on CY 3 × S 1 , in the limit of large CY 3 volume and finite S 1 radius, is that of a five dimensional supersymmetric QFT on a circle, whose particles arise from membranes wrapped on the 2-cycles of a suitable non compact CY manifold. As such, the counting of the BPS protected sectors of the theory can be obtained by considering a dual picture given in terms of a topological string on CY 3 . The precise dictionary between the two descriptions is obtained by identifying the topological string partition function on the CY 3 with the supersymmetric index of the gauge theory, which is conjectured to capture the exact BPS content of its 5d SCFT completion [2]. More generally, the supersymmetric index of the gauge theory with surface defects is matched with the corresponding D-brane open topological string wave function [3,4]. The coupling constants and the moduli of the QFT arise from the geometric engineering as CY moduli parameters (Kähler and complex in the A and B-model picture respectively). Therefore, the QFT generated in this way is naturally in a generic phase in which all the coupling constants can be finite. To identify the weakly coupled regimes, one has to consider particular corners in the CY moduli space. In such corners, the topological string theory amplitudes allow a power expansion in at least one small parameter which is identified with the gauge coupling, while the others are fugacities of global symmetries of the QFT (masses and Coulomb parameters).
The problem we would like to face, in the general set-up described so far, is that of understanding how to predict the properties of such a supersymmetric index, given the noncompact CY manifold which realizes the five dimensional theory via geometric engineering. We will show that this index satisfies suitable q-difference equations which in the rank one case, namely for Calabi-Yaus whose mirror is a local genus one curve, are well-known in the mathematical physics literature as q-Painlevé equations [5]. These are classified in terms of their symmetry groups as in Fig. 1. Remarkably, this classification coincides with the one obtained from string theory considerations in [6]. This allows to describe the grand canonical partition function of topological strings as τ -functions of a discrete dynamical system, whose solutions encode the BPS spectrum of the theory. From this viewpoint the grand canonical partition function is actually vector-valued in the symmetry lattice of the discrete dynamical system at hand. The exact spectrum of the relevant integrable system can be computed from the zeros of the grand partition function.
The solutions of the discrete dynamical system are naturally parametrised in different ways according to the different BPS chambers of the theory. We will show that the Nekrasov-Okounkov [7] presentation of the supersymmetric index can be recovered in the large volume regions of the Calabi-Yau moduli space which allow the geometric engineering of five-dimensional gauge theories. The expansion parameter is schematically e −V , V being the volume of the relevant cycle corresponding to the instanton counting parameter.
Around the conifold point the solution is instead naturally parameterized in terms of a matrix model providing the non-perturbative completion of topological string via topological string/spectral theory correspondence [8]. The case of local F 0 geometry, which engineers pure SU (2) Yang-Mills in five dimensions at zero Chern-Simons level, was discussed in detail in [9]. In this case the matrix model is a q-deformation of the O(2) matrix model describing 2d Ising correlators [10,11]. The quantum integrable system arising from the quantum Calabi-Yau geometry is two-particle relativistic Toda chain.
In this paper we show that the discrete dynamics is determined from the analysis of the extended automorphism group of the BPS quiver associated to the Calabi-Yau geometry. In this respect let us recall the results [12][13][14][15] where the BPS state spectrum of a class of four-dimensional supersymmetric theories is generated through quiver mutations. The quiver describes the BPS vacua of the supersymmetric theory and encodes the Dirac pairing among the stable BPS particles. The consistency of the Kontsevich-Soibelman formula [16] for the wall crossing among the different stability chambers is encoded in Y-and Qsystems of Zamolodchikov type. While this program have been mostly studied for fourdimensional theories, recently a proposal for BPS quivers for the five-dimensional theory on a circle has been advanced in [17]. The five-dimensional BPS quivers are conjectured to describe the BPS spectrum of the five-dimensional theory on R 4 × S 1 , and have two extra nodes with respect to the corresponding four-dimensional ones, representing, in properly chosen regimes, the KK tower of states and the five-dimensional instanton monopole which characterise the theory on a circle.
The proposal we make in this paper is that these very same quivers also encode the q-difference equations satisfied by the SUSY index. These are generated by studying the application of extended quiver symmetries on the relevant cluster algebra variables τ , the latter being identified with a vector-valued topological string grand partition function. The action of the symmetry generators on the cluster algebra coefficients y keeps track of the discrete flows for the τ -functions. As such, once the gauge theory is considered on a self-dual Ω-background, we obtain that its supersymmetric index satisfies a proper set of q-Painlevé equations generated by the extended automorphisms of the quiver. More precisely, we identify different dynamics corresponding to different generators of the extended automorphism group. In a given patch, in which the topological string theory engineers a weakly coupled five dimensional theory, the generator shifting the chosen gauge coupling induces the q-Painlevé dynamics, while the other independent ones act as Bäcklund transformations of the former.
In this paper, we make a first step towards realizing the above proposal by showing that the discrete flows induced by the extended automorphism group on the BPS quiver generate in a simple way the full BPS spectrum of the 5d SCFT for some examples in the rank one case. At the same time we show that the Nekrasov-Okounkov dual partition function of the 5d gauge theory obtained by relevant deformation of those theories solves the q-Painlevé equations associated to the same discrete flows. This will be accompanied also by the study of the degeneration of the five-dimensional cluster algebra into the four-dimensional one by appropriate decoupling limits. More specifically, we explore the above connection by considering in detail the case of pure SU (2) gauge theory, engineered by local F 0 and local  (2) gauge theory with two fundamental flavors, or equivalently the one engineered by the local Calabi-Yau threefold over dP 3 . This case gives a much richer lattice of bilinear equations than the case of pure gauge, with four independent discrete time evolutions.
It was noticed in [18][19][20] that cluster algebras provide a natural framework to describe q-deformed Painlevé equations, together with their higher rank generalizations and quantization (crucial to describe the refined topological string set up). Further, following the results of [9,21] evidence was provided for the identification of the q-Painlevé tau function with Topological String partition function on toric Calabi-Yau threefolds, or q-deformed conformal blocks. However, while the connection with q-Painlevé equations was derived in many cases, only in the case of pure SU (N ) gauge theory (corresponding in the SU (2) case to q-Painlevé III 3 ) bilinear equations were derived from the cluster algebra. In this paper we derive from the cluster algebra bilinear equations for the SU (2) theory with two flavors, as well as a bilinear form the the q-Painlevé IV equation from the cluster algebra of the local dP 3 geometry which to our knowledge did not appear in the literature, and we discuss its physical interpretation in terms of the (A 1 , D 4 ) Argyres-Douglas theory.
Notice that, given the geometrical datum of the toric Calabi-Yau, it is possible to obtain its associated quiver from the corresponding dimer model [22,23], and the A-cluster variables defined from this quiver lead to bilinear equations. In many cases these have been shown to be satisfied by dual partition functions of Topological String theory on this same Calabi-Yau [24], or by q-deformed Virasoro conformal blocks [21,[25][26][27]. These can also be rephrased in terms of K-theoretic blowup equations [24,28,29].
Here is the plan of the paper. In Section 2 we discuss BPS quiver spectroscopy, by first checking our perspective with the known case of local F 0 which correctly reproduces the results of [17], before turning to discuss the new cases of local F 1 and dP 3 five dimensional gauge theories. In Section 3 we study the discrete BPS quiver dynamics for the above ex-amples, the related cluster algebras and obtain the explicit q-Painlevé equations in bilinear form. In section 4 we show that indeed the τ -functions of the specific q-Painlevé flows can be matched with shifted Nekrasov-Okounkov partition function of the corresponding gauge theory. In Section 5 we make more precise the observation that the four-dimensional quiver can be obtained by removing two nodes from the five-dimensional one, and show, for all the examples previously considered, that appropriate scaling limits of the cluster variables correctly reproduce the cluster algebra of the four-dimensional subquiver, which is known to describe the 4d BPS spectrum. In Appendix A we collect all the necessary formulas for five-dimensional Nekrasov functions, while in Appendix B we show how the bilinear equations of [30] can be also recovered from the cluster algebra approach. These are seemingly different from the ones of [26], but we show that they correspond to a different choice of initial coefficients for the cluster algebra. Appendix C collects few technical points related to improved saddle point expansion of NO partition functions used in the paper.

BPS spectrum of 5d SCFT on S 1 and quiver mutations
The construction that generates the BPS spectrum of a supersymmetric theory through mutations of its BPS quiver is known as mutation algorithm, and was widely employed in the case of four-dimensional N = 2 theories [13,14,31]. We recall that, given a quiver with adjacency matrix B ij , the mutation at its kth node 1 is defined by The mutations of the BPS charges γ i are given by where we defined [x] + = max(x, 0). In this context, each node of the quiver represents a BPS charge in the upper-half plane, and a mutation µ k encodes the rotation of a BPS ray vector out of the upper half central charge Z-plane (see [13,31] for a detailed description) in counterclockwise sense. If the charge is rotated out of the upper-half plane clockwise instead, one has to use a slightly different mutation rule This construction is most effective when the BPS states lie in a "finite chamber", i.e. when the BPS spectrum consists entirely of hypermultiplets. This is not the case for the 5d theories we are considering: due to the intrinsically stringy origin of the UV completion of these theories, in general the BPS spectrum is organised in Regge trajectories of particles with arbitrary higher spin [32,33]; such chambers of the moduli space are known as "wild : Quiver associated to local F 0 chambers". In [17] an argument was put forward for the existence of a "tame chamber" of the moduli space. Such a region is characterised by the fact that the higher-spin particles are unstable and decay, and one is left with hypermultiplet and vector multiplets only, giving a situation much similar to the four-dimensional weakly coupled chambers.
2.1 Super Yang-Mills, k = 0 As an example, Closset and Del Zotto argued that the spectrum for local F 0 , engineering pure SU (2) SY M on R 4 × S 1 with Chern-Simons level k = 0, in such a tame chamber is organised as two copies of the weakly coupled chamber of the four-dimensional pure SU (2) gauge theory. The relevant quiver is depicted in Fig.2, and its a adjacency matrix is The spectrum of this theory was originally derived by using the mutation algorithm in [17]. This has been done by using the sequence of mutations which represents the wall-crossing arising from clockwise rotations in the upper half-plane of central charges. The n-th iteration of this operator has the following effect on the charges γ i , i = 1, . . . , 4 of the BPS states: with The action of m corresponds to rotating out of the upper-half plane the BPS charges in the order 1342. The towers of states obtained in this way accumulate on the vector multiplets from one side only. Because of this, the operator m is not sufficient: in order to construct the full spectrum in this chamber, it is necessary to use also the second operator constructed from right mutations (2.3). The shifts obtained from this operator arê The resulting BPS spectrum consists of two vector multiplets δ u , δ d , and two towers of hypermultiplets These are two copies of the weakly coupled spectrum of four-dimensional N = 2 SU (2) pure SYM, which can be thought as being associated to the decomposition of the quiver 2 into two four-dimensional Krönecker subquivers, as depicted in Figure 3a.
Let us show an alternative derivation of the above result, making use of the group G Q of quiver automorphisms. This contains the semidirect product Dih 4 W (A (1) 1 ), where Dih 4 is the dihedral group of the square, which consists only of permutations. The automorphisms group is generated by π 1 = (1, 3)ι, π 2 = (4, 3, 2, 1), The operator T F 0 is a Weyl translation on the A 1 lattice. This operator directly generates the whole BPS spectrum of the theory by acting on the charges. Indeed, by applying the mutation rules (2.2) we obtain 14) By computing the Dirac pairing of these states, which is given by the adjacency matrix of the quiver, in particular we see that T F 0 generates mutually local towers of states  and As n → ∞, the towers of states accumulate to the vectors δ u , δ d , which are vector multiplets for the four-dimensional quivers that decompose the five-dimensional quiver as in Figure  3a. The mutation operators m,m are related in a simple way to the the time evolution operator: where ι is the inversion. From the perspective of the full automorphism group 20) it is natural to consider also another translation operator whose action on the charges is This generates different towers of hypermultiplets, which are still organized as two copies of the weakly coupled chamber of four-dimensional super Yang-Mills, with vector multiplets In this way, we find a different infinite chamber, corresponding to the decomposition of the 5d BPS quiver as in Figure 3b.  We see that considering the natural translation operators associated to the quiver automorphisms builds the correct spectrum for the tame chambers in a simpler way, without the need to consider both left and right mutations. This simplification occurs because we are allowing not just mutations, but also permutations, which are relabelings of the BPS charges. This operation of course has no effect on the resulting spectrum, which is the same as the one emerging from using just the mutation algorithm. However, by using quiver automorphisms, it is possible to construct more elementary dualities of the theory, and the spectrum can be constructed more simply. This plays a crucial rôle in more complicated cases. To illustrate this point we discuss in the following the cases of local F 1 and dP 3 .

Super Yang-Mills, k = 1
The local F 1 quiver is displayed in Figure 4a. This engineers pure SU (2) SYM with 5d Chern-Simons level k = 1. The adjacency matrix is (2.25) The traslation operator is given by As far as the spectrum is concerned, this is the same as the local F 0 one. The operators m,m are easy to build 27) and the associated evolution on the vector of charges γ is We see that even though the introduction of a Chern-Simons level will affect some physical aspects, it does not modify the type of states in the spectrum: again δ u , δ d correspond to the vector multiplets of the 4d subquivers depicted in Figure 4b. What changes however is the number of tame chambers: because the symmetry group now does not include the Dih 4 factor -as it is clear by inspection of the quiver -there is not the related chamber.
We see that T 1 generates infinite towers of hypermultiplets given by These are the BPS states corresponding to two copies of the weakly-coupled spectrum for the N f = 1 theory in four dimensions, and correspond to the decomposition of the 5d quiver into two 4d subquivers for N f = 1, as in Figure 6. One can easily check that the towers of states are mutually local, and as n → ∞ they accumulate on the rays which are indeed the vector multiplets for the 4d N f = 1 subquivers. More precisely, the towers of hypermultiplets above are only half of the towers from N f = 1 theory. To complete the picture here we have to consider, like in the pure gauge case, the states constructed from right mutations: these are generated as before by powers of the inverse of the evolution operator, composed with an inversion ι: The spectrum of the N f = 1 theory in four dimensions also includes two quarks, that for the subquivers in Figure 6 are given by γ 5 , γ 4 + γ 6 , γ 2 , γ 1 + γ 3 . We see that we recover the quarks γ 5 , γ 2 as the states that are left invariant by T 1 , while the other quarks would be their complementary in the subquiver. We will see below how the remaining quarks can be recovered as the states that are fixed by a different flow. T 2 is given by T 2 = s 1 s 0 π = (1, 4)µ 4 µ 1 (3, 6)µ 6 µ 3 (1, 2, 3, 4, 5, 6), (2.42) and acts on the BPS charges as Reasoning as before, we find that the spectrum in this chamber is organized in two copies of the 4d N f = 1 weakly coupled chamber, corresponding to the subquiver decomposition in Figure 7, with vector multiplets Finally, we have which gives another chamber organized as two copies of four-dimensional weakly coupled N f = 1 depicted in Figure 8, with vector multiplets δ (u) Before considering the evolution T 4 , let us make a remark. The picture above suggests that there exists a relation between the different flows in terms of permutations of the nodes of the quiver. Indeed, it is possible to check that we have the relations From the point of view of the BPS spectrum, it is now clear that these three flows will generate the same spectrum up to relabeling of states, i.e. they will differ in what we call electric or magnetic in the field theory. Another interesting quiver automorphism is given by which is known as half-translation, because it satisfies R 2 2 = T 2 (half-translations for T 1 , T 3 can be obtained by using equation (2.48)). Under this quiver automorphism, the BPS while of course R 2n 2 = T n 2 . Note that this generates the CPT conjugates of the towers of states as T 2 , while the states that are left fixed by the action of R 2 are exactly the missing quarks from our analysis of T 2 , so that R 2 generates the full spectrum of the two copies of N f = 1 in the subquivers of Figure 7.
Finally, the time evolution T 4 is given by and acts on the BPS charges as follows: We can recognise in this chamber towers of states that accumulate to the same BPS ray δ = γ 1 + · · · + γ 6 , representing a multiplet with higher spin s ≥ 1. In this case the fourdimensional interpretation is subtler and more interesting, and we postpone it to Section 5.3.

Discrete BPS quiver dynamics, cluster algebras and q-Painlevé equations
The translation operators acting on the BPS quivers we described so far can be regarded as time evolution operators for discrete dynamical systems arising from deautonomization of cluster integrable systems, naturally associated to the geometric engineering of the corresponding five-dimensional gauge theories. This allows to bridge between the BPS quiver description and classical results in the theory of q-Painlevé equations, and actually inspired the reformulation of the BPS quiver analysis that we presented in the previous section. Indeed, the quivers studied in studied in [18] are exactly the 5d BPS quivers studied in section 3. In this respect, the q-Painlevé flows describe wall-crossing of BPS states for the 4d Kaluza-Klein theory obtained by reducing the 5d gauge theory on S 1 . We now turn to the study of all the examples we considered up to now from this perspective.

Cluster algebras and quiver mutations
Let us first recall the notion of cluster algebra [35,36], as well as the two types of cluster variables that will be used throughout the paper. The ambient field for a cluster algebra A is a field F isomorphic to the field of rational functions in n = rk A independent variables, with coefficients in QP, where P is the tropical semifield. The tropical semifield is defined as follows: starting with the free abelian group (P, ·) with usual multiplication, the operation ⊕ is defined in terms of a basis 3 u of P The cluster algebra A is determined by the choice of an initial seed. This is a triple (Q, τ , y), where • Q is a quiver without loops and 2-cycles, with n vertices; • y = (y 1 , . . . , y n ) is an n-tuple of generators of the tropical semifield (P, ⊕, ·) (which in general will not be independent generators, because dim P ≤ n); • τ ≡ (τ 1 , . . . , τ n ) is an n-tuple of elements of F forming a free generating set: they are algebraically independent over QP, and F = QP(τ 1 , . . . , τ n ).
The variables (τ , y) are called A-cluster variables. We can alternatively define the seed as (B, τ , y) in terms of the antisymmetric adjacency matrix B of the quiver. Given these objects, the cluster algebra is the ZP-subalgebra of F generated recursively by applying mutations to the initial seed. A mutation µ k is an operation defined by its action on a seed: where we defined [x] + = max(x, 0). It is clear from the above expression that the coefficients y i represent an exponentiated version of the BPS charges γ i . An alternative set of variables are the so-called X-cluster variables x = (x 1 , . . . , x n ), taking values in F. They are defined in terms of the A-variables as and their mutation rules are the same as for coefficients, but with ordinary sum instead of semifield sum: The X-cluster variables can be considered as coordinates in the so-called X-cluster variety, which is endowed with a degenerate Poisson bracket, with respect to which the X-cluster variables are log-canonically conjugated: Given a convex Newton polygon ∆ with area S, it is possible to construct a quiver with 2S nodes describing a discrete integrable system in the variables x i [22,37]. Due to (3.7), in general the Poisson bracket is degenerate, as there is a space of Casimirs equal to ker(B). For quivers arising in this way, the quantity is always a Casimir. The system is integrable on the level surface The number of independent Hamiltonians is the number of internal points of the Newton polygon. The set of discrete time flows of the integrable system is the group G Q of quiver automorphisms 4 . We will in fact work with the extended groupG Q , that extends G Q by the inclusion of the inversion operator ι. This operation reverses all the arrows in the quiver, and acts on the cluster variables as while the variables τ are invariant, consistently with the relation (3.5).
In [18] it was shown that it is possible to obtain q-Painlevé equations by lifting the constraint q = 1, which amounts to the deautonomization of the system. This is no longer integrable in the Liouville sense, since the discrete Hamiltonians are no longer preserved under the discrete flows. The related equations of motion are well-known q-difference integrable equations of mathematical physics, namely q-Painlevé equations: the time evolution describes in this case a foliation, whose slices are different level surfaces of the original integrable system, see e.g. [38] for such a description of q-Painlevé equations. These equations can be obtained geometrically by studying configurations of blowups of eight points on P 1 × P 1 , or equivalently by configurations of nine blowups on P 2 . As in the case of differential Painlevé equations [39], this leads to a classification in terms of the space of their initial conditions, called in this context surface type of the equation, or equivalently by their symmetry groups due to Sakai [5], see Figure 1. The former are given by an affine algebra, while the latter turns out to be given by the extended Weyl group of another affine algebra, which is the orthogonal complement of the first one in the group of divisors P ic(X), X being the surface obtained by blowing up points on P 1 × P 1 .
It was further argued in [18] that the time evolution given by the deautonomization of the cluster integrable system, when written in terms of the cluster A-variables (τ , y) takes the form of bilinear equations, so that we can identify the variables τ with tau functions for q-Painlevé equations. However, while the q-Painlevé equations in terms of the X-cluster variables were derived for all the Newton polygons with one internal point in [18], their bilinear form was not obtained, except for the Newton polygon of local F 0 , corresponding to the q-Painlevé equation of surface type A (1) 7 , and local F 1 in [19], corresponding to A (1) 7 in Sakai's classification.
In the next section we review these two cases, before turning to the case of dP 3 , which corresponds instead to the surface type A (1) 5 . In fact, this case is much richer, as it admits four commuting discrete flows: we will show that one of these reproduces the bilinear equations considered in [25,26] for q-Painlevé III 1 .

Pure gauge theory and q-Painlevé III 3
Let us briefly review how q-Painlevé equations are obtained from the quivers associated to local F 0 and local F 1 , whose Newton polygons are depicted in Figure (9a) and (9b). These correspond to the pure SU (2) gauge theory with Chern-Simons level respectively k = 0, 1. Local F 0 : Let us consider first the cluster algebra associated to the quiver in Figure 2. This corresponds to local F 0 . The group G Q of quiver automorphisms contains the symmetry group of the q-Painlevé equation qPIII 3 of surface type A (1) 7 , which is the semidirect product Dih 4 W (A (1) 1 ). It is generated by The operator T F 0 generates the time evolution of the corresponding q-Painlevé equation, and is a Weyl translation on the underlying A 1 lattice. From the adjacency matrix of the quiver we see that the space of Casimirs of the Poisson bracket (3.7) is two-dimensional. We take the two Casimirs to be Therefore, the tropical semifield has two generators, that we take to be the two Casimirs q, t. By fixing the initial conditions for the coefficients, consistently with equation (3.13), one finds that the action of T F 0 on the coefficients yields while the tau variables evolve as leading to the bilinear equations 5 The actual q-Painlevé equation is the equation involving the variables x. It takes the form of a system of two first order q-difference equations, or of a single second-order q-difference equation, in terms of log-canonically conjugated variables Their time evolution can be studied in a completely analogous way by using the mutation rules (3.6) for X-cluster variables, and leads to the q-Painlevé III 3 equation (3.20) Local F 1 : We now consider the A-variables associated to the local F 1 quiver of Figure 4a, engineering pure SU (2) SYM with 5d Chern-Simons level k = 1. The adjacency matrix is The corresponding equation is the q-Painlevé equation of surface type A (1) 7 , which is a different q-discretization of the differential Painlevé III 3 . The time evolution is given by The Casimirs are now Consistently with this relation, we choose the following initial conditions for the coefficients: This yields the time evolution of the Casimirs and of the τ -variables The bilinear equations obtained in this way are which are the same as the equations appearing in [19] τ for the single tau function τ 4 ≡ τ . The identification is achieved by noting that so that the first of our bilinear equations becomes which coincides with (3.28) after using (3.25).

Super Yang-Mills with two flavors and qPIII 1
We now turn to consider the quiver associated to dP 3 , engineering the SU (2) theory with two flavors, depicted in Figure 10. It has adjacency matrix and Casimirs that satisfy a 0 a 1 a 2 = b 0 b 1 = q −1/2 , q = y 1 y 2 y 3 y 4 y 5 y 6 . give rise to the q-Painlevé equation qPIII 1 in the x-variables, and satisfy T 1 T 2 T 3 = 1. On the other hand, the evolution T 4 = r 0 π 3 (3.36) yields q-Painlevé IV. The time evolution of the Casimirs can be obtained easily from the X-cluster variables: it is This is the counterpart of the fact that T i are Weyl translations acting on the root lattice Q((A 2 + A 1 ) (1) ). If α 0 , α 1 , α 2 are simple roots of A 2 , and β 0 , β 1 are simple roots of A 1 , the action of T i as elements of the affine Weyl group is where δ = α 0 + α 1 + α 2 = β 0 + β 1 is the null root of (A 2 + A 1 ) (1) . From each one of these discrete flows we can obtain bilinear equations for the cluster A-variables τ . Once we choose one of the flows as time, the other flows can be regarded as Bäcklund transformations describing symmetries of the time evolution. Let us define the four tropical semifield generators to be q, t, Q 1 , Q 2 , and the initial condition on the parameters to be y = − 1 Q 2 t 1/2 , q 1/4 t 1/2 , Q 1 q 1/4 , − 1 Q 1 t 1/2 , q 1/4 t 1/2 , Q 2 q 1/4 (3.43) which means, in terms of the original parametrization of the Casimirs, We now derive bilinear equations for the discrete flows of this geometry: the time evolution for T 1 is The action on the Casimirs is given by (3.37), that means

47)
We then have The time flow under T 2 for the A-cluster variables is where the time evolution is given by leading to the bilinear equations τ 3 τ 2 = q 1/4 t 1/2 τ 5 τ 6 + τ 3 τ 2 , τ 6 τ 5 = τ 5 τ 6 + q 1/4 t 1/2 τ 3 τ 2 , (3.51) In particular, from the flow T 2 it is possible to reproduce the bilinear equations of [26], thus obtaining an explicit parametrization of the geometric quantities a i , b i coming from the blowup configuration of P 1 × P 1 in terms of the Kähler parameters of dP 3 . The discrete flow T 3 is not independent, being simply given by T 3 = T −1 1 T −1 2 , but we write it down for completeness: leading to the bilinear relations (3.54)

Super Yang-Mills with two flavours, q-Painlevé IV and q-Painlevé II
On top of the previous time evolutions giving rise to qPIII 1 equations, there is another the time evolution T 4 from a further automorphism of the dP 3 quiver. This gives rise to the qPIV dynamics and has the following action on the Casimirs, dictated by (3.40): On the tau variables, this amounts to (3.57) At first sight this seems to lead to cubic equations. However, by following the procedure explained in Appendix B.2, one obtains an equivalent set of bilinear equations These provide a bilinear form for the qPIV equation, which to our knowledge did not appear in the literature so far.
q-Painlevé II bilinear relations from "half" traslations: Given the root lattice (A 2 + A 1 ) (1) , there exists another time flow that preserves a (A 1 + A 1 ) (1) sublattice only [40,41]. It corresponds to the q-Painlevé II equation, and it is given by which is still an automorphism of the quiver in Figure 10. Because R 2 2 = T 2 , this flow is also known as half-translation 6 . Its action on the Casimirs is a translational motion (i.e. a good time evolution) only on the locus a 0 = q −1/4 , i.e. Q + = 1, on which it acts as R 2 (a 1 ) = q 1/4 a 1 , R 2 (a 2 ) = q −1/4 a 2 , (3.60) corresponding to R 2 (t) = q 1/2 t. (3.61) Its action on the tau-variables reads (3.62) (3. 63) We see that in fact these equations are consistent under the further requirement Q = −1. This is because the third and fourth equations are obtained by simply applying T −1 2 to the first and second one.
According to Sakai's classification (see Figure 1) and the analysis in [42] this flow correctly points to the Argyres-Douglas theory of N f = 2 which is, in the four dimensional limit, governed by the differential PII equation. It would be interesting to see if the relevant τ -function can be constructed from a 5d lift of the matrix model considered in [43].

Solutions
In this Section we discuss how the solutions of the discrete flow of BPS quivers are naturally encoded in topological string partition functions having as a target space the toric Calabi-Yau varietes associated to the relevant Newton polygons. The corresponding geometries are given by rank two vector bundles over punctured Riemann surfaces. Let us recall that the BPS states of the theory are associated to curves on this geometry that locally minimise the string tension. More specifically, hypermultiplets are associated to open curves ending on the branch points of the covering describing the Riemann surface, while BPS vector multiplets are associated to closed curves 7 . The BPS states are then described in this setting by open topological string amplitudes with boundaries on those curves. The very structure of the discrete flow suggests to expand the τ functions as grand canonical partition functions for the relevant brane amplitudes. Specifically, we propose that where q = e , = g s being the topological string coupling, Q i the Calabi-Yau moduli and s i the fugacities for the branes amplitudes associated to BPS states with intersection numbers m i with the cycles associated to the Q i moduli. These cycles represent a basis associated to the BPS state content of theory in the relevant chamber, the intersection numbers representing the Dirac pairing among them. It is clear from this that the expansion (4.1) for the tau function crucially depends on the BPS chamber. Moreover, distinct flows of the BPS quivers described in the previous sections correspond to bilinear equations in distinct moduli of the Calabi-Yau.
These bilinear equations are in the so called Hirota form and turn out to be equivalent to convenient combinations of blowup equations [28,44], which consist of many more equations, and suffice to determine recursively the nonperturbative part of the partition function, given the perturbative contribution [45].
In the following we will mainly focus on the expansion of τ functions in the electric weakly coupled frame which is suitable to geometrically engineer five-dimensional gauge theories. In this case the τ function coincides with the Nekrasov-Okounkov partition function.

Local F 0 and qPIII 3
We first discuss the pure gauge theory case to gain some perspective. We'll then pass to the richer, and so far less understood, N f = 2 case. Let up point out here that the solution of PIII 3 in the strong coupling expansion was worked out in [9] in terms of the relevant Fredholm determinant (or the matrix model in the cumulants expansion). In [9] also the relevant connection problem was solved. Since we are interested in showing the classical expansion of the cluster variables, here we discuss the different asymptotic expansion in the weak coupling g s ∼ 0.
In our favourite example, the local F 0 , the cluster variable This can be written in terms of Nekrasov-Okounkov partition functions as with τ 1 = n∈Z s n Z(uq n , t), where Z is the full Nekrasov partition function for which we give explicit formulae in Appendix A. This case corresponds to the SU (2) pure gauge theory with Chern-Simons level k = 0, and we set u 1 = u −1 2 = u, q 1 = q −1 2 = q. The bilinear equations turn into an infinite set of equations for Z: (4.6) where the coefficient for each power of s must vanish separately. Of course, most of these equations are redundant, but everything is determined by fixing the asymptotics, i.e. the classical contribution for the partition function. Selecting the term n + m = 1, for example, we can obtain the following equation for the t 0 coefficient of Z (i.e. the pertirbative contribution): which is the q-difference equation satisfied by Z 1-loop . The term n + m = 0 allows us to determine the instanton contribution from the perturbative one in the following way: n Z(uq n ; qt)Z(uq −n ; t/q) = n Z(uq n ; t)Z(uq −n ; t) − t 1/2 n Z(uq n+1/2 ; t)Z(uq −n−1/2 ).
(4.8) We can express the above equation in terms of Z inst as which gives a recursion relation for the coefficients of the instanton expansion For example, the one-instanton term is fully determined just by the perturbative contribution: which of course correctly reproduces the one-instanton Nekrasov partition function.
It is possible to study the autonomous limit of the X-cluster variables by setting s = e η/ , q = e , u = e a , (4.12) and sending → 0. In this limit one can expand the Nekrasov partition function in the Ω-background parameter as  The behavior of the Fourier series in this limit is determined by a discrete version of the saddle point approximation [46]. Let us call n * the saddle point for n: for given a, η the saddle point condition η −F 0 (a + n * ) + O( 2 ) (4.14) can be satisfied only approximately. More precisely: denote by a * the "true" saddle value, given by the condition In general a + n * will be able to approximate this value only up to corrections. We write this as a + n * = a * + x, (4.16) where the variable x ∼ O(1) measures the offset between the true saddle and the approximate one. We review in Appendix C the computation of the leading and subleading order in the → 0 limit for the dual partition functions, first performed in [19]. The result is that When we consider the q-Painlevé transcendent, given by the cluster variable x −1 2 , the prefactor simplifies, so that is is given by a ratio of theta functions: The above analysis can be easily extended to the local F 1 case by making use of the results in [18]. We do not repeat it here.
(4. 25) It was shown in [26] that the above bilinear equations are solved in terms of the dual partition function for SU (2) SYM with two fundamental flavors. More precisely, in that paper it was shown that if we define where Z is the Nekrasov partition function for the N f = 2 theory, the τ -functions solving (4.25) can be written as By using also τ 4 = T 2 (τ 2 ), τ 1 = T 2 (τ 5 ), we can add to these Working in the same way as in Subsection 4.1, one can arrive at bilinear equations for Nekrasov functions, but differently from what happened in that simpler case, now one equation does not suffice to determine the nonperturbative contribution from the perturbative one: we have to use both the first and third equations of (4.25). The first equation takes the form n t 2n 2 u 2n Z 1-l Z inst (Q 1 q 1/2 , uq n ; This leads to the following equation on the one-instanton contribution: Differently from what happened in the pure gauge case, one equation is no longer enough to determine the partition function, because we get two occurrences of the function with different shifts on the mass parameter Q 1 . We have to use the third equation of (4.25), that leads to and the third equation, which becomes n t 2n 2 u 4n q n 2 Z 1-l Z inst (Q 1 q 1/2 , uq n ; tq −1/2 )Z 1-l Z inst (Q 1 q −1/2 , uq −n ; tq 3/2 ) = n t 2n 2 q n 2 Z 1-l Z inst (Q 1 q 1/2 , uq n ; tq 1/2 )Z 1-l Z inst (Q 1 q −1/2 , uq −n ; tq 1/2 ) (4.32) that gives an equation for the one-instanton contribution (4.33) Putting the two equations together, and using the identities (A.10) and (A.11), we obtain the correct one-instanton contribution matching the one computed by instanton counting. One can go on and compute the higher instanton contributions in an analogous way. These two equations are enough to determine the nonperturbative contribution order by order in t, starting from the knowledge of the perturbative contribution, which is the t 0 term. Let us finally note that all these bilinear equations could be written as lattice equations on Q((A 2 + A 1 ) (1) ) by noting that all the various tau functions can be obtained starting from a single one, let us say τ 1 , since we have so that it is possible to introduce, following [34], the tau lattice (4.37) In this notation the original tau-variables can be denoted by 39) and the time flows are integer shifts of the indices of the tau function (4.37). However, not all the flows are compatible with the instanton expansion: from (3.47) and (3.55) we see that the natural expansion parameter for the solution of the T 1 and T 4 flows are respectively Q 1 Q 2 and Q 2 /Q 1 . In fact, the usual Nekrasov expansion, as defined in Appendix A by a converging expansion in t, can only solve the equations for T 2 , which have t as time parameter: this is because if we try to solve the other equations iteratively by starting with the perturbative contribution as defined in equation (A.7), there is no region in parameter space where all the multiple q-Pocchammer functions with shifted arguments entering the bilinear equations have converging expressions simultaneously. To find a solution one should find an analogue of the perturbative partition function (A.7) which is of order zero, not in t, but rather in the appropriate time parameter, solving the order zero of the bilinear equations. This indeed corresponds to an expansion of the topological string partition function (4.1) in the corresponding patch in the moduli space in the Topological Vertex formalism [3].
A preliminary analysis shows that, on top of the evolution in the mass parameters, comparing with the solution in terms of Nekrasov functions, we see that consistency requires also that T 1 (u) = q 1/2 u and T 4 (u) = q 1/2 u. To see why this must hold, one has to consider tau functions related by time evolutions of the flows T 1 , T 4 . For example the action on the flow T 1 on the solutions τ 1 , τ 3 (the same considerations would hold by considering the other tau functions):

Degeneration of cluster algebras and four-dimensional gauge theory
In the previous sections we saw how the cluster algebra structure on the one hand yields the q-difference equations satisfied by the partition function of the theory. On the other hand, since it conjecturally encodes the wall-crossing of states for the four-dimensional KK theory, it allows, through a generalized mutation algorithm, to produce the spectrum of the theory in a weak-coupling chamber. Further, it was observed in [17], that the BPS quivers describing the purely four-dimensional theory (with all KK modes decoupled) are contained in the five-dimensional one as subquivers with two fewer nodes: roughly, one of the additional nodes is the five-dimensional instanton monopole, while the other corresponds to the KK tower of states. From the point of view of cluster integrable systems and q-Painlevé equations this was already realized in [18]. Graphically, to go from the 5d theory to the 4d one, one "pops" two nodes of the quiver. We now show how it is possible to explicitly implement the operation of deleting the two nodes, that brings the five-dimensional quiver to the four-dimensional one, at the level of the full cluster algebra, so that we recover the four-dimensional description of the BPS states. From the gauge theory point of view, the four-dimensional limit R 4 × S 1 R → R 4 is obtained by taking the radius of the five-dimensional circle R → 0. More precisely, one has to scale the Kähler parameters in such a way that the KK modes and instanton particles decouple from the BPS spectrum. This limit is usually achieved by implementing the geometric engineering limit [47,48], and takes the form We see that this limit amounts to sending Because this limit involves while the other Casimir is still given by a product of cluster variables, we can already see that it is unlikely for this limit to be able to reproduce cluster algebra transformations. Another way to see this is the case, consider the relation between X-and A-cluster variables for the case of local F 0 : Because of this, if we implement the limit t → 0, q → 1 by using the geometric engineering prescription, the tau functions, which are given in terms of five-dimensional Nekrasov partition function, will simply go to their four-dimensional limit. Then no X-cluster variable has an interesting limit. In fact, this is instead the continuous limit of the corresponding Painlevé equation, in which the q-discrete equations become differential equations (see e.g. [21] for the explicit implementation of the limit on the 5d Nekrasov functions).
We will now show how to instead implement the limit q → 1, t → 0 for the cases we considered in this paper: local F 0 , F 1 , and dP 3 (respectively 5d pure gauge theory without and with Chern-Simons term, and the theory with N f = 2 hypermultiplets), in such a way that the cluster algebra structure of the quiver is preserved: in particular we will see that: • The mutations of the five-dimensional quiver degenerate to those of the four-dimensional one in terms of the reduced set of variables; • The q-Painlevé time flows (or a sub-flow, in the case of F 1 ), which were given by automorphisms of the five-dimensional quivers, degenerate to appropriate sequences of mutations and permutations which are automorphisms of the four-dimensional ones.
Of course, the recipe taken to implement these limit is quite general, and we have no reason to expect it not to work for the other cases. We will implement the limit on the X-cluster variables, because they carry no ambiguity related to the choice of coefficient/extended adjacency matrix. The four-dimensional cluster A-variables can then be obtained from the X-cluster variables using the adjacency matrix as usual. However, because we are implementing this limit on the X-cluster variables, we do not have an explicit expression in terms of Nekrasov functions for the limiting system.

From local F 0 to the Kronecker quiver
Recall the expression for the Casimirs in terms of the cluster variables: Let us say that we want to decouple the nodes 3,4 on the corresponding quiver, so that we remain with the Kronecker quiver with nodes 1,2 (the red quiver in the Figure 3a). We need then to implement the limit which, as we argued above, is different from the geometric engineering limit. We then have to take We are interested in the expressions for the mutations at the remaining nodes after decoupling, as well as for the q-Painlevé translation. For the mutations this case is very simple: the limit takes the form We can proceed and take the analogous limit for local F 1 , for which We again focus on the Kronecker subquiver with nodes 1,2, and set 14) The limiting behavior of the mutations is now which again yields the correct limiting behavior. The q-Painlevé flow does not have a good limiting behavior: however its square does, since as we saw above.

Local dP 3
This case is much more interesting, because we get different decoupling limits, and only one of them is similar to the usual four-dimensional limit, involving t → 0. These are related to the presence of different discrete flows. We consider as usual T 2 first, which we have already seen to be related to the usual weakly-couplied/instanton counting picture. In analogy to what was done in the previous cases, since we take the limit by taking a limit on two of the cluster variables. Looking at the quiver for this case, we recognize that the subquiver with vertices 2,3,4,6 (or equivalently 1,3,5,6) gives the BPS quiver of the four-dimensional N f = 2 theory, as in figure 11. We will focus on the former case. Because we are "popping out" the nodes 1,5 from the quiver, we want to achieve this by implementing the limit (5.19) directly on the cluster variables. By studying the expressions for the Casimirs (3.32), (3.33) we find so that we want to study the limit (5.21) Figure 11: N f = 2 kite-subquivers for the discrete flow T 2 Taking the limit on the mutations we obtain 22) and similarly for the other mutations µ 3 , µ 4 , µ 6 , that all degenerate to the mutations of the four-dimensional quiver. The discrete flow also has a "good" limit: x 6 (1 + x 2 (1 + x 3 )) .

(5.23)
If we call the variables after taking the limit we have that the limit of the discrete flow is which is an automorphism of the 4d quiver. We can follow the same logic for the other discrete flows T 1 , T 3 , T 4 : we will from now on discuss only the limits on the discrete time flows, because those on the mutations are rather simple and given by essentially the same computations as above. In the first case the flow is so that the natural guess for the right limit to consider is Q + → ∞, in analogy with the previous case. By looking at the Casimirs, we arrive to the conclusion that we can either decouple the nodes 1,3 or 4,6, producing the 4d N f = 2 subquivers in Figure 12. The limit Figure 12: N f = 2 kite-subquivers for the discrete flow T 1 we want to implement is then , ∞.

(5.28)
Which is the same 4d quiver automorphism as for T 2 , up to permutations of the nodes. The time evolution T 3 is characterized by so that the natural limit on the Casimirs is This can be achieved by decoupling the nodes 3,5 or 2,6, keeping the subquivers depicted in Figure 13. Choosing the former one for concreteness, we want to compute the limit on the discrete evolution T 3 . This is given by We see that in all the cases that yielded the time evolution of q-Painlevé III 1 , the degeneration of the time flow produces the same automorphism of an appropriate subquiver. It remains to study the flow T 4 , which yielded a q-Painlevé IV time evolution, characterized by In terms of the Casimirs b 0 , b 1 , this leads to To achieve this without affecting the Casimirs a 0 , a 1 , a 2 we have to decouple either the nodes 2,5, or the nodes 3,6, or the nodes 1,4, giving the subquivers in Figure 14, and we will consider the first option, given by the limit Here something similar to what happened when we studied the degeneration of the q-Painlevé III 3 associated to local F 1 happens: recall that in that case T F 1 did not have a Figure 14: N f = 2 subquivers for the discrete flow T 4 good degeneration limit as an automorphism of the subquiver, but rather its square did. We observed that this was related to the Z 2 -periodicity of the action of T F 1 on the BPS charges. What happens here is that not T 4 , but rather T 3 4 has a good action after taking the limit, in particular only for T 3 4 it is true that consistently with the limit. The resulting sub quiver is the oriented square with arrows of valency one and no diagonals with adjacency matrix (5.37) The corresponding four dimensional gauge theory has been already classified in [14] as Q(1, 1) and shown to correspond to H 3 , which is the Argyres-Douglas limit of the N f = 3 with SU (2). All this is consistent with the reductions of the Sakai's table in Figure 1.
The symmetry type of the five dimensional SU (2) N f = 2 gauge theory is E 3 . The reduction of the T 1 , T 2 and T 3 flows corresponds to the reduction E 2 , the latter being the symmetry type of the H 3 theory. According to Sakai's classification (see Figure 1) and the analysis in [42] this flow correctly points to the Argyres-Douglas theory of N f = 3 which is, in the four dimensional limit, governed by the differential PIV equation.

Conclusions and Outlook
In this paper we studied the discrete flows induced by automorphisms of BPS quivers associated to Calabi-Yau geometries engineering five-dimensional quantum field theories. We showed that these flows provide a simple and effective way to determine the BPS spectrum of these theories, producing at the same time a set of bilinear q-difference equations satisfied by the grand canonical partition function of topological string amplitudes. In the rank one case these are known as q-Painlevé equations and admit in a suitable region of the moduli space solutions in terms of Nekrasov-Okounkov, or free fermions, partition functions.
A very attractive feature of this approach is that a simple symmetry principle -the symmetry of the BPS quiver -provides strong constraints on the BPS spectrum and contains a rich and deep set of information which goes well beyond the perturbative approaches to the same theories. Indeed, one can show that the non-perturbative completion of topological string via a spectral determinant presentation, arising in the context of the topological string/ spectral theory correspondence, arises naturally as solution of this system of discrete flow equations [9]. Moreover, some of the flows associated to the BPS quiver directly link to non-perturbative phases of the corresponding gauge theory, as we have seen for a particular flow of the local dP 3 geometry which describe a (A 1 , D 4 ) Argyres-Douglas point, see subsect. 5.3. A discussion of the relation between Painlevé equations and Argyres-Douglas points of four-dimensional gauge theories can be found in [42] based on the class S description of these theories [49].
It is also very interesting that a fully classical construction, the cluster algebra associated to the BPS quiver, contains information about the quantum geometry of the Calabi-Yau. Indeed the zeroes of the τ -functions of the cluster algebra provide the exact spectrum of the associated quantum integrable system, as it was shown in [9] for the local F 0 geometry corresponding to relativistic Toda chain [50], and in [51,52] for its fourdimensional/non-relativistic limit. Further evidence we provide in this paper is that the X-cluster variables of the 5d quiver flow in the 4d limit to the X-cluster variables of the corresponding four-dimensional BPS quiver, which are known to be related to the Voros symbols, i.e. exponential of the exact quantum WKB periods of the four-dimensional integrable system [53]. The fact the we find that standard topological string -or equivalently 5d gauge theory in the self-dual Ω-background 1 + 2 = 0 rather than in the Nekrasov-Shatashvili [54] background 1 = 0 -provides a quantisation of the Calabi-Yau geometry is not fully surprising from the view point of equivariant localisation. Indeed the difference between the two cases resides in a different choice of one-parameter subgroup of the full toric action, and therefore contains the same amount of information, although under possibly very non-trivial combinatorial identities. A first instance of this phenomenon was discussed from the mathematical perspective in [55]. For the case at hand, the non-trivial relation between the two approaches is encoded in a suitable limit of blow-up equations [43,[56][57][58][59].
There are several directions to further investigate. Let us notice that, with respect to the framework of [13,31], to define a BPS chamber one should set the precise order of the arguments of the central charges Z(γ i ) for all the charges γ i in the spectrum. While our method efficiently computes the spectrum, at least in the tame chambers, it doesn't point yet to a precise definition of the corresponding moduli values. This is because we still miss a link with the relevant stability conditions. Our method relies on the existence of patches in the moduli space where the topological string partition function allows finite radius converging expansions 8 . Let us notice that clarifying this point would prepare the skeleton of the demonstration that Kontsevich-Soibelman wall-crossing would be equivalent to the discrete equations (q-Painlevé and higher rank analogues) we obtain. Moreover, the chambers we do compute are "triangular" in the sense of [60]. In this paper it is shown that similar chambers exist for all the class S[A 1 ] theories: while multiple affinizations are generically involved, these coincide with the ones computed with our methods, at least in the examples we work out explicitly.
We have seen that when the Calabi-Yau geometry admits several moduli there are various inequivalent flows for the same BPS quiver, but only few of them have a realisation in terms of weakly coupled Lagrangian field theories. In some cases the other flows correspond simply to Bäcklund transformations mapping solutions one into the others. This is the case for example for the fluxes T 1 , T 2 , T 3 discussed in subsect. 3.3. We expect that the full solution to this system of equations will be given in terms of suitable expansions of the topological vertex 9 [3], while its non-pertubative completion should be given by the spectral determinant of the corresponding N f = 2 spectral curve. In other cases the flows are intrinsically non-perturbative, like the flux T 4 discussed in subsect.5.3. It would be interesting to characterise the solutions of these flows in terms of supersymmetric indices of four-dimensional gauge theories [63][64][65].
We expect that the full refined topological string or equivalently the gauge theory in the full Ω background is captured by the quantum cluster algebra. The bilinear equations in this case are expected to have a direct relation to the K-theoretic blow-up equations [24].
We have also shown that the X-cluster variables correctly reproduce the ones of the four dimensional BPS quivers under a suitable scaling limit. It would be very interesting to further explore the relation of our results with the ones on exact WKB methods and TBA equations [56,66,67], possibly extending these methods to the q-difference/5d case. For the class S theories an important rôle should be played by the group Hitchin system [68], in the perspective of its quantisation [69,70]. An interesting open question is the nature of the quantum periods in five dimensions and their relation to the cluster variables appearing in the study of q-Painlevé equations.
In the four-dimensional case, the Painlevé/gauge theory correspondence [42] extends also to non-toric cases, corresponding to isomonodromic deformation problems on higher genus Riemann surfaces, see [71,72] for the genus one case. These have a 5d uplift in terms of q-Virasoro algebra [73] and matrix models [74,75] whose BPS quiver interpretation would be more than welcome. Also the higher rank extension of BPS quiver flows and the associated tau-functions is to be explored in detail. As a first example, one can consider SU (N ) Super Yang-Mills, whose spectral determinant in matrix model presentation was presented in [76]. In the one period phase, this satisfies N -particle Toda chain equations. The corresponding cluster integrable system is discussed in [19]. More in general, our method should extend beyond the rank 1 case and q-Painlevé systems, pointing to more general results about topological string partition functions and discrete dynamical systems. The perturbative contribution is given by the following: 6 log q 1 log q 2 , (A.6) Here (u i /u j ; q 1 , q 2 ) ∞ is the multiple q-Pochhammer symbol, defined by The time evolution is the following (we only write the relevant τ -variables): which is the qPIII equation appearing in [30].

B.2 qPIV
The action of T 4 on the tau function is the following: At a first glance these seem trilinear, rather than bilinear, equations. However, take linear combinations of (B.11) in such a way that the first term on the RHS cancels out: These are the bilinear equations for qPIV, with the parametrization of [30].

C q-Painlevé transcendents and autonomous limit
Recall from Section 4.1 that the solution G(t; q, u, s) to the q-Painlevé III 3 equation where Z is the partition function of pure five-dimensional SU (2) super Yang-Mills. It is possible to study the autonomous limit of this object, following the discussion of [19] for the tau functions. One sets s = e η/ , q = e , u = e a , (C. 4) sending → 0. In this limit one can write the partition function as Z(a, , t) = exp 1 2 ∞ n=0 2n F n (a, t) , (C.5) so that we want to take the "semi-classical" (actually autonomous) → 0 limit of the dual partition functions, keeping the leading and first subleading term. Let us review the argument: in [7] it was shown that the saddle point of Z is the Seiberg-Witten A-period: let us denote this by a * . It is such that The sum over n will be dominated by terms that are close to this saddle point: let us denote by n * the value of n such that a + n is closest to a * : in other words, set a + n * ≡ a * + x, x ∼ O(1).