Conserved quantities of Q-systems from dimer integrable systems

We study a discrete dynamic on weighted bipartite graphs on a torus, analogous to dimer integrable systems in Goncharov-Kenyon 2013. The dynamic on the graph is an urban renewal together with shrinking all 2-valent vertices, while it is a cluster transformation on the weight. The graph is not necessary obtained from an integral polygon. We show that all Hamiltonians, partition functions of all weighted perfect matchings with a common homology class, are invariant under a move on the weighted graph. This move coincides with a cluster mutation, analog to Y-seed mutation in dimer integrable systems. We construct graphs for Q-systems of type A and B and show that the Hamiltonians are conserved quantities of the systems. The conserved quantities can be written as partition functions of hard particles on a certain graph. For type A, they Poisson commute under a nondegenerate Poisson bracket.


Introduction
The dimer model is an important model and has a long history in statistical mechanics [Kas63]. It is a study of perfect matchings of a bipartite graph, a collection of edges in which each vertex of the graph is incident to exactly one edge. Cluster algebras introduced in [FZ02] are commutative algebras equipped with a distinguished set of generators called cluster variables. There is a transformation called mutation which creates a new set of generators from an old one. This transformation allows us to consider a dynamical system inside the cluster algebra. One important feature of cluster dynamics is the Laurent property, namely any cluster variables can be expanded as a Laurent polynomial on initial cluster variables. In many cases, this expansion can be written as a partition function of dimer configurations over a certain graph, see for examples [Spe07,MP07,MS10,DF13,JMZ13]. As a discrete dynamical system, many cluster dynamics have been shown to be Liouville-Arnold integrable [FM11,GK13,FH14,HI14,GSTV12,GSTV16,Wil15,FM16]. In [GK13], dimer models are used to construct a class of integrable systems enumerated by integral polygons. The dimer integrable system introduced in [GK13] is a continuous Liouville-Arnold integrable system whose phase space is the space of line bundles with connections on a bipartite torus graph G obtained from an integral convex polygon. Let n be the number of faces of G. The phase space can be combinatorially viewed as the space of weights on oriented loops of G compatible with loop multiplication. The space of oriented loops is generated by all counterclockwise loops around each face W i (i ∈ {1, . . . , n}) and two extra loops Z 1 , Z 2 whose homology classes on the torus T generate H 1 (T, Z) ∼ = Z × Z. The condition i W i = 1 is the only nontrivial relation among these generators. So the phase space is generated by the weight assignment w i (i ∈ {1, . . . , n}) together with z 1 , z 2 on all the loops W i and Z 1 , Z 2 . The only condition among these weights is i w i = 1.
The phase space is equipped with a Poisson bracket defined from the intersection pairing on the twisted ribbon graph obtained from G. A Y-seed [FZ07] of rank n + 2 indexed by the 1 arXiv:1704.08736v2 [math.CO] 26 Sep 2017 loop generators is assigned to the weighted graph G where an entry of the exchange matrix is the intersection pairing of the generators and y-variables are their weights.
Hamiltonians are defined on the phase space as Laurent polynomials on the variables {w 1 , . . . , w n , z 1 , z 2 }. For (a, b) ∈ Z × Z, a Hamiltonian is written as the partition function over weighted perfect matchings on G where the exponent of z 1 and z 2 in their weights is a and b, respectively. The Hamiltonians vanish for all but finitely many (a, b). There is a move called urban renewal on the weighted graph G, which acts on its corresponding Y-seed as a Y-seed mutation. This transformation is a change of coordinates on the phase space, and the Hamiltonians are invariant under the transformation. By thinking of this change of coordinates as a map on the phase space, it becomes an evolution of a discrete dynamical system. The evolution can also be written as a Y-seed mutation. Various discrete dynamical systems has been studied in this framwork [EFS12].
The first goal of this paper is to rethink the discrete dimer integrable system of [GK13] in cluster variable setting and extend it to bipartite torus graphs not necessary obtained from integral polygons. We study, in Sections 3 and 4, a system associated with a general bipartite torus graph not necessary be obtained from an integral polygon. Recall that the loop weights in [GK13] are the y-variables in the associated Y-seed. In our study, we instead associate weights that act as cluster variables in the associated cluster seed. We show that the Hamiltonians are invariant under the evolution, see Theorem 4.5.
Q-systems first appeared in an analysis of Bethe ansatz of generalized Heisenberg spin chains. They were first introduced as sets of recurrence relations on commuting variables for the classical algebras [KR87] and later generalized for exceptional algebras [HKO + 99], twisted quantum affine algebras [HKO + 02] and double affine algebras [Her10]. See [KNS11] for a review on the subject.
They can also be normalized and then realized as mutations on cluster variables [Ked08,DFK09,Wil15]. Explicit conserved quantities for Q-systems of type A have been studied in [DFK10] as partition functions of hard particles on a graph and in [GP16] as partition functions of weighted domino tilings on a cylinder. In [GP16] the Q-system of type A r is identified with the T-system of type A r ⊗Â 1 .
For simply-laced finite type and twisted affine type, conserved quantities arise by identifying the systems with the dynamics of factorization mappings on quotients of double Bruhat cells [Wil15].
The second goal of the paper is to use perfect matchings on graphs to compute conserved quantities of Q-systems associated with a finite Dynkin diagram of type A and B in Section 5 and 6, respectively. The conserved quantities of type A coincide with the partition functions obtained in [DFK10] and [GP16].
The paper is organized as follows. In Section 2, we review some definitions and results on Q-systems and cluster algebras. In Section 3, we introduce weighted bipartite torus graphs, weight of perfect matchings and weight of loops on the graph. A move on weighted graphs is defined. In Section 4, we define Hamiltonians and show that they are invariant under the move. In Section 5 (resp. Section 6), a graph for A r (resp. B r ) Q-system is constructed. The Hamiltonians are shown to be conserved quantities of the system. They can also be written as partition functions of hard particles on a certain graph. A nondegenerate Poisson bracket is constructed. The conserved quantities Poisson-commute in type A and are conjectured to Poisson-commute in type B.
Acknowledgements. The author would like to thank his advisors R. Kedem and P. Di Francesco for their helpful advice and comments. This work was partially supported in part by Gertrude and Morris Fine foundation, NSF grants DMS-1404988, DMS-1301636, DMS-1643027 and the Institut Henri Poincaré for hospitality.

