{'fraction_non_alphanumeric': 0.05721531633652904, 'fraction_numerical': 0.010490115083863282, 'mean_word_length': 3.7603804646058165, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The critical Ising model via Kac-Ward matrices

The Kac-Ward formula allows to compute the Ising partition function on any finite graph G from the determinant of 2^{2g} matrices, where g is the genus of a surface in which G embeds. We show that in the case of isoradially embedded graphs with critical weights, these determinants have quite remarkable properties. First of all, they satisfy some generalized Kramers-Wannier duality: there is an explicit equality relating the determinants associated to a graph and to its dual graph. Also, they are proportional to the determinants of the discrete critical Laplacians on the graph G, exactly when the genus g is zero or one. Finally, they share several formal properties with the Ray-Singer \bar\partial-torsions of the Riemann surface in which G embeds.


Introduction
Most of the exact results for the two-dimensional Ising model rely on the so-called Pfaffian method. The idea, due independently to Hurst-Green [23], Kasteleyn [26] and Fisher [18,19], is to associate to the given graph G an auxiliary graph Γ G such that the dimer partition function on Γ G is equal to the Ising partition function on G. The dimer model technology can then be applied to solve the Ising model on G. In particular, if G can be embedded in an orientable surface of genus g, then so can Γ G , and its dimer partition function can be computed as an alternated sum of the Pfaffians of 2 2g well-chosen skew-adjacency matrices [22,38,15,10]. Even though this method is very standard at least for planar graphs (see for example the classical book [34]), it is not a very natural one. First of all, this socalled Fisher correspondence G → Γ G is by no means unique: for example, each of the articles [26,19,15,6,33,8] contains a different version of it. Secondly, whatever the chosen correspondence, virtually all the geometric and combinatorial properties of G will get lost when passing to Γ G -the only obvious exception being the genus. This will not be a problem if one is studying a topological class of graphs, such as all planar graphs, or all finite graphs of a given genus. However, if one is interested in a geometric classas we will be -the Pfaffian method leads to unnecessary complications.
There is another combinatorial method to solve the two-dimensional Ising model which, although naturally related to the Pfaffian method (see [8,Subsection 4.3]), is in our opinion much more natural. It is due to Kac-Ward [25] (even though a rigorous proof awaited many years [16]), was originally formulated for planar graphs, and recently extended to any finite graph [32,8]. With this method, no auxiliary graph is needed: the Ising partition function on a finite graph G is computed as an alternated sum of the square roots of the determinants of 2 2g Kac-Ward matrices naturally associated to the graph G.
In this paper, we initiate the study of the critical Ising model on graphs of arbitrary genus, and we do so using these Kac-Ward matrices. What we mean by "critical Ising model" will be formally defined and thoroughly motivated in Section 2, but for now, we will content ourselves with an informal description. Consider a finite number of planar rhombi {R e } e∈E of equal side length, each rhombus R e having a fixed diagonal e and corresponding half-rhombus angle θ e ∈ (0, π/2), as illustrated below. e θ e Paste these rhombi together along their sides so that extremities of diagonals are glued to extremities of diagonals. The result is a graph G with edge set E(G) = E embedded in a flat surface Σ with so-called cone-type singularities in the vertex set V (G) of G, and in the middle of the faces of G ⊂ Σ. We shall say that G is isoradially embedded in the flat surface Σ (see Definition 1). Using the high-temperature representation, we define the partition function for the critical Ising model on such a graph G by where E(G) denotes the set of even subgraphs of G, and the critical weights ν e are given by ν e = tan(θ e /2). This is a natural generalization of the critical Z-invariant Ising model [4], which corresponds to the special case where Σ is a domain in the (flat) plane. Note that only a specific class of planar graphs admit a Z-invariant Ising model (see [29,11]). On the other hand, any finite graph can be isoradially embedded in a flat surface as explained above, and therefore admits a critical Ising model (Proposition 2.1).
Since its introduction by Baxter, the critical Z-invariant Ising model has been extensively studied, as well as its analog on the flat torus (see for example the papers [6,7], where Boutillier and de Tilière make use of the Pfaffian method). On the other hand, very little is known about the critical Ising model on graphs in higher genus. It is widely believed that such models should be discrete analogs of some conformal field theory [1], but in genus g ≥ 2, such statements are only supported by numerical experiments on very specific examples [12,13]. It is our belief that, in order to try to tackle such outstanding conjectures, the Kac-Ward method will prove useful.
Before doing so, we need to settle some fundamental questions about the critical Ising model on graphs of arbitrary genus and the associated Kac-Ward matrices, and this is exactly what the present paper is about.
In the general case of an arbitrary graph embedded in a topological surface, the (generalized) Kac-Ward matrices can be quite complicated (see Definition 1 in [8]). The first nice surprise is that for a weighted graph (G, x) embedded in a flat surface, the corresponding Kac-Ward matrices take a remarkably simple form. For each homomorphism ϕ from the fundamental group π 1 (Σ) of Σ to the group S 1 , we get a ϕ-twisted Kac-Ward matrix of order 2|E(G)| whose determinant we denote by τ ϕ (G, x) (see Definition 3). For a specific type of ϕ's -the ones that belong to the set S of discrete spin structures on G ⊂ Σ -τ ϕ (G, x) turns out to be the square of a polynomial in the variables {x e } e . The main theorem of [8] then easily implies the following result (see Theorem 3.3 for the complete statement).
Theorem. If all cone angles are odd multiple of 2π, then the Ising partition function on the weighted graph (G, x) is given by where g is the genus of Σ and Arf(λ) ∈ Z 2 the Arf invariant of the discrete spin structure λ.
Let us now turn to our main results. In a nutshell, we show that when the weight system is critical the corresponding Kac-Ward determinants τ ϕ (G, ν) exhibit several remarkable properties.
Firstly, these determinants turn out to admit a relatively simple combinatorial interpretation, as described in Proposition 4.1. Furthermore, they satisfy the following duality property.
Theorem. Let G be a graph isoradially embedded in a flat surface Σ, and let ν be the critical weight system on G. The dual graph G * is also isoradially embedded in Σ, and therefore admits a critical weight system ν * . If all cone angles are odd multiples of 2π, then for any ϕ, This can be interpreted as a generalization of the celebrated Kramers-Wannier duality [31] from the case of planar graphs to the case of graphs of arbitrary genus.
Our final result relates the Kac-Ward matrices to some a priori totally different operator. Given a weighted graph (G, x) and a homomorphism ϕ : π 1 (G) → S 1 , the associated discrete Laplacian on G is the operator the sum being over all oriented edges e of the form (v, w). Note that if G is a (planar) isoradial graph, then the corresponding critical weights are given by c e = tan(θ e ) (see [27]). We prove: Theorem. Let G ⊂ Σ be an isoradially embedded graph in a flat surface, and let us assume that all cone angles ϑ v of singularities v ∈ V (G) are odd multiples of 2π. If the genus of Σ is 0 or 1, then for any ϕ : π 1 (Σ) → S 1 , where N is the number of vertices v ∈ V (G) such that ϑ v /2π is congruent to 3 modulo 4, and χ(G) = |V (G)| − |E(G)|. On the other hand, the functions τ ϕ (G, ν) and det ∆ ϕ (G, c) are never proportional if the genus of Σ is greater or equal to two.
Via the method developed in [8,Subsection 4.3], this theorem can be interpreted as a wide-reaching generalization of the main result of [6,7] which was obtained via the Pfaffian method. In our opinion, this is a good example of how simpler and more natural a proof can get, when the Kac-Ward method is used instead of the Pfaffian one. (See Remark 4.7 below for a more detailed comparison.) In the case of the flat torus, the theorem above implies a relation between the free energy of the critical Z-invariant Ising model on G and the normalized determinant of the critical discrete Laplacian on G. The former quantity was computed by Baxter [4], the latter by Kenyon [27], and our equality allows to obtain any of these two results as a corollary of the other one.
The paper is organized as follows. In Section 2, we define our model: the Ising model on graphs isoradially embedded in flat surfaces (Definition 1), with critical weights (Definition 2). In Section 3, we introduce the ϕ-twisted Kac-Ward matrices for graphs in flat surfaces (Definition 3), and we show how they can be used to compute the Ising partition function (Theorem 3.3). Section 4 deals with the case of isoradially embedded graphs with critical weights, and contains our main results. We start with the combinatorial interpretation for the Kac-Ward determinants with critical weights (Proposition 4.1). Then, we prove the equality relating the Kac-Ward determinants of dual isoradially embedded graphs (Theorem 4.4). Also, we relate the Kac-Ward determinants with the determinant of the critical discrete Laplacian on G (Theorem 4.6). In a last paragraph, we explain how the Kac-Ward determinant can be understood as a discrete version of the ∂-torsion of the underlying Riemann surface (Subsection 4.4).
we start by recalling what is meant by high and low-temperature expansions for the Ising model, leading to the Kramers-Wannier duality argument (Subsection 2.1). The models on which such an argument can be applied are called Z-invariant Ising models (Subsection 2.2). They are all defined on planar (or toric) graphs, but a generalization of these models to surfaces of arbitrary genus then naturally leads to our definition (Subsection 2.3).
2.1. Kramers-Wannier duality. Let G be a finite graph with vertex set V (G) and edge set E(G). A spin configuration on G is a map σ : V (G) → {−1, +1}. Any positive edge weight system J = (J e ) e∈E(G) on G determines a probability measure on the set Ω(G) of such spin configurations by is the partition function of the Ising model on G with coupling constants J.
As observed by van der Waerden [40], the identity allows to express this partition function as where E(G) denotes the set of even subgraphs of G, that is, the set of subgraphs γ of G such that every vertex of G is adjacent to an even number of edges of γ. This is called the high-temperature expansion of the partition function.
Let us now assume that the graph G is planar, and let G * denote its dual graph. For any spin configuration σ ∈ Ω(G), consider the subgraph of G * given by all edges e * ∈ E(G * ) dual to e = (u, v) with σ u = σ v . Clearly, this is an even subgraph of G * . Furthermore, since G is planar, this defines a surjective map Ω(G) → E(G * ) such that σ and σ ′ have same image if and only if σ ′ = −σ. This leads to the following low-temperature expansion of the Ising partition function:  Thus, if we assign weights J to E(G) and J * to E(G * ) in such a way that tanh(J e * ) = exp(−2J e ), or more symmetrically, sinh(2J e ) sinh(2J e * ) = 1, we obtain that the partition functions Z J (G) and Z J * (G * ) are proportional to each other.
In the case of the square lattice with constant weight system J, this is enough to determine the critical value J c of the coupling constant. Indeed, assuming that the free energy of the model is analytic everywhere except at a single point, this point must be equal to J c and to J * c , since the square lattice is self-dual. The equality J c = J * c then leads to the explicit value J c = log 1 + √ 2.
2.2. The Z-invariant Ising models. This beautifully simple argument, the celebrated Kramers-Wannier duality [31], is not sufficient to determine the critical value of the coupling constant on a graph that is not self-dual: it only relates this critical value to the one for the dual graph. However, for some planar graphs, this can be obtained "with little additional labor" [41]. Let us start with the example of the hexagonal lattice H, and let H ′ denote the graph obtained from H by a star-triangle transformation at a vertex v as illustrated in Figure 1. Assume one can assign coupling constants J to the edges of H and J ′ to the newly created edges of H ′ in such a way that Z J ′ (H ′ ) = R v Z J (H) for some function R v of the coupling constants of the edges around v. Since the triangular lattice T can be obtained from H by such transformations, it would follow that Z K (T ) = R Z J (H) for some controlled R and well-chosen coupling constants K, J. This, together with the Kramers-Wannier duality, would lead to an equality of the form Z K (T ) = k Z K * (T ), with K → K * some involution and k an explicit function of K and K * . Arguing as above, the critical points should be self-dual under this involution, leading to the equality k = 1 and an exact description of these critical points for the triangular and hexagonal lattices.
This strategy of using invariance under the star-triangle transformation (or, Z-invariance) can be applied not only to the hexagonal-triangular lattices, but to a wide class of planar graphs [5,4]. It turns out that this class of graphs on which a Z-invariant Ising model can be defined coincides with the graphs that admit an isoradial embedding in the plane [29,11]: this is an embedding such that each face is inscribed in a circle of radius one, with the circumcenter in the closure of the face. Furthermore, the corresponding critical coupling constants admit a very simple geometric description: they e θ e Figure 2. An edge e of an isoradial graph, the associated rhombus, and the half-rhombus angle θ e . are given by where θ e ∈ (0, π/2) is the half-rhombus angle associated to the edge e, as illustrated in Figure 2. For example, the square lattice is isoradially embedded with all half-rhombus angles equal to θ = π/4, leading to the critical coupling constant J c = log 1 + √ 2 as above. On the other hand, the triangular and hexagonal lattices are isoradially embedded with angles θ = π/6 (resp. π/3), so the corresponding critical values are equal to J c = log √ 3 (resp. log 2 + √ 3). This geometric description of the critical coupling constants becomes even nicer when using the high-temperature expansion, as we obtain the critical weights ν e = tanh(J e ) = tanh 1 2 log 1 + sin θ e cos θ e = 1 − cos θ e sin θ e = tan(θ e /2).

2.3.
Isoradial graphs in flat surfaces. In the present paper, we will study more general models where the graph G is not assumed to be planar. The proper generalization of planar isoradiality is obtained by considering socalled flat surfaces with cone-type singularities. Let us quickly recall their definition and main properties, referring to [39] for further details. Given a positive real number ϑ, the space endowed with the metric ds 2 = dr 2 + r 2 dt 2 is called the standard cone of angle ϑ. Note that the cone without its tip is locally isometric to the Euclidean plane. Let Σ be a surface with a discrete subset S. A flat metric on Σ with cone-type singularities of angles {ϑ x } x∈S supported at S is an atlas where U x is an open neighborhood of x ∈ S, φ x maps x to the tip of the cone C ϑx , and the transition maps are Euclidean isometries.
This seemingly technical definition should not hide the fact that these objects are extremely simple and natural: any such flat surface can be obtained by gluing polygons embedded in R 2 along pairs of sides of equal length. For example, a rectangle with opposite sides identified will define a flat torus with no singularity. On the other hand, a regular 4g-gon with opposite sides identified gives a flat surface of genus g with a single singularity of angle 2π(2g − 1). In general, the topology of the surface is related to the cone angles by the following Gauss-Bonnet Formula: if Σ is a closed flat surface with cone angles {ϑ x } x∈S , then where χ(Σ) is the Euler characteristic of Σ.

Definition 1.
A graph G is isoradially embedded in a flat surface Σ if the following conditions are satisfied: -Σ is a compact orientable flat surface with cone-type singularities; -each edge of G is a straight line in Σ; -each closed face f of G ⊂ Σ contains an element x f at distance 1 from all vertices of ∂f ; -a singularity of Σ is either a vertex of G or a vertex x f of the dual graph G * , that is, the singular set is contained in Given an isoradially embedded graph G ⊂ Σ, each edge e ∈ E(G) has an associated rhombus as illustrated in Figure 2. Therefore, the metric space Σ should simply be understood as rhombi pasted together along their boundary edges. This observation also leads to the following fact. Proof. Fix an arbitrary angle θ ∈ (0, π/2) and associate to each half-edgeẽ of G the isosceles triangle illustrated below. For each vertex v ∈ V (G), choose a cyclic ordering of the d v half-edges of G coming out of v and build the associated star St(v) as follows: glue together the corresponding d v triangles following the chosen cyclic ordering around v. Note that St(v) is a flat surface with one singularity of cone angle 2θd v , and that the cyclic ordering endows this surface with an orientation. For each edge e = (v, w) ∈ E(G), glue together the stars St(v) and St(w) along their boundary by pasting together the two triangles associated to e in the unique way that is consistent with the orientation of the stars. (If e is a loop at v, just glue together the corresponding sides of the star St(v).) By construction, G is isoradially embedded in the resulting metric space Σ, which is a compact oriented flat surface.
Following the discussion of the previous subsections, we shall adopt the following terminology. Definition 2. Let G be a graph isoradially embedded in a flat surface Σ. The critical weight associated to the edge e ∈ E(G) is defined by where θ e ∈ (0, π/2) is the half-rhombus angle associated to the edge e. The partition function for the critical Ising model on G is given by where E(G) denotes the set of even subgraphs of G.

The Kac-Ward formula for graphs in flat surfaces
In [8], we gave a generalized Kac-Ward formula for the Ising partition function on any finite weighted graph (G, x). The aim of this section is to show that when the graph G is embedded in a flat surface, the generalized Kac-Ward matrices take a particularly simple form -whatever the weight system x on G is. In the next section, we will consider the case of isoradial graphs with critical weights.
3.1. Kac-Ward matrices for graphs in flat surfaces. Let us start with some general terminology and notation. Given a weighted graph (G, x), let E = E(G) be the set of oriented edges of G. Following [37], we shall denote by o(e) the origin of an oriented edge e ∈ E, by t(e) its terminus, and byē the same edge with the opposite orientation. By abuse of notation, we shall write x e = xē for the weight associated to the unoriented edge corresponding to e andē. Now, assume that G is embedded in an orientable flat surface Σ so that each edge of G is a straight line, Σ \ G consists of topological discs, and the set S of cone-type singularities is contained in V (G) ∪ V (G * ). As above, let ϑ x denote the cone angle of the singularity x ∈ S. Fix a unitary character ϕ of the fundamental group of Σ, that is, an element of Hom(π 1 (Σ), U (1)) = Hom(π 1 (Σ), S 1 ) = Hom(H 1 (Σ), S 1 ) = H 1 (Σ; S 1 ).
As G ⊂ Σ induces a cellular decomposition of Σ, one can represent such a cohomology class by a cellular 1-cocycle, that we shall also denote by ϕ. This is nothing but a map from the set E of oriented edges of G into S 1 , such that ϕ(ē) = ϕ(e) and ϕ(∂f ) = e∈∂f ϕ(e) = 1 for each face f of G ⊂ Σ.
, with α(e, e ′ ) ∈ (−π, π) the angle from e to e ′ illustrated in the right part of Figure 3. If v does belong to S, then the dotted line drawn there does not make sense anymore, hence the necessity to adopt this slightly less intuitive definition.

3.2.
Discrete spin structures on flat surfaces. The Kac-Ward matrices are particularly useful when ϕ is a special type of 1-cocycle, namely a discrete spin structure. In this paragraph, we shall recall the definition and main properties of these objects, slightly generalizing Section 3.1 of [9].
Loosely speaking, a spin structure on an oriented surface Σ is a way to count parity of rotation numbers for closed curves in Σ. In the plane, there is a unique way to do so, and therefore a unique spin structure. On a closed orientable surface of genus g however, there are exactly 2 2g distinct spin structures. More precisely, one can identify the set S(Σ) of spin structures on Σ with the set of quadratic forms on Σ [24]: these are the maps q : H 1 (Σ; Z 2 ) → Z 2 such that q(x + y) = q(x) + q(y) + x · y for all x, y ∈ H 1 (Σ; Z 2 ), where x · y denotes the intersection number of x and y. Note that the difference of two quadratic forms is a linear form. Therefore, this set admits a freely transitive action of the abelian group H 1 (Σ; Z 2 ); in other words, it is an affine H 1 (Σ; Z 2 )-space. The Arf invariant of a spin structure is defined as the Arf invariant of the associated quadratic form, that is, the number Arf(q) ∈ Z 2 satisfying Coming back to flat surfaces, let us assume that G is a graph embedded in a flat surface Σ so that Σ \ G consists of topological discs, and let X denote the induced cellular decomposition. We shall now explain how, in such a situation, it is possible to encode spin structures on Σ by some cocycles λ ∈ Z 1 (X; S 1 ). Let us assume that all cone angles ϑ x are positive multiples of 2π, i.e. that Σ has trivial local holonomy. Then, the holonomy defines an element Hol of Hom(π 1 (Σ), S 1 ) = H 1 (Σ; S 1 ) = H 1 (X; S 1 ). We shall call a cocycle κ ∈ Z 1 (X; S 1 ) such that [κ −1 ] = Hol a discrete canonical bundle over Σ. Note that such a cocycle κ is very easy to determine. Indeed, it is always possible to represent Σ as planar polygons P with boundary identifications. Furthermore, these polygons can be chosen so that G intersects ∂P transversally, except at possible singularities in S ∩ V (G). Define κ by where θ denotes the angle between the sides of ∂P ⊂ C met by the edge e. If S ∩ V (G) is empty, this defines completely a natural choice of discrete canonical bundle κ. Otherwise, the partially defined κ above can be extended to a cocycle yielding a discrete canonical bundle.
Mimicking the continuous case (in the version developed by Atiyah [2]), let us define a discrete spin structure on Σ as any cellular 1-cocycle λ ∈ Z 1 (X; S 1 ) such that λ 2 = κ. Two discrete spin structures will be called equivalent if they are cohomologous. The set S(X) of equivalent classes of discrete spin structures on Σ is then given by Note that if the flat surface Σ has trivial holonomy, then [κ] is trivial, so the set S(X) is equal to the 2g-dimensional vector space H 1 (Σ; Z 2 ). In general, G ⊂ Σ can be described via planar polygons as explained earlier. In such a case, and assuming that the singular set S ∩ V (G) is empty, a discrete spin structure is given by where exp(−iθ/2) denotes one of the square roots of the angle between the sides of ∂P ⊂ C met by the edge e.
One easily checks that the set S(X) is an affine H 1 (Σ; Z 2 )-space. Furthermore: Proof. Let κ ∈ Z 1 (X; S 1 ) be a fixed discrete canonical bundle over Σ. For each λ ∈ Z 1 (X; S 1 ) such that λ 2 = κ, we shall now construct a vector field V λ on Σ with zeroes of even index. Such a vector field is well-known to define a spin structure, or equivalently -by Johnson's theorem [24] -a quadratic form q λ on H 1 (Σ; Z 2 ). The proof will be completed with the verification that two equivalent λ's induce identical quadratic forms, and that the assignment First replace the cellular decomposition X of Σ by X ′ , where each singularity v ∈ V (G) ∩ S is removed as illustrated above. Obviously, λ induces λ ′ ∈ Z 1 (X ′ ; S 1 ) by setting λ ′ (e) = 1 for each newly created edge e. Fix an arbitrary orientation ω of the edges of X ′ . This allows to represent λ ′ ∈ Z 1 (X ′ ; S 1 ) as follows: write λ ′ (e) = exp(iβ λ ′ (e)) with 0 ≤ β λ ′ (e) < 2π if e is an edge oriented by ω, and set β λ ′ (ē) = −β λ ′ (e) for the reverse edge. Fix an arbitrary tangent vector V λ (v) at some arbitrary vertex v of X ′ , and extend it to the 1-skeleton G ′ of X ′ as follows: running along an edge e, rotate the tangent vector by an angle of 2β λ ′ (e) in the negative direction. Since λ is a cocycle such that λ 2 = κ, and since each cone angle is a multiple of 2π, this gives a well-defined vector field along G ′ . Extend it to the whole surface Σ by the cone construction, creating one zero in each face of X and at each element of V (G) ∩ S. Obviously, the resulting vector field V λ depends on the choice of ω, but not in a crucial way. Indeed, reversing the orientation ω on a given edge e either does nothing (if λ ′ (e) = 1), or corresponds to adding two full twists to the vector field along e. Therefore, the parity of winding numbers with respect V λ are independent of ω. In particular, one easily checks that a zero of V λ is of even index if and only if the corresponding cone angle is an odd multiple of 2π, which we assumed.
As explained in [24], the quadratic form q λ : H 1 (Σ; Z 2 ) → Z 2 corresponding to V λ is determined as follows: for any regular oriented simple closed curve C ⊂ Σ \ S, the number q λ ([C]) + 1 is equal to the mod 2 winding number of the tangential vector field along C with respect to the vector field V λ . For an oriented simple closed curve C ⊂ G, we obtain the following equality modulo 2: where the first sum is over all oriented edges in the oriented curve C, and α v (C) is the angle illustrated below. (This angle should be interpreted as explained in Remark 3.1.) Obviously, equivalent λ's induce the same v α v (C) C quadratic form q λ . Finally, given two discrete spin structures λ 1 , λ 2 , the cohomology class of the 1-cocycle λ 1 /λ 2 ∈ Z 1 (X; {±1}) is determined by its value on oriented simple closed curves in G. For such a curve C, we have Therefore, the assignment [λ] → q λ is H 1 (Σ; Z 2 )-equivariant, which concludes the proof.
3.3. The Kac-Ward formula for flat surfaces. We are finally ready to prove the main result of this section, motivating the introduction of twisted Kac-Ward matrices and discrete spin structures. As before, let (G, x) be a weighted graph embedded in a closed orientable flat surface Σ so that each edge of G is a straight line, Σ \ G consists of topological discs, and the set S of cone-type singularities is contained in V (G) ∪ V (G * ).  ) is the square of a polynomial in the x e 's whenever ϕ is a discrete spin structure on G ⊂ Σ. Furthermore, if τ ϕ (G, x) 1/2 denotes the square root with constant coefficient equal to +1, then the Ising partition function on G is given by where g is the genus of Σ and Arf(λ) ∈ Z 2 the Arf invariant of the spin structure corresponding to λ.
The demonstration given below is by no means self-contained: it only consists in recasting the flat surface case in the more general (and more complicated) topological setting discussed by the author in [8]. We refer to this article for further details.
Proof. By Bass' Theorem [3], τ ϕ (G, x) is given by where P(G) is the (infinite) set of prime reduced oriented closed paths in G, and the second product is over all pairs of consecutive oriented edges in the oriented path γ. By definition of T ϕ , where x(γ) = e∈γ x e and α(γ) is the sum of the angles α(e, e ′ ) along γ (interpreted as in Remark 3.1). This equality already shows that τ ϕ (G, x) does not depend on the choice of the 1-cocycle representing the cohomology class ϕ. Furthermore, if ϕ ∈ Z 1 (X; S 1 ) is a discrete spin structure, then for all oriented closed path γ in G. This implies that ϕ(γ) exp i 2 α(γ) always belongs to {±1}. Therefore, for such a ϕ = λ ∈ S(X), for some w λ (γ) ∈ Z 2 , where the equivalence relation on P(G) is given by γ ∼ −γ. Using the notations of the proof of Proposition 3.2, the element w λ (γ) satisfies Therefore, w λ (γ) is nothing but the mod 2 winding number of the tangent vector field along γ with respect to the vector field V λ associated to the discrete spin structure λ.  [31].) If the flat surface has several boundary components, then the formula is slightly more complicated.

