Additional tools and programs are available to help automate post-processing analysis and plotting of the results of phonon calculations.
Two programs dispersion.pl and dos.pl analyse the .castep or .phonon files, read the phonon information and can generate plots of phonon dispersion curves across the Brillouin Zone, and of phonon densities of states respectively1 . These programs are written in the PERL language which is almost universally available on modern operating systems. Generation of the graphics output is handled by the “xmgrace” program (http://plasma-gate.weizmann.ac.il/Grace/) (the perl programs generate an xmgrace script and invoke it automatically). On linux systems xmgrace can usually be found as a contributed package and installed using the system package manager. Xmgrace is also available for Microsoft Windows systems as part of the “cygwin” suite of programs (http://www.cygwin.com) along with shells, the PERL interpreter and an X-windows server (Xmgrace is an X-windows program and requires a running X server to display).
The dos.pl program can read either a .castep or a .phonon file and generate a phonon density of states plot. Arguments are given in “unix style” following a minus sign (dash). The command
will generate a phonon density of states using a Gaussian broadening with a FWHM of 10 cm-1, and invoked xmgrace to generate the plot. The DOS is constructed as a weighted average over all q-points present in the file, using the weights generated by CASTEP in the case of PHONON_KPOINT_MP_GRID, or read from the .cell file if %BLOCK PHONON_KPOINT_LIST was used.
The options -np, -ps, -eps change the default output and write an xmgrace file, a PostScript or Encapsulated PostScript file respectively. These files are written to standard output so use a shell redirect (>) to name your plot file. The option -ir option weights the computed DOS by the computed infra-red intensity in the .castep or .phonon file. This simple algorithm is not a fully realistic model of an infrared powder spectrum, and should be regarded as a simple approximation only.2 Likewise the -raman option extracts raman intensities and computes the weighted spectrum. The computed spectrum does include the frequency-dependent and Stokes thermal factors, and is therefore a more realistic model spectrum than in the infrared case. The -lorentz option switches from Gaussian to a Lorentzian broadening and the -temp T option sets the temperature for the Stokes thermal population term in Kelvin.
Figure 3.1 shows an example derived from the output produced by using dos.pl on the example run of figure 2.3.
The dispersion.pl program can read either a .castep or a .phonon file and generate a dispersion curve plot using xmgrace. Unlike the behaviour of dos.pl there is an important difference between the behaviour when reading these two different output files concerning the detection of branch crossings. A high-quality dispersion plot requires that phonon branches are drawn as continuous lines even when two branches cross in between the computed wavevectors. Dispersion.pl contains an algorithm based on matching of eigenvectors at adjacent points to determine branch connectivity. Only the .phonon file contains eigenvector information, so only in this case is crossing detection enabled. The algorithm can be time consuming and take several minutes to complete in large cases, so patience is sometimes required. The -nj option (“no-join”) disables the crossing detection even when the input file is a .phonon one.
The options -np, -ps, -eps behave exactly as for dos.pl. One useful output option is -symmetry <symm> which attempts to label the high symmetry points using the conventional Brillouin zone notation of Bradley and Cracknell. The symmetry keywords cubic, fcc, bcc, tetragonal, tetragonal, tetragonal-I, orthorhombic, hexagonal, trigonal, trigonal-h (and minor variants) are understood.
Figure 3.2 demonstrates the effect of the flags and the branch joining algorithm. The plots were produced from a Fourier interpolation calculation of fcc RbBr using the commands
mode_follow is one of the Fortran tools suite in the CASTEP source, which is compiled using the command make tools. As the name implies its function is to generate new “frozen phonon” configurations based on perturbation by a mode generated from a previous phonon calculation, which it outputs by writing one or mode new .cell files. In fact it has two modes of operation.
mode follow -mode mode_num -namp num_amplitudes -amp max_amplitude -qpoint qx qy qz <seedname>|<seedname>.phonon
The file seedname.phonon must exist and be readable. If mode_follow is invoked without the .phonon extension, it will also attempt to read seedname.cell file if it exists and will copy most other cell parameters and settings to its output .cell files.
As an alternative to specifying the arguments on the command line mode_follow will also attempt to read them from a file named seedname.mode-param if it exists. This file should contain a Fortran namelist named freeze, whose entries are the identical to the command-line argument names. For example
To produce a frozen phonon configuration for a nonzero q-vector it is also necessary to generate a supercell which is commensurate with a frozen phonon at wavevector q. This supercell may be specified in the .cell file using the usual PHONON_SUPERCELL_MATRIX block, or by the entry supercell in namelist freeze in the .mode-param file. (There is no corresponding command line argument). For example a .mode-param file requesting a zone-boundary phonon might contain
One of the scripts in the cteprouts package, e.g. cell2xtl, cell2pdb, cell2xyz may be then be used to convert the .cell files to a form suitable for visualisation.
The program phonons, one of the CASTEP tools suite is a general purpose phonon post-processing tool. It can read all of the dynamical matrix or force constant matrix data from a .check or .castep_bin file generated in any phonon calculation and re-generate the final phonon output with changes to one or several “finalisation” options, without needing to repeat the expensive “electronic” DFPT or supercell parts of a lattice dynamics calculation. For example, an acoustic sum-rule correction may be applied to a calculation where this was not chosen initially.
phonons is invoked exactly as is CASTEP and reads a .cell and a .param file exactly as CASTEP does. These may be identical to or near copies of the original calculation, but the .param file must contain the continuation keyword which must point to the .check or .castep_bin file which contains the dynamical matrix data. If the run is successful it will write a log file with the extension .phonon_out and a new .phonon file. In this respect a run of phonons on a continuation deck is very similar to re-running castep on the same deck. However it will not attempt to perform any “electronic” calculation and will ignore any attempt to try. For example, if the parameter elec_energy_tol was changed castep would discard the saved dynamical matrix data and restart from the beginning. phonons will ignore this and process the saved data as a continuation run.
This post-processing can be used for a number of tasks, including
All of the above could also be performed using castep rather than phonons provided care is taken not to change any parameters which control the properties of the “electronic” part of the calculation. However phonons can also perform some additional processing which castep can not, most notably isotopically substituted lattice dynamics calculations.