Day 9: First Principles: Castep Simulation¶
Practical 1 - Instructions¶
On scarf you need to tell the system where to find castep and it’s associated tools. If you just type
which castep.mpi
you will get a ‘no castep in …’ message. To fix this, you just need to type the command
module load CASTEP
and then castep.mpi will be added to your PATH. Unfortunately you will need to do this every time you log in, unless you add this command to the end of your ~/.bashrc file.
This practical now starts with a basic Castep run and then moves onto understanding the accuracy of the results. We will use the crystal quartz (\(SiO_2\)) and examine questions about the crystal structures at ambient and high pressures.
A simple Castep .cell file for quartz is:
%BLOCK lattice_abc
4.9158 4.9158 5.4091
90.0 90.0 120.0
%ENDBLOCK lattice_abc
%BLOCK positions_frac
Si 0.5303000000000000 0.0000000000000000 0.3333333333333333
Si 0.0000000000000000 0.5303000000000000 0.6666666666666667
Si 0.4697000000000000 0.4697000000000000 0.0000000000000000
O 0.1462000000000000 0.4142000000000000 0.8810000000000000
O 0.7320000000000000 0.5858000000000000 0.7856700000000000
O 0.5858000000000000 0.7320000000000000 0.2143300000000000
O 0.2680000000000000 0.8538000000000000 0.5476700000000000
O 0.4142000000000000 0.1462000000000000 0.1190000000000000
O 0.8538000000000000 0.2680000000000000 0.4523300000000000
%ENDBLOCK positions_frac
This gives the hexagonal unit cell with lattice parameters a=b=4.9158 Å and c=5.4091 Å and the corresponding hexagonal unit cell angles in the data block “lattice_abc”. The fractional coordinates of the atoms are then given in the next data block “positions_frac”. From now on we will use scarf. Please do the setup if you did not do it alredy. Copy the files
ssh scarf
mkdir ~/quartz
cp /work4/training/ccp5/abinitio/castep/quartz/* ~/quartz/
cp /work4/training/ccp5/abinitio/castep/castep.slurm ~/quartz/
cd ~/quartz
Examine the cell input file where symmetry optimisations are turned on. In the param file task is set as GeometryOptimisation. We can run in parallel on 24 compute cores with, edit castep.slurm to contain the follwoing line
mpirun -n 24 castep.mpi quartz-geom
submit the job
sbatch castep.slurm
After that, your task is to determine the atomic positions and lattice parameters of quartz in the local-density approximation with lattice parameters accurate to 0.5% and internal coordinates accurate to 0.25%. The provided “quartz-geom” files runs a geometry-optimisation calculation. However this will NOT satisfy the criteria above. You will need to give some thought to how to modify the .param and .cell files to achieve the desired result.
You will need to change keyword values in the cell and param files, for example k-point convergence and plane wave cutoff. The keywords can be found at https://www.tcm.phy.cam.ac.uk/castep/documentation/WebHelp/content/modules/castep/expcastepkeywords.htm
Castep will also be able to give informaiton on keywords with its internal help function. For example if you want to find all the keywords that can be changed in a geometry optimisation you can search with:
castep.mpi -s geom
This will list all keywords containing “geom”. You can then get help/syntax for specific keywords, for example to find options and defaults for geom_max_iter:
castep.mpi -h geom_max_iter
c) (More ambitious) Try to compute the transition pressure from quartz to the high-pressure phase stishovite. A useful keyword in the .cell file will be external_pressure. You will need to think carefully about how to structure the calculation and the accuracy and convergence issues. An example .cell and .param file for stishovite is given in
mkdir ~/stishovite
cp /work4/training/ccp5/abinitio/castep/quartz/stishovite.* ~/stishovite/
cp /work4/training/ccp5/abinitio/castep/castep.slurm ~/stishovite/
cd ~/stishovite/
edit castep.slurm and run the job.
N.B. You may need to set up a series of calculations to run overnight and finish the analysis in the morning. Does your answer make sense? d) Repeat (c) using the “PBE” generalised gradient approximation.