The Kac-Ward matrices with critical weights
As proved in the previous section, the ϕ-twisted Kac-Ward matrices can be used to compute the Ising partition function for any weighted graph embedded in a flat surface. We shall now assume the graph to be isoradial and the weights to be critical (recall Definitions 1 and 2). We will start with a combinatorial interpretation for τ ϕ (G, ν) (Proposition 4.1), that we then use for two of our main results. First, we prove a duality theorem relating τ ϕ (G, ν) and τ ϕ (G * , ν * ) (Theorem 4.4). Then, we show that τ ϕ (G, ν) coincides up to a multiplicative constant with the determinant of the critical discrete Laplacian on G if and only if the genus of Σ is zero or one (Theorem 4.6). In a last subsection, we explain how τ ϕ (G, ν) can be understood as a discrete version of the ∂-torsion of the underlying Riemann surface.
Given a graph G, let F(G) denote the set of subgraphs F ⊂ G such that F spans all vertices of G, and no connected component of F is a tree. Also, for a graph F embedded in an oriented surface Σ, we shall denote by N (F ) a small tubular neighborhood of F in Σ. (This is simply F "thickened", as illustrated in the middle of Figure 4.) Since Σ is oriented, so is N (F ), and this induces an orientation on the boundary ∂N (F ) of N (F ). Therefore, ∂N (F ) consists of a disjoint union of oriented simple closed curves γ on Σ. This is illustrated in Figure 4. Proposition 4.1. Let G be a graph isoradially embedded in a flat surface Σ, and let us assume that all cone angles ϑ v of singularities v ∈ V (G) are odd multiple of 2π. Let ν e = tan(θ e /2) denote the critical weight system on G ⊂ Σ, and set µ e = i tan(θ e ). Then for any 1-cocycle ϕ, where the product is over all connected components γ of the (clockwise oriented) boundary of a tubular neighborhood N (F ) of F in Σ, µ(F ) = e∈F µ e , and the constant C is equal to with χ(G) = |V (G)| − |E(G)| the Euler characteristic of G.
The proof being quite substantial, we will split it into two lemmas. Let us begin with some notation. We shall write V = V (G) and E = E(G) for the sets of vertices and edges of the graph G, E = E(G) for the set ) Given e ∈ E v , let R(e) denote the next edge with respect to this cyclic order, as illustrated in Figure 5. This induces an endomorphism R of L(E). Also, let J denote the endomorphism of L(E) given by J(e) =ē. Finally, we shall write µ for the endomorphism of L(E) given by µ(e) = µ e e, and similarly for any weight system and for ϕ. The aim of the first lemma is to relate τ ϕ (G, ν) to the determinant of a more tractable matrix. where ω(e ′ ,ē) = exp(− i 2 β(e ′ ,ē)) for e ′ =ē ∈ E v with β(e ′ ,ē) as in Figure 3, and ω(ē,ē) = −1. Also, let S ∈ End (L(E)) be the endomorphism given by S = Succ + iJϕν. By definition, the ϕ-twisted Kac-Ward matrix is the transposed of I − S. Now, consider the matrix   Figure 5. The endomorphism R (to the left), and the equality β(e, R(e)) = θ e + θ R(e) (to the right).
we get the equality (The computation above is a variation on a trick due to Foata and Zeilberger, see [20,Section 8].) Let Q ∈ End (L(E)) be defined by Q(e) = exp i 2 β(e, R(e)) e, and set P = I − RQ. Obviously, this endomorphism decomposes into P = v∈V P v with P v ∈ End(L(E v )), and one easily computes as the cone angle ϑ v is an odd multiple of 2π. Hence, the determinant of P is 2 |V | . The point of introducing this P is that it can be used to greatly simplify the matrix A. Indeed, let us compute the composition P A. If e has terminus v, then We finally get where A ′ is given by It is now time to use the fact that the weights ν e are not any weights, but the critical ones given by ν e = tan(θ e /2). First observe that Next, note the equality β(e, R(e)) = θ e + θ R(e) illustrated to the right of   Each permutation σ ∈ S(E) decomposes into disjoint cycles, inducing a partition E = j E j (σ) into orbits of length ℓ j (σ). The corresponding contribution to the determinant is Since M e,e is equal to 1, the oriented edges that are fixed by σ contribute a trivial factor 1 to this product and the corresponding orbits can be removed. By definition of M , a permutation σ ∈ S(E) will have a non-zero contribution only if each of the n(σ) remaining orbits forms a cycle of oriented edges of G such that each oriented edge e is either followed by J(e) =ē or by R(e), and such that these cycles pass through each edge of G at most twice, and if so, in opposite directions. If Γ(G) denotes the set of such union of cycles, we have where each γ ∈ Γ(G) is written as a union of cycles γ = n(γ) j=1 γ j . Now, for any fixed γ, a given edge e ∈ E will fall in one of the following five categories: (v) e is not covered at all, and the contribution is 1.
For any given element γ ∈ Γ(G), any edge of type (ii ) in γ can be removed (i.e. replaced by an edge of type (v )) and the resulting union of cycles will still belong to Γ(G). The converse also holds: any type (v ) edge in an element of Γ(G) can be replaced by a type (ii ) edge, the result will be in Γ(G). Therefore, each time an edge appears as an edge of type (ii ) of some element of Γ(G), it also appears as an edge of type (v ) of some other element of Γ(G) and vice versa. Using the equality (1 − µ 2 e ) = (1 + µ e )(1 − µ e ), we therefore can factor out a term 1 + µ e for each e ∈ E, leading to where γ(i ) (resp. γ(ii ), γ(iii )) denotes the set edges of type (i ) (resp. (ii ), (iii )) of γ. Next, we wish to expand the last product above as Using the notation we get the equality where n( γ) = n(γ) + |γ(i )|, the support of γ is Supp( γ) = γ(i ) ∪ γ(ii ) ∪ γ ′ and ϕ( γ) = e∈γ(i) ϕ(e) for any γ ∈ Γ(G). In other words, We shall now check that c ϕ F vanishes whenever F does not span all vertices of G. Let us assume that the vertex v is not spanned by F . Let γ v be the cycle (e, R(e), R 2 (e), . . . , R d−1 (e)) with e ∈ E v and d = |E v |. The set of γ ∈ Γ(G) with Supp( γ) = F is equal to the disjoint union of Γ 0 and Γ 1 , where Γ 0 (resp. Γ 1 ) denotes the set of such γ = (γ, γ ′ ) with γ containing (resp. not containing) γ v . As v does not belong to Supp( γ), the mapping (γ, γ ′ ) → (γ ∪ γ v , γ ′ ) gives a well-defined bijection f : Γ 0 → Γ 1 .
Let N ϕ T ∈ End(L(E(T )) be the endomorphism given by N ϕ As before, the set E(T ) is equal to v∈V (T ) E v (T ), and the endomorphism ). Now, the orbits E j of the action of R −1 J on the set E(T ) correspond exactly to the connected components of the oriented boundary of a tubular neighborhood N (T ) of T in Σ, where N (T ) is endowed with the clockwise orientation. Hence (1 − ϕ(γ)).
Proof of Proposition 4.1. Lemmas 4.2 and 4.3 give the equality where the constant C is equal to Finally, note that if a component of F is a tree, then ∂N (F ) will contain a trivial cycle and the corresponding coefficient will vanish. Therefore, we can sum over all elements of the set F(G) defined at the beginning of the section. This concludes the proof of the proposition.

