Electrical varieties as vertex integrable statistical models

We propose a new approach to studying electrical networks interpreting the Ohm law as the operator which solves certain Local Yang-Baxter equation. Using this operator and the medial graph of the electrical network we define a vertex integrable statistical model and its boundary partition function. This gives an equivalent description of electrical networks We show that in the important case of an electrical network on the standard graph introduced by Curtis, Ingerman and Morrow, the response matrix of an electrical network, its most important feature, and the boundary partition function of our statistical model can be recovered from each other. Defining the electrical varieties in the usual way we compare them to the theory of the Lusztig varieties developed by Berenstein, Fomin and Zelevinsky. In our picture the former turns out to be a deformation of the latter. We describe how our approach produces new interesting mathematical structures on the electrical varieties. Our results should be compared to the earlier work started in Lam and Pylyavskyy on the connection between the Lusztig varieties and the electrical varieties.


Introduction
The theory of cluster algebras [4], [5], [6] and the theory of directed networks, not necessarily planar, developed in [7] grew out of a very interesting paper [2] where the authors studied the Lusztig variety L, the variety of parametrisations of the unipotent group U n . The following features of this variety are important for us: • the set of toric charts labelled by reduced words for the longest permutation coming out of the factorization of a unipotent matrix into a product of the Jacobi matrices • the set of directed graphs labelled by the same set as the charts, these directed graphs are obtained out of the pseudo-line arrangements defined by reduced words for the longest permutation • a supply of functions defined as sums of weights of directed paths in these graphs which can be packed into a unipotent upper triangular matrix • the transition maps between the charts correspond to the local "Yang-Baxter" mutations and a particular solution to the tetrahedron Zamolodchikov equation defines the formulas for these transition maps • the nil Temperley-Lieb algebra related to this solution • a particular set of functions M L labelled by the subsets of the set [1, n] which generate the ring of functions of the Lusztig variety and obey a Plücker type relation • the natural action of the symmetric group on the electrical varieties associated with important classes of graphs analogous to the discrete Toda lattice These led among other things to the discovery of the concept of the cluster algebra and the theory of directed networks. Let us look at a different problem. Suppose we are given a connected graph Γ, a part of its vertices is called the boundary the rest are forming the interior and a function γ from the edges of Γ to the non-zero complex numbers. If γ takes only positive real values the pair (Γ, γ) defines an electrical network with the conductivity γ on Γ [1], [8]. Apply the electrical potential to the boundary vertices then the Ohm law and the Kirchhoff law imply that the current through the internal vertices is zero and therefore we obtain a linear map sending the values of the potential on the boundary to the currents from the boundary to the network. The matrix of this linear map is called the response matrix of the network. One naturally obtains a variety T of electrical networks in this situation. Indeed the choice of the conductivity function, not necessary positive, should be treated as a point in the toric chart labelled by Γ. The graph of the network can be changed locally using the so called "star-triangle" transformation which involves three edges incident to each other in two different ways. If one changes the value of the conductivity function on these edges appropriately, obtaining a new network, the responses matrix of this network is equal to the response matrix of the old network. This change of the conductivity defines the transition map between the toric charts. In what follows we use the fact that this transformation produces a solution for the Zamolodchikov tetrahedron equation. The response matrix M R is therefore a matrix-valued function on our variety. Studying the variety T, which we will call the electrical variety, is the natural task. Moreover it is evident from the description of the electrical varieties that one should search for the connection between them and the Lusztig varieties.
The first work in this direction was done in [3] where the authors clearly introduced the idea that the theory of the electrical varieties is a deformation of the theory of the Lusztig varieties. Using a solution of the Yang-Baxter type equation the authors introduced the electrical Lie group which acts on the set of electrical varieties and is closely related to the symplectic group. This idea was further developed in the subsequent work [9], [10], [11] leading to a number of significant developments in the theory of the electrical varieties.
We suggest a new approach to studying the electrical varieties by introducing a new complete electrical invariant, the data equivalent to the response matrix. Consider the medial graph of Γ. The "star-triangle" transformation of the original graph corresponds to the "Yang-Baxter" mutation in the medial graph. It turns out that the Ohm law defines an operator which solves the Local Yang-Baxter equation with spectral parameters related by the Zamolodchikov mapa solution for the Zamolodchikov set-theoretical equation. This map was known for a long time, it has been used earlier in connection to (2 + 1) integrability in [12] and it is different from the one used in [3]. We will call our operator the Ohm-Yang-Baxter operator and denote it by φ. Using the Ohm-Yang-Baxter operator and the medial graph of Γ we will define a vertex integrable statistical model and a matrix-valued function M B on T which is the boundary partition function of our vertex statistical model.
In the paper we will show that this statistical model gives an equivalent description of the electric variety at least for some important class of electrical networks introduced in [1]. This class of networks is special because the inverse problem for these networks can be solved, namely, given the response matrix one can recover the conductivity function of the network. The graph of such a network is called the standard graph in [1]. We will give precise formulas relating the matrices M R and M B and solve the inverse problem for M B giving therefore a new solution for the inverse problem of the electrical networks on the standard graphs.
The medial graph of the standard graph turns out to be exactly the pseudoline arrangement for a certain reduced word for the longest permutation used in [2]. It allows us to compare our approach to the theory of the electrical varieties for these networks to the theory of the Lusztig varieties discovering all the features we listed above with the appropriate modification.
• the solution of the Local Yang-Baxter equation coming out of the Ohm law is in fact the deformation of the Lusztig solution • the matrices M B belong to the symplectic group and are the deformation of the unipotent upper triangular matrices • for n even the partition function M B gives an embedding of the variety T to the symplectic group Sp(n) • the Temperley-Lieb algebra T L(0) at a root of unity of which the nil Temperley-Lieb algebra is a degeneration • the "Plücker coordinates" will be constructed making the algebra of functions of the variety T a cluster like algebra which is the deformation of the cluster algebra of functions on the Lusztig variety • the discrete Toda system analog naturally acts on the electrical variety defined by the rectangular lattice and the standard graphs.
Concluding the introduction we will point out two things. Firstly, almost all of the items on the list above also appeared in the work [3], [9], [10]. However the connection of them to our work needs to be clarified. Secondly, a different statistical model approach to the electrical varieties via the dimer models was developed and the cluster algebra structure on the electrical varieties was introduced in [13] and [14]. Our statistical model is an integrable model of the vertex type and we use its specific properties to derive the features listed above. Combining all these points of view and establishing the precise relationship between them should be an interesting task, we hope to return to it later.
The paper is organized as follows: the sections 1 and 2 serve to introduce the definition of the electrical variety and the notion of the vertex statistical model. The major results of the paper are situated in the sections 3 and 4. Part of the material in the sections 5 and 6 will be known to experts. We included it as an illustration of our point of view on the idea that the electrical varieties are the deformation of the Lusztig varieties.
Acknowledgements. The authors are grateful to Arkady Berenstein, Azat Gainutdinov, Michael Gekhtman, Gleb Koshevoy and Vladimir Roubtsov for generously sharing knowledge and ideas and to Thomas Lam and Pavlo Pylavskyy who read the first draft of the paper and made a number of critical but helpful remarks and comments.
The work of V.G. was carried out within the HSE University Basic Research Program and funded (jointly) by the Russian Academic Excellence Project '5-100'.
The work of D.T. was carried out within the framework of the State Program of the Ministry of Education and Science of the Russian Federation, project No. 1.13560.2019/13.1, and was also partially supported by the RFBR grant 17-01-00366 A. D.T. is grateful for the Thélème atmosphere of the IHES where the part of this work was done.

