pymol and c2x

The natural environment of pymol (open source at GitHub) is displaying molecules, so this example considers the π bond of ethene.

Pymol likes volumetric data in the CCP4 format. This format contains no atomic positions, and contains the cell description in terms of abc αβγ with no clear definition of whether abc form a left- or right-hand set. This is not ideal, but some progress can be made as follows.

First prepare suitable input files. Here the .check file from a Castep calculation is used.

$ c2x --pdb ethene.check ethene.pdb
$ c2x -b=6 --ccp4 ethene.check ethene.pi.ccp4

Note that the filenames excluding the extension (ethene and ethene.pi) must differ, and that c2x version 2.32 (or more recent) will be necessary for writing CCP4 files.

Then load into pymol:

  load ethene.pdb
  set normalize_ccp4_maps, off
  load ethene.pi.ccp4
  isosurface pos,ethene.pi,0.3
  isosurface neg,ethene.pi,-0.3
  color red,pos
  color blue,neg

After a little rotation and zooming (the latter by dragging the right button over the image), the result should look like:

pymol with ethene pi bond

Note that the load commands create objects whose names are the filenames without the extension. Hence these must differ. Similarly pos and neg are arbitrary names for the two isosurfaces created. Note too that pymol's current default is to normalise CCP4 data so that the mean is zero and the standard deviation unity. This is generally unhelpful in the context of DFT.