 Previously in the class, we've never stumbled upon this problem that we had to predict a specific path of a specific atom. Let's see if we can avoid that here too. Actually, this far you've been able to make do with the Boltzmann distribution and the partition function. So let's see how far that takes us. Assuming that there is an energy landscape and I'm interested in the equilibrium properties of it, then you know now that it's sufficient to know the populations of the states here. If I would like to know the kinetics, I would also need to know the peaks, but at equilibrium I also only need to know the states. If I'm at the edge here, I would fall down on either side, right? This is something you worked with already in Hand in Task 1, but what you did there to simplify things, you simply defined a number of energy levels and then you calculated the probability of moving between them from the energy difference between them. And in particular, in that Monte Carlo program that you run, you used a method that is very special, although you didn't know it. So the probability of being in an individual state that is proportional to e raised to minus eI divided by kT. But you used something else. You used the relative probability of i and j, pI divided by pj, which is e raised to the energy difference between states i and j divided by kT. And what you did, if this was exponent here, if the energy difference was negative, that if I'm going downhill, you always took the move and if it was going uphill, you sometimes took the move, at least if the gap was not too much uphill. That sometimes you decided by drawing a random number x. I don't think you called it x, but I need to call it something. It's a uniform random number in the range 0 to 1. And then we compare that pij to x. If pij is greater than x, we always accepted the so-called move. And if pij was smaller than x, we rejected the move. But note that x is random, so we don't know. x is between 0 and 1. Does this make sense? Yes. If the energy difference from j2i was negative, this is going to be positive, then pij is greater than 1. Well, x can only be 1, then you would always accept it. On the other hand, if the any barrier is uphill but small, it's going to be a negative number close to 0. It's going to be just under 0. And then it's very likely that x will actually be smaller than that and then you will probably take the move anyway. But if the energy difference is very large and uphill, this will be a very small number and then it's very likely that you will reject it. That was not, this was hand-waving, but the method you used has a very special name. It's called Monte Carlo sampling or Monte Carlo simulation. And that specific criterion is the so-called metropolis criterion by Nicholas Metropolis, published in 1949. This was such a breakthrough that the US military even considered classifying the discoveries because they wanted to use this for simulating nuclear weapons. That was hand-waving, but what I'm going to argue that we haven't proven is that this will actually reproduce the Boltzmann distribution. And it will particularly reproduce a nice property called detailed balance, meaning that at equilibrium, the flux across the barrier here, left to right or right to left, it's going to be the same. So there are many more particles here, but they have to find and go over a very high barrier, which is unlikely. I have much fewer particles here, but for them the barrier is lower. And if the flux is the same in both directions, the relative distribution of atoms or particles between the states is going to stay constant, right? So that should be great for a protein in water too. Let's take my protein and try to make that type of moves. Moving a torsion, well, that's a torsion. That worked great. Well, no, it didn't. It only worked because I didn't show you all the water around this protein. In practice, what just happened is that I bumped into the water. I need to reject that move. Let's try to move something else. I bumped into water there too. In fact, I'm going to bump into water pretty much. It's going to be one in a billion that I don't bump into water. So this method is hopeless for anything that's exist in solvent, unless I have a very smart way of moving them. Too bad, we're going to need to go back to the old slides where I argued that we're going to predict individual motions. Well, do we? I would actually argue that this conceptual way of looking at it makes a lot of sense. It's just that the specific recipe we made for the moves that they didn't hand in task one is not going to suffice for proteins. I just need some other way that generates confirmations that are correct according to the Boltzmann distribution. And you have such a way. In fact, we had it two minutes ago. Newton's equations of motion will fulfill this. Two, they have a slightly different property, though. They're the actual steps we take are going to be minute, which means that I won't move very fast. But on the other hand, I never end up rejecting any of them. And in the end, that benefits me more. I will be able to sample better. But then you should ask, didn't all those concerns about accuracy of prediction and everything hold? Well, they do. But you see the difference I'm making here. I'm no longer pretending that I can predict the exact path of one atom. All I'm interested in is am I sampling the energy landscape correctly? Which I will do in terms of the occupation of the states here. The other thing that gets me is something that you didn't get from the lab. In this lab, you had no information of the kinetics because you didn't even consider the any barriers between the states, right? So just moving directly from state to state would mean that there was no kinetic information at all. But if I'm now using Newton's equations of motions, I do get information about kinetics. I can count how fast they go over barriers and everything. And I'm going to argue it's the same property there that the individual atom might not be exact. But when I average this over many atoms, the average kinetic properties will in fact correspond to the correct values unless I made an error in my potentials or something. So this is going to be a beautiful way of getting rid of the challenges with predicting parts of individual atoms while also using the safe and sound Newton's equation of motion to generate new states. And that's why we use molecular dynamics. I'll formulate this in a slightly more formal way though. Each atom has a mass I that we multiplied by the second derivative of the vector coordinates of that atom with respect to T. That should be equals minus the gradient taken with respect to coordinates I of the potential that is a function of all coordinates. And then I will be in the range one to N where N is all the atoms in the system and that can be 10,000, 100,000 or even a million. So these are going to be a very large set of equations in general and it will still be expensive to calculate B. But this solves the challenges for us. And just to draw the analogy, remember that integration I showed you. An individual atom might deviate here but that's going to be one in a million. And in general, most of the atoms will stay closed both in terms of what states they're sampling and the kinetics they're sampling. And that means that I will get good averages here not just for the states I'm visiting but also the kinetics. And then we're in business.