Show HN: Python Simulator of David Deutsch’s “Constructor Theory of Time”
github.comHi HN,
I turned the freshly published paper “The Constructor Theory of Time” by David Deutsch and Chiara Marletto (arXiv, 13 May 2025) into an executable Python library.
What you’ll find • One-to-one translation of the paper’s formalism: Substrates, Attributes, Tasks, Constructors, and task-algebra operators • Possibility / impossibility predicates and counterfactuals encoded exactly as defined • Test suite that mirrors every lemma and example (>95 % coverage, mypy-typed) • Reproductions of key results: time-keeping substrates, irreversibility proofs, quantum branching tasks, and a self-replicating constructor
Why share? Reading the paper is tough going; expressing each definition in code clarified the ideas and surfaced a couple of questions for discussion. Hoping it helps others and sparks extensions.
Looking for feedback: • Did I miss any subtleties in the formalism? • Which additional theorems or examples would you like implemented next?
Repo: https://github.com/gvelesandro/constructor-theory-simulator
Thanks for taking a look—issues and PRs welcome!
Clearly a labor of love. Props to you
I suppose if one is teaching or evangelizing constructor theory, this could be sort of like an interactive textbook
Needless to say, constructor theory hasn't really earned a stable foothold in mainstream physics, and there's a lot of hype in this space, but that's not a criticism of this particular project, just good to know for anyone not familiar
The quantum gravity + graviton tasks stuff especially. without a falsifiable physical model backing it, this can feel like mathematized cosplay. But that has more to do with constructor theory vs this project
Would love to see someone do a pluggable backend so you could test different "task ontologies" against each other.
Mainly I came here to say that categories can likely be used to great effect here a la Geroch
For instance you can start by modeling tasks as morphisms between substrate states (objects), and then enforce composition explicitly. define constructors as functors that map tasks and substrates while preserving structure.
for quantum or irreversible effects, use monads to encapsulate branching and decoherence. Then one could represent task sequences as categorical diagrams and check for commutativity. Or embed substrates via Yoneda to expose behavior in terms of available tasks
https://arxiv.org/abs/2401.05364
>In this work, we show how to formulate fundamental notions of constructor theory within the canvas of process theory. Specifically, we exploit the functorial interplay between the symmetric monoidal structure of the category of sets and relations, where the abstract tasks live, and that of symmetric monoidal categories from physics, where concrete processes can be found to implement said tasks.
This is very helpful and insightful. Thank you!
Can it simulate a hydrogen atom? How about two hydrogen atoms coming into contact with various energies?
Here you go:
https://github.com/gvelesandro/constructor-theory-simulator/...
Not sure what to make of this. The only relation with the hydrogen atom is that it has the name "Hydrogen" in the code. And the only relation with the energy is that is has a float value called "energy_gap" which has some random hardcoded value.
Thanks for adding it :)
I do have a question ... it seems you modeled the hydrogen atom specifically, but how does that work if a larger nucleus falls apart? Would it be possible to do the modeling at a lower level?
when I run the demo.py, its static in matplotlib window, should it move right ?
What is it for ?
https://en.wikipedia.org/wiki/Constructor_theory
"The fundamental elements of the theory are tasks.. A task is impossible if there is a law of physics that forbids its being performed with arbitrarily high accuracy, and possible otherwise. When it is possible, a constructor for it can be built, again with arbitrary accuracy and reliability."