Check2xsf and Crystals
Some notes on visualising CASTEP results from periodic systems. This assumes that you have already read the page on visualising data for aperiodic systems.
Not all viewers can automatically tile unit cells. The one used for most of these examples, XCrysDen, can easily. However, there are complications, as will become apparent later.
The first example system is silicon, with an 8 atom cubic cell.si8.cell
%BLOCK LATTICE_CART 5.46 0.00 0.00 0.00 5.46 0.00 0.00 0.00 5.46 %ENDBLOCK LATTICE_CART %BLOCK POSITIONS_FRAC Si 0.00 0.00 0.00 Si 0.00 0.50 0.50 Si 0.50 0.00 0.50 Si 0.50 0.50 0.00 Si 0.75 0.25 0.75 Si 0.25 0.25 0.25 Si 0.25 0.75 0.75 Si 0.75 0.75 0.25 %ENDBLOCK POSITIONS_FRAC symmetry_generate kpoints_mp_grid 2 2 2 kpoints_mp_offset 0.125 0.125 0.125si8.param
cut_off_energy : 150 num_dump_cycles : 0
Without even running Castep, one can use check2xsf to extract the structure from the .cell file:
$ check2xsf si8.cell si8.xsf $ xcrysden --xsf si8.xsf
This is an unpromising start, partly because XCrysDen fails to find any bonds in bulk silicon! To solve this problem, choose Modify, Atomic Radius, and increase the "Chemical connectivity factor" from 1.05 to 1.1. Choose also Display, Crystal Cells, Display, Co-ordinate System, and rotate slightly.
Finally one can choose Modify, Number of Units Drawn, and see a larger part of the crystal, with the new bonds being added automatically. Here a 2x1x3 slab is created.
The XSF file for the charge density is readily generated using the `-c' switch to check2xsf, and can be viewed as above. One can first follow the above steps to view the structure, and then load the 3D data via the tools menu in the usual fashion. The initial result should be something like the below.
By default the 3D data (which require a lot of memory) are plotted in just one unit cell. However, one can expand the isosurface to the whole supercell, or to a smaller supercell.
Odd Unit Cells
One rarely wishes to use the above eight-atom cell for a Castep calculation, for a smaller, two-atom, primitive unit cell exists, and, even give the extra k-points one should use in such a cell, the gain in the parts of Castep which scale quadratically or cubically with system size more than offsets this. The cell file for the two-atom unit cell would be:
%block POSITIONS_FRAC Si 0.0 0.0 0.0 Si 0.25 0.25 0.25 %endblock POSITIONS_FRAC %BLOCK LATTICE_CART 2.73 2.73 0.00 2.73 0.00 2.73 0.00 2.73 2.73 %ENDBLOCK LATTICE_CART kpoints_mp_grid 3 3 3 kpoints_mp_offset 0 0 0
The resulting energy will not be precisely a quarter of the previous value: the k-point sampling is different, the basis set is (subtly) different, the choice of FFT grid may be very different, etc.
The resulting unit cell does not form conveniently-shaped supercells: any attempt results in something long and thin.
Check2xsf can overcome this problem in many common cases. It has a `-x' option which will expand a rhombohedral cell back to a cubic/hexagonal one, interpolating any densities at the same time. This cell can then be used as above.