4.2.
The duality theorem. We are now ready to state and prove one of our main results.
Theorem 4.4. Let G be a graph isoradially embedded in a flat surface Σ, and let ν be the critical weight system on G. The dual graph G * is also isoradially embedded in Σ, and therefore admits a critical weight system ν * . If all cone angles are odd multiples of 2π, then for any ϕ ∈ H 1 (Σ; S 1 ), (1+cos(θ e * )) τ ϕ (G * , ν * ) = 2 |V (G)|

e∈E(G)
(1+cos(θ e )) τ ϕ (G, ν). Proof. Given a subgraph F of G, let ψ(F ) denote the subgraph of G * given by Obviously, ψ defines a bijection from the set of subgraphs of G onto the set of subgraphs of G * , with inverse ψ −1 (F * ) = {e ∈ E(G) | e * / ∈ F * }. Let F(G) denote the set of subgraphs of G spanning all vertices of G, and containing no cycle that is the boundary of a face. These two conditions being dual to each other, the map ψ defines a bijection ψ : F(G) → F(G * ). Now, consider the sum Since dual edges have rhombus half-angles related by θ e * = π 2 − θ e , the weight µ e = i tan(θ e ) satisfies µ e * = −µ −1 e . Therefore, Furthermore, for any F ∈ F(G), one can decompose the surface Σ as the union of two tubular neighborhoods N (F ) and N (ψ(F )) of F and ψ(F ), pasted along their common boundary. (This is illutrated in Figure 6.) In particular, the oriented boundaries satisfy ∂N (F ) = −∂N (ψ(F )). Therefore, since ϕ is a 1-cocycle, where |∂N (F )| denotes the number of boundary components of N (F ). Note also that, since F spans all vertices of G, adding or removing an edge to F changes the parity of |E(F * )| and of |∂N (F )|. Therefore, the parity of their sum does not depend on F , and it is easily seen to be equal to the parity of |V (G * )|, the number of faces of G ⊂ Σ. We have proved: Since c ϕ F vanishes whenever F ∈ F(G) does not belong to F(G), Proposition 4.1 gives the equalities where τ and τ * stand for τ ϕ (G, ν) and τ ϕ (G * , ν * ), respectively. The three equations above yield the equality where the constant A is equal to with N the number of v ∈ V (G) such that ϑ v /2π is congruent to 3 modulo 4 (and similarly for N * ). By the discrete Gauss-Bonnet formula (recall Subsection 2.3), This means exactly that N + N * and 1 2 χ(Σ) have the same parity, so A is equal to 1 and the theorem is proved.

