← Eyal Merhavi · Labelings, models, and gauge theory
Chapter 5 of Labelings, models, and gauge theory, rendered from the executed notebook. Code cells and their outputs are shown as they ran.
Run this chapter in your browser ↗ · Source on GitHub ↗
Runs on JupyterLite. The first time, it downloads Python and its libraries (about 40 MB).
Chapter 5 — Layers and the transfer matrix: dynamics from a distribution
So far a model has been a single, static object: one probability distribution over whole labelings of a board. Nothing in it "happens". There is no before and after.
Now take a board shaped like a stack of rings: a cylinder. Cut it into its rings, one layer at a time, and ask a modest question: if I know the labels on one ring, what do I know about the next one? The answer turns out to be one matrix. Its eigenvalues are numbers you can also measure by sampling the model and watching how quickly two rings forget each other. And on the simplest boards, the ring's loop product does nothing more than a random walk on the group.
This chapter is the bridge of the course. On one side is "a model is a distribution". On the other side is a vector space with an operator acting on it, which physicists would recognize as a quantum system. We will build that operator from the distribution, never assume it.
What you'll learn
- How cutting a board into layers turns a model into a chain of matrix multiplications (the transfer matrix).
- Why, on a cylinder, the loop product of a layer performs a random walk on , and what the eigenvalues of that walk mean.
- How the same numbers come out of sampling the model as a black box: two roads to one number.
Prerequisites: chapters 1–4. From linear algebra: eigenvalues of symmetric matrices. From probability: Markov chains.
import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.linalg import circulant
from scipy.optimize import minimize_scalar
from scipy.special import ive
from lgt import *
from lgt import viz
from lgt.grid import GridModel
viz.use_style()
rng = np.random.default_rng(5)
5.1 Cutting a board into layers
Take a grid with columns and rows and wrap it around in both directions. Each row is now a ring of vertices. We call the rows layers , with layer indices taken mod , so layer is layer again (glossary 5.2).
Every edge is one of two kinds:
- a layer edge joins two vertices of the same layer (the edges going around a ring);
- a step edge joins a vertex of layer to the vertex above it in layer .
Every face is a square with two layer edges (one in layer , one in layer ) and two step edges. So the faces sit between consecutive layers, in a band we call a slab. A layer labeling (glossary 5.5) is the restriction of a labeling to the layer edges of one layer: an element .
If you ignore the wrap-around in the vertical direction, the board looks like a cylinder: rings stacked on top of each other, joined by step edges. Below, one layer is drawn in teal and the step edges above it in gold. (Time wraps around too, so the top ring is glued back to the bottom one.)
def draw_cylinder(ax, W, N, layer=2):
ang = 2 * np.pi * np.arange(W + 1) / W
for k in range(N):
c = viz.TEAL if k == layer else viz.INK
ax.plot(np.cos(ang), np.sin(ang), k, color=c, lw=3 if k == layer else 1.2)
ax.scatter(np.cos(ang[:W]), np.sin(ang[:W]), k, color=viz.INK, s=10)
if k < N - 1:
for x in range(W):
c = viz.GOLD if k == layer else viz.MUTED
ax.plot([np.cos(ang[x])] * 2, [np.sin(ang[x])] * 2, [k, k + 1], color=c,
lw=2.5 if k == layer else 0.8)
ax.set_box_aspect((1, 1, 1.4)); ax.set_axis_off()
fig = plt.figure(figsize=(5, 5.5))
draw_cylinder(fig.add_subplot(projection="3d"), W=8, N=6)
plt.show()
Each ring (black) is a layer; the vertical segments are step edges. The teal ring is layer 2, and the gold step edges lead from it to layer 3.
Symmetries. A symmetry of a board (glossary 5.1) is a bijection of the vertices that maps edges to edges and faces to faces. The total cost only looks at face products, so a symmetry of the board is automatically a symmetry of every model on it. Our board has two that matter:
- the shift moves every vertex up one layer, (glossary 5.3);
- the flip turns the stack upside down, (glossary 5.4).
Let's check both with a few lines of code, together with a bijection that is not a symmetry.
def is_symmetry(board, vmap):
edges = lambda m: sorted(tuple(sorted((m[s], m[t]))) for s, t in board.edges.tolist())
faces = lambda m: sorted(tuple(sorted({m[v] for v in board.walk_vertices(f)})) for f in board.faces)
ident = list(range(board.n_vertices))
return edges(vmap) == edges(ident) and faces(vmap) == faces(ident)
W, N = 4, 6
B = Board.grid(W, N, periodic=True) # vertex (x, k) has index x + W*k
vid = lambda x, k: (x % W) + W * (k % N)
shift = [vid(x, k + 1) for k in range(N) for x in range(W)]
flip = [vid(x, -k) for k in range(N) for x in range(W)]
twist = [vid(-x if k == 0 else x, k) for k in range(N) for x in range(W)] # mirror layer 0 only
print("shift:", is_symmetry(B, shift), " flip:", is_symmetry(B, flip), " twist:", is_symmetry(B, twist))
shift: True flip: True twist: False
Why do we care? Because of the shift, every slab looks exactly like every other slab. Whatever rule tells us how layer constrains layer , it is the same rule for every , just like a time-homogeneous Markov chain uses the same transition matrix at every step. The flip will give that rule a special shape (sections 5.4 and 5.6).
Recap. A layered board splits its vertices into layers . Layer edges stay inside a layer, step edges go from one layer to the next, and every face lives in the slab between two consecutive layers. The shift and the flip are symmetries of the board, hence of every model on it.
Check yourself
- On the torus, how many layer edges, step edges and faces are there in total?
Answer
layer edges ( per layer), step edges ( per slab) and faces ( per slab).
- Why is "mirror only layer 0" not a symmetry?
Answer
It keeps layer 0's ring intact, but the step edge from to is sent to a pair , , which is not an edge unless .
5.2 The transfer matrix
This section builds one matrix, , that contains the whole model on the stack. We get there in three small steps: a toy chain, one slab of our board, and then the matrix itself.
Warm-up: a sum over sequences is a matrix power
Forget boards for a moment. Suppose you have a finite set of states and a table of nonnegative weights , one for every ordered pair of states. Give a sequence of states the weight
If were a table of transition probabilities, this would be the probability of a path of a Markov chain. Here it is just a weight. Now fix the two ends and and add up the weights of all sequences in between. For this sum is
which is exactly the entry of the matrix product . By the same reasoning, summing over all the states in between, for sequences of length , gives the entry of the -th matrix power. This is the same fact you use when you compute -step probabilities of a Markov chain, or count walks of length in a graph with powers of its adjacency matrix.
One more twist. If the sequence is cyclic, meaning it must end where it started (), then adding up over as well gives , the trace . Let's check both statements by brute force on a two-state example.
K = np.array([[3.0, 1.0],
[1.0, 2.0]]) # weights between two states, called 0 and 1
t_len = 4
seqs = list(itertools.product([0, 1], repeat=t_len + 1))
open_sum = sum(np.prod([K[s[i], s[i + 1]] for i in range(t_len)]) for s in seqs if (s[0], s[-1]) == (0, 1))
cyclic = sum(np.prod([K[s[i], s[i + 1]] for i in range(t_len)]) for s in seqs if s[0] == s[-1])
Kt = np.linalg.matrix_power(K, t_len)
print(f"sequences 0 -> ... -> 1 of length 4: brute force {open_sum:.0f}, matrix power entry {Kt[0, 1]:.0f}")
print(f"cyclic sequences of length 4: brute force {cyclic:.0f}, trace of K^4 {np.trace(Kt):.0f}")
sequences 0 -> ... -> 1 of length 4: brute force 75, matrix power entry 75
cyclic sequences of length 4: brute force 175, trace of K^4 175
Matrix powers are a compact way to add up exponentially many products. Now we show that our model on the stack is a weighted sequence of this kind, with states = layer labelings.
One slab
Look at the slab between layer and layer of the torus. It contains:
- the layer edges of layer , carrying the layer labeling ;
- the layer edges of layer , carrying ;
- the step edges between them, carrying ;
- faces. Face is the square between columns and ; its four edges are , , and (with , since the ring closes).
Here is a slab with , unrolled flat, the dashed column being column 0 again.
def draw_slab(ax, W=3):
for x in range(W):
ax.annotate("", xy=(x + 1, 0), xytext=(x, 0), arrowprops=dict(arrowstyle="-|>", color=viz.TEAL, lw=2.2))
ax.annotate("", xy=(x + 1, 1), xytext=(x, 1), arrowprops=dict(arrowstyle="-|>", color=viz.CORAL, lw=2.2))
ax.annotate("", xy=(x, 1), xytext=(x, 0), arrowprops=dict(arrowstyle="-|>", color=viz.GOLD, lw=2.2))
ax.text(x + 0.5, -0.13, f"$a_{x}$", ha="center", va="top", fontsize=13, color=viz.TEAL)
ax.text(x + 0.5, 1.13, f"$b_{x}$", ha="center", va="bottom", fontsize=13, color=viz.CORAL)
ax.text(x - 0.07, 0.72, f"$s_{x}$", ha="right", va="center", fontsize=13, color=viz.GOLD)
ax.add_patch(plt.Rectangle((x + 0.08, 0.08), 0.84, 0.84, color=viz.PALE, zorder=0))
ax.text(x + 0.55, 0.35, f"face {x}", ha="center", va="center", fontsize=10, color=viz.MUTED)
ax.plot([W, W], [0, 1], ls="--", color=viz.GOLD, lw=2)
ax.text(W + 0.08, 0.5, "$s_0$ again", ha="left", va="center", fontsize=11, color=viz.GOLD)
ax.text(-0.9, 0.0, "layer $k$", ha="right", va="center", fontsize=11)
ax.text(-0.9, 1.0, "layer $k+1$", ha="right", va="center", fontsize=11)
ax.scatter(*np.meshgrid(np.arange(W + 1), [0, 1]), color=viz.INK, zorder=5, s=25)
ax.set_xlim(-2.4, W + 1.2); ax.set_ylim(-0.45, 1.45); ax.set_aspect("equal"); ax.axis("off")
fig, ax = plt.subplots(figsize=(7, 3))
draw_slab(ax)
plt.show()
Every face of the board lies in exactly one slab, and a face in this slab involves only , and . So the total cost splits into slab costs, and the weight splits into a product of slab weights:
Here is the slab weight: the weight of one slab whose lower layer carries , whose step edges carry and whose upper layer carries . On the left, is the whole layer labeling of layer and the step labels of slab . So from now on the subscript tells you what is meant: with a column index is one label of a layer labeling ; (or ) with a layer index is the layer labeling of layer .
For the coin model (, labels , which are their own inverses) the face product of face is simply , and .
The matrix
The step labels of a slab appear in that slab's weight and nowhere else. So we can add them up slab by slab, which leaves a weight that depends only on the two neighboring layer labelings. That is the transfer matrix (glossary 5.6):
Its rows and columns are indexed by layer labelings. For the coin model with there are of them, so is . Let's compute one entry by hand first, with . The face products become , so each face is a defect exactly when . Going through the 8 choices of : 2 of them (all equal) give no defects, and the other 6 give exactly 2 defects. Each defect costs , so
def layer_labelings(W):
"""All 2^W coin-model layer labelings, as rows of +-1."""
return np.array(list(itertools.product([1, -1], repeat=W)))
def coin_transfer_matrix(W, beta):
A = layer_labelings(W) # rows of A also serve as the step labels s
T = np.zeros((len(A), len(A)))
for i, a in enumerate(A):
for j, b in enumerate(A):
f = a * b * A * np.roll(A, -1, axis=1) # face x: a_x b_x s_x s_{x+1}, one row per s
T[i, j] = np.exp(-beta * (1 - f)).prod(axis=1).sum()
return T
beta = 0.7
T3 = coin_transfer_matrix(3, beta)
print(f"T(+++, +++) from code: {T3[0, 0]:.6f} by hand: {2 + 6 * np.exp(-4 * beta):.6f}")
T(+++, +++) from code: 2.364860 by hand: 2.364860
The normalizer is a trace
Recall from chapter 2 what a model needs: a weight for every labeling, and the total of all weights,
(for a finite group, summing over all labelings ). Every probability is a weight divided by , and every average is a ratio of two such sums. (Chapter 2 divided by the number of labelings, to compare with the uniform distribution. That changes by a constant factor, which cancels from every probability.)
Computing by brute force means visiting all labelings. The transfer matrix replaces this with a matrix power, in three steps.
Step 1: organize the sum by layers and slabs. A labeling of the stack is the same thing as a list of layer labelings together with lists of step labels . Its weight is a product of slab weights, with because the stack wraps around:
Step 2: sum out the step labels. The labels appear in factor and in no other factor, so their sum can be done inside that factor, and it gives by definition:
Step 3: recognize the warm-up. This is a sum over cyclic sequences of states, weighted by . So it is a trace:
In the smallest case, , you can see it directly: .
(On boards of dimension 3 or more, some faces lie inside a layer. Their cost is then split half-and-half between the two slabs touching that layer, so that stays symmetric. On our 2D torus every face is in a slab, so no splitting is needed.)
The check: build the model on the torus, enumerate all labelings exactly (chapter 2), and compare with .
B33 = Board.grid(3, 3, periodic=True)
ex = Model(B33, Z2(), beta).exact()
total_weight = 2.0 ** B33.n_edges * np.exp(ex.log_Z) # undo chapter 2's division by 2^18
print(f"Z by summing over all 2^18 labelings: {total_weight:.6e}")
print(f"trace of T^3: {np.trace(np.linalg.matrix_power(T3, 3)):.6e}")
Z by summing over all 2^18 labelings: 3.762284e+03
trace of T^3: 3.762284e+03
They agree to every digit. A sum over 262,144 labelings has become the trace of the cube of an matrix. For a taller board we would only raise to a higher power, and the matrix stays .
Why a trace? Because the stack is periodic: layer is layer , so the sequence of layers must return to where it started. If instead the stack had two separate ends, with the bottom layer fixed to and the top layer fixed to , the same three steps would give a single matrix entry, . The trace is the periodic version of that.
Averages are traces too
The same bookkeeping computes averages. Suppose is a function of one layer's labeling, and you want . An average is the sum of (weight × ) divided by , so put the factor into the sum of Step 2. In matrix language, let be the diagonal matrix with the values on its diagonal. Then , so multiplying by is the same as inserting just before the first :
A second function of layer (for ) is inserted the same way, as after the first factors of . Dividing by gives:
Rule (averages as traces). For functions of a layer labeling, .
Read it as a trip around the stack: measure , go up slabs, measure , and go the remaining slabs back to the start. Let's check it on the torus with , the ring's loop product of a layer: , the product of its three labels (column indices here). We compare layers 0 and 1.
eidx = B33.meta["edge_index"]
def w_layer(k):
"""Loop product of layer k's ring, for every labeling of the exact enumeration."""
return np.prod([ex.U[:, eidx[(x + 3 * k, 0)]] for x in range(3)], axis=0)
D_w = np.diag(layer_labelings(3).prod(axis=1)) # multiply by the loop product
mp = np.linalg.matrix_power
print(f"<w(a_0) w(a_1)> by enumeration: {np.sum(ex.p * w_layer(0) * w_layer(1)):.6f}")
print(f"<w(a_0) w(a_1)> by traces: {np.trace(D_w @ T3 @ D_w @ mp(T3, 2)) / np.trace(mp(T3, 3)):.6f}")
<w(a_0) w(a_1)> by enumeration: 0.266615
<w(a_0) w(a_1)> by traces: 0.266615
Tall stacks: one eigenvalue wins
First a property we will use constantly: is symmetric, . Swapping the roles of the two layers is the flip of one slab, which maps faces to faces and does not change any cost (it may invert a face product, and the face costs of glossary 4.2 satisfy ). For the coin model you can see it directly: the face product doesn't change if and trade places. A real symmetric matrix has real eigenvalues and an orthonormal basis of eigenvectors.
The trace of a matrix is the sum of its eigenvalues, and the eigenvalues of are the -th powers of those of . So
Every entry of is a sum of positive weights. For such a matrix the Perron–Frobenius theorem (the one behind the stationary distribution of a Markov chain) says that the largest eigenvalue is positive and strictly larger than for every other . Dividing by , every other term goes to . So as grows, takes over: , and . In words: in a tall stack every layer contributes the same factor to the total weight. You can see it converge.
print("T symmetric:", np.allclose(T3, T3.T))
lam0 = np.linalg.eigvalsh(T3).max()
for N_ in [1, 2, 3, 5, 10, 20]:
print(f"N = {N_:>2}: (1/N) log Z = {np.log(np.trace(mp(T3, N_))) / N_:.6f} log lambda_0 = {np.log(lam0):.6f}")
T symmetric: True
N = 1: (1/N) log Z = 2.940161 log lambda_0 = 2.740694
N = 2: (1/N) log Z = 2.764484 log lambda_0 = 2.740694
N = 3: (1/N) log Z = 2.744260 log lambda_0 = 2.740694
N = 5: (1/N) log Z = 2.740799 log lambda_0 = 2.740694
N = 10: (1/N) log Z = 2.740694 log lambda_0 = 2.740694
N = 20: (1/N) log Z = 2.740694 log lambda_0 = 2.740694
Already at the two agree to six digits. This factor is "the weight per layer", and section 5.4 will divide by it.
Recap. A sum over sequences of products is a matrix power, and a sum over cyclic sequences is a trace. Writing a labeling as layers plus step labels and summing out the step labels gives on a periodic stack (a single entry with fixed ends). Averages of layer functions are traces with diagonal matrices inserted. In a tall stack : each layer contributes the factor .
Check yourself
- In the warm-up, what does add up?
Answer
The weights of all sequences of length that start at and end at , where a sequence's weight is the product of over its consecutive pairs.
- Compute by hand.
Answer
Now face 0 has product and faces 1, 2 have , . The product of all three face products is , so an odd number of faces are defects: 1 or 3. Going through : 6 choices give one defect and 2 give three. So .
- How big is for the coin model with ? For with ?
Answer
, and . The size grows exponentially in the size of a layer, but not with the height of the stack.
5.3 The layer constraint: the ring's loop product does a random walk
Let's look at the matrix. We sort the layer labelings by their loop product (chapter 1: the product of the labels around the ring), the four with first.
A3 = layer_labelings(3)
w3 = A3.prod(axis=1)
order = np.argsort(-w3, kind="stable") # w = +1 first, then w = -1
names = ["".join("+" if v > 0 else "−" for v in a) for a in A3[order]]
fig, ax = plt.subplots(figsize=(5, 4.3))
im = ax.imshow(T3[np.ix_(order, order)], cmap="magma")
ax.axhline(3.5, color="white", lw=2); ax.axvline(3.5, color="white", lw=2)
ax.set_xticks(range(8), names, rotation=45, fontsize=9); ax.set_yticks(range(8), names, fontsize=9)
ax.set(xlabel="layer labeling $b$ (layer $k+1$)", ylabel="layer labeling $a$ (layer $k$)",
title="T, sorted by loop product")
fig.colorbar(im, ax=ax, shrink=0.8)
plt.show()
Two things stand out. The matrix has only two distinct entries. And it is made of four constant blocks: the entry is large when and have the same loop product, and small when they differ. Everything else about and seems to be irrelevant. Why?
Why only sees loop products
Take a reframing that acts only on the vertices of layer . It changes the layer labeling into some other labeling . It also changes the step labels touching layer , but those are exactly the labels that sums over. Reframing doesn't change any face product's cost (chapter 2), and it only relabels which is which in the sum. So the sum is the same:
Fact 5.1 (layer constraint). For every reframing that acts only on one layer, , and likewise . So depends only on the classes of and (glossary 5.10).
On a ring the class of a layer labeling is determined by its loop product (chapter 1). For the coin model that means: depends only on whether . Let's check, using the reframing that flips vertex 1 of the upper layer (which flips the two labels and touching it).
code = lambda rows: ((1 - rows) // 2) @ (2 ** np.arange(3)[::-1]) # row of +-1 -> row index of T
h = np.array([1, -1, 1]) # flip vertex 1 only
hb = A3 * h * np.roll(h, -1) # b_x -> h_x b_x h_{x+1}
print("T(a, h.b) == T(a, b) for all a, b:", np.allclose(T3[:, code(hb)], T3))
same, diff = T3[0, 0], T3[0, code(np.array([[-1, 1, 1]]))[0]]
print(f"the two entries: same loop product {same:.4f}, different loop product {diff:.4f}")
T(a, h.b) == T(a, b) for all a, b: True
the two entries: same loop product 2.3649, different loop product 1.5096
Shrinking to a matrix
Since only matters, collapse each block. Write and for the two entries printed above. If the current layer has loop product , the total weight of moving to some next labeling with loop product is the block entry times the 4 labelings in that block:
rows and columns indexed by . Divide each row by its sum and you get a matrix of transition probabilities: the probability that the next layer's loop product equals or differs from this one's.
Tt = 4 * np.array([[same, diff], [diff, same]])
P = Tt / Tt.sum(axis=1, keepdims=True)
print("transition probabilities for the loop product (rows: from +1, -1; columns: to +1, -1):")
print(np.round(P, 4))
print(f"probability of keeping w: {P[0, 0]:.4f} formula (1 + tanh(beta)^3) / 2 = {(1 + np.tanh(beta) ** 3) / 2:.4f}")
transition probabilities for the loop product (rows: from +1, -1; columns: to +1, -1):
[[0.6104 0.3896]
[0.3896 0.6104]]
probability of keeping w: 0.6104 formula (1 + tanh(beta)^3) / 2 = 0.6104
Where does that formula come from? Use the freedom of Fact 5.1: reframe layer by layer from the bottom up so that every step label becomes . (This is a tree normal form whose tree contains the step edges; on a torus one slab is left over, which we ignore for now.) With all , the face products of a slab are just , so , and multiplying around the ring:
The face products of a slab are independent, each with probability (this is Fact 2.8 of chapter 2, and its average is ). So has average , and it is with probability .
Fact 5.2 (the ring's walk). Going up one layer, the ring's loop product is multiplied by the product of independent random face products, each with distribution proportional to . The sequence is a random walk on . For the coin model it keeps its value with probability and flips with probability , where .
Here is that walk, read off from samples of the actual model (using the fast sampler of chapter 4) on tori with layers and three ring lengths.
def ring_walks(W, N, beta, n_samples, rng, gap=20):
M = GridModel((W, N), Z2(), beta).hot_start(rng)
M.sweep(rng, 300)
out = []
for _ in range(n_samples):
M.sweep(rng, gap)
out.append(M.U[0].prod(axis=0)) # loop product of every layer's ring
return np.array(out)
walks = {W: ring_walks(W, 64, 1.2, 1000, rng, gap=5) for W in [2, 4, 8]}
fig, axs = plt.subplots(3, 1, figsize=(9, 4.6), sharex=True)
for ax, W in zip(axs, [2, 4, 8]):
ax.imshow(walks[W][::100], cmap=ListedColormap([viz.GOLD, viz.PALE]), aspect="auto", vmin=-1, vmax=1)
ax.set_yticks([]); ax.set_ylabel(f"W = {W}", rotation=0, ha="right", va="center")
axs[-1].set_xlabel("layer $k$")
axs[0].set_title(r"loop product of each layer's ring: pale $=+1$, gold $=-1$ (10 samples per panel, $\beta=1.2$)")
plt.show()
Each row is one sample: a sequence of 64 values, flipping now and then like a telegraph signal. The longer the ring, the more often it flips, because more faces get a chance to be defects.
This is worth pausing on. Summing the model over everything except the layers' loop products leaves a sum over paths of a random walk on , each path weighted by its step probabilities. A weighted sum over paths is what physicists call a path integral. Here it is not a metaphor: it is a random walk you can sample.
Recap. doesn't change if either layer is reframed, so it only sees the classes of the layers. On a ring those are given by the loop product, so collapses to a small matrix on , which (after normalizing rows) is the transition matrix of a random walk: going up one layer multiplies the loop product by independent face products.
Check yourself
- For the coin model at , what is the probability that the loop product flips between consecutive layers, for and ?
Answer
. For , and the flip probability is . For , and it is about .
- At what does the walk do?
Answer
Every face product is uniform, so their product is uniform: the loop product jumps to a fresh uniform value at every layer. No memory at all.
5.4 How fast do layers forget? Eigenvalues
Here is the question that will give us the most important number of the chapter: if you know the loop product at layer 0, how much do you know about it at layer ?
Iterating the walk by hand
The answer is in the powers of the transition matrix: is the probability of going from to in steps (the warm-up of 5.2 again). For a matrix we can compute exactly, using two special vectors. Write as
Multiply it by the vectors and :
So and are eigenvectors, with eigenvalues and : does not mix them, it only scales them. Read as functions of the loop product, is the constant function and is the function itself. Any vector is a combination of the two, for example the starting distribution "certainly ":
(A distribution is usually multiplied by from the left. Here is symmetric, so left and right give the same vector, and is the first column of , whose first entry is .) Applying a total of times multiplies the part by and the part by :
The first entry is the answer:
The constant part, , is where the walk ends up when it has forgotten everything. The memory of the start is the second part, and it shrinks by the factor at every layer. The eigenvalue is the rate of forgetting.
Let's check this against the samples from the previous section: the fraction of pairs of layers apart whose loop products agree.
fig, ax = plt.subplots(figsize=(7, 3.8))
ts = np.arange(0, 13)
for W, c in zip([2, 4, 8], [viz.TEAL, viz.CORAL, viz.GOLD]):
agree = [np.mean(walks[W] == np.roll(walks[W], -t, axis=1)) for t in ts]
r_W = np.tanh(1.2) ** W
ax.semilogy(ts, np.array(agree) - 0.5, "o", color=c, label=f"W = {W}: samples")
ax.semilogy(ts, 0.5 * r_W ** ts, "-", color=c, lw=1.5, label=fr"W = {W}: $r^t/2$")
ax.set(xlabel="layer separation $t$", ylabel=r"$\Pr(\mathrm{agree}) - 1/2$", ylim=(3e-3, 0.7))
ax.legend(fontsize=8, ncol=3, loc="upper right")
plt.show()
On this logarithmic scale each "memory" curve is a straight line, and its slope is . A longer ring has a smaller , so a steeper line: it forgets faster. Once the remaining memory is below about half a percent, it is smaller than the sampling noise, and the points scatter around the line instead of following it (for that happens after only a few layers).
Levels: rates instead of factors
Exponential decay is easier to talk about as a rate. Write , so that
is "how much memory is lost per layer". For the coin model, .
In general we don't normalize into a probability matrix first, so we define the rates directly from the eigenvalues of . is symmetric, so its eigenvalues are real. Order them . The levels (glossary 5.8) are
Dividing by is what normalizing does: is the overall weight per layer, and it cancels from every probability. For the coin model you can see this exactly. Every row of has the same sum, so the constant vector is an eigenvector of with that row sum as eigenvalue, and that is (checked below). Then , so the eigenvalues of are those of divided by : and . So always, and the gap is the decay rate of the slowest-forgetting memory. A small gap means long memory; a big gap means fast forgetting.
What about the other six eigenvalues?
The full for is , so it has 8 eigenvalues, not 2. Let's look at all of them.
ev = np.sort(np.linalg.eigvalsh(T3))[::-1]
print("eigenvalues of the 8x8 T:", np.round(ev, 6) + 0.0)
print(f"lambda_1 / lambda_0 = {ev[1] / ev[0]:.6f} r = tanh(beta)^3 = {np.tanh(beta) ** 3:.6f}")
print(f"lambda_0 = {ev[0]:.6f} row sum of the 2x2 matrix = {Tt[0].sum():.6f}")
eigenvalues of the 8x8 T: [15.497733 3.42115 0. 0. 0. 0. 0.
0. ]
lambda_1 / lambda_0 = 0.220752 r = tanh(beta)^3 = 0.220752
lambda_0 = 15.497733 row sum of the 2x2 matrix = 15.497733
Two of them are the eigenvalues of the small matrix : on a function that is constant on each class, acts exactly like , because each block has 4 equal entries. The other six are exactly zero. The reason is Fact 5.1. Take any function of a layer labeling that adds up to zero over each class, for example (which flips sign under the reframing of vertex 1). Then
because is the same number for every in a class . Such functions form a subspace of dimension : the 8 values of only have to satisfy one linear condition per class, and there are 2 classes. Every vector in it is an eigenvector with eigenvalue , which accounts for the six zeros. So erases everything about a layer except its class. Only functions of the loop product survive one step, and those are what the levels describe. This is why glossary 5.8 says to restrict to reframing-invariant functions.
g = A3[:, 0] - A3[:, 1] # b_0 - b_1, not an invariant
print("T applied to g = b_0 - b_1:", np.round(T3 @ g, 10))
for W_ in [2, 3, 4, 6]:
lam = np.sort(np.linalg.eigvalsh(coin_transfer_matrix(W_, beta)))[::-1]
print(f"W={W_}: nonzero eigenvalues {np.sum(lam > 1e-9)}, E1 = {-np.log(lam[1] / lam[0]):.4f}, "
f"-W log tanh(beta) = {-W_ * np.log(np.tanh(beta)):.4f}")
T applied to g = b_0 - b_1: [0. 0. 0. 0. 0. 0. 0. 0.]
W=2: nonzero eigenvalues 2, E1 = 1.0071, -W log tanh(beta) = 1.0071
W=3: nonzero eigenvalues 2, E1 = 1.5107, -W log tanh(beta) = 1.5107
W=4: nonzero eigenvalues 2, E1 = 2.0143, -W log tanh(beta) = 2.0143
W=6: nonzero eigenvalues 2, E1 = 3.0214, -W log tanh(beta) = 3.0214
For every ring length, only 2 eigenvalues are nonzero, and the gap matches . The gap is proportional to the length of the ring: keeping a loop of length "remembered" from layer to layer costs an amount proportional to .
A warning about signs
We took of eigenvalue ratios without worrying. That needs every relevant eigenvalue to be positive. (Zero eigenvalues are harmless: they belong to the erased functions, which we have just set aside.) A negative eigenvalue would make the memory alternate in sign from layer to layer ( with ), and no decay rate could describe it. For our models this never happens. The property that guarantees it is called flip-positivity, and it is important enough to get its own section (5.6).
Recap. An eigenvector of the walk is a function that one step only rescales; its eigenvalue is the factor. Memory of the start decays like , so the gap is the rate of forgetting. erases every non-invariant function (eigenvalue 0), so only functions of the loop product matter. For the coin model , and flip-positivity guarantees the logarithm makes sense.
Check yourself
- Verify by multiplying out.
Answer
First entry: . Second entry: . So .
- Suppose we allowed a negative stiffness, , with . What is , and what goes wrong?
Answer
. The memory alternates in sign and of a negative number is undefined. Flip-positivity fails for negative stiffness (with odd ), and the derived picture of section 5.8 breaks down (section 5.6 shows this failure in detail).
- Why does the gap grow with ?
Answer
The ring's loop product flips whenever an odd number of the faces in a slab are defects. More faces mean more chances, so the walk forgets faster.
5.5 Two roads to one number
We computed the gap from the cost function: build , take eigenvalues. Now forget the cost. Suppose someone hands you a black box that produces random labelings of the cylinder from some model, and nothing else. Can you get the same number?
Yes: section 5.4 already said how. Memory decays like , so measure memory. Write for the loop product of layer 's ring and define the layer correlation
which by the shift symmetry does not depend on .
The prediction, step by step
On a periodic stack two layers apart are joined two ways: slabs going up and slabs going the rest of the way round. With the matrices of 5.2 the average is
where is the diagonal matrix that multiplies by the loop product (the rule of 5.2 with ). Now compute the trace in a basis of eigenvectors of . Recall that the trace of a matrix can be computed in any orthonormal basis, as ; so a basis vector with contributes exactly . For the space of functions on (-dimensional) take:
- , the constant function , with ;
- , the function itself, with (these are the vectors and of the walk, now read as functions of the whole layer labeling);
- the remaining basis vectors: erased functions , with (5.4).
(Divide each by its length to make them orthonormal; that doesn't change what they contribute.) An erased contributes , because the first matrix to act on it, , kills it (for ). Multiplying by swaps the other two, since : and . Now follow through , from right to left: scales it by , turns it into , scales by , and turns it back into . So . Starting from instead gives . Adding both and dividing by (the zero eigenvalues add nothing):
Two exponentials appear because a periodic stack can be traversed both ways round. For much smaller than , : the correlation between layers decays at a rate equal to the gap.
First a sanity check of this formula against exact enumeration on the torus, where and :
eidx = B33.meta["edge_index"]
w_layer = lambda k: np.prod([ex.U[:, eidx[(x + 3 * k, 0)]] for x in range(3)], axis=0)
C1_exact = float(np.sum(ex.p * w_layer(0) * w_layer(1)))
r = np.tanh(beta) ** 3
print(f"C(1) by enumeration: {C1_exact:.6f} by the formula: {(r + r ** 2) / (1 + r ** 3):.6f}")
C(1) by enumeration: 0.266615 by the formula: 0.266615
Now road 2 for real. We sample the coin model on a torus at with the chapter 4 sampler, record every layer's loop product, and average over all samples and all starting layers . The cost function is used only inside the sampler, which we treat as the black box.
W5, N5, beta5 = 4, 16, 1.6
M = GridModel((W5, N5), Z2(), beta5).hot_start(rng)
M.sweep(rng, 500)
ws = np.array([(M.sweep(rng), M.U[0].prod(axis=0))[1] for _ in range(20000)]) # (samples, N)
per_sample = np.stack([np.mean(ws * np.roll(ws, -t, axis=1), axis=1) for t in range(N5 + 1)], 1)
blocks = per_sample.reshape(100, -1, N5 + 1).mean(axis=1) # binning (ch. 4)
C_hat, C_err = blocks.mean(axis=0), blocks.std(axis=0, ddof=1) / np.sqrt(len(blocks))
def C_model(t, E1, N):
return (np.exp(-E1 * t) + np.exp(-E1 * (N - t))) / (1 + np.exp(-E1 * N))
def fit_E1(C, err, N):
t = np.arange(1, N)
return minimize_scalar(lambda E: np.sum(((C[t] - C_model(t, E, N)) / err[t]) ** 2),
bounds=(0.01, 3), method="bounded").x
E1_road1 = -W5 * np.log(np.tanh(beta5))
E1_road2 = fit_E1(C_hat, C_err, N5)
boot = [fit_E1(blocks[i].mean(axis=0), C_err, N5)
for i in (rng.integers(0, len(blocks), len(blocks)) for _ in range(200))]
print(f"road 1 (eigenvalues of T): E1 = {E1_road1:.4f}")
print(f"road 2 (sampling, black box): E1 = {E1_road2:.4f} ± {np.std(boot):.4f}")
road 1 (eigenvalues of T): E1 = 0.3263
road 2 (sampling, black box): E1 = 0.3361 ± 0.0058
t = np.arange(N5 + 1)
tt = np.linspace(0, N5, 300)
fig, ax = plt.subplots(figsize=(7, 3.8))
ax.errorbar(t, C_hat, yerr=2 * C_err, fmt="o", color=viz.CORAL, ms=5, capsize=2,
label="road 2: measured from samples (±2 s.e.)")
ax.plot(tt, C_model(tt, E1_road1, N5), color=viz.TEAL, lw=2, label="road 1: from eigenvalues of $T$")
ax.plot(tt, np.exp(-E1_road1 * tt), color=viz.MUTED, ls=":", label=r"$e^{-E_1 t}$ alone")
ax.set(xlabel="layer separation $t$", ylabel="$C(t)$", yscale="log", ylim=(0.03, 1.2))
ax.legend(fontsize=9)
plt.show()
The dots (sampling) lie within their error bars of the teal curve (eigenvalues), though all of them sit slightly below it. That common shift is not 15 separate discrepancies: neighbouring points come from the same samples and move together. The fitted gap, against , is about 1.7 standard errors away, which is agreement within the statistical error. For small both follow the dotted straight line on this log scale; past the middle of the stack the correlation climbs back up, because the layers are approaching each other the other way round the periodic stack.
Why this matters. Road 2 never used the cost function: it needed only samples of the distribution, plus a way to cut the board into layers with a shift and a flip. This is the answer to a question from the very start of the course: what do you need, besides the distribution, to extract dynamics? Only the layering and its symmetries. The cost function is merely one convenient way of writing the distribution down.
Recap. The correlation between layers apart decays like (with a mirror term on a periodic stack). Measuring that decay from samples gives the gap without ever looking at the cost. Road 1 (eigenvalues) and road 2 (sampling) agree within the sampling error.
Check yourself
- With , how many layers apart must two rings be before their correlation drops below 1%?
Answer
needs . On a stack of only 16 layers you'd never see that, because the mirror term takes over first.
- The correlation length (glossary 4.7) measures how fast correlations decay with distance. How is it related to the gap?
Answer
with : the correlation length in the layer direction is the reciprocal of the gap.
5.6 Flip-positivity
Twice already we needed every eigenvalue of to be nonnegative: to take logarithms in 5.4, and for to decay instead of oscillating in 5.5. This section explains the property behind that, flip-positivity. It is worth the time: it is also what turns functions on the board into the vector space of a quantum system (5.8), and it is one of the properties the Millennium problem demands of the limit in chapter 6.
Two ways to put a mirror in the stack
The flip turns the stack upside down. There are two natural places to put the mirror:
- through a layer: layer stays where it is, and layer goes to layer ;
- between two layers: the mirror sits in the middle of slab 0, so layers and swap, and layer goes to layer . The step edges of slab 0 are cut in half by the mirror and turned around.
Either way the mirror splits the periodic stack into an upper half and a lower half, and swaps them. On a periodic stack the mirror has a second copy halfway round, so we take even. Through a layer, the upper half is layers with the edges among them (the two mirror layers and belong to both halves). Between layers, the upper half is layers with the edges among them; the step edges of slabs and , which the mirrors cut, belong to neither half.
def draw_mirror(ax, between, ks=range(-3, 4)):
for k in ks:
ax.plot([0, 4], [k, k], color=viz.INK, lw=2)
ax.text(-0.3, k, f"layer {k}", ha="right", va="center", fontsize=10)
m = 0.5 if between else 0.0
ax.fill_between([-0.2, 4.2], m, 3.5, color=viz.TEAL, alpha=0.12, lw=0)
ax.plot([-0.2, 4.2], [m, m], color=viz.CORAL, ls="--", lw=2.5)
ax.text(4.4, m, "mirror", color=viz.CORAL, va="center", fontsize=11)
ax.text(4.4, 2.5, "upper half", color=viz.TEAL, va="center", fontsize=11)
t = 2
ax.annotate("", xy=(2, 2 * m - t), xytext=(2, t),
arrowprops=dict(arrowstyle="<->", color=viz.GOLD, lw=2, connectionstyle="arc3,rad=0.35"))
ax.set(xlim=(-2.2, 7), ylim=(-3.6, 3.6), title="mirror between layers 0 and 1" if between else "mirror through layer 0")
ax.axis("off")
fig, axs = plt.subplots(1, 2, figsize=(10, 4))
draw_mirror(axs[0], between=False); draw_mirror(axs[1], between=True)
plt.show()
The gold arrows join layer 2 to its mirror image: layer on the left, layer on the right. Notice the number of slabs between a layer and its image. Through a layer it is always even (). Between layers it is always odd (). That difference will matter.
The definition
Write for the edges of the upper half, and let be any function of their labels, . Its mirror image is the same function applied to the mirrored labeling, so it depends only on the lower half. Flip-positivity (glossary 5.7) says:
In words: a quantity measured on the top half and the same quantity measured on its mirror image are never, on average, anti-aligned. For a real this says that and its mirror image have a nonnegative average product.
This is not automatic. Averages of products of two different functions can be negative, of course. The claim is about a function and its own mirror image, and it is a real restriction on the model.
The single-layer case is linear algebra
Take the simplest upper-half function, a real function of one layer: (so the complex conjugate does nothing). Its mirror image is of the mirrored layer, which is slabs away, with (mirror through a layer) or (mirror between layers). By the trace rule of 5.2,
(The model is shift-invariant, so only the separation between the two layers matters.) Write in its orthonormal eigenvectors (5.2): and . Substituting, and using ( is diagonal, hence symmetric), the numerator becomes
Each term is a square times . Since is even, and are both even (mirror through a layer) or both odd (mirror between layers). Even powers are nonnegative whatever the signs of the eigenvalues. Odd powers are nonnegative for sure only if no eigenvalue is negative. So:
Fact 5.3 (flip-positivity for one layer). Let be symmetric with positive entries, and even. For the mirror through a layer, for every single-layer , automatically. For the mirror between layers, for every single-layer if has no negative eigenvalue; if does have a negative eigenvalue, it fails for some single-layer once the stack is tall enough.
Why the failure: on a tall stack the terms with dominate, and they add up to . By Perron–Frobenius has positive entries, so you can choose (entrywise) for an eigenvector with . Then , the sum is just for odd , and the average is negative.
So the between-layers flip is the demanding one, and " has nonnegative eigenvalues" is what flip-positivity says about single layers.
Watching it fail
Negative stiffness is the easy way to break it: a model with prefers defects. Take the coin model with and . The favourite slab now has all 3 of its faces as defects, an odd number, and an odd number of defects in a slab flips the ring's loop product (Fact 5.2). So the loop product tends to flip at every layer. Neighbouring layers become anti-aligned.
Use , the loop product of layer 1. The mirror between layers 0 and 1 turns it into , so flip-positivity requires . Let's compute it with the trace rule on a stack of layers, for both signs of , and for several separations .
def flip_overlap(T, f, p, N):
"""<f(a_0) f(a_p)> on a periodic stack of N layers, by the trace rule."""
D = np.diag(f)
return np.trace(D @ mp(T, p) @ D @ mp(T, N - p)) / np.trace(mp(T, N))
w3_ = layer_labelings(3).prod(axis=1)
for b in [0.7, -0.7]:
Tb = coin_transfer_matrix(3, b)
vals = " ".join(f"p={p}: {flip_overlap(Tb, w3_, p, 8):+.4f}" for p in [1, 2, 3, 4])
ev_ = np.linalg.eigvalsh(Tb); nz = ev_[np.abs(ev_) > 1e-9][::-1]
print(f"beta = {b:+.1f} nonzero eigenvalues of T: {np.round(nz, 3)} {vals}")
beta = +0.7 nonzero eigenvalues of T: [15.498 3.421] p=1: +0.2208 p=2: +0.0488 p=3: +0.0113 p=4: +0.0047
beta = -0.7 nonzero eigenvalues of T: [1033.487 -228.144] p=1: -0.2208 p=2: +0.0488 p=3: -0.0113 p=4: +0.0047
At every overlap is positive. At one eigenvalue of is negative, and the overlaps for odd separations (, the between-layers mirror) are negative, exactly as Fact 5.3 predicts. Even separations stay positive.
Is this an artifact of matrices? Ask the black box: sample the model directly with the Metropolis rule of chapter 4, and measure the average product of neighbouring layers' loop products.
Bneg = Board.grid(3, 8, periodic=True)
chain = Model(Bneg, Z2(), beta=-0.7).metropolis(rng, n_samples=3000, burn_in=200)
eneg = Bneg.meta["edge_index"]
w_rows = np.stack([np.prod([chain[:, eneg[(x + 3 * k, 0)]] for x in range(3)], axis=0) for k in range(8)], 1)
measured = np.mean(w_rows * np.roll(w_rows, -1, axis=1))
print(f"sampled <w(a_k) w(a_k+1)> at beta=-0.7: {measured:+.3f} trace rule: {flip_overlap(coin_transfer_matrix(3, -0.7), w3_, 1, 8):+.3f}")
sampled <w(a_k) w(a_k+1)> at beta=-0.7: -0.224 trace rule: -0.221
The samples agree: neighbouring layers really are anti-aligned. With such a model, section 5.4's levels make no sense ( of a negative ratio), and the derived system of section 5.8 can't be built.
Why it holds for our models: a sum of squares
For it never fails, and for the coin model we can see exactly why. Write one face's weight, for a face product . Since , and is even while is odd, . So:
Multiply this over the faces of a slab and expand the product: terms, each picking, for every face, either or . Now sum over the step labels . A step label appears in two faces, and . If a term picks in exactly one of them, that term is times something not involving , and summing over gives : the term dies. If it picks both, appears squared, , and it survives. So a term survives only if, for every , faces and are picked alike; going around the ring, that means all faces alike. That leaves just two terms: "pick everywhere", and "pick everywhere". In the second, the product of the face products is times . Neither surviving term depends on , so each of the choices of contributes the same, and
In matrix form, with the all-ones vector and the vector of loop products,
The vectors and are orthogonal (, since half the labelings have ), and each has squared length . So and , while kills every vector orthogonal to both. That explains everything we saw in 5.3 and 5.4 at once: two distinct entries, only and survive, all other eigenvalues are zero, , , and . And for any vector ,
a sum of squares with coefficients . When both coefficients are nonnegative, so for every ; taking to be an eigenvector shows that can never have a negative eigenvalue. When and is odd, , and that is the failure we just watched.
for b in [0.7, -0.7]:
c0, c1 = (2 * np.exp(-b) * np.cosh(b)) ** 3, (2 * np.exp(-b) * np.sinh(b)) ** 3
closed = c0 * np.ones((8, 8)) + c1 * np.outer(w3_, w3_)
print(f"beta = {b:+.1f}: closed form matches T: {np.allclose(closed, coin_transfer_matrix(3, b))}, c0 = {c0:.4f}, c1 = {c1:+.4f}")
beta = +0.7: closed form matches T: True, c0 = 1.9372, c1 = +0.4276
beta = -0.7: closed form matches T: True, c0 = 129.1859, c1 = -28.5180
The same mechanism works for every group. Above, we expanded the weight of one face in two special functions of the face product, and . For a general the special functions are the characters of (for the coin model, and ; for the circle, the functions , , that 5.7 will use as eigenfunctions of the ring's walk). For the standard face cost every coefficient of that expansion is nonnegative when . For the circle, the expansion is , with the Bessel numbers we will meet again in 5.7. Nonnegative coefficients make the weight across the mirror a sum of "(something about the top half) × (the same thing about the bottom half)", which is a sum of squares. This argument, done carefully for all upper-half functions, not just single layers, is the theorem of Osterwalder and Seiler (1978).
Fact 5.4 (flip-positivity of our models; Osterwalder–Seiler). For the standard face costs of glossary 4.2 (including the coin and circle costs), any compact label group, any dimension and any , the model on a periodic grid with an even number of layers is flip-positive for the mirror between layers, for every function of the upper half. In particular has no negative eigenvalues. (For the mirror through a layer, the single-layer case is automatic, as Fact 5.3 showed; we won't need more than that.)
We don't prove Fact 5.4 here; the coin-model computation above is the single-layer case of it.
th = np.linspace(-np.pi, np.pi, 7)
n_ = np.arange(-30, 31)
series = np.real(np.exp(1j * np.outer(th, n_)) @ ive(n_, 2.0)) * np.exp(2.0) # sum_n I_n(2) e^{in theta}
print("circle expansion reproduces e^{beta cos theta}:", np.allclose(series, np.exp(2.0 * np.cos(th))))
print("smallest coefficient I_n(2), n = 0..30:", f"{(ive(np.arange(31), 2.0) * np.exp(2.0)).min():.2e}", "(all positive)")
circle expansion reproduces e^{beta cos theta}: True
smallest coefficient I_n(2), n = 0..30: 3.89e-33 (all positive)
What flip-positivity buys: an inner product
Here is the reason flip-positivity is central rather than technical. For two functions of the upper half, define
This is linear in and conjugate-linear in . Swapping and conjugates it (apply the symmetry inside the average, and use identity). And flip-positivity says exactly that . So it is an inner product on functions of the upper half, except that some nonzero functions may have length zero. Throw those away (formally: take the quotient by them), and what is left is a genuine inner-product space, built from nothing but the distribution and the mirror.
For single-layer functions, take the mirror between layers 0 and 1, and , , so . The trace rule gives . On a tall stack and (5.2), so this tends to . For the coin model is constant, so the inner product is proportional to . The functions of length zero are those with . For a matrix with no negative eigenvalues that forces (expand in eigenvectors), so they are exactly the functions erases: the non-invariant ones of 5.4. What survives are the functions of the loop product. That is the 2-dimensional space we have been working in all along, now obtained from the flip.
G_flip = T3 / np.linalg.eigvalsh(T3).max() # the flip inner product on single-layer functions
print("rank of the flip inner product on the 8 single-layer functions:", np.linalg.matrix_rank(G_flip, tol=1e-9))
print("its eigenvalues (all >= 0):", np.round(np.linalg.eigvalsh(G_flip), 6) + 0.0)
rank of the flip inner product on the 8 single-layer functions: 2
its eigenvalues (all >= 0): [0. 0. 0. 0. 0. 0. 0.220752 1. ]
In general, the vector space of a quantum system is constructed exactly this way: functions of the upper half, with the flip inner product, modulo the functions of length zero. The transfer matrix then acts on it as a positive operator. This is the Osterwalder–Schrader construction (named in the dictionary). It is also why flip-positivity is one of the requirements in the Millennium problem (chapter 6): it is an inequality between averages, so it survives limits, and with it the inner product survives too.
Recap. A mirror through a layer or between two layers swaps the upper and lower halves of the stack. Flip-positivity says a function of the upper half and its mirror image never have a negative average product. For single layers it means has no negative eigenvalue; it fails for negative stiffness, as sampling confirms. For our models it holds because the weight across the mirror is a sum of squares with nonnegative coefficients. Its payoff is an inner product on functions of the upper half: the vector space of the derived system.
Check yourself
- Why is the through-a-layer mirror "automatically" positive for single-layer functions, even at negative stiffness?
Answer
A layer and its mirror image are an even number of slabs apart (and is even too). Even powers of real eigenvalues are nonnegative, so every term is nonnegative.
- Coin model with and : does the single-layer test pass?
Answer
Yes: because the power is even, so is still a sum of squares. With 4 faces per slab, the favourite slab (all faces defects) has an even number of defects, so it no longer flips the loop product.
- What is for a constant function ?
Answer
, which is for . Constants always have positive length; for the coin model the constant function is (up to normalization) the eigenvector of .
5.7 The circle: free motion on a group
Now let the labels be angles, , with face cost . Fact 5.2 still holds: the ring's loop product is a random walk on the circle, and each step adds independent angles, each with density proportional to .
A random walk on a circle is diagonalized by the functions , (the characters of ). One step multiplies by the average of over one step. For one face that average is a ratio of Bessel functions, , so
For a stiff model each face angle is small and roughly Gaussian with variance , so one step is roughly Gaussian with variance , and :
The levels lie on a parabola. Let's check this against an honest matrix: replace the circle by equally spaced angles, build the transfer matrix of the walk, and take its eigenvalues.
def circle_levels_matrix(W, beta, K=64):
p = np.exp(beta * np.cos(2 * np.pi * np.arange(K) / K)); p /= p.sum() # one face
step = p.copy()
for _ in range(W - 1): # W faces in a slab
step = np.real(np.fft.ifft(np.fft.fft(step) * np.fft.fft(p)))
ev = np.sort(np.linalg.eigvalsh(circulant(step)))[::-1][:15] # the top few levels
return -np.log(ev / ev[0])
def circle_levels_bessel(W, beta, n):
return -W * np.log(ive(n, beta) / ive(0, beta))
n = np.arange(0, 7)
fig, axs = plt.subplots(1, 2, figsize=(11, 3.8), sharey=False)
for ax, b in zip(axs, [2.0, 10.0]):
Em = circle_levels_matrix(2, b)
ax.plot(n, Em[[0] + [2 * k - 1 for k in n[1:]]], "o", color=viz.CORAL, ms=8, label="eigenvalues of a 64×64 matrix")
ax.plot(n, circle_levels_bessel(2, b, n), "x", color=viz.INK, ms=8, mew=2, label="Bessel formula")
nn = np.linspace(0, 6, 100)
ax.plot(nn, 2 / (2 * b) * nn ** 2, color=viz.TEAL, label=r"parabola $\frac{W}{2\beta}n^2$")
ax.set(title=fr"$W=2$, $\beta={b}$", xlabel="$n$", ylabel="level $E_n$")
ax.legend(fontsize=8)
plt.show()
Each eigenvalue except the first comes twice, for and (the walk can't tell clockwise from counterclockwise), so we plot every second one. Matrix and formula agree. At the levels sit right on the parabola; at they bend below it for large , where the Gaussian approximation is too crude.
A parabola of levels is famous: it is the spectrum of a free particle moving on a circle. Physicists call it a rotor. Here it was never put in. It came out of a distribution over labelings of a cylinder.
And the walk itself? Below are a few samples of the actual model on a torus at . For each sample we follow the angle of every layer's loop product and draw it continuously (adding whenever it wraps), starting from .
M = GridModel((4, 64), U1(), 4.0).hot_start(rng)
M.sweep(rng, 600)
fig, ax = plt.subplots(figsize=(8, 3.6))
for i in range(8):
M.sweep(rng, 60)
ang = np.unwrap(np.angle(M.U[0].prod(axis=0)))
ax.plot(np.r_[ang, ang[0] + 2 * np.pi * np.round((ang[-1] - ang[0]) / (2 * np.pi))] - ang[0], lw=1.3)
for m in (-2, -1, 0, 1, 2):
ax.axhline(2 * np.pi * m, color=viz.MUTED, lw=0.8, ls=":")
ks = np.arange(-2, 3)
ax.set(xlabel="layer $k$", ylabel=r"loop product angle $w_k - w_0$", yticks=2 * np.pi * ks,
yticklabels=[r"$-4\pi$", r"$-2\pi$", "0", r"$2\pi$", r"$4\pi$"])
plt.show()
Each curve is a random walk path. Because the stack is periodic, each path has to come back to its starting point on the circle after 64 layers, but it may arrive having wound around the circle: on this unrolled picture every path ends at a whole multiple of . The model is a weighted sum over all such paths.
Recap. For the circle group the ring's loop product does a random walk on the circle. Its eigenfunctions are the characters , with levels : the levels of a free particle on a circle, derived from a distribution.
Check yourself
- If you double the ring length , what happens to the levels?
Answer
They all double. In the parabola picture, plays the role of : a longer ring is "lighter", so it wanders faster.
- Why does each level with appear twice among the eigenvalues?
Answer
and have the same eigenvalue, because the step distribution is symmetric ( and equally likely).
5.8 Naming what we built
Step back and look at the objects we derived, using nothing but the model and a layering:
- a vector space: functions of a layer labeling, , restricted to the reframing-invariant ones. Section 5.6 showed where it really comes from: functions of the upper half with the flip inner product, after discarding the functions of length zero. For the coin model on a ring it is 2-dimensional; for the circle it is the space of functions on the circle;
- a symmetric operator with nonnegative eigenvalues on it, the transfer matrix , and its logarithm
whose eigenvalues are the levels (after subtracting the smallest, );
- the identity for the total weight.
This pair (vector space, ) is the derived system of glossary 5.9. Physicists know it under another name. The vector space is a Hilbert space, is the Hamiltonian, its eigenvalues are energy levels, and the whole thing is a quantum system. The coin model on a ring derives a two-level system; the circle model derives a rotor. The periodic stack of layers corresponds to that quantum system at temperature ; a very tall stack means temperature near zero, where only the lowest levels matter.
The usual textbook order goes the other way round: start from a quantum system, write as a product of small steps, insert complete sets of states between them, and call the result a path integral. We never assumed a Hilbert space or a Hamiltonian. We had a distribution on labelings, and they came out.
A word about real time. Our "time" direction is the layer index, and correlations decay like . The quantum system's actual time evolution is : oscillations instead of decay. In principle the two determine each other, since both are built from the same . In practice, recovering oscillations from a sum of noisy decaying exponentials is a notoriously unstable inverse problem: tiny errors in hide large changes in the oscillating answer. That is why simulations of real-time dynamics are hard, and why people hope quantum computers will help.
Recap. The invariant functions of a layer, together with , form the derived system. Its eigenvalues are the levels. Physicists call it a quantum system, its vector space a Hilbert space and its Hamiltonian, but here it was derived from a distribution, not assumed.
Check yourself
- In the coin model on a ring, what is the "quantum system" we derived?
Answer
A 2-dimensional vector space (functions of ) with levels and : a two-level system.
- As the stack gets taller (), what happens to at fixed ?
Answer
The mirror term and the in the denominator vanish, leaving exactly . Zero temperature: only the lowest level and the first one above it matter for this correlation.
Chapter recap
- A layered board splits into layers; faces live in slabs between consecutive layers. The shift and flip are symmetries of the board and hence of every model on it.
- A sum over sequences of products is a matrix power. Summing out step-edge labels slab by slab gives the transfer matrix , indexed by layer labelings. The normalizer is , averages are traces with diagonal matrices inserted, and in a tall stack .
- Layer constraint: ignores reframings of a layer, so only invariant functions matter. On a ring those are functions of the loop product , which performs a random walk on .
- Eigenvectors of are functions that one step only rescales. Memory of a layer decays like , so the levels are rates of forgetting and the gap is the slowest one. erases non-invariant functions (eigenvalue 0). Coin model: .
- Flip-positivity: a function of the upper half and its mirror image never have a negative average product. For single layers it means has no negative eigenvalue; it fails for negative stiffness and holds for our models because the weight across the mirror is a sum of squares (Osterwalder–Seiler). It provides the inner product of the derived system.
- Two roads: eigenvalues of and the decay of correlations measured from samples give the same gap, within sampling error. Only the distribution and the layering are needed.
- For the circle the levels are : a free particle on a circle, derived, not assumed.
- The pair (invariant functions of a layer, ) is what physicists call a quantum system.
Dictionary
| Our term | Other names |
|---|---|
| layer, layer edge, step edge | time slice; spatial link, temporal link |
| shift, flip | time translation, time reflection |
| transfer matrix | transfer matrix / transfer operator |
| layer constraint (Fact 5.1) | Gauss's law |
| step edges set to the identity | temporal gauge |
| partition function | |
| weight per layer , | free energy per unit time; vacuum (ground-state) energy |
| flip-positivity | reflection positivity (Osterwalder–Schrader); Fact 5.4 is the Osterwalder–Seiler theorem |
| flip inner product | the Osterwalder–Schrader inner product, from which the Hilbert space is built |
| , levels | Hamiltonian, energy levels |
| gap | mass gap (the lightest state above the vacuum) |
| gap growing like const for a wrapped loop | string tension: the energy of a flux loop grows with its length |
| derived system (invariant functions, ) | Hilbert space and Hamiltonian; a quantum system |
| random walk of the loop product, summed over paths | path integral |
| circle levels | quantum rotor; free particle on a circle |
| periodic stack of layers | temperature |
| rebuilding from correlations | Osterwalder–Schrader reconstruction: the general theorem that a flip-positive distribution yields a Hilbert space and a Hamiltonian |
What's next
We now have all the ingredients. A model on a board; invariants and averages; sampling; and a derived system with levels and a gap. Chapter 6 puts them together: take the board to be a four-dimensional grid and the label group to be a group of matrices, and you have the theory physicists call Yang–Mills. We will state, entirely in our terms, what the Millennium Prize problem about it asks, what is known, and what was proved this year.








