Decapodes

A Kelvin–Helmholtz instability, simulated by a Decapodes specification, from the compositional methods talk.

Physics is written down as equations and then rewritten, by hand, as a solver. The rewrite is where the modeler’s intent goes missing: the code that runs bears no mechanical relationship to the system of equations it came from, so changing the physics means changing the program, and the two drift apart.

Decapodes closes that gap. A physical system is written as a diagram – variables as nodes, differential operators as arrows – and the diagram is the artifact the software operates on. Diagrams compose, so a multiphysics model is assembled from the single-physics models it is made of rather than derived again from scratch, and the composite diagram compiles to a solver. The discrete exterior calculus supplies the operators, which is what lets the same specification run on a plane, a sphere or an arbitrary mesh without being rewritten for each.

Point vortices spiraling Point vortices spiraling

Project team

How the papers fit together

Luke Morris led this project until his graduation in May 2026 and George Rauta now has the reins. James Fairbanks is an author on the papers below, so each entry names the rest of the collaborators.

A diagrammatic view of differential equations in physics, with Evan Patterson, Andrew Baas and Tim Hosgood, is the mathematics: it takes the diagrams physicists already draw and makes them a syntax, with morphisms of diagrams as the way one system is built out of another.

Decapodes: a diagrammatic tool for representing, composing, and computing spatialized partial differential equations, with Andrew Baas, Jesus Arias and Maia Gatlin of the Georgia Tech Research Institute and Evan Patterson, is the implementation and the evidence: the compilation pipeline from diagram to solver, benchmarked against SU2 to show the generated code agrees with an established tool.

The diagrammatic presentation of equations in categories, with Kevin Carlson, Tim Hosgood and Evan Patterson, answers the question the implementation kept raising: when do two diagrams present the same system? That is what says which rewrites the compiler is allowed to perform.

Software

Written elsewhere

Tim Hosgood and Evan Patterson wrote the diagrammatic framework up for a general audience on the Topos Institute blog, in two parts: diagrammatic equations and multiphysics (1) and (2). They are the gentlest way into this project.

Project articles

Where an entry carries a note, it says what the paper establishes and what to read it for.

  1. Currier, K., Leal, W., Rauta, G., Copeland, A., Dixon, W., & Fairbanks, J. P. (2026). Whitney Control Barrier Functions: A Mesh-based Geometric approach via Discrete Exterior Calculus. In IFAC. (in press).

    Control barrier functions built from Whitney forms, so that a safety constraint is a discrete differential form living on a mesh rather than a smooth function on the state space, with the discrete exterior calculus supplying the operators that enforce it. It is where the coordination project and Decapodes meet: the safety machinery of control theory posed in the same discrete exterior calculus the simulation work is built on, so a constraint and the physics it constrains are written over one mesh.

    Read it for The construction of the barrier function from Whitney forms.

  2. Morris, L., Baas, A., Arias, J., Gatlin, M., Patterson, E., & Fairbanks, J. P. (2024). Decapodes: A diagrammatic tool for representing, composing, and computing spatialized partial differential equations. Journal of Computational Science, 81, 102345. https://doi.org/10.1016/j.jocs.2024.102345

    A system of partial differential equations can be written as a diagram, the diagrams can be composed with an operad of wiring diagrams, and the result compiles to a solver by categorical data migration, graph traversal and the discrete exterior calculus. Benchmarked against SU2, the generated solvers agree with an established tool. This is the Decapodes project’s own paper: it is where the representation, the composition operation and the compiler are stated together, and where the claim that generated code is competitive is actually tested.

    Read it for The compilation pipeline and the SU2 comparison. The introduction to the discrete exterior calculus is better read from the CombinatorialSpaces documentation.

    Read first A diagrammatic view of differential equations in physics

  3. Arlin, K., Fairbanks, J. P., Hosgood, T., & Patterson, E. (2024). The diagrammatic presentation of equations in categories. arXiv:2401.09751.

    When is one diagram a presentation of the same system of equations as another? Reading a lift of a diagram against a discrete opfibration as a solution, the paper gives an equivalence of diagrams that holds exactly when the two have the same solutions, and identifies the localisation it generates with a localisation of a slice category along initial functors. The result is then lifted to the 2-categorical setting. Decapodes rewrites diagrams constantly – composing, stratifying, and simplifying them – and this is the result that says which of those rewrites are allowed to change the answer and which are not.

    Read it for The definition of diagram equivalence and the statement of the localisation theorem. The 2-categorical extension is for readers who want the general form.

  4. Patterson, E., Baas, A., Hosgood, T., & Fairbanks, J. P. (2023). A diagrammatic view of differential equations in physics. Mathematics in Engineering, 5(2), 1–59. https://doi.org/10.3934/mine.2023036

    Physicists have long drawn systems of differential equations as diagrams; this puts that practice on a categorical footing, with diagrams as the syntax and morphisms of diagrams – the less appreciated half – as the way one system is built from another. Worked examples run through electromagnetism, transport, and fluid mechanics. It is the mathematics Decapodes implements. Read it if you want to know why a Decapode is a legitimate presentation of a physical system rather than a picture of one.

    Read it for The examples, first. The general theory reads much more easily once you have seen a diagram for a physical law you already know.

Subproject: general categorical equations

Led by Kevin Carlson at the Topos Institute, this is the diagram-equivalence work above, pursued for its own sake rather than for the compiler.

Diagrammatic Presentations of Equations Diagrammatic Presentations of Equations

Sponsors

Decapodes has been supported by the following DARPA programs:

  • Automating Scientific Knowledge Extraction
  • Directly Computable Models
  • Automating Scientific Knowledge Extraction and Modeling