DFT Calculations on Periodic Systems - University of St ... • Theory – DFT on periodic systems...

40
DFT Calculations on Periodic Systems Herbert Früchtl

Transcript of DFT Calculations on Periodic Systems - University of St ... • Theory – DFT on periodic systems...

DFT Calculations on PeriodicSystems

Herbert Früchtl

Outline

• Theory– DFT on periodic systems– Basis Sets– Pseudopotentials– Functionals

• CASTEP, VASP and SIESTA input syntax andcapabilities

• Steps in a typical surface science project• Visualisation of results• How to do a calculation on wardlaw• Links to more help

Density Functional Theory

Hohenberg-Kohn Theorem:

All ground state properties can be determined as afunctional of the electron density

Kohn-Sham equations

Can be solved self-consistently, using a basis set toexpress ψi(r), analogous to Hartree-Fock-Roothaanmethod

Periodic Systems

Bloch Theorem

Eigenfunctions of a periodicpotential can be expressed asplane wave x periodic function

• After Fourier transformation,only need to solve for 1st

Brillouin zone

• Plane waves are natural (butnot the only) choice of basisset

)()(

)()(

Rruru

ruer

knnk

kn

rkink

Basis SetsPlane Waves Good at describing periodic systems Straight-forward way of extending

basis No geometry dependence (BSSE) Mathematically simple Not good at describing “rough”

features Does not take advantage of geometric

knowledge (e.g. empty space) Need many functions to converge

result

Atom Centred Good at describing core

Correspond to atomic orbitals

Relatively few functionsnecessary

Better scaling for large systemsdue to integral screening

Not orthogonal

BSSE and linear dependencies

Different types available:Gaussian, Slater, numerical

MixedAtom centred functions in non-overlapping spheres

Plane waves in interstitial regions

Many flavours: PAW, FLAPW, GPW, …

Pseudopotentials

Problems with core electrons• wave function has many nodesneed large basis set to describe

• high kinetic energy relativistic effects

But: they are barely changed bybonding

Replace core with potentialthat “looks like a core” tovalence electrons outsidethe core area

Pseudopotential Gobbledigook

Small/large coreHow many electrons are removed?

HardnessA measure for the cutoff-radius (smaller=harder)

US-PPUltrasoft potentials: very fast

TransferabilityDoes it work for different chemical environments?

Norm-conserving

US-PP’s are not norm-conserving

PAW: Projector Augmented Wave

Construct wavefunction in core area frompseudopotential wavefunction

All-electron wavefunction (frozen core) based on US-PP calculation

• Little difference for structural properties, but better electronicdescription (charges, DOS, …)

• Recommended method in VASP

• GIPAW (Gauge Invariant PAW) used for NMR calculations in CASTEP

Density FunctionalsLess choice than for molecules

• LDA

• GGA

– PBE Very similar in cost

– PW91 and accuracy

• Hybrid functionals

– now available in CASTEP and VASP

– very expensive

• VdW correction (Grimme’s DFT-D2) available

• A few meta-GGA functionals appearing…

K-Points

Need to sample Brilloiun zone

– Monkhorst-Pack grid: equally-spaced points in BZ

– For band structure, specifyexplicit k-points alonghigh-symmetry axes in BZ

BZ describes interaction with remotecells in real space.

Need more k-points for

– small unit cells

– metals

– magnetic materials

Band Structure of fcc Ag

Programs(marked in blue if available in St Andrews )

CASTEPCPMDAbinitDacapoCRYSTALVASPPWscf (QUANTUMESPRESSO)SIESTAQuickStep (CP2K)NWChemConquestASWWien2k

More at http://www.psi-k.org/codes.shtml

CASTEPCambridge Serial Total Energy Package

Plane wave pseudopotential codeFairly high accuracy

SIESTASpanish Initiative for Electronic Simulations

with Thousands of AtomsNumerical atomic orbital basis + pseudopotentials

Good scaling towards large numbers of atoms

VASPVienna Ab-initio Simulation Package

Similar to CASTEP in theoryFaster, but not as robust and user friendly

No NMR properties

CASTEP input and output

Need (at least) two input files:

<project>.cell geometry, k-points

<project>.param everything else

Output will be appended to<project>.castep

Pseudopotential filescreated automatically by default (Vanderbilt US-PP),unless you want others

CASTEP .cell File: Geometry

Free-form and caseinsensitive

! starts comment

Multiline inputs in %block /%endblock

Cell dimensions can begiven as Cartesianvectors or as lengths andangles

Atomic positions infractional or absolute(Cartesian) coordinates

CASTEP .cell File: K-points and Constraints

K-points

kpoints_mp_grid <nx> <ny> <nz> Number of points in xyz directions

kpoints_mp_spacing <R> Max distance between k-points in Å-1

%block KPOINTS_LIST<x1> <y1> <z1> <weight1> Explicit list (Σ(weights)=1)

<x2> <y2> <z2> <weight2>… Only one of these!

%endblock KPOINTS_LIST

Simple geometric constraintsfix_all_cell = true Default is not to freeze

fix_all_ions = true anything

More complex linear constraints possible using blocksCELL_CONSTRAINTS and IONIC_CONSTRAINTS

CASTEP .param File

Format:

<parameter> : <value> [units]

Important parameters:task : GeometryOptimization or SinglePoint, MolecularDynamics

xc_functional : PBE or LDA, PW91, …

cut_off_energy : 400 eV accuracy of basis set

max_SCF_cycles : 100

geom_max_iter : 100

fix_occupancy : false Necessary for metals

smearing_width : 0.1 eV Only compare total energies

obtained with same smearing!

Order of input is irrelevant

VASP Files

Need (at least) four input files:

POSCAR geometry

POTCAR pseudopotentials and method

KPOINTS grid of points in Brillouin zone

INCAR everything else

Files MUST have these names

Output:

OSZICAR short overview

OUTCAR human readable output

Several other files for analysis or restart

POSCAR fileTitle (ignored)Lattice constant

lattice vectors and cartesiancoordinates will be multiplied by this

Lattice vectorsNumber of atoms of each species

(here: 7 atoms of 3 species)

“selective dynamics”Optional. Necessary if atoms to befrozen

Direct (fractional) / cartesiantype of atom positions

Atomic coordinates and constraints:F=frozen (actually FALSE…), T=free

Optionally: velocities(in case of dynamics)

Information on atom types comespurely from POTCAR file!

POTCAR File

Pseudopotential (including electronconfiguration and functional to use) foreach atom species in same order as inPOSCAR

• Created by concatenating atomic PP files:uncompress -c /usr/local/VASP/potpaw_PBE/Rh/POTCAR.Z >POTCAR

uncompress -c /usr/local/VASP/potpaw_PBE/C/POTCAR.Z >>POTCAR

uncompress -c /usr/local/VASP/potpaw_PBE/O/POTCAR.Z >>POTCAR

Overwrite if it exists

AppendPBE GGA functional and correspondingpseudopotential with PAW

KPOINTS (Regular Grid)

Automatic mesh0Gamma4 4 40. 0. 0.

Title (comment)

Number of points (0 = automatic)Centering (Gamma/Monkhorst)

Points along reciprocal vectors

Shift from centre (optional)

VASP will take care of symmetry

KPOINTS for Band Structure

Band structure10 ! 10 points per lineLine-modecartesian0 0 0 ! gamma0 1 0 ! X

0 1 0 ! X0.5 1 0 ! W

0.5 1 0 ! W0 1 0 ! gamma

Best to run a calculation with full K-grid first, and thencalculate babnd structure at unchanged density(ICHARG=11 in INCAR)

Example INCAR Filegeneral:

SYSTEM = Cu 111 surface Title

ISTART = 1 Start / restart

ICHARG = 2 initial guess charges

ENMAX = 270 energy cutoff in eV

ISMEAR = 2 Initial Fermi smearing (for metals)

SIGMA = 0.2 Smearing width

ALGO = Very_fast fast or robust?

geometry optimisation:

NSW = 100 max. number of steps

POTIM = 0.2 scaling for forces

IBRION = 2 optimisation/dynamics algorithm

Many more options. See manual!

SIESTA InputFiles

FDF (Flexible Data Format) file

Pseudopotential file for each element (download fromhttp://www.uam.es/departamentos/ciencias/fismateriac/siesta/

or create your own (ask me…))

FDF format<parameter> <value> [units]

Case insensitive; random order

Characters -_. ignoredLattice-Constant = lattice_constant = LatticeConstant

# starts a comment

Logical values: T = true = .true. = yes

Complex data structures in blocks (like CASTEP)%block <label>…

%endblock <label>

SIESTA: A Simple Input

Name of project

Root for file names

Atoms and elements

Scaling factor for further geometry

information

Unit cell (also possible to specify through

LatticeVectors)

Atomic coordinates (various methods,

including Z-matrix)

Monkhorst-Pack grid (one of several

ways of specifying it)

Functional (LDA, GGA, hybrid)

Geometry optimisation

Properties to Calculate

• Total energy• Equilibrium Structures

with and without optimising the unit cell• Dynamics• Band Structures• Density of States

Local DOS (projected on axis or atom)• Mulliken Charges (even with CASTEP…)• Phonon Spectrum• NMR: chemical shift, EFG (only CASTEP)

How To Simulate Adsorptionon surfaces or microporous structures

Solid• Periodic

• Fractionalcoordinates

• Plane Waves

• Band structure

Molecule

• Isolated (vacuum orsolvent)

• Z-Matrix

• LCAO

• Energy levels

?

Cluster Calculations

Treat limited part of solid as amolecule

• Use any molecular program

• In case of molecular crystal, capdangling bonds with hydrogen

• Freeze all or most of the solid atbulk geometry

• Can not determine bulkgeometry

• For metals, consider usingECPs (=pseudopotentials)

Periodic Surface Model

Use sufficiently large unit cell

– Vacuum slab between bulklayers

– Potential self-interactionbetween adsorbatemolecules

– Need to freeze lowerlayer(s) of bulk

Steps• Optimise bulk structure

– Create unit cell geometry– Converge energy cutoff to a few meV/atom– Converge k-points to a few meV/atom– Optimise cell size and ionic positions

• Relax surface– Create surface cell with vacuum slab large enough to accommodate

adsorbate and enough layers to get bulk properties– Re-converge k-points (need less now)– Freeze cell dimensions and lowest layer(s)– Optimise geometry (1)

• Optimise complete system– Add adsorbate molecule– Optimise geometry (3)

• Optimise adsorbate– Remove adsorbent– Optimise adsorbate in the same cell with the same parameters (2)

• Calculate adsorption energy– Difference in final energies: ΔE = E(3) – (E(1) + E(2))

Example: Adsorption Energy

A

B

C

• Convert existing structure file– Scripts on wardlaw in

/usr/local/progs/CASTEP-6.0/scripts

– cryst (syntax like babel) translatesbetween fdf, cell, poscar, …

– Most viewers allow saving in differentformats

• Build from scratch– Fairly easy for basic crystals in fractional

coordinates

– Atoms at top and rear are not part of theunit cell!

• Use primitive cell if possible– This is not what we did in the fcc

examples…

Create Unit CellA

• Use a calculator and a bit oftrigonometry…– Make sure you use the lattice constant from

bulk optimisation

• Use tetr (non-graphical)– Tool to create or modify inputs for VASP,

SIESTA and (less so) CASTEP

– Can be used to freeze bottom layers

• Use gdis (graphical)– No support for VASP, but easy to convert

from cif or fdf formats

– Less powerful than tetr, but easier to use

Create Surface SlabB

Example: (1 1 5) fcc-Surface with gdis

Add Molecule to Surface

gdis viewer can add, deleteor move atoms

Select “Editing” in Model menu

Add atom:

–Select “Add atoms”

–Specify element

–Left-click in model window

Move atom

–Select “Normal Mode”

–Select atom

–Ctrl-middle-mouse-button tomove atom

Or: change coordinates

C

More Complex Molecules

Combine Cartesian coordinatesUse a spreadsheet to move molecule

Use Z-Matrix input for SIESTA

• Define molecule by distances, angles anddihedrals

• Can combine Cartesian and Z-Matrix coordinates

Gdis can copy between different files

• Open slab model (e.g. fdf file)

• Open molecule file (e.g. xyz or Gaussian log)

• Select molecule, Edit -> Copy

• Switch to slab window, Edit -> Paste

• Move molecule with ctrl-middle-mousebutton

C

Visualising Periodic Structures

Want to see• Geometry• Electron density• Orbitals• Spectra• DOSAvailable programs• Gdis Blue: available on wardlaw• XCrysDen• Mercury• VESTA• Discovery Studio Visualizer• Materials Studio

Gdis

• Fairly good rendering

• Can read .castep andwrite .cell or .fdf files(problems reading .cell)

• Display animation of MDor optimisation

• Calculate diffractionspectra (X-Ray, neutron,electron)

• The only reasonablebuilder (except MaterialsStudio)

Mercury

• Part of CambridgeStructural Database

• Very good rendering

• Use castep2cif.pyscript to create cif file

• Can calculate X-raypattern

XCrysDen

• Good rendering

• Very good atdisplaying molecularsurfaces (density, …)

• Scripts to convertdifferent formats to .xsfin/usr/local/progs/CASTEP-6.0/scripts/usr/local/progs/siesta-3.0/Utils

How to do a Calculation

• Get an account on wardlaw– Email me! [email protected]– Look at introduction lecture or ask me

• Create input files– Templates available.

• Create job script– Templates available…

• Submit batch jobs– See introduction lecture (sbatch, squeue, scancel…)

• Sample job scripts available in/usr/local/examples

Links

This lecture and previous ones:Available soon!

CASTEPhttp://www.tcm.phy.cam.ac.uk/castep/

SIESTA:http://http://icmab.cat/leem/siesta//

CPMD (with a very good tutorial)http://www.cpmd.org/

VASP (also with good tutorial)http://www.vasp.at/

Postgrad course on computational chemistry

Email your name and supervisor to Tanja van Mourik

[email protected]

Not only for postgrads!

Other Lectures and SeminarsLectures on

Molecular Quantum Chemistry (Monday)

DFT on Periodic Systems (Tuesday)

Computation in Chemistry Seminars

See Chemistry Newsletter

Sign up to mailing list with Tanja van Mourik