JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Discrete Exterior Calculus: Cochains, Coboundary & the Discrete Hodge Star

Smooth differential forms eat oriented pieces of a manifold and spit out numbers — so on a mesh, just store one number per oriented simplex and let Stokes' theorem define the exterior derivative for you. That single idea, made literal, gives a complete calculus on a triangulation: cochains, a coboundary that squares to zero, and a discrete Hodge star that turns it into the geometry your mesh actually has.

A form is a thing you integrate — so discretize the integral

From the forms rung you know a smooth differential k-form omega is not really a function on points — it is a machine that eats an oriented k-dimensional piece and returns a number, namely the integral of omega over that piece. Discrete exterior calculus (DEC) takes this definition completely literally. Fix the simplicial complex you built in Guide 1 — vertices, edges, triangles, tets, all oriented — and instead of storing omega itself, store only its integrals over the simplices. A discrete k-form, called a k-cochain, is just one real number assigned to each oriented k-simplex. Nothing more: a 0-cochain is a value per vertex, a 1-cochain is a value per oriented edge, a 2-cochain is a value per oriented triangle.

This is a genuine choice with consequences, and it is worth saying out loud what we threw away. A smooth 1-form on an edge carries infinitely much data; we keep one number, its integral over the edge, and forget the rest. So DEC is a sampling scheme, and like all sampling it is faithful only up to mesh resolution — refine the triangulation and the discrete object converges to the smooth one. The trade we get for that loss is enormous: the discrete theory is exact, not approximate, in its algebra. Stokes' theorem will hold on the nose, d will square to zero on the nose, and de Rham cohomology will come out integer-for-integer right, all on a finite mesh a computer can hold.

The coboundary is just Stokes' theorem, read as a definition

Now the central trick. We need a discrete exterior derivative d that sends k-cochains to (k+1)-cochains, matching the smooth d that you already know raises form-degree by one. We do not approximate any derivative — we let Stokes' theorem tell us the answer. Smooth Stokes says the integral of d omega over a region sigma equals the integral of omega over the boundary of sigma. The left side is exactly the value of the discrete (k+1)-cochain d omega on the simplex sigma; the right side is a signed sum of the values of omega on the boundary faces of sigma. So we simply DEFINE the discrete exterior derivative by that equation: (d omega)(sigma) = sum over the boundary faces of sigma, with orientation signs, of omega on each face.

Make it concrete on an edge. Let omega be a 0-cochain, i.e. a value f at each vertex, and let e be the oriented edge from vertex a to vertex b. Its boundary is the head minus the tail, b - a, so (d omega)(e) = f(b) - f(a). That is the discrete gradient: a 1-cochain whose value on each edge is the difference of the endpoint values. Climb one rung: for a 1-cochain alpha and an oriented triangle T = [a, b, c], the boundary is the three edges [a,b] + [b,c] + [c,a], and (d alpha)(T) = alpha(ab) + alpha(bc) + alpha(ca) — the discrete curl, the net circulation of alpha around the triangle's rim. The exterior derivative is nothing but signed accumulation over a boundary, and that is purely combinatorial.

0-cochain f  (one value per vertex)
    |  d_0   (discrete gradient)          (d f)(a->b) = f(b) - f(a)
    v
1-cochain a  (one value per edge)
    |  d_1   (discrete curl)              (d a)([a,b,c]) = a(ab)+a(bc)+a(ca)
    v
2-cochain w  (one value per triangle)
    |  d_2   (discrete divergence-of-rotor, etc.)
    v
3-cochain ...

Matrix view:  d_k = transpose of the boundary operator  partial_{k+1}
              entries are only  -1, 0, +1   (the incidence/orientation signs)
              d_{k+1} composed with d_k  =  0     (since partial-partial = 0)
The coboundary d_k is the signed incidence matrix — the transpose of the boundary operator — and d composed with d vanishes because the boundary of a boundary is empty.

Why d-squared is zero, exactly, and why that hands you cohomology

The smooth identity d(d omega) = 0 is one of the load-bearing facts of the forms rung; its discrete shadow is even cleaner. Stack the cochain spaces and the coboundary maps and you get a sequence C^0 -> C^1 -> C^2 -> ... where each arrow is a d. This is a cochain complex, the dual of the chain complex you used for simplicial homology. The discrete d is, entry for entry, the transpose of the simplicial boundary operator partial. So d composed with d is the transpose of partial composed with partial — and partial-partial = 0 is the bedrock fact that the boundary of a boundary is empty. Transpose a zero map and you still get zero. So d^2 = 0 holds EXACTLY on any mesh, not approximately, inherited directly from a combinatorial truth about simplices.

