The Nuts and Bolts of First-Principles Simulation Durham, 6th-13th December : Is it running properly? CASTEP Developers’ Group with support from the ESF k Network
Nuts and Bolts : Is it running properly? 2 Outline Why you have to read the output file Sample output The road to hell Look after the pennies Completely wrong Right and wrong Graphic detail Summary
Nuts and Bolts : Is it running properly? 3 What is the question? We have to eliminate technical failures and separate artefacts from the proper predictions of DFT theory within an approximation (LDA, GGA) Goes much further than just checking the basics, because testing is the bedrock of good simulation studies (see Lecture 10) Here though we start with the basics
Nuts and Bolts : Is it running properly? 4 Scrutinise the output file! But I’ve got Materials Studio… CASTEP sets all the defaults…. But I have already set up the job properly… But it finished ok without crashing… But the results look ok, what else is there..?
Nuts and Bolts : Is it running properly? 5 But I’ve got Materials Studio… Defaults (interface or CASTEP) may not be appropriate Choices made on your behalf: are they what you want? The program tells you what it is doing and what’s going wrong
Nuts and Bolts : Is it running properly? 6 But I have already set up the job properly… All of the previous, and That doesn’t mean it has run properly You have to verify that your intentions were realised: you might have asked the impossible Are the results physically reasonable?
Nuts and Bolts : Is it running properly? 7 But it finished ok without crashing… All of the previous, and Finished because.. The task was finished and the tolerances met or it ran out of iterations? Was it efficient? But the results look ok, what else is there..?
Nuts and Bolts : Is it running properly? 8 The output file (.out.cst ) Input and defaults Initialisation Electronic minimisation (then MD, geometry optimisation) Calculate properties (Eigenvalues, forces and stress, band structure…) Finish
Nuts and Bolts : Is it running properly? 9 Sample output: startup | | | It is no longer just Cambridge... | | it is no longer just serial... | | it is no longer just for total energies... | | | | but for marketing and legal reasons it is still | | | | CCC AA SSS TTTTT EEEEE PPPP | | C A A S T E P P | | C AAAA SS T EEE PPPP | | C A A S T E P | | CCC A A SSS T EEEEE P | | | | | | Welcome to Castep II.0, the DFT code for the | | professional user. | | | | Authors: | | M. Segall, P. Lindan, M. Probert, C. Pickard, | | P. Hasnip, S. Clark, M. Payne |
Nuts and Bolts : Is it running properly? 10 Startup | | | Copyright 2000,2001 | | | | Please cite | | | | A Real and Reciprocal Space Odyssey | | (Comp. Phys. Comms 2001) | | | | in all publications arising from your use of | | this fine product. | | | Or perhaps M. C. Payne, M. P. Teter, D. C. Allan, T. A. Arias and J. D. Joannopoulos, Rev. Mod. Phys. 64 (1992) 1045 …but please acknowledge
Nuts and Bolts : Is it running properly? 11 Inputs defaults Warning: parameters_read - missing parameters file, using defaults Strategy found: 1 g-vector groups containing 1 nodes. Initialising basis set. Standard grid dimensions: Fine grid dimensions: Plane wave load balancing: max 1899 min 1863 average 1881 Warning: parameters_output - missing parameters file, using defaults ************************************ Title ************************ ***************************** General Parameters ****************** output verbosity : normal (1) write checkpoint data to : si_8atoms.check type of calculation : single point energy unlimited duration calculation *********************** Exchange-Correlation Parameters *********** using functional : Local Density Approximation (LDA) initialisation
Nuts and Bolts : Is it running properly? 12 ************************* Pseudopotential Parameters ************** pseudopotential representation : reciprocal space representation : reciprocal space **************************** Basis Set Parameters ***************** basis set accuracy : FINE finite basis set correction : automatic **************************** Electronic Parameters **************** number of electrons = 32 number of up spins = 16 number of down spins = 16 number of spin components = 1 number of bands = 19 ********************* Electronic Minimisation Parameters ********** Method: Treating system as metallic with ensemble DFT treatment of electrons, and number of SD steps = 1 and number of CG steps = 9 total energy convergence tolerance = E-04 Electron Volt eigen-energy convergence tolerance = E-05 Electron Volt periodically dump wavefunctions to : si_8atoms.wvfn *******************************************************************
Nuts and Bolts : Is it running properly? Unit Cell Real Lattice(Angstrom) Reciprocal Lattice(Angstrom-1) Lattice parameters(Angstrom) Cell Angles a = alpha = b = beta = c = gamma = Current cell volume = Angstrom^ Cell Contents Total number of ions in cell = 8 Total number of species in cell = 1 Max number of any one species = 8
Nuts and Bolts : Is it running properly? 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x Element Atom Fractional coordinates of atoms x x Number u v w x x x x Si x x Si x x Si x x Si x x Si x x Si x x Si x x Si x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx No user defined ionic velocities Details of Species Mass of species in amu Si Files used for pseudopotentials: Si Si_00.recpot
Nuts and Bolts : Is it running properly? k-Points For BZ Sampling MP grid size for SCF calculation is Number of kpoints used = Number Fractional coordinates Weight Symmetry and Constraints There are no symmetry operations specified or generated for this cell Centre of mass is constrained Number of ionic constraints = 3 Set iprint > 1 for details of ionic constrains Number of cell constraints= 0 Cell constraints are: External pressure/stress (Gigapascal)
Nuts and Bolts : Is it running properly? <-- SCF SCF loop Energy Energy gain Timer <-- SCF Initial Final per atom (sec) <-- SCF <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF E E E <-- SCF <-- SCF Electronic minimisation NB: “very-beta” test run and timings! Try this one yourself
Nuts and Bolts : Is it running properly? 17 The road to hell I thought I had Used the rPBE functional... Run it as a metal... Used the gamma point... Continued a run… Altered the lattice parameters… Used that other pseudopotential… Run without symmetry… Fed the dog my homework... Or anything you care to mention. The truth is in the output file!
Nuts and Bolts : Is it running properly? 18 Look after the pennies If CASTEP ran what you wanted it to: Are there any warning messages? Do you know if they are important or irrelevant? Has it converged or just stopped? Are all the obvious quantities reasonable? Total energy: negative? Expected value? Forces and stress: zero if they should be? Too large? Electronic energies: related to known values?
Nuts and Bolts : Is it running properly? 19 Completely wrong Apart from the obvious: The job never started The job crashed There are many ways a calculation can be rendered useless, but usually are avoided via systematic testing (Lecture 10) Inadequate plane-wave cutoff, k-point sampling Pseudopotential ghost states, poor transferability System size However, within a single calculation things can still go wrong, a few examples follow
Nuts and Bolts : Is it running properly? 20 Right and wrong I Although density mixing never does produce a smooth E vs. n curve (e.g. Cu unit cell)...
Nuts and Bolts : Is it running properly? 21 …right and wrong I Sometimes it just doesn’t work (e.g isolated Carbon atom, -point)
Nuts and Bolts : Is it running properly? 22 Right and wrong II Symmetry Use of (point group) symmetry imposes constraints The supercell imposes the translational symmetry constraints Both can lead to the wrong answer
Nuts and Bolts : Is it running properly? 23 Right and wrong III Load balancing On a parallel computer the node with the most work dictates overall performance Example (artificial!) 4 k-point calculation on three nodes, k-parallel Max. speedup is only 2X, not 3X
Nuts and Bolts : Is it running properly? 24 Graphic detail Use graphics to see what you are calculating xo yo zo dx dy dz
Nuts and Bolts : Is it running properly? 25 Summary The output file contains the basic information on the identity, health and sanity of your calculation Here we have looked at a tiny fraction of the potential pitfalls Always use/check the most basic data first Plot graphs, use graphic images If it can go wrong it will - but only when you are not looking!