Running a DFT calculation inVASP ICME Fall 2012 Laalitha Liyanage [email protected] Codes Density Funtional Theory • Hohenberg-Kohn theorems – Energy of the system is a unique functional of the charge density – The correct ground state charge density minimizes the energy functional and the resulting energy is the ground state energy. • Exchange-Correlation functional:unknown – Approximations: LDA, GGA (PW91, PBE) • Kohn-Sham scheme – Map interacting system to non-interacting system – Gaussian.Well-converged calculation • Choose XC functional – Accuracy: LDA < GGA < Hybrid • k-points in Brillouin zone – Do k-point convergence • Accuracy increases with no. Methfessel-Paxton etc. – good for ionic and geometric relaxations • Energy cutoff – Controls completeness of planewave basis set • Pseudopotentials – Replaces nucleus and core electrons with fixed effective potential . of k-points – For metals • Choose a smearing technique – Tetrahedron method – good for very accurate total energy calculations. What is VASP? • One of the software packages that uses DFT to solve the quantum problem for materials – Uses periodic boundary conditions – Uses pseudopotential method with a plane waves basis set – Can model systems with maximum no.html • Other DFT packages – (public license) – Quantum espresso (www.org) – Siesta (http://icmab.mpi.ac.univie. of atoms in the range of 100-200 – Commercial software package ~$5000 – Manual http://cms.at/vasp/vasp/PREC_tag.cat/leem/siesta/) .quantum-espresso.org) – Abinit( www.abinit. VASP input files • INCAR – User specified parameters that define the calculation • Global break condition. Energy cutoff. Smearing. Ionic and geometric relaxation parameters • POSCAR – Specifies the periodic simulation cell – Information regarding geometry of the system • POTCAR – Pseudopotential (PP) file – Information on PP and XC functional • KPOINTS – Defines k-point mesh . 0. 4.5.5.0) • a3 = (0.5. 0. fcc structure – Translational lattice vectors • a1 = (4.0) • a2 = (0.0 0.0. 0.Our system • Al • 4 atoms. 0.0.0.5 . 0.0. 0. 0.0) – Basis vectors • • • • 0. 0.0.0 0. 0. 0. 4.0. 0.0.0. 0. 0.0.5 0.5. PAW-LDA. PAW-PBE • If multiple species of atoms are in the system – Concatenate the same type of POTCAR files to make a single POTCAR file • E. cat POTCAR_Al POTCAR_Mg >> POTCAR – The order of the POTCAR types should correspond to the ordering of atoms in POSCAR . PAW-GGA.g.POTCAR file with LDA XC • For all elements VASP provides PP files in different flavors – US-PP. • Universal scaling factor scales the volume of the unit cell – If negative value is given then it is taken as the volume of the unit cell. – In Cartesian coordinates position of atoms is given in global coordinates. • Order of atom types in POSCAR should be same with POTCAR .POSCAR file • In Direct coordinates the positions of atoms are given as a fraction of translational lattice vectors. of plane waves in the basis set • Default: ENCUT=Largest ENMAX of POTCAR file – Best if convergence test could be done – PREC : Controls the overall precision of the calculation • Default: Normal – Standard calculation – are sufficiently accurate with errors less than 1 meV/atom • Low – quick and dirty calculations • Accurate – High accuracy calculations • For geometric relaxations (changing cell size) set ENCUT=1.INCAR file • Minimal setup – ENCUT : Controls the no. – uses in reciprocal space • AUTO – recommended for systems more than 20 atoms. – uses real space – ISMEAR • Default: 1 – MethfesselPaxton • -5: Tetrahedron method .False.3*ENMAXlargest – LREAL: use of reciprocal/real space • Default: . If the lattice vectors are a1=3 a2=9 a3=21 then k-point grid should be 7:3:1 ratio .KPOINTS file • For Al bulk system For Al single atom • k.g.point grid should be inversely propotional to the ratio of lattice vectors (else it will give rise to errors) – E. g. 11 × 11 × 11) – http://cms.html #im-smear .point convergence – recommended to use even meshes (e.mpi.univie.ac.g. • For very accurate total energy calculations (no relaxations in metals) use the tetrahedron method (ISMEAR=-5).at/vasp/vasp/Automatic_k_mesh_generation.at/vasp/vasp/Number_k_points_method_smearing.ac.Comments on k-points and smearing • Smearing – Guidelines for ISMEAR • For semiconductors or insulators always use tetrahedron method (ISMEAR=-5) or if cell is too large use Gaussian smearing (ISMEAR=0) • For relaxations in metals always use ISMEAR=1 – Never use ISMEAR > 0 for insulators and semiconductors.univie.mpi. 8 × 8 × 8 ) for up to �=8 • After that odd meshes are more efficient (e.html – http://cms. • k. of evaluations of the Hamiltonian acting on WF • rms – approximate error in WF • rms(c) – difference between input and output charge density .Standard output of a VASP run: PREC=N • N – iteration count • E – Total energy • dE – change of total energy • ncg – no. 01meV Therefore PREC=Normal with EDIFF=1e-04 is accurate enough. http://cms.at/vasp/vasp/stdout_OSZICAR_file.00001eV = 0.html .mpi.ac.univie.Standard output of a VASP run: PREC=A • • • • • No wrap-around errors Energy difference ~ 0. Data from stdout are written to OSZICAR file as well. OUTPUT files • CONTCAR – Contains position of the system after the calculation has completed • OSZICAR – Contains data of electronic steps and ionic steps • OUTCAR – Complete output of run including input file data. • CHGCAR – Charge density of system after run . cell volume.3*ENMAX to – If close to minimum use IBRION=1 (quasiaccommodate cell volume newton) change.ac. – To only optimize ionic positions with in the cell do ISIF=2 – To perform cell volume and cell shape optimization do ISIF=2 • NSW tag: Specifies the maximum no.html .Bulk Relaxations: Setup • ISIF tag – determines which degrees of freedom (ions.at/vasp/vasp/IBRI ON_tag_NFREE_tag.mpi.univie. – If away from minimum use IBRION = 2 • ENCUT is increased to (Conjugate -gradient) 1. of ionic steps – Default NSW = 0 • Since Al is metallic – Use ISMEAR = 1 for • IBRION tag: determines how the ions are relaxation run updated and moved. cell shape) are allowed to change. – http://cms. • http://cms.html . Next copy CONTCAR to POSCAR.at/vasp/vasp/Accurate_bul k_relaxations_with_internal_parameters_one.Bulk relaxation:Procedure 1.ac.mpi. Final step: switch on tetrahedron method (ISMEAR=-5) to get very accurate energies – NEVER use energies from a relaxation run if volume change is allowed.univie. clear output files (use ‘cleanvaspfiles’) and run again – For ISIF=2 second step is unnecessary 3. Using the relaxation setup INCAR do the first run with ISMEAR=1 (since metallic) and ISIF=2/3 2. • At the end of relaxation (ISIF =2/3) – if converged to parameters specified stdout will say .Volumetric relaxation procedure • Best method is to use do ionic relaxations (ISIF=2) at different volumes and plot energy vs volume curve. – Fit to equation of state and obtain equilibrium volume and energy – ‘evfit’program offers several equation of state equations which can be used for fitting purposes. 5 Å ~ only 10 points – More points will increase accuracy • Extracts – Final volume/ion – Energy/atom – Time for calculation • Makes 2 output files (2 columns) – Energy/ion for each lattice parameter – Energy/ion for each volume/ion • Calculation at each fixed volume could be static or only ionic relaxations.Automated Energy-Volume curve • Shell script • Uses lattice parameters from 3. .5 Å to 4. Curve fitting • Using ‘evfit’ program we fit the data to – Murnaghan’s equation of state • From the fitting we derive – Equilibrium lattice constant. and energy per atom. . bulk modulus. 8x8x8 and 11x11x11 • • At each fixed volume static calculation is done Total cpu time for these grids is recorded • • From 4x4x4 grid to 11x11x11 grid the time taken quadruples Energy difference is – From 4x4x4 to 8x8x8 ~50 meV – Form 8x8x8 to 11x11x1 ~ 6 meV .Automated k-point convergence test • EV generation script is called for different k-point grids – 4x4x4. pbs script For RAPTOR • To submit jobs to TALON or RAPTOR you need a pbs command script – Make sure that total no. of processors you request is used in your mpirun command For TALON • mpirun –np <nodes x ppn> • When doing calculations over 20 atoms use cluster . • Good rule of thumb: make system big enough that surface to surface distance is at least 10 Å – applies for any defect (vacancy. EDIFF=1e-06) • Next Setup surface calculation – Start with a system that has at least 5 layers of atoms and 5 layers of vacuum.Surface energy calculations • First to very accurate bulk energy calculation – Do k-point convergence to ~< 1meV • if you want to calculate surface energies within meV you should probably increase the k-mesh till your energy is converged to 1 meV -VASP – Do Volumetric and ionic optimizations to a high degree (PREC=Accurate. interstitial. stacking fault) – Do k-point convergence test • Since in one direction there is a vacuum and it is longer than other translational lattice vectors set revelent k-point to 1 • For the other 2 directions start off with values used for bulk calculation and do convergence • Finally keeping the k-points and all other parameters fixed change no. of bulk and vacuum layers – Look for convergence of surface energy – Remember to divide by 2 since periodic boundary conditions give rise to 2 surfaces . adsorption of O atom on Al (111).at/vasp/vasp/most_important _parameters_source_errors.g.univie.ac.Most common mistakes • Considering energy difference from calculations that has different energy-cutoffs – If ENCUT is not specified default is largest ENMAX of POTCAR – If adsorption energy is considered • E.html .mpi. Al ENMAX = 240 eV while Co ENMAX = 400 eV • Considering energy difference from calculations with two different k-point grids • Please read – http://cms. of k-points • Increase slab thickness for surface energy and adsorption energy calculations • Increase the size of the supercell for defects – To remove interaction of defect with defect due to periodic boundary condition .How to validate results • Increase cutoff – Recommended to set ENCUT by hand – Change to PREC=Accurate • Increase no. – Explain whether you got a well-converged result – You will submit a report and do evaluations of your group members . (110) and (001) surfaces Extrinsic and intrinsic stacking fault energies Plot generalized stacking fault curve – – – – – Lattice constant. elastic constants Defect energies – vacancy formation and interstitial Stacking fault energies – Intrinsic and extrinsic Surface formation energies E-V plot and GSF plot • List of properties of Aluminum going up to atomistic scale • Divide calculations within group – Report on ICME website what/how you did calculations assigned to you.Homework 1 • Each group will use different XC functional – LDA. GGA-PW 91 and GGA-PBE • DFT calculations – – – – – – – Energy-volume curves Elastic constants Vacancy formation energy Interstitial formation energy (Both octahedral and tetrahedral) Surface formation energy for (111). bulk modulus. ovito.ks.org/ – Windows and Linux • XCrysDen – www. Mac and Linux • OVITO – www. Mac and Linux • VMD – http://www.uiuc.xcrysden.Visulization tools • VESTA – http://jp-minerals.org/ – Mac and Linux .edu/Research/vmd/ – Windows.org/vesta/en/ – Windows. htm • VASP tutorial @ ugent – http://users.pdf .univie.ac.mpi.mpi.References • VASP documentation – http://cms.be/~devpouck/dlstuff/VAPS_tutorial 11_01_2010.at/vasp/vasp/ • VASP workshop slides – http://cms.ugent.at/vaspworkshop/slides/documentation.univie.ac.