Hacker News · Feb 16, 2026 · Collected from RSS
A pretty simple but fun to play with simulator for a concept from mathematical physics called the "2D Coulomb gas". I originally made this for my Bachelor's thesis to create pretty pictures and build intuition but have recently gotten it a fresh coat of paint and better performance curtesy of WebGPU acceleration (ported with liberal help from Codex to get through all of the boilerplate). Play around with it - hopefully read up more on the 2D Coulomb gas because it is an incredibly deep topic research wise. Comments URL: https://news.ycombinator.com/item?id=47039044 Points: 6 # Comments: 0
Each dot represents an electron experiencing pairwise Coulomb repulsion with every other electron while being confined by an external potential $Q$. The energy of a configuration $z_1, \dots, z_n$ is given by the 2D log-gas Hamiltonian $$H(z_1,\ldots,z_n) = -\sum_{i \neq j} \log\lvert z_i - z_j \rvert + n\sum_{j=1}^n Q(z_j).$$ The 2D Coulomb gas is interesting because this type of Hamiltonian shows up in many different places across mathematics / mathematical physics: Eigenvalues of a random matrix with Gaussian random entries Zeroes of a polynomial with Gaussian random coefficient Fractional quantum hall effect Hele-Shaw/Laplacian growth Vortices in superconductors Consequently, there is a large body of research devoted to deducing properties of this family of systems. For example, in 2017 in was shown that the density of particles near the boundary follows an erfc distribution by means of a remarkably long proof. Of course, with this simulator we minimize the Hamiltonion, not sample from it in a temperature dependent way. We therefore approximate the minimum-energy state which is known as a Fekete configuration. For more on the background and context of these systems, I implore you to look into my bachelor thesis or this blog post. Exact pairwise repulsion is O(n²); very large n may be slow.