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.

StatusReleased
CategoryTool
PlatformsWindows, Linux
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
Authorlisyarus
GenreSimulation
Tags2D, Open Source, Physics

Download

Download
wigner-crystal-win.zip 2 MB
Download
wigner-crystal-linux.zip 1 MB

Development log

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.

(+1)

Show off! :)

Brilliant as always.

(+1)

I don’t necessarily understand the science behind this but it doesn’t make it any less cool!

Thanks! :)