Q-systems and cluster algebras
In this section we review the definition of Q-systems for simple Lie algebras and an interpretation as cluster mutations.
2.1. Q-systems. We use a normalized version of Q-systems studied in [Ked08,DFK09], and we will use it as the definition of the Q-systems.
Let g be a simple Lie algebra with Cartan matrix C. We denote a simple root α by its corresponding integer in [1, r]. The Q-system associated with g is defined to be the following recurrence relation on a set of variables {Q α,k | α ∈ [1, r], k ∈ Z}: where t denotes the integer part of t, and t α are the integers which symmetrize the Cartan matrix. That is, t r = 2 for B r , t α = 2 (α < r) for C r , t 3 = t 4 = 2 for F 4 , t 2 = 3 for G 2 , and t α = 1 otherwise.
A conserved quantity of a discrete dynamical system is a function H : X → C on the phase space X which is invariant under the evolution of the system. That is H(x 1,k , . . . , x n,k ) = H(x 1,k+1 , . . . , x n,k+1 ) for all (x 1,k , . . . , x n,k ) ∈ X .
The goal of this paper is to compute conserved quantities of the Q-systems of type A and B.
2.2. Cluster Algebras. We review some basic definitions in cluster algebras from [FZ02,FZ07] and results of [Ked08,DFK09] about the formulations of Q-systems as cluster mutations for simple Lie algebras.
Definition 2.1 (Cluster seeds and Y-seeds). A cluster seed (resp. Y-seed) of rank n is a tuple Σ = (A, B) (resp. (y, B)) consisting of: • An n × n skew-symmetrizable matrix B, called an exchange matrix.
When the exchange matrix B is skew-symmetric, the quiver associated with B, is defined to be a directed graph without 1-cycles or 2-cycles Q whose signed adjacency matrix is B. In this case, we can also write a cluster seed (resp. Y-seed) as (A, Q) (resp.(y, Q)).
The mutation at k on the exchange matrix can be translated to a rule of quiver mutation at vertex k consists of the following steps: (1) Reverse all the arrows incident to k.
(2) For each pair of incoming arrow from i to k and outgoing arrow from k to j, we add an arrow from i to j.
(3) Remove all resulting oriented 2-cycles one by one.
Example 2.2. Consider the following quiver with five vertices labeled by k, k 1 , . . . , k 4 . A quiver mutation at vertex k can described as follows.
In this paper, we will only work on mutations at a vertex having exactly two incoming and two outgoing arrows. So the change of arrows will be described as in Example 2.2. Definition 2.3 (Mutations and Y-seed mutations). For any k ∈ [1, n], the mutation (resp. Y-seed mutation) in direction k sends (A, B) to (µ k (A), µ k (B)) = (A , B ) (resp. sends (y, B) to (µ k (y), µ k (B)) = (y , B )) where: Definition 2.4 (τ −coordinates [GSV03]). Let (A, B) be a cluster seed. There is a map τ sending (A, B) to a Y-seed (y, B) where  Figure 1. The quivers for A r Q-system (left) and B r Q-system (right).
The map τ commutes with the mutations [FZ07, Proposition 3.9]: where the mutation on the left of the equation is a cluster mutation, while the mutation on the right is a Y-seed mutation.
Theorem 2.5 ([DFK09, Theorem 3.1]). Let C be the Cartan matrix of an underlying simple Lie algebra. The Q-system relation (1) can be realized as cluster mutations. There is a sequence of mutations such that every Q-system variable appears as a cluster variable.
The sequence of mutations in the theorem is explicitly described in terms of the root system of the underling Lie algebra. We translate it into a sequence of mutation together with relabeling of indices as follows.
Let C be a Cartan matrix of rank r, we let Σ k := (A k , B) be cluster seeds of rank 2r where The cluster tuple A k consists of Q-system variables. There exists a sequence of mutations µ and a permutation σ ∈ S 2r connecting the seeds as the following.
The cluster tuple A k , the permutation σ and the sequence of mutations µ are defined according to the type of the Cartan matrix C. The following are their definitions for type A and B.
• For type A r we have µ := r i=1 µ i , The quivers associated to the matrices B for type A and B are shown in Figure 1. We also note that the mutations µ i in the product i µ i in equations (6) and (7) commute, so the product makes sense.

Weighted bipartite torus graphs
We think of a torus T = R 2 /Z 2 as a rectangle with opposite edges identified. A torus graph is a graph embedded on the torus with no crossing edges. We do not require that every face is contractible. A weighted graph (G, A) is a pair of a graph G with n faces and a collection A = (A i ) n i=1 of variables or nonzero complex numbers called weights. A bipartite graph is a graph whose vertices can be colored into two colors (black and white) such that every edge connects two vertices of different colors.
Throughout the paper, we let G be a bipartite torus graph with n faces. We label the faces by the numbers 1 to n, so F (G) = [1, n].
3.1. Quivers associated with graphs and mutations. For a bipartite torus graph G, we let Q G be the quiver associated with G defined as follows. The nodes of Q G are indexed by the faces of G. There will be an arrow between node i and node j for each edge adjacent to face i and face j. The arrow is oriented in the way that the black vertex of G is on the right of the arrow, see the following figure.
i j Lastly, any 2-cycles are removed one by one until the directed graph has no 2-cycles. We also let B G denote the signed adjacency matrix of Q G . Note that from the construction the resulting directed graph can possibly contain 1-cycles. To a weighted bipartite torus graph (G, A) whose Q G has no 1-cycles, we can associate a cluster seed (A, Q G ) of rank n, see Definition 2.1.
We then define two moves on weighted bipartite graphs.
• The graph G is obtained from G by replacing the subgraph of G containing four edges around the face k with a graph described in the following picture. The labels are face indices. The four outer vertices connect to the rest of the graph.

