Skip to main content
QUICK REVIEW

[Paper Review] Compositional Scientific Computing with Catlab and SemanticModels

Micah Halter, Evan Patterson|arXiv (Cornell University)|May 11, 2020
Distributed and Parallel Computing SystemsComputer Science7 references10 citations
TL;DR

This paper introduces Catlab.jl and SemanticModels.jl, a category-theoretic framework in Julia that enables compositional scientific computing through decorated cospans and generalized algebraic theories (GATs). By modeling scientific systems as morphisms in symmetric monoidal bicategories, the approach allows automatic solver generation, model composition, and structural comparison across domains like epidemiology and Petri nets, significantly reducing manual coding and enhancing reusability and formal verification in scientific modeling.

ABSTRACT

Scientific computing is currently performed by writing domain specific modeling frameworks for solving special classes of mathematical problems. Since applied category theory provides abstract reasoning machinery for describing and analyzing diverse areas of math, it is a natural platform for building generic and reusable software components for scientific computing. We present Catlab.jl, which provides the category-theoretic infrastructure for this project, together with SemanticModels.jl, which leverages this infrastructure for particular modeling tasks. This approach enhances and automates scientific computing workflows by applying recent advances in mathematical modeling of interconnected systems as cospan algebras.

Motivation & Objective

  • Address the lack of compositional, reusable, and formally grounded scientific modeling frameworks in computational science.
  • Overcome the limitations of monolithic domain-specific modeling frameworks by enabling model composition and transformation using category theory.
  • Develop a general-purpose metamodeling framework that supports model comparison, composition, and automatic solver generation across diverse scientific domains.
  • Bridge symbolic computation with numerical simulation by integrating categorical logic with existing scientific computing stacks like DifferentialEquations.jl and Petri.jl.
  • Enable scientists to define complex models using intuitive, hierarchical, and formally verifiable structures based on decorated cospans and GATs.

Proposed method

  • Represent scientific models as decorated cospans in a symmetric monoidal bicategory, where objects are input/output variable sets and morphisms are open systems.
  • Use generalized algebraic theories (GATs) in Catlab.jl to formally define algebraic and categorical structures, including monoidal categories and quantum circuits.
  • Implement three syntactic representations for morphisms: point-free formulas (e.g., (f⊗g)·h), string diagrams (via TikZ/Graphviz), and imperative-style program syntax.
  • Compose models via sequential composition (g∘f) and parallel composition (f⊗g), corresponding to serial and concurrent execution of systems.
  • Automatically generate simulations by interpreting wiring diagrams (string diagrams) as executable models, with parameters mapped to reaction rates or coefficients.
  • Integrate with existing Julia scientific computing packages (e.g., DifferentialEquations.jl, Petri.jl) to execute and solve models without low-level coding.

Experimental results

Research questions

  • RQ1How can category theory be used to formally define and compose scientific models across diverse domains such as epidemiology and systems biology?
  • RQ2Can decorated cospans in symmetric monoidal bicategories provide a unified, compositional framework for model composition, comparison, and solver generation?
  • RQ3To what extent can generalized algebraic theories (GATs) in Catlab.jl automate symbolic reasoning and representation of mathematical structures in scientific computing?
  • RQ4How does the integration of categorical modeling with existing scientific computing stacks reduce development effort and increase model reusability?
  • RQ5Can hierarchical, diagrammatic representations of models (e.g., string diagrams) enable intuitive, scalable, and formally verifiable model construction and simulation?

Key findings

  • The framework enables automatic solver generation for new scientific models by interpreting their categorical structure, eliminating the need for manual implementation of differential equations or transition rules.
  • Model composition via sequential and parallel operations (∘ and ⊗) allows the construction of complex systems—such as dual-infection models between humans and mosquitoes—from basic building blocks like infection and recovery processes.
  • The use of string diagrams and program syntax in Catlab.jl provides a human-readable, executable, and formally grounded interface for defining morphisms in monoidal categories.
  • SemanticModels.jl successfully integrates with Petri.jl and DifferentialEquations.jl, enabling end-to-end simulation of models defined via decorated cospans with minimal additional code.
  • Structural comparison of models (e.g., SIR vs. SIRD) reveals shared substructures (e.g., infection model F) and distinct components (e.g., recovery with death transition γ), enabling formal analysis of model variants.
  • The framework demonstrates that categorical abstractions like decorated cospans can serve as a foundation for a general-purpose scientific metamodeling ecosystem, supporting reuse, verification, and extensibility across domains.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.