This is a list of Python versions of the code examples appearing in the text, in order, indicating the corresponding online program files. The online GUIDE provides more information about running these programs, but there they are grouped together by system studied, for easier comparison of the typical test results. Although links are provided here to the individual files, it is expected that you will have downloaded them all together.
Not all the examples have online files: in some cases the code was provided in the text. We have only provided a selection of examples in Python, whereas the full set is provided in Fortran.
The utility module files averages_module.py, config_io_module.py, and maths_module.py, and a small module containing long-range-correction formulae lrc_lj_module.py are widely used by the simulation programs. They are not explicitly listed in most cases below.
Several other small programs are not described in the text, but are mentioned in the online GUIDE:
An additional molecular dynamics program using quaternions md_nvt_poly_lj.py and md_poly_lj_module.py is described in the online GUIDE, but does not appear in the text.
A Fortran version of this code snippet appears in the text, not online. However working Python examples of a similar kind may be found in mc_lj_module.py and md_lj_module.py.
A Fortran version of this code snippet appears in the text, not online.
A Fortran version of this code snippet appears in the text, not online.
A Fortran version of this code snippet appears in the text, not online.
A Fortran version of this code snippet appears in the text, not online.
A Fortran version of this code snippet appears in the text, not online. However a working Python example of a similar kind may be found in md_nve_lj.py.
A Fortran version of this code snippet appears in the text, not online.
A Fortran version of this code snippet appears in the text, not online.
md_nve_lj.py and md_lj_module.py.
md_chain_nve_lj.py and md_chain_lj_module.py.
md_chain_mts_lj.py and md_chain_lj_module.py.
md_nve_hs.py and md_nve_hs_module.py.
md_nvt_lj.py and md_lj_module.py.
md_npt_lj.py and md_lj_module.py.
hit_and_miss.py (a Fortran version also appears in full in the text).
sample_mean.py (a Fortran version also appears in full in the text).
mc_nvt_lj.py and mc_lj_module.py.
mc_nvt_hs.py and mc_hs_module.py. We also supply a constant-pressure version mc_npt_hs.py.
mc_npt_lj.py and mc_lj_module.py.
mc_zvt_lj.py and mc_lj_module.py.
mc_nvt_poly_lj.py and mc_poly_lj_module.py. We also supply a molecular dynamics program md_nvt_poly_lj.py and md_poly_lj_module.py to simulate the same model.
mc_nvt_sc.py and mc_sc_module.py. We also supply a constant-pressure version mc_npt_sc.py.
We do not provide a Python version of this example. A Fortran version is available.
A Fortran version of this code snippet appears in the text, not online.
md_lj_ll_module.py. This may be used in combination with md_nve_lj.py, md_nvt_lj.py, or md_npt_lj.py. In each case, the program needs to be edited so as to import routines from this module instead of md_lj_module.py. Despite the name, linked lists are not used, as there is no advantage in Python. However, the module illustrates the cell structure, and the calculation of forces between neighbouring cells, analogous to the Fortran example.
We do not provide a Python version of this example. A Fortran version is available.
We do not provide a Python version of this example. A Fortran version is available.
initialize.py. This program also has options to initialize a random configuration, and a chain of atoms.
ewald.py with ewald_module.py and mesh_module.py. As well as the real-space and reciprocal-space routines mentioned in the text, we also illustrate the particle-mesh-Ewald method.
mesh.py and mesh_module.py.
A Fortran version of this code snippet appears in the text, not online.
We do not provide a Python version of this example. A Fortran version is available.
mc_nvt_lj_re.py and mc_lj_module.py.
pair_distribution.py. A Fortran version of part of the code also appears in the text.
A Fortran version of this code snippet appears in the text, not online. However working Python examples of a similar kind may be found in diffusion.py of Code 8.3 and corfun.py of Code 8.4.
diffusion.py. Also supplied is a program diffusion_test.py to generate test data.
mc_chain_wl_sw.py and mc_chain_sw_module.py. Also provided is a small program wl_hist.py to do post-processing of the histograms produced by the Wang-Landau simulation and, for comparison, a constant-temperature MC program mc_chain_nvt_sw.py.
mc_chain_nvt_cbmc_lj.py and mc_chain_lj_module.py.
md_nvt_lj_le.py and md_lj_le_module.py.
md_lj_llle_module.py. This may be used in combination with md_nvt_lj_le.py, edited so as to import routines from this module instead of md_lj_le_module.py. Despite the name, linked lists are not used, as there is no advantage in Python. However, the module illustrates the cell structure, and the calculation of forces between neighbouring cells, analogous to the Fortran example.
bd_nvt_lj.py and md_lj_module.py.
smc_nvt_lj.py and smc_lj_module.py.
dpd.py and dpd_module.py.
qmc_pi_sho.py for the simple harmonic oscillator. qmc_pi_lj.py and qmc_pi_lj_module.py for Lennard-Jones.
A Fortran version of this code snippet appears in the text, not online.
grint.py.
We also provide a (comparatively large) file grint_data.zip
containing test data
in the Data repository.
cluster.py. We also provide a test configuration file cluster.inp.
averages_module.py, config_io_module.py, and maths_module.py, used by many of the programs listed above.
test_pot_atom.py together with any one of test_pot_at.py, test_pot_bend.py, or test_pot_twist.py.
test_pot_linear.py together with any one of test_pot_dd.py, test_pot_dq.py, test_pot_qq.py, or test_pot_gb.py.
A Fortran version of this code snippet appears in the text, not online. However, a working Python example may be found in mc_nvt_lj.py and its module mc_lj_module.py.
A Fortran version of this code snippet appears in the text, not online. However, a working Python example may be found in md_nve_lj.py and its module md_lj_module.py.