Because d^2 = 0, the same closed/exact bookkeeping you ran in the smooth case runs here. A cochain is closed if d of it is zero (a discrete closed form), and exact if it is d of something. Closed-modulo-exact is the simplicial cohomology H^k of the mesh, and by the discrete analogue of the de Rham theorem its dimension is the k-th Betti number — the count of k-dimensional holes you already met in Guide 1. So if you compute the dimension of the kernel of d_k minus the rank of d_{k-1}, by pure linear algebra on integer matrices, out pops the Betti number: connected components, independent loops, voids. DEC turns the smooth-geometry statement of de Rham cohomology into a finite rank computation a laptop finishes in milliseconds.

Where the geometry enters: the discrete Hodge star

So far everything was combinatorial — the same answer on any mesh of the same shape, blind to edge lengths and angles. But real calculus needs a metric: the smooth Hodge star * uses the Riemannian metric to convert a k-form into its complementary (n-k)-form, and it is what lets you form inner products, the codifferential, and the Laplacian. DEC supplies this through the discrete Hodge star, and here is the crucial structural idea: it maps a k-cochain living on the primal mesh to an (n-k)-cochain living on the DUAL mesh. The dual of a triangulation puts a dual vertex at each triangle (its circumcenter), a dual edge crossing each primal edge, and a dual face around each primal vertex. Primal k-simplices pair off with dual (n-k)-cells exactly as forms pair with their Hodge duals.

In its simplest, diagonal form the discrete Hodge star is breathtakingly concrete: the star of a primal k-cochain on a simplex is its value times the ratio of the dual cell's measure to the primal cell's measure. For a 1-cochain on an edge e, that ratio is (length of the dual edge) / (length of e). Compute the dual edge by joining the circumcenters of the two triangles sharing e, and a short trigonometric simplification turns that length ratio into exactly (cot alpha + cot beta) / 2, where alpha and beta are the two angles opposite e in those triangles. That cotangent weight is not a coincidence — it is the discrete Hodge star, and in the next guide it assembles into the celebrated cotangent Laplacian that drives all of mesh processing.

Putting it together: the discrete Laplacian and Hodge decomposition

With d (combinatorial) and the Hodge star * (metric) in hand, every smooth operator you want assembles by the same formulas as in the continuous theory. The discrete codifferential is delta = (sign) * d *, the metric adjoint of d that lowers degree, and the discrete Hodge Laplacian is Delta = d delta + delta d, exactly mirroring the smooth Hodge Laplacian. On 0-cochains this reduces to the discrete Laplace-Beltrami operator acting on functions sampled at vertices — and when you write it out with the diagonal cotangent star, you get precisely the cotangent Laplacian of the next guide, the matrix whose (i,j) entry is minus (cot alpha_ij + cot beta_ij)/2 for an edge ij and whose diagonal balances each row.

And the payoff theorem comes along for free. Because cochain space is finite-dimensional, the Hodge decomposition is just the orthogonal-complement decomposition of a vector space under the inner product the Hodge star defines: every cochain splits uniquely as exact + coexact + harmonic, where harmonic means killed by Delta. The harmonic part is the genuinely topological remnant — its dimension equals the Betti number again — so harmonic 1-cochains are a concrete basis for the loops of your surface. The smooth Hodge theorem is a hard analytic result requiring elliptic PDE theory; its discrete sibling is a one-line consequence of linear algebra, which is precisely the bargain DEC offers: trade analytic depth for a finite, exact, computable model that keeps the structure intact.

  1. Orient the mesh and store data as cochains: one number per vertex (0-cochain), per oriented edge (1-cochain), per oriented triangle (2-cochain).
  2. Build each coboundary d_k as the signed incidence matrix (the transpose of the boundary partial), entries only -1, 0, +1; this is pure combinatorics and gives d^2 = 0 exactly.
  3. Build each Hodge star *_k as a diagonal matrix of dual-cell over primal-cell measures, using circumcenters; for edges this is the cotangent weight (cot alpha + cot beta)/2.
  4. Assemble delta = (sign) *^{-1} d^T * and the Laplacian Delta = d delta + delta d; its kernel is the harmonic cochains, and dim of that kernel is the Betti number.