3). That is,
Definition 3.2. A shrinking of a 2-valent vertex sends (G, A) to (G , A) where G is obtained from G by removing a 2-valent vertex and identifies its two adjacent vertices, while the weights of the graph stay unchanged. It can be visualized in the following picture. (We also have another version of the move when the colors of the vertices are switched.) Definition 3.3 (Mutations of weighted bipartite graphs). Let k be a quadrilateral face of a weighted bipartite graph (G, A). A mutation at face k, µ k , is a combination of an urban renewal at face k and shrinking of all 2-valent vertices. Two weighted graphs are mutation equivalent if one is obtained from another by a sequence of mutations.
Theorem 3.4. Let (G, A) be a weighted bipartite graph whose Q G has no 1-cycles, k be a quadrilateral face of G.
If every pair of adjacent faces of k are distinct except possibly pairs of opposite faces, then the mutation µ k on (G, A) is equivalent to a cluster mutation µ k on a seed (A, Q G ). In particular, Q µ k (G) = µ k (Q G ) and the weight on G are transformed according to the cluster transformation with respect to the quiver Q G .
Proof. Consider the following picture where k i are adjacent faces of k.
Since k i = k i+1 for all i (reading modulo 4), the vertex k of Q G has exactly two incoming and two outgoing arrows. (There is no cancellation of arrows incident to k.) The arrows of Q G are then transformed according to the rule of quiver mutations. Also, the mutation does not introduce any 1-cycles because k i and k i+1 are distinct. This also shows that the weights on the graph are transformed according the cluster mutation: Shrinking of a 2-valent vertex corresponds to removing a pair of arrows with opposite orientations that may appear between k i and k i+1 . This also follows the rule of quiver mutations.
So we can conclude that Q µ k (G) = µ k (Q G ).
Example 3.5. The following is an example of graph mutations. We consider the first mutation µ 1 . Using the notations in the proof of Theorem 3.4, when k = 1, we have (k 1 , k 2 , k 3 , k 4 ) = (3, 4, 3, 4). We see that k i = k i+1 for all i ∈ [1, 4]. So the mutation µ 1 on the weighted graph is equivalent to the mutation µ 1 on the corresponding cluster seed. Similarly, we can see that µ 2 satisfies the requirement in Theorem 3.4. The corresponding mutations of quivers are shown as follows. The weight changes as follows.
3.2. Perfect matchings and oriented loops. A perfect matching of a graph G is a subset M ⊆ E(G) of the set of all edges in which every vertex of G is incident to exactly one edge in M .   Since G is a torus graph, a loop on G can be embedded on the torus. Using the identification H 1 (T, Z) ∼ = Z × Z, we let a horizontal loop going from left to right have homology class (1, 0), and let a vertical loop going from bottom to top have homology class (0, 1).  where the product runs over all directed edges in ρ. Let the edge e be adjacent to faces i and j. The contribution from e is w(e) := (A i A j ) −1 when e is oriented from black to white, while w(e) := A i A j when e is oriented from white to black. See the following figures.
Comparing to the weight of perfect matchings, we notice that for any perfect matchings M, M of G.
Example 3.11. Let G be a weighted bipartite torus graph whose weight is shown at each face in the following picture. The perfect matchings M and M are depicted below.

Hamiltonians
In this section, we define Hamiltonians on a weighted graph (G, A) with respect to a perfect matching M 0 , and show that they are invariant under certain conditions. They will be used to compute conserved quantities of Q-systems of type A in Section 5 and type B in Section 6. 4.1. Hamiltonians. We modify the Hamiltonians defined in [GK13] and use the weight of perfect matchings induced from the weight of G in Definition 3.6.
Definition 4.1. Let (G, A) be a weighted torus graph, M 0 be a perfect matching of G, where the sum runs over all perfect matchings M of G such that the homology of The weight w is defined as in Definition 3.6. We say that M 0 is a reference perfect matching.
Definition 4.2 (Induced perfect matching by an urban renewal). Let k be a quadrilateral face of G. Let G be a graph obtained from G by an urban renewal at k. Let M be a perfect matching of G containing exactly one side of k. We say that a perfect matching M of G is induced from M by an urban renewal if M coincides with M on all edges of G not related to the urban renewal, and on the subgraph replaced by the urban renewal M and M are related as in Figure 2.  Definition 4.4 (Induced perfect matching by a mutation). Let µ k (G) is a graph obtained from G by a mutation at k. The induced perfect matching from M by a mutation at k is the perfect matching µ k (M ) induced from M by an urban renewal at k and then by shrinking of all 2-valent vertices.
Proof. It suffices to show that the Hamiltonians are invariant under an urban renewal and shrinking of a 2-valent vertex.
Consider shrinking of a 2-valent vertex. Let G be obtained from G by shrinking a 2valent vertex v. Let assume first that the 2-valent vertex is white. The other case can be treated in a similar manner. Let v be adjacent to faces i, j and edges e 1 , e 2 . Consider a perfect matching M of G. Since M is a perfect matching, exactly one of e 1 , e 2 must be in M . Assume without loss of generality that e 1 ∈ M . From the following picture, there is a unique perfect matching M of G which is identical to M except on e 1 and e 2 . Similarly, any perfect matching M of G has a unique perfect matching of G such that they agree on E(G ). Hence this map is a bijection between the perfect matchings of G and of G .
We also have Similarly, for the reference perfect matching M 0 of G, we have regardless of whether M 0 contains e 1 or e 2 . Hence we have For an urban renewal, let (G , A ) be obtained from (G, A) by an urban renewal at the face k. Let M 0 (resp. M 0 ) be the reference perfect matching of G (resp. G ). There are 4 involved edges before the move and 8 involved edges after the move. Let x ∈ {A i } n i=1 be the weight at the face k of G, a, b, c, d ∈ {A i } n i=1 be weights at the four adjacent faces, and x ∈ {A i } n i=1 be a weight at the face k of G . We then have xx = ac + bd.
Without loss of generality, we assume that the edge adjacent to the faces whose weights are x and c is in M 0 . The following picture show M 0 and M 0 on subgraph involved in the urban renewal.
In order to show H 1 = H 1 , we define a bijection between the matchings contributing terms to H 1 and the matchings contributing terms to H 1 . The bijection maps a matching M in H 1 to another matching M in H 1 which differs from M only on the edges involving in the urban renewal. The bijection can be described as follows.
Since M and M differ only on edges involved in the urban renewal, their contribution of the edges other than such edges near the face k to w(M )/w(M 0 ) and w(M )/w(M 0 ) are the same. Now we consider the contributions from the edges involved in the urban renewal. Recalling the weights in (10), in the first case, the contribution of such edges to w(M )/w(M 0 ) is xc/xa = c/a, and the contribution to w(M )/w(M 0 ) is (x abc 2 d)/(x a 2 bcd) = c/a. Similarly, the contributions in the second case (resp. the third and the fourth case) from before and after the move are the same and equal to c/b (resp. 1 and c/d). Hence H 1 = H 1 .
In order to show H 0 = H 2 , we define a one-to-two map from the matchings contributing terms to H 0 to the matchings contributing terms to H 2 . The map can be described as the following. and Let M be a matching of G contributing to a term in H 0 , M and M be the corresponding matchings of G from the one-to-two map. The contribution from the four edges around the In order to show H 2 = H 0 , we define a two-to-one map from the matchings contributing terms to H 2 to the matchings contributing terms to H 0 as the following. and The contribution from the four edges around the face k of G is and the contribution from the eight edges of G is x .

