 or online lecture course on statistical mechanics, chemistry, and material science. Today, we shall start a new topic, a very important topic, which is the computer simulation methods in statistical mechanics. As we have seen, we have gone through many aspects of statistical mechanics from the beginning of the postulates and then on to different ensembles and applications. And one thing that you must have realized that it's a lot of really, lot of analytical work, lot of very difficult mathematical methods that are being implemented. And these mathematical methods and the requirement of mathematics becomes more and more demanding as you go to real systems. Actually, at one point, it becomes quite difficult. And so one then starts wondering that can one really push this ambitious project of statistical mechanics of explaining the observed variables of the crystal, phase transitions, biological systems from past principles? We mean that from an intermolecular potential, particularly when the intermolecular potential. This was the condition state of the art in 1960s and 70s when people are still pursuing analytical work. By the end of 1970s, it became quite clear that it might not be feasible to solve these analytical theories. For example, percussive equation of the partition functions to get the required observed properties. That was very, very beginning to dawn on people. Fortunately at the very time, computers were developed to a great extent. And some very smart people realized that computer celebration can come to rescue in a big way. And that was developed by very smart people. And now computer simulation essentially 90% of the applications of statistical mechanics that we do through computer simulation. However, the methods of computer simulations are firmly based on the developments or advances of statistical mechanics even now. So this kind of handover, it seems like that statistical mechanics developed all the principles and the methods and applied to real systems. Because in analytical methods, solving of integral equation theories or as you see in case of may have cluster expansion, we could get the phase transition, we could get some above the cluster size distribution. But even then the calculation of virial coefficients is extremely difficult for any kind of realistic problems. So we are going to kind of just state what I have been saying that simple model based calculations can be done. And then certain simple theories like cell theories, lattice models like Ising models, Landau theory, they are wonderful theories. They have done a wonderful job in explaining and providing us insight of what is going on. However, they cannot be successfully applied to a quantitative prediction for the real systems. Like real systems like water, liquid water, ethanol, proteins and then DNA. So this kind of what you want to understand the lipid by the air. So all these systems, let us stick to basically with water, which is a very simple thing. So even in water, analytical theories did not quite success. Despite tremendous effort by very, very smart people, well we can do some amount of analytical things to try to understand the liquid to stream transition. But even when it comes to freezing, it is still a very, very, it has not been successful. So we faced with these things as I told you in 70s, it was realized and people realize that however is bottleneck at the big, big wall presented by the analytical theories, which cannot be complex intermolecular potential. What are intermolecular potential is complex in the sense is more than Lena Jones. It has oxygen atom through hydrogen and they have charges at the moment. But then at that time, computer solution came to big, big risk. And the intermolecular potentials which are discussed like Lena Jones, especially the way and this is just radial potential between two atoms. And water is a far cry from these things. So real molecular potential for real molecular liquid like water, ethanol, dynamical, sulfoxide, many, many other things are far more complex. So analytical theories didn't work and that is what computer simulation came to rest when, as I said, 90% of the statmate base worked now done with using computer simulations. So in fact, it required no less ingenuity, full less creativity to develop the computer solution. Yes, basic principles and basic methodologies and the things that we need to calculate like radial distribution function, specifically on the fluctuation. And many other quantities were in when it was the formalism and the way to think and go about and the equations were given by statistical mechanics, but they are implemented now through computer simulation. So that's what I said, as if the methods of statistical mechanics was developed and handed over to the next generation to take it ahead by using computer simulations. So computer simulation, as I have saying, is very, very smart work and it started essentially with a very famous paper. I'll cite the paper in the next slide by Metro Police, Rosenboot, Taylor and Taylor and they did what is called Monte Carlo simulation. It was an equilibrium static simulation and a few years later in 1950s, both in 50s, older and when right, did this simulation in a time plane by molecular dynamic simulation. And both treated this heart-sphere kind of interaction which was simple to do and got results which was tested against the theoretical results which fortunately were known quite a bit. From analytical theories, because heart-sphere is something analytical theories made some advances. So we then did computer simulations and tested the computer simulation against the analytical theories. It started both the purpose. We could test the analytical theories, which as I said cannot be done exactly, but fairly accurate for heart-sphere. And we can check computer simulations and it is extremely important. That means this verifying computer simulation by statistical mechanics and verifying statistical mechanics by computer simulation. Where you start from first principles, I give you intermolecular potentials and you do computer simulation like molecular dynamic simulations and you give me a bunch of numbers which now can be tested. Theory that flows directly from statistical mechanics without going through the computer simulation. So there is something which is not sufficiently emphasized that these two things are extremely important and extremely useful in both the ways. While older India dosen't with the heart-sphere, the first continuous potential and that was the birth of one can say heelistic simulation of heelistic systems was done by an Indian, Anisur Rahman, who studied in Hyderabad and then went to United States and made enormous contribution. Later teamed up with Stillinger, the calculations of water that those who are going down on a whole of 1970s, I think they were 8 or 10 papers. Very nice papers which is done through these computer simulations. Then that became available in 1970s in increasing capacity. I should also mention to work by Carplus, Warshall and Levitt who had given Nobel Prize in 2014 for their applications of these computer simulation techniques or computer methods to study a biology and that was the celebration of the reach of computer simulation. Before that, the Nobel Prize in computer simulation was given. There were a lot of prizes and the commission was given to analytical theories developed by statistical mechanics. These are the papers I told you. The slides are in the first paper, the Metropolis Rosenwood, Rosenwood, Taylor and Taylor, the equation of state calculation of fast computing machines in 1953. Then they did a heart-sphere system. Then Barney, Alder and Wendite, they did heart-sphere and later heart-disk. The first paper of Metropolis Rosenwood was done by Monte Carlo simulations while Alder and Wendite implemented molecular dynamics simulation. So they had two different techniques but the results agreed well with each other and with the theories as I have been telling. Then the real fast continuous potential was done by Ernest Roman, who is a seminal paper and very famous paper in 1964, which is highly cited and highly respected. Then Ernest Roman teamed up with Stringer and did a series of work on water. At that time was increased the reach of computer simulation to a significant degree. Now let us start on the main work, which is the classification of simulation and molecular dynamics simulation, computer simulation divided into two things. One is molecular dynamics, which is propagated in time domain and this is Monte Carlo. So remember when you are doing statistical mechanics, in the beginning the postulates, you are telling there are two postulates of statistical mechanics. One is that, equal or equal probability. Another is the time average goes to ensemble average. Now in a basic idea of statistical mechanics is that you have the phase space in particles, the six n dimensional space called a gamma space and the system is executing a work in this trajectory in this multi-dimensional phase space. And the properties that you observe as a result of this trajectory as the promotion of the system on this phase space. So if you wanted to dynamics the time, the correlated time and also structure, then we have to really play the system propagated on the six n dimensional space by moving each atom and molecule. Because the movement in phase space is essentially due to the movement of each atoms and molecules. In the usual atoms and molecules moving rotating and that is so one point in phase space to another point in phase space means change of configuration of all this in particle system, in molecular system or in atom system. Monte Carlo on the other end is dips on the ensemble. So molecular dynamics is time average. Monte Carlo is the ensemble average. In Monte Carlo, there is no time. In Monte Carlo simulation, what we start with the initial configuration, then we follow certain rules to generate new new configurations. New new configurations which are allowed according to Boltzmann distribution and some technique like that. But there is a lot of creativity in creating this Monte Carlo. Monte Carlo which is a huge gambling town with got so casinos in France. And this Monte Carlo is a method which is depends on random number use of repeated use of random number and which allows us to push the system in the configuration space from one point in the configuration space to another configuration space. And there are rules so that the systems that we generate follow the basic principles of statistical mechanics. So the sampling is very important in Monte Carlo. So to summarize again molecular dynamics is a time averaging while Monte Carlo simulation is an ensemble based things. So molecular dynamics is time and Monte Carlo has no time. That so as I stated repeatedly in this course that is very important to get an overall picture. Because statistical mechanics involves a lot of techniques, a lot of beautiful stuff. But soon when you start doing work or research you tend to get lost into the details. It's very in computer simulation. You start what kind of numerical technique I use to propagate it, what kind of sampling, what kind of random number generator. So there are many details but it always makes sense to have the big picture in mind. So that you know where you are starting and where to go and you can figure out if you are making a mistake, get an overall understanding of what is expected, what kind of results I need to compare with experiments. Are my results correct? So these things are essentially to keep you on the correct state and overall picture is required. So the computer simulation always has these four steps. Any computer simulation has these four steps. We start with, we prepare initial configuration. I talk about preparing initial configuration example. Then the initial configuration obtains very far from the system configuration that you want to study. So then that from the initial configuration you have to run the system for a long time. You are in Monte Carlo also. You have to make many, many moves to equilibrate the system. That you need the temperature, pressure and density condition. This equilibration is very important thing because the equilibration brings the system to the state, microscopic state that you start with the microscopic state in initial configuration. Then you keep on evolving the system, keep on changing the system so that you ultimately come to a state which I can call the system is an equilibrium so that I can start now measuring the properties. So once it reaches the equilibrium, we do a production run. This is the run where we calculate all the quantities along the trajectory or along the sample run and then we use those to get the numbers. So the production run generates the trajectories that to be used in analysis to obtain the experimentally observable results, obtain the equilibration has to be longer than the production because once equilibrium is done, production is reliable. So often the equilibration is 5 to 10 times longer than production run. So many times, for example, in relation to water of 1000 water molecules then your production run may be about 20 or 30 nanoseconds but your equilibration might be more than that, it might be 50 nanoseconds. So this is a very, very important thing. Remember that these four steps are already involved. So about the initial configuration, I told you for example I want to simulate that but then in order to generate the configuration of liquid water which is random with random positions of water molecules, random orientations there are two ways to generate them. One is to put the water molecules one by one into the box and the other one which is more easy to visualize is start with an ice. Although you might be interested in knowing what are at 25 degrees centigrade at ambient condition but you can start with an ice which is the structure of the ice and get a little below that. And so that ice gives you, allows you. So you put a box around the ice, now increase the temperature. As you increase the temperature, the ice melts. This is what I was saying. Now, so ice served as the initial configuration. Now melting and running for a long time is the production, is the equilibration. So that after a long production done the liquid water that you get has forgotten that it came from ice. Then we are in a position to start making calculations and as I told you within a thousand water molecules sometimes the production run starting from ice can be more than 15 nanoseconds or even 100 nanoseconds. So that the final equilibrium state has forgotten the ice and is the equilibrium state of the liquid water. Then we do maybe 10 nanoseconds of the production run and keep track of all the positions and momentum now and they use the energy position, momentum orientation to calculate the properties. The other example is the argon. We start with argon with Fc the crystal and then I veil the ice and let's say I create an interface along the line of the liquid solid. Then you can see that on the left hand side we have the argon Fc the crystal. On the right hand side we have the random liquid and very sharp boundary between them. Similarly, if you want to consider a protein, then you start with protein data bank which gives me a configuration of all the amino acids. And I take the extra structure from protein data bank which is all the proteins that I want to study it in water. Then I dip it in water and run again for a long time so that I get equilibrated structure. Once I get the equilibrated structure I start studying the properties of the proteins. Same we do in DNA or the binary mixtures. So, this is kind of explaining the steps of initial configuration, equilibration, production and then the analysis of the data bank. Here I am showing two types. And there are two particles which are not very close to each other. The positions of the particles are projected on three dimensional space where we can visualize them. And you can see that each of them seems to be a random haphazard motion, like what we call a random walk, the trajectories. The reason it is so random is because it contains the effects of interactions with all the surrounding molecules. And this is very important because this lot of information is contained into these trajectories. Now, we will go on the very basic techniques of computer simulation. And so there are the following techniques. One is the periodic boundary condition and is minimum image convention. Then something comes. Minimum image convention is, they are all very closely correlated. The range of intermolecular interaction, which has to be finite, otherwise it is very hard to see. And then something random number generator as in Monte Carlo simulation. And this random number generator has to form a Markov chain. So these are all connected. That we are saying here, all the five chains are connected. And as I told you, and enormous amount of effort has gone into bringing this area of computer simulation, which is an active area of research in the present state. So let us talk about periodic boundary condition. Why do we need periodic boundary conditions? You know, it is as you understand, the real system is, I have a number of water molecules, 10 to the power 23. But however, we cannot do that because we are going to solve the interacting systems. It turns out we can typically consider it for something like water, a few thousand water molecules. In our demanding cases, sometimes to resolve an issue, we might do larger systems. But routinely, we will do a few thousand water molecules. And here you show that, but it is one huge problem with small system that the fraction of surface or molecules on the surface scales as n to the power 2 by 3, where n is the number of particles in the system. So in a microscopic system, that is very, very small. One in 10 to the power 8 particle is in the system. However, surface, a small system for something like 216, which was the initial simulation of water molecule was done with 216 water molecules. That is 16.5% of the particles on the surface. 1,000 is still 10. 216 36 and 1,100 particles and this percentage on the last column, what percentage of particles on the surface. And you don't want that because this creates a serious problem because we do not want to start in surface effect. That has a different goal and different methodologies. We want to start in bulk properties. But if it is influenced so much by the surface, we cannot really trust it. So this was and several other limitations or drawbacks of finite simulation was circumvented by very carefully and artfully implementing this condition called periodic boundary condition, which creates, kind of puts the repeated of the same your original system, but removes the boundary. And here my system of the rate of arrows up, up, down, up, down. This is my ising model. But now I, this two dashed line, vertical dashed line on the, my net line is the defines boundary of the system, but I don't want to have the boundary. So what I do, I replicate this on the left and right. Now see, on the left most spin, up spin is now, is have a neighbor on the left hand side with the down spin. Similarly has the neighbor which is on the left. So yes, this is, you may consider this little bit of artificial, but it serves the purpose, will come to the artificiality. It serves the huge purpose of viewing the boundary. So system is no longer bound. It doesn't have any surface. It is extended to infinite system. And then you will see that what are the limitations for that, how we go about it. But it's true that it has certain correlations will be compromised. And but when the system is sufficiently large, a thousand or few thousand, then the surfaces, the particle feature on the surface, they fill the correlations. But if the correlation between one end of the surface is to another of the surface, it's not long range. Then for many purposes, the periodic boundary condition and so on. So there is the continuity. It's made at the surface. And in one stroke, we remove the boundary. And now, in Ising model, the systems go, they are fixed in rigid. But in this case, the real liquid molecules move around. Then there is one very beautiful thing that has been invented, that if a molecule goes out of the box, like the one on my top left in my shaded area, that is my original box, then the other one, which is an identically positioned place in the periodic image, is moving. So in this way, number of particles in the system, number of molecules in my system is conserved. This is done for every image. So every image retained the number of particles. So if a particle leaves a central box, the image enters to the exactly opposite side. This is again a very nice technique. But on the other hand, you know, it has limitations, as you can realize. But as I am saying that these limitations is not too drastic. Then for example, dealing in phase transition, this periodic boundary condition creates a problem because you are creating an image of a system when correlations go far beyond. So you are cutting off those long range correlations. That's why study of phase transitions is very difficult. But there are techniques again to circumvent them called finite scaling, but we are not going to go into that. The next technique is the minimum image condition. And this is another technique. Again, when you are doing the periodic boundary conditions, you are creating a huge number of images. The system has become virtually infinite. Then two things come into play. A, if you are going to include interaction with the spins, then all the interaction with all these spins are not required. Interaction of one molecule with all the other molecules that you created not required. And because of the finite range of the interaction potential, and more importantly, you do not want to interact with your own image. And here the rate is done. This is called minimum image convention. You might see that's within my rate box that I must cut out the interaction of my spin that is the elliptical one that should not interact with itself. So the main system is showing here in this... by double arrow on the bottom. And then you draw this thing so that now you can... within that, now you are interacting with my central spin is interacting with these two spins on the left and two spins on the right, but it does not interact with its own image. So that is the minimum image content both periodic and real images and particle must not see its own periodic repetition. Then another thing of the minimum image convention is another thing that works very well with MIC is the truncation of intermolecular potential. Many times we actually do not have to go all the way to minimum length of the minimum image convention because intermolecular potentials are often short range and the Euclid-Antonium potential we might take up to third neighbor or so. After that intermolecular potential becomes likely to be small. So when interaction potential is short range then we need not consider interaction between all the particles. Then we can have a kind of a box within which we will consider the interaction. So this is then combined with the minimum image convention we will take care of the finite range of the intermolecular interaction. So as I told you there are many many interesting techniques are developed and this is the and then random number generated particularly in Monte Carlo simulation what do we need to do? There are many random numbers many random moves because we have to sample the configuration space and we cannot let it move in a correlated way then many of it or many other configurations which are far from my initial configuration will get remain unexplored. So basic idea then is to push the system into different directions randomly so that my system samples maximum number of configurations and this is done by using a random number generated so that the positions and the velocities are changed of each atom or molecule are changed randomly by small amount but then we of course have guidelines to see whether we accept the configuration or not and that is sampling that was developed by metropolis called metropolis sampling but we will come into that in the next lecture. So but we need that for a very large number of random numbers and one important thing that the random numbers should not be correlated. So random number should not repeat itself and this is called when I have a sequence of random numbers where one is uncorrelated to the other so basically we develop a Markov process that which has no correlation so each random number and the previous one, next one, next one, next one they are all completely uncorrelated to each other and that is very important so that I get to sample much of the configuration space the transition from one microscopic state to another microscopic state has to be as much uncorrelated as possible so that I sample everything. Of course that is not possible because just giving push you do not put it away of the configuration space but you allow it to move in all directions so while Markov chain is independent of each other system is not independent we should not mistake that system remains correlated but we push it in different directions so that everything is and computer simulation is done in it you see it I talked in many times in my class that because of the universality that allows it rho star is rho sigma is the molecular diameter rho is the number density this dimensionless unity allows a transferability that I can now compare a methanol with ethanol but then I have to put them in the same dimensionless rho star of ethanol will have different rho because sigma is different similarly with ethanol will be different this star will be different because of the interaction potential epsilon so it is very important the dimensional unity as I discussed in law of corresponding states allows you to explore certain aspects of universality it is very very important thing so the final issue I discussed in this lecture is the force field which is like interaction potential as I said Lennard Jones is very simple that was generated because of the Lennard Jones did it by using the mayors expression of the real coefficient dependent of the real coefficient from equation of state which was measured experimentally but in real for example like water we similarly have the equation of state we have the diffusion coefficient of the water now there is oxygen which is negatively charged and to hydrogen which is positively charged we buy at large no from quantum chemical calculation then size however there are many things we are not taking into account when we are taking the two water molecules interacting and we bear away its additivity that means three particle four particle interactions are not taken into account that has to be absorbed in my interaction this game this technique of finding a good interaction potential is called force field is a highly demanding and highly respected area of research now because once you have a force field then you buy three STs now pattern is well set so this is the force field once I get force field I can do the computer simulation but getting a lot of statistical mechanics and so back and forth back and forth then finally we settle on a force field and that then can be used for computer simulation ok so take a message of this lecture is that we study complex systems with many interactions it really really take the statistical mechanics huge direction so to an extent the modern success of statistical mechanics of the subject is hugely new to the computer simulations and there are many books my book is there but then computer simulation of the Frankel and Smith and then the Allen and Tildesley number three Allen and Tildesley is a very respected book and I strongly recommend that you get a lot of materials on on in the internet and Google and you can see many many simulations actually the trajectories the configurations evolving through computer simulation I strongly recommend you that you see some of these things in your