CatColab 0.2: Wren

technology
double categories
CatColab
Author
Published

2025-02-05

Abstract
Today we’re excited to announce the first alpha release of CatColab 0.2: Wren. CatColab is software for making models of the world together.

We’re pushing out a major release comprising our CatColab work over the last quarter. If you’re just tuning in to the project, see my first blog post on the topic.

This is an alpha release, that is, CatColab is still experimental software with many features on the roadmap. However, we now have a more full-featured user-accessible database for storing, saving, and sharing your models, and we intend to migrate your data along with all future updates. Therefore, from today, we think CatColab is ready for real exploration for adoption as a part of your scientific modeling work.

1 What’s new?

1.1 Accounts and permissions

As I just hinted, perhaps the most immediately obvious change is that you can now have your own personal CatColab account! Simply click the hamburger menu in the upper-left of any page in the app to find an option to log in, via Google, GitHub, or a new account. If you click “Edit user profile”, you can choose a username and a display name, for sharing models with friends and collaborators.

The primary function of user accounts at this point is to share permissions. When you make a new model while logged in, you’ll see a permissions button in the upper-right corner of your screen. You can set global permissions for anyone with the link to be able to view or edit the document (or leave it completely private, the default). You can also set these permissions one person at a time, via username.

This allows you to share models you build without the concern that recipients will mess with all your beautiful work. As a first proof of concept for this, here is an immense causal loop diagram I built. It may appear that you can edit it, but those changes will only appear locally! You can’t mess up my original copy.

1.2 Diagrams in models

In some theories, most notably ologs and schemas, you’ll now see an option (in the hamburger menu at top-left) to create a new diagram in the current model, as well as the pre-existing option to create a new analysis. What’s a diagram in a model? Well, you may know that ologs were introduced in large part to give a category-theoretic notion of database schema. (All the moreso for schemas themselves!) The ontology logs the kinds of things you can have in your database and how they connect to each other (the “tables” and “foreign keys” in database lingo) and then a database instance actually populates that ontology with some particular things and their particular relationships. For instance, you can see a small database of 19th-century realist novels and novelists here. You can get back to the ontology this diagram lies within using the “instance of…” link, and we can visualize the database in much the same way as we visualized a model:

Some 19th-century novels visualized via CatColab

Some 19th-century novels visualized via CatColab

If you want some mathematical detail on what’s going on here, recall that a database instance on an olog is just a functor from that olog to the category of sets; this can also be seen as a profunctor from the terminal category to that olog, or in other words a right module over that olog. Following a definition of Bob Paré, Evan and Michael Lambert have developed a notion of bimodule between models of double theories which specializes to a profunctor between categories. With some finagling this gives a nice notion of one-sided module, or instance, over a model of a double theory as well. One way to present a right module over a category is simply via a diagram in that category, and it’s that presentation we’ve implemented here, since the UI could be so similar to that for models in general.

What’s most interesting to me about this feature is that it adds a whole new level to the architecture of the software. At the lowest level is the doctrine, something invisible to the user but which currently distinguishes the stock-flow theory, where links can run “across levels” from stocks to flows, from other “simple” theories. Next up is the theory level itself, which the user selects between but currently can’t modify based on what classes of things are needed in their modeling activity. At the third level is the model, where the user constructs a specific ontology, and at the top level is the diagram or instance, where the user populates that ontology with concrete data. We’re quite excited to continue exploring the potential of building out and interoperating these four levels!

1.3 Multiphysics simulation with Decapodes

A particularly novel theory for this release is the discrete exterior calculus. A big chunk of our work this quarter was on the ongoing ASKEM project, specifically around compositional PDE modeling. The discrete exterior calculus is a language we’ve already been using for some time in AlgebraicJulia toward this end in the Decapodes.jl library, developed primarily by Luke Morris in the GATAS lab at the University of Florida.

Our new work this quarter was to build a diagrammatic representation of a PDE system in CatColab, then export from there to AlgebraicJulia to actually solve the system in Decapodes, which sends an animation of the solution back to CatColab for later display. We think this is a much more usable interface to Decapodes. The interaction with AlgebraicJulia is currently a bit complicated to set up, though we have instructions to do so here if you’re a bit intrepid; in probable lieu of reproducing this yourself, let me just show you some vortices here!

1.4 Other new theories and analyses

The library of theories has ramified a bit from last release. You’ll see that a new model now starts in the “Informal” theory, which allows nothing but rich text; mathematically, it’s the empty double theory and so is a natural place to start.

We’ve added some decorated versions of the causal loop diagram language: you can now add delays and indeterminates to the edges in your causal loop diagrams to refine the types of causal influences you’re modeling. These are a couple of special cases of a quite general theory of decorations for edges in causal loop diagrams John Baez has been discussing in a series of blog posts lately on joint work with Evan, Nate Osgood, and Xiaoyan Li. Also around systems dynamics, we now have a mass-action-style ODE semantics for stock-flow diagrams. It’s similar in feel to the Lotka-Volterra semantics for causal loop diagrams we had in the previous release, but can express a different class of differential equations, roughly the polynomial ODEs in which certain sums of state variables are conserved.

1.5 More documentation

You can find help on each theory you may be in by clicking the question mark symbol in the top bar. There are links in many of these documentation pages to example models, as well as further reading about the modeling language at hand.

2 What’s next?

For one thing, now that we’ve reached an alpha release, we expect to get onto a more continuous release schedule. So you should see new features pop up regularly with no particular notice!

Among the near-term features we have coming down the pike are

  • JSON import and export for models and diagrams, so you can store your files locally on your own machine
  • A public profile page listing all your documents, for easier sharing
  • Versioning, so that you can use somebody else’s document and not have it change under your feet right when they update.
  • Migrating models to more complicated theories

Over the next couple of months, we’re also working on:

  • A thicker library of examples, particularly in epidemiological use cases
  • Search capabilities in the database
  • Composing models out of smaller ones
  • Improvements to the rich text editor in text-only cells

3 Thanks for reading!

If you’re interested, curious, excited, scared, amused, bored, inspired, or have any other reaction to this post or, better yet, to your experience with CatColab you’d like to share, feel free to leave me a comment below or drop me a line. If you like to code, you’re very welcome to come check out (pun intended) our repo. Talk soon!

Leaving a comment will set a cookie in your browser. For more information, see our cookies policy.