Wigner crystal simulation
A downloadable simulation for Windows and Linux
This is fun little a Wigner crystal simulation. It minimizes the energy of a bunch of electrons (which repel each other due to electromagnetic forces) in a radial quadratic potential (i.e. something like V(x,y) = x^2 + y^2). It works by simulating the dynamics with damped forces. The electron-electron repulsion is accelerated through the Barnes-Hut algorithm.
For visualization, the Delaunay triangulation of the points is computed; points having degree 5 are marked red, points with degree 7 are marked blue (both are considered to be defects of the crystal), others are black.
The UI in the upper-left corner controls some simulation parameters:
- Count is the number of electrons in the simulation. Higher values mean slower & less stable simulation, but more interesting effects.
- Step is the time step size. Smaller values lead to slower simulation, larger values lead to instabilities.
- Damping is the velocity damping factor (i.e. the parameter C in v' = -Cv). Smaller values mean hotter simulation (more movement & wiggliness), larger values mean colder simulation (behaves more like gradient descent on energy).
- Precision is the parameter for Barnes-Hut algorithm. Smaller values lead to imprecise electron-electron force calculations & instabilities, larger values increase precision at the expense of slower simulation.
I've no idea how useful that is, but at least it's fun to watch, so I figured I'd share it. If you enjoyed it, please let me know, I'll be more than happy :)
The full code for this project is here. It uses my own C++ game engine (which is used for most other projects I've released here as well).
This project was inspired by John Carlos Baez's post on mastodon about Wigner crystals.
Status | Released |
Category | Tool |
Platforms | Windows, Linux |
Rating | Rated 5.0 out of 5 stars (1 total ratings) |
Author | lisyarus |
Genre | Simulation |
Tags | 2D, Open Source, Physics |
Development log
- Switch to damped dynamicsDec 10, 2022
- Small updateDec 09, 2022
Comments
Log in with itch.io to leave a comment.
I am extremely pleased to find this scientific simulation!
One can certainly wonder if this project, taken to 3 dimensions, could then simulate x-ray diffraction. All so be used as a training simulation for crystallography. ...and if you were to train a Neural Network on these simulations, you could have a semi-helpful prediction tool that can withstand the noise that's naturally in a crystal — but can also try to detect the subtle intricacies of what's inside certain proteins.
Show off! :)
Brilliant as always.
I don’t necessarily understand the science behind this but it doesn’t make it any less cool!
Thanks! :)