Home


Maxwell's Demon

Posted on

Ok, I didn't actually get to implementing the demon part. But I did build something I've been meaning to try for a while now: running a particle simulation on a server, and streaming visualization info over a websocket. Code is here.

For the simulation, I'm using JAX. The particles interact with the walls of the box (they exert a normal force when a particle starts crossing them), and each other. But I'm looking at all N^2 pairs now, so it's not efficient.

For the server, I'm using Starlette and Uvicorn. Starlette is a lightweight ASGI framework, and Uvicorn is an ASGI server. Together they let you build surprisngly fast async web servers in Python.

For the frontend, I'm using three.js.