A r Q-systems
In this section, we apply Theorem 4.5 to construct conserved quantities for A r Q-systems, and show that they coincide with the quantities shown in [DFK10]. We also give a Poisson structure to the phase space and show that the conserved quantities mutually Poissoncommute.
5.1. A r Q-systems and weighted graph mutations. Consider the following quiver of an A r Q-system. See Theorem 2.5 for the detail.
We recall that Theorem 4.5 requires every mutation to happen at a quadrilateral face. This means every quiver mutation in the sequence µ in (6) has to be at a vertex with exactly two incoming and two outgoing arrows. In order to archive this, we add another vertex labeled by 0 which will not be mutated, called frozen vertex, and assign a value of 1 as its cluster variable. According to the formula of a cluster mutation in Definition 2.3, adding a frozen vertex with value 1 does not effect the system. The following is the resulting quiver Q. The vertex labeled by 0 on the left and on the right are identified. So it has four incident arrows.
The bipartite torus graph G associated with Q is depicted below. Since every vertex of Q is of degree 4, every face of G has 4 sides. We note that the face 0 is not contractible. It is indeed homotopy equivalent to a cylinder. Let M 0 be the perfect matching of G containing all vertical edges whose top vertex is black. It can be depicted as the following. We also let the weight at face i be A i .
Theorem 5.1. Let (G, (A i )) be a weighted bipartite torus graph defined above. Then the Hamiltonians Proof. We want to show (6). By Theorem 2.5, there is a sequence of mutation µ = µ r · · · µ 1 and a relabeling σ : i → i + r mod 2r such that σµ sends Q to Q, and the Q-system variables are shifted by n → n + 1. We first claim that the conditions in Theorem 3.4 and Theorem 4.5 hold along the sequence of mutations µ: • Each mutation happens at a contractible quadrilateral face.
• The mutating face contains exactly one edges in the induced reference perfect matching from M 0 . • Two adjacent faces of the mutating face are distinct, except possibly when they are opposite faces.
Consider the first mutation µ 1 . It is clear that face 1 is a contractible quadrilateral face and contains exactly one edge of M 0 . Although its adjacent faces are not distinct, the nondistinct faces are opposite. So the conditions hold. The following graph on the left is the resulting graph after an urban renewal at face 1. The graph on the right is the result after shrinking all 2-valent vertices, hence it is µ 1 (G). The induced reference perfect matching from M 0 are shown on the graphs. The weight is now (A 1,k+2 , A 2,k , . . . , A 2r,k ).
We then continue on to the relabeling σ : i → i + r mod 2r. This gives the following graph on the left. By vertical translation, we obtain the graph on the right. The weight after relabeling is (Q 1,k+1 , . . . , Q r,k+1 , Q 1,k+2 , . . . , Q r,k+2 ).
Hence H (i,j),G,M 0 are conserved quantities of the A r Q-system.