The definition of the electrical variety
The definition of electrical variety has appeared already in [13], [11], and [3], so we just recall it here.
Suppose we are given a pair (Γ, γ), where Γ is a connected graph, a subset of its vertices is labelled as the boundary vertices or nodes, the rest are forming the set of the interior vertices and γ is a function from the set E(Γ) of edges of Γ to real numbers. It defines an electrical network with the conductivity function γ on Γ if γ takes positive values. Let us denote by N(Γ) the set of graphs which can be obtained out of Γ by applying the local star-triangular transformation or its inverse which are pictured below: For a graph Γ obtained from Γ by such a transformation and a function γ on the set of edges of Γ define a function γ on the edges of Γ as follows: the value of γ on all the edges is the same as the value of γ except for the new edges a 1 , a 2 , a 3 which replace the edges a 1 , a 2 , a 3 where Definition 2.1. We will say that (Γ , γ ) and (Γ, γ) are related by the startriangular mutation.
Definition 2.2. The electrical variety T associated with the pair (Γ is a collection of charts {t k ∼ = (C * ) m } labelled by the elements of the set N(Γ). Two points γ and γ in the charts labelled by Γ and Γ are glued together by the above maps if the pairs (Γ, γ) and (Γ , γ) are related by the star-triangular mutation. Definition 2.3. Suppose (Γ, γ) is a connected electrical network, with n boundary vertices numbered v 1 , ..., v n . The Kirchhoff matrix K = K(Γ, γ) is the n×n matrix constructed as follows.
• If i = j then K ij = − γ(e), where the sum is taken over all edges e joining v i and v j . If there is no edge joining v i to v j , then K ij = 0 where the sum is taken over all edges e with one endpoint at v i and the other endpoint not v i .
The Schur complement M R (Γ, γ) in the Kirchhoff matrix associated with pair (Γ, γ) to the submatrix of the interior vertices of Γ is called the response matrix [1]. Its role in the theory of electrical networks is described in the introduction. If it does not lead to confusion we will denote the response matrix simply by M R . Note that due to the properties of the Schur complement the matrix M R is singular because the Kirchhoff matrix is singular.
The response matrix has many remarkable properties. The following will be especially important for us Proposition 2.4. The matrix M R does not change under star-triangular mutations of the pair (Γ, γ) and therefore it defines a function on T with values in matrices.

Electrical varieties as vertex statistical models
3.1. Vertex statistical models. The definition below is the usual definition from statistical mechanics adapted to our situation. Definition 3.1. By a vertex statistical model, the vertex model for short, we mean a pair (N, X), where N is a finite directed graph without directed cycles and multiple edges situated in the disk whose set of vertices V is divided into two subsets, the interior vertices V 0 and the boundary vertices V 1 , and X is a collection of 2 × 2 matrix X a with the coefficients in some ring, one for each interior vertex a ∈ V 0 . The boundary and the interior vertices are situated on the boundary and in the interior of the disk respectively. The boundary vertices have the degree one and the interior vertices have degree 4. We assume also that each interior vertex to have in-degree 2 and out-degree 2, and the incoming edges and the outgoing edges are adjacent, as shown in the figure 2. For each cross as above there are four ways a path can traverse through the vertex: N S, N E, and W S, W E, then the rows of the matrix X a can be viewed as the weights of these paths through it.
Since the graph is directed the boundary vertices are naturally divided into the sources and the sinks. We will offer now a different way of calculating the matrix M B which shows that this matrix is indeed a boundary partition function of a vertex statistical model. Let us call a strand a path which goes through the vertex from the North to the South or from the West to the East. Let us enumerate all the strands of the graph N . Then to each vertex a which is the intersection of say the i-th and the j-th strands we assign a block matrix (X a ) ij which is the identity matrix except the submatrix with i-th and j-th rows and columns which is X a .
Since the graph N does not have directed cycles there is a natural partial order on the vertices: a > b if there is an oriented edge connecting b to a. Consider the product of the matrices (X a ) ij (over the ordered set of vertices) in which the order of the factors agrees with the order of the vertices who label the factors Proof. Although this statement is well known we propose here our interpretation a proof of it.
First, note that from the construction of the matrices (X a ) ij it is clear that if two vertices a and b are not comparable in the partial order then the matrices (X a ) ij and (X b ) kl commute, hence the matrix M is well defined. Now consider the sum of the weights of the paths going from a source vertex to a sink vertex. The matrix elements of (X a ) ij define the weights of all the ways a path can travel along the strands intersecting at a. At each point there are four such ways as the figure 2 shows and we will identify them with the matrix elements of (X a ) ij as follows before (3.1) It is clear now that to each such path we can find a unique summand in the expression of the appropriate matrix element of M .
We can perform the following local transformation on our vertex model. It changes the graph N as follows: Suppose also that we find three matrices (X a ), (X b ), (X c ) such that the following Local Yang-Baxter equation holds: The upper indices as usual show the pairs of indices in C n the appropriate operator acts on. Our transformation replaces the matrices X a , X b , X c in the set X by the primed matrices X a , X b , X c . The rest of the network data remains unchanged.  Proof. This is obvious due to lemma 3.3. Indeed, the products of the local vertex matrices for both vertex models coincide as a consequence of the local Yang-Baxter equation.

3.2.
Directed graph associated to electrical network. We will show now how to associate a vertex model in the above sense to an electrical network. First we will define a directed graph (naturally) related to an electrical network.
Suppose Γ is a planar graph with no loops, with n nodes; Γ is embedded in the plane so that the nodes v 1 , v 2 , ..., v n are in clockwise order around a circle C and the rest of Γ is in the disc D bounded by C.
Recall the construction of the medial graph Γ M of Γ. It depends on the embedding of Γ in the disc. For each edge e of Γ let m e be its midpoint. Place 2n points t 1 , t 2 , ...t 2n on C so that: The vertices of Γ M are the points m e for all edges e in Γ and the points t i for i = 1, 2, ..., 2n.
If e and f are edges in Γ with a common vertex, and which are incident to the same face, the interval joining m e and m f will be an edge in Γ M . For each point t j on the boundary circle, there is one edge as follows: the point t 2i is joined by an edge to m e where e is the edge whose endpoint is v i which comes first after the line v i t 2i in clockwise order around v i ; the point t 2i−1 is joined by an edge to m f where f is the edge whose endpoint is v i which comes first after the line v i t 2i−1 in counter-clockwise order around v i as shown on the picture 4.
As it is true for any medial graph the interior vertices of Γ M are of degree 4. The strand, as in section 3.1, is a path in Γ M which connects two nodes of Γ M and goes straight through any interior vertex. This defines a perfect matching on the set of nodes of Γ M and an orientation on any strand as well. Indeed each strand has the endpoints labelled by the unique pair of distinct numbers between 1 and 2n. We will think of this pair as defining the direction going The conductivity function γ on the edges of Γ translates into a function on the vertices of Γ M , which we denote by the same letter γ.
The graph Γ M has an important additional structure: its vertices are naturally coloured by one of two colours, the black or the white. If the vertex belongs to an edge of Γ then the line this edge belongs to breaks the strands which intersect in the vertex in two possible ways: either the sources of the strands sit in different half planes bounded by that line or in the same. In the first case we colour the vertex black and in the second white, see figure 4.
3.3. The Ohm-Yang-Baxter operator. The next step in the construction of the vertex model is to define the set of matrices X labelled by the vertices of the graph M Γ which solve the Local Yang-Baxter equation. This will be done using the major feature of electrical networks, the Ohm law.
The graph Γ M is a directed graph whose internal vertices are identified with the edges of Γ. The conductivity function γ therefore is a function on the set of the vertices of Γ M .
Recall that the vertices of Γ M are coloured either by the black or by the white colour. We will describe the two types of variables one can attach to the vertices of Γ M so that the Ohm law will produce linear operators acting on these sets of variables.
Consider a white vertex in Γ M as the pictures below show.
For such a vertex we define the set of edge variables by the equations Rewrite the Ohm law in these variables: This equation together with the identity which depends of the parameter R. For black vertices we define the set of together with the identity which depends on the parameter R as well. These operators are related as follows We have the following theorem Theorem 3.6. The operator φ(r) satisfies the following local Yang-Baxter equation.
where φ ij is a 3 × 3 diagonal block matrix those ij-block is φ and the rest is 1 and Proof. The author of [15] gives a list of the solutions to the Local Yang-Baxter equation in dimension two. One on the list is the operator φ.
The following is the key statement for our approach to the theory of electrical networks.
Corollary 3.7. The operator φ solves the following form of the Local Yang-Baxter equation where the parameters R i and R i , i = 1, 2, 3 are related by the identity: Proof. Trivial check.
3.4. Vertex model of electrical network. Now we are ready to summarize our construction.
Definition 3.8. For an electrical network (Γ, γ) define the vertex model associated to it as (Γ M , X) where the set of matrices X is made of the operators ψ(γ(v)) if the vertex v is white and the operators φ(γ(v)) if the vertex v is black.
Example 3.9. In the picture 4 the sources are the nodes labelled 1, 2, 3, 5, 7, the rest of the nodes are the sinks. The internal vertices are coloured in white or black, indicating whether we use the operator ψ or φ to calculate the weights of paths through the internal vertices.
We can introduce as before the set of all vertex models N(Γ M , X) obtained out of (Γ M , X) by the Yang-Baxter mutations, except in addition the Yang-Baxter transformation should turn the black vertices into white ones and vice versa.
Putting together all the pieces we have the following Proof. This is the direct consequence of the fact that φ and ψ solve the local Yang-Baxter equation 3.7.

Electrical varieties of standard graphs
In the section we will study the electrical variety defined by an important set of graphs, the standard graphs, introduced in [1]. Their importance is due to the fact that the inverse problem of recovering the conductivities from the response matrix can be solved by the explicit algorithm [1]. For the electrical variety defined by the standard graph the partition function M B has a number of remarkable properties. We will state and prove them in this section.

Standard graphs.
The standard graph is defined in [1] and is denoted by Σ n . The first few of them are figured in 7 below.

4.2.
The connection between M R and M B . Consider the graph Σ n . Here we will prove one of our main results that for any electrical network on Σ n the response matrix M R can be recovered from the boundary partition function M B and visa-versa.
Recall that M R is a symmetric matrix for which the sum of the entries in each row is zero. On the other hand it is easy to see from the construction of the matrix M B that the sum of the entries in each row and each column equal to 1.
First we will describe the connection between the vector of the currents I = (I 1 , ..., I n ), the vector of the potentials U = (U 1 , ..., U n ) and the vector of our new face variables J = (J 1 , ..., J n ) which follows from the Ohm law and the Kirchhoff law.
Introduce the matrix S n of the size n × n Observe that the matrix S n has the partial left inversẽ Introduce also the shuffle matrix T 2n of the size 2n × 2n which moves the components U of the vector (J, U ) through the components J putting U i in front of J i for all 1 ≤ i ≤ n. (4.9) The labelling of the input and the output vertices in the medial graph of Σ n is given as follows. The first n components of the vector label the inputs and the other n components label the outputs.
The picture 9 illustrates it for n = 2. The variables I, J, and U are connected   where Id is the identity matrix of the size n × n.
The above leads to the key observation Proof. The proof is obvious since both matrices when considered as linear operators have the same kernel. Since the matrix S n has the partial left inversẽ S n and the matrix M R is singular, the rank of the matrix W 1 is equal to n − 1 and hence this matrix defines a point in G(n − 1, 2n) as claimed. This says of course that the rank of the matrix W 2 must be n − 1. Indeed although the matrix M B is non-degenerate as we pointed out above, the sum of the entries in each column of M B is equal to 1, hence the matrix (M B , Id n )S 2n has the rank less than n. But then it must be equal to n − 1 to match the rank of W 1 .
Let Id 0 be the (n − 1) × n matrix obtained out of the identity matrix Id n by crossing out the last row and Id 1 be the 2n × 2n − 1 matrix obtained out of the identity matrix Id 2n by crossing out the last column. Denote by M 0 the left n − 1 × n − 1 submatrix of the matrix Id 0 W 2 and denote by M 1 the right n − 1 × n − 1 submatrix of the matrix Id 0 W 1 T 2nS2n Id 1 .
Theorem 4.6. The matrix Id 0Sn M R is the right (n − 1) × n (block) submatrix of the matrix Proof. Multiplying W 1 byS n on the left and crossing out the last row we get the matrix on the form (Id n−1 , −1,M R ), where −1 is the (n − 1) dimensional column vector whose components are all equal to −1. Therefore by 4.5 the M 0 is invertible and the first statement of the theorem follows.
The group GL(2n) action on the vector space C 2n induces the action of GL(2n) on G(n − 1, 2n). Therefore the matrices W 1 T 2nS2n and W 2 S 2nS2n still represent the same point in G(n − 1, 2n). The matrix Id 0 W 2 S 2nS2n has the form (Id 0 M B , Id n−1 , −2), where −2 is the (n − 1) dimensional column vector with all the components equal to −2. Again by 4.5 M 1 is invertible and the statement follows.
We finish this subsection with a couple of remarks.
Remark 4.7. Our theorem should be helpful for calculating the response matrix. Being the Schur complement the response matrix requires inverting (n(n − 1)/2) × (n(n − 1)/2) matrix. The above theorem says one needs to invert the (n − 1) × (n − 1) matrix M J B,0 to calculate the response matrix.
Remark 4.8. According to [1] the response matrix of an electrical network has some interesting positivity properties. Namely all the so called circular minors have the same sign. The results we have presented in this section suggest that the boundary partition function associated to an electric network also has some special positivity properties. We plan to study this in a future publication.
The appearance of the Grassmanian G(n − 1, 2n) we saw above should be compared to the way it appears in [11]. This could lead to identifying precisely the place of our complete electrical invariant M B in the earlier work on the electrical varieties.

Symplectic group and Temperley-Lieb algebra.
Recall that the boundary partition function M B is the product of the operators φ(r), the solutions for the local Yang-Baxter equation. The matrix M B for the standard graph Σ 2 4.2 for example is the following product For the graph Σ k , k > 2 the matrix M B takes the form where the product is over the pairs (ij) such that i < j and the order of the factors is defined by the lexicographic order on the pairs (ij).
To make connection with the Lusztig varieties it is convenient to consider the alternative version for the boundary partition function. There are two forms of the Yang-Baxter equation and P is the permutation operator.
Introduce the operatorsφ ij = P ij φ ij and define as before the product over the pairs (ij) in the lexicographic order. Moving all the permutation operators to the left we obtain Define the matrixM B by the following formulǎ ).
which is symplectic for even n.
Proof. The operatorφ i i+1 (r) belongs to the symplectic group Sp(n) for 1 ≤ i ≤ n − 1 and even n:φ The form Ω n and the operator φ i i+1 (r) are given by the following matrices: where e ij is the matrix unit and e i is the standard basis vector. It is clear that: Ω n a j = −(e j + e j+1 )(e j + e j+1 ) T ; a T j Ω n = (e j + e j+1 )(e j + e j+1 ) T ; a T j Ω n a j = 0. ThereforeM T B Ω nMB = Ω n . (4.20) After change of the basis form Ω n will be given by the matrix which is known to be symplectic for even n.
Remark 4.12. The proof above works for any electrical network with the even number of nodes n, in other words the partition function of any such a vertex model belongs to the symplectic group Sp(n).
When n is odd the partition function M B also has interesting properties, namely its determinant is equal to 1, hence it belongs to the group Sl(n), and the sum of the matrix elements in every columns is equal to 1 as we already have mentioned.
Recall that the operatorφ(r) satisfies the following form of the local Yang-Baxter equation.
Define the Temperley-Lieb algebra with coefficients in the polynomial ring r := C[r 1 , ..., r m ] as T L(0) ⊗ C r. We will be denoting it by the same letter T L(0). where Remark 4.14. The Lusztig solution to the Local Yang-Baxter equation used in [2] is related in the same way to the nil-Temperley-Lieb algebra, a degeneration of our Temperley-Lieb algebra.
Remark 4.15. It turns out that the representation of the Temperley-Lieb algebra T L(0) at a root of unity q = i related to the Ohm-Yang-Baxter operator φ appears in the studying of the XXZ model in statistical physics [16]. The explicit formula for the generators u i of T L(0) in terms of the symplectic algebra generators is given in [16] 6.11, 6.12.
Remark 4.16. The results in this section should be compared to the electrical Lie group defined in [3].

