 Good morning, everybody, and welcome to the BioExcel webinar. The webinar today, that is number 54, is Applying the Accelerate Weight Histogram Method to Alchemical Transformation. Our presenter are Berkes from the Royal Institute of Technology, Sweden, and Magnus Lundborg from Erko Farma, also Sweden. I'm hosting the webinar, I'm Alessandra, and together with me there is Arno Prome from the University of Edinburgh. Before, I just want to point your attention that before, in the BioExcel webinar series, we had already a webinar telling details about Accelerate Weight Histogram. We will post in the chat the link, so if you are interested to have a look to the general methods, you can have a look to that webinar. Today's presenter are, as I was saying, Berkes, Berkes Professor of Theoretical Biophysics at the Royal Institute of Technology. He designed a lot of algorithms that are implemented in the GROMAX Simulation Package, and his current research focus on advanced sampling methods, aggregation of molecules, studying weighting of sulfates at the molecular scale. Magnus Lundborg, he got a Master Degree in Pharmacy at the University of Pupsala, then he got his PhD in Organic Chemistry, Stockholm University, after he moved for a postdoc at the University of Cambridge. Since 2012, he works in the biomolecular biophysics group in Stockholm, and since 2050, he is employed by Erko Pharma. He's working, he's calculating permeability through the intercellular lipid matrix in a stratum corneum in skin using molecular dynamic simulation. And now I give the word to Berkes. Welcome all today for this webinar, where I and Magnus will present an application of the accelerated weighting Instagram methods to alchemical transformations. So I'll present the first half of this webinar and Magnus the second half and then you can ask questions to either or both of us afterwards. Outline. So I'll have a very short introduction to alchemical free energy calculations. I would think most participants are somewhat familiar with this if they are interested in this webinar. Then I'll describe the basics of the AWH method, which I said was already presented in another webinar, so I won't get into much detail. Then Magnus will present examples of applications and also show how to set up such calculations in practice. Okay, so let's, so let's start. First, what are alchemical free energy calculations. So, well, first what are free energies, let's explain that so free energy difference is basically nothing more than the relative population between states, but expressed as an as an energy so if one has two states the state a and b, then the free energy difference between us. I see now that I forgot to change some indices on this slide there's a two and a one which should be in a in a b or b in a. So the free energy difference between these two states. You can re express as a ratio of probabilities by taking the, the exponent of this energy difference divided by the formal energy unit. So, free energies are basically nothing more than differences to express difference in populations which of course is a very important property to know how much a system is in a certain state versus another state that might be of interest. And then there's techniques to compute such for energy differences as we'll discuss today. Some examples here so there's one example here on the bottom left of salvation free energy which is rather important especially in parameterization of force fields but also for actually investigating properties of molecules and how they behave in solvents or if they so if they are soluble, which here is drawn as a well you can think of it as a physical process where I would take a solid molecule and I would have a solvent separately and then I want to know what's the energy difference of solvating the solute insolvent or what's the probability of the solid being insolvent, which is equivalent to the free energy question. Using the above formula here. This could you could actually do through a physical path by taking the solute and moving it into solvent which in practice is usually not the best way to compute it. One often uses what's called an alchemical path or non physical path where one transforms interactions between molecules like in this case one would have a solute. Not interacting with the solvent and then you can slowly turn on the interactions to make it interactive the solvent and make it feel solvated. It's not chemical in the sense that we change interactions of the molecule so this is not physical but we change the properties of the of the atoms and the molecules in the system. On the right here is a more complicated example but that's quite common in biomedical applications in pharmaceutical industries for instance if you want to develop a new drug molecule or inhibitor which is why it's called probably called I enzyme a protein E, then you might be interested in. If I change some atoms on my inhibitor on my ligands or drug molecule from I go from I to I prime as shown here. What's the binding how's the binding effect of this molecule doesn't bind weaker or stronger so you might for instance be interested in making a drug that binds stronger to your target molecule. Then, here, what you're interested in is always in actual physical quantities like this delta G1 and delta G2 which tell you how strong does the inhibitor bind to the molecule to the protein but that's difficult to compute so you can actually compute through thermodynamic cycles which tells that since the free energy is a state function. Any circle you make going through states should be free energy should add up to zero so this means that I can compute what in this case called the delta delta G a difference of difference free energy so the difference in binding free energy. I can compute delta G3 and delta G4 instead which is much easier and compute with that difference in binding free energy between these two ligands. And I called alchemical because I'm changing here the ligand molecule from one molecule to another I may be changing the character some atoms adding a few atoms removing a few. And thereby changing atoms or molecules so that's what we call alchemical. This is a very powerful technique that's used in many different applications as probably many of you are aware of. So there are techniques available to do to compute such just free energy differences. More or less efficiently, and they've been available for quite some time and their improvements have been going on, which will explain one improvement that we've made here today. So how do you, how do you do this so formally how one does this is one is what's called a coupling parameter approach. So, to do this you add a coupling parameter lambda to the Hamiltonian. And it's written out generally as a full Hamiltonian but the many cases as I use like in a slide slide before it's often just to the potential energy that you have to add the coupling parameter. And this is done such that in a state at lambda zero. The Hamiltonian corresponds to the state to the Hamiltonian of state a and in London, in the case of London as one, it corresponds to the Hamiltonian of State B. So now I've formally made a path from state a to state B. And then you can obtain the free energy by the difference by integrating the derivative of the Hamiltonian with respect to the land I haven't derived this is a rather simple derivation so this actually you can see this is the work that you need to do to change the system from a to be. And this, this is one way of writing the free energy difference there is actually other ways in discrete which like with the benefit acceptance ratio which I won't have time to go into in this presentation I'll refer to that. But this is the basic mechanism so you, you extend the Hamiltonian with a coupling parameter. And then here it's not written how you actually do this. So here it's only written that the zero should match the states to the Hamiltonian of state a and lambda as one should match the Hamiltonian should match set of state be so the endpoints, how you couple these endpoints is up to up to you so you can do whatever you like. But some choices are more efficient other choice are less efficient. So in this presentation also want to discuss options for for making paths here in grow max or some options. There's continuous research going on to into improving the path here to make things easier to sample and more efficient. So, why do you actually need such a path, or why do you need intermediate lambda states that values that's because often there's no overlap between states like in the in the example of solvating a molecule in water for instance, unless your molecule so small that is methane there are no holes in water that are large enough to fit a molecule. One of the things that my face space I've shown here schematic representation of face space in two dimensions so you could say that the red, the red part here is my, my molecule not solvated in in water on the blue part of this one. Then there's no going to be no overlap in states because the molecule is so large that they're never cavity so you could not fit in the molecule in water as is so you need to create space in water so you need to create some kind of path here between these states. So one thing one can do here friend if you just have these two states the coupled and the decoupled molecule you can compute this this derivative of the Hamiltonian with respect to lambda. If you have machinery in the code to do that which grow max has, for instance, but then this DH lambda might vary a lot in between so you just get it at the end state so that's not good enough so you need to do something more. And what you need to do is create this lambda path in between here to create overlap. So that's something that you need to do for any method estimating free energies you need to have enough. What we call phase space overlap to be able to compute free energy differences so here we've drawn some some more lambda values some more colors in between and now we have all these circular phase space or sorry all the sampling regions that overlap in phase now and now we can do something. So now one can choose different methods to compute free energies. So, to make this connection you actually need to choose an efficient path, which in grow max there's a limited set of options to do that there's some parameters you can vary, and you need to choose points along the path. In this case I've chosen, but we have to do and states and I added four points in between these and states I have 66 points in total. So that's another choice you need to make. Okay, so let's see what what what we can do now so now we can compute free energy differences from this. So one way is what's called thermodynamic integration that was the old way that we used when I started my PhD, where you compute this derivative of the same with respect to lambda as I showed before at the different points that you have independently, and then you integrate that. But that actually leads to integration errors or quadrature errors because you only estimate the derivative at certain points and both in between. So this gives you a systematic error that you can only get lower by having more than lambda points. So what's the standard method now also in grow max is to use what's called benefit acceptance ratio which explained very shortly on the right here. There's more to it to this I should have put in a reference but this is too complicated to explain here in this talk and off topic. So, but what you do here is you use differences in energy between the lambda value so you simulate at zero the red ensemble here the red state, and then you compute a Hamiltonian differences from lambda zero to the next state which is in this case all point two. And you do the same thing for London's all point two you compute Hamiltonian differences to lambda zero. And for these two energy differences you can do a very accurate. In certain sense unbiased free energy estimates for energy different estimate between the states which is what benefit acceptance ratio does. Okay, so let's see what we do now so what what we now do with with the accelerated weight histogram method is we've, we instead of doing simulations at fixed points for each of these lambda values we now let lambda move so we now added lambda as a dynamic variable using Monte Carlo, and here's a small animation of, of how that could go here. So we, we start out for instance at lambda zero, and then the, the, the system samples and moves. Not only a space space but also along lambda, and then at the bottom you see the colors indicated which lambda is currently active. So which from which lambda the forces call. And to compute the free energy differences we do the same that bar does so we compute these. Let's go back here we compute these energy differences that bar does to all the other points at how often we think is is needed. So we get, we get the free energy differences between these lambda points here. We get a lot of time and we get a lot of information and we can combine that information physically mathematically correct to get an accurate free energy estimate. So this is a bit like like actually m bar or multi bar where you have where you use all the information to all the different lambda points together. Okay, so how, how does this work so this is described in detail in several papers so this method day which method was originally to develop by yuck litmar for different applications then it was adapted by vehicle Linda for sampling collective coordinates and in the context. So there's a webinar on this which the link is should be in your chat. We also devised a metric for this, which is something maybe markets will show something on, which tells you how you should sample along this lambda coordinate which I haven't discussed here so you did lambda coordinate you. You could some regions might be easier and others might be more difficult so you might want to take that into account which metric will tell you, and then the manuscript isn't has been submitted on this new application, which is, we hope will be accepted soon. Okay, so how does, how does the age method actually work. So, a short, a short explanation on that is that this is examples from from taken from the presentation on the, or for reaction coordinates but you could in a reaction corner can be lambda, like in this case so the trick is that we add. We have a well we have a free energy landscape which is given by the lambda dependence that the system has. We have to sample, in this case, all on the values equally. So to do that we need to have a bias potential that should match the free energy so that's this blue bias potential to flatten out the potential to make it to make the effect of potential flat, which is, of course a problem because what we want to compute is the free energy so we don't know that. So we need to have an iterative procedure to compute the bias potential, thereby also computing free energy. So we, what we do so we have a bias simulation we guess some initial bias which is usually flat, then you estimate the distribution that you would have. If you assume that everything is correct which it's not because you have the wrong initial bias and then you can update it with the differences that you have observed from the samples to what you expect, and then iterate this around. The method does. And here's another schematic drawing of how it actually does this and how it, how it adapts the sampling and the free energy updates here so there are some weights that are being updated that's why the weight histogram method that is in different states. And then there's a number of samples involved. So slowly method converges as a number of samples increases in the updates go down, you get more certainty in your results. So the updates, the free energy updates go down as roughly one over a number of samples. So that was that's what happens and then we have an initial phase to make the initial phase go exponentially fast which makes it really efficient. And the details are in the are in the paper or in the Okay, so let's show an example here of how this goes for the double well potential so you see that the system started out with a pretty fast with a flat blue bias and then slowly as it samples it converges this blue bias to the black curve. So that the free energy estimate improves and improves and as it's, you gain more and more information it becomes more and more accurate, and you can, you can imagine that this, this converges to, I can run it again. So initial updates are very large, and then the update gets smaller and smaller as time progresses. So there's an initial exponential phase which is given by this factors to four eight, and then in, there's a final phase in which the updates go down as one over the number of samples and you converge to the, to the final result. So this is holds both for the reaction coordinate AWS and for this new free energy application, which is uses completely the same algorithms and machinery. And that's an advantage here let me go back is that you know, unlike for for for others simulation techniques where you have to do many different simulations, given by the number of London points you take because you have to run one simulation on that point so here we here we run. See the animation again. Here we run one simulation that samples all on that point so you can get your free energy out of a single simulation. But so that's nice. So you can only run only to run one not manage a set of simulation but you can actually paralyze that again if you want to have it run in parallel. Next slide. Yes, we can use what's called multiple Walker so I can run multiple simulations that all contribute to the same blue bias here so here's an example. Yes, so here, here you see I think it's for but it's difficult to see this animation goes fast. So now you converge much faster because you have many nearly independent simulations contributing to the same to the same bias to the same free energy. So they're coupled through the free energy bias. So this is convenient because you can have any number of workers you want until it gets so many that your production time gets shorter than your than your calibration time that you're losing efficiency. And you can thereby reduce time to solution a very flexible way and the simulations are also easy to manage with and you run. So this gives you a very convenient parallelization of the method as well. Which markets will show results for soon. So, sorry. So, there are few choices to make for the French okay so there's not so many. Actually, which another advantage so there's the number of workers that you need to choose for the parallelization as I just showed so you can choose this relatively freely according to your resources. I don't know if you get very many as I said that you're start losing efficiency. Sorry, there's the number of lambda points you need to choose, but this is also an advantage here they're not not very sensitive so you can choose sufficiently sufficiently many so there's not not a penalty when it's going from the various to 100 or so there's no almost no overhead in cost so you can choose a lot resin in other methods. You have to choose very carefully to get good efficiency you should not choose too few and should not choose too many so here you can just simply sufficiently many. Then there's one main parameter which is the initial update size which is set by two parameters a bit strange maybe a diffusion coefficient and initial error. And so that sets how fast tells you how fast the lambda moves. And what's the initial areas in your guess which usually flat but I give you some numbers which usually tend to work so something like 0.01 per picosecond and thinking to promote if you plug in that then it's usually works fine this is not very sensitive either. So this is really nice because there's so you can easily paralyze it with freely choosing the number of simulations and the other parameters are not critical at all. So this is what one main main advantage of the method it's very easy to set up and to use. Okay, so now Magnus will take over and show some examples of our method. Yes, so I will continue here and present some examples that we have used for testing this method. So first, I will just look at two compounds where we are calculating the salvation free energy and just looking at the effect of the number of walkers in the simulations. With more walkers you run shorter simulations but you can run them then more easily in parallel if you have sufficient resources. And I am just shown two compounds here for comparison. So you can see that the number of walkers do not affect the time for the simulations to converge. We see that they stabilize fairly quickly and then are reasonably planar. Especially if you look at the scale of the free energy units here you see that it's quite small differences even between the sort of 400 total simulation time 400 non seconds compared to the full simulation time for ethanol. Likewise we see that for testosterone as well we see that more walkers do not affect the efficiencies you can more or less freely choose according to what computer resources you have. In both these cases when I have been running one walker I decided to run them run five times as many simulations rather than run them five times as long. So this is sort of the same reasoning that it's easier to parallelize. Likewise here I only show the example for testosterone where I have changed the number of lambda points so the number of intermediate states from 16 up to 141 lambda points. And here see that there is not any large difference in the simulation results between quite large differences in the number of lambda points. So as long as you choose lambda points that you have sufficient overlap. This AWH method should work fairly well and if you are uncertain it's usually wise to pick a little bit more lambda points. It's a little bit longer that you have to calculate the difference to all neighboring states but it doesn't make that much of an impact. And then finally the sort of last input parameter that you can change which is the diffusion coefficient. You can also here see that the results do not change much for testosterone at a range of a factor of 100 different in diffusion coefficient where we are going from slow diffusion coefficient in black to a much faster diffusion coefficient in green. What we can see though is that the variation or the standard deviation goes down when you diffuse a little bit faster. In general it's good to pick as fast diffusion coefficient as you can but if you pick it too fast you will create or get too high energy barriers in your PMFs. So you have to be a little bit careful but if you check that the PMFs make sense you can usually use quite high diffusion coefficient. And here I can actually also mention the AWH friction metric that Berg mentioned. I will not go into any detail about that but there is a metric in the AWH method that shows you the friction at each lambda point for the free energy calculations. Or the friction along the AWH reaction coordinate for if you are pulling for example. And this friction shows or tells you how efficient the sampling is at that point. And it's not implemented in Gromax yet but we are looking into doing that because using this friction you can change the target distribution so that you tell AWH. To sample more where the sampling is inefficient and that has been shown by Jack to speed up the convergence. At least significantly even if it might not be a huge difference. If we then compare the convergence using AWH to equilibrium simulations using M bar. We can see we can start with the ethanol case where we see that the. We have a significant difference between the M bar results and the AWH results. But when we added an extended ensemble simulation the what is called the one lambda here analyzed by M bar afterwards. We can see that the AWH seems to agree with that and is placed right in the middle of the two other methods. So we are not too worried that the M bar results here differ a little bit but it's still if you look at the free energy values it's a very small difference anyhow. Extending these simulations here might make the difference a little bit smaller as we can see if we jump over to the testosterone case instead. Where we show two different AWH setups so the black one here is just chosen because it's the one that differs most from the M bar simulations and also has very low standard error of the mean. Possibly since it's only from five simulations it might be artificially low. But we see that there is a difference here but it's not very large at all and when we use a little bit higher diffusion coefficients and only four walkers so what is shown in red there is no significant difference to the. M bar simulations. That we can see here but if we extend also the M bar simulations here so that we see what happens at a longer time scale we also see that it. Seems to converge to at least towards the AWH results but we also see here that the time scales required are quite long so the. Blue simulation here is 70 nanoseconds in 27 lambda points repeated five times and in these cases. I have used an equilibrium or a equilibration time that I have discarded the first five nanoseconds of the equilibrium simulations so what is the green and blue lines here. That can be automated a little bit so that you don't have to choose it. If you use the M bar analysis tools, but I also wanted to see what happens if we extend the similar equilibration time longer so if we instead discard a whole. 35 nanoseconds of the 70 nanoseconds simulations. Then we can see that the results are quite close to what you get from AWH. Which also shows you that sometimes you might have to discard. A lot more data than you wouldn't prefer to like to in equilibrium simulations. So even here discarding 35 nanoseconds is longer than most people even run equilibrium simulations. And now I will go to another fairly different example where. I show how this AWH with. Elkambagruf ENG coupling can be used in a more advanced setting. So in this case I will go through calculating. Permability through the skin lipid barrier. And this is a quite complex lipid system. And the one problem is that it's in near gel states. It's almost frozen. You don't have much motion in the system. Which also means that you have slow diffusion through the system and slow convergence. And that's a challenge when it comes to sampling. Here is just the same but turned around because when I show the PMFs it will be easier to visualize the system in this way instead. And in the PMFs that I show the center of this molecular system will be at zero coordinate. And then it will be symmetrized so that I only show it in the positive coordinate range up to five nanometers approximately. So that will be in this interface. You will also notice that unlike most lipid bilayers we don't have a large water layer in the system. We have a little bit of water in the head group region here. But the ceramides that constitute the systems are extended here and then the system is just repeated. And first when we studied this system we used non-equilibrium pulling methods to pull the molecule through the system and calculate the PMF from that. And that seemed quite promising but when we studied it further and reduced the pulling speeds we saw that the PMFs were drastically affected by the pulling speed. That the slower you pulled the lower PMFs you got. You can of course here also see that what I show here we have quite a large difference in the total simulation time here as well. But even if we extend the fast pulls to 10 nanoseconds we don't see a large difference in the PMFs. Even if you can see that in the green and the blue case there is a difference when we extend the simulation time by a factor of three will still be a fairly small difference also for the past pulling case. But here we also realize that pulling through the system at this slow pace means that it takes a very long time to get the results that we want. So we cannot parallelize through or around that problem. And we also noticed even if I won't show any data here but that umbrella sampling also required very long simulations and you often had to discard lots of data as equilibrium when you inserted the molecules or if you pull the molecules through to generate starting configurations. So we realized that umbrella sampling was not very good for us either. We tried before I look into the we look into this picture we start tried also with the WH just pulling through the system. But one problem was that since system has a very low diffusion it can take a long time to visit all the significant regions. So, when we then had to develop this a WH with a chemical reaction coordinates, we combine that with pulling so that we have a two dimensional pre energy landscape, where we have the pooling across the system in the z coordinate here, and the on the other axis where lambda states 20 here is the fully decoupled states where you see that we have a flat. Level here, and the lambda state zero is fully interacting with the system, so that you can combine a WH in this way which makes it very powerful. And what we then see is that we get the PMF that is more similar to the closest pooling PMFs, but still a lot more detailed one note here though is that the error estimations for the WH is not correct in this case. It is only a very rough estimates and not from repeated simulations we will come in a little bit more into that later. So we can see here that we can get a lot more data from combining these two reaction coordinates. And notice that it's still fairly slow because using the free energy kernels are still not very efficient. So that's still a problem but we are now we have decided that it's worth it, even if the simulations are not very quick. So what I mentioned one problem with a WH is that there is no error estimation from the analysis. So if you are used to running a bar or m bar analysis, you will get an estimate from the results or when in the results. And as with a WH to get the reasonable error estimate you would will have to repeat simulations and I would recommend at least four or five times to get a good estimate. However, you should also note that that's actually the best way to do it for equilibrium simulations as well because the error estimates from bar and m bar are often somewhat underestimated, especially if you sample all configurations properly at all m bar states. So I would still recommend that even for other methods that you repeat your simulations and calculate your error estimates from that. So now I will just quickly go through a little bit how you can run this in grow max. So there are two sections that you will have to look into and that's the free energy section. And there you have the lambda states like normal. And what as we pointed out before you don't have to optimize the lambda point distribution very carefully when you run a WH. You just have to choose enough points that you have sufficient overlap between neighboring states. And then what you have to do is like if you run m bar that you specify that you calculated lambda Hamiltonian differences to all neighbors, not only the next neighbors. And then in the a WH section of these simulation parameters. You need to set or use a convolved. Oh, sorry. Here it should be the other way around the WH potential should be umbrella not convolved. That's something that should be changed. Because the convolved works with full dimensions but when you have at least one chemical dimension you need an umbrella potential. But that's checked by go MPPA as you generate your TPRs. Then you need to set your this how many steps between your a WH samples to be a multiple of the number of steps you calculate energy so that you have calculated the any difference to the lambda states or neighboring lambda states when you sample the a WH. Reaction coordinate. When you say that you are using the free energy perturbation lambda as coordinate provider for this dimension. You specify a start and end points the indices of the first and last lambda points. And then you set the diffusion as high as possible. And then you set the beginning multiple walkers you all shows so should consider using equilibrate histogram, where you during the initial exponential phase that back mentioned, you will make sure that you first sample the a WH histograms so that they are close to the distribution so that you have sort of a flat sampling before you start the more careful in your face. So this is just an extraction then or extract from MP file to see the relevant sections I won't go through this but if you want to go back and look at this recorded session you can have a look at these slides. And here I have written the correct idea WH potential. Let's wrap this up. Now, since or from grow max 2021 a WH can be used for a chemical free energy calculations. There are a few input parameters, but it's not very difficult to pick reasonable values for them and it's not very sensitive to them. We have seen that it converges at least as quickly as equilibrium simulations. Within settings or with a multiple walker system it's easy to use your compute resources parallelize the simulations. And then as I showed last it can also be combined with a WH react other a WH reaction coordinates for example if you're pulling through the system at the same time. And now we have time for questions. Okay, Magnus, thank you very much as well for an interesting presentation. I'm sure people will find this useful. We've had one question already saying oh where can I find out the MP parameters. So I think I will put in the chat a link to the part of the the grow max manual where there is the a WH options are mentioned there. We also have on the bio website. We have a forum where people can ask about this. Now if people are looking for tutorials or more information about how to do this practically, Berg or Magnus, do you want to point them anywhere else in particular? There are no good tutorials available, but with the manuscript that we are have submitted on this. There will be an auto link to GitHub repository with at least the examples from that manuscript. Okay, thank you very much. So then with that I will go to the question. Sorry, Berg go ahead. No, it might actually be a good idea to have an example MP file somewhere because this is a really simple otherwise so that's basically all you need. So we should think about that. We don't have it ready now, but it's useful to put somewhere. We'll try to do that. Okay, we can put a link on the page on the website that has the webinar description so that people can find it from there easily when they go back. So let's go to the questions. The first question is about similarity with one Lando. So William Smith. Yes, I'm familiar with Monte Carlo simulations, as well as indeed this this looks like the MD and MD implementation of the Wang Lando flat histogram method in Monte Carlo that's been around for quite some time. Is that the case? Well, you know, Max has a Wang Lando scheme for this already. So that has that's implemented such a traditional Wang Lando phase but if I'm not mistaken that has incorrect convergence properties or incorrect it converges too fast so you don't get, you don't converge to exactly the right answer. It might not matter in practice in many cases because it's good enough. So as long as if you don't assume that your distribution is flat, but you correct for what you get then then that might work. But that's the grow max is implemented as an initial Wang Lando phase and then and then sampling with this bias that you accumulated there. Whereas this AWH method is continuously improving at the correct rate so you get better and better. It might that matter depends on your on your application case I would say so AWH is more robust in the sense that it always keeps improving. So if you made an initial error you missed some parts of phase space that might be relevant and it will keep correcting for that. And of course corrects correctly. I mean if initially you sampled wrong the final energy will still be correct since it reweights all the points correctly. But it's quite similar, but different in the way that the weights are updated. Right. Okay, I understand that Monte Carlo Wang Lando implementation does the same thing. I mean it iterates and so on. Okay, so that that's Yes, it does conceptually the same thing but but the way the way the weights are updated are somewhat different. So it depends on what Wang Lando you're talking about. I mean you can you can probably make a version of Wang Lando that's almost nearly identical to AWH but most versions are not exactly like that. So AWH usually converges better than Wang Lando methods depending on how you set up the details. Okay, that's great. Thank you. Okay, thank you very much. Then the next question is going to be related to lambda dynamics. So Ying Qi, I'm going to unmute you and please feel free to try and ask your question. Thank you for the nice talk. So there is a method called lambda dynamics. They also allow the lambda to varies during the assimilation. So what is the major difference between the AWH and lambda dynamics? Thank you. Yeah, so lambda dynamics depends on what you mean with that. So that's a very general term where it just tells you that lambda is dynamic, which it also is here. So, but that depends on what context it's used in. So lambda dynamics as I've encountered often which I'm actually a project which I'm involved in is having many lambdas for many groups like if you want to do constant pH simulations. So you have many protons that can appear and disappear and dynamically and move around. So in that's different because there are very many lambda values that are moving around. And then there's a difference in detail because they often use a mass to be updated depending if you use Monte Carlo for that or molecular dynamics. In our constant pH application we use masses for them. But here you only have one lambda that moves around and that's coupled to the Hamiltonian as we've shown here. But conceptually lambda dynamics is not much different except that you have many lambdas and they often use a mass instead of Monte Carlo. Thank you. Yeah, if I just may add one difference is also that lambda dynamics as such does not tell you anything about the bias that is used but just that you sample and can move between the lambdas. Yes, it also right. It also lambda dynamics you would not get a free energy out for saving you can of course compute the distributions but you don't you don't have the potential changing resin AWH or Wang lambda or whatever for that matter you have a bias that gets updated. So you you change the sampling. That's not what happens in London. Thank you. Okay, the next question is regarding the applicability of this approach from Thomas Stockner. So Thomas's question is, has this approach been tested for more complex systems such as protein conformational changes. The chemical reaction coordinate with AWH has not been tested for protein conformational changes. But the AWH method itself has been used for that or correct me if I'm wrong back. Yeah, I must say the question is a bit confusing so so the chemical change are not while there might be a change a conformational change involved but it's computer free energy differences between different alchemical states or chemically different or in composition. As conformational changes are usually you would associate that with the same system but in different conformational states. So that would be an application of AWH in that case, not of this alchemical case, which has been extensively used to use for that that's what the method was originally implemented for in grown max and adapted. So, I hope that answers the question. Okay, I'll let you know if we get response. So then we move on to the thanks from Thomas, then we move on to the next question, which is from see that about computational time for bar runs. So the question is, what is the computational time needed as compared to bar runs. So, I would say that if you, let's see if I can switch slides here. So if you mean that the computational time for to reach convergence, for example, then we can see that we, as I mentioned, we reach convergence, at least as quickly. Well, here I compare compare with m bar but in these cases there is not a large difference to bar either. The actual simulation efficiency is not any different compared to m bar. Since you still have to calculate the free energy difference to all lambda points and the AWH algorithm itself is very quick. So I hope that explains it but if he is interested in the actual bar analysis time that you have to do after the simulations which can take some time. So that is avoided with AWH that runs the analysis as you run the simulation and then you can just get the output when you are finished. Okay, I will assume that answers the question. Then we have time for one possibly two more questions. So I'll just pick there's one more question regarding salvation free energy calculations. William, I will let you ask your question. So thank you again for a very interesting talk and this is my questions, maybe a bit off topic, but not really. We use grow max quite regularly for salvation free energy calculations but in fact we use them for calculating standard state chemical potentials. So this raises the question that do you insert a molecule that is do you couple the solid molecule or should you decouple it. That's one aspect. And the other aspect is do you run your simulations in NPT or do you run them in NPT. Can you comment on each of those. So I will start the last and then all these cases I have run the simulations in NPT ensembles. Okay, can I respond. And why do you do that. Why do you do that. Because it doesn't have a well our philosophy or our view on it is MVP. If you do an NPT on the soul you solvent I'm sorry. And we're looking at salvation free energies. We find the correct box size for that pressure. And then we can do the more complicated chemical potential calculations. Without a barrel stuff thus reducing the noise in the system. And in fact we find when we run NPT and NPT for free energy calculations. They're basically the same anyway. I haven't really thought about that but I guess you would then get the Helmholtz free energy rather than the Gibbs free energy observation. If that makes a difference. Yes, that is true. I think that's what your NPT simulation gives you as well. But yeah, you have to construct your chemical potential properly from a Helmholtz model. But so in a sense then I mean that this is your NPT versus NPT is a very common one when people are trying to calculate chemical potentials, which is not mentioned in the grow max manual but we think we know how to do it. What about the this is related to the insertion versus deletion of the solute molecule. Do you have any thoughts on that. So, in general, if I were was running equilibrium simulations I would start the sort of process from a decoupled state. Change the lambda setups that I start copying the solute from there but then we'll run the simulations along the sort of in the lambda windows. With AWH, I wouldn't say that it really matters if you start from an equilibrated system with the dissolute then you should then you can use that or if you start from an equilibrated system without the solute and the solute fully decoupled you can let AWH turn on the coupling and it will also then go back and forth during the simulation. I can also add here that I mean if you do if you do equilibrium methods there is no direction in principle because it's equilibrium at the lambda value but of course you have to come up with an initial confirmation for each state which you might generate with directionality but there's no direction there. And here in AWH there are the only direction it's there is where you start from but if you use multiple replicas you could start all of them at one decoupled or all of them coupled or you could start them at a mix of whatever you want so in that sense there's also you can choose if there's any directionality or not. In the end it all shouldn't matter. Well, if you're calculating a chemical potential it does matter because you have to add on the ideal gas piece. If you have a rigid molecule it doesn't matter. It would only matter if you simulated NVT so your volume would matter anything else doesn't matter there there's no there's no directionality in the end of these calculations. Yeah, but wait a minute I'm not talking about directionality I'm talking about. Well, in a sense directionality but I'm talking about calculating the contribution of the intramolecular part of the ideal gas molecule. But that has nothing to do with how you do these calculations that's a choice that you make in how you set up the Hamiltonians that you're interested in. Yes, but if you want to calculate the chemical potential the complete salvation free energy with a coupling you have to separately calculate the ideal gas contribution with a decoupling you don't. No, it depends. No, no, no, that's not the coupling or deeply you can choose in grow max if you want to couple the inter intermolecular part or not so you can choose if you want to. If you want to go to directly to a decoupled ideal gas state or if you want to decouple all interaction inside the molecular options to do that so there are choices there but that has that's orthogonal to to orthogonal question to these approaches and you can choose many things there but that's not particular to do this. Okay, well thanks very much I'd like to continue this offline I'll send you an email. This is quite important actually. Okay, thank you very much for an interest of time I think we will leave it there in terms of the questions. I would just like to thank the speakers again so thank you Beric and Magnus for an interesting talk and thank you for the interesting questions. Before we say goodbye. Just like to tell you about an upcoming training event which may be of interest. Magnus if you could advance slides one thank you. So bio Excel is organizing a summer school that takes place in June. They the link I will put in the chat so you can have that now. This is more cover Gromax and also other core applications supported by the bio Excel center of excellence including haddock and CB2K. BMX and also bio Excel building blocks for workflow management. So you're very welcome to to apply there and tell anybody who you think might be interested in this event. It's a very very well very positive we got very lots of positive feedback about this summer school so people find it very valuable. With that the final bit is if to continue this conversation or to address any of the questions I will not have time to answer. You can visit the Gromax forum at gromax.bioexcel.edu. I've also put the link in the chat so thank you everyone for coming and have a good rest of your day.