5.2.
Partition function of hard particles. In [DFK10], conserved quantities for A r Qsystem are shown to be partition functions of hard particles on a certain weighted graph. We will show that they coincide with the Hamiltonians H (i,j),G,M 0 computed in the previous section.
is always a product of non-intersecting simple loops of G. Given the reference perfect matching M 0 defined in the previous section, we then try to find such simple loops Γ i on G. We modify the construction in [EFS12] and define Γ i as the following.
Let γ i := w(Γ i ) be the weight of Γ i on G, see Definition 3.10. We note that when A i = A i,k defined in equation (6), we get the same expressions as in [DFK10]: where we assume that Q 0,k := 1 and Q r+1,k := 1 for all k ∈ Z. It is easy to see that H 0 = H r+1 = 1. By an interpretation of [M ] − [M 0 ] as a hard particle configuration on G r , we get the following theorem and conclude that the Hamiltonians coincide with the conserved quantities computed in [DFK10].
Theorem 5.5. Let k ∈ [1, r]. Then where the sum runs over all k-subsets I of pairwise nonadjacent vertices of G r .
Remark 5.6. In [GP16] the Q-system of type A r is identified with the T-system of type A r ⊗Â 1 . Our Hamiltonians coincide with the "Goncharov-Kenyon Hamiltonians" in [GP16, Section 3.2], which defined in terms of domino tilings on a cylinder. Our choice of a reference perfect matching corresponds to the minimal-height domino tiling. Our homology class (0, k) corresponds to k "hula hoops" (noncontractible cycles) that appear in a "double dimer model" between a domino tiling and the minimal domino tiling.
5.3. Poisson-commutation. Let C be the Cartan matrix of type A r . The signed adjacency matrix of the quiver of A r Q-system is Recall that the phase space X has coordinates (A 1 , . . . , A 2r ). We then define a Poisson bracket on the algebra O(X ) of functions on X by where the coefficient matrix Ω is defined by Using this Poisson bracket, the bracket {γ i , γ j } is in a nice form.
Proposition 5.7. Let i ∼ j denote vertices i and j are connected in G r . Then otherwise.
In order to prove Proposition 5.7, we introduce an intersection pairing on a twisted ribbon graph from G. We refer to [GK13] for more details. The pairing is defined for oriented loops on G. It is skew-symmetric and can be described combinatorially as follows.
Definition 5.8. For a pair of oriented loops W and W on G, the intersection pairing (W, W ) is the sum of all the following contributions over the shared vertices of W and W .
The sign of the contribution is switched (between plus and minus) each time the vertex coloring is switched or the orientation of a path is reversed.
Proposition 5.9. For any loops W and W on G with weight w and w , respectively. We have Proof. For j ∈ [1, 2r] we let Y j be the counterclockwise loop around the face j of G. Since Y 1 , . . . , Y 2r together with the oriented loop Γ 1 (Definition 5.2) generate all the oriented loops on G, we only need to show (11) on such generators. It is easy to see that Let y j be the weight of Y j . We need to show that This is equivalent to From the graph G we have We also note that {log(A i ), log(A j )} = Ω ij and Ω = −B −1 . To show (12), we consider To show (13), we consider (Ω r+1,i − Ω 1,i )B ij = (ΩB) r+1,j − (ΩB) 1,j = −I r+1,j + I 1,j = −δ r+1,j + δ 1,j .
Proof of Proposition 5.7. It is easy to see that From Proposition 5.9, we have {γ i , γ j } = (Γ i , Γ j )γ i γ j . This finished the proof.
Recall that a Hamiltonian can be written as where the sum runs over all n-subsets I ⊆ [1, 2r + 1] of pairwise nonadjacent vertices of G r . The following lemma gives an involution which will be use to cancel out terms in a computation of {H i , H j }.
Lemma 5.10. Let i 1 < j 1 < i 2 < j 2 < · · · < i k < j k < i k+1 be a connected sequence of vertices of G r of odd length. Then Proof. We consider The 2k contributions on the right hand side of the first equality can be view graphically as the following. First, we think of I and J as subsets of V (G r ), and then plot all the elements of I and J on the graph G r . For each even length maximal chain of vertices, we have an alternating sequence between elements of I and elements of J. Then I (resp. J ) is obtained from I (resp. J) by swapping all the elements in every even-length maximal chain. As a result, |I | = |I| and |J | = |J|. So, both I and I (resp. J and J ) contribute terms to H m (resp. H n ). It is also clear that ι is an involution. From Lemma 5.10, the vertices in odd-length maximal chains contribute nothing to the bracket { i∈I γ i , j∈J γ j }. So where the sum runs over all even-length maximal chain C ⊆ I ∪ J. By the construction, A fixed point of ι is a pair (I, J) where all maximal chains are odd. We have that Using notations in Section 7.1, it can be obtained from an integral convex polygon with edge vectors: • e 1 = (1, r+1 2 ), e 2 = (−1, r+1 2 ), e 3 = (−1, − r+1 2 ), e 4 = (1, − r+1 2 ) when r is odd • e 1 = (1, r+2 2 ), e 2 = (−1, r 2 ), e 3 = (−1, − r+2 2 ), e 4 = (1, − r 2 ) when r is even. The integral convex polygon can be depicted as the following.
The following pictures are G with oriented loops. We define a reference perfect matching from a sequence e 1 , e 2 , e 3 , e 4 according to the construction in 7.3. It coincides with the perfect matching M 0 defined at the beginning of Section 5. We denote by M 0 this perfect matching of G.
Let G be a bipartite torus graph obtained from an integral polygon with edge vectors e 1 , e 2 , . . . , e n in Section 7.3. Let v be a vertex in a loop Γ. Let where R v (resp. L v ) be the set of all edges incident to v which are on the right (resp. left) of the loop Γ (not including edges in Γ).
The following lemma says that for any homologically nontrivial loop Γ on G, the number of edges in M 0 incident to Γ on the left is equal to the number of edges in M 0 incident to Γ on the right.  Consider The sum is then divided into two sums: • The first summation runs over all the fixed points of ι: • The second summation runs over all equivalence classes {(M 1 , M 2 ), (M 1 , M 2 )} of size 2: To calculate the first sum (14), let (M 1 , M 2 ) be a fixed point of ι. By Proposition 5.9 we have . We have the following four configurations of e 0 , e 1 , e 2 depending whether e 0 is on the left/right of Γ or whether v is black/white. Note that e 1 (resp. e 2 ) goes from black to white (resp. white to black) in Γ.
For each vertex v, there are edges incident to v and belong to M 1 , M 2 and M 0 . Similarly to the computation for the first sum, if such edges of M 1 and M 2 are the same, then the summand vanishes. If v belongs to a homologically nontrivial loop, by Lemma 5.13, the summand also vanishes. If v belongs to a homologically trivial loop, we see that Hence the summand (16) vanishes. This concludes that the second summation vanishes. Thus {H a , H b } = 0. This finishes the proof.

