Tutorials

# Conv

The goals of today's practical are

1. to explore further the CASTEP code, and let you practice running a pre-prepared calculation on α-quartz.
2. to modify the supplied input files and use these to explore how the calculation convergences as you vary the input parameters.

copy and unpack the archive containing the files for this exercise.
` wget http://www.castep.org/files/Exercise_2_Quartz.tar.gz `
` tar xvfz Exercise_2_Quartz.tar.gz `
` cd Exercise_2_Quartz `

``` Running the example CASTEP job
```

You will have two files "quartz.cell" and quartz.param. Examine these and see if you can understand the input syntax of CASTEP. In addition there are several files containing pseudopotentials for silicon and oxygen which the run uses.

When it is done, examine the output file quartz.castep. Read and try to understand the output, and see if you can figure out what CASTEP is doing.

``` Performing convergence tests on Quartz example
```

In principle convergence testing is as simple as running a series of calculations changing a single parameter between runs to vary the convergence parameter of interest. The convergence behaviour is studied by extracting some quantity of interest from the output file and usually plotting as a function of the parameter being varied. You should bear in mind the important scientific principle of only changing one parameter at a time.  However you will probably soon discover that the computational cost can vary dramatically with the parameter as well as the result, and it is easy to end up with a very long and large calculation. You should not have to perform any very long runs for this section - no longer than about 10-15 minutes each. But you will have to think carefully about how to choose the run parameters to achieve this.

1. Devise and submit a series of tests to explore convergence with the plane-wave cutoff. You should plot (a) the total energy, (b) the forces and (c) the stresses as a function of cutoff energy. What would be a good cutoff energy for a cohesive energy calculation? For a calculation to determine the lattice parameters? For a calculation to determine the equilibrium crystal structure? How does the computation time vary with cutoff?
2. Devise and submit a similar series of tests to explore convergence with k-point sampling. Use the cell file keywords ` kpoint_mp_grid p q r ` to specify a p x q x r grid and ` kpoint_mp_offset a b c ` (in fractions) to shift the grid relative to the origin. Again plot the convergence, and computational time.

The castep command has a help facility which can give you information on any of the input parameters. Try the command
` castep -help cut_off_energy `
or to find out all of the keywords related to kpoints, ` castep -help search kpoints.`

``` A geometry optimization
```

CASTEP has the capability of performing ''geometry optimization'' - adjusting the co-ordinates of the atoms to minimize the electronic energy. It can also perform a variable-cell geometry optimization at fixed external applied pressure. You have been provided with example input files to set up a variable-cell geometry optimisation, in files quartz-geom.cell quartz-geom.param.

You can visualise the geometry optimisation by copying the file quartz.geom back to your desktop or laptop, and using the Jmol to display an animation of the geometry optimisation.

Finally make a simple quantitative study of the effect of the plane-wave cutoff and/or k-point sampling convergence on the final geometry. Modify the input files to set up a poorly- and a well-converged geometry optimisation. Then extract the structural data from the output files, and compute the absolute and relative error in the unit cell and atomic co-ordinates.