PB

simulating · codes in progress

explorations

Interactive computational-physics notebooks, each a small machine you can run in the browser. Pick one, push its sliders, watch it behave. Every card opens its own page with the live notebook, the figures, and the source.

explorations

active matter: vicsek model + run-and-tumble

Two faces of active matter in one place. The Vicsek model is the crowd: a few hundred self-propelled particles that each steer toward the average heading of their neighbours, with a little noise mixed in. Turn the noise up and the flock scatters; turn it down and the whole swarm commits to a single direction. That switch is a real phase transition, and the order parameter follows it as I sweep the noise. Run-and-tumble is the single cell: a swimmer that runs straight, reorients at random, and runs again. Its mean-squared displacement starts ballistic and turns diffusive right around the tumble time, and the effective diffusion constant I read off matches the analytic value.

explorations

coupled oscillators: kuramoto synchronization + chimera states

A population of oscillators, each ticking at its own natural frequency, all nudging each other toward sync. Below a critical coupling they drift apart; above it they fall into step, and the onset lands right where mean-field theory says it should. The second half is stranger. On a ring with a phase lag, identical oscillators can split themselves into a synchronised arc and an incoherent one at the same time. These chimera states are not supposed to exist by symmetry, but they do, and watching one form on the ring is the best part.

explorations

causal inference: transfer entropy + ccm + causal emergence

Telling which signal drives which, from data alone, is harder than it sounds, because correlation is symmetric and says nothing about direction. I built three tools that do say something. Transfer entropy measures how much one series’ past cuts the uncertainty in another’s future. Convergent cross-mapping handles the deterministic systems where transfer entropy struggles, rebuilding one variable’s history from the other’s attractor. Causal emergence asks a different question altogether: whether a coarse-grained view of a system can carry more causal weight than the fine-grained one underneath it. I run all three on shared benchmarks and watch where they agree and where they split.

explorations

physics discovery: sindy + conservation laws + symbolic regression

Three ways to pull physics back out of raw trajectory data. SINDy fits a sparse handful of terms from a candidate library and recovers the actual equations of motion for systems like the Van der Pol oscillator. A kernel method asks instead what stays constant along the motion, finding conserved quantities without being told their form. Symbolic regression evolves expression trees until one of them rediscovers a closed-form law, like the pendulum period. Same data, three different questions: what are the dynamics, what is invariant, and what is the law.

explorations

spin glass analysis of neural network training

Training a neural network is really a walk downhill on a bumpy, high-dimensional surface, and that surface behaves a lot like a spin glass. I train a small network and watch the curvature of the loss landscape through the diagonal of the Hessian. The inverse participation ratio of that curvature spectrum tells me how the minimum is shaped: spread flat across many directions early on, the glassy phase, then concentrating into a few sharp directions as training settles. It is a small, hands-on way into the physics behind the 2024 Nobel.

explorations

physics-constrained cd spectral inversion

Circular dichroism spectroscopy reads out a protein’s secondary structure, but only forwards: given the helix, sheet, and coil fractions, you can predict the spectrum from reference curves. I wanted to go backwards and recover the composition from a measured, noisy spectrum. That inverse problem is ill-posed, so I pin it down with the physics that has to hold: the fractions are non-negative and sum to one. It comes straight out of CD experiments I ran in the lab, and watching that constraint rescue an otherwise unstable inversion is the satisfying part.

explorations

percolation on simplicial complexes

Ordinary percolation lives on a graph: add links until a giant connected cluster appears. I pushed it up a dimension, onto simplicial complexes where the pieces are triangles and tetrahedra, not just edges. The higher-order versions do not ease into their transition the way ordinary networks do; they snap, much closer to discontinuous. I track the giant component and the susceptibility across the occupation probability and use finite-size scaling to pin down where the jump sits.

explorations

minimal reservoir computing

A reservoir computer forecasts chaos by pushing a signal through a big fixed random network and training only a linear readout. The question I cared about: how small can the reservoir get before it stops working? I map prediction quality across the sparsity and spectral-radius plane, scoring each setup by how many Lyapunov times its forecast stays valid, with the Lyapunov exponent computed straight from the dynamics rather than looked up. I run it on the Lorenz and Rossler flows and the Henon map to find the smallest network that still tracks each attractor.

explorations

differentiable pendulum: parameter inference

A double pendulum is chaotic, but its masses and arm lengths still leave a fingerprint in the motion. I treat the RK4 simulator as a differentiable forward model and run gradient descent on a loss that compares simulated and observed trajectories, recovering the physical parameters from noisy data to within a few percent. It is the mirror image of the chaos work: instead of predicting motion from parameters, I infer parameters from motion.

explorations

gō model: protein folding free energy

A simplified, off-lattice Go model of a small protein, folded with Monte Carlo. The payoff is the free energy landscape as a function of the fraction of native contacts: the folded basin, the unfolded one, the barrier between them, and the temperature where folding tips over. It is the coarse-grained, statistical-mechanics picture of folding, and it connects directly to the spectroscopy I did in the biophysics lab.

explorations

driven quadruple pendulum

A driven, damped pendulum is about the simplest thing that goes chaotic, and this one has four coupled segments. I derived the equations of motion, wrote a custom RK4 integrator, and used phase portraits, Poincare sections, and Lyapunov divergence to watch the route into chaos as the drive turns up. Co-authored with Soham Bhar for a computational physics course.

explorations

quantum wavepacket — schrödinger in any potential

One solver for every one-dimensional quantum scattering problem in the textbook. A Gaussian wavepacket evolves under the time-dependent Schrodinger equation by a split-step method that stays unitary and conserves the norm, through any of six built-in potentials or one you type in yourself. The wavefunction is drawn as a 3D Argand helix: the real and imaginary parts live on perpendicular planes and the probability density sits on the floor, with the view tracking the packet as it moves and spreads. Below it, the live density reports the norm and the transmission and reflection coefficients.

explorations

gray-scott reaction-diffusion — turing patterns

Two chemicals, one that activates and one that inhibits, diffusing at different rates. That is all it takes for a flat, featureless state to break into spots, stripes, and labyrinths on its own. This is Turing’s idea made concrete with the Gray-Scott equations on a grid. Sweeping the feed and kill rates walks you across the whole Pearson diagram of patterns, and watching one grow out of random noise does not stop being a little surprising.

← back to home