B r Q-systems
We construct a "double cover" of B r Q-system quiver and compute Hamiltonians on the weighted bipartite torus graph associated with the quiver. 6.1. B r Q-systems and weighted graph mutations. Consider the following quiver of an B r Q-system. See Theorem 2.5 for the detail. In the case of A r Q-system, we added a frozen vertex to the quiver so that it has an associated bipartite torus graph. Unlike the previous case, the quiver of B r Q-system does not have an associated bipartite torus graph. We resolve this issue by considering instead a double-cover of the quiver together with a frozen vertex as in the following picture. Let Q denote the resulting quiver. Notice that Q and the original quiver are locally the same. There are two copies for each vertex. So we can think of this quiver similar to a double-cover of the original quiver with an extra frozen vertex. The bipartite torus graph G associated with Q is depicted below. We then assign Q-system variables as weights of G according to face labels, see Theorem 2.5. We abuse the notation and use µ for a sequence of mutations where the mutation at i actually means the mutations at both faces labeled by i. Then σµ sends Q to itself and the Q-variables are shifted by k → k + 1 as well. To be precise, Q i,k → Q i,k+1 for i ∈ [1, r − 1] while Q r,2k → Q r,2k+2 and Q r,2k+1 → Q r,2k+3 .
Let M 0 be the perfect matching of G containing all vertical edges whose top vertex is black. It can be depicted as the following when r is odd and similarly when r is even.
Hence the Hamiltonians H (i,j),G,M 0 are conserved quantities of the B r Q-system. This proved the following theorem.
6.2. Partition function of hard particles. In this section, we write the Hamiltonians as partition functions of hard particles on a weighted graph, analog to what has been done for Q-systems of type A.
From Proposition 3.8, [M ] − [M 0 ] is a product of non-intersecting simple loops of G. The following loops are all connected simple loops that can be appeared (given our choice of M 0 ). This will be proved in Theorem 6.2.
We first define 2r straight loops on G and denote them by Γ 2a−1 for a ∈ [1, 2r].
We notice that when a ∈ [1, r − 1], Γ 2a always goes counterclockwise around face a and clockwise around face r + a. When a ∈ [r + 1, 2r − 1], Γ 2a goes counterclockwise around face 2r − a and clockwise around face 3r − a. Lastly, we define Γ 2r,j for j ∈ [1, 6]. They are depicted as follows.  We then have the following theorem analog to Theorem 5.3. There is a complete graph K 6 as a subgraph of G r in the middle. The label (6) on the three thick lines indicates that the vertex connects to all six vertices in K 6 . There is a thick line with label (5); vertex 2r + 2 connects to all vertices in K 6 except to the vertex (2r, 1). (This is indicated by a dotted line between (2r, 1) and (2r + 2).) The vertex (2r, 6) has two extra edges connecting to vertex 2r − 4 and 2r − 3.
The Example 6.4. When r = 2, the graph G 2 for B 2 Q-system has 12 vertices and can be depicted as the following. We have the following weights. , γ 4;6 = 1 Q 2,2k , For H k := H (0,k),G,M 0 (A 1,k , . . . , A 2r,k ), we have We notice that H 0 = H 4 and H 1 = H 3 . In fact, we will show that for the Hamiltonians of the B r Q-system.
Let F r be the following graph with 2r vertices. Conceptually F r is obtained from G r by collapsing all six vertices (2r; 1), . . . , (2r; 6) into one vertex 2r and folding the resulting graph by identifying vertices i ↔ 4r − i. The projection π sends a vertex of G r to a vertex of F r by the collapsing/folding procedure.
Let C be the set of all hard particle configurations on G r , and let C k be the set of all k hard particle configurations on G r . We have C k = ∅ for k ∈ [0, 2r]. (The set C 0 contains exactly one configuration, the empty configuration.) So Figure 3. An example of dots on F 10 associated with a configuration {1, 4, 11, 14, 20, 27, 33, 41} in C. The dot indicates two dots of different colors on the same vertex.
1 Figure 4. A running example from Figure. 3 showing F 10 decomposed into blocks. We identify a hard particle configuration with a subset of [1, 2r − 1] ∪ {(2r; j)} 6 j=1 ∪ [2r + 1, 4r − 1]. Let A ∈ C. We then associate each element i ∈ A with a black or white dot on the vertex π(i) F r as follows.
• An element (2r; j), for j ∈ [1, 5], is associated with a black dot together with a label j on vertex 2r. • The element (2r, 6) is associated with a white dot together with a label 6 on vertex 2r and a black dot on vertex 2r − 2.
See an example in Figure 3. Notice that we can recover the hard particle configuration on G r from a configuration of dots on F r . It is obvious that not every dot configuration on F r is associated with a configuration in C.
We define an involution ι : C → C by the following steps.
(1) Let A ∈ C. Consider the dot configuration on F r associated with A. We have a collection of connected chains of dots. Since A is a hard particle configuration, each chain is a chain of dots of alternate colors or A pair of white and black dots on the same vertex. For each connected chain i 1 < · · · < i k or a pair of black and white dots i 1 = i 2 (k = 2), we let i be the largest odd integer such that i ≤ i 1 , j be the smallest even integer such that i k < j. When j > 2r, we set j = 2r. We then delete edges (i − 1, i), (i−1, i+1), (j, j +1) and (j, j +2) of F r when possible. As a result, F r is decomposed into disconnected blocks (isomorphic to F n , n ≤ r). Lastly any block of 2n vertices containing no dots is decomposed into n blocks of 2 vertices. See Figure 4 for an example.
(2) For each block we define an involution on dot configurations as in Figure 5 and 6.
The blocks in Figure 7 are fixed by the involution. (3) The hard particle configuration ι(A) is the configuration associated with the resulting dot configuration. See Figure 8 for an example.
For a block of 2n vertices the involution sends a dot configuration of size k to a configuration of size 2n − k, where we do not count the black dot at 2r − 2 when the white dot with label 6 on 2r is present. The sum of all the number of vertices of all blocks is 2r. So the involution is a bijection between C k and C 2r−k . It is left to show that if A ∈ C k and B = ι(A) ∈ C 2r−k then i∈A w(γ i ) = j∈B w(γ j ).
By a direct computation, we have Figure 9. The involution on a block can be written as a sequence of moves in (18).
for a ∈ [1, r − 1] and b ∈ [1, r]. These equations say that the following moves preserve the weight of the associated hard particle configuration.
Since the involution on each block can be written as a sequence of the moves (18) (see Figure 9 for an example), the involution preserves the weight for each block. Hence the equation (17) holds.
6.3. Poisson bracket. Similar to type A, we let let C be the Cartan matrix of type B r . The signed adjacency matrix of the quiver of B r Q-system is . Let X be a phase space with coordinates (A 1 , . . . , A 2r ). Define a Poisson bracket on the algebra O(X ) of functions on X by where the coefficient matrix Ω is defined by Comparing to Proposition 5.9, the Poisson bracket for B r Q-system cannot be written as the intersection pairing. This is due to the existence of faces with the same weight, which makes the Poisson bracket not local. Nevertheless, experimental data still show that the Hamiltonians Poisson-commute.
Conjecture 6.6. The Hamiltonians of the B r Q-system Poisson-commute.

