Skip to content

epa058/MC-MCMC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

(Metropolis-Coupled) Monte Carlo Markov Chain

This project visualizes the electron orbitals of a hydrogen atom by sampling the wavefunction probability density $|\psi_{n \ell m}(r, \theta, \varphi)|^2$ using Markov Chain Monte Carlo (MCMC) methods. It implements two sampling strategies:

  • Hydrogen MCMC: A standard Metropolis-Hastings random walk.

  • Hydrogen MCMCMC: A Metropolis-coupled MCMC (thermodynamic MCMC). Metropolis-coupled MCMCs run multiple MCMC chains in parallel at different temperatures. Only the coldest chain samples the target probability density, while hotter chains explore flattened versions of it. Periodic swaps between chains allow the cold chain to traverse low-probability barriers, greatly improving mixing.

FAQ

Q: Why did you start this project?

A: Because I didn't know what MCMCs were, and that was making me insecure. Actually, that's not even true. I've used the Metropolis algorithm before to simulate Ising models. Sorry Adrian, I promise I learned a lot from your class.

Q: What if I want 2D visualizations?

A: Go here.

Q: Why would anyone use a MCMC when we know the analytical form of the hydrogen wavefunction?

A: Because I am stupid Because if I implemented a Diffusion Monte Carlo (DMC) instead, I wouldn't be able to visualize anything other than the ground state due to the fixed-node error, which is an interesting problem. I'll work on it!

Q: What next?

A: The actual reason for wanting to do this project was because I came across this video by minutephysics a few years ago and wanted to recreate their animations, but couldn't find any of their source files. Turns out someone else had the exact same idea and beat me to it: https://asliceofcuriosity.fr/blog/posts/rendering3.html (Wagyx). Like them, I also want to get better at JavaScript, so I will try to make my own application. However, unlike them, I am lazy and will probably not get to it any time soon.

About

Metropolis-Coupled Monte Carlo McChicken Markov Chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages