geometry optimisation with · pdf filegeometry optimisation with castep chris eames this...

56
Next: Recipe Geometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) is a basic introduction to the methodology of performing geometry optimisation calculations with the CASTEP program. It is not intended as a review of the ideas behind that methodology. Before approaching this guide the reader is strongly recommended to read a relevent review article (such as [1] or [2]) if they do not have the background knowledge. The aim of this guide is to answer three questions; What structures can be geometry optimised and what types of geometry optimisation are there? What are the basic inputs to a calculation and how are they set up? What are the possible outputs of a calculation and how should they be interpreted? We begin with a discussion of what occurs during a calculation and an outline of what the main considerations should be for the user. Some example calculations are presented at the end to show how it all fits together. Recipe Inputs The .cell file and Pseudopotential libraries The Size and Shape of the Supercell The Initial Configuration of the Atoms Within the Supercell The k-point sampling grid Cell symmetry Constraints on the cell size/shape Constraints on the movement of ions

Upload: truongtram

Post on 10-Feb-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Recipe

Geometry Optimisation with CASTEPChris Eames

This document (which is available for download as a pdf file) is a basic introduction to the methodology of performing geometry optimisation calculations with the CASTEP program. It is not intended as a review of the ideas behind that methodology. Before approaching this guide the reader is strongly recommended to read a relevent review article (such as [1] or [2]) if they do not have the background knowledge.

The aim of this guide is to answer three questions;

● What structures can be geometry optimised and what types of geometry optimisation are there? ● What are the basic inputs to a calculation and how are they set up? ● What are the possible outputs of a calculation and how should they be interpreted?

We begin with a discussion of what occurs during a calculation and an outline of what the main considerations should be for the user. Some example calculations are presented at the end to show how it all fits together.

● Recipe ● Inputs

❍ The .cell file and Pseudopotential libraries ■ The Size and Shape of the Supercell ■ The Initial Configuration of the Atoms Within the Supercell ■ The k-point sampling grid ■ Cell symmetry ■ Constraints on the cell size/shape ■ Constraints on the movement of ions

Page 2: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

■ Atomic masses ■ The location of the pseudopotential libraries ■ External pressure that is to be applied to the supercell

❍ The .param file ■ General Job Parameters ■ Basis Set Parameters ■ Variable Cell Calculations ■ Electronic Minimisation Parameters

● Example - Bulk Silicon ● Outputs

❍ The .castep file ❍ The .geom file ❍ The .check file ❍ Other output files

● Checking the absolute convergence of our Bulk Silicon Calculation ● A Variable Cell calculation for Bulk Silicon. ● Example - A Bulk Terminated Silicon Surface ● References ● About this document ...

2005-04-04

Page 3: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Inputs Up: Geometry Optimisation with CASTEP Previous: Geometry Optimisation with CASTEP

Recipe The essence of the calculation is for the ions and electrons in the supercell to be moved around stepwise until the forces on the atoms and the change in total energy between steps fall below some predefined convergence tolerance. The ionic positions are optimised using quasi-Newton methods. For each configuration of the ionic positions the electronic configuration is optimised using the method of conjugated gradients. The flow of the calculation is thus;

1. Move ions into new positions using geometry optimisation algorithm 2. Optimise electronic configuration using conjugated gradients method 3. Compare total energy with previous configurations and check if forces within tolerance limits 4. If structure not optimised start at (1) and generate new set of ionic positions

This cycle is performed until the forces fall within the tolerance limit and the energy should then be a local minimum.

What types of system can this be applied to? In theory CASTEP can geometry optimise most bulk systems in a wide range of materials such as semiconductors, ceramics, metals, minerals and zeolites. It can also look at defects such as surfaces. The main restriction is the amount of computational resources available to the user. Calculations scale with the cube of the number of atoms included. More about this in the discussion of supercells.

Next: Inputs Up: Geometry Optimisation with CASTEP Previous: Geometry Optimisation with CASTEP 2005-04-04

Page 4: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The .cell file and Up: Geometry Optimisation with CASTEP Previous: Recipe

Inputs There are three principal inputs; the <seed>.cell file, the <seed>.param file and the pseudopotential library.

Subsections

● The .cell file and Pseudopotential libraries ❍ The Size and Shape of the Supercell ❍ The Initial Configuration of the Atoms Within the Supercell ❍ The k-point sampling grid ❍ Cell symmetry ❍ Constraints on the cell size/shape ❍ Constraints on the movement of ions ❍ Atomic masses ❍ The location of the pseudopotential libraries ❍ External pressure that is to be applied to the supercell

● The .param file ❍ General Job Parameters ❍ Basis Set Parameters ❍ Variable Cell Calculations ❍ Electronic Minimisation Parameters

2005-04-04

Page 5: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The Size and Shape Up: Inputs Previous: Inputs

The .cell file and Pseudopotential libraries

Together these contain all of the information relevent to the material in the supercell. The supercell size and shape and the ionic positions within the supercell must be specified. The other cell parameters can be omitted and defaults will be applied in their place. Beware; it is advisable to specify most cell parameters. For example, the default Monkhorst-Pack (MP) k-point grid is unlikely to be suitable for most geometry optimisation jobs.

Subsections

● The Size and Shape of the Supercell ● The Initial Configuration of the Atoms Within the Supercell ● The k-point sampling grid ● Cell symmetry ● Constraints on the cell size/shape ● Constraints on the movement of ions ● Atomic masses ● The location of the pseudopotential libraries ● External pressure that is to be applied to the supercell

2005-04-04

Page 6: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The Initial Configuration of Up: The .cell file and Previous: The .cell file and

The Size and Shape of the Supercell

There are two ways to specify this. Cartesian coordinates can be used

%BLOCK LATTICE_CARTunits

%ENDBLOCK LATTICE_CART

Where, for example, is the x-component of the second lattice vector and is the z-component

of the third lattice vector and so on. The supercell can also be defined in terms of the magnitudes of the lattice vectors

%BLOCK LATTICE_ABCunits

%ENDBLOCK LATTICE_ABC

, and are the magnitudes of , and and , and are the values of ,

and .

Page 7: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

In both cases if [units] are not specified default units of Å are automatically used. However, angles must be specified in degrees.

2005-04-04

Page 8: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The k-point sampling grid Up: The .cell file and Previous: The Size and Shape

The Initial Configuration of the Atoms Within the Supercell

Having defined the supercell we can now specify the ionic positions within it. We have two choices of how to do this. We can either specify the Cartesian coordinates of each individual atom

%BLOCK POSITIONS_ABSunits

%ENDBLOCK POSITIONS_ABS

Each ion occupies its own individual line. For ion number n the first item on the line is the relevant

element symbol or atomic number which is followed by a string of three numbers which are