Dimer integrable systems
In this section, we compare our constructions and results to [GK13]. First we summarize the result from [GK13]. 7.1. Minimal bipartite torus graphs from convex polygons. Let N be a convex polygon in R 2 with corners in Z 2 , called integral polygon, considered up to translation by vectors in Z 2 . We pick all the integral vertices on the boundary of N (i.e. every vertex in ∂N ∩ Z 2 ) counterclockwise, and get a sequence of vertices v 1 , v 2 , . . . , v n where n is the number of integral vertices on ∂N and the indices are read modulo n. Let vectors e i be vectors pointing from v i to v i+1 . We get from the construction that each e i = (a i , b i ) is a primitive vector, i.e. a i , b i ∈ Z and gcd(a i , b i ) = 1. We then get a collection {e i } of integral primitive vectors in Z 2 .
Consider the torus T = R 2 /Z 2 . Each e i determines a homology class (a i , b i ) ∈ H 1 (T, Z) = Z × Z, and there is a unique up to translation geodesic representing this class. In other words, it is an oriented straight line on T with slope b i /a i , i.e. a projection of e i on the torus T. Note that the geodesics are indeed oriented loops on T since their slopes are rational.
We then take a family of distinct oriented loops {α i } on T such that the isotopy class of α i matches the isotopy class of the geodesic representing e i . By Theorem 7.3 we can choose {α i } such that the loops are in generic position (no intersection of more than two loops) and satisfy the following conditions [GK13, Definition 2.2]: (1) (admissibility) Going along any loops α i , the directions of the other loops intersecting it alternate (left-to-right or right-to-left).
(2) (minimality) The total number of intersections is minimal. The collection {α i } provides a decomposition of T into a union of polygons whose oriented sides are parts of α i and vertices are intersection points of the loops α i . Then the first condition is equivalent to (1 ) (admissibility) The sides of any polygon P i are either oriented clockwise, counterclockwise or alternate. The family of oriented loops {α i } gives rise to an oriented graph on the torus T. We call an oriented graph on T satisfying the above conditions minimal admissible graph on a torus.
Example 7.1. Starting from an integral polygon on the left, we obtained four primitive vectors depicted in the middle picture.
The vectors are then associated with oriented loops on a torus, which gives a minimal admissible graph shown in the picture on the right.
Given an admissible minimal torus graph, we construct a bipartite graph G on T by constructing vertices from the polygons P i where the coloring is determined as follows: • Polygons P i with counterclockwise orientation are associated with black vertices.
• Polygons P i with clockwise orientation are associated with white vertices. From the construction, every intersection is a vertex shared by exactly two well-oriented polygons having opposite orientations. We then associate each shared vertex with an edge connecting the two vertices of G associated to the two polygons.
We see that G is indeed a bipartite graph, and we will call it a minimal bipartite torus graph. For the rest of the section, unless stated otherwise we assume that G is a minimal bipartite torus graph obtained from an integral polygon N .
Example 7.2. In our running example, there are eight polygons and eight intersection points. In the picture, the polygons labeled by 2, 3 (resp. 4, 5) are oriented counterclockwise (resp. clockwise), so they are associated with black (resp. white) vertices of G. The polygons labeled by 1, 6, 7, 8 have alternate orientation. The eight intersection points are associated with eight edges of G.
From the bipartite graph G, we can uniquely (up to translation) recover the starting integral polygon by reversing the process. The convexity condition on the integral polygon will guarantee the uniqueness of the polygon. We also note that a 180-degree rotation of N corresponds to reversion of the orientation of all loops in the admissible minimal graph. This will switch the color of the vertices of G.
For an arbitrary integral polygon N , a minimal admissible graph on a torus associated with N and a minimal bipartite torus graph associated with N always exist. Furthermore, we can obtain one minimal bipartite torus graph from another by use of the two elementary moves (definitions 3.1 and 3.2), as stated in the following theorem. Remark 7.4. Our bipartite torus graphs for the Q-systems of type A and B in sections 5 and 6 are not obtained from non-degenerate convex polygons.
For A r Q-system, we reverse the process and construct oriented loops on the torus as in the following picture. We get only two oriented loops depicted in blue and red whose homology classes are (0, −r−1) and (0, r + 1), respectively. Notice that they are not primitive, and they form a vertical degenerate bigon with sides of length r + 1. For B r Q-system, we have the following picture. There are four oriented loops depicted in blue, green, yellow and red whose homology classes are (0, −2r + 1), (0, −1), (0, 1) and (0, 2r − 1), respectively. The blue and red loops are not primitive when r > 1. The loops form a vertical degenerate quadrilateral. 7.2. Phase space and Poisson structure. For a minimal bipartite torus graph G with n faces, let L G be the moduli space of line bundles with connections on G. We have L G ∼ = Hom(H 1 (G, Z), C * ), so combinatorially L G is the set of all weight assignments to all the loops on G compatible with loop multiplication. (The weight of a product of loops coincides with the product of their weights.) For j ∈ [1, n], let y j be the weight assigned to the counterclockwise loop Y j around the face j of G. Since G is a graph embedded on a torus, there is a projection H 1 (G, Z) → H 1 (T, Z).
We then pick two loops Z 1 , Z 2 having homology classes (1, 0), (0, 1) ∈ H 1 (T, Z) under the projection, and assign weight z 1 , z 2 to them, respectively. Any loop on G can then be generated by y j 's together with z 1 and z 2 , where a product of the variables corresponds to a product of loops. Since the product of all the face loops is trivial, we must have n j=1 w j = 1. This is the only condition among the generators. So dim L G = n + 1 and the algebra O(L G ) of functions on L G has (y 1 , . . . , y n−1 , z 1 , z 2 ) as coordinates.
Note that this weight is different from our weight in Definition 3.10. The connection between the two is discussed in Remark 7.5.
For any loops Γ 1 , Γ 2 on G, the Poisson bracket of their weights is defined in terms of the intersection pairing of the twisted ribbon graph associated with G as in Definition 5.8. Now we define a Y-seed (B, (y 1 , . . . , y n , z 1 , z 2 )) of rank n + 2 associated with L G , where the exchange matrix B = (B ij ) and with Y n+1 := Z 1 and Y n+2 := Z 2 .
Let G and G be two minimal bipartite torus graphs associated with the same integral polygon N . By Theorem 7.3, they are related by a sequence of elementary moves. These moves induce an isomorphism i G,G : L G → L G according to Y-seed mutations. Let X N be the phase space defined by gluing the spaces L G by the isomorphisms. The phase space depends only on N and each isomorphism i G,G can be viewed as a change of coordinate.
Remark 7.5. Let G be a minimal bipartite torus graph with n faces. Each choice of face weight (A i ) ∈ (C * ) n induces a weight assignment on oriented edges of G by Definition 3.10. This then induces a weight assignment on Y 1 , . . . , Y n , Z 1 , Z 2 , hence a loop weight in L G . Since L G has dimension n + 1, not all loop weights of [GK13] can be obtained from our weight in Definition 3.10.
In addition, the weight y j around face j of G is the j th τ −coordinates (Definition 2.4) of a cluster seed (A, B), i.e.
where B = B G is the signed adjacency matrix of the quiver associated to G (see Section 3.1).
Since y 1 and y 2 are algebraically independent, the induced loop weight is a subspace of dimension 2 inside L G of dimension 5. (L G is of dimension 5 because every loop weight in L G satisfies y 1 y 2 y 3 y 4 = 1.) The map from face weight to loop weight is not injective. We have the following 2-dimensional symmetries for λ, µ ∈ C * . 7.3. Casimirs and Hamiltonians. A zig-zag path on G is an oriented path on G which turns maximally left at white vertics and turns maximally right at black vertices [Ken02,Pos06]. They will always close up to form loops. Notice that the projection of the zig-zag loops on the torus are in the same isotopy classes with the oriented loops α i obtained from the primitive edges e i of N (See Section 7.1). So the oriented zig-zag loops are in bijection with {α i }.
The weight of these zig-zag loops, called Casimirs, generate the center of the Poisson algebra O(L G ) as described in the following proposition.
Proposition 7.7 ([GK13, Lemma 1.1]). We consider the oriented zig-zag loops on a bipartite oriented surface graph G. Then as Z runs over zig-zag loops, the functions w Z generate the center of the Poisson algebra O(L G ) of functions on L G . The product of all of them is 1. This is the only relation between them.
Recall the construction of G from a minimal admissible graph (an arrangement of {α i } n i=1 ) in Section 7.1. We see that each edge e of G has exactly two loops α i , α j ∈ {α 1 , . . . , α n } crossing it. Let α i and α j be as the following. Then we define a reference perfect matching M 0 to be the matching containing all edges e such that i > j. It is shown in [GK13, Theorem 3.3] that M 0 is indeed a perfect matching of G. We note that M 0 is not unique. Since the indices of α i can be read modulo n, another cyclic ordering gives another reference perfect matching. There are also many other choices of M 0 including "fractional matchings", see [GK13, Section 3.2-3.4] for details.  We also have that the partition function is invariant under the change of coordinates i G,G (defined in Section 7.2). This implies that all Hamiltonians are also invariant under the change of coordinates. In fact, the map i G,G is a unique rational transformation of face weights preserving the partition function, given a graph mutation from G to G .
Theorem 7.10 ( [GK13, Theorem 4.7] ). Given an urban renewal, there is a unique rational transformation of the weights preserving the partition function P a . This transformation is a Y-seed mutation.
By counting the number of Hamiltonians and Casimirs, we can conclude on the integrability of the system. Theorem 7.11 ([GK13, Theorem 1.2]). Let M 0 be a reference perfect matching obtained from a circular-order-preserving map. The Hamiltonian flows of H M 0 ,a commute, providing an integrable system on X N . Precisely, we get integrable systems on the generic symplectic leaves of X N , given by the level sets of the Casimirs.
Remark 7.12. We notice that the integrable system described in this section is a classical dynamical system where the evolutions are Hamiltonian flows. This system also contains a discrete dynamical system whose evolution is a change of coordinate i G,G (Y-seed mutation on loop weights).
For a graph G periodic (up to a relabeling of vertices) under a sequence of urban renewals and shrinking of 2-valent vertices, we take the change of loop weight under such sequence to be the dynamic of a discrete system. Since the graph is periodic, the dynamic is a Poisson map with respect to the Poisson bracket in Section 7.2. The Casimirs and Hamiltonians return to the same form under such sequence. Since they are also invariant by Theorem 7.10, they are conserved quantities of the system. By Theorem 7.11, the quantities form a maximal set of Poisson-commuting invariants, hence the system is discrete Liouville integrable.

