Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: current

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


This directory contains Python code which wraps LAMMPS as a library
and allows the library interface to be invoked from a Python, either
from a script or interactively.

Details on how to build and use this Python interface are given in

Basically you have to extend the Python on your box to include the
LAMMPS wrappers:

python build           # for serial LAMMPS and Python
sudo python install

python build                  # for parallel LAMMPS and Python
sudo python setuppy install

but there are several issues to be aware of, as discussed in the doc


Once you have successfully built and tested the wrappers, you can run
the Python scripts in the examples sub-directory:          read/run a LAMMPS input script thru Python	  	    invoke various LAMMPS library interface routines	    mimic operation of couple/simple/simple.cpp in Python		    GUI go/stop/temperature-slider to control LAMMPS		    real-time temeperature plot with GnuPlot via	    real-time viz via some viz package  combination of and and

For the and commands, replace "tool"
with "gl" or "atomeye" or "pymol", depending on what visualization
package you have installed.  We hope to add a VMD option soon.

Note that for GL, you need to be able to run the GL tool,
which is included in the pizza sub-directory.  See the doc
pages for more info:

Note that for AtomEye, you need version 3, and their is a line in the
scripts that specifies the path and name of the executable.  See
the AtomEye WWW pages for more details:

The latter link is to AtomEye 3 which has the scriping
capability needed by these Python scripts.

Note that for PyMol, you need to have built and installed the
open-source version of PyMol in your Python, so that you can import it
from a Python script.  See the PyMol WWW pages for more details:

The latter link is to the open-source version.


You can run a particular script in either of the following ways:

% in.trivial
% python -i in.trivial

The former assumes that you have changed the first line of the script
to point to the Python installed on your box.

Run the Python scripts with the following LAMMPS input scripts and
arguments: in.trivial in.simple in.gui 100 in.plot 10 1000 thermo_temp in.viz 100 5000 in.viz 100 thermo_temp

You can un-comment the Pypar calls if you want to run these in

Each script has more documentation in the file that explains how to
use it and what it is doing.
Something went wrong with that request. Please try again.