{'fraction_non_alphanumeric': 0.03557541010291006, 'fraction_numerical': 0.01184641261688159, 'mean_word_length': 4.130555813306115, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Transfer matrix for spanning trees, webs and colored forests

We use the transfer matrix formalism for dimers proposed by Lieb, and generalize it to address the corresponding problem for arrow configurations (or trees) associated to dimer configurations through Temperley's correspondence. On a cylinder, the arrow configurations can be partitioned into sectors according to the number of non-contractible loops they contain. We show how Lieb's transfer matrix can be adapted in order to disentangle the various sectors and to compute the corresponding partition functions. In order to address the issue of Jordan cells, we introduce a new, extended transfer matrix, which not only keeps track of the positions of the dimers, but also propagates colors along the branches of the associated trees. We argue that this new matrix contains Jordan cells.


Introduction
Spanning trees are a classical theme which forms a chapter of virtually every textbook of combinatorics or graph theory, see for instance [1]. For G a connected, unoriented graph, a spanning tree on G is a connected subgraph with the same set of nodes as G, and which contains no cycle. The problem of counting the spanning trees on a given graph appears to have a classical solution as well, based on Kirchhoff's theorem (or the Matrix-Tree theorem) [2].
Spanning trees are related to various statistical physics models, like the Potts model [3], the dimer model [4,5,6] and the two-dimensional Abelian sandpile model [7] in which they play a crucial role. Spanning trees have also been intensively studied in the mathematical literature, where many of the most recent contributions are based on the relation between spanning trees and the loop-erased random walk (LERW) [8]: the chemical paths connecting two points on uniform spanning trees have the same distribution as the LERW running between the same two points [9,10,11,12].
As introduced above, a spanning tree is an unoriented structure. By selecting a specific vertex as a root, the spanning tree acquires a natural orientation: the edges forming the spanning tree become oriented and are directed towards the root. A rooted spanning forest is an oriented spanning graph which is a disjoint union of rooted trees. These oriented structures can be seen as configurations of arrows: at each vertex, except the root, there is one and only one outgoing arrow, pointing to one of its neighbouring vertices, potentially the root as the case may be. A rooted spanning tree or forest is then a configuration of arrows which contain no loop, with all arrows flowing to the root. A colored forest is a forest in which the different disconnected trees are assigned distinct colors.
Relaxing the constraint that the arrow configurations cannot contain loops leads to generalized structures. They are known in the mathematical literature as unicycles, cycle-rooted spanning forests, cycle-rooted spanning groves, which in general combine trees and loops, contractible or not, oriented or not, see for instance [13,14,15,16,17,18,19,20] for recent works. In the physical literature, these different structures are known under the general name of spanning webs, and appear most often in the context of the monomer-dimer model [21,22,23,24,25].
Our purpose in this article is to study the statistics of spanning webs on two-dimensional square grids. We recall that Temperley's correspondence establishes an isomorphism between the dimer configurations on a rectangular grid and spanning trees or spanning forests on an appropriate sublattice. Depending on the parities of the dimensions of the dimer grid, different boundary conditions may be achieved through the existence or not of connections between boundary sites and the root. A uniform measure on dimer configurations induces a uniform measure on the corresponding class of spanning forests.
When the grid on which the dimers live is embedded on a cylinder, Temperley's correspondence gives rise to a special class of rooted spanning webs, which, following [17], we will call incompressible spanning webs, meaning that their connected components are either rooted spanning trees or cycle-rooted spanning trees where all loops must be non-contractible and self-avoiding. Again uniform dimer configurations lead to uniform incompressible spanning webs. Our aim is to study the statistics of the subclasses of those spanning webs that contain a fixed number of loops, by computing the corresponding partial partition functions. In this sense, the present work is a continuation of [23].
In Section 2, we recall the Temperley correspondence for dimer configurations on a cylinder and the type of boundary conditions which the associated spanning webs are subjected to. In this way the problem of computing the partition funcions for spanning webs reduces to computing the partition function for dimers. Section 3 indicates how this can be done by using the transfer matrix formalism, following an old proposal by Lieb [26]. In Section 4, we show how the subclasses of spanning webs comprising a fixed number of loops can be separated, by assigning appropriate weights to certain bonds on the dimer grid. Section 5 indicates how the proper weighing can be implemented on the transfer matrix, and computes the relevant partial partition functions, for incompressible spanning webs on a cylinder and in the conformal limit. Sections 6 and 7 are devoted to the conformal bulk generating functions. Section 8 introduces colors on disconnected rooted trees and discusses the emergence of Jordan cells.

Spanning webs from dimers
There is a well-known correspondence between rooted spanning forests on a domain and dimer configurations on a related domain, first observed by Temperley [4] in the case of a finite portion of Z 2 and generalized, much more recently, in various directions [13,5,6]. On a non-planar graph, this correspondence establishes a relation between dimer configurations and incompressible spanning webs. Here we recall this relation in the special case we want to study, namely a cylindrical grid.
We consider a M ×N rectangular grid on Z 2 on which we impose a periodic boundary condition horizontally. The sites of this grid L are labelled by two integer numbers, a horizontal coordinate between 1 and N and a vertical coordinate between 1 and M. We also define L odd and L even as the subsets of sites with their coordinates either both odd or both even respectively, the union L odd ∪ L even being (roughly) half the full grid L. Seen as a (non-planar) graph, the sites of L form the set of vertices while the edges are those inherited from the lattice Z 2 .
A dimer configuration on L is a subset of edges such that every site of L belongs to exactly one edge. Equivalently one thinks of placing dimers, little rectangles covering exactly two neighbouring sites, in such a way that every site is covered by exactly one dimer (obviously this is only possible if the number of sites MN is even). By defining a probability measure on the set of dimer configurations, a statistical analysis of their general characteristics can be made. A specific (unnormalized) measure which is commonly used is the one that gives a dimer configuration the statistical weight α h β v , where α, β are positive real numbers and h and v are respectively the number of horizontal and vertical dimers contained in the configuration. In what follows, we will use another measure in order to disentangle the various classes of spanning webs to which the dimer configurations will be associated.
It is easy to see that every dimer covers exactly one site of either L odd or L even , the other site being in the complement L \ (L odd ∪ L even ). Accordingly one separates the dimers into two classes, odd or even, which we color in blue and red, as in Figure 1.
Temperley's correspondence replaces each dimer by an arrow: the arrow starts from the site of L odd or L even which the dimer covers, is aligned along the dimer, and points to the next site of L odd or L even , or towards the outside of the grid if the arrow goes out from a site which is a neighbour site of the boundary. In this case, we say that the arrow points to a root. Except in this last situation, the arrows connect two neighboring sites of L odd or of L even . Finally, the arrows inherit the color from the dimers they are constructed from: they are colored blue if they originate from sites of L odd , and red if they originate from sites of L even . The set of blue arrows form a spanning web on L odd , and the set of red arrows form a spanning web on L even . For the rest, the complement L \ (L odd ∪ L even ) plays no role and will be removed. The boundary conditions are different on the two sublattices, as can be seen in Figure 1. Let us note that the lattice L odd ∪ L even consists of layers of sites of L odd alternating with layers of sites of L even .
If the number M of rows is even, the bottom layer belongs to L odd and the top layer is in L even . On L odd , the blue arrows on the bottom row point to sites of L odd , but those on the highest row of L odd (row number M −1) may also point vertically to a root. We will say that the boundary conditions on the bottom and top edges of L odd are respectively closed and open, see [27]. On L even , the situation is reversed: the top edge (row M) is closed while the bottom edge of L even (row 2) is open.
If M is odd, L even has one row less than L odd . In this case, the two boundaries of L odd are closed, whereas the two boundaries of L even are open.
If periodicity is imposed in one direction, say horizontally, we will always assume that the number N of sites in that direction is even. Then L odd and L even inherit of the same periodicity in that direction.
Thus the correspondence associates to each dimer configuration on a cylindrical grid two arrow configurations forming two spanning webs, a blue one and a red one. One can make a number of more or less elementary observations about the spanning webs that occur in this correspondence, all of which are well illustrated in Figure 1.
(i) The arrows of the spanning webs, blue or red, flow to roots or to loops.
(ii) The blue and red spanning webs do not cross, but are intertwined; as L even is the dual lattice of L odd , one can view the two spanning webs as dual.
(iii) A spanning web, either blue or red, never contains a contractible loop, because such a loop would encircle an odd number of sites of L, which could therefore not be fully covered by dimers. If however periodicity is assumed in one direction, a spanning web may contain noncontractible loops wrapping around the periodic direction (like on Figure 1). Note that a non-contractible loop can wind around the cylinder only once, since it cannot intersect itself. A spanning web with no loop is a spanning forest. If the grid has no periodic direction, all spanning webs are spanning forests.
(iv) If a dimer configuration gives rise to an arrow configuration with a non-contractible loop, there is one other dimer configuration leading to identical arrows except that the orientation of the loop is opposite. This other dimer configuration is simply obtained by shifting the dimers forming the loop, by one lattice spacing along the loop.
(v) Suppose, like in Figure 1, that periodicity is assumed horizontally but not vertically. Then, if M is even, the blue spanning web contains the same number of loops as the red spanning web; moreover blue and red loops alternate from bottom to top, starting with a blue one and ending with a red one. Indeed if the blue spanning web contains a loop, the red arrows located above the blue loop cannot flow to roots because the top boundary of L even is closed. Therefore they must be a red loop to which they can flow. If M is odd, the blue spanning web has one more loop than the red spanning web. The loops of either color still alternate, starting and ending with a blue one. The reason for this is that the two boundaries of L odd are closed, so that the blue arrows have nowhere to flow except to loops.
(vi) An important observation for what follows is that the dimers of one color unambiguously determines the positions of the dimers of the other color, up to the orientation of the loops. As therefore follows from the previous remarks, to a fixed configuration of blue arrows containing L loops, there are 2 L or 2 L−1 (depending on the parity of M) possible arrangements of the red arrows, equivalently, of the dimers touching sites of L even .
(vii) The correspondence between dimer configurations and the pair (blue and red) of oriented spanning webs of the sort described above is one-to-one, but is in general many-to-one if one keeps the spanning web of only one color, because of the orientation of the loops.
The correspondence recalled above allows to trade the statistical analysis of certain webs on a cylindrical grid, taken as the L odd of L even of some larger cylindrical grid L, to a related analysis of dimer configurations on L. By choosing an appropriate measure on the dimer configurations, one can disentangle the different sorts of spanning webs that occur. As the multiplicity introduced by the orientations of the loops is known, one may choose to consider oriented spanning webs or else to ignore the orientation.
The dimer setting is convenient to work with, especially in view of the fact that it allows for a transfer matrix treatment. In the rest of this article, we will show how the different classes of spanning webs can be separated, and also how the loops can be removed, therefore leading to a situation where spanning forests only remain. As the recurrent configurations of the sandpile model are equivalent to spanning forests [7], this will provide a transfer matrix for the sandpile model defined on a cylinder (but not on a torus).

Counting dimers
The construction of a transfer matrix for dimer configurations has been given long ago by Lieb [26]. A recent account of it can also be found in [28].
As explained above, we consider all possible dimer configurations on a rectangular grid in Z 2 with M rows and N columns. For the moment, periodicity may be assumed horizontally or vertically, or both. In this section we restrict to the probability measure that assigns a dimer configuration the statistical weight α h β v discussed in the previous section. We will see in the next section how to modify it in order to keep track of the loops in the spanning web picture. The partition function sums these weights for all configurations, but since h + v = MN/2, it essentially depends only on the ratio α/β. Equivalently, setting β = 1 without loss of generality, we can write The idea underlying Lieb's construction is to code the presence of a horizontal or vertical dimer in terms of up and down spins, in such a way that a whole configuration of dimers can be traded for a configuration of spins. The spins are attached to the sites, see the figures below. An up spin at site i means that there is a vertical dimer covering i and its top neighbour; a down spin indicates the absence of such a vertical dimer. In the latter case, it either means, if the down spin is right above an up spin, that site i pairs up with its neighbour below to form a vertical dimer; otherwise, it means the down spin at i is next to another down spin, at the left or at the right neighbouring site, to form a horizontal dimer. A row of N sites can have 2 N different spin configurations. The correspondence is pictured in Fig. 2 for a dimer configuration covering five successive rows.
The transfer matrix iteratively builds up the dimer configuration row by row, starting from a first row, at the bottom of the grid. It produces a new row of spins from the previous one (the one below it) by making appropriate flips. As is customary, we can think of the up and down spins as the canonical base elements | ↑ = ( 1 0 ) and | ↓ = ( 0 1 ) of a vector space C 2 , so that a row configuration of spins is an element of (C 2 ) ⊗N . In this case the different actions on spins are realized by Pauli matrices σ i = I ⊗ . . . ⊗ σ ⊗ . . . ⊗ I, where σ, in position i, is one the following matrices The matrices on different sites commute, σ i σ j = σ j σ i for all i = j, while those at the same site From the way the association dimers-spins is defined, a down spin can be followed on the next row by a down or an up spin, but an up spin can only be followed by a down spin. It follows that the transfer matrix reads [26] It is not difficult to see that, when acting on an incoming horizontal sequence of spins, this matrix does exactly what it should. First the factor V 1 = i σ x i flips all the incoming spins, and makes sure that an up spin goes out as a down spin. This is followed by the action of factors Each such factor either does nothing (I) or else turns two up spins at i and i + 1 into down spins to form a horizontal dimer, and at the same time assigns the correct weight α. The product over i produces this alternative for every pair of neighbouring sites in the row.
Thus the matrix T outputs all possible spin configurations from an incoming row |in while respecting the constraints: it correctly handles the incoming vertical dimers, and creates horizontal dimers wherever possible. Likewise, the power T m successively constructs all possible arrays of n rows built on top of |in which satisfy the rules prescribed by the model. The top row in this process, |out = T m |in , gives all possible outgoing row configurations, m layers higher than the incoming row |in .
Two different boundary conditions can be considered on the vertical edges, straight and periodic. Straight means that the grid is bordered, on the left and on the right, by straight edges which form barriers holding the dimers (horizontally the geometry is that of a strip). In this case the summation over i in the exponential in (3.3) runs from 1 to N − 1, whereas it includes N in the periodic case, as well as the periodicity condition σ N +1 = σ 1 . The only difference in the periodic case is, therefore, an extra term α σ − 1 σ − N in the exponential.
The same two boundary conditions can also be considered on the bottom and top boundaries, but the way they are implemented is different. If straight boundary conditions are assumed, the incoming bottom row |in as well as the outgoing top row |out are constrained. A spin up in |in means that a vertical dimer is located at that position, pointing upwards; a down spin indicates the absence of a vertical dimer, and therefore means that this site is covered by a horizontal dimer which also covers a neighbouring site, itself with a down spin. Therefore down spins must come in pairs. On the other hand, a spin up in |out is forbidden, as it would mean that a vertical dimer is going upwards, and would therefore stick out from the top row. Thus the outgoing state must be the all down spin state, |out = | ↓↓ . . . ↓ .
We obtain, for straight boundary conditions on the bottom and top rows (the choice of T , as discussed above, determines the horizontal boundary conditions), where the states |in are constrained as explained above, and in addition, must be weighted by the appropriate power of α according to the number of pairs of (adjacent) spins down they contain.
One may simplify this expression by observing that the allowed incoming states are exactly all the possible states output by the transfer matrix when it acts on the all down spin configuration, and that they automaticaly get the correct weight. We then obtain the nicer formula, (straight bottom and top boundaries) (3.5) If vertical periodicity is assumed, the row number M + 1, produced by the action of T M , is to be identified with the initial row |in , so that the partition function takes the form In this case, there is no restriction on the initial states |in . An isolated down spin in |in is allowed and corresponds to a vertical dimer coming from the previous row, in this case from a site of the top (M-th) row. Therefore we get the familiar formula Let us note that partial traces can also be considered. As shown in [28], the full configuration space of spins on a row, of dimension 2 N , can be divided in disjoint sectors, each sector being left invariant by the action of T . This splitting stems from the existence of an operator V which anticommutes with the transfer matrix and is diagonal in Lieb's spin basis, Its eigenvalues, called variation indices in [28], vary between − N 2 and N 2 by integer steps and label the different sectors. The partial traces restricted to sectors lead to refined partition functions. Figure 3. The figure shows the weights associated to horizontal dimers used in the text to disentangle the configurations with different number of loops. As before, the sites of L odd resp. L even are colored in blue resp. red.

Handling the loops
Our primary purpose is to study the spanning webs arising from Temperley's correspondence with dimers on a cylindrical grid, and to separate them according to the number of loops they contain. As there are no loops if no direction is periodic, we assume horizontal, but not vertical, periodicity, and take N to be even.
We do not want to make a distinction between horizontal and vertical dimers, as in the previous section, so we take α = 1. However we want to be able to distinguish the dimer configurations which give rise to spanning webs with different numbers of loops. A simple way to achieve this is pictured in Figure 3: we assign alternating weights w and w −1 to the horizontal bonds contained in two columns in the way indicated. All other horizontal bonds and all vertical bonds keep a weight equal to 1.
Thus a dimer has generically a weight equal to 1, but will get a weight w or w −1 if it covers one of the marked horizontal bonds. As a consequence, a sequence of dimers forming a loop oriented from left to right, either blue or red, will get a weight equal to w. A loop with the opposite orientation, from right to left, will get a weight w −1 . More generally, a dimer configuration leading to a spanning web with n + loops oriented left-right and n − loops oriented right-left has a weight equal to w n + −n − . Let us write the dimer partition function in terms of the loop content of the associated spanning webs.
If M is even, the number of blue loops is equal to the number of red loops. According to the above discussion, a dimer configuration with a total of 2L loops (L blue and L red) contributes a factor w n + −n − , with n + + n − = 2L. The partition function is thus The case n + = 2L corresponds to the dimer configurations with all loops oriented left-right. For each such configuration, one can reverse the orientation of n − loops by moving the dimers along loops, as explained in Section 2. As there are 2L n − = 2L n + ways to choose n − loops out of 2L, we obtain # configurations with 2L loops, and the partition function becomes As we do not want to keep track of the orientation of the loops but only their number, we may write It is to be emphasized that even though we do not keep track of the orientations, the loops are oriented. This means that two spanning webs differing by the orientation of some of their loops correspond to distinct dimer configurations and therefore are counted as being different. A natural alternative is to consider non-oriented loops, in which spanning webs are identified, and counted as one, if they only differ by the orientation of some of their loops. This means that we keep only one representative among 2 2L oriented spanning webs, leading to (M even) (4.5) As illustration, for a 4 × 4 cylinder with horizontal periodicity, one finds and thus 29 spanning trees, 19 configurations with two loops oriented left-right (or as many nonoriented loops), and 1 configuration with four loops oriented left-right.
It is also noted that the value w = i satisfying w + w −1 = 0 automatically removes all the configurations with loops: the corresponding partition function counts the configurations which are spanning forests, and assigns a zero weight to the configurations containing loops.
If M is odd, there is always one more blue loop than red loops, so the total number of loops is odd. In this case the partition function reads It implies that the number of spanning trees on L odd is equal to 0, as expected since the boundary conditions on L odd are both closed, and that the number of spanning forests on L even (boundary conditions on L even are both open) is the coefficient of (w + w −1 ). For instance, one finds implying that there are 1728 spanning forests on L even , a 2 × 3 cylindrical grid with two open edges.

Loops on a cylinder
We have shown in the previous sections that the spanning webs on a cylinder C with no other loops than those wrapping around the cylinder can be traded for dimer configurations on an extended cylindrical lattice, weighted appropriately so that the spanning webs with different number of loops can be separated. Depending on the boundary conditions chosen on the two edges, open or closed, the cylinder should be identified as the even or odd lattice of the extended one.
If the extended dimer lattice L is 2M × 2N (even height, even perimeter), the odd and even sublattices, both M × N, are subjected to the same boundary conditions : one edge is open, the other one is closed. In this case, the two sublattices play a symmetrical role, and we may take C to be either of them, say C = L even . From the previous section, we have Each dimer configuration on L with 2L loops gives rise to a spanning web on C with L loops, and another one on L odd , also with L loops. Because of the possible orientations of the L loops on L odd , we find that for each spanning web on C with L loops, there are 2 L configurations on L, If the dimer lattice is (2M + 1) × 2N (odd height, even perimeter), then L odd is (M + 1) × N and has two closed edges, while L even is M × N and has two open edges. A dimer configuration on L with 2L + 1 loops gives rise to a spanning web on L odd with L + 1 loops, and another one on L even , with L loops. Focusing on either sublattice, and owing to the possible orientations of the loops on the other sublattice, we find Thus all partial partition functions Z (L loops) pertaining to the spanning webs containing a fixed number of loops and given boundary conditions can be computed from a dimer partition function, provided the dimer configurations are appropriately weighted, in shown in Figure 3. This can be done with the help of the transfer matrix as follows.

Weighted dimer configurations
The most convenient way to compute the required dimer partition functions with the transfer matrix is to choose the periodic direction to be the direction of transfer. The marked bonds, weighted with w or w −1 , then appeared as vertical bonds, as pictured in Figure 4. Away from these, we use the transfer matrix introduced in Section 3 (the left and right edges are straight) where M can be even or odd.
Let us denote by T (w) the modified transfer matrix that has to be used when the first row of weighted vertical bonds is encountered. Then, the matrix to be used immediately after T (w) is T (w −1 ) so that the dimer partition function reads The modified matrix T (w) should assign an outgoing up spin a factor w or w −1 , depending on its position. The operator w 1 2 (I+σ z i ) precisely produces a factor w if the outgoing spin at i is up, and a factor 1 if it is down. Therefore we obtain where V is the variation operator introduced before in (3.8). Recalling that V anticommutes with T [28], the partition function takes the form Since the operator V, like T , acts on rows of spins of length M, its eigenvalues vary between − M 2 and M 2 . Consequently, the trace in the previous equation is a finite series in w with powers ranging between −M and M, and includes only powers of the same parity as M. These traces, for M even or odd, have been computed in [28]. In what follows, we set w = e iπz .

Mixed open/closed boundary conditions
As discussed above, this case corresponds to an extended cylindrical lattice with an even height, which we denote by 2M. The result is [28]  For z = 0 (dimers), it reduces to θ 3 η (q), in agreement with an old known result [29,30]. For z = 1 2 , namely w = i corresponding to spanning forests or equivalently to the recurrent configurations of the sandpile model, one finds θ 4 η (q), reproducing an earlier result [31]. In the scaling limit, we may extract the partition functions Z (L loops) op,cl for spanning webs involving a fixed number of loops by using the q-series expansion of θ 3 , Using the Tchebychev polynomials T 2n (cos πz) = cos (2nπz) expanded in (even) powers of cos πz, we obtain with T (ℓ) As particular cases, from the coefficients (most easily derived from the Tchebychev differential equation) T 2n (0) = (−1) n , T (2) 2n (0) = 4(−1) n+1 n 2 , T (4) 2n (0) = 16(−1) n n 2 (n 2 − 1), (5.15) we obtain the following expressions for the first three partition functions, where the derivatives of θ 4 (e 2iπz |q) are taken with respect to z, evaluated at z = 0.
These results may be used to compute the probability distribution for the number of loops in oriented spanning webs when these are uniformly weighted. For the boundary conditions considered here, the probability that a random arrow configuration contain exactly L loops when the arrows can point outside of the cylinder along one of the two edges is given by The distribution generating function can be obtained from the expressions found. Setting x = 2 cos 2 πz and using the product representation of θ 3 (e 2iπz |q), we have As x = 1 corresponds to z = 1 4 , it follows that the generating function is given by .

(5.20)
For fixed L, the probability Prob op,cl (L loops), as a function of τ has a bell-like shape, with a unique maximum around 1 τ = 2L. The distributions for the first values of L are shown in Figure  5. For large M, small τ , the average value L increases linearly with M.
We stress again the fact that the previous distribution refers to oriented spanning webs having a certain number of loops. One may decide to ignore the orientation and simply focus on the set of lattice bonds used by the spanning webs. All 2 L oriented spanning webs with L loops then get all identified to a single unoriented graph, called an incompressible cycle-rooted spanning forest [17]. The number of those containing L loops equal 2 −L Z (L loops) so that the generating function must be slightly reinterpreted. The resulting distribution reads The distributions in this ensemble are similar to those for oriented loops shown in Figure 5, the main difference being that the curves are slightly shifted to the right (except the first one, for L = 0) and appear to have a larger dispersion.

Open/open and closed/closed boundary conditions
This case corresponds to an extended dimer lattice with an odd height, which we take to be 2M +1. The relevant result from [28] reads The usual dimer partition function θ 2 η (q) is recovered upon setting z = 0 [32], while the function at z = 1 2 vanishes, as expected. The boundary conditions are no longer the same on the odd and even sublattices. However due to the relation Z , we obtain the first two partition functions, and reproduces the result obtained in [17] by different methods.

Transfer matrix for spanning webs
In the previous sections, we have computed the cylinder partition functions for spanning webs with a fixed number of loops by using the original transfer matrix proposed by Lieb, accompanied by the insertion of the defect-like operator w 2V to keep track of the loops. It is instructive to reformulate the problem by using a modified transfer matrix that, at each step of the transfer, allows to keep track of the loops. In other words, the operator w 2V should be spread out over the whole lattice instead of being concentrated on a particular row (or pair of rows). The discussion depends on the direction in which the transfer is performed.

Transfer along perimeter (open channel)
We start with the easier case where the transfer is made in the direction of the perimeter, like in Section 5. Using the anticommutation of V and T , it is not difficult to see that the dimer partition a a a a a a a a a a a a a a a function from which the partial partition functions for the spanning webs are to be extracted, can be written Thus the cylinder partition functions can be computed by acting alternatively with the single row modified transfer matrices w − V N T and w V N T , or equivalently, by using the two-row modified matrix w − 2V N T 2 or T 2 w 2V N . It also means that the pattern of alternating weights w and w −1 located on two rows of vertical bonds, see Figure 4, should be copied to all vertical bonds while replacing w by the new weight a = w 1/N . The result is pictured in Figure 6, where the cylinder has been once again rotated.
The computation of the eigenvalues of the two-row transfer matrix T 2 a 2V is straightforward since T 2 and V commute. A common eigenbasis has been discussed in [28], from which the eigenvalues are easily derived. For M even for instance (we recall that T 2 a 2V acts on a row of M sites and has dimension 2 M ), we obtain that each eigenvalue of T 2 a 2V has the form where for each k, λ k takes one of the following four values, with q k = πk M +1 . The use of these eigenvalues to compute the trace in (6.1) leads directly to the results mentioned in the Section 5.

Transfer along height (closed channel)
More interesting is the case where the transfer is made in the direction of the height of the cylinder, which implies that the seeked transfer matrix will act on periodic row configurations. In conformal terms, this transfer matrix yields the conformal spectrum in the bulk (non-chiral).
According to Figure 6, the weights a and a −1 now refer to all the horizontal bonds, alternating both horizontally and vertically. A horizontal bond with a weight a means that a dimer covering this bond gets a weight a. Thus the transfer matrix should not assign a uniform weight α to all horizontal dimers, like in Section 3, but alternating weights a and a −1 . From the expression (3.3), it follows that the correct transfer matrix for this case has the form with the periodic boundary condition σ − 2N +1 ≡ σ − 1 . It assigns a weight a to the first horizontal bond, a weight a −1 to the second one, and so on. Since the weight also alternate vertically, the transfer is performed by alternatively using T (a) and T (a −1 ).
One may also define the two-row transfer matrix, (6.5) easier to handle (and sufficient when the height M is even). From what we have discussed in Section 3 and more specifically from (3.5), the dimer partition function on a cylinder with an even height M is given by It is to be noted that T 2 (a) is the proper matrix to compute the dimer partition function from which we can extract the partition functions for spanning webs with a fixed number of loops. It is however not in itself a transfer matrix for spanning webs having a fixed number of loops. A notable exception is T 2 (a = e iπ/2N ), which corresponds to w = a N = i. As discussed in Section 4, this value of w assigns a weight 0 to the spanning webs containing non-trivial loops, so that T 2 (a = e iπ/2N ) is a genuine transfer matrix to iteratively build and count spanning forests.
In the rest of this section, we report on the exact spectrum of T 2 (a) and compute, in the next section, the conformal spectrum generating function in the scaling limit. We note that if a is a pure phase, T 2 (a) is hermitian and therefore diagonalizable. For general a, it is no longer hermitian, nor even normal, but is nevertheless fully diagonalizable, except at a finite number of isolated points in the complex a plane, located on two circles of radii ( √ 2 ± 1), see below.
For a = 1 or w = 1, the explicit diagonalization has been carried out by Lieb [26] using a Jordan-Wigner transformation. The same method works for a generic value of a, so we merely quote the results.
The Jordan-Wigner transformation maps the spin operators σ ± i to fermionic creation and annihilation operators and so realizes the spin configuration space C ⊗2N as a Fock space. The even (odd) sector comprises the states of the Fock space which have an even (odd) number of fermionic excitations; in terms of spins, the even (odd) sector contains the configurations which have an even (odd) value of V [28]. The splitting into sectors provides a first block-diagonalization of the transfer matrix, since the latter does not change the parity of the fermion number, In addition, the fermions do not satisfy the same boundary condition in the two sectors, so that the two blocks are slightly different. As before, we set w = e iπz and a = e iπz/N .
Carrying the Jordan-Wigner transformation, one finds that the blocks can be written in the following way, where the fermions satisfy the canonical anticommutation relations, Each factor in the tensor products acts in a four-dimensional Fock space, but the restriction to the even or odd sector respectively, which applies to the whole products and not to the factors separately, reduces to 2 2N −1 the dimension of the two blocks T even 2 , T odd 2 . A factor in the products has the typical form given by A = exp (2γ ψ 1 ψ 2 ) exp (2γ ψ † 2 ψ † 1 ), (6.11) and is easily diagonalized in the following basis, The two odd states Φ 1 and Φ 2 are eigenstates of A with eigenvalue 1. The other two eigenvectors are linear combinations of Φ 0 and Φ 21 and therefore even, with eigenvalues λ ± = µ 2 ± , µ ± = 1 + γ 2 ± γ. (6.14) We see that if γ satisfies γ 2 = −1, A is no longer diagonalizable, but contains a two-dimensional Jordan cell. For γ = α k or β k , the condition γ 2 = −1 implies that a = e iπz/N has a complex norm equal to ( √ 2 ± 1). Thus T 2 (a) is diagonalizable for all a lying on the unit circle, as noted before.
We obtain the spectra of T even 2 and T odd 2 , which together form that of T 2 (a), as the sets where the total number of 1's in the product must be even for λ even and must be odd for λ odd .

Bulk spectrum generating functions
The usual statement is that the spectrum of the transfer matrix on a cylinder (with periodic spatial direction) gives the full information on the spectrum of scaling operators in the bulk. This information is traditionally encoded in the torus partition function, where the trace enforces periodicity in the vertical (temporal) direction. When we keep a generic value of w, the interpretation of Z in terms of a loop gas is however no longer clear, so we prefer to talk of Z as a bulk spectrum generating function.
The generating function is given for arrow configurations living on an M × N grid, corresponding to a 2M × 2N grid for the underlying dimer configurations. In the scaling limit, and for w = e iπz as before, the function Z is a function of the aspect ratio M/N through the variable q = exp (−2πM/N), and a function of z. The value z = 0 corresponds to dimers, whereas z = 1 2 corresponds to spanning trees in the sense of the previous section.
The spectrum of T 2 (a) has two parts, the odd one and the even one. From the previous section, the generating function for the odd part of the spectrum reads where β k = sin π(k+z) N , and the odd part of the product means that we do not take all terms in the product but only those terms which contain an odd number of 1's. This constraint can be taken into account by introducing a variable y in the following way, and keeping the odd part in y. The function Z odd can also be written as The first product can be computed asymptotically by using Euler-MacLaurin's formula, and yields log N −1 up to terms which vanish in the limit M, N → ∞ with M/N fixed; G is the Catalan constant.
The second product, using the following estimate, as well as the identity α N −k (z) = α k (−z), yields in the limit N → ∞, Combining this last result with (7.5) from which we remove the extensive term proportional to MN, and taking the odd part in y, we obtain the universal function for the odd sector as A similar calculation for the even sector yields, where we have used θ 1 (y √ q|q) = i √ y q −1/8 θ 4 (y|q) and θ 2 (y √ q|q) = 1 √ y q −1/8 θ 3 (y|q).
Adding the odd and even parts, we obtain the full generating function for the spectrum of the transfer matrix T 2 on a cylinder, Z(q; z) = q z 2 θ 2 1 + θ 2 2 + θ 2 3 + θ 2 4 2η 2 (q z |q). (7.10) This formula reproduces the known result [33] for the dimer model, corresponding to z = 0, This function is modular invariant and a genuine partition function. It is also the torus partition function of the triplet theory [34], with central charge c = −2, and can be expressed in terms of non-chiral characters of W(1, 2), as shown by the second expression in the previous equation.
The other instructive case is z = 1 2 , related to spanning trees, equivalently to the sandpile model. Interestingly, we find As anticipated, it is not modular invariant since the two directions are not treated in the same way. However from its expression in terms of W-characters, we see that Z trees appears as the Z 2 -twisted version of the modular invariant Z dimer .
We have used in this section the transfer matrix T 2 (a) and powers thereof, by which all horizontal bonds are assigned alternating weights a and a −1 whereas vertical bonds have a constant weight 1. We have seen in Section 6 that this setting (in Figure 6) was in fact equivalent to the situation in which only two columns of horizontal bonds are assigned alternating weights w = a N and w −1 = a −N (rotating the Figure 4). The insertion of these weights can be viewed as a defect line propagating vertically, which is the rotated version of the seam shown in Figure 4, itself implemented by the operator w 2V . For z = 1 2 , this operator w 2V = e iπV is a Z 2 symmetry transformation since V takes integer values.
Thus Z trees can be seen as the partition function for dimers complemented by the insertion of the Z 2 defect line running vertically, whose realization in the rotated lattice is provided by e iπV . It gives a lattice realization of the Z 2 defect in the triplet theory and explains the relation of Z trees to Z dimer [35].

Transfer matrix for colored spanning forests
Dimers, spanning trees, spanning webs, sandpiles and dense polymers are very closely related models. All of them, although to different extent, are believed to contain distinctive features that lead to their description in the scaling limit by logarithmic conformal field theories [36,37,38,23]. The hallmark of logarithmic theories is the presence of reducible indecomposable representations in their spectrum, causing logarithms to appear in correlation functions. In particular, the Hamiltonian (or the Virasoro modes L 0 ,L 0 ) of such theories turns out to be non-diagonalizable, namely contains Jordan cells.
For the critical dense polymer model, and the result is expected also for the infinite family of logarithmic lattice models studied in [39], the Jordan cells are already present in the finite volume model, since the finite transfer matrix is non-diagonalizable [40]. For the other aforementioned models, it is not the case. Lieb's transfer matrix originally defined for dimers, and its generalizations described earlier in Section 6, turn out to be fully diagonalizable at finite volume. Whether Jordan cells emerge in the scaling limit, and how, remains an open and intriguing question.
We will not try to answer the question in this last section. What we would like to do is to define a new transfer matrix for spanning trees, essentially based on Lieb's matrix for dimers, but dressed with new degrees of freedom, namely colors. For simplicity, we will restrict to the M × N strip, with an odd number N of columns.
The idea of the construction, described below, is the following. We start with the standard Lieb transfer matrix generating fully packed dimer configurations on the strip. Then, we consider the sublattice of sites with odd horizontal and even vertical coordinates. Using the Temperley mapping, we define the spanning forest on that sublattice. Each tree in the forest has its root in the zeroth row of the full lattice and is thereby globally oriented downward. We ascribe a color to each root and allow it to propagate up the corresponding tree along the bonds oriented downward, left or right (but not upward: the principle of a transfer, as implemented by the transfer matrix, does not allow to transfer a color from a later time). The propagation of colors means a successive ascription of a color to a new site of the odd-even sublattice if it is connected with an already colored site by a bond oriented from the uncolored to colored site. Thus, the number of colors reached at a given row is a non-increasing function of the row number. This is reminiscent of what happens in the dense polymer model in the link state representation, where the number of defects is also non-increasing, causing the Jordan cell structure observed in the transfer matrix. We conjecture (and observe for small system sizes) that this property ensures a similar Jordan cell structure in the colored version of Lieb's transfer matrix.
We consider a strip of width N in the infinite the square lattice, with N sites in each row, for N odd. The state of site i in row m is described by a spin τ i,m = ↑ or ↓, and, in addition, each odd site in a row has a color k, between 1 and N +1 2 , or is uncolored, in which case we set k = 0. Even sites are described by spins only. In the following, we set K ≡ N +1 2 .
As above, we consider the up and down spins as the canonical base elements ↑ = ( 1 0 ) and ↓ = ( 0 1 ), so that a row configuration of spins is an element of (C 2 ) ⊗N . Along with the standard Pauli matrices σ − i , σ + i , σ x i , we will use the projectors For the (K + 1)-dimensional vector denoting the color 0 ≤ k ≤ K at an odd site i, we set |k i = (0, . . . , 0, 1, 0, . . . , 0) t with a 1 in position k + 1; the vector (1, 0 . . . , 0) t is used for the case when no color is ascribed to the odd site. In addition, we define the projector of any color state at site i onto the ℓ-th colored state |ℓ i , ℓ = 0, 1, . . . , K, by and the indicator of a (true) color at a site by Thus, the full, color and spin, configuration of row m row can be written as We specify the state of the first row, the in-state, to be τ j,1 , with τ j,1 =↑ for all j (8.5) in order to ensure the maximum number K = (N + 1)/2 of colors at the bottom of the forest.
The transfer matrix acts both on the spin content of a configuration and on the color variables to ensure the propagation of the colors. The transfer on the spin part is effected by the same matrix T introduced in section 3, Eq. (3.3). The transfer of the color labels, which depends on whether it acts on an odd row or on an even row, is defined as follows.
The following operators U 2i−1 are responsible for the transfer of the colors from the odd sites of an odd row m up to the next even row: where the two factors in the tensor products refer respectively to the color variable and to the spin variable at site 2i − 1. A spin up means the presence of a vertical dimer connecting the sites (2i − 1, m) and (2i − 1, m + 1), and therefore the presence of a bond in the tree oriented downward. This bond thus conducts the color from site (2i − 1, m) to site (2i − 1, m + 1) of the next upper row; this action is described by the first term in U 2i−1 . Likewise a spin down at site 2i − 1 implies the absence of a bond in the tree pointing downward from the site (2i − 1, m + 1), so that the propagation of color is forbidden: the site (2i − 1, m + 1) becomes uncolored after the action of the second term of U 2i−1 . The operators U 2i−1 implement the vertical transfer of the colors from row m to row m + 1 but their action depends on the spins on row m. Therefore they should act before the spin variables themselves are transferred by T . It follows that ensures the vertical transfer of both the spin and the color variables from an odd row to the next row up.
After the transfer by T , we need to worry about the possible transfer of colors horizontally in the even row m + 1. A transfer of color between (2i − 1, m + 1) and (2i + 1, m + 1) is possible if and only if both sites (2i, m + 1) and (2i, m) have spins down, since this ensures the presence of a horizontal dimer either connecting sites (2i − 1, m + 1) and (2i, m + 1) (case 1), or (2i, m + 1) and (2i + 1, m + 1) (case 2). In case 1, the tree has a bond pointing from (2i − 1, m + 1) to the right so that the transfer of color goes in the opposite direction, from right to left, thus from (2i + 1, m + 1) to (2i − 1, m + 1). It is the opposite in case 2, for which the color of (2i − 1, m + 1) is transferred to (2i + 1, m + 1).
The spin at (2i, m) can be probed by applying n ↓ 2i before the action of T . If indeed the spin at (2i, m) is down (the projector n ↓ 2i placed before T does not give zero), one acts with the following two commuting operators In the first two terms of both operators, the projector n ↓ 2i tests the spin at (2i, m+ 1). If it is down, the first term of R 2i+1,2i−1 transfers a non-zero color from (2i + 1, m + 1) to (2i − 1, m + 1) (case 1), whereas that of L 2i−1,2i+1 transfers a non-zero color in the opposite direction (case 2). For each operator, the second term ensures that a zero color is not transferred, while the third term makes sure that no transfer of color takes place when site (2i, m + 1) has a spin up.
It should be noted that pairs of operators L 2i−1,2i+1 , L 2j−1,2j+1 having one index in common do not commute, and the same is true of the R operators. In order to correctly propagate the colors in the two directions, the R operators must be applied by starting from the rightmost site, and ending at the leftmost site, i.e. in the order R 3,1 R 5,3 . . . R N,N −2 ; the L operators must be applied in the inverse order, as L N −2,N . . . L 3,5 L 1,3 .
Putting all together, we obtain the transfer matrix T odd acting on odd row configurations and transferring colors upward, and leftward or rightward in the next even row, can be written as where the sum over {θ 2k = 0, 1} denotes a sum over θ 2 , θ 4 , . . . , θ N −1 , each taking the values 0, 1. By convention, we set R 0 = L 0 = I.
The transfer matrix acting on the configuration of an even row does not transfer colors horizontally and has a much simpler form, Horizontal transfer of colors is not needed, because it would refer to horizontal bonds in the tree living on the other sublattice (even horizontal and odd vertical coordinates), which we are not interested in. For the same reason, the order of the spin transfer matrix T and the operators U is reversed.
We thus obtain the double row transfer matrix as producing spin and color configurations on odd rows. The action of the colored transfer matrices T odd and T even is illustrated in Fig. 7.
A main peculiarity of the proposed colored transfer matrix is its (partial) ability to detect connectivity between different branches of the spanning forest. Lieb's pure spin transfer matrix is sufficient to reproduce all possible dimer and spanning forest configurations but obviously loses the information on connectivity. As connectivity may be one of the non-local observables forcing a description by a logarithmic conformal theory, and Jordan cells in the conformal representations, we are led to suspect that the colored transfer matrix might have Jordan cells.
Checking this out is not easy. Because of the operators responsible for the transfer of color labels, the transfer matrix is not easy to handle analytically. One can perform a numerical investigation, but its size 2 N (K + 1) K grows very fast: the full matrix, equal to the total number of color-spin configurations, has dimension 72, 2 048 and 80 000 for N = 3, 5, 7 ! Not all configurations have to be taken in account however. For instance, the natural order of the non-zero color labels along the rows, 1 ≤ k ≤ K, must be preserved by the transfer, since we start with the ordered color configuration (1, 2, . . . , K) on row 1 (the colored branches cannot cross each other). More generally, the initial configuration S 1 gives rise, under transfer, to a limited number of subsequent configurations above it, which are the only ones worth keeping. This usually leads to a drastic drop in the number of relevant configurations. For N = 3 and 5, the results are as follows. . Illustration of the propagation of colors in a spanning forest, defined on a vertical strip containing 3 columns. Two roots, shown by stars, are placed on the zeroth row (the bottom one) below the odd columns (the first and third). The roots carry an additional color variable, here blue and red. The sites on the second column have no color label (in gray), while the sites of the first and third columns with a zero color label are represented in black. The three panels illustrate the bijective mappings between configurations of (a) spins (+ is for "up", − for "down") and colors, (b) colored dimers, and (c) colored forests. Tree edges oriented upward are uncolored (in black).
For N = 3, the full matrix T is 72-dimensional but its image on the initial state S 1 is only 7-dimensional. The corresponding subspace is generated by the following seven states (as in Fig.  7, the "+" and "−" denote up and down spins respectively, while the numbers refer to the colors): Its characteristic polynomial reads (z − 1) 3 (z 2 − 4z + 1) 2 = 0, showing that the matrix has three different eigenvalues, λ = 1, degenerate three times, and λ = 2 ± √ 3, each twice degenerate. One can check that the equation (z − 1) (z 2 − 4z + 1) = 0 is not satisfied by M, whereas the following is, (M − I) 2 (M 2 − 4M + I) = 0. It implies that M is non-diagonalizable, and possesses one Jordan cell of size 2, associated with the eigenvalue 1.
The situation is similar for the next case N = 5. As mentioned above, the full T has dimension 2 048, but its restriction to the image of the initial state S 1 has dimension 95. By looking at its characteristic polynomial as before, one finds that it has again a single Jordan block of size 2, associated with the eigenvalue 1 (which is degenerate 27 times).
We have not been able to go much further, and the only few general observations about the restriction T restr can be summarized as follows. It is not difficult to see that the state S 1 is a left eigenvector of T with eigenvalue 1, S 1 T = S 1 . In fact the eigenvalue 1 is always highly degenerate, since the states with all spins up and any sequence of non-zero colors such that two consecutive colors are not equal, are all left eigenvectors of T with eigenvalue 1, making it degenerate at least K(K − 1) K−1 times. In addition we have observed that S 1 is orthogonal to all right eigenvectors, suggesting that S 1 is part of a right generalized eigenvector of eigenvalue 1.
All this is too preliminary to lead to any definite conclusion. However the fact that this new transfer matrix carries non-local degrees of freedom may open a new perspective.