Practical Session 04

Files for practical on 1/31/2012. These files will be available for the duration of the course.
[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[   ]Ar_rho=0.0333_fcc_unwrapped.xyz2013-01-31 10:48 36K 
[   ]Practical04PythonAndNumpy.pdf2013-02-10 21:08 100K 
[DIR]PythonAndNumpy/2013-02-10 21:06 -  
[TXT]assignment_07.txt2013-01-31 18:33 8.7K 
[TXT]mdIO_v0.py2013-01-31 10:53 1.8K 
[TXT]mdIO_v1.py2013-01-31 15:01 1.9K 
[TXT]p04_class.txt2013-02-10 21:08 6.5K 
[DIR]xyz/2013-01-31 17:42 -  


The Python programming language is versatile, not too hard to learn, and very useful. For learning Python see


NumPy is a very useful package to do scientific computing. In particular, it provides the array object which we will be using to hold coordinates etc.

XYZ file format enhanced

The XYZ file format is a very simple format to store positions of particles. It is described in VMD's XYZ Plugin. Basically, a XYZ file looks like this, with our own enhancement, the box dimensions

box Lx Ly Lz title text
atom1   x y z
atom2   x y z
atomN   x y z

The first line is the number of atoms. The second a string. The string shoul;d start with the word box and then follow three float numbers that are the lengths of the orthorhombix unit cell. From the third line onwards, each line contains a symbol for the particle ("atomX") and the cartesian coordinates. All entries are white-space separated.


VMD is a versatile molecular visualization program. It is very good at displaying MD trajectories and is geared towards biopolymers and liquids but it can be used for a wide range of systems.

On the Macs, you will find it in /Applications.