In this section, Kontsevich is describing a pattern of index contraction of a certain tensor which reproduces a statistical mechanics sum over configurations. For his model, you have at each vertex, which I will label by the integer k$k$, a copy of the same four index tensor
$R_{a\mu}^{b\nu}$$$R_{a\mu}^{b\nu}$$
Where awhere $a$ and b$b$ are indices for one vector space of dimension $d_1$, $\mu$ and $\nu$ indices are for another vector space of dimension $d_2$. The dimensions of the vector space are going to be the number of discrete states at each site.
He multiplies together all the R's$R$'s at all the vertices, and contracts the a$a$-index of each site with the b$b$-index of the site which is "left" of it, and the $\mu$ index of every site with the $\nu$ index of the site which is "up" of it. This contracts all the indices in closed cycles, giving a complex number.
Sliding the vertices along the two kinds of arrows, you get two independent "flows" which are number conserving on a finite graph, so the trajectories of the flows are cycles, and on each cycle, the flow is a cyclic permutations of the vertices. For the Ising model on an square N$N$-by-M$M$ lattice with periodic boundaries, one of the two flows just moves a horizontal line containing a site left by one unit, and the other moves a vertical line containing a site by one unit, so they commute as permutations of the $N^2$ elements, and he likes this condition, so he emphasizes it.
$Z = \sum_{a_k,\mu_k} \prod_k R_{a_k\mu_k}^{a_{l(k)}\mu_{u(k)}}$$$Z = \sum_{a_k,\mu_k} \prod_k R_{a_k\mu_k}^{a_{l(k)}\mu_{u(k)}}$$
Where l(k)where $l(k)$ is the left-neighbor of k$k$, and u(k)$u(k)$ is the up-neighbor of k$k$. That is, it's$Z$ is a sum over all possible configurations of values of the indices $a_k, \mu_k$ on the vertices of the graph, of the product of a certain quantity which depends on the value of the indices at the site and the right and up neighbor. In terms of the logarithm of R$R$,
$R_{a\mu}^{b\nu} = \exp(-E(a,\mu;b,\nu))$,$$R_{a\mu}^{b\nu} = \exp(-E(a,\mu;b,\nu)),$$
where E$E$ is the energy function, then
$Z = \sum_{a_k,\mu_k} \exp(\sum_k E(a_k,\mu_k;a_{l(k)},\mu_{u(k)}))$$$Z = \sum_{a_k,\mu_k} \exp(-\sum_k E(a_k,\mu_k;a_{l(k)},\mu_{u(k)}))$$
Wherewhere the big sum outside is over all the possible assignments of indices $a_k$ and $\alpha_k$$\mu_k$ to each of the vertices, and l(k)$l(k)$ is the left-map taking vertex number k$k$ to the number of the left neighbor, while u(k)$u(k)$ is the up-map, taking k$k$ to the up neighbor.
To reproduce the Ising model, let $a_k$ and $\mu_k$ take the two "spin" values 0 or 1 (i.e. the two vector spaces $V_1$ and $V_2$ are both 2 dimensional). Then you want to make sure you get a zero contribution unless the index value $a_k$ is equal to $\alpha_k$$\mu_k$. For this purpose, make the energy function $E(a,\mu,b,\nu)$$E(a,\mu;b,\nu)$ infinite unless $a=\mu$ (i.e. make the corresponding $R$ element zero). Then the big sum on the outside collapses to a sum over configurations of $a_k$ in {0,1}. The following values of $S$$E$ are the finite ones:
The nonzero R$R$ tensor elements are the exponentials of these. The coupling $J$ is the standard extra energy cost for mismatched neighboring spins.