Programming for Particle Physics - Monte Carlo simulations and Markov Chains

Call me Ishmael. Some years ago - never mind how long precisely - having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. 

I'll tell you a story from my ongoing adventure in physics.

Though I do a lot of bioinformatics research, I've always secretly loved physics more than any other subject. (Maybe it's not much a secret since I am a physics major.) I never really saw a reason why I couldn't do research in both fields while I was an undergraduate, so I decided to just follow wherever my heart leads me in whatever field I enjoy the most. That's why I do research in both fields. Recently, I've joined a project at a computational physics lab here at IU in the Fox Lab. As exited as I am to get into this research, it requires a very deep level of understanding of mathematics and abstract physics concepts, unlike my research in Biology.

From my weeklong excursion to Canada last summer. (Kitchener uptown)
Imagine that, one fine, beautiful night, around 1 or 2 in the morning, you're walking home from a party. Unfortunately, you had a bit of too much fun, so you struggle down the street and stumble to see the road in front of you. Instead of doing the right thing and calling for a friend or trusted adult to help, you decide to latch yourself onto a streetlamp until you start really feeling it again. Now, as you stand by this street lamp, every now and then, you put together your willpower and courage in order to let go and start walking again. But, you find yourself meandering aimlessly without any control whatsoever, and occasionally, end up hitting your head in the street lamp.

The moral of the story is to study mathematics. Especially if you want to be a physicist.

This drunken behavior is a random walk. And it's similar to the basis for the Markov Chain, which constructs the probability of future events that are independent of the probabilities of the past events, but dependent on the present conditions. It basically accounts for randomness in different sciences and processes such as Brownian motion.

Brownian Motion (Source)
A while ago I made a blog post about Comparing Genome Alignments in which I touched on a few models for creating alignments form given genome inputs. What this algorithm uses is a Markov Model which creates nodes that string together to form full-fledged genomes. Markov Models work by assuming the Markov property that I just described, and the Genome Alignment algorithm uses it to, well, align genomes of different species. But why limit yourself to Biology? Why not extend it to particle physics?

And what could be more exciting than the world of particle physics? Making Monte Carlo simulations to study the decay and interactions of subatomic particles, of course!

We can probabilistically determine the energies of momenta of the particles in the following reaction:

γ +  p --> π+ + π- + πo + p

This is how a photon and proton collide in order to form three pions (plus, minus, and naught), along with a proton. When this collision happens, we want to know how the energy and momenta of the particles change. We can do a Monte Carlo simulation (or a computational test that gives us probabilities of different results) of this Markov process to get the probabilities of various outcomes of this interaction.We run thousands of trials with different collisions and take a look at the values of the particles throughout the collision. This means that, according to our Markov property, the process is like a bunch of drunk people running into each other on the street.

I like to think of the randomness of particles physics almost like the tumultuous waves of the ocean that rock back and forth. A single event doesn't tell much, but, together, they show beautiful patterns about the world we live in.

From my stay at Cornell University last summer
I do not know what I may appear to the world, but to myself I seem to have been only like a boy playing on the sea-shore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me. - Sir Isaac Newton