the x, y and z Cartesian coordinates of the ion.

The second way is to use fractions of , and for the three coordinates.

%BLOCK POSITIONS_FRAC

%ENDBLOCK POSITIONS_FRAC

Page 9: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

After the atomic symbol or the atomic number there are three entries which represent the coordinates of

the ion in terms of fractions , and of , and respectively.

Next: The k-point sampling grid Up: The .cell file and Previous: The Size and Shape 2005-04-04

Page 10: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Cell symmetry Up: The .cell file and Previous: The Initial Configuration of

The k-point sampling grid

The points in k-space at which the Brillouin zone is to be sampled can be defined in one of three ways.

As a list

%BLOCK KPOINTS_LISTunits

%BLOCK KPOINTS_LIST

The first three numbers on a line are the co-ordinates of a k-point as fractions of the relevent reciprocal space lattice vector. The final number is a weight for the k-point. The weights of all n k-points must add up to 1.

Another way is to use a Monkhurst-Pack grid and there are two ways of doing this.

The first way is to specify the grid dimensions in the three directions of the reciprocal space lattice vectors

KPOINTS_MP_GRID

So, for example, we could have a 2x2x2 grid or a 3x4x1 grid. The choice depends upon computational resources and whether a more detailed sampling of the electronic wave function is required in a given reciprocal space direction.

A second way of requesting a Monkhurst-Pack grid is to specify a minimum grid density.

Page 11: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

KPOINTS_MP_SPACING [units]

Where is the maximum distance between any two k-points in the grid. The default [units] of the k-

point spacing are Å .

Another feature of the Monkhurst-Pack grid that the user can specify is the alignment of the grid with respect to the origin of the Brillouin zone. By including

KPOINT_MP_OFFSET

the Monkhurst-Pack grid can be offset from the origin of the Brillouin zone. The entries

are the fractions of the reciprocal space lattice vector that give the value of the offset in the three directions.

Next: Cell symmetry Up: The .cell file and Previous: The Initial Configuration of 2005-04-04

Page 12: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Constraints on the cell Up: The .cell file and Previous: The k-point sampling grid

Cell symmetry

If the unit cell is invariant under certain symmetry operations these can be specified in the .cell file

%BLOCK SYMMETRY_OPS

%ENDBLOCK SYMMETRY_OPS

Each symmetry operation occupies four lines. The first three lines make a 3x3 array that represent a symmetry rotation and the next line is the translation associated with this rotation.

Another way is to allow CASTEP to automatically find the highest symmetry group that applies to the structure.

SYMMETRY_GENERATE

Note of caution; with a non-cubic cell or with a cell in which the c vector is not along the z direction the automatic symmetry generation can sometimes fail to find all of the symmetry operations that apply to a supercell.

Page 13: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

2005-04-04

Page 14: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Constraints on the movement Up: The .cell file and Previous: Cell symmetry

Constraints on the cell size/shape

The default is to allow all of the supercell lattice vectors to vary is size and orientation. To fix the size and shape of the supercell we must include the keyword

FIX_ALL_CELL : TRUE

There is also the possibility of allowing only some of the supercell lattice vectors/angles to vary while keeping others fixed

The BLOCK format is

%BLOCK CELL_CONSTRAINTS

%ENDBLOCK CELL_CONSTRAINTS

The first line contains constraint information for the lattice vectors and the second line contains constraint information for the angles. First, if any entry is zero that quantity stays fixed. If two entries on a line are the same integer then they must both have the same value whatever that might be.

2005-04-04

Page 15: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Atomic masses Up: The .cell file and Previous: Constraints on the cell

Constraints on the movement of ions

(This page was written by D. Quigley and is taken from the Molecular Dynamics in CASTEP user guide).

Any combination of linear constraints can be specified in the cell file.

We assign the index to run over all species present in the cell, the index to run over the

ions in each species, and the index to run over the three spatial co-ordinates of an ion. The co-

ordinate of the 2nd ion in the 3rd species is then . Associated with each of these degrees

of freedom is a co-efficient . The n linear constraint can then be specified as

where the constant is determined by the initial conditions. Specification of the n linear constraint

therefore reduces to specification of the co-efficients . These are input into the cell file in the

following fashion.

%BLOCK IONIC_CONSTRAINTS

1 S j

1 S j

Page 16: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

2 O j

2 O j

2 O j

%ENDBLOCK IONIC_CONSTRAINTS

For two constraints, one involving two sulfur ions, and another involving three oxygen ions. All coefficients not specified are assumed to be zero.

The first column in the block gives a unique number to the constraint specified. The second specifies the species by either atomic symbol (S or O in the above example) or atomic number. The third column is

the index within a species . The co-efficients of the three spatial co-ordinates for this ion under the

current constraint are then specified.

As an example, let us consider the case of restricting a single ion to move along along a plane parallel to

. The normal to this plane is and our constraint is that the dot product of this

normal with the position vector of the ion in question is zero. If this is the second ion in the fourth species then

In this trivial example, we can see that we need (if the fourth species is say, sulfur)

%BLOCK IONIC_CONSTRAINTS1 S 2 -1 1 0%ENDBLOCK IONIC_CONSTRAINTS

to satisfy the above equation.

A variety of constraints can be specified in this fashion. For simplicity, a special cell file keyword is provided to fix the centre of mass in the calculation.

fix_com = true

Page 17: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

It is possible to fix the positions of all ions and hence only conduct dynamics for the cell degrees of freedom using the following.

fix_all_ions = true

Similarly, it is possible to specify that all cell degrees of freedom remain fixed.

fix_all_cell = true

Fixing both the cell and ionic degrees of freedom in this way will eliminate all motions and will hence return an error.

Non-linear constraints, such as those used to fix the distance between two ions, are not yet supported. Constraints on individual cell degrees of freedom are also not yet supported.

Next: Atomic masses Up: The .cell file and Previous: Constraints on the cell

2005-04-04

Page 18: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The location of the Up: The .cell file and Previous: Constraints on the movement

Atomic masses

The mass of each species of ion in the calculation may be specified in the cell file. The format for the BLOCK is

%BLOCK SPECIES_MASSunits

%ENDBLOCK SPECIES_MASS

Each species is treated on a separate line. The first entry for species n is either the atomic symbol

or the atomic number and the second entry is the mass, which has default units of atomic

mass units. If the mass of any species is not specified then the default value of the mass will be assigned to that species.

2005-04-04

Page 19: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: External pressure that is Up: The .cell file and Previous: Atomic masses

The location of the pseudopotential libraries

In this BLOCK the user tells CASTEP where the pseudopotentials can be found

%BLOCK SPECIES_POT

%ENDBLOCK SPECIES_POT

The species symbol/atomic number must be consistent with that in the IONIC_POSITIONS block and the SPECIES_MASS block. If the pseudopotential files are contained in a working directory then only the filename is specified. If the user is working on a shared machine such as a cluster in which the pseudopotentials are kept in a library for access by multiple users then the full directory path must be specified.

2005-04-04

Page 20: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The .param file Up: The .cell file and Previous: The location of the

External pressure that is to be applied to the supercell

A pressure tensor is used to specify any external pressure that is to be applied to the cell

%BLOCK EXTERNAL_PRESSUREunits

%ENDBLOCK EXTERNAL_PRESSURE

Here we have, for example - the -component of the pressure and the -component

of the pressure and so on. The default units are GPa. If the whole BLOCK is omitted then no external pressure is applied by default.

For example we might specify

%BLOCK EXTERNAL_PRESSUREatm 1 0 0 1 0 1%ENDBLOCK EXTERNAL_PRESSURE

Which will apply a hydrostatic pressure of 1 atmosphere upon the supercell from all three directions

2005-04-04

Page 21: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: General Job Parameters Up: Inputs Previous: External pressure that is

The .param file

This contains all of the parameters which the user requires within the calculation. The parameters can be specified in any order but only one parameter must be specified per line. The most fundamental parameter is the task (there are other types of CASTEP calculation besides geometry optimisation). A geometry optimisation .param file should always include the line

task : GeometryOptimization

Note the format

keyword : value

Most of the parameters (there are very many of them) can be left as defaults. The main parameters that the user may find useful to specify and why are outlined below

Subsections

● General Job Parameters ● Basis Set Parameters ● Variable Cell Calculations ● Electronic Minimisation Parameters

2005-04-04

Page 22: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Basis Set Parameters Up: The .param file Previous: The .param file

General Job Parameters

An important first choice is which method to use for optimisation of the ionic positions. The default option is the Broyden-Fletcher-Goldfarb-Shannon (BFGS) method and this is used throughout the rest of this user guide. For fixed cell calculations there are two other options, damped molecular dynamics

geom_method : damped_md

and delocalised internal coordinates

geom_method : delocalized

The user is free to learn about these methods from the literature and try them out if they suit a particular problem. Since we will be doing variable cell calculations later on we will stick with BFGS.

The verbosity of information in the output files is controlled by

iprint : value

value can be 0,1,2 or 3 in order of increasing verbosity with a default value of 1, which in most cases will be sufficient to understand how the calculation has progressed. iprint : 3 is for full debugging. For users who wish to know a little bit more about what occurs during a calculation it might be interesting to set

iprint : 2.

If a calculation is unexpectedly interrupted many hours of work might be lost. CASTEP automatically backs up the calculation after every 5 BFGS steps. The parameter

num_backup_iter : value

allows the backup interval to be user specified. For very slow jobs it is sensible to back up the results after every BFGS step

num_backup_iter : 1

Page 23: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

When a calculation that was stopped is resumed the parameter

continuation : default

must be included so that the calculation will read the .check file and use the last completed BFGS step as a starting point for the calculation. This feature is essential when the calculation is run on large shared computational facilities where the run time per job is restricted.

It is possible to choose whether the algorithm should favour a speedier calculation at the cost of using more RAM during the calculation or whether to to slow down the calculation and make it less RAM intensive.

opt_strategy : value

value can be 'MEMORY' or 'SPEED'. The default is for a balance between memory usage and performance. If the calculation is at all likely to be RAM limited then MEMORY should be chosen. On RAM extensive architectures SPEED should be chosen. SPEED should also be used for most clusters, multiple processors or supercomputers because these write data temporarily to disk so as to conserve RAM which significantly hampers performance.

Next: Basis Set Parameters Up: The .param file Previous: The .param file 2005-04-04

Page 24: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Variable Cell Calculations Up: The .param file Previous: General Job Parameters

Basis Set Parameters

The number of plane waves included in the calculation is controlled by the cutoff energy .

cut_off_energy : value [units]

Default [units] are eV.

Increasing the value of this parameter increases the computational cost of the calculation. However,

is a variational parameter and the total energy will convergence towards the variational

minimum as is increased. It is crucial to repeat the calculation a few times with a fixed k-

point grid but with increasing . The total final energy will asymptotically reduce to the

variational minimum and when it levels off the user can be confident that they have the right value for

and that the calculation will be properly converged.

How do we decide what cutoff energy to use when first approaching a new system? Trial and error is not feasible for large jobs. There is a parameter which will automatically choose a cutoff energy

basis_precision : value

value can be coarse, medium, fine, precise or extreme. For fixed cell calculations it is suggested that the basis precision should be at least fine and for variable cell calculations it should be at least precise but the user should carefully check in both cases.

Next: Variable Cell Calculations Up: The .param file Previous: General Job Parameters 2005-04-04

Page 25: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Electronic Minimisation Parameters Up: The .param file Previous: Basis Set Parameters

Variable Cell Calculations

A variable cell calculation is performed if we are attempting to geometry optimise a material for which the lattice parameters and atomic positions are not even approximately known. In this situation, placing constraints on the size and shape of the supercell might affect the result. A ground state structure with a large lattice constant might not be found if a small supercell was used which confined the atoms to be too close together.

The solution is to perform a variable cell calculation which will allow the supercell size and shape to be optimised along with the atomic positions. A variable cell calculation is the default and will be performed as long as FIX_ALL_CELL : TRUE is not in the .cell file. A finite basis set correction [3] is used to reduce errors associated with changes in the total number of plane waves as the system changes size. As the supercell changes size the basis set associated with each k-point is altered. To adjust for this the cutoff energy could be varied to maintain the number of plane waves as a constant. However, it is generally considered [4] to be more acceptable to keep the cutoff energy constant and vary the number of plane waves. This 'graininess' in the basis set can be smoothed out with a finite basis set correction. This involves the calculation of the variation of the total energy with the logarithm of the cutoff energy, which is used as a smoothing parameter.

The principle keyword that activates a finite basis set correction whenever the cell parameters change is

finite_basis_corr : n

The default value of n is none, meaning no finite basis set correction is performed. The user can specify the value of the smoothing parameter by setting n = manual and then including

basis_de_dloge: v

where v is the value of the smoothing parameter.

There is also the handy option of allowing castep to automatically perform a finite basis set correction. Set

finite_basis_corr : auto

The correction is made by performing several total energy calculations for a given configuration of atoms but using different cutoff energies in each one. The variation in the total energy with the logarithm of the cutoff energy extrapolated from these singlepoint calculations enables the evaluation of the smoothing parameter. The user can specify.

Page 26: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

finite_basis_npoints : n