4.4.
The solution of the inverse problem. As we mentioned earlier the inverse problem for an electrical network Γ, γ is recovering the values of the conductivity function from the known response matrix M R . It can not be solved in general, however in the case when Γ is the standard graph there is an explicit algorithm which solves it [1]. The algorithm is based on the boundary properties of discrete harmonic functions. In our picture the boundary partition function plays the role of the response matrix and the inverse problem for it is a an interesting task. Finding the solution of the inverse problem for the Lusztig varieties was an important achievement in [2].
We present here a simple algorithm for finding the values of the function γ out of the matrix M B for an electrical network defined on standard graph Σ n : Let the interior vertex v ij be the intersection of the strands started at the sources labelled i and j, i < j. By the way we label the boundary vertices, these strands arrive to the sinks labelled n − i + 1 and n − j + 1 respectively see figure (8). There is only one path connecting the boundary vertices labeled j and n − i + 1 which contains the vertex v ij , it is the path which runs along these two strands only. The rest of the paths which connect these two vertices must be strictly on the right of it as the figure (8) shows. Therefore in the sum which calculates the matrix entry (M B ) j,n−i+1 3.1 there is only one summand which contains the factor γ(v ij ), the rest will be monomials in γ(v kl ) with either j < k or n − i + 1 < l or both. This provides the step of the induction. Since (M B ) nn = 1 − γ(v nn ) we obtain the algorithm.
The result of the previous sections together with the above algorithm allow to prove

