Skip to content
John Doe

Example note: the Hodge Laplacian, drawn

A worked example on one triangle: its boundary maps, the Laplacian they build, and what the Laplacian's kernel counts.


On this page

One triangle

Take the smallest cell complex with something to say: three vertices, the three edges between them, and the face those edges bound. Give each edge an orientation, from its lower vertex to its higher one. The orientation is bookkeeping. It fixes the signs below, and any other choice gives the same answers.1Flipping an edge changes the sign of its column in one matrix and of its row in the other. Ranks, kernels, and eigenvalues stay the same.

Boundary maps

012
Figure 1.The complex in this note: three vertices, three edges, and the face they bound. Each arrow is an edge's orientation.

The boundary of an edge is its head minus its tail. The boundary of the face is the sum of its edges, each signed by whether it runs with or against the loop 0→1→2→00 \to 1 \to 2 \to 0. Edges (0,1)(0,1) and (1,2)(1,2) run with it; (0,2)(0,2) runs against. With the vertices as rows and the edges (0,1),(0,2),(1,2)(0,1), (0,2), (1,2) as columns:

B1=(−1−1010−1011),B2=(1−11)B_1 = \begin{pmatrix} -1 & -1 & 0 \\ 1 & 0 & -1 \\ 0 & 1 & 1 \end{pmatrix}, \qquad B_2 = \begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix}
(1)

Their product is zero, B1B2=0B_1 B_2 = 0: the boundary of a boundary is empty. Every complex has this property, and the rest of the note leans on it.

The Laplacian on edges

The Hodge Laplacian on edges adds the view from below, through the vertices, to the view from above, through the face:

L1=B1⊤B1+B2B2⊤L_1 = B_1^{\top} B_1 + B_2 B_2^{\top}
(2)

For the filled triangle the two terms add up to 3I3I, and its kernel holds only zero: every edge signal shows up in one view or the other. Remove the face and only the first term remains. Its kernel is spanned by (1,−1,1)(1, -1, 1), the loop around the triangle: a hole.

Two complexes on the same three vertices and edges. The dimension of the kernel of the edge Laplacian counts the holes that edges go around.
ComplexBoundary of the faceEigenvalues of L1L_1Kernel of L1L_1Holes
Hollow triangleNone0, 3, 3(1,−1,1)(1, -1, 1)1
Filled triangle(1,−1,1)⊤(1, -1, 1)^{\top}3, 3, 3Only zero0

This is the Hodge theorem in miniature: over the reals, the kernel of LkL_k has one dimension for each kk-dimensional hole. Checking it takes a few lines:

laplacian.py
import numpy as np

B1 = np.array([[-1, -1,  0],
               [ 1,  0, -1],
               [ 0,  1,  1]])
B2 = np.array([[1], [-1], [1]])
assert not (B1 @ B2).any()     # the boundary of a boundary

L1 = B1.T @ B1 + B2 @ B2.T
print(np.linalg.eigvalsh(L1))  # [3. 3. 3.]: no holes

# Without the face, one eigenvalue is zero: one hole.
print(np.linalg.eigvalsh(B1.T @ B1))  # about [0. 3. 3.]

What a network gets from it

The two halves of L1L_1 are two ways for edges to be neighbors. B1⊤B1B_1^{\top} B_1 links edges that share a vertex, and B2B2⊤B_2 B_2^{\top} links edges that lie on a common face. A message passing layer on edges can give each its own weights. The layer on the paper page passes its messages along the same two boundary maps.