The number of different cutoff energies at which to evaluate the total energy and work out basis_de_dloge. The default value is 3.

If an auto finite basis set correction has been performed in the first run of a job it need not be repeated at the start of the continuation run. The value of basis_de_dloge is given in the .castep file and this can be included in the .param file along with

finite_basis_corr : manual

Another neat trick is the use of finite basis set corrections to efficiently converge with respect to the basis set (see this section for more details about convergence with respect to the basis set). The keyword

finite_basis_spacing :

Allows specification of the spacing, in eV, between the finite_basis_npoints:. These are evenly spaced up to the specified cutoff energy with a default spacing of 5eV. If the user was to specify

finite_basis_npoints : 7

With

finite_basis_spacing : 50

and a cutoff energy of 350eV then singlepoint calculations would be performed at cutoff energies of 50, 100, 150, 200, 250, 300, 350. This would enable very efficient calculations of the convergence of the total energy with respect to the cutoff energy for a given k-point mesh.

Next: Electronic Minimisation Parameters Up: The .param file Previous: Basis Set Parameters 2005-04-04

Page 27: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Example - Bulk Silicon Up: The .param file Previous: Variable Cell Calculations

Electronic Minimisation Parameters

The calculation may fail to converge if the electronic minimisation parameters are not suitable.

First, the exchange correlation functional. The default choice is the Local Density Approximation and this will probably be suitable in most cases. If the calculation fails to converge the parameter

xc_functional : value

