so guys thanks for coming to this semester's first virtual simulation lab seminar today we're going to have one on something new fundamentals and applications of density functional theory given by Astrid Markinson so Astrid please okay thank you thank you for an introduction I'm happy to see that there is so many people interested in learning about the density functional theory which is what I do every day so yeah my name is Astrid I'm a PhD candidate that departments of material science and engineering so the outline for this talk I've divided into two parts so the first part of my talk I will introduce you to the fundamentals of density functional theory so that involves solving them anybody shredding a question and will also move into DFT I applied to crystalline solids which I'm mostly concerned about and the second part we're actually going to talk a bit about how to do our DFT calculations so when you go out here you'll have some knowledge on how to actually sit on your own computer and run your calculations yourself yeah so that involves a small introduction to the vast software which is what I use for these DFT calculations okay so first off what we're doing is computational material science that would be the field so it's not like I'm coding some language or whatever I'm a material scientists so I also do experiments but I'm just do it on a computer so this is me sitting on my lab in my office doing my computer experiments so DFT calculations they're also called first principles calculations or it needs so that means from the begin it just means that density functional theory calculations the whole theory it's not based on any you don't need any empirical parameters into your theory just plain and simple quantum mechanics building up the world right so you just set up your experiment and then let the computer apply the theory and then you get out or I get out a lot of nice properties describing my material so structural properties vibrational properties electronic you name it you can get it out okay so part one the fundamentals of DFT I'll just start with a slide of some definition so I don't sort of lose you when I get into the fundamental theory so we're all on the same page so just first a wave function in quantum mechanics that just describes the quantum state of a set of particles in an isolated system so that's nicely illustrated here you have a particle and in quantum mechanics you can just like make it into a wave right okay an operator that's not a scary word it's just it just does a mathematical operation on some variable so you shouldn't be afraid of that word easy example is the derivative that's not greater when you go into the quantum mechanics you deal with quantum mechanical operators and in quantum mechanics any observable anything you can physically measure in quantum mechanics is represented by an operator so for example that kinetic energy in quantum mechanics the kinetic energy is written like something like this so it's something something and then a derivative right so and lastly ground state that's mainly what we're after we're after defining the ground state of our system that's basically the most stable state of our system the system like the energy the lowest energy state right okay so that's that so now we start from the beginning so we're interested in finding the ground state of a set of particles and the way we do that is we try to solve the many body Schrodinger equation right so we have our wave function here which describes our system of atoms or nuclei and electrons and and we have our Hamiltonian which is an operator and energy operator which you apply to the wave function so again it's just operators just you can divide it into energy terms the T operator is just taking care of the kinetic energy and then you have the potential or Coulomb potential operator which just includes all Coulomb interactions so you know between two charges you always have a Columba interactions right so it's just yeah but you can see from this equation that from basic quantum mechanics we only sort of we look at the single electron state so because that's the most easy here we have a bunch of a new client a bunch of electrons which makes this sort of a very complicated equation to solve so let's try to make this at least a bit simpler and the first thing we do we apply the born-oppenheimer approximation that the proximation just basically says that the nuclei they are big and they are heavy and they are slow and electrons they are small and they are fast that means that you can decouple the dynamics of the nuclei and the electrons so the time electrons need to find their ground state with for one specific like positions of the nuclei it's much faster than a new plier able to move right so that means that the electrons they only see this external potential of static nuke life right so we decouple the wave functions that means that we from now on can only concentrate on first solving the ground state of the electrons for one like fixed set of atomic positions so great reduced our number of variables a bit and now the Hamiltonian only consists of terms which include electrons so D you have the kinetic energy term and then you have the potential terms here so the electrons interacting with the nuke lie which is only sees as an extent external potential and then electron-electron repulsions but let's just pause the BET and think of how big of a problem this turns out how fast this escalates in terms of dimensions of the problem so okay real materials let's take an easy small example let's look at the carbon dioxide the carbon dioxide molecule consists of 22 electrons each electron are described by three spatial dimensions coordinates that means that solving the Schrodinger equation becomes this the six by mentioning problem okay if you look at the Nano cluster of lead each leg consists of a two electrons so say that the Nano cluster has hundred atoms that means that the number electrons in the system is eight thousand two hundred and multiply that with three and you have the dimensions of your problem so you can see that solving the many-body Schrodinger equation is for all practical materials a bit of a hassle here is where we start to approach the density functional theory right so the electron density that's actually a true observable which in principle can be measured that can be defined from from the wavefunction that reduces from 3n dimensions to three spatial dimensions so the electron density is only three dimensional right so that seems to be sort of a hint the let's go in that direction let's try to solve the Schrodinger equation in terms of considering the electron density right hint hint now let's make another approximation so consider the electron as a point charge in the field of all other electrons that would simplify the many electron problem to many one electron problems so you go from a situation like this to something that looks like this and you consider single electron wave functions you still would simultaneously need to know them all of course to know it's there to care to calculate the one but still let's keep you there so that means that we can now redefine our electron density in terms of all the single electron wave functions okay so again we're approaching now the heart of DFT so the heart of DFT basis is based on two very fundamental theorems and the first theorem states that the ground state energy is a unique functional of the electron density so here's where the word fans the word functional comes in but it's not really a fancy or a scary word it's something you've all done so if functional is basically a function of a function a functional you'll would know an integral that's a function a functional sorry right so yeah don't be afraid of the word functional but the theorem basically states that the electron density is all you need in order to define your total ground state energy so get that's a really good thing and the second theorem that tells you how you're going to find your ground state density well you just minimize your energy functional so that just means moving down the well until you found your ground state density and then you're there so let's talk a bit about this energy functional this energy functional can be divided into two main parts the one that is known and the one that is unknown so the known part is basically all the energy terms that we already seen the kinetic energy and then all the potential energy terms which is connected just to the columbian tractions right and then we have the exchanged relation functional that takes care of all the quantum mechanical interaction between electrons and unfortunately that's something that we don't really know it exists the perfect the functional exist but we don't know it so in all calculations in DFT this is something that needs to be approximated so the simplest exchange correlation functionals that you will stumble upon in DFT it's called the local density function approximation that's the LDA only basis in self on local electron density and then the generalized gradient approximation which also takes into account the gradient of the electron density and there's a lot of developments going on all the time on improving these exchange collation functionals but i'm not going to dwell anything more upon that now so we call them the two theorems so Kuhn and then is postdoc charm they found out how you can actually find like in practice how you actually obtain them the ground state electron density and so they came up with this scheme so the first thing you do is that you just consider this effect of single electron wave functions and they're not interacting so it's non interacting system the interactions are sort of implicitly accounted for in these potentials and so the Hamiltonian for the single electron wave functions is the external potential and then the Hartree potential hence the age which is just electron interacting with the electron density and then this range relation potential which we have to approximate so that self-consistency scheme that's what we actually do in our calculations the first thing we do we just guess some electron density and so we make a trial liking density and we put that in to our to our Hamiltonian here and then we solve the charm equations which is the set of equations here so one equation for each electron and then we obtain a set of wave functions and we are already seeing how this correlates with the electron densities then we can recalculate the electron density and if the electron density we got out was the same one as we guessed and put in then we have self-consistency in our loop so that means that we obtain the true ground state if it's not the same then you replace your electron density put it as new trial and then just loop through again and so that's how you minimize you try search for the lowest the ground state and electron density by loop through this so yeah yes an electron density put it in your Hamiltonian then we calculate the electron density if it's the same perfect then you've got out the same as you put in so then we know how we have obtained the electron electronic ground state and now it's super easy to find the ionic ground state so or maybe not to find the ground state but at least from when you know the Hamiltonian and you know the set of correct wave functions because you have the right density functional right electron density you can easily calculate forces on ions and then you just move along the steepest distance of this steepest descent of the ionic forces to obtain an ionic ground state so in practice you use an algorithm you move it a bit and then you recalculate the electronic ground state and then you sort of always move it until you reach some sort of ground state for the ions as well and when you obtain that you can go even further in like move the items a bit away from their equilibrium position then you kind of it can obtain for your constants and vibrational frequencies yeah you can calculate the whole phonon spectrum for the ions there's a lot of possibilities okay so now we're moving into more specific gist of crystalline solids and now we're concerning with the plane wave DFT so let's see what that is let's first define a crystal so a crystal is a periodic arrangement of atoms this crystal so consider the nuclide er have some positive charge right may represent the periodic potential looks like this a free electron is represented by a plane wave this looks like this but what happens if you put an electron in the crystal how would the wave function look like and this guy block find out found out some nice things it's basically the result is block waves so you have the still plane wave and it's just modulated by some random potential which is also periodic with the lattice so it's basically just perturbed free electrons that's your answer and here is where playing wave DFT sort of comes into the discussion okay so I'll talk about some very important concepts in terms of your actual calculations in DFT or plane wave DFT the first one is cutoff energy so every central concept in DFT or yeah reciprocal space reciprocal space mathematically it's just the Fourier transform of your real lattice where all the dimensions are turned upside down basically so everything which is large in real space turns small in reciprocal space and vice versa small things in real space extend yeah far in reciprocal space okay and then you might remember that from math that if you have some periodic function you can always expand it in terms of a Fourier series so let's look at our block function which is the electronic wave function in our crystal so this was a periodic with with our lattice so we expand it and the wave vector turns out to be or this it's also sort of a timer no I don't know anyway so the wave vector actually turns out to be some reciprocal lattice vector right and if you multiply this in here you see that the Bloch wave can be represented as a sum of plane waves which has the wave vector of G plus K right and then you sum over an infinite number of reciprocal lattice vectors the problem numerically is of course that you cannot deal with infinite sums so in our calculations we have to define some sort of cutoff so each plane wave in this sum has an in a kinetic energy which is given by this so for a larger and larger reciprocal lattice and vector you have an increase in kinetic energy so we just in our calculations we just define some cutoff we don't consider plane waves which have a higher energy kinetically than this specific cutoff so this is a really important input parameter for you when you do these calculations yourself yeah and I'll come back to how you actually choose this cutoff energy because you have to do convergence testing in terms of your total energy to actually choose a high enough cutoff energy another important concept is a K point sampling again we're in a reciprocal space you just have to have some sort of sense of over what that is but yeah okay so our wave vectors are plane wave wave vectors they span the reciprocal space and in reciprocal space the primitive unit cell is called the Brillouin zone or the first Brillouin zone then you need to know that any K vector which extends the primitive cell in your reciprocal space or it's extends the Brillouin zone and if it can be written as the sum here so if it just first by some reciprocal lattice vector G is basically the same wave just sort of face shifted right so that means that in terms of considering which plane wave wave vectors we need to look at we can only consider the first Brillouin zone and we sort of captured it all so not dwelling too much on this either it means that the math and DFT in terms of evaluating integrals in a k space means that you only integrate over your first Brillouin zone so this is where the K points come in because again numerically you can't do you can't do integrations you have to do summations right so that's what you do you just sample your Brillouin zone you just put in some key points here and then you evaluate your intervals by like summing up all these points somehow okay so might be a bit vague but this is also important part of your calculations that you have to define you have to map and your Brillouin zone in terms of K points and the number of K points have to be sufficiently large so that you obtain reliable energies right and converged energies third important concept is the pseudo potentials so in terms of physical quantities like chemical bonding and yeah other characteristics of the material which we care about are mainly characterized by the outer electrons the valence electrons so let's make life a bit easier for ourselves so instead of considering like when we minimize our electrons electron energy let's not consider them all let's only consider the outer electrons and just fries in the inner electrons that makes calculations so much easier to do because the inner electrons here they're just now like in this big sum effective positive potential and then you only let this out of here move and a nice thing is that current DFT code they provide the pseudo potentials it's not like you recalculate what this anything here is every time so there's often a library with the pseudo potential that you use for each element in the periodic system okay so last concept before I move over to part two the calculations are performed with periodic boundary conditions so it's not like you implement every huge cell when you when you calculate some crystalline thing you implement the unit cell or you implement a super cell and the cell you implement is just periodically repeated in calculations so that means that there will be or there will be interactions across your periodic boundaries so that means that you can model non periodic entities like interfaces or like molecules or defects if you want so impurities in your system but then you have to take care when you actually define your super cell because of these are official interactions across across the periodic boundary conditions so for example if you want to simulate molecule maybe first of all maybe plane wave DFT is not the best thing because it's optimized for crystal structures but if you don't want interaction across the periodic boundary condition you have to make some sort of a lot of blank space around it right and also when you simulate defects you also need to take care on how you define your supercell to not have artificial interactions due to the periodic boundary conditions right so that was a lot of concepts now we're actually going to talk a bit about how we actually do DFT calculations on our computer some practical aspects so the software we use is called vas or Vienna ab initio simulation package so what is it well it's one of the software packages that uses DFT it uses periodic boundary conditions it uses the pseudo potential method with a plane wave basis set and yeah it can model system you can always model systems which are a larger but in terms of computational cost is not really optimized for any like you don't model this order in DFT you don't implement the cell with tens of thousands of atoms right doesn't make sense and yeah and it's a commercial software package there are other DFT codes or packages which are used quantum expresso obvi needs a siesta I don't really have any knowledge about them but there's a lot of people using the vas perm software and one main reason is well it's recently well documented and also they have a large set of pseudo potentials which are very well tested so that's perhaps one of the main things we pay for when we choose to use vasp so doing a simple DFT calculation in vast includes inputting into your computer or making four main files there are a lot of vast files with its name something car I don't know what the car comes from so don't ask anyway we have the in-car you know uh uh okay but don't care about the car you have Inc car includes inputs so that sort of it defines your setup in terms of yeah users specified parameters for example global break condition and you cut off the grease of freedom for the ions and so on and then you have the post car so that's the position car it's where you define your prereq simulation cell and yeah it contains basically information regarding the geometry of the system and then you have your pot car or that potential car and this car includes the pseudo potential so this is basically something that is provided by a wasp so it's big library and it also includes your information about the pseudo potential and the exchange functional so you have to choose one and then the K points so that's a a file that's suffice how you put out the decay points in your Brillouin zone right it's no car k points car is to be gold but oh okay so let's just take a simple example this is a simple pearl sky so in the perovskite world this is a simple example barium titanate okay so cubic Behrman titanate has a equals B equals C lattice parameters and then you have Kinley find some fractional ionic coordinates so just there's not eight barium that need to be defined you define the one barium right and then the all the other ones are just like mapped out by the periodicity so this is what you define and that means that you can create your postcard file that would look something like this so what does it mean well this is basically just the Cartesian lattice parameters you can you have a scale factor here that you can choose to use if you want you could in principle here since a equals B equals C set the number of 4.01 there and then just like one zero zero zero blah blah but yeah nevermind so this specifies the elements and here's number of each element so the first one here belongs to barium then the second belongs to titanium and then we have the three oxygen and this is just the fractional coordinates so it's very very simple and then we have the inc car fall this is a very simple in car file and you can specify a lot of tags here so I'll just mention the ones that I've put in and you can always argue whether these are the most relevant once or not but nevermind just like just to have a feeling what you put in there so for example you define the ink and cut that would be that's the energy cut off and that needs to be tested by convergence testing I'll come back to that then you for example set the maximum of electronic steps that's basically to prevent that the calculation never ends so it has some sort of drop out if it yeah never converges and you always set the convergence criterion both for ions and electrons you can for Alliance you can choose whether you want the convergence to be in terms of total and or forces on each ion or the total energy converging total total energy and also depends on like how stable your system is initially for example if you have some vacancies in your system it might be harder to relax it in terms of like it will always be some forces there for example if you have to have some artificial interface or whatever yeah you set the electronic to electronic convergence or the global break condition to an appropriate number and then you also can define the degrees of freedom in your system so for example if you want the the volume to change during your relaxation or if your own you want to fix the volume and you want to only relax ions or you don't want to relax science at all you just want to look at the energy for one specific configuration of the atoms you set this and you can also set the algorithm for how you update and move your eyes right so they're different choices there yeah so this is basically a file when you set a lot of tags cake points file it's quite small file doesn't contain a lot I always use the automatic mesh I can't really there's a lot of way you can explicitly set the key points in your bo-zone and but I use always an some automatic mesh so my file looks simple and the other things here is that I specify that I want to generate a gamma centered mesh so the gamma point that's just the denotes that a central point in your reciprocal space nothing more fancy and then just subdivisions of K points along each shell the reciprocal lattice vectors and this is also a subject for convergence testing Patkar file so in vasp you get a big library of so you have pseudo potentials for all the different elements in the periodic table and so you just like copy paste all your elements into your pot careful and you get a big file basically so it contains is some stuff for example type of pseudo potential because often or sometimes you can choose yeah never mind typos pseudo potential and here also the specific exchange correlation potential and all you can choose different pseudo potentials for what the same element by changing the number of valence electrons which are free to move right so this is one for the for barium yeah it's big file contains a lot of stuffs so what you get out some standard output files is you have the quant core file that basically looks the same as the postcard file it's just your relaxed ions of the car file and one of the more important ones it contains all your electronic and ionic steps I'll show you this afterwards and you have an out car file which is just like complete output so you go there if you want to see how the forces are charges and ions symmetry etc etc and then you also get out a charge charge car and you can there's a lot of things you can get out so I can't state them all until you go actually start doing these calculations yourself but you get some sort of idea of what you put in and what you can get out right so the Aussie car would look something like this so we talked about the the self-consistency scheme and the electronic iterations that's basically what you see here so for each each lump here that's the set of electronic minimization steps and then you have defined some sort of electronic convergent step so then it goes out of the loop and it calculates forces on ions it moves forces on ions and then it's just starts all over right so it calculates the total energy and what you set as a break condition is actually when the energy difference in two calculated total energies with that becomes smaller than something then it just breaks Loup so here it's something 10 to the minus 8 or something it might be 7c sitter and then you get out a total energy and so it will continue to do this until it reaches some sort of and your criterion for the ionic relaxation right and so in the end of this fall you have the total energy of your relaxed ionic steps ok so two things we talked about the K points and we talked about the cutoff energy and it's important to test convergence of that you always have to do that when you implement some new material system in your calculations you always have to do these convergence testing so what you basically do it's just you define for example a K a number of K points and then you just increase the number of K points and then calculate the total energy and when the total energy starts to converge you choose that number of practically the smallest number of K points that you need to make your calculations converge and then you do the same thing for the cutoff energy and also be aware that like the cutoff energy and the K points they all the number also influences for structural parameters like the lattice parameters which also will see would converge here is plotted against the K points if you make a point that total energies are not really what we care about in DFT will always look at energy differences it's not like oh the total energy of this system is minus 42 it it would change with the the pseudo potential and the action yeah with all your choices but if you keep your choice is the same when you do different calculations so keep the K points and the cutoff energy constant then you and compare energies and that's relevant and to have some sort of sense of the energy resolution in DFT we often say that's like a bit like approximately 1 million Eckstrom per atom so it's a bit hand waving but it's it's fine before we say ok so I'm approaching the end yeah right so just a few slides about the DFT which you can consider as a theoretical microscope that's a favorite phrase of my supervisor when it talks about DFT so for a lab experiment list that would be ok so you can actually can use it as a microscope that's cool so point this whitney of t you can obtain structure beyond the current capabilities of experiments and you can predict properties at a resolution and limescale currently and accessible to experiments but of course it all goes hand in hand I'll just give you a flavour or what I do myself so I'm sort of in the business of thin film technology if I flatter myself but ok so thin films are like big deals and big deal in terms of down scaling of electronics so yeah thin films this yeah in elect in mobiles and whatever electronics you obtain a thin film by growing it on a substrate so that's why you see here and a bit more detail see a substrate and a thin film often have different lattice rameters and then you have strain here and oh then you can have some defects or impurities in your thin-film and so this guy here is struggling because so this guy here sitting in the lab and he's doing some measurements on his thin film and he doesn't know what it's measuring right so there's okay so am i the result of what I'm measuring is that because I have strain in my film is that because I have some interface interactions going on is that because of the effects I don't know so here is where D of T the beautiful tool of DFT comes in because it's so pure right so so this is me again and and what I do is that then I also want to look at this thin film but I want to isolate effects and I can do that in my computer I don't need the substrate for example so I want to look okay I want to look at the thin films but I don't all only want to look at the effect of strain right so I can just make model and I can impose that strain without having the substrate so in DFT you have complete control of degrees of freedom that's the nice thing so you you know your model so you know exactly what you measure of course the challenge is thus the model correspond to reality so I don't say that DFT should replace the lab experiments I say that they have to go hand in hand and just a bit the visual of the outputs you can actually get so looking through the DFT microscope there's a lot of nice visualization it's not like I set the reading these files of numbers can visualize this very well to actually study the structure at an atomic level I can if I want plot the charge dense these I can see the charge density if I want and I can visualize density of states and you know get the information I want about my all the electronics and structural properties of my model so I hope in summary that I've showed you that density functional Theory is a powerful tool for predicting material properties and also that doing the actual calculations it's not so scary and yeah I have some references here to books about the fundamentals and your future Bible if you go into a DFT using wasp it's the Voss manual so thank you