pylj#
pylj runs molecular dynamics and Metropolis Monte Carlo simulations of atoms interacting through pair potentials, in two dimensions, and draws and animates the atoms. It is a teaching code, written in Python and NumPy.
Installation#
pip install --pre pylj
pylj 2.0 is a beta release, so pip needs --pre to install it. Without --pre, pip installs the previous release, 1.5.2.
pylj needs Python 3.12 or later.
Contents#
Getting started: a model, a molecular dynamics run and a Monte Carlo run.
Building a simulation:
initialise, the starting lattices, and the configuration.Running a simulation: molecular dynamics, Monte Carlo, restarting, and how long a run takes.
Samples and the trajectory: what
sample()records, and g(r), S(q) and the mean squared displacement.Pictures and animations:
view()andanimate().Custom potentials: the
PairPotentialinterface and mixtures.Units: the units pylj takes and reports, and its constants.
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.