First Principles: CASTEP Phonons and Spectroscopy Tutorial

If you prefer you may do any of the tutorials on alternative types of calculations which you can find on http://www.castep.org

The aims of this tutorial session is to introduce you to running larger-scale CASTEP jobs on supercomputer clusters, creation of input files for and setup of CASTEP jobs, and analysis of the results using standalone tools. In order to achieve results without waiting too long for jobs to complete the initial runs will be small ones, but the aim by the end of this afternoon should be to set up larger and more significant runs. Today’s session will entirely comprise insulators or semiconductors.

You may need to consult the CASTEP phonon users guide, which may be accessed at http://www.tcm.phy.cam.ac.uk/castep/Phonons_Guide/Castep_Phonons.html

These calculations should be run on the dedicated high-performance cluster system SCARF. Please see the separate instructions for logging on to these systems and transferring files to and from the PC/Laptop system.

A. \(\Gamma\)-Point phonon in h-BN

The first exercise will take you through the construction of a \(\Gamma\) point phonon calculation and the generation of a simple model infrared spectrum of a semiconductor. It will also introduce you to the use of some additional analysis and visualisation tools.

BN is one of a family of Nitride semiconductors, which occurs in cubic zincblende (c-BN), hexagonal wurtzite (w-BN) and graphite-like hexagonal (w-BN) polymorphs. We will calculate the phonons, infrared spectrum and Raman spectrum of h-BN.

Your starting point will be the structure which is provided in a castep .cell file which you can copy from

mkdir h-BN
cp /work4/training/ccp5/abinitio/castep/h-BN/* h-BN
cd h-BN

The Phonons manual (http://www.tcm.phy.cam.ac.uk/castep/Phonons_Guide/Castep_Phonons.html) contains a very similar example for the Wurtzite-structure polymorph of BN.

[NB If you want to use your own structure, you may download it in a CIF format from online databases such as ICSD. This will then require conversion to CASTEP .cell format, for which the cif2cell tool is ideal. If this is not already installed, then you can easily add it yourself:

pip install cif2cell
cif2cell -p castep my_cell.cif

which will convert my_cell.cif into CASTEP format.]

Note in the cell file the %block species_pot which reads

%block species_pot

NCP

%endblock species_pot

to select the norm-conserving pseudopotentials library. Density functional perturbation calculations requre norm-conserving peeudopotentials (the computational savings of ultra-soft potentials is lost with all of the addtional terms these require in perturbation theory).

To specify a gamma-point phonon wavevector

phonon_kpoint_mp_grid 1 1 1

Test your configuration using

castep.mpi –-dryrun <seedname>

Once you have in place the <seed>.cell and <seed>.param files you are ready to submit the CASTEP job. When it has finished, you can examine the output file h-BN.castep and find the frequencies. What you see is explained further in the Phonons user guide on the web link provided above. There is also a machine-readable file h-BN.phonon which contains the frequences, but also the eigenvectors which we will analyse.

Analysis of h-BN phonon output

We will use the academic tools to visualise the modes using the free Jmol visualiser.

Use the scp command to copy the .phonon file back to the cloud account (where Jmol is installed) or your own device (where you can install Jmol). Start jmol and bring up a “console window” from the right-mouse menu. Then type this command to load your .castep file

load h-BN.phonon {3 3 2} PACKED

(You may need to supply a full pathname for Jmol to find the .phonon file). Note that while you can read in the .phonon file from Jmol’s “File” menu, you need the additional options of the command line to display additional periodic repeats.

You can then use the “Tools-Vibrate” menu to turn on mode animation, and navigate the modes. Can you see from the mode eigenvectors which modes are IR active and which are Raman active? Do you agree with the IR and Raman activity printed in the .castep file?

Generation of IR spectrum

The easiest way to generate a simple model ir spectrum is to use the dos.pl tool. To run this in the most effective way and automatically display a plot, you will need to be running an X windows server.

In that case the command

module load xmgrace

dos.pl -ir -xg h-BN.phonon

will generate a plot script and use the xmgrace plotting program to display it. You can create a gnuplot script instead by changing the -xg flag to -gp. Alternatively you can generate a gnuplot script without plotting by

dos.pl -ir -gp -np h-BN.phonon > h-BN-phonon.plt

Raman spectrum

The calculation of the Raman intensities is fairly expensive compared to infrared matrix elements and it is therefore not turned on by default. To enable this, add the keyword

CALCULATE_RAMAN : TRUE

RAMAN_METHOD: DFPT

to the h-BN.param file, and resubmit the job. You can then use the -raman flag of dos.pl to generate and plot a Raman spectrum.

You can then copy the h-BN-phonon.plt back to the PC and read this into gnuplot locally.