Electrical varieties as deformation of Lusztig varieties
In this section we will present several properties of the electrical varieties which show that the theory of the electrical varieties is an interesting deformation of the theory of the Lusztig varieties. For this we introduce a slight modification of the electrical variety defined by the standard graph. We simply ignore the colours on the vertices of the graph Γ M and use the collection X of matrices made out of the operatorsφ(r) defined earlier 4.3. We will denote the resulting variety L 1 . It is in fact isomorphic to T, but it is more convenient for studying the connection to the variety L.
5.1. The boundary partition functions for the Lusztig and the electrical varieties. To put the electrical varieties and the Lusztig varieties on the same footing we will present the latter as a vertex integrable statistical model. In this language the Lusztig variety is a pair (Σ M n , X), with the collection of matrices X made out of the operators The operator ϕ L (t) satisfies the following local Yang-Baxter equation.
Remark 5.1. Since we use the operatorsφ(r) and ϕ L (t) we must reverse the order of the sinks of the graph Σ M n as opposed to our earlier convention, see 4.10.
As such this variety is a vertex model in our definition and it has the boundary partition function. It is represented by an upper triangular unipotent matrix as it should be according to [2].
whenever J is a chamber set for h and the product is over all k such that i ∈ J, j ∈ J.
Proof. The first statement is proved by a direct calculation.
As for the second statement, the proof from [2] uses only the following property of the transition functions: if two charts are related by the elementary transformation t i , t j , t k → t i , t j , t k then t i t j = t k t j and t k t j = t i t j . This holds for the transition maps of the electrical variety 4.22 as well.
Example 5.7. For the electrical variety associated to the same graph Σ M 2 the Chamber Ansatz formulas are the same as for the Lusztig variety but the 3-term relation deforms to the 4-term relation: This theorem suggests that the theory of the electrical varieties may provide a non-trivial deformation of the cluster algebra structure introduced in [4].
In the case of the Lusztig variety the variables M L have a nice interpretation as the minors of a matrix closely related to the partition function of the Lusztig variety [2]. The interpretation of these variables in the case of the electrical variety is not known at the moment as far as we understand, however the theorem 5.1 maybe be helpful in finding it. We plan to study it in a future publication.

