312025/23: Tori in the state space of a spin glass

31.1Problem

In a recent article, Kondor and Papp (https://arxiv.org/abs/2412.13580) has found that the first and second excited states of an 8 spin Sherrington–Kirkpatrick spin glass model are positioned on the surface of a torus (Fig. 10 in the article). Ignoring the energy values (not requiring that they are first or second excited states), determine if torus topologies with other size are present in this system or not. Generalize the result for an \(N\) spin system and provide an algorithm that find the tori.

(István Csabai)

31.2Explanation

The states of \(N\) spins are the \(2^N\) corners of an \(N\)-dimensional cube, and two states are neighbors when they differ by the flip of one spin. Kondor and Papp found a set of 60 states of 8 spins in which every state has exactly four neighbors inside the set, and these neighbor relations form a \(6\times 10\) square grid that closes on itself in both directions, which is a torus. The energy only served to select this set. Without the energy, the question is about the cube alone: for which \(a\) and \(b\) does the \(N\)-dimensional cube contain a set of states whose neighbor relations form exactly an \(a\times b\) grid on a torus, and how can we find such sets?

31.3Theory

Spins and the SK model. A spin here is a variable \(s_i\) that takes the values \(+1\) (up) and \(-1\) (down), a simplified model of a magnetic atom. A spin glass is a set of spins whose pairwise interactions have random signs: some pairs prefer to be parallel, others antiparallel. In the Sherrington–Kirkpatrick (SK) model [19] every pair of the \(N\) spins interacts, and the energy of a configuration \(\vv s = (s_1, \dots, s_N)\) is

\[ H(\vv s) = -\sum_{i<j} J_{ij}\, s_i s_j . \]

A positive \(J_{ij}\) lowers the energy when spins \(i\) and \(j\) are parallel, a negative one when they are antiparallel. Kondor and Papp [18] take each \(J_{ij}\) to be \(+1\) or \(-1\). In general no configuration can satisfy all pairs at once (for three spins with \(J_{12} = J_{23} = J_{13} = -1\), at most two of the three pairs can be antiparallel), so the lowest energy is reached by many different configurations, and the low-energy states form a complicated pattern.

The hypercube. A configuration of \(N\) spins is a list of \(N\) signs. For \(N = 2\) the four configurations are the corners of a square, for \(N = 3\) the eight configurations are the corners of a cube, and in general they are the \(2^N\) corners of the \(N\)-dimensional cube, the hypercube \(Q_N\). Two corners are joined by an edge of the cube when they differ in exactly one coordinate, that is when one configuration is obtained from the other by flipping one spin. We call the index of that spin the label of the edge. Every corner has \(N\) edges, one for each spin. Kondor and Papp study the energy landscape, which is this network of states with the energy written at each state; a group of states whose neighbors outside the group all have higher energy is a local minimum, a valley from which a single spin flip cannot escape downhill.

Graphs. A network of points (vertices) and connections (edges) is called a graph. For a set \(S\) of vertices of \(Q_N\), the induced subgraph on \(S\) consists of \(S\) and every edge of \(Q_N\) whose two ends are both in \(S\); we may not leave out any such edge. The cycle \(C_L\) is \(L\) vertices joined in a ring. The torus grid \(C_a\times C_b\) has the vertices \((i,j)\), with \(i = 0, \dots, a-1\) and \(j = 0, \dots, b-1\), and each vertex is joined to its four neighbors \((i\pm 1, j)\) and \((i, j\pm 1)\), where \(i\) is counted modulo \(a\) and \(j\) modulo \(b\). Drawn on paper it is a rectangular grid whose right edge is glued to its left edge and whose top edge is glued to its bottom edge, which is the surface of a doughnut (left panel of Figure 59). A coil in \(Q_m\) is a cycle of \(Q_m\) whose induced subgraph is the cycle itself: no two vertices of the cycle that are not consecutive on it are neighbors in the cube. Coils are studied in coding theory under the name coil-in-the-box codes [20].

The precise question. The cluster in the paper is isolated: each of its 60 states has 4 neighbors inside the cluster, and its other 4 neighbors are outside. So the torus is the induced subgraph on the 60 states, and the question becomes: for which \(a\), \(b\) and \(N\) does \(Q_N\) contain a set of vertices whose induced subgraph is \(C_a\times C_b\)?

31.4Solutions

31.4.1The edge labels

Step 1: squares. Along a path in the cube, each edge flips one spin. A closed path returns to its starting state only if every spin has been flipped an even number of times. A 4-cycle visits 4 different states, so it cannot flip the same spin twice in a row (that would return to the previous state), and its labels must therefore be \(i, j, i, j\) with \(i \neq j\). Hence opposite edges of every square in \(Q_N\) have the same label.

Step 2: ladders. Look at the torus grid. The horizontal edges between column \(i\) and column \(i+1\) form a ring of rungs around the torus, like a closed ladder, and two consecutive rungs are opposite edges of a square. By Step 1 all of them have the same label, which we call \(h_i\). In the same way all vertical edges between row \(j\) and row \(j+1\) have one label, \(v_j\). The whole torus is therefore described by two sequences of labels, \(h_1,\dots,h_a\) and \(v_1,\dots,v_b\) (Figure 59).

Step 3: the labels separate. A horizontal label cannot equal a vertical one. If \(h_i = v_j\), the square at column \(i\) and row \(j\) would have four equal labels and would flip the same spin twice in a row, which is impossible by Step 1. So the set \(H\) of spins flipped by horizontal edges and the set \(V\) of spins flipped by vertical edges have no common element.

Step 4: the torus is a product. Let \(\vv s_0\) be the state at the grid point \((0,0)\). The state at \((i,j)\) is reached by flipping the spins \(h_1,\dots,h_i\) and then \(v_1,\dots,v_j\). The first group changes only spins in \(H\), the second only spins in \(V\). Therefore the spins in \(H\) of the state at \((i,j)\) depend only on \(i\), the spins in \(V\) depend only on \(j\), and all other spins are as in \(\vv s_0\). Going once around horizontally traces a closed path \(A\) in the smaller cube formed by the spins in \(H\), and going around vertically traces a closed path \(B\) in the cube formed by the spins in \(V\). The torus consists of all combinations of a state of \(A\) with a state of \(B\). This has two consequences. The \(ab\) grid points are \(ab\) different states only if \(A\) has \(a\) different states and \(B\) has \(b\), so \(A\) and \(B\) are cycles. And the induced subgraph has no edges beyond the grid only if \(A\) and \(B\) are coils: an edge with a label in \(H\) joins two states with the same spins in \(V\), hence in the same row, and it is an extra edge exactly when it joins two non-consecutive states of \(A\). Conversely, if \(A\) is a coil in the spins \(H\) and \(B\) is a coil in different spins \(V\), the set of their combinations is an induced torus grid. We have proved:

\(Q_N\) contains \(C_a\times C_b\) as an induced subgraph exactly when the spins can be divided into two disjoint groups \(H\) and \(V\), of sizes \(|H| + |V| \le N\), such that the cube of the spins in \(H\) contains a coil of length \(a\) and the cube of the spins in \(V\) contains a coil of length \(b\).

Figure 59
Figure 59: Left: the \(6\times 10\) torus grid of Kondor and Papp, with periodic boundaries (dotted). The number next to each column or row of edges is the spin flipped along all of them. The horizontal labels \(1,2,3,1,2,3\) form a hexagon in the spins 1 to 3, and the vertical labels \(4,5,6,4,7,5,8,6,7,8\) form a coil of length 10 in the spins 4 to 8, so this torus uses all 8 spins. Right: the hexagon in the cube \(Q_3\). It passes through the six corners other than \(000\) and \(111\), and no two of its non-consecutive corners are neighbors.

Step 5: which coils exist. A closed path flips each spin an even number of times, so every cycle in a cube has even length. The shortest coil is the square, \(L = 4\), which needs 2 spins. The hexagon of Figure 59 is a coil of length 6 in \(Q_3\). Let \(d(L)\) be the smallest number of spins for which a coil of length \(L\) exists. The longest coils in \(Q_m\) have the lengths 4, 6, 8, 14, 26, 48 and 96 for \(m = 2, \dots, 8\); the last two values were established by large computer searches [21]. We checked by an exhaustive computer search, described in Section 31.4.3, that for each \(m \le 6\) coils of every even length up to the maximum exist, and for \(m = 7\) we found coils of every even length from 28 to 46. This gives

\[ d(4) = 2,\quad d(6) = 3,\quad d(8) = 4,\quad d(L) = 5 \text{ for } 10 \le L \le 14,\quad d(L) = 6 \text{ for } 16 \le L \le 26 , \]

and \(d(L) = 7\) for \(28 \le L \le 48\). Combined with Step 4: \(C_a\times C_b\) occurs as an induced subgraph of \(Q_N\) exactly when \(d(a) + d(b) \le N\).

Step 6: the answer for \(N = 8\). The torus of the paper has \(d(6) + d(10) = 3 + 5 = 8\), so it needs all eight spins and cannot occur with fewer, which agrees with its first appearance at \(N = 8\) in the paper. Its horizontal cycle is a hexagon in three spins, and its vertical cycle is a coil of length 10 in the other five (Figure 59). There are many such tori: choosing the three spins of the hexagon (56 ways), one of the 4 hexagons of \(Q_3\), and one of the 12 096 coils of length 10 in \(Q_5\) gives \(56 \times 4 \times 12\,096 = 2\,709\,504\) different \(6\times 10\) tori in \(Q_8\). Other sizes occur as well. The condition \(d(a) + d(b) \le 8\) allows the 18 sizes

\[ 4\times b \ (b = 4, 6, \dots, 26), \qquad 6\times b\ (b = 6, 8, \dots, 14), \qquad 8\times 8, \]

with 16 to 104 states. The largest is \(4\times 26\), a square times a longest coil of \(Q_6\). Table 25 lists the sizes for smaller \(N\). Which of them appear as isolated clusters at a given energy depends on the couplings \(J_{ij}\), which the problem tells us to ignore.

Table 25: The torus grids that occur as induced subgraphs of the \(N\)-dimensional hypercube, from the condition \(d(a)+d(b)\le N\).
\(N\)induced torus grids \(C_a\times C_b\) in \(Q_N\) (\(a \le b\), \(b\) even)
1–3none
4\(4\times4\)
5\(4\times4\), \(4\times6\)
6\(4\times4\), \(4\times6\), \(4\times8\), \(6\times6\)
7\(4\times b\) for \(b = 4,\dots,14\); \(6\times6\), \(6\times8\)
8\(4\times b\) for \(b = 4,\dots,26\); \(6\times b\) for \(b = 6,\dots,14\); \(8\times8\)

General \(N\). For any \(N\), the tori of \(Q_N\) are the products of two coils in disjoint groups of spins, and the sizes that occur are those with \(d(a) + d(b) \le N\). For \(N < 4\) there are none. The smallest torus, \(4\times4\), is \(Q_4\) itself: the 4-dimensional cube is a product of two squares. A simple family of tori exists for every \(N \ge 4\): flipping the spins \(1, 2, \dots, p, 1, 2, \dots, p\) in turn gives a coil of length \(2p\) in \(Q_p\), so \(C_{2p}\times C_{2q}\) is an induced torus of \(Q_{p+q}\) for all \(p, q \ge 2\). The hexagon is the case \(p = 3\). The largest number of states on one torus in \(Q_N\) is the largest product \(c(p)\,c(N-p)\), where \(c(m)\) is the length of the longest coil in \(Q_m\). If we drop the requirement that the torus be induced, and allow extra neighbor pairs that are not edges of the grid, the coils can be replaced by any cycles, and much larger tori exist: two cycles through all 16 corners of \(Q_4\) give a \(16\times 16\) torus through all 256 states of \(Q_8\).

The same argument rules out two other surfaces built from squares with four squares at each corner. On a twisted torus, going once around vertically shifts the column index by some \(s\). Step 4 then requires the path \(A\) to repeat after \(s\) steps, so two different grid points would be the same state. On a Klein bottle, going once around reverses the direction of the columns, which requires \(A\) to be symmetric under reversal and again maps two grid points to the same state. Neither can occur in a hypercube.

31.4.2The Euler characteristic

The method of Section 31.4.1 used the special structure of the hypercube. A second method recognizes a torus in any set of states from its shape alone, and is useful for checking clusters found in a computer search. For a polyhedron with \(V\) vertices, \(E\) edges and \(F\) faces, Euler found that \(V - E + F = 2\); a cube has \(8 - 12 + 6 = 2\). The number \(\chi = V - E + F\), the Euler characteristic, is the same for every way of dividing a given surface into polygons, and it distinguishes surfaces: it is 2 for a sphere and 0 for a torus. For example, an \(a\times b\) torus grid has \(ab\) vertices, \(2ab\) edges and \(ab\) square faces, so \(\chi = 0\).

To apply this to a set \(S\) of states, take the induced subgraph on \(S\) and attach a square face to every 4-cycle. The result is a closed surface if every edge lies on exactly two faces and the faces around each vertex form a single ring. A closed surface is a torus exactly when \(\chi = 0\) and it is orientable, which means that a consistent direction of circulation can be chosen on all faces; we check this by choosing a direction on one face and passing it on to each neighboring face, so that the shared edge is traversed in opposite directions, and verifying that no face receives two contradictory directions. The Klein bottle also has \(\chi = 0\) and fails this test. For the cluster of the paper \(V = 60\), each vertex has 4 edges, so \(E = 60\cdot 4/2 = 120\), and each edge lies on 2 squares of 4 edges each, so \(F = 120\cdot 2/4 = 60\); hence \(\chi = 60 - 120 + 60 = 0\).

The method needs one precaution in the hypercube. If a cycle of the grid has length 4, as in \(C_4\times C_b\), that cycle is itself a square of \(Q_N\) and would be added as an extra face, so for such clusters we must decide which squares are faces before counting \(F\).

31.4.3Algorithms

All tori of \(Q_N\). (i) For each \(m \le N - 2\), list the coils of \(Q_m\) by a depth-first search. The search grows a path one state at a time. It may add a state that is a neighbor of the last state of the path and of no other state of the path, and it closes the path into a coil when the new state is a neighbor of both the last and the first state. When it reaches a dead end it steps back and tries the next possibility. The search can be made much faster by using the symmetry of the cube: it may always start at the state with all spins up, and whenever it flips a spin that has not been flipped before, it may take the lowest-numbered such spin. (ii) For every division of the spins into disjoint groups \(H\) and \(V\) and every pair of coils on them, form the product. By Step 4 this produces every torus exactly once. For \(N = 8\) only coils with \(m \le 6\) are needed, because the other factor uses at least two spins, and the search for them takes about two seconds in Python.

The tori in a given energy landscape. For given couplings \(J_{ij}\) and a selected set of energy levels: (i) compute the energy of all \(2^N\) states and keep the set \(S\) of states at the selected levels; (ii) build the induced subgraph on \(S\) and split it into connected pieces; (iii) keep the pieces in which every state has exactly 4 neighbors; (iv) for each such piece, take one state, try the three ways to split its four edge labels into two horizontal and two vertical ones, pass the split on along the ladders, and check that the piece is the product of a coil in the spins \(H\) and a coil in the spins \(V\). A piece that passes (iv) is a torus, and the method of Section 31.4.2 gives an independent check. For \(N = 8\) step (i) needs only \(2^8 = 256\) energy evaluations; the procedure remains practical up to about \(N = 30\), where storing the energies of all \(2^N\) states becomes the limit.

References

  • [18] I. Kondor and G. Papp. Energy landscapes of small SK spin glasses. arXiv:2412.13580, 2024.
  • [19] D. Sherrington and S. Kirkpatrick. Solvable model of a spin-glass. Physical Review Letters 35, 1792–1796, 1975.
  • [20] W. H. Kautz. Unit-distance error-checking codes. IRE Transactions on Electronic Computers EC-7, 179–180, 1958.
  • [21] P. R. J. Östergård and V. H. Pettersson. On the maximum length of coil-in-the-box codes in dimension 8. Discrete Applied Mathematics 179, 193–200, 2014.