4.3.
Kac-Ward matrices versus discrete Laplacians. Quite surprisingly, if the surface Σ has genus zero or one, then our Kac-Ward determinants with critical weights turn out to be proportional to the determinants of discrete critical Laplacians. Let us briefly recall the definition and main properties of these objects before stating the precise result.
As first observed by Eckmann [17] (in a much more general context), the Laplace operator on the space of complex valued smooth functions on a Riemann surface admits a beautifully simple discretization. It is the operator ∆ on C 0 (G; C) = C V (G) given by for any f ∈ C V (G) , where the sum is over all oriented edges e of the form (v, w). Its codimension-one minors are very useful, as they count the number of (weighted) spanning trees in G: this is Kirchhoff's celebrated matrix tree theorem [30]. On the other hand, the determinant of ∆ always vanishes.
This construction admits a straightforward generalization: Definition 4. Let (G, x) be any weighted graph, and ϕ : π 1 (G) → S 1 any representation. The associated discrete Laplacian is the operator , , where the sum is over all oriented edges e = (v, w).
The determinant of this discrete Laplacian has a nice combinatorial interpretation, which goes back at least to Forman [21]. We include a proof here for the sake of completeness.
Given a graph G, let F 1 (G) denote the set of subgraphs F ⊂ G such that F spans all the vertices of G, and each connected component T of F has a unique cycle (i.e: |V (T )| = |E(T )|).
Proposition 4.5 (Forman [21]). For any weighted graph (G, x) and any ϕ : where the product is over all connected components T of F , x(F ) = e∈F x e , and ϕ(T ) = e∈C T ϕ(e) with C T the unique cycle in T endowed with an arbitrary orientation.
Proof. Evaluating directly the determinant of ∆ ϕ (G, x) as a sum over per- Each permutation σ ∈ S(V ) decomposes into disjoint cycles, inducing a partition V = j V j (σ). A permutation will have a non-zero contribution to the determinant only if these orbits correspond to the disjoint union of oriented simple closed curves γ = |γ| j=1 γ j in G. If Λ(G) denotes the set of such union of curves, we get with x(γ) = e∈γ x e and ϕ(γ) = e∈γ ϕ(e).
Given any subset W ⊂ V , let X(W ) denote the set of maps X assigning to each v ∈ W an oriented edge X(v) ∈ E with origin v, and set x(X) = v∈W x W (v) . For any "vector field" X ∈ X(V ), let Λ(X) denote the set of disjoint unions of "trajectories" of X: these are oriented simple closed curves C in G such that any oriented edge e ∈ C with origin o(e) satisfies X(o(e)) = e. We have the product being over all trajectories C of X. (This is the original formula of Forman [21].) The map assigning to each X ∈ X(V ) the subgraph F = {X(v)} v∈V is surjective onto the set F 1 (G) defined above, and each F ∈ F 1 (G) has 2 |F | preimages given by the possible choices of orientations of the cycle in each of the |F | connected components of F . The proposition now follows from the equality ( Let us mention one more fact: if G is a planar isoradial graph, then the corresponding critical weights for the discrete Laplacian are given by c e = tan(θ e ), where θ e denotes the half-rhombus angle [27]. Therefore, we shall refer to ∆ ϕ (G, c) as the critical discrete Laplacian on G. Finally, we shall make the usual abuse of notation and denote by the same letter ϕ a homomorphism π 1 (Σ) → S 1 and the induced homomorphism on π 1 (G) for G ⊂ Σ.
Theorem 4.6. Let G be a graph isoradially embedded in a flat surface Σ, and let us assume that all cone angles ϑ v of singularities v ∈ V (G) are odd multiples of 2π. Let ν e = tan(θ e /2) denote the critical weight system on G ⊂ Σ, and set c e = tan(θ e ). If the genus of Σ is zero or one, then for any ϕ : π 1 (Σ) → S 1 , where N is the number of vertices v ∈ V (G) such that ϑ v /2π is congruent to 3 modulo 4 and χ(G) = |V (G)| − |E(G)|. On the other hand, the functions τ ϕ (G, ν) and det ∆ ϕ (G, c) are never proportional if the genus of Σ is greater or equal to two.
Proof. If ϕ is trivial, then both sides of the equality vanish by Propositions 4.1 and 4.5. In particular, the equality holds in the genus zero case, so it can be assumed that the genus g of Σ is positive. Let F be an element of the set F(G), that is, a spanning subgraph of G such that no connected component of F is a tree. For any connected component T of F , let c ϕ T denote the corresponding coefficient c ϕ T = γ⊂∂N (F ) (1 − ϕ(γ)). First note that c ϕ T only depends on the homotopy type of T in Σ. (Basically, one can deform T continuously in Σ without changing c ϕ T .) Therefore, it can be assumed that T is a wedge of n circles, with n = 1 − χ(T ) = 1 + |E(T )| − |V (T )| ≥ 1. If n is greater then 2g, then these n cycles are linearly dependant in H 1 (Σ; Z). Via a homotopy of (Σ, T ), one can therefore assume that one of these cycles is null-homologous, leading to c ϕ T = 0. If n is equal to 2g, then either these cycles are linearly dependant in H 1 (Σ; Z) and c ϕ T vanishes as above, or these cycles are independent in homology. In this case, T induces a cellular decomposition of Σ, so ∂N (T ) is the boundary of f faces with Therefore, f is equal to 1, so ∂N (T ) is connected, hence null-homologous, and c ϕ T vanishes in this case as well. We have proved that c ϕ F vanishes unless In the case of genus 1, this shows that c ϕ F vanishes unless F belongs to the set F 1 (G). For such an element F , the contribution of each connected component T can be easily computed: ∂N (T ) consists of two connected components homologous to T and −T , so By Propositions 4.1 and 4.5, we now have since µ e = ic e . The equality now easily follows from the explicit value for the constant C given in Proposition 4.1.
Let us finally assume that the genus of Σ is greater or equal to two. By the argument above, it is enough to show that there is some element F ∈ F(G) \ F 1 (G) with non-zero coefficient c ϕ F . In particular, we just need to find a spanning connected subgraph T ⊂ G with |E(T )| − |V (T )| = 1 and such that none of the boundary components of N (T ) is trivial in H 1 (Σ; Z). Such a T is obtained as follows: choose a spanning tree T 0 ⊂ G and add two edges of G so that the resulting two cycles are linearly independent in H 1 (Σ; Z) but have zero intersection number. (This is possible since Σ has genus g > 1 and G induces a cellular decomposition of Σ.) The resulting graph T satisfies the conditions listed above, and the proof is completed.
Remark 4.7. Boutillier and de Tilière obtained a similar result in [6,7] (see also [14]): given any graph G isoradially embedded in the flat torus, they relate det ∆ ϕ (G, c) with the determinant of some ϕ-twisted Kasteleyn matrix of (Γ G , ν), where Γ G is the graph associated to G via some variation of the Fisher correspondence [19]. Actually, using the methods developed in [8,Subsection 4.3], one can show that Corollary 12 of [7] is equivalent to our Theorem 4.6 in the flat toric case (that is, when g = 1 and S is empty). In our opinion, our approach has several advantages. It is more general, as we allow singularities and understand the higher genus while Boutillier-de Tilière only deal with the flat toric case; it is more natural, as we work on the same graph G throughout without using one of many possible auxiliary graphs Γ G ; and it is simpler, as our whole proof relies solely on Propositions 4.1 and 4.5. The demonstration of Boutillier-de Tilière, on the other hand, is quite substantial and relies on highly non-trivial results of Kenyon [27] and Kenyon-Okounkov [28].
We conclude this section with one last remark. Let us assume that G is isoradially embedded in the flat torus Σ = C/Λ, with Λ some lattice in C, and let G be the corresponding Λ-periodic planar graph. For n ≥ 1, set G n = G/nΛ. The free energy per fundamental domain of the critical Z-invariant Ising model on G is defined by with J e = 1 2 log 1+sin θe cos θe as explained in Subsection 2.2. The equality together with Theorems 3.3 and 4.6 imply where log det 1 ∆(G, c) = lim n→∞ 1 n 2 log det ∆ λ (G n , c) and λ is one of the three non-trivial spin structures on the torus. (On the torus, spin structures are canonically identified with H 1 (Σ; Z 2 ), the trivial spin structure has Arf invariant 1 and the three others have Arf invariant 0. The trivial spin structure does not contribute to the partition function by Proposition 4.1, and it is a fact that the three other spin structures will have the same contribution to the free energy of the model.) The free energy f I was computed by Baxter in [4], and the normalized determinant by Kenyon in [27] -even though the existence of the limit was not proved there. One can check that these two results are related in the way displayed above. This gives a reality check to our computations, and allows to obtain any of these two results as a corollary of the other one.
4.4. The Kac-Ward determinants as discrete ∂-torsions. In this last subsection, we wish to relate (in an informal way) the critical Kac-Ward determinants with the ∂-torsions of the underlying Riemann surface. Let us start by briefly recalling the definition of this invariant, in the special case relevant to us.
To any closed N-dimensional complex manifold Σ endowed with a unitary representation ϕ : π 1 (Σ) → U (n) and a Hermitian metric, Ray and Singer [35] associate a sequence of numbers T p (Σ, ϕ) with p = 0, 1, . . . , N . In the case of a Riemann surface (N = 1), the numbers T 0 (Σ, ϕ) and T 1 (Σ, ϕ) coincide, leading to a single invariant T (Σ, ϕ). If n = 1, then ϕ is a unitary character (that is, an element of H 1 (Σ; S 1 )), and it induces a complex line bundle L(ϕ) over Σ. Since Σ is endowed with a Hermitian metric, one can consider the associated Laplacian ∆ on the space of smooth sections of L(ϕ). The ∂-torsion T (Σ, ϕ) is defined as the square root of the zeta-regularized determinant of this Laplacian, that is, where ζ(s) is the zeta function of the Laplacian ∆. Of course, this depends on the choice of Hermitian metric. However, for any two non-trivial characters ϕ, ϕ ′ , the ratio T (Σ, ϕ)/T (Σ, ϕ ′ ) is independent of this choice [35, Theorem 2.1]. Let us come back to the discrete setting. As before, let G be a graph isoradially embedded in a flat surface Σ with all cone angles at singularities in V (G) being odd multiples of 2π. Recall that the flat metric defines a conformal structure on the underlying surface, so that Σ is now a Riemann surface. Consider the following statement.
We shall not give any proof of this vague statement, not even formulate a precise conjecture (although this is very tempting). Instead, we shall simply give a list of evidences towards such a statement.
First of all, recall that given any two non-trivial characters ϕ, ϕ ′ , the ratio T (Σ, ϕ)/T (Σ, ϕ ′ ) only depends on the Riemann surface Σ and on ϕ, ϕ ′ , but not on the Hermitian metric. Therefore, one expects the corresponding ratios τ ϕ (G, ν)/τ ϕ ′ (G, ν) to exhibit some independence of the choice of the graph G embedded in the surface Σ. As mentioned in the introduction, the papers [12,13] provide numerical evidences towards such a claim at the scaling limit (in the special case where ϕ and ϕ ′ are discrete spin structures). Now, our duality result can be understood as a further step in that direction. Indeed, it is a direct consequence of Theorem 4.4 that the ratios τ ϕ (G, ν)/τ ϕ ′ (G, ν) and τ ϕ (G * , ν * )/τ ϕ ′ (G * , ν * ) actually coincide, without taking any scaling limit, for any two non-trivial characters ϕ, ϕ ′ .
In the remainder of the discussion, we shall distinguish between the genus zero, the genus one, and the higher genus cases.
The genus zero case. Whenever the character ϕ is trivial, τ ϕ (G, ν) vanishes by Proposition 4.1 (actually, Lemma 4.2 is enough). Since the kernel of the continuous Laplacian has dimension one, T (Σ, ϕ) is also equal to zero. In particular, τ ϕ (G, ν) and T (Σ, ϕ) 2 trivially coincide in the case of genus zero.
The genus one case. In the toric case, Theorem 4.6 shows that τ ϕ (G, ν) is proportional to the most 'natural' discretization of T (Σ, ϕ) 2 , that is, the determinant of the critical discrete Laplacian.
Here, the product is over all conjugacy classes of primitive elements of Γ, that is, elements that are not powers in Γ [35,Theorem 4.6]. As explained in [36], there is a more geometric way to understand this zeta function: conjugacy classes of primitive elements of Γ correspond to primitive closed geodesics on Σ, and 2ρ γ is the length ℓ γ of the corresponding geodesic. Summing up (and neglecting the problems of convergence), we have the equality where P(Σ) denotes the set of primitive closed geodesics in Σ.
Let us make the corresponding study on the discrete side. Given an oriented closed path γ on a graph G, we will say that γ is reduced if it never backtracks, that is, if no oriented edge e is immediately followed by the oriented edgeē. The oriented closed path γ will be called prime if, when viewed as a cyclic word, it cannot be expressed as the product δ r of a given closed path δ for any r ≥ 2. Finally, we shall denote by P(G) the set of prime reduced oriented closed paths in a graph G. Let us now assume that G is isoradially embedded in a flat surface Σ. As explained in the proof of Theorem 3.3, Bass' Theorem [3] implies the equality where ν(γ) = e∈γ ν e and α γ is the sum of the angles α(e, e ′ ) along γ (recall Figure 3). The expression (⋆⋆) can be understood as a discrete version of (⋆) in the following sense. Primitive closed geodesics on Σ are replaced by homotopically non-trivial reduced prime closed paths in G ⊂ Σ. The factor exp i 2 α γ measures to which extend γ differs from a straight line (i.e. a geodesic on Σ with respect to the flat metric). And finally, the critical weight ν e = tan(θ e /2) plays the role of exp(−ℓ e ), with ℓ e the length of the edge e.