pylj#
pylj runs molecular dynamics and Metropolis Monte Carlo simulations of atoms interacting through pair potentials, in two dimensions, and draws them as they run. It is a teaching code, written in Python and NumPy.
Installation#
pip install pylj
pylj needs Python 3.11 or later. To watch the figures redraw you need a Jupyter notebook; start each notebook with %matplotlib inline. In a script, a viewer’s fig is a matplotlib figure that can be saved.
Contents#
Getting started: a model, a molecular dynamics run and a Monte Carlo run.
Simulations: building a simulation, the configuration, the two
step()methods, sampling and restarting.Custom potentials: the
PairPotentialinterface and mixtures.Viewers and panes: the viewers, and writing a pane.
Modules: every class, function and argument, with units.
Citing pylj#
McCluskey, A. R., Morgan, B. J., Edler, K. J., and Parker, S. C. (2018). pylj: A teaching tool for classical atomistic simulation. Journal of Open Source Education, 1(2), 19. https://doi.org/10.21105/jose.00019
pylj.__cite__() opens the paper in a browser. Development is on GitHub.