Discrete integrable dynamics of electrical varieties
It is natural to study the transformations of the electrical varieties for which the behaviour of the response matrix is under control. The list of such is known (see for example [8]). The most interesting for us are the star-triangle transformation and the transformation adjoining an edge to the graph. In terms of the medial graph this is equivalent to the (local) Yang-Baxter transformation and the transformation of adding a crossing to the medial graph.
6.1. General scheme. There is a class of discrete systems of the Toda type related to the Lusztig variety. These were considered for example in [17] and are related to the box-ball system, the Painlevé IV equation and many other dynamical systems. The machinery of the electrical varieties offers a natural generalization of these. We consider the discrete system produced by commuting actions of a pair of the symmetric groups each defined by the above transformations of the electrical variety. This system was elaborated in a series of papers summarized by [18]. We include our calculations here to demonstrate the similarity with the result of [17]. These actions are the deformations of the actions studied in [17] and in the appropriate limit recover the action considered in [17], see also [19], [20].
Consider the graph whose medial graph is a ladder made out of two horizontal lines and a bunch of vertical lines as in the picture below. Following [19] add a crossing to this graph with the operator φ(t) attached to the new vertex as shown on the figure 11.   The transformation of the resistances is given by: and µ = (x 1 + y 2 + x 1 y 2 (x 2 + y 1 ))/(x 2 + y 1 + x 2 y 1 (x 1 + y 2 )).