can be used to try a Generalised Gradient functional. The options are PW91 (Perdew Wang '91), PBE (Perdew Burke Ernzerhof) and RPBE (Revised Perdew Burke Ernzerhof). When satisfied that a calculation has completely converged with the LDA it is probably a good idea to rerun the whole calcualtion using a GGA functional to check that the final result is not drastically different. In general the LDA is better suited to bulk calculations and the GGA to surface calculations.

There is also the option of using a non-local xc_functional (for fixed cell calculations only). The options are

HF Hartree-Fock

SHF Screened Hartree-Fock

EXX Exact exchange

LDA-X Local Density Approximation for exchange

LDA-C Local Density Approximation for correlation

Health warning; non-local xc functionals are very computationally expensive.

A cap can be placed on the maximum number of allowed SCF cycles. The calculation is stopped if the electronic minimisation is unconverged after this many step. The keyword string is

max_SCF_cycles : value

If a calculation has taken more than 100 SCF cycles then it probably won't converge, although it does

Page 28: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

depend on the nature of the system and the method used to treat any metallic species in the system

metals_method : value

For insulators no special treatment is required. Including a parameter

fix_occupancy : true

defines the system as an insulator and metals method will be set to a default value of NONE.

If the user defines

fix_occupancy : false

then by default a choice will be made by CASTEP for

metals_method : EDFT

Now with Ensemble Density Functional Theory (EDFT) the calculation is more likely to converge than with the alternative method Density Mixing (DM) and will usually require fewer SCF cycles to minimise the electronic structure for a given ionic structure. However, DM is much faster per SCF cycle than EDFT. For systems containing metallic atoms it is advisable to first try DM with

max_scf_cycles : 50

and if this is failing to converge switch to EDFT.

The electronic minimisation is considered to have converged when the change in the total energy from one iteration to the next remains below some tolerance value per atom for a few scf steps. The default value of the parameter

elec_energy_tol : value

is eV per atom and is usually suitable but it might be suitable to reduce the strictness of this

tolerance limit if a calculation is consistently failing to converge. The number of iterations for which the change in the total energy must remain below elec_energy_tol is the convergence window and it can be specified by.

elec_convergence_win

Page 29: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

the default value is 3 but it must be at least 2.

Next: Example - Bulk Silicon Up: The .param file Previous: Variable Cell Calculations 2005-04-04

Page 30: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Outputs Up: Geometry Optimisation with CASTEP Previous: Electronic Minimisation Parameters

Example - Bulk Silicon At this point we introduce geometry optimisation of bulk Silicon as an example. We will use the known bulk structure as a starting point and check what structure CASTEP suggests and what the bond length is optimised to.

Bulk Silicon is shown in figure 1 below.

Figure 1:Bulk silicon

Page 31: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

We must now choose a supercell to enclose as few atoms as possible but still reproduce the whole structure. The following configuration can be used provided we include the relevant symmetry operations in the cell file.

Figure 2:The primitive cell which we will take as our supercell

The complete .cell file for this supercell is included in the link.

The first thing that we notice is that we are using the abc format to specify the size and shape of the lattice. The shape of our unit cell naturally suggests that we do this.

The lengths of a,b and c are the same as those in the bulk lattice. Later we will do a variable cell calculation as both an example of how to set one up and to check how accurately the primitive cell shape and contents can be optimised.

Note that we are using a 2x2x2 Monkhurst-Pack grid and also the inclusion of symmetry_generate to ensure that castep is aware of the symmetry operations that our supercell satisfies.

The parameters file si.param is here

Notice that we can include the parameter line

Comment : value

This will appear in the output as a title (see the next section).

Having set up our input files we can now run the job. The job is small and we will execute it on a desktop

Page 32: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

pc under the command prompt. To do this we type

castep <seed>

ie

castep si2

when we are in the folder in which the castep executable and the input files are located (including the pseudopotential files). In the next section we will use the results of this calculation to discuss the output files.

Next: Outputs Up: Geometry Optimisation with CASTEP Previous: Electronic Minimisation Parameters 2005-04-04

Page 33: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The .castep file Up: Geometry Optimisation with CASTEP Previous: Example - Bulk Silicon

Outputs

Subsections

● The .castep file ● The .geom file ● The .check file ● Other output files

2005-04-04

Page 34: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The .geom file Up: Outputs Previous: Outputs

The .castep file

The complete si.castep file can be found in the link. The file begins with a header which contains the details of the version of castep which was compiled into the executable. Authors and contributors are acknowledged and copyright and licensing information is summarised. The details of a publication which should be cited in any work arising from use of CASTEP are given.

A full summary of all of the parameters (even those left to default) to be used in the calculation are listed in groups; general parameters, Exchange-Correlation parameters, Pseudopotential parameters, Basis Set parameters, Electronic parameters, Electronic Minimization parameters, Density Mixing, Population Analysis parameters, Geometry Optimization parameters. Notice that our request for medium basis set precision has produced the default cutoff energy of 120eV.

The cell parameters follow, including a list of the k-point co-ordinates

------------------------------- k-Points For BZ Sampling ------------------------------- MP grid size for SCF calculation is 2 2 2 Number of kpoints used = 3 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Number Fractional coordinates Weight + +-----------------------------------------------------+ + 1 0.250000 0.250000 0.250000 0.2500000 + + 2 -0.250000 -0.250000 0.250000 0.2500000 + + 3 0.250000 -0.250000 0.250000 0.5000000 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++

After symmetry and constraint information the results of the calculation begin. For the initial configuration of the atoms in the supercell the electronic minimisation begins

------------------------------------------------------------------------ <-- SCFSCF loop Energy Energy gain Timer <-- SCF per atom (sec) <-- SCF------------------------------------------------------------------------ <-- SCFInitial 0.00000000E+000 1.13 <-- SCF

The iterations in the electronic structure continue until 2 consecutive iterations fall within the electron convergence window

1 -2.09000140E+002 1.04500070E+002 1.23 <-- SCF 2 -2.15287289E+002 3.14357473E+000 1.34 <-- SCF 3 -2.14863841E+002 -2.11724154E-001 1.45 <-- SCF

Page 35: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

4 -2.14844155E+002 -9.84322032E-003 1.55 <-- SCF 5 -2.14844793E+002 3.19055641E-004 1.62 <-- SCF 6 -2.14844863E+002 3.53437051E-005 1.69 <-- SCF 7 -2.14844865E+002 6.42301690E-007 1.75 <-- SCF 8 -2.14844864E+002 -1.44644986E-007 1.81 <-- SCF------------------------------------------------------------------------ <-- SCFFinal energy = -214.8448643011 eV

The electronic minisation for this ionic configuration is now complete. A convergence check is performed

******************************** Forces ********************************* * * * Cartesian components (eV/A) * * --------------------------------------------------------------------- * * x y z * * * * Si 1 0.00000 0.00000 0.08113 * * Si 2 0.00000 0.00000 -0.08113 * * * ************************************************************************* BFGS: finished iteration 0 with enthalpy= -2.14844864E+002 eV +-----------+-----------------+-----------------+------------+-----+ <-- BFGS | Parameter | value | tolerance | units | OK? | <-- BFGS +-----------+-----------------+-----------------+------------+-----+ <-- BFGS | dE/ion | 0.000000E+000 | 2.000000E-005 | eV | No | <-- BFGS | |F|max | 8.113133E-002 | 5.000000E-002 | eV/A | No | <-- BFGS | |dR|max | 0.000000E+000 | 1.000000E-003 | A | Yes | <-- BFGS +-----------+-----------------+-----------------+------------+-----+ <-- BFGS

|F|max is the maximum allowed force on any atom and |dR|max is the tolerance for the change in any atomic position between iterations. Since the calculation has not converged a new set of ionic co-ordinates must be generated. A new BFGS iteration is started and a summary of the previous BFGS step is given

================================================================================ Starting BFGS iteration 1 ...================================================================================ +------------+-------------+-------------+-----------------+ <-- min BFGS | Step | lambda | F.delta | enthalpy | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS | previous | 0.000000 | 0.000002 | -214.844864 | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS

What is meant by lambda and F.delta ?

F.delta is the search direction in BFGS and this doesn't change during a BFGS iteration. F is the force vector. Ideally, the step length lambda should take the value that makes F.delta = 0 (to ensure conjugacy of the search directions). In practice, the value of F.delta for which the energy is lowest is chosen and so F.delta is not

Page 36: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

necessarily equal to zero at the end of each BFGS step. By default a step of lambda = 1 is taken first

-------------------------------------------------------------------------------- BFGS: starting iteration 1 with trial guess (lambda= 1.000000)--------------------------------------------------------------------------------

The electronic minimisation is performed and the total energy calculated. Now the line minimisation is performed

+------------+-------------+-------------+-----------------+ <-- min BFGS | Step | lambda | F.delta | enthalpy | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS | previous | 0.000000 | 0.000002 | -214.844864 | <-- min BFGS | trial step | 1.000000 | 0.000001 | -214.844908 | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS

-------------------------------------------------------------------------------- BFGS: improving iteration 1 with line minimization (lambda= 6.048479)--------------------------------------------------------------------------------

Which results in

+------------+-------------+-------------+-----------------+ <-- min BFGS | Step | lambda | F.delta | enthalpy | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS | previous | 0.000000 | 0.000002 | -214.844864 | <-- min BFGS | trial step | 1.000000 | 0.000001 | -214.844908 | <-- min BFGS | line step | 6.048479 | 0.000000 | -214.845023 | <-- min BFGS +------------+-------------+-------------+-----------------+ <-- min BFGS

BFGS: finished iteration 1 with enthalpy= -2.14845023E+002 eV

This is repeated for each BFGS step. The calculation proceeds until the end of BFGS iteration 2, after which the change in the energy falls within the convergence tolerance and

BFGS: finished iteration 2 with enthalpy= -2.14845023E+002 eV +-----------+-----------------+-----------------+------------+-----+ <-- BFGS | Parameter | value | tolerance | units | OK? | <-- BFGS +-----------+-----------------+-----------------+------------+-----+ <-- BFGS | dE/ion | 1.709020E-008 | 2.000000E-005 | eV | Yes | <-- BFGS | |F|max | 3.838766E-003 | 5.000000E-002 | eV/A | Yes | <-- BFGS | |dR|max | 7.445744E-005 | 1.000000E-003 | A | Yes | <-- BFGS +-----------+-----------------+-----------------+------------+-----+ <-- BFGS

BFGS: Geometry optimization completed successfully.

All that is left to do is to print the final supercell configuration

================================================================================

Page 37: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

BFGS: Final Configuration:================================================================================

------------------------------- Cell Contents -------------------------------

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x Element Atom Fractional coordinates of atoms x x Number u v w x x----------------------------------------------------------x x Si 1 0.249792 0.249792 0.250624 x x Si 2 0.000208 0.000208 -0.000624 x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

BFGS: Final Enthalpy = -2.14845023E+002 eV

The bonding information is revealing

Atomic Populations ------------------Species Ion s p d f Total Charge (e)============================================================== Si 1 1.22 2.78 0.00 0.00 4.00 0.00 Si 2 1.22 2.78 0.00 0.00 4.00 0.00==============================================================

Bond Population Length (A)====================================Si 1--Si 2 3.22 2.13974====================================

We can see that the bonds are sp hybridised as we might expect in Si. The bond length is 2.13974 Å. The accepted value for the Si-Si bulk bond length is 2.332 Å. Our calculation is 8% out. More about this in a later section.

Next: The .geom file Up: Outputs Previous: Outputs 2005-04-04

Page 38: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: The .check file Up: Outputs Previous: The .castep file

The .geom file

The <seedname>.geom file contains a brief record of the main results at the end of each BFGS step. Note that everything in the .geom file is in atomic units. So, for example, the end of BFGS iteration 0 would correspond to the following output in the .geom file

0 -7.93316351E+000 -7.93316351E+000 <-- E 0.00000000E+000 5.13126785E+000 5.13126785E+000 <-- h 5.13126785E+000 0.00000000E+000 5.13126785E+000 <-- h 5.13126785E+000 5.13126785E+000 0.00000000E+000 <-- h Si 1 0.00000000E+000 0.00000000E+000 0.00000000E+000 <-- R Si 2 7.56877069E+000 2.52292356E+000 7.56877069E+000 <-- R Si 1 -5.22300739E-003 6.43530285E-003 -1.71774942E-003 <-- F Si 2 5.22300739E-003 -6.43530285E-003 1.71774942E-003 <-- F

The first line contains the iteration number. The next line is the final energy in Hartrees (1eV = 0.03674 932 45 Ha). This is repeated twice - why? In a finite pressure calculation it is the free energy, the enthalpy, that is minimised. This is E + PV where E is the energy, P is the pressure and v is the volume. In this case P = 0 so the energy and the enthalpy are the same. The final energy is listed first and then the enthalpy.

The next three lines are the unit cell vectors in cartesian coordinates in units of Bohrs. There exist programs such as geom2xyz to convert the .geom file into a list of xyz coordinates. For each atom in the supercell the absolute position is listed and then the forces are listed (both quantities in atomic units).

2005-04-04

Page 39: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Other output files Up: Outputs Previous: The .geom file

The .check file

This Fortran binary file is a very detailed store of all of the information gathered during a calculation. The .check file is vital for checkpointing. When a job is resubmitted after an intentional or accidental interruption the information in the .check file is used to resume the calcultion from the end of the last successfully completed BFGS step. The parameters may be changed during the interruption. The line

continuation : default

must be included in the .param file to specify a restart and not a fresh calculation.

2005-04-04

Page 40: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Checking the absolute convergence Up: Outputs Previous: The .check file

Other output files

.wvfn.nnnn this file contains a record of the wavefunction. The presence of this file allows a secondary restart mechanism. In the param file set

ELEC_RESTORE_FILE

To the root name.

.bands this file contains the electronic eigenvalues related to the individual k-points.

.err.nnnn this is an error file, written by every MPI process. If a job terminates unexpectedly this file will provide a ready source of diagnostic information. nnnn is the MPI rank. A job run in parallel on, say, 4 processors will return up to 4 .err. files depending on which nodes the problem has occured. If the calculation is run in serial without MPI then nnnn = 0001.

2005-04-04

Page 41: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: A Variable Cell calculation Up: Geometry Optimisation with CASTEP Previous: Other output files

Checking the absolute convergence of our Bulk Silicon Calculation The example calculation with bulk silicon does not produce a very accurate answer. Can it be improved? There are two main sources of error in our calculation;

● Fundamental errors associated with the approximations used in the calculation such as the use of the LDA.

● Systematic errors associated with inaccuracies in the wavefunctions introduced by using a finite basis set and wavefunction sampling in reciprocal space.

The latter of these must be reduced to a minimum. To show how this might be done I have repeated the calculation several times with increasing precision in the basis set and with various MP grid densities. Figure 3 below shows the total energy as a function of the basis set size for calculations with 1, 10, 28 and 60 K-Points. (See the section on variable cell calculations for a neat trick to efficiently perform many singlepoint energy calculations at a variety of cutoff energies at a fixed k-point density).

Page 42: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Figure 3:Convergence of the bulk Si calculation with respect to the basis set

We can see that gamma point sampling with a single k-point produces a structure with a much higher energy than sampling with other k-point densities. Figure 4 below shows a plot of figure 3 with the 1 k-point data removed for greater clarity.

Figure 4:Convergence of the basis set showing only the higher k-point densities

The cutoff energy is a variational parameter and as it is increased the energy will converge asymptotically on the ground state from above. However, it is important to remember that the sampling set size is not a variational parameter. It entirely possible to increase the total final energy of the system by increasing the density of the sampling grid. If we know more information about the wavefunction it does not mean that this information will provide us with a lower energy structure. The key point about convergence with respect to the sampling grid density is that the difference in energy from one grid density to the next should be minimised. We can see from figure 4 that increasing the MP grid density from 28 to 60 k-points has a negligible effect on the total final energy. Indeed, the two curves lie on top of one another and cannot be separately resolved. Also, the total energy is converged with respect to the cutoff energy when this is above about 280eV.

In summary, our fully converged basis set parameters are; 28 k-points in the reciprocal space sampling grid and a cutoff energy of 280eV or higher. Has the reduction of systematic error helped? The bond length for the calculation with the optimal set of parameters for both accurate wavefunction modelling and conservation of computational resources is 2.28753 Å. This is only 1.9% away from the acepted value of 2.332 Å. Convergence has resulted in an improvement of 6% on the answer obtained using an

Page 43: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

arbitrary set of basis set parameters.

One final point on sampling grids. An important factor in dictating the required sampling grid density is the size of the supercell. A large real space supercell might require only a very sparse reciprocal space sampling grid. Our small bulk silicon unit cell requires quite a dense MP grid. In the later silicon (100) surface example the supercells contain 20 atoms but require only a 9 k-point sampling grid. Of course, the electronic complexity of the constituent atoms also plays a role in determining the required sampling grid density.

Next: A Variable Cell calculation Up: Geometry Optimisation with CASTEP Previous: Other output files 2005-04-04

Page 44: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: Example - A Bulk Up: Geometry Optimisation with CASTEP Previous: Checking the absolute convergence

A Variable Cell calculation for Bulk Silicon. In our bulk Silicon calculation we had a rigid supercell shape and the starting atomic positions of the silicon atoms were those known to be correct. What effect will a variable cell calculation have?

In the cell file

FIX_ALL_CELL : FALSE

In the .param file our keywords are;

finite_basis_corr : 2

which ensures that an automatic finite basis set correction is made

The complete output is in the link. We see that the first three steps are indeed singlepoint energy calculations

Calculating finite basis set correction with 3 cut-off energies.Calculating total energy with cut-off of 270.000eV.------------------------------------------------------------------------ <-- SCFSCF loop Energy Energy gain Timer <-- SCF per atom (sec) <-- SCF------------------------------------------------------------------------ <-- SCFInitial 0.00000000E+000 4.05 <-- SCF 1 -2.07999179E+002 1.03999590E+002 15.06 <-- SCF 2 -2.16644967E+002 4.32289377E+000 25.37 <-- SCF 3 -2.16547612E+002 -4.86773393E-002 35.44 <-- SCF 4 -2.16472419E+002 -3.75966977E-002 45.52 <-- SCF 5 -2.16473346E+002 4.63609274E-004 51.23 <-- SCF 6 -2.16473342E+002 -2.09197016E-006 55.58 <-- SCF 7 -2.16473343E+002 7.21451053E-007 59.95 <-- SCF 8 -2.16473343E+002 1.95459391E-008 64.28 <-- SCF------------------------------------------------------------------------ <-- SCFFinal energy = -216.4733431455 eV (not corrected for finite basis set)

Calculating total energy with cut-off of 275.000eV.------------------------------------------------------------------------ <-- SCFSCF loop Energy Energy gain Timer <-- SCF per atom (sec) <-- SCF------------------------------------------------------------------------ <-- SCFInitial -2.16473343E+002 65.79 <-- SCF 1 -2.16474422E+002 5.39545221E-004 72.46 <-- SCF 2 -2.16474423E+002 2.77186149E-007 76.73 <-- SCF

Page 45: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

3 -2.16474423E+002 2.10512829E-007 81.13 <-- SCF------------------------------------------------------------------------ <-- SCFFinal energy = -216.4744232114 eV (not corrected for finite basis set)

Calculating total energy with cut-off of 280.000eV.------------------------------------------------------------------------ <-- SCFSCF loop Energy Energy gain Timer <-- SCF per atom (sec) <-- SCF------------------------------------------------------------------------ <-- SCFInitial -2.16474423E+002 82.48 <-- SCF 1 -2.16475528E+002 5.52276233E-004 89.09 <-- SCF 2 -2.16475528E+002 3.59413754E-007 93.47 <-- SCF 3 -2.16475529E+002 2.76001709E-007 97.85 <-- SCF------------------------------------------------------------------------ <-- SCFFinal energy = -216.4755290347 eV (not corrected for finite basis set)

For future reference: finite basis dEtot/dlog(Ecut) = -0.061086eV Total energy corrected for finite basis set = -216.475512 eV

With the finite basis set correction in place the calculation can proceed as normal. The calculation completes and we have a silicon bond length of 2.328 Å which is 0.17% out and an improvement of about 1.7% on our fixed cell calculation.

We get a bonus. The calculation of the finite basis set correction provides information that can be used to estimate the bulk modulus of silicon based upon the energy changes as the cell size changes.

BFGS: Final bulk modulus = 9.99180951E+001 GPa

The known bulk modulus of silicon is 98.8 GPa at room temperature (Kittel page 59 [5]) and our zero temperature estimation is only 1 % out. A more rigorous way to calculate this quantity would be to plot energy versus cell volume for a variety of cell volumes (perhaps individually done as fixed cell calculations) and to fit a curve to this plot. The bulk modulus B can then be calculated from

(1)

In summary the user should become more inclined to a finite basis set correction whenever there is uncertainty about whether the final expected configuration of the supercell might be very different from the initial configuration.

Next: Example - A Bulk Up: Geometry Optimisation with CASTEP Previous: Checking the absolute convergence 2005-04-04

Page 46: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: References Up: Geometry Optimisation with CASTEP Previous: A Variable Cell calculation

Example - A Bulk Terminated Silicon Surface When the supercell does not have full 3D periodicity the calculation must be converged with respect to other supercell parameters. Consider a surface. We will use the Si(100) surface reconstruction as an example. Figure 5 below shows the bulk terminated Si(100) surface.

Figure 5:The bulk terminated Si(100) surface

In one direction we have a defect; after some point there will be a complete absence of atoms, essentially out to infinity. In the opposite direction we move into the bulk and in principle we should include an infinite number of bulk layers below the top few surface layers.

Both of these requirements are computationally impractical. In practice we must include just enough bulk layers so that the inner bulk atoms remain in place during the calculation and only the top surface layers reconstruct.Also, only a finite amount of vacuum space above the top surface layer is practical. However, when a supercell is repeated periodically in all three spatial directions the bottom bulk-like region of one supercell borders upon the top vacuum region of the supercell below it (figure 6). If the vacuum region is not thick enough the uncompensated charges on the bottom of the one supercell and the top of the supercell under it will cause an unphysical interaction. Vertically adjacent supercells must not be able to 'see' one another.

Page 47: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Figure 6:A finite vacuum gap may cause an interaction between neighbouring atomic

layers in vertically adjacent supercells

Other effects are caused by uncompensated charges. The bottom layer of the supercell, which should be bulk-like, may reconstruct. To prevent this we can constrain these atoms to remain in their bulk positions. Another effect is an interaction between the top surface layer uncompensated charges and the bottom layer uncompensated charges through the intermediate layers. The supercell must contain sufficient numbers of layers of atoms to space the top and bottom layers out so as to minimise the internal interactions in the supercell. A neat trick is to use hydrogen passivation. In this the dangling bonds of the bottom bulk like layers are compensated by bonding these atoms to hydrogen atoms. This introduces extra atoms into the calculation but reduces the overall number of atoms needed because the number of spacer layers in the supercell is reduced (also, hydrogen is computationally cheap). The thickness of the vacuum gap can also be reduced when hydrogen passivation is used (remember empty space is a computational expense too).

The Si(100) surface is known to have a simple 2x1 dimerised structure. The small in-plane unit cell of the reconstructed surface means that we can use a small supercell and we do not need many atoms. The following initial supercell will be sufficient (figure 7). Notice the hydrogen passivation.

Page 48: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Figure 7:A hydrogen passivated Si(100) supercell with a 7 Åvacuum

gap and 9 layers of silicon.

This is a crucial feature of performing geometry optimisation on surfaces. The initial surface unit cell must be large enough to enclose any expected reconstruction. A Si(111)-1x1 supercell will not reconstruct into the Si(111)-7x7 Takayanagi reconstruction! If no suggestions have been provided as to possible reconstructed periodicities by previous theoretical or experimental work then the user might have to begin with a large supercell and perform a variable cell calculation (in case of lateral relaxations).

Now we must perform the abovementioned supercell convergence checks. We will use a 9 k-point MP grid with a cutoff energy of 260eV for this (we will converge our calculation with respect to basis set parameters later). Let us start with a large vacuum gap of 15Å (I know that this is entirely sufficient from experience). We will now be able to perform several calculations with 7, 8, 9, 10 and 11 layers of silicon and not have to worry about the vacuum gap - one problem at a time. The supercell lattice matrix and the atomic coordinate list in the .cell file for 7 layers of silicon looks like

%BLOCK LATTICE_CART 7.6801695932 0.0000000000 0.0000000000 0.0000000000 3.8801700000 0.0000000000

Page 49: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

0.0000000000 0.0000000000 24.5037250000 %ENDBLOCK LATTICE_CART

%BLOCK POSITIONS_FRAC H 0.2500000000 -0.0103307854 -0.0000000000 H 0.7500000000 -0.0103307854 -0.0000000000 Si 0.5000000000 0.9896692146 0.1662206460 Si 0.5000000000 0.9896692146 0.3878481741 Si 0.2500000000 0.4948346073 0.0554068820 Si 0.2500000000 0.4948346073 0.2770344101 Si 0.7500000000 0.4948346073 0.0554068820 Si 0.7500000000 0.4948346073 0.2770344101 Si 0.0000000000 0.9896692146 0.1662206460 Si 0.0000000000 0.9896692146 0.3878481741 Si -0.0000000000 0.4948346073 0.1108137640 Si -0.0000000000 0.4948346073 0.3324412921 Si 0.7500000000 0.9896692146 0.2216275281 Si 0.5000000000 0.4948346073 0.1108137640 Si 0.5000000000 0.4948346073 0.3324412921 Si 0.2500000000 0.9896692146 0.2216275281 %ENDBLOCK POSITIONS_FRAC

Notice the hydrogen atoms. Now for the constraints on the bottom layer silicon atoms and the hydrogen atoms (the H atoms must also be constrained because the have a tendency to move into awkward formations). The list of constraints whose format was specified before looks like

%BLOCK IONIC_CONSTRAINTS 1 H 1 1.00000000 0.00000000 0.00000000 2 H 1 0.00000000 1.00000000 0.00000000 3 H 1 0.00000000 0.00000000 1.00000000 4 H 2 1.00000000 0.00000000 0.00000000 5 H 2 0.00000000 1.00000000 0.00000000 6 H 2 0.00000000 0.00000000 1.00000000 7 Si 3 1.00000000 0.00000000 0.00000000 8 Si 3 0.00000000 1.00000000 0.00000000 9 Si 3 0.00000000 0.00000000 1.00000000 10 Si 5 1.00000000 0.00000000 0.00000000 11 Si 5 0.00000000 1.00000000 0.00000000 12 Si 5 0.00000000 0.00000000 1.00000000 %ENDBLOCK IONIC_CONSTRAINTS

So now we have our supercells ready to run. The calculations were performed on 9 nodes of a Beowulf cluster. The total final energy per supercell atom as a function of the number of layers of silicon is shown

Page 50: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

in figure 8 below

Figure 8:The total final energy per supercell atom as a function of the number of layers of silicon.

We can see that the energy per atom is decreasing almost linearly with the number of layers. We would need to add very many layers for the energy to not vary by the inclusion of more layers. We will use 9 layers of silicon in future calculations. With 9 silicon layers the vacuum gap was varied from 3 Å to 15 Å in 2 Å steps. The total final energy as a function of vacuum gap separation is shown below.

Figure 9:The total final energy as a function of the vacuum gap

Page 51: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

thickness

We can see that the total energy is converged with respect to the vacuum gap when this has a thickness greater than about 7 Å (there is a slight upwards kink after this). We will use a 9 Å vacuum gap in all future calculations.

Now it remains to converge the basis set paramters. Cutoff energies of 140, 180, 230, 260, 290, 320, 350, and 370eV were used with MP grids containing 4, 8 and 9 k-points. The calculations were performed on a Beowulf cluster using 8 nodes for the 4 and 8 k-point calculations and 9 nodes for the 9 k-point calculation. The convergence of the total energy with basis set parameters is shown below.

Figure 10:Convergence of the total energy with respect to the basis set parameters

We can see that using 9 layers of silicon, a 9 Å vacuum gap, 9 k-points and a 370 eV cutoff energy will ensure minimisation of systematic errors with respect to both supercell aperiodicity and the basis set repectively.

So what results do we get? Click on the movie below to see the evolution of the atomic positions as the calculation progresses. Please use the 'back' button to close the movie.

Page 52: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

We can see that the result is an initial vertical relaxation followed by asymmetric dimerisation of the top layer silicon atoms. Asymmetric dimerisation has been seen experimentally [6] and has been confirmed by detailed theoretical calculations [7]. The bond lengths are shown in figure 11 below (the numbers in brackets are taken from reference [7]).

Figure 11:Principle bond lengths compared with the results of other theoretical work (in brackets).

Page 53: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

It is interesting to look at the evolution of the total energy and the forces as the calculation progresses. Figures 12 and 13 below shows this.

Figure 12:The variation of the total energy with BFGS iteration number.

Figure 13:The variation of the maximum force with BFGS iteration number.

Page 54: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

There is an inital dip in the forces at around iteration 14 as some search direction is tried but this causes an increase in the energy. Then there is a large increase in the forces (presumably due due dimer attraction) accompanied by a large energy gain which are due to dimerisation. There is then a small peak in the forces and the energy at about iteration 24 as the energy barrier to asymmetric dimerisation is overcome.

In summary, this example has illustrated the use of constraints upon atomic positions and has also looked at hydogen passivation and the variation of both the number of layers of atoms and the thickness of the vacuum gap as ways to deal with aperiodic supercell configurations such as surfaces.

Next: References Up: Geometry Optimisation with CASTEP Previous: A Variable Cell calculation 2005-04-03

Page 55: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Next: About this document ... Up: Geometry Optimisation with CASTEP Previous: Example - A Bulk

References

1) Payne et al. Iterative minimization techniques for ab initio total-energy calculations: molecular dynamics and conjugate gradients. Rev. Mod. Physics, V64:1045-1097, 1992.

