As part of my PhD I do computational modeling of quantum-biological systems. One of my simulations was misbehaving and in certain cases could take 8 hours to complete. That's really bad when you're trying to iterate quickly. This post describes how I made a series of optimizations to reduce the runtime by 250x via profiler driven algorithmic improvements, rewriting the core in Rust, and making use of parallelism.| Tinkering
As part of my research I found an excuse to use Rust. `polsim` is a commandn line utility for simulating the polarization of a laser beam as it interacts with a sequence of optical elements. In this post I'll describe `polsim` itself and my experience using Rust to write it rather than Python.| Tinkering
By playing with the Python AST we can add functionality with making the user write any extra code. You may use this power for good or evil.| Tinkering