Conclusion and discussion
In this paper, we studied a discrete dynamic on a weighted bipartite torus graph, obtained from an urban renewal on the graph and cluster mutation on the weight. The weight is defined differently from [GK13]. The graph can be any bipartite graph on a torus, not necessarily obtained from an integral polygon. The Hamiltonians are defined and proved to be invariant under the mutation.
For a Q-system of type A, we constructed a weighted bipartite torus graph which is periodic under a sequence of mutations up to a face relabeling. The weight changes according to the Qsystem relation. So the Hamiltonians are conserved quantities of the system. This coincides with the result from [GP16]. We also showed that the Hamiltonians can be written as hardparticle partition functions on a certain graph, which coincides with the result in [DFK10]. A nondegenerate Poisson bracket is defined, and the Hamiltonians Poisson commute.
For a Q-system of type B, a bipartite torus graph is constructed. The graph is a doublecover of the dual graph associated with the Q-system quiver. It is periodic under a sequence of mutations up to a face relabeling. The weight are transformed according to the Qsystem relation. The Hamiltonians are conserved quantities of the system. They can also be interpreted as hard-particle partition functions on a certain graph. We conjecture that the conserved quantities Poisson commute under the Poisson bracket defined in Section 6.3.
One could wonder what happens for types C, D and other exceptional types. The sequence of mutations in [DFK09, Theorem 3.1] contains a mutation at a vertex of degree greater than 4. Recall that an urban renewal corresponds to a mutation at a vertex of degree 4 which has exactly two incoming and two outgoing arrows. Although some mutations in type A and B happen at a vertex of degree less than 4, we fixed this issue by adding a frozen vertex. However this technique is not applicable when the degree of a mutating vertex is greater than 4. This problem might possibly be solved by unfolding or factoring the quiver so as to restore the 4-valent property. We leave this for future work.