2) Segall et al. First-principles simulation: ideas, illustrations and the CASTEP code. J. Phys.: Cond. Matt., V14:2717-2743, 2002.

3) G. P. Francis, M. C. Payne. Finite Basis Set Corrections to Total Energy Pseudopotential Calculations. J. Phys.: Cond. Matt.., V2:4395-4404, 1990.

4) P. G. Dacosta, O. H. Nielsen, K. Kunc. Stress theorem in the determination of static equilibrium by the density functional method J. Phys. C: Solid State Physics, V19:3163, 1986.

5) C. Kittel Introduction to Solid State Physics (Seventh Edition). Wiley, New York, 1996.

6) R. J. Hamers, R. M. Tromp, J. E. Demuth. Scanning Tunneling Microscopy of Si(001). Phys. Rev. B, V34:5343-5370, 1986.

7) A. Ramstad, G. Brocks, P. J. Kelly Theoretical Study of the Si(100) Surface Reconstruction. Phys. Rev. B, V51:14504-14524, 1995.

2005-04-04

Page 56: Geometry Optimisation with · PDF fileGeometry Optimisation with CASTEP Chris Eames This document (which is available for download as a pdf file) ... The Size and Shape of the Supercell

Up: Geometry Optimisation with CASTEP Previous: Bibliography

About this document ... Geometry Optimisation with CASTEP

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds. Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were: latex2html GEOM_OPT.tex

The translation was initiated by on 2005-04-04

2005-04-04