6.2.
Stable point. Let us analyze the general rectangular case. We consider the composition of several star-triangle transformation of the form The important observation is that the transformation T x,y : t → t is a Mobius transformation of hyperbolic type with t = 0 a stable point . The composition of such transformations is of the same type, it is defined by a triangular matrix, hence for generic choice of parameters it has two stable points. One of the stable points is 0. We are interested in the second stable point t({x 1 , . . . , x n }, {y 1 , . . . , y n }).

Let us introduce the matrix of the corresponding affine transformation
A(x, y) = Ç x 0 1 + xy y å . (6.24) The stable points of the transformation T x,y are in one-to-one correspondence with the eigenvectors of the matrix given by the product In projective coordinates u i /v i = t i the transformation t i → t i+1 takes the form Hence we obtain the formula where t is from equation 6.26. Such expressions define the transformation on X, Y Let us work out the formula for t i The expression P (i+1) is in fact a polynomial: We can now define the transformations r j which act on the j−th and (j+1)−th rows of a rectangular lattice transforming the parameters in these nodes x j,i and x j+1,i by the formulas: r j (x j,i ) = x j+1,i P j,i P j,i+1 ; r j (x j+1,i ) = x j,i P j,i+1 P j,i ; r j (x k,i ) = x k,i if k = j, j + 1; In these formulas we always suppose the cyclic indices x j+m,i = x j,i+n = x j,i . In fact, P j,i = P (i+1) (x j , x j+1 ).
In a similar way one could define the action on the pairs of columns. Let us denote these transformations by s i . In terms of the vertex representation for the electric network one obtains quite a simple theorem: Theorem 6.4. The transformations {r i } and {s j } define the actions of the symmetric groups S m and S n , moreover these actions commute with each other. Remark 6.5. Making the substitution x i = εξ i , y i = εζ i and passing to the limit ε → 0 we recover the situation studied in [17]. Remark 6.6. It can be shown as well that the maps similar to r i act on the electrical variety corresponding to the standard graph as the figure 14 illustrates. We have indicated already a number of ways the results of this paper could be extended. Now we want to suggest a few areas of possible applications of our approach to studying the electrical varieties.
There is a natural connection between electrical networks and so called reversible Markov chains. An example of such a chain is the symmetric graph random walk which, in each step, jumps to a randomly chosen graph neighbour at equal probability. This connection is studied in a number of papers and books see [?]. Interpreting the mathematical structures we have found in this paper in the setup of the Markov chains might be an interesting task.
There is a very intrinsic relationship between the theory of the electrical networks, the Ising model, the dimer model and the Hopfield neural network model. Just like the random walk model plays the role of the relaxation procedure for the potential distribution problem of the electric network, the dynamics of the Boltzmann machine does the same for the network with not necessarily positive conductivities. We hope that there are similar generalized cluster algebra structures on varieties of neural networks and Ising non homogeneous models.
The theory of electrical networks is a part of discrete harmonic analysis. The methods of the theory of the vertex integrable statistical models we introduced in this paper may therefore find applications in discrete harmonic analysis as well.
The challenging problem is to find the interpretation of the Lusztig-type varieties for the trigonometric solutions for the Zamolodchikov equation from [15].