10, 15 seconds. Ciao Alberto, benvenuto. Ciao tutti. Hello everyone. Good morning. Good morning. To meet you again at a different venue. Sooner or later, we'll get to know each other in person. Are you a boxer? Alberto, are you a boxer? No. OK, Stefano, we are live. We're live on streaming, yes, Stefano. So we are live now. You can start. OK. Alberto, are you a boxer? No. I heard my hand whipping cream. So I just need to. Yes. It's a gentler, a gentler, less aggressive one. So we are live now. But I thought it was a Leone thing, a wrap. No. No, it is like a martial arts wrap, but it's like what I had at home, so. Oh, I see, I see. I heard my hand whipping cream, so like. It's a gentler, a gentler, less aggressive one. But I thought. I hear my voice, so with several seconds delay. Yeah, it's OK. It's the streaming, because they had the volume on. Now I turn it off. I see. You can start anyway. OK. I don't know how to start. I would say good morning, but it may as well be good afternoon, good night, good whatever. Good day, everyone. And welcome to this first online edition of the Quantum Espresso School. I am thrilled, as I was saying to my colleagues before switching the microphones on, because this is the very first time we go live online. And it's an experiment for everyone. Of course, this gives us the opportunity to reach out to many of you all over the world, but it also leaves some uncertainties. And I beg you in advance to forgive us if anything does not go as smoothly as we wish it will. This is the 25th edition of a long series of schools that started at ICTP in 2001. Since the school has roamed many continents around the world, including Europe, of course, the Americas, both North and Latin America, Asia, and Africa. You guys and gals have been preceded by almost 2,000 previous participants in this series of schools. This time had an immense and unexpected success. We received 1,300 applications from 92 countries. And 123 such applications have been selected. We apologize to all those who had to be excluded. Probably in the future, we will admit more people than just the 100 that we have admitted this time. But we wanted to make sure that for this first time we can manage hands-on rooms, hands-on stations, in as much a way as possible. This school should have taken place in person in 2020 in Shanghai. And I wish to thank Professor Ray from Shanghai University for volunteering to host the school last year and Alessandro Stropa for putting us in contact with Ray, with Professor Ray, and the University of Shanghai. Unfortunately, as you can imagine, the pandemic prevented us to make it last year. And it took us some time to figure out how to proceed. We have been hoping for a while to make it in person. But at the end, I have no regrets. I mean, at the end, as much pain the pandemic may have given all of us. But this, I think, prompting us to try this experiment is one of the few good side effects of the pandemic. So no regrets about that. The last edition of the school was held in person in Ljubljana in 2019. And it was a success. I wish to thank Tony Tockel and his collaborators for hosting us in the George F. Steffen Institute in Ljubljana in 2019. And for the incredible work they made to make this virtual edition a success, I'm sure. So the school is the result of a long collaboration between CISA and ICTP in many areas of research and education. And it is being held under the umbrella of two parent institutions that I would like to acknowledge. You may wonder what Max means. Max is an European Center of Excellence for Supercomputing Applications. That is the main source of funding for the quantum espresso project these days. Many distinguished institutions from all over Europe belong to Max, including CISA, ICTP, the Italian National Council for Research, the EPFL, the School of Technology in Lausanne, the ETH, the School of Technology in Zurich, Foschum Zentrum in Yolish, CEA in France, the Catalan Institute of Nanoscience and Nanotechnology in Catalonia in Spain. And communication and dissemination is also being taken care of by the Gantt University, CICAM, and the Trusted Service Company. Other, the Quantum Espresso Foundation is the home of the Quantum Espresso project itself. It's an institution that has been supported by CISA, ICTP, the EPFL again, the Cineca Supercomputing Center in Bologna, the University of Texas at Austin. And shortly, I believe, and I strongly and I wholeheartedly hope, the George Stephan Institute in Ljubljana. I would like to cut the long story short and proceed with the knowledgement of the many people and institutions which have made this event possible and the case preparation incredibly smooth. I'm really grateful to the local organizers, the two events, Ivan's, even Girotto from the ICTP and even Karni Mayo from CISA, whose energy and constructiveness has been really instrumental for the success of the preparation. The efficacy of the ICTP staff, both administrative and technical, has been beyond imagination, as usual. And I would like to present my own personal thanks and the thanks of all the organizing committee to Adriana Pinto and Massimo Maffione, who is assisting us in this very moment. Hardly researches have been proposed, have been provided by a range of different public and private bodies. And our thanks goes to all of them as well. I wish I won't forget any of these important sponsoring components, which include several computing centers. Cineca, Arnaz, that's an organization for research in Slovenia. The HZW company in the Far East, in the Shanghai area. ICTP and CISA are providing their computational support as well. I'm sure I have forgotten some important things and I apologize in advance to anybody or any institution that I may have forgotten to thank my full-hearted thanks goes to those whom I have forgotten as well. So I wish all of you to learn as much as you can teach and to enjoy the school as much as we will enjoy it. Thank you very much for being with us and I leave the stage to Rafa Bauer. OK, thank you very much, Stefano. I hope that everyone can hear me. So welcome also from my side. My name is Ralf Skibauer. I'm from ICTP. And before starting, I should say that it's obviously a big pleasure and also a big honor to be the first speaker in this long two weeks event. And I should also say this should really not be my place now to speak because everyone who knows something about Guantum Espresso and about the community behind it immediately knows that one of the pillars of everything which we'll be hearing about in these two weeks is Paolo Giannazzi. And so it was planned in the original program that this first talk would be given by Paolo. And so by all means, he should be the first speaker and introduce everyone to Guantum Espresso, which he is very much under the pillars of it, as I just said. OK, so Paolo cannot come today.  So it's just one day later. And I will now try to share my screen in order to presentation. So I hope that you can see my screen now. Please interrupt me when something goes wrong with the presentation or so. So my plan today is to give you a very general overview of what Guantum Espresso is. And I will spend most of the time of my talk then, in fact, talking about very basic things. Mainly, I will talk about the plane wave basis set and what the plane waves and periodic system and k-points and all these kind of things have to do one with the other. Because these are very recurring themes which also distinguish Guantum Espresso for many other electronic structure codes. And I think as a first presentation in this conference, this is probably the main topic one should mention. As Stefan was just said, we have had many, many kind of schools in the past. But this is really the first one where everything is virtual. And this being virtual, this is really a very large scale collaboration. Here, I just list the logos of kind of sponsors. And you see all kind of different institutions. There is the Guantum Espresso Foundation. Obviously, there's Max, which Stefano has just introduced. There are also the two Trieste institutions, CISA and ICDP, which is my own affiliation. There's SECAM, with supercomputer centers, Ginega for Italy. There is the Arnes Supercomputer Center, which is in Slovenia. We have Shanghai University. So it's really a large scale collaboration by many people, just like Guantum Espresso itself. It's a large scale collaboration of many developers, many interested people, and so on. So this is where I am in this very moment. This is Trieste, the Miramare region. I am sitting right now in an office which is somewhere here in this building. And if there wasn't this horrible pandemic going on, I think it's quite sure to say that we all would now be here in that area and sitting somewhere close to the seaside and talking about physics. But well, we all know that it could not come like this. So only I am here now, and I'm trying to talk to all of you from all kind of places in the world. So let me just say some words about ICDP, since this is my own institution. So ICDP is, we have just seen where it's located here in Trieste. It is now nearly 60 years old already, and it was founded by the Nobel laureate, Abdul Salam. And we are, in fact, an international organization which is under the two United Nations agencies, which are UNESCO, so the UN Armed for Science, Culture, and Education, and the IAEA, which is the International Atomic Energy Agency. And we are also regularized by the SEED Agreement with Italy. So our goal in ICDP is to bring together people from kind of from everywhere in the world to do science and work collaboratively on scientific problems. We all know that in today's world, more often people do wars against each other than do scientific collaborations. I think this mission, even now 60 years after the foundation of our center, is very important. And in a sense, this going virtual, like we are doing now with this school and so on, these virtual ideas also are kind of bringing us close to our, to this mission of bringing people from the whole world together. This is very well illustrated. If you look at this map of the world, where these circles here indicate where people have been applying from. And you see really from every corner of the world, we have had applicants. In fact, this activity is a record breaker. Never in the history of ICDP anything has had 1,292 applicants. So we are very proud of this, obviously this big success and interest which Bantum Espresso and which our topics have. I would also like to say what Stefan has already said. We are at the same time very sorry that this 1,292 is about one order of magnitude more than the number of people we could admit. The reason is that this is a hands-on school and we have a limit number of tutors and it's the first time. So we could really admit only many, many fewer people than we would have liked to admit. So I would like to say to all those who have not been selected and would perhaps now look at this on YouTube in streaming or watch a recording later. It is clearly not due to you that you could admit it but it is the logistics and the fact that it's the first time. So I would like to go to science and not say many things but this huge number of applicants and this fact that this is really first for ICDP, this has put a lot of work especially on the secretaries who had to deal with all these applicants and so on. So I would like just here say a special thing to Monica, Victoria and Adriana who have in a very nice and smooth way managed to cope with so many applicants and so much bureaucratic issues. So again this thing. So I would now like to come to the heart and to the star of this school which is quantum espresso. So what does this quantum espresso mean? Well, quantum everyone knows what it means because we do quantum mechanical simulations and this espresso stands for open source package for electronic, sorry, open source package for research and electronic structure, simulation and optimization. This is an acronym which we have been looking a long time until we found something. The real reason is probably that most of the people behind quantum espresso are Italians. So that might be one of the reasons why this is called espresso. The other reason might be that the results you get from these calculations they are so exciting that it's like an espresso. It keeps you excited and awake when you use quantum espresso. And so quantum espresso as we talk about it today exists in fact since 2002. And since this is an activity which we are doing together here with the Chinese organization I would like to recall the fact that in fact in this year 2002, many of us were sitting in Beijing airport and we were precisely discussing that the set of pros and cons which already existed but which did not really have neither a trademark nor real structuring beneath them they should come under one umbrella. And it was in fact in Beijing airport that the name espresso for this whole thing came up. So this is also some connection to China. And so in 2002, this umbrella was kind of created quantum espresso, but some of the core components or the most important components which underlie many of these codes this goes back more than even 30 years and probably even more than 30 years. But since 2002, there was this deliberate effort to try to put subroutines in common between different programs to have a common architecture for many things which before were very different. And what distinguishes this quantum espresso from many other approaches to electronic structure is that we are trying, we are not always managing but we are trying very much to be at the forefront of theoretical methods. So when someone invents new functionals or a new computational method to calculate something new, very often rather quickly these new developments find their way into quantum espresso. And so we are kind of proud of the fact that most of the interesting things today are in fact in one way or another implemented in quantum espresso. So one of the two goals we have is this staying close to innovation. And the other goal is that we are trying to make these codes run and as many different computer architectures as possible. Some of you have perhaps already seen this video which Nicola Mazzari has once done where he has installed a quantum espresso on a smartphone. It was even a very old smartphone. So basically from smartphones up to mainframe, computers, clusters, your laptop, you name it, quantum espresso can use and run on many modern architectures including architectures which have accelerators and so on. There will be also some session about GPU and accelerators in fact in this group. So these are the kind of the two aspects which I would say distinguish us from any other thing. Another thing which is not particular to quantum espresso but which I find extremely important is that this code is a free code. So everything in quantum espresso is distributed under this GNU public license. And this means that anyone who wants has access to the source code but not only has access to and can read it but can also distribute the code however someone wants. So if you take quantum espresso and you find someone who is even willing to pay you money for giving you can even sell the code if you want it's completely free. The only thing is that this license requires that if you have some derivative work related to it you are asked also to publish this under the similar kind of license. And this kind of free nature of our codes it not only means that everyone can use the code even if people working in some research groups which perhaps do not have the money to pay licenses or so on but it also means that people who perhaps like programming or like new methods they have a very low hurdle to overcome to implement their ideas in our codes. This is probably also one. So I think this free license is also one of the reasons why we are able to stay as I said in the forefront of new developments and having all the time new developers which are joining our team. Obviously, I mean this free license is not the singular to quantum espresso. I mean the most famous one is the Linux kernel which is in this very moment running on most of your computers. So another thing which I should say in the beginning is if you're really a beginner and you wonder where can I get more help or why can I get answers to my question and where can I get information from? There are various sources which you can look at. Well, one is obviously a school like this one. You can look at this school and you can also look at recordings of previous schools where many things I explain. But apart from this, one of the thing is obviously the main the official documenting papers. Here are these two papers from 2009 and 2017. And in fact, we are very happy if people who have some results and publish some results with our codes if they site these papers. Another very rich source of information is obviously our website, quantum espresso.org. On that website, you can find links to the code itself. You can find links to pseudo potentials to various places where pseudo potentials can come from. You can find links to mailing list. So there, this is kind of probably the first place to start looking for information is this quantum espresso website. Now, this week, all of you will be working with the code itself installed in a computer. And as soon as you install quantum espresso in your computer, you will have all the source code obviously, but also the source code contains these documentation, these doc sub directories. And they contain a lot of input explanation and files which explain you how you can address certain problems. If you're more not so much into user, but into a developers one, then you might be interested in the Github obviously where quantum espresso is hosted. And then if you run quantum espresso and something stops with some cryptic error message, which we really don't know what it means. One good thing is always to look in the archive of the mailing lists. So put the copy, the strange error message in Google or so you will very likely end up on these mailing lists which I recommend you to subscribe. And if you do not find in the archive of the mailing list the answer to your problems then you can obviously also write to the mailing list and there are many people who try to have this issue. So there are many ways how you can get help or if you're lucky and you know some of the people and tutors of the next two weeks you may also contact one of these people and directly obviously. Then I should say what quantum espresso itself is. So quantum espresso in fact is not one code.  In fact, this does not exist. There is no executable quantum espresso. Quantum espresso is kind of as I said before a package. It's a package which contains various other codes, many other codes as you will see in a second. And then, but these packages kind of they rely on two packages which are the core of everything and also kind of the oldest one. One is the PW program, it's PW.x is the executable. We call it PWSEF. It stands for plane waves, self-consistent field. This is the main workhorse for calculating the electronic structure in a self-consistent way. You can do structural optimizations of your system. You can use variable cells. PWSEF can also do molecular dynamics to some degrees but it's really not optimized for being very fast in molecular dynamics. For molecular dynamics instead, there is this second basic code which is the CP code, the Kappa-Marinello molecular dynamics and as the name indicates the CP code, this is really geared to do up-in-issue molecular dynamics and it can also do variable cell molecular dynamics. So these are the two basic codes and it's very likely that for running any of the other codes or for using any of the other codes, you would probably first have to run either PWSEF or CP in order to get the basic results in which then the other codes rely. So here I just made a list and I'm sure I might have forgotten some. So the most important kind of other codes which are part of this distribution. So one in the phonon code, it's also one of the oldest codes of the package. This implements linear response calculations so density function response theory and with this code one can calculate phonons in the system and dielectric properties. And so this is a typical thing here to calculate in a system phonons. One first has always to calculate with PWSEF, the ground state electronic structure of a system and then kind of as a second step, one can run phonon or one of the other codes then to calculate, in this case, the phonons. Another big part of the things are the PP and programs. PP stands for post-processing and this allows you to analyze results of code. You can log in, what is the density of states? How do the cone-sharm orbitals look like? What is the electrostatic potential in your system? Things like this. So the PP programs allow you to examine and analyze results of, for example, PWSEF. Needless to say that during these two weeks, you will get in touch with all of, with most of these codes, but certainly you will get in touch with phonon and the PP codes. Another very popular code is the NAB code which allows you to calculate reaction pathways, transition states and so on, reaction barriers. So this is a driver code which inside itself runs PW. Then we have the atomic speed of problems. So with the atomic code, one can create pseudo-potentials, which I will talk about a bit later today also, what pseudo-potentials are important. So we have a code which is running for any given atom over the periodic table. You calculate the all-electron atomic wave functions and then you can create pseudo-potentials. There is a GUI program also, which is a graphical user interface. There's a code PWCond for calculating conductance. You can calculate X-ray absorption spectra with the X spectra code. One can go beyond ground state electronic structure by doing other GW calculations. So many body perturbation theory and we have one implementation of it which uses localized one-year function. This is the GWL code. There is TDDFT implemented, so time-dependent density functional theory. This is also a code which can be used for calculating electronic excited states. Something which in recent years has become extremely popular in the scientific community is electron phonon effect. So there is a code which is called EPW, electron phonon physics. This code obviously like the other one is linked to the phonon code, which is linked to PW. So you see that there's also a hierarchy always of these different codes. And there's a code HP, which allows one to calculate some Harvard parameters in certain systems. I'm sure that there are many more and other codes, but I think these are the most important. So you see this quantum espresso is not one code, but it's a whole distribution of different codes which have a hierarchy because some of them need the output of one code in order to be run and to be unclogged, okay? So this is kind of what quantum espresso is really all about. And what is underlying, everything is obviously the big theory is density function theory, okay? So in this talk, it's just one talk today. I will not be able to give a full introduction into density function, see you and explain where everything comes from. What I would like to do in the next minutes is rather than really giving a full introduction to DFT, I will introduce the most important notation and just say the most important things, hoping that all of you have in one way or the other already encountered density function. So in DFT, so it's a ground state theory, we are interested in a system which has N electrons. Each electron has obviously a spin one half and these N electrons are somehow distributed in space and give rise to an electron density. Now the electron density is a very easy quantity because the electron density is simply a scalar function at each point in space. It's always non-negative and the integral over all space of this density must correspond to the number of electrons. So the density which is kind of our basic variable in DFT is a very easy quantity and surely much easier quantity than say the ground state many body wave functions of your system. Now in DFT, what we know thanks to Hohenberg and Kohn and the Hohenberg and Kohn theorem is that there exists a functional, so a function of a function which takes us and input this ground state electron density gives you the ground state energy of your system. So this DFT functional is unknown but one knows in a mathematical proven way that this functional exists. So the way how one addresses then this problem is typically going to the Kohn-Sham formalism and in the Kohn-Sham formalism this unknown functional of DFT is written as the sum of several terms. One is a kinetic energy term, this TS which you see here, then an external energy term, the Hartree energy term, exchange correlation energy all these depend on the density and then the trivial ionic-ionic interaction which is just the Coulomb interaction between. So this year should give you the ground state energy of the system with the charge density N. And you see however that Kohn-Sham they had to introduce in order to get a good approximation for the kinetic energy they have introduced here orbiters. So not many body wave functions but single particle orbiters the so-called Kohn-Sham orbiters and these orbiters they are linked to the charge density just in the way as one would guess so they are N-orthanormal orbiters and the sum of their square moduli this is the famous charge density. They have introduced these orthanormal Kohn-Sham orbiters in order to have a good approximation for the kinetic energy. So this Kohn-Sham non-interacting particle kinetic energy is written in the following way. So it's again a sum of all these N Kohn-Sham orbiters and then the usual expression one would write for kinetic energy. And these orbiters obviously they are N and they are orthanormal. This is obviously not the exact kinetic energy of a many body system. It's an approximation. This is why it's a T but it's T as the single particle kinetic energy and all which we do not know about this functional in fact is hidden here in this exchange correlation functional or the other energies in fact we can write them down explicitly. So the external energy, so external means coming from the ions it's simply the external potential which is the Coulomb potential due to the atomic nuclei which are positively charged exerting on the electron. So this here is simply the density times the given external potential. The Hartree potential is also very easy to write down knowing the density because it's simply the classical Coulomb interaction of charges. So written here in this way ions as I've said is simply the point wise interaction between the ions of your system. The big unknown in DFT and the problem where kind of the failures of DFT come in is that no one knows the exact form of exchange and correlation. So this exchange correlation functional must be approximated and there are many, many various approximations. None of them is perfect. I will in this talk not talk at all about exchange correlation functionals but the usual ones which either simply are simply local approximation in terms of N or semi local or then also more complicated stuff are implemented in fact in quantum expresses. So for the moment here just take for granted that some approximation of the unknown energy here of the exchange correlation is given and we take that in our code. So this gives us now a way of writing the ground state density of our system in terms of say either density or these orthonormal Coulomb orbitals. So in practice what is done what is always done is one wants to find the ground energy. So one is minimizing this quantity with respect to the density or if you want with respect to the Coulomb orbitals and if you write down in fact the functional derivative of the DFT energy with respect to the Coulomb orbitals and you add the constraint that these orbitals must remain always orthonormal then one ends up with an equation which looks like this.  So the Coulomb equations are essentially a Hamiltonian like operator acting on each one of these single particle Coulomb orbitals equals energy density. So a Schrodinger like equation and this Coulomb Hamiltonian which we have here contains in fact the derivatives of the energies we have seen before. Kinetic part which is simply the derivative of the kinetic energy of the previous slide the external potential which is due to the nuclei the Hartree potential and exchange correlation potential. And the formal definition is that the exchange correlation potential is the functional derivative of this unknown exchange correlation function with respect to the density. Same for Hartree it's the functional derivative of the Hartree energy which we know explicitly and therefore it has this easy form. And so one can solve this equation. So you have a Schrodinger equation. It has eigenvalues and eigenvectors. So and if you solve this same with the sum either iterative or the complete solver you will find this eigen energies epsilon. So if you plot then these eigen energies epsilon you have one eigenvalue, another one, another one and from bottom to top you might have something like this. And if you have n electrons you will need n such eigenvalues and eigen functions. So what one is doing is one is filling up the lowest n levels just here if the system is non-magnetic in the way which I've shown here and one doesn't even need to calculate. One can calculate if one wants more of these empty states here of the empty eigen vectors of your Hamiltonian but it's not necessary to calculate them. You must calculate at least as many as you have electrons or I mean always a factor of two for spin if you have a system depending if your system is magnetic or if it is not magnetic. So in practice what one is doing is one has a Hamiltonian that Hamiltonian is well-defined once you know a density and once you know I have an approximation for exchange of correlation. One calculates in one way or the other we will talk about in a minute eigenvalues of this and one takes the lowest eigenvalues and takes at the conchum orbitals those functions which correspond to these low-lying eigenvectors. Okay so this it seems to be very straightforward and very easy but there is one problem in this and the problem is that this Hamiltonian here itself it depends on the charge density. You can see very clearly for some of the Hartree potential here in order to calculate you need to know what is the density but the density you obtain it from the conchum orbitals so from the solution of this Schroding equation. So the problem which arises here is that you have an equation and in order to write down the equation you need to know already its solution. You need to know the conchum orbitals in order to be able to write the equation which the conchum orbitals have to satisfy. So you see it's kind of a circular problem and this is known as the consistency or the self-consistency problem. We must be able somehow to find conchum orbitals which are eigenfunctions of an operator where inside the operator the operators in here are defined by N and N as you remember from the previous slide for N we need to know what are the conchum orbitals. So this self-consistency problem there are various ways how one can try to address this and the way which is implemented in the PWSEF code and also in many other codes is to do this in an iterative way. Let me show also kind of the picture how one can imagine this iterative way. So this is known as a self-consistency cycle. And the idea is in the beginning obviously you do not know yet anything.  You can start with a guess say put as a density is simply random numbers or you can put which is most of the time done you can put as a guess in the beginning a density which would just be the superposition of unperturbed atoms which do not interact. The only thing is that you're starting density it must satisfy obviously these two rules. It must be non-negative and it's integral must be correspond to the number of electrons you have in your system.  So now you have a density it is certainly a wrong density but it's an admissible density from the mathematical point of view. And with this density you can now build this Hamiltonian from the previous slide. So you can go here now having some density you can write what is the heart rate potential what is the exchange correlation potential. So now you can define this concham Hamiltonian. Obviously it will be as wrong as the density will be wrong this concham Hamiltonian will probably not be the one which we will have in the end but you now have a Hamiltonian at iteration number i in this case in the beginning at the zero iteration. Now with this Hamiltonian you can now solve this Schrodinger like equation which I've shown you.  Now you can take these output orbitals take the square moduli of these orbitals this gives you a new density the output density. So you started with the guest density to the left and you end up with an output density of your system which is of these new eigen functions of your Hamiltonian. And now you look at it if you're in the first iteration for sure this output density here will be different from what you have guessed in the beginning. So you're comparing them are they more or less the same and there is some criterion some convergence criterion in the beginning certainly the answer is no they are not nearly the same and you go to the next step. So what you're doing now is you're taking these two densities the one which you have guessed before and the output density which you have just calculated and you're mixing them together. In the easiest way in the easiest case you're just mixing as I've written here you take a parameter alpha which is a number between zero and one you are taking a bit of the old density and the other bit of the new density you're mixing them together. Now this mixing is important in order to have this repetitive circle to be able to converge. If you do not mix and just take the output and put it as a new input it's very likely that you will have oscillations going on forever. So this mixing is necessary for assuring convergence and for kind of you can see it as if you were adding some kind of friction into your system, okay. So you now update a new density I call the I plus one of iteration I plus one. This new density is now different from the one we have guessed in the very beginning. Now you set the variable I to the next one you're so you're next to use it again to build the Herakon-Chum Hamiltonian you solve the Schrodinger equation to get again a new density and again you are comparing is what I plugged in more or less the same as what I get here and to iterate this as a function of how your system is you might need five iterations you might need 10 sometimes when it's 200 iterations it depends and obviously there are many parameters in PW input files which you can tune to try to get better convergence of this side. But the basic idea here is always this year you start with some guess to build the Hamiltonian you solve the Contramagraded get new density and you do this with the mixing and finally the so-called self-consistency is reached if the density you use to build your Hamiltonian is the same as the one which comes out of the eigenfunction of that same Hamiltonian in this case you are done and you have found the ground state density of your system, okay? So this is in theory in two, three pictures how the self-consistent circuit looks like in practice it's the hands on school you will see it starting from later this morning this is a part of an output of quantum espresso and what you see here in the output is it says in the very beginning my initial potential so the initial Hamiltonian is guessed from a superposition of free atoms in this case, okay? So here it takes atoms and this is just taken as initial guess as I've said it could even be random numbers but here the code has used as an initial guess a superposition of free atoms it also needs to start with some guess for these cone shum orbitals and here it takes atomic orbitals but it is randomized so it's adding a little bit of random numbers to them to break some spurious symmetries which might be there so this is what the code is doing in the beginning it is guessing how the solutions might be like and then it starts iterating as I've just said it says iteration one it gets a guess for the energy which certainly is very bad and it says ah, but I see that the accuracy here in this case it's still very poor it does the next iteration has a better guess for the energy and you see that the estimated accuracy is going down that's a third iteration and so on and it will continue in this case you see until iteration 10 and iteration 11 and then you see here after iteration 11 obviously this accuracy you see it has been going down from 1.9 in the first step this is if you want the comparison between the two densities up to here already 10 to the minus 8 or something like this and at a certain point it reaches its conversion threshold here this is after iteration 11 and in this case now the code prints out of this self consistent Hamiltonian which are the eigenvalues so the eigenvalues remember these lines where you put two electrons starting from the bottom these here are the eigen energies in electron volts of your Hamiltonian in increasing order and it also tells you ah, okay so in this case the highest occupied level is minus 6.2 so this here is the highest occupied level and the first level which I did not occupy anymore is minus one so you see here and it has in this case here if you want a band gap of about five electron volts so this is what the code does then it gives you the total energy at this one and you see now this accuracy this conversion threshold it's really very small now and this is why it is said okay we have converged in this case you needed 11 iteration so this is the basic thing whenever you run PW so the basic DFT code of quantum espresso you will always notice this it starts with some guess it does a series of iterations hopefully at a certain point it converges when it is converged it gives you the eigen values of the Hamiltonian and the energy unfortunately I have when I was copying this picture here into my presentation I was by mistake cutting here the left because once it is converged it is putting the code is putting an exclamation mark in front of the converged total energy so you can if you use a grab of an exclamation mark in the output you directly find the converged total energy so unfortunately I have cut this away without working okay so this is what I have said now as we know how in principle the ground state DFT calculation can be done we have to ask ourselves well how is this done in practice because we have densities we have quantum objects they are all functions of R of space and this must be stored in a computer somehow the computer cannot store a function the computer can only store numbers a set of numbers so any electronic structure code not only one of those any code will need a basic set a basic set essentially is a set of functions here I call the functions V alpha a set of functions and whatever you are interested in being the density being a concha model or whatever is expressed as a linear combination of some given basis functions and which function you use as basis functions this is kind of determining also which code you are using because typically you cannot within one code change so there are various functions which you can use to express your density in your objects as linear combinations and so here again I say this so the function which you need to represent in the computer is this F you have given before you start your calculations a set of basis functions we will talk about them in a minute what they are what the computer really stores is only these expansion coefficients so for every function needs to represent it is storing the expansion coefficient for every basis function it has this is in the computer's memory now how many basis functions are there I call here this number M and this is the size of the basis set and you can already imagine that if you have a basis set which is larger then you will need much more memory in your computer because for every function you need to store these M expansion coefficients so on one hand you would like M to be as small as possible to save memory but on the other hand you also want your basis set as complete as possible in order to be able to describe any shape of your function this is a linear combination of your basis set so many various basis sets have been chosen very popular are for example basis sets which are localized around given atoms or for example Gaussian functions which are centered on the atom or atomic orbitals which are also centered on the atoms but none of this is done in quantum espresso one of the defining features of quantum espresso is that we are using a basis set so these functions V alpha which are used in the quantum espresso codes are plane waves what do you mean by plane waves? well here you see the explicit plane wave is essentially e to the i a wave vector times r so essentially in other words a plane wave is a sine and a cosine function with a given well defined wave vector and once you have defined the wave vector you know what this plane wave is so in quantum espresso everything densities, quantum orbitals and what you have is expressed as linear combinations of sine and cosine functions and this has obviously important consequences so why are we using these plane waves and not something which is localized on your atoms? because the plane waves have a lot of advantages one thing is obviously they are very easy functions so everyone can very easily integrate or take a derivative of a plane wave so there are many many expressions which appear in your equations are very easy to perform the other thing is if you have two plane waves with two different wave vectors then automatically they are orthogonal and two plane waves with the same wave vector they are normalized so plane wave is automatically an orthonormal basis which is also very useful in practice the other advantage is that plane waves are unbiased in the sense that you have a system you throw plane waves on it and you do therefore not assume all my electrons are close to the transition metals or all my electrons are close to the center of my molecules you do not assume anything that is treated equally in the same way and there is no bias in this another point is that since the plane waves are independent of where your atoms are sitting you do not have a change of basis set whenever you move your atoms so if you do some molecular dynamics also your atoms move but your basis set remains the same the basis set does not change with changing atoms which is the case if you have for example atomic orbital centered on your atoms you move around an atom you move the basis set and therefore you have different basis sets for different geometries and that means in practice that you have forces to calculate so you can pool a forces and they are absent in codes which use plane wave another very big advantage is the convergence of the basis set size this is something I will be talking about in the following slides a lot there is one number which you can increase or decrease and with this number make your calculation or your basis set better or less good and you can very easily in this way check on the convergence of your basis set so it's really useful to have just one number which you change and the other point is that obviously plane waves and sine and cosine they are ideal for using Fourier transforms and going back and forth for some equation obviously I mean the big disadvantage is that since plane waves have no built in knowledge about what chemistry looks like what an atomic function looks normally like typically these spaces are much much bigger so this number m the basis size is much larger than if you use atomic orbitals or use gaussians or something like this so now that we have established how we can express our functions using kind of combinations of functions which look like what you see here I have to talk about something which is intrinsic whenever you talk about plane waves and this is periodicity we will see in a minute later why it is so important or why periodicity of a system is so closely linked to the use of plane waves but for this reason let me just say some more words so imagine you know that the system is periodic here I just show it in two dimension so periodic means that you have a unit cell which is repeated indefinitely in all three dimensions so here for showing this it's just in a two dimensional world so once you define your basic box and the box does not need to be a rectangular box as I've shown here I've shown you a kind of a hexagon box so in this case it's made out of two vectors one of the two vectors of this box would be this one, the other this one and this is the basic cell which in a periodic system you imagine repeated indefinitely together with your basic repeating box you define where the atoms are so in this case for example I decided I put in every box two atoms and you see it's not even necessary that they lie directly the atoms inside the box which you define which defines your periodicity you can put them anywhere but you will repeat the atoms as you will repeat the box so now looking at this probably it's not easy by the eye to see what kind of system you are calculating with this kind of box these kind of two atoms but if instead of plotting just one unit plot now a two by two repetition okay this already looks like here something which is a cyclic and if instead of two I plot three you can see that we are coming closer and closer to the hexagonal graphene structure and in fact if you imagine that you would be having really an infinite repetition of this box with two atoms you see that this gives you in this case a sheet of graphene obviously I've chosen this example because in the exercises today we will be one of the first exercises you will be capable so periodic systems can either be typically they are three dimension here I've chosen a two-dimensional system but if you have a crystal for example you have a diamond or something this is what happens typically with a three-dimensional box with three lattice vectors and you repeat it indefinitely and inside this box you have your atoms at well defined positions so imagine you have a system which is periodic and you now would like to describe wave functions using plane waves in such a periodic setup now one thing which you probably remember from mothermatics if you have a function which is periodic in real space so you have anything for example a density which is the same in this box as it is in this box as in this box so you have a system which is periodic you calculate the Fourier transform and you will find out that the Fourier components are nearly all zero except for the Fourier components at very special discrete wave vectors g and in fact so in one dimension where you can see very easily if your plane wave looks like e to the i g x so just a one-dimensional thing so you have non-zero expansion coefficients only in front of those plane waves where this g vector satisfies the fact that it must be an integer number times 2pi over l so l in this case is in one dimension the size of the repeated unit and this 2pi over l if you want is the distance between non-zero Fourier components or in other ways you have had an infinite number of plane waves now you still have an infinite number of basis functions but now you have not a continuous but you have discrete values of g which you have to consider this is thanks to the periodicity of your system a three dimension it's very simple you have a three-dimensional wave vector and the wave vector three dimension must be an integer multiple m and p are integers an integer multiple of the three reciprocal lattice vectors so also here you have now discrete plane waves rather than a continuous set of wave vectors in your basis in 1d you can see again here so you have the possible non-zero g vectors are obviously g equals zero and then you have one two three four and so times the basic 2pi over l which is the distance here and you can already see that the larger your unit cell so if you double your unit cell l becomes larger and this distance between the discrete point becomes smaller if you double the size of your unit cell you will have double the density of g vectors in your basis now a wave vector is always linked obviously to a wavelength and if you plot the wavelength or if in the same thing you look at what is the wavelength of all these wave vectors here so you have the wavelength here your lambda is equal to the size of your box then the size divided by two three four and so on so the wavelength which you are describing with a given plane wave is inversely proportional to the g vector so now thanks to the fact that we live in a periodic world we now can say okay instead of having an infinite number of basis vectors because g is cotins we now still have an infinite number but now we have discrete values for g and the values are these here but still in order to do a practical calculation we need a finite number of basis functions so somehow we need to take out of this infinity of possible plane waves we need to pregnant and the reflection will be the same things as you found and this is done and this is done by imposing in fact a minimal size of features you want to be able to describe in your system so one is saying okay I know that my density or my orbital they will not vary on the scale of atomic nucleus they will vary on the scale of or I don't know our basis, we define a minimal wavelength which we want to be able to describe. And these I show you here. So this is again my g-vectors, my discrete g-vectors. And now I define a minimal wavelength lambda min. And you see here, for example, if I say lambda min is this value here, then L over 4 is still a wavelength which is larger than the minimum you have imposed. But here then L divided by 5, 6 and so on, this is a smaller wavelength. And here the same is for the minus g's here, you have again the same thing. So imposing a minimal wavelength which you want to be able to describe, kind of cuts out of this discrete but infinite number of possible plane waves, all those out which are lying to the left or to the right of your cut-off wavelength. So this is basically the idea in one dimension. You have one parameter which describes how good your basis set is, and this is obviously something system dependent, and it's this minimum wavelength lambda min. So for practical reasons, one is typically in an input file, sorry, not describing what is lambda min, but one is describing what is the maximal norm of the g-vector which comes in. And in fact, so the maximal value of the g-vector obviously is inversely proportional to this lambda min. So it's the same if you describe a minimum wavelength or a maximum norm of the g-vector. And in fact, what really one puts into quantum expression in the code is a cut-off energy which would correspond to the kinetic energy of that maximal g-vector. So in a PW input file, you will put in e-cut. The e-cut defines by this equation a maximum norm of the g-vectors and therefore a minimal feature size which in your system you would like to describe. So if you're not in one dimension, but in two or three dimension, it looks a little bit like this. The g-vectors, as I said, are integers times the reciprocal lattice vector. So here that reciprocal lattice vector one would be in this direction, reciprocal lattice vector two would be this vector here. And then you have integer numbers times this. You have a discrete set of possible g-vectors which are compatible with a periodic system, a discrete set of g-vectors, but an infinite number. Now you impose a maximum kinetic energy or if you want a minimal feature size you would like to be able to describe. This defines you a norm g-max. This looks in two dimensions now like a circle. One dimension was the two blue lines I've shown in the previous slide. In two dimensions it's this circle. In three dimensions it would be a sphere of this radius of g-max which is related to the cut-off energy. So you have this and now you consider only those plane waves which have a norm which is inferior than your cut-off. And now you are left with the basis set which is well defined because it is a finite number of g-vectors and these are they. So this is how in quantum espresso you obtain a basis set. It is by imposing a minimal feature size or a cut-off energy which cuts the total number of possible g-vectors to a finite number. So now I need to say something about orbitals and charge density. So what we have done now is we are saying okay we have a function which is periodic for example a cone-sharm orbital psi L. This cone-sharm orbital is written as we have said as a linear combination of these basis functions. The sum goes only over these allowed g-vectors which lie inside our sphere. And what the computer stores for every plane wave is this expansion coefficient here. This is what is stored in the computer. So imagine we are doing this with a well defined cut-off with a well defined g-max for the cone-sharm orbitals. Then the next step which we would need to do is to calculate the charge density corresponding to those cone-sharm orbitals. Remember that the charge density is calculating by calculating the square modulus of the orbitals. Now if you see this here this is in real space a product of two functions. Fourier analysis tells you if you have a real space a product of two functions this corresponds in reciprocal space to a convolution. So if I write this down here what is the Fourier transform of the density. So this is now a function of g. Then I obtain here again a sum over all possible vectors because this here will also be periodic. So I have again a sum over g-primes and I have something like this psi of g and psi of g minus g prime. Now I know that this term here the psi tilde of g prime will be non-zero only if g prime lies inside my sphere because this is precisely how I defined. So we can restrict the sum over g prime to those lying inside the sphere. But now you see what happens the vector g in fact it can have a norm which is larger than the maximum norm allowed for the wave functions because even if say this g here has a norm two times the maximum g then if g prime is g max you still can have here a non-zero element. So Fourier analysis tells you that the density because it is a product of two functions which are written with a kind of g max the density will have much higher cutoff. In fact it will have Fourier components which are non-zero up to two times g max. So now this is very important that in these calculations you need two different basis sets one basis set for the orbitals with a given cutoff and one basis set for the density which will contain many more g vectors simply because you have two times g max here and you therefore need for the density a cutoff which is at least four times the cutoff for the density four times because g squared goes into the energy. So this is in fact the reason why you will have always two cutoffs and if you do not do this then you get so-called aliasing or aliasing errors in your Fourier analysis and this is nothing you would like to have in your code. So at this stage we can say okay you do the properties of plane waves the cutoff for the density must be four times the cutoff of the wave function. Later towards the end of my talk you will see that sometimes one needs even a higher cutoff for the density. So this is how it looks in PW this is an absolutely minimal input file here and the minimal input file tells you okay here I used for the wave function e-cut w of c a cutoff energy of 60 the code reads this oh why does this continue the code reads this and in the output of the code it says okay my kinetic energy is 60 Rittbergs as written in the input for the charge density I will use four times like it so obviously the code knows about these Fourier analysis features okay so 64 times gives you this here in the output. Let me just say one thing which you might observe is if you are changing the the lattice constant of your periodic system then sometimes you might observe something which is happening here a strange discontinuity when you are increasing the lattice size of your system so how can it be that one would expect that functions kind of behave in a continuous way but sometimes you see discontinuous jumps of the energy. The reason for this is as you increase the lattice constant of your system you are making this grid of g vectors denser and denser remember that the distance between adjacent points is 2pi divided by the size of your system so increasing the lattice constant here to the left gets these dots closer and closer and closer you keep a fixed cutoff energy obviously then at discrete intervals some points will fall within the sphere and you have in a non-continuous way you will have a larger basis set the larger basis set if you're not at convergence means that the energy goes down so these jumps and they are obviously not very pleasant especially if you are trying to do molecular dynamics where the variable cell where the cells are can change and this problem has obviously some solutions I will not explain them in detail here but if you're interested in this look in the input descriptions for the variables easy fixed you can see and q2 symbol you will have in the input file to set variables like this to take care of eventual jumps in the in the energy when you change the lattice constant of your system this was just some comment I wanted to make here now very important is something I have not mentioned yet is the fact that even if your system is periodic your orbitals typically are not periodic in fact we all have learned in solid state physics blocks the urm okay which tells us that in fact the concharm orbitals in a periodic system okay they have a label a k label a wave vector label and they have the shape of e to the i k so here you see again a plane wave with a wave vector k multiplied by a function u and in fact only this function u here is purely the size you see this here k is not necessarily one of these points on our grid and the psi function itself is not periodic only this part here so what does this mean for what I've just been saying up to now if u is a periodic function then u we can express on this grid of g vectors I've just been saying before so u we can express in our basic set with the discrete and grid of g vectors just like we've been saying so far now you put this u into the definition of a block vector and you obtain something like this and now you see that you have again an expansion in the terms of discrete set of g vectors but the effective g wave vector is no longer g but it's always k plus g for a block orbital with the wave vector k okay so you have this thing which is shifted by k in other images so this is the image we have seen before this where where we did not have any any k point now if instead of g you have k plus g you can imagine that this is always shifted away from this grid from what it was before the cut off remains obviously the same it's a sphere centered around zero and the k vector for a given block orbital effect would be here this small vector here this would be k another k vector would be this so a block function for a wave vector k here has a basic set given by by plane waves which is given by these functions inside this circle okay so for different k vectors you will have a different three dimensional grid of loud g vectors it is very clear that if you take as if you add to any k vector a reciprocality vector then you are shifting this already periodic set of black points so far that you cannot distinguish it so this kind of explains again to you why in fact the system is periodic in k space and one needs to consider in fact only what for for k what is happening inside the first brilliant zone because anything outside the k vector outside the first brilliant zone corresponds by periodicity to a point inside the first brilliant so if you have your periodic system you have to sum over all possible k vectors but the k vectors are restricted to lie inside this first brilliant zone and this is done in quantum express quite easily if here again i show you a picture of the brilliant zone so imagine this here is reciprocal lattice vector one reciprocal lattice vector two the brilliant zone in this case if they are rectangular it will look something like this and in quantum express you give in the input file you say i want to sample the brilliance and in this case for example the four times four k point grid and then it would choose these k points and each one of these k points corresponds to what we have seen here before to this shift here of the k plus k okay now very often it is not useful to take a grid in k points like this but one is shifting the k point grid by half the distance between these k points so if i do this this here would be the shifted four by four grid so you see i'm shifting the same grid and i'm just shifting it by half the distance between all these points why is it useful to shift your k point grid well because of symmetry you see for example so if you have a symmetric system where for example this wedge here of the brilliant zone would be equivalent to the upper wedge here then this point here has in the brilliant zone eight friends so one two three four five six there are eight points which are equivalent so in order to have calculated the charge density for these eight points you just need to calculate at one single point if you have the much more symmetric non-shifted grid you have no single k point which corresponds to eight other points you can see this both in in the non-shifted grid you always have the k equal zero point and whatever is the symmetry of of of of your system the the zero point it will always end up on itself again so here symmetry is really a handicap and shifting the k points in fact leads to grids with the same amount of calculations it gives you a much faster convergence so in a pw input file this brilliant zone sampling is done just by saying okay i want k points i want an automatic grid and in this case for example you can say okay i want in the x and y direction nine points in the c direction only one this might be for example if you have a two-dimensional system like raffin and then the next three numbers is always zero or one it tells you for x y and c if the grid is shifted or not so the 991 110 selection would be a nine times nine grid in two dimensions which is shifted and a non-shifted single point typically the k equals kc equals zero point in the third dimension and in the output of bottomless press over it gives you the k points it's using it gives oh okay this here leads now in this case to 25 non-equivalent k points and you see every k point these k points have different weights this is what i've said here for example here these points which have a multiplicity of eight one will calculate them only once but give them a higher weight and you see here there are some points which have a high weight of 0.09 other k points have a much lower weight like here like this the last one which is 0.02 and you also know that all these k points have as a third component zero because we have only one k point one point in the c direction and do not shift so this is always zero okay so this is how plane waves your your basis set and so on is linked to also to k points and and to to this okay so now what happens if you have a system which is not periodic well in this case one is introducing a supercell the supercell in fact one is i show you here one is simply taking a cell which again is repeated periodically this is also of today's exercises where you will calculate benzene so one is putting your non-periodic system sorry an isometric molecule in a cell which is so large that the distance to the neighbors in one direction or in the other direction and also in the third direction is so long that you effectively cut off any overlaps of wave functions and so on okay so a supercell essentially in these cases means that you're taking a very well as large as you can afford a computational cell in order to ensure no interaction between these images now this is not always so easily possible because if your object is charged for example if this molecule was charged then you can use as large as you want a unit cell the coolant interaction will always be there the same if you have a molecule with a dipole or something with the dipole it will interact with the dipolar interaction you cannot have a cell which is so large that that this interaction goes completely away now this issue so for charged or dipole system has two solutions if you have a zero D so say a molecule or cluster something which really is not periodic in no direction then you can use the input variable assume isolated which essentially in one way or the other cuts of coolant interactions beneath the length which are and intramolecular so the coolant interaction will be cut such that essentially one molecule cannot see the other and therefore you are getting rid of this wrong periodicity which you might want so this is possible if you have zero D so no periodicity at all things are more complicated if you have say something like a grapheme layer or surface so these are systems which are periodic in two dimension but which are not periodic in the third dimension this case one is also using supercells which have a lot of vacuum in the direction where the system is not periodic but still if your surface is charged or if you have dipoles along the surface then one surface will see the other and in this case also in this case you will have to be very careful and there again look at the input description for the very um dip field you will have to put in some something into the vacuum to effectively decouple one surface one image from the next so in quantum espresso you can calculate um also non periodic system but always with these periodic codes but you have to be careful in many cases so I would like to use the last minutes which I have to say something about the other big issue which are pseudo potentials so why do we need pseudo potentials or what are pseudo potentials so you remember in my very first slides where I've shown the conchamp potential there was the so-called external potential and the external potentials I've said is the potential due to the nuclei so it is a very easy shape it is simply minus one over the distance from this nuclear nucleus times the nuclear charge because it's simply a positive charge point wise which is attracting all the electrons so that would be the the pure Coulomb potential now why are we not using the pure Coulomb potential well the the answer is look at this here if you're here on the left side of my graph you have the nucleus and this here is the radial part of some atomic wave function this might be uh I don't know um um four s or so I don't have to count the notes here um wave function of your system then you see that close to the nucleus this function in fact because say the four s needs to be orthogonal to the three s needs to be orthogonal to the two s which needs to be orthogonal to the one s okay so because of orthogonal granularity these radial functions they have very fast oscillations but these oscillations are in a region of of distance from the nucleus where anyway no chemistry is taking place we are no bonds with the neighbors are happening the bonds with the neighboring atoms will probably happen in this region where you see the your radial wave function is perfectly smooth so um this is a problem for us because as I have been explaining in length before when we use plane wave basis sets we define a minimal wavelength lambda min up to which we can describe features so if we want to describe features which are as fine as what you see here in this radial wave function you need a very small lambda min and at the same time therefore a very high kinetic energy cut off and this is something which you really do not want because their calculation would become extremely expensive and in most interesting system undo and you would have to pay this high price for something you're not interested in because the shape of this wave function close to its nucleus is for most applications entirely irrelevant so the idea of a pseudo potential is the following is we try to replace the Coulomb potential the one over our potential due to the nucleus by something else which has as a solution a radial function which looks here exactly like the right atomic all electron wave function for distances for further than some cut off distance and inside this cut off sphere around the nucleus where anyway no bonding is supposed to happening no chemistry is supposed to happening you would like to the function to be perfectly smooth and go smoothly to zero so it's clear that obviously this blue function here would need a much lower kinetic energy cut off a much higher lambda min would be enough to describe this function with respect to this for the red function here so a lot of kind of research has been happened how one can create effectively such functions and the most important lesson which people have learned is that this can only work if you have norm conservation norm conservation means that the integral inside this cut off sphere around your atom the integral of the norm of the all electron wave function must be the same as the integral of the blue pseudo wave function this must be the case otherwise your atom will have wrong scattering properties and things will not work so one thing which people have learned they must construct the blue line in such a way that there is norm conservation but apart from this this can perfectly well be done and I show you here how such a pseudo potential can look like here this is for modiculum pseudo potential what you see here is the dashed line this is the simple external Coulomb potential which we would have without pseudo potential so it's the function which goes to minus infinity minus one over r you see here the pseudo potential you see has compared to this easy form some very weird forms you see here far from the atom it is the one over r of the exact one but then as you come closer within this radius the shape is quite strange and you see also that it is angular momentum dependent which potential so the pseudo potential is a potential which electrons of various angular momentum are seeing and it has this shape far away from the atom it is the same as the Coulomb potential close to the atom it has an L dependent shape and how is this obtained well essentially one calculates TFT for an atom and one is inverting the Schroding equation to find out which potential do I need to put in order to have as a solution the blue line instead of the red line okay so this is how a pseudo potential looks like and in quantum espresso when you're running the the pseudo potentials you have to provide them as a user in the form of files these are files and the these files contain numbers on a radial grid and tell you precisely the shape of these functions here the the solid lines on a radial grid for every element a different one okay so here for example this is an example for some some system which I've been calculating it has five different elements in the input line one says for every element well what is the mass of the element and then one says which is the name of the file which you want to use for this and if you look at these file names you can already see that and since the pseudo potentials have to be calculated by inverting a Schroding equation of a DFT calculation on an atom you need DFT to calculate a pseudo potential so therefore the pseudo potentials depend on the functional and so in a normal PW calculation on a normal quantum espresso calculation you will not need to put into your input which functional you want to use because the code automatically looks ah I have this pseudo potential so I need to use the functional used for this one in this case was the PVE functional okay so now as a user you must be careful that if you have various elements in your system like here you must use only pseudo potentials which are all being created with the same functional otherwise the system on your composite system it would not know the code which functional to use here the density functional it will be using is obviously PVE so be very careful and know what you are doing if in the input file you say I want to use I don't know the HSE functional but I have pseudo potentials which come from a different function you can force the code to do this if you do not force it it will not like to do this and you will complain so you should know what to do and keep in mind that pseudo potentials which you are using are um functional dependent and um it's all okay so this is the basic idea of pseudo potentials and I would like to finish what I have to say by pointing to two different classes of pseudo potentials which are very important these days which are so-called ultras of pseudo potentials and poor pseudo potentials now this is something which goes beyond what I've just said what norm conservation is remember norm conservation means that in close to the atom the integral of the square of the all electron wave function must be the same as the square of the pseudo wave function now however in many elements this is a serious problem for example look here this is oxygen okay and oxygen here the all electron wave function looks like this and there is not much wiggles or something you can get rid of you will have your your pseudo wave function if you use um um a norm concerning pseudo potential will have to describe this very uh this peak here over the 2p wave function of oxygen and it will require a rather high cutoff which I would like to avoid same problem appears if you have for example 3d transition metal or 4f world earth elements in your system where you have no wiggles and nodes of your wave function which allow you an efficient um civilization like in the picture before but where still you have something which is very localized and you would like to get rid of this very small wavelength which you need here so this norm conservation constraint is a problem in many kinds of systems and the way to go beyond this has been invented by david van der built uh now many years ago and essentially in this van der built ultras of pseudo potential the idea is to release this need of norm conservation which I've mentioned before okay so a norm conserving um pseudo potential would require you to have an all and to have a pseudo wave function which more or less follows the all electro wave function with these very steep features here what van der built has allowed is that your pseudo wave function looks like the dashed line here so much smoother in this case this is again oxygen 2p much smoother than this one here but it's also clear that this here has a different norm inside the radius than this function here so he had to get rid of norm conservation to do this now how can he do it that without norm conservation he still gets excellent results for pseudo potentials well the price which one has to pay here is that the one gets a more complicated expression for the charge density so so far what we've always said is that the charge density is the sum over the square moduli of your concham orbitals however if you have an ultrasoft that the same story is true for poor pseudo potentials which are for for many users points of view exactly the same thing so in ultrasoft of poor pseudo potentials the density is defined as it was before but then there is also an additional term here which is called the augmentation charge density which is always localized close to the atoms to those atoms which have an ultrasoft pseudo potentials and which needs a very high cut off because this augmentation charge here will have to account for the difference between the square modulus of the dashed line and of the real line so one obtains i will not give you here the expression because it contains a lot of projectors it's not not something easy to or pleasant to look at the expression for the augmentation charge just keep in mind that whenever you have a pseudo potential in your system which is ultrasoft or norm conserving the code will add something to your charge density and as the code adds something which will be very localized to your charge density this means that the four times cut off which you use for for norm conserving pseudo potential will not be enough you will need a much higher cut off than this so if i go back to this input which i've shown you before here in this system okay there are five elements and if you look at the final names of these pseudo potentials where we have already discussed it says your pve but the final name here also in all cases has this us whenever you see us in the final name and you can also look inside the file where it's written explicitly these are us pseudo potential so be aware that you need to have higher cut off than four times the wave function cut off and and this is where it comes from it comes from augmentation charges which have to account for the difference here close to every atom but this thing works very well so here for example this is from this old Vanderbilt paper he has shown here as a function of the cut off energy how the energy converges and you see if you have a norm conserving but then the conversion is very very slow and you need to have very high cut offs with these um ultras of pseudo potentials already here in this case a 30 40 readbook you have perfectly converged total energies for the wave function so these pseudo potentials either poor or um ultras of pseudo potentials allow you to get away with a rather low cut off for the wave functions but be aware the density will still need the high cut off okay this I've written here again explicitly you need more than four times the cutoff for the orbitals and here really I have so many years of experience with new students and people doing quantum expression I can tell you the most uh the beginner's mistake I've seen most in all those years is that people do not realize that some pseudo potential is ultra soft or poor and do not specify the second cut off so in a typical input file which you see see here on the right e-cut wfc 40 this is for the cone tram orbitals the cut off if you have also um some of these pseudo potentials shown to the left you have to define another cut off for the density it is more in these times more than four times 40 a typical thing is either eight or ten is a typical factor so if you want a rule of thumb but in truth is you must check convert is not with one cut off but with two cut offs okay so with these words about the most most common beginner's mistake um all that remains to me is to wish you happy computing in these uh in the tutorials which will start now and uh if some of your questions I'm obviously very happy to ask a question thank you Rolf I don't know how the local organizers thought we should proceed I would gladly there are four questions on the chat I don't know Ralf if you can read through them wait I cannot because I'm having full screen of my presentation let me see besides I just by chance now see that it's 10 000 so this is a perfectly timed talk but I cannot see why cannot see the question yeah the first one why don't you read it to me because I cannot see it you know yeah so one is uh what are the pros and cons to the pro and constrain of that 0.5 shifting I believe this is about the uh the the k point the point in the preview and so sorry there is another one saying the same question would do I need to shift the k mesh okay so yeah let me say something more about the k point can you still see my screen yes we can okay good so um this is very much related to symmetries of k points or obviously the code tries to calculate as little as somehow possible and it is employing the symmetries of your system to reduce the number of k points okay so if you have like you have here for example um a 4 by 4 by by 4 grid okay then some of these k points are equivalent okay due to your symmetry so for example you might imagine that you can here have a symmetry for the plus minus x plus minus y and concentrate only on the irreducible wedge of this of this rectangle here okay then the code will automatically calculate only one of the various equivalent k points and give that k point a higher weight okay now if you have a shift of your regular mesh then typically the points lie on less symmetric points in the brilliant zone meaning that the symmetries allow you a higher multiplicity of your points so it is all due to in fact due to symmetry so the big advantages is you have less calculations you have more sample points because the k points lie on less symmetric points you can see this I mean as I said before the key thing of a not shifted mesh is mesh is that the k equals zero is always in the non-shifted mesh and the k equals zero whatever is the symmetry you're doing lands on itself so that point counts only for itself if you shift it a little bit to a point which is not symmetric lying out of the center then every symmetry will bring this point on a different point and therefore you you obtain effectively more k points with the same calculation so the advantage of shifting is that you have a faster convergence of your k point sampling if you're pretty shifting the disadvantage and there are disadvantages is that sometimes you want to compare a calculation with k points with a different calculation with less k points but a larger unit cell okay so you can for example take a supercell where you double the dimension of your your primitive cell in all directions and then in order to have an equivalent calculation you should have exactly half the number of k points and this equivalence of of a supercell with a shifted mesh goes away or because for this equivalence you always need again the k equals zero point and the regular mesh but these are really very special cases where you need for some reasons to compare either a supercell with a k point calculation cell or it can happen that if you want to calculate some electron phonon properties you need a particular regular mesh where it cannot be shifted so in special applications it can happen that shifting is not good if your goal is really only in a periodic system to converge as fast as possible with as few k points as possible you should always shift other questions yeah there are there are some others so how far can we set the distance between supercell in case of not periodic system to neglect the interactions so there are no rules of thumb some people say ah seven angstrom is always enough some other people will say in seven angstrom it's clearly too close and it must always be 11 or so this is something where you typically have to do a convergence test so you calculate it with various with the say eight nine ten angstrom difference between your copies and then you see it depends very much on the system as i've said if they are if they are dipoles if they are the system is somehow charged then you will need much more vacuum than in cases where everything is huge very good i understood that it's often give gives much faster convergesi as there will be more equivalent k points is this right maybe this is a question exactly this is what i just said it converges faster yeah another one is cutoff always 10 times if we increase 100 times then is it effective it's certainly not effective because if you have 100 times so i mean you probably think about the ratio between the cutoff for density and wave function i imagine and so at a certain point using a higher cutoff for the density will make a calculation heavier but you will be at convergence so a typical thing nearly always in you get away with the effect of eight between the density and the wave function and cutoffs in fact the people in losan with nicole amatsari they've made a very thorough testing of cutoffs for all kind of pseudo potentials and with the pseudo potentials they recommend in their database these and they get for all elements except iron they get optimal results with the effect of eight between the two cutoffs only iron they needed 10 but that is specific to those three the potentials they recommend okay there is the the latest question from the zoom and then with which there are a few questions from the streaming as well so the latest from the zoom is beside of the auger cutoff for the density is there any disadvantage to use the ultra soft pseudos um that this is one it depends one for me personally the biggest disadvantage of ultra soft pseudos potential is that some advanced features might not be implemented for example i recently was interested in some electron phonon interaction some systems and that was not yet implemented for poor or um ultra soft but generally today nearly always people use poor or ultra soft pseudos potential simply because one can get away with much less computational effort okay there are and let me just say so the the issue arises mainly if one uses hybrid functions but one needs to calculate exact exchange that is still an issue where i think we should all work more on implementing that with ultra soft pseudos potentials in a in a better and even faster way than it is now okay there are a few questions from the streaming so even with periodicity what is the reason of band banding as we go to higher dimension supercells what does this mean band banding i don't understand this question so typically when you have an interface between two different kind of materials you have a band banding yes but i don't see how this is linked to periodicity in higher dimensions okay let's go let's go to the other one sorry how how to create an ion in quantum espresso so that the ion absorption on the surface can be studied ah so no what you can do is you can create an ionic system by telling in the input file that you won't have a charge system so you can say i want to have one more or one or two three electrons more or less than its neutral so your system will therefore be charged then it is quantum mechanics which decides where the system prefers to take away the electron if you have for example an atom on top of a surface and you take away an electron that this electron will prefer going away from the atom or from the surface this is quantum mechanics which decides where it goes this is not something which you as a user can and should change okay so you can in the input file simply say i want more or less electrons in my system but where in space these electrons decide to localize this is physics which decides which pseudo potential is recommended for computational expensive form calculation maybe this is something that is going to be answered during the school i think yeah i think it will be seen during the school let me just say for pseudo potentials i really like very much this pseudo potential table which has been tested i just said it before in los an it's the sssp pseudo potentials so you should type in google sssp pseudo potentials you find a table a periodic table it says only for the function it's pve and pve sol but it gives you recommended cutoffs everything and they are very thoroughly tested and i mean there are many other libraries for pseudo potentials recently i've made good experience in those okay the last from the from the online is there a way to predict how many k points will now put file process given a certain mesh for example how many k points will a six times six times one mesh have please assume more symmetry this depends on the symmetry of your system so in principle if a six times six times six is the number of k points is that you multiply that but then please actually the code sorry sorry sorry i have the question and with please assume no symmetry if you assume no symmetry then if you have a three by three by three grid you will have 27 k points okay there are a few big questions from the from the zoom the last two big i don't know if you can read them and yourself because it's quite long or otherwise i go through it so one is as one can understand a large number of failure can come from incorrect use of pseudo potential grid choices resolution etc in this regard it will be great if everyone who use quantum espresso took is as a rule at the end of their scientific work say at the stage of making an article available on the internet to place their input script to an open library what do you see maybe this is in progress so this is a very big topic not only for pseudo potential this goes into this big discussions which are taking place these days about open science okay so in principle the good thing the good practice should be for everyone and especially for those who enter the field now um when you publish something it should be done in such a way that anyone can repeat your calculations okay so that is in principle the goal which one should have science should be reproducible and you should have either on some jeep tab or some other repository some way where people find all the data they need not only pseudo potential but as you say all the input files and so on to reproduce the calculations so this is where the world is going i think and that should be going and editors should exist more insist more on this is being done having said this many people do not want to do it because if you give away your input files everyone can do your calculations and people for the wrong reasons i think they want to keep thing only i know how to calculate a graphene graphene sheet and i do not want that others also can do it easily and so some people especially yeah okay so some people are picky about giving away input files which i think is the wrong attitude okay so i suggest that there is only one last question from the streaming and then at the zoom and maybe we'll apply here in chat i mean we are always able to reply here and then Ralph will be available also in some breakout room i believe at some point during the school so the last one i take from the streaming is uh it's possible to change the electronic configuration of the potential of the atoms for droplet system well so so first i should say the idea of pseudo potentials is that they should be transferable meaning that if you have a pseudo potential say for carbon then you should be able to use this very same pseudo potential if you are in a graphene if you're in diamond if you're at high pressure if you have an atom in whatever chemical environment this carbon atom is you should be able to use the same pseudo potentials they are made for this okay so this is point number one transferability however if you think you are in such a special case that you need because i don't know the electronic environment is so strange you need to construct new pseudo potential starting from different electronic aggregate you are free to do so and as i said in the beginning there is the atomic code distributed with quantum espresso in which you define the electronic configuration of the atoms upon which you construct your pseudo potential you can do it but especially for beginners i do not at all recommend starting to create your own pseudo potentials this is a source of the most serious kind of errors which can appear they are very good pseudo potentials ready for downloading everywhere okay i will uh i think we can close it here for now uh take a break of 10 minutes before we 15 minutes before we have the end session so thank you very much Ralph thank you very much it was a great talk and let me just say if there are more questions which and you want answer you can write them on slack so and you we can read them but because i see there are other questions going in the in the chat if you write them on slack we we can answer uh we can answer there okay okay we are convening 15 minutes for the lab session see you soon okay shall we start is there Pietro connected okay let me share the screen can we start yes yes okay cool just let me share the screen please before before we start Petros if you give me one minute uh yes yes just to share a few info with the with the participants here on zoom okay okay so um so i mean have we been repeating many times in this i mean in this introduction lecture we are doing also we are experimenting let's say this formula ourselves as well here at the ICCP so we have seen that there are there are there are a lot of people following in streaming and since they cannot interact we will favor their question during the lecture okay so but you have an advantage here and the advantage is that you have the slack channels so we encourage everybody that is attending and is selected to participate in the zoom meeting to please use the slack channel for any question i mean starting from now during the lab where we expect to have the majority of the problems but also during the lectures if you use slack we'll have much more we have much more people there that are following the the channels and that can reply to your questions okay so if uh i mean we we we want to try from now on that the people that are attending here in zoom write their question on the slack channel so let's see let's see how it works and and then we try to figure okay Petro your stage is your okay okay can you can use okay so greetings to greetings to everybody and sorry okay greetings to everybody and welcome to this first and zone session of the sorry there is this annoying green line okay never mind okay greetings to everybody and uh welcome to this end zone session this first on end zone session it will be the first one so it will be mostly a warm-up for the next days so we are we are trying to to see how things works i am pietro delugas from sissa and i will be presenting this end zone and other persons that will be tutoring you will be anton cocal shall made one matitz pobernitz umesh mondal matayush and yanin kui there will be the other tutors that will be available in the breakout rooms whenever you have issues and problems with any one of the exercises uh okay the topic of the exercises of today are the first example will be the compilation of the compilation of quantum express as the first example to show you how to compile the program and then we will show you how to run some basic calculation using pw.x that is the program that ralf has just presented during the lecture of this morning and then we will show how to use post processing the post processing tools for plotting the molecular orbital density charge densities with pp.x how to compute density of states and and plot it with those dot x and then how to compute the band band structure and plot it with uh and plot it and uh okay this is about the documentation of quantum espresso and how you can where you can download it ralf has already uh said many of these things during the lecture of before so i will skip it about the the end zone will be organized for those that are using the virtual machine there will be uh there will be organized oh sorry this stuff is there will be organized in um just for those using the virtual machine that um the end zone will be organized in uh in the east so you will find the material of each of the end zone in uh in these directories the one day two and so on so forth for those and instead i will be will be a we are not using the virtual machine the exercises can be all found in this uh git repository that is called that is uh it is on git lab this is the address of the of the kit lab repository it's a little bit long so i don't know whether you can read it or not and but it is a variable also on the ictp web page so you can uh uh take it from there and uh okay so to do the exercises of the of day one we just have for those using the virtual machine we have to go to the directory uh quid 2021 day one or just from uh from from the virtual machine you just uh from the virtual machine you from the virtual machine you just go to a little bit of a mess with zoom and uh from the virtual machine you just go to uh you go to the desktop of go to the desktop of the virtual machine you just go to uh select day one and here on day one you open a terminal in this way so you will be in day one directory and uh so we start with the first exercise that is example zero one quick compilation this exercise is pretty simple you have just two uh here you will find in the directory the archive with the last latest release of quantum express of this file here and you just have to extract it with the tag command after you have extracted the file you just go into the directory and uh okay in the directory we're also for a file I find a file called install dot md dot md that has all the instructions for compiling the code and configuring and compiling the code in most of the machines and for using most of the libraries that you can if you want to link that but today we'll be we'll keep things simple and we'll use just the uh the basic configuration and using the virtual machine we have we have all everything that we need for compiling quantum express already installed in the virtual machine so you we just need to to run the command configure and the the configure script will find all the all the needed libraries and all the inner configurations and we'll write them in this file that is called make dot ink and uh you can check the the file as first of all found the npi library and then this found the fftw library and so the the the program will compile with npi with the npi parallelism enabled and link in the fftw3 library other things that you may check is the fact that the program has found the library the the blast lapak library is installed inside the system otherwise the the program will try to compile the internal ones that is usually not something that sorry i will slow down yes and so we'll find the libraries the lapak and the blast libraries that can be found in um in the in the virtual machine otherwise the program will try to compile lapak and black and blast libraries and the compilation will take much more time so we have now typed configure i will retype it for well who has not seen it and running configure the program finds all the instruction all the all the settings at this point we just compile pw and so the command for compiling pw is just make pw you don't need to configure and uh you will you don't need to configure npi because in this machine npi is already being configured so you don't need to you don't need to uh configure anything the program will find npi already there uh usually if npi is installed in one of the standard parts where the autoconf script looks for it you will find the the program the the configure script will be able to find npi and use it automatically so you will not you don't have to enable that there may be some cases when instead you want to you want to avoid to compile the program with the npi parallelism enabled and so you have to uh you have to instruct the program not to use npi and uh yes okay we i think that we are using a system where npi is already installed but if you don't obviously installing npi is a little bit more complicated a little bit longer to explain and during the exercise and uh okay there's no need to uh to do the the end zone right now i mean i'm just showing you how to do the exercise and then then you will have time afterwards to do the exercise and for any questions please ask to the tutors that will be waiting for you in the breakout room so more detailed questions about anything about this compilation and about the other exercises will be explained afterwards by by the tutors okay so it's taking a little bit longer than usually because there is zoom working on the machine but it's going to end now so it's taking a little bit more time than usually because there is zoom that is slowing down all the stuff so the program has finished it has compiled everything eventually and you will find all the executables that have been compiled in the bin directory here as you can see these are links to the executables that are still in the source directory and it has compiled not only pw.tix but it also compiled other programs that are used that are tools that are used by users of quantum of quantum espresso and this is the first exercise okay now we move to the actual exercise to the actual exercises of computations and there will be two exercises there will be two other exercises that will be of actual compilation with quantum espresso let's see the first one okay the first one is example one example one dot benzene okay i already ran it yesterday so it's the directory is a little bit dirty but so what we need to do here is to we have already we have the okay we will find the benzene directory already the input files for running the exercise but whenever you want to write an input file of quantum espresso you may you have to write a file like this in the virtual machine there are two tools that are very important that are very helpful for writing an input file one is the mx mode one is the one is the quie max modes so you are you open the file with mx and inside emacs you have activated the the quie emacs modes that allows you that have the automatic highlighting for the automatic highlighting for the keywords of quantum espresso and so you can see that everything is already set up and in case you want to add you want you want to add any variable you have also the possibility to add it directly for example using the command using the using the shortcuts of the quie max modes like for example for any variable you can use like you can do like this and then there is the auto completion so you can use the tab to auto complete the command and the the emacs will already tell you what command what is the right the right name of the variable and and you will ask you for the value of our tier in this case we don't want to you to set our tier actually so we just we avoid we avoid to avoid to write it but okay it doesn't i will put a variable for the value for this value okay we don't want actually this value because we have already set up an input and the fault value the fault value for the out here so we don't want to use it so we go out another tool for editing the files the input files of quantum espresso is the is the pw gui utility this is this instead is a graphical user interface and allows you to open directly files the input files like this for example you want to orbit the input file of quantum of pw and you open the file and the program reads the file reads the the settings in the file and you can you can select directly the values with the instructions and it's a little bit maybe it's easier to use it than just then the then the editing directly the text so you have a you have a tab for each of them which of the possible name lists of the input of quantum espresso of pw so for example you have control system and electron science and and all the others and okay you can play around with them afterwards okay the first exercise so it consists on first okay you will find here the excess consists first in running the the self consists of calculation for the benzene so you just run my piece okay when the calculation is finished you can look at the the output of the program it is here that the program check that the complete that the run is terminated at this point okay at this point you can run the the post processing utility pp.x in order to okay at this point we run that in the post processing utility i will open it with pw gui we'll open the input file with pw gui and uh i'll show you so you see you see you have the in the input file you have the name of the prefix this is the same uh name of the prefix that is benzene like it was for the self consists of calculation then uh you have to you have to specify the name of the output file that is in this case is psi square benzene and then you have to choose the the functionalities the the the post processing utility that you want to run in this case we want to run psi square that is the utility that computes the the charge density related to the to a single molecular condition orbital and so it computes in and we are using the we are using the and so you just select this one here and uh if we want if we look directly at the file we said we have uh the we have the prefix specified as benzene you have to specify the name of the the plot of the file here you have to choose the plot moon this is the one that chooses you to do that tells the program to compute psi square then uh obviously in this case we have we are doing a calculation only at gamma so we have only one k point we want to use we want to use all the orbitals so we just go from the first to the 16th orbital and we select l sin equal to l sin equal to equal to means that as we are using as we are running a molecule we are running a molecule and we are the our our concham orbitals are real functions so the only difference in the phase is due to the of the sine so the program would not only compute the charge density related to the orbital but we also give a lot the local value the value of the sine of the function in that point and the point point and there are two name lists one is input pp where we tell the program what compute and then we have another name list that is called plot instead tells the program out to print out the results here we have uh we specify the type of output that we want to you that we want to to have an output so we have that dot xf means that the program will will print out an output for xkris then a flag equal equal three we means that we provide us with a three three three dimensional three dimensional data file then we have that we are we are going to to we are going to plot only one file that we here we specify the output format that is a five that is um and related to xkris then and okay in this case we have only one file so we are not combining densities from many files but in any case you can when you combine many files then these files may be summed and each file as an individual weight in the sum in this case having only one file obviously the sum is the weight of the only one file is one point is one dot zero so now we run the and we run tp dot x first it computes the density then it prints out in file uh so okay sorry uh so the command the okay the instructions for running the exercise are uh here i mean if you miss any passage uh just uh just open the file don't read me if you open it with um if you open it with if you open it with uh firefox it's easier because it's it's it's formatted with with a markdown syntax and so you can find here all the commands so the first command is running pw the second command is running pp dot x this is the one that i just typed and it's pp dot x and then in input pp benzene sorry the the input of the of the benzene calculation and uh and just that and then uh here are the other commands and okay at this point we have run uh we have we have run pp dot x and we have produced all the we have produced the okay we have produced the files with the uh charge density of each of the orbitals and we have that uh we have produced the files in in two formats one is the format which is internal to this internal to the post processing utility and there's it has its own format and and then we have also the format which is instead the one that we use to the one that will be used to plot the the density files with x-cris then so x-cris then is already installed in the digital machine so we just have to to run and to uh to remember the syntax now as usual we just run x-cris then type is we run the command x-cris then in this way so we say minus minus xf is an option to specify the program that we are going to read um we're going to read an xs file and so uh with the xs format okay let me show you just briefly the xsf format the terminal so it's um so the file the file the file contains the information about the primitive cell of the structure then the coordinates of the atoms and then there are these data grids data grids are the data that we want that can be plotted in these cases the charge the charge density of one of one orbital and there are all the informations to uh for plot for reading and plotting it so we just use the x-cris then you squeeze them in this way minus minus xsf the program opens the structure and first it just and first it just it just plots um first it just it just plots the the atoms the structure of the atoms then at this point we want to to see that uh we want to plot the data grid with the charge density we go in tools that is here okay we just we have just here the values uh menus we select the tools menus menu we select data grid and here in data grid we have uh we can select the different data grids we are okay we have we have one only data grid so we just select this one by default and here there is a multiply factor as the charge density is divided by the volume of the cell so as the total charge is divided by the volume of the cell it's printed in uh it's printed in electrons per cell and so it's it's very small because your cell is large as your system is your i mean in this case we were computing an isolated molecule so we're using a very large uh a relatively large supercell where the the graphene you can see here you can see it here we are using a supercell so we have the benzene and we see molecule that is at the center of a large supercell and it's allegedly isolated by the periodic images that you can that are you can actually print if you want if you want you can show like this you see now they are isolated one from the other so but they are one far far away from the other but in doing this we have obviously we have obviously we are obviously using a very large supercell so the the value of the density is very small so when we use tools and then data grid to import why not okay just when it doesn't work when we import the data grid here we need to to have to avoid to have very small values we can multiply this value for some multiplier in this case i use 100 so and just import it like this and uh and here the the program shows you a menu where it tells you that uh here you have in this you see that you can you can see that so okay here in the in the in this okay here as you can see here you have um you know you can see the now you can see in the more in the in the panel you have in the panel it shows you which is the minimum value of the of the charge density and the minus maximum values of the charge density so you need to select the value between these two in order to show an iso in iso surface just put here 0.3 just for trying and we select here render iso value in order to have that the program also brings the the the sign of the of the charge density we just submit and as you can see you have it plots you the charge density one other thing that you can do is and then you can try different values to see which is the one that it's better for you so and you see them and then you can custom uh after down this you can customize the image you can for example select a different color for the background like for example white in this case we don't need the the supercell so here in display we can also select two we cannot we can avoid to use the crystal to show the crystal cell so if you select here there you can delete the crystal cell uh from there once the orientation of the crystal is when you have chosen a good orientation of the crystal one other thing that you can do is select a desolation factor uh that is better than 30 in order to have a better quality of the image for example we can use something like 70 and we can other thing that you can do is just to select anti-aliasing to improve the quality of the image once we have done these things one thing as we have 16 orbitals here and we want to do the same uh the same um customization of the image for all the orbitals we can we can save the state the status of the molecule we can save it in this file and a file that is called that we can call as as we like in this case in this case i will call it a more state is crystal and then i will save it okay the file exists already exists but i just rewrite it at this point we can uh close this file for example and uh okay for example if we want to to plot another orbital for example 12 using the same settings as before then use the option minus minus script and use the script that we will save the that we had that we have just saved like this and the program just reads the instructions uses the same settings that you were using before and prints the files the file like this and that's it okay during the end zone you will also find here a script called plot size square dot s h that allows you to plot the plot and save and save all the images in the apng format if you want to learn more about how uh how to use excris then it's a good thing to see how the example in this image and uh just that now let's go to the second exercise yeah which is graphene before running graphene exercise uh i changed the exercise a little i changed some things in the exercise yesterday night so please to download last settings just do git pull like this okay my case it tells obviously it says already update up to date because i saved already saved the exercises there but just do git pull to update everything in order to have the exercises as i'm going to describe you okay also in this case we have that we have uh values input files the first input file is for the scf calculation so you can see here the exercise you can see here the the input file as i was saying before you need to specify you need to specify the prefix you need to specify which type of calculation are you doing and in principle you have also to specify um an out dear we need also to specify an out dear and pseudo dear actually in this case we don't need to specify them just because they are they have been defined as enviable as environment variables virtual machine so you have you're specified in the in the virtual machine two environment variables one is a espresso temp dear and espresso pseudo whenever we don't specify in input here in the input the values of out dear and pseudo dear the program we look for these two environment environment variables and we'll set the out dear variable to espresso temp dear and the value of pseudo dear to the value of espresso pseudo so in in calculations that are done that are done in places where you are not set up these two variables it's important that you specify here the name of the out dear and of the pseudo dear so again looking at the in system here we have also the description of the system the system is described by a ibra index that tells you which crystal structure you are using in this case ibra equal four means that we are using for example the hexagonal structure and then these are the the dimension of the of the structure the number of the atoms the number of types of atoms used in the cell and here we are specifying the cutoff energy for the basis set and the cutoff energy for the density basis set other things that i can show you is here we are here the coordinates of the atoms that we are using and the mesh of the key points that we are using as you can see here okay the hexagonal the the zagonal lattice constants at two two main dimensions the first dimension is the dimension of the of the lattice parameter on the on the plane that is the length of if you wish of the hexagon and then this one is the ratio between the the the height of the cell and the height of the cell and the in plane lattice parameter as you can see here it's put to three it's put to three in order to assure to warrant that we we have enough distance between the the graphene sheets and then they don't interact in order to simulate in this way a two-dimensional system using using a boundary condition this point we can run in pw dot x yes calculation is very fast just runs and after we have okay there is a raised end please can you i don't know if it's possible i think it's not good morning sir yes i just uh one question we do the exercise on the same time same time and then you know we do it sir no no no if you can do also afterwards in the session and just just there's no problem to no no no there is no need to follow me right now okay once we have run the self-consistent calculation we need to we we will run a non-self-consistent calculation and the input for the non-self-consistent calculation is practically the same as the one for the self-consistent one the only things that will be changing will be that here we'll be using nscf instead of scf that means non-self-consistent calculation and the other thing that is changing is that as we want to use uh this calculate the again values computed in this calculation to compute the density of states and the density of states we will use a denser uh measure of key points so it will be 12 12 1 instead of 9 and the other thing that we are going to change is the way in which we you compute we compute the occupations if we look at the previous file you will look you will look at the previous file you will see that you will see that occupation was not specified so that means that occupation we use the fixed occupations and we use fixed occupations while instead in this case we are using we are using tetrahedral occupation while we are using tetrahedral occupation because for computing for computing the density of states we need to we need a more more precise method to compute the occupations and and you and then you can see it's it will be different and so we now you know the question is also very fast and once we have computed the the non-self-consistent calculation you can use the DOS program compute the density of states of the of the system the input of the DOS program is this one it's very simple you just you just need to specify the prefix that is that is to be always the same as before so that must be prefix equal graphina one times one pbe and the name of the DOS file that you want to input that you want to print out in output and you will read all the settings of the systems from the previous runs of from the previous pw runs so the calculation is just dot those dot x minus e those dot graphine 15 and the program produces a file that is called the graphine dot DOS graphine the DOS you will find two things first thing that you will have to notice that you have the value of the energy and then you have the density of states then you have the density of states and the integrated density of states this is the value of the density of states and sorry this is the the value of the integral density of states exists the the the the just the integral density of states and okay for plotting it we have prepared an input we have prepared a script The first thing that if you open the input you will find that here you have 0.0 so you have to put here instead of 0.0 you have to put here the value of the energy of the Fermi energy that you have found in the DOS file. Yes, the structure was already optimized, I think that we were using the experimental structure, I mean this is not an example about how to optimize the structure, so we just took a structure that was already optimal and we we just use it as an example, I mean, no we I don't know whether the the value of the lattice constant is optimal, I guess it is, but I don't know if you are curious about that, okay, let me see. Okay, first let's plot the DOS, now if you want to plot, okay, if you can just look at the pw.graphing.scf.out. And if you're curious about if the structure was already optimized or not, one thing that you can do is take the input file of pw.txt, the scf file. And here this flag tprn4 sent it to true what the program does in this way is just to and then we just rerun the program, just rerun the program and at the end of the program you will have that process printed out but actually the point is that in this case the system obviously is symmetric so the forces are vanishing by default so you need to optimize the lattice constant in this case and obviously I don't know whether it was optimized or not and so the other thing that you can do is try to optimize to check a different lattice constant and see what happens but this is an example that we'll do tomorrow with other systems but then you can obviously adapt them to graphene and okay now just we want just to plot the DOS we prepared the script and now we plot the script like this and the program shows you the DOS so okay the part that is filled is the part up to the Fermi energy, the part that remains unfilled is instead for the finance band that are not filled I've set out, okay let me show you again again when the plotting script makes two things, first thing to do the plotting script does two things, the first thing that the plot script does is to shift the energy values in order that they are, that the zero is at Fermi energy and just that so in this case when you see the plot you see that you see that the Fermi energy is set at zero equally while instead okay this obviously in the, if you look at the DOS file if you look at the DOS file, sorry if you look at the DOS file you find that the value of the Fermi energy that you had at the end of the DOS file was 0.92 so we are just shifting the energy in order for plotting the density of states with the Fermi energy at zero okay the second part of the exercise is plotting the bands of graphene so now we have to run another W calculation in this case we select as calculation bands the input is always the same because the program must read the density of the charge density from the same file as before in this case we don't specify occupations because we're computing the bands but we specify the number of bands because by default the program uses as occupation fixed but when you use fixed as occupation only the occupied bands are computed and so if you want to compute also the valence the conduction bands of graphene we need to specify more bands than the four bands that are occupied in graphene so we now run the calculation also this calculation is very fast and we run another post-processing utility that is called bands.x and use the input that is already being prepared also this input is very very simple just contains again the prefix that is important because you need to in the prefix because it's in this text the program where to read all the data from PW then you have to specify the number of the file that you want to write and here we also specify LCM equal to that means that the program that bands.x will make the symmetry analysis of the bands just run bands.x and again you see we have specified LCM equal to and and so the program makes the symmetry analysis at each point so it prints you the the symmetry analysis of all the eigenvalues of the bands that you have computed and if you are looking for something that is symmetry related it's the this is the the file that you have to look at this point we have we want to plot the bands to plot the bands we have created another another new plot script that is called spaghetti.gp again here in the file that you have in your directory this value is still set to zero and you have to set it to the same value of the Fermi energy that you will find in the DOS file then you have to uncomment this line that here is already uncommented that will set the axis of them the axis that will plot the zero axis in order to show you where the where the Fermi energy is and then the script runs the script just reads the file called graphene.bands.data.genu and just takes the values shifts them of the Fermi energy in order that the Fermi energy is plotted at zero and plots everything like this and we have also set here the ticks to the high symmetry to the high symmetry points in the Brigham zone you need just to run it and here you have your bands and you can see here there is the Dirac point and this is the exercise that's it okay there is one more thing that I wanted to say and for example in this case the path of the okay we'll show you the slide okay there are two tools for for creating the Brigham zone that we wanted to talk to you I mean in our cases in our case in this case the plot of the Brigham the key points for the path for the band plot were already set in the input so you don't have to create it but there are two tools for creating it one is the key path selection tool of and we squeeze them and the other one is one that you can find online in materialscloud.org tools seek path and also allows you to create a path that's okay first thing that is this tool suggests you a path that is the path that is usually used in this standard and then gives you the coordinate and helps you to write the input file and I think that's it sorry if it was a little bit confusing the presentation it's just that I had a problem with the it's sharing the screen and it was I almost couldn't see anything of what I was presenting so I'm sorry if there are any questions otherwise yeah there are several questions from the streaming if you can look them in the chat I posted it for you okay okay yes 0.920 okay the first question is yes you need to do the mscf before doing the dose.x or project.x okay it's not mandatory you can also use the eigenvalues that you have computed with the self-consisted calculation but usually when you do the self-consisted calculation you don't you use a key point mesh that is good for for doing an accurate self-consisted calculation but then when you want to plot the dose for the quality of the dose you may need a finer mesh the other thing is that for example in this case for doing the density of states of the project density of states we want to use the tetrahedral method why we want to use the tetrahedral method because while the CF calculation just tries to compute accurately and there is integrals in the BWN zone when you are plotting a density of states of density of states you are actually plotting all your functions are much more much sharper so they will require a much more denser number of key points and also techniques like the smearing technique or just the fin sum with the monk's pack are not accurate enough because they just try to to take away the integration of the periodic part of for example in this case of your eigenvalues in the other case instead you have something that is much more localized in values so for example when you do a density of states you have the calculation of your band times step function that is very very sharp and cannot be done with cannot be done accurately with the other techniques so yes in principle you can use directly the SCF but the result that you get is