Fixed CONVERT_TO_FES to make it more back compatible with earlier versions of PLUMED. #1376
Fixed CONVERT_TO_FES to make it more back compatible with earlier versions of PLUMED. #1376
Conversation
…k compatible with previous versions of PLUMED
|
@gtribello I think the CG idea is cool, but where do you start it from? If it has multiple minima it would be stuck. Does it make sense to start the CG from the minimum of the grid? Could this be just the new default option? This would be by definition <= than the minimum on the grid, and also very likely <= than the minimum with CG starting from 0. |
|
This works by finding the grid point where the free energy has the lowest value. I then do the CG starting from there. This is what happens if you use the FINDMINTOZERO option I wanted to make this change because Omar had a crash when he used the MINTOZERO option because the CG wasn't converging. This wouldn't have happened in old versions of the code because you are not doing the CG. I thus thought that introducing the new flag for turning this option makes sure people know what they are doing. |
|
Good point! So: can you make it so that if the CG gradient does not converge it just uses the lowest point seen so far? This should be robust enough for all applications, without the need to learn an extra option |
… you use MINTOZERO option Note that if no minimum is found then the lowest point is assumed to be the point on the grid where the free energy is lowest. A warning is also printed to the log to inform users that an optimum was not found
|
OK @GiovanniBussi with this commit, I have done what you suggested so the behaviour now is that we try to find an optimum using the conjugate gradient. If no optimum is found then you use the lowest point on the grid. |
Description
CONVERT_TO_FES is now a shortcut action in PLUMED 2.10 that uses CUSTOM to convert to take the negative logarithm of a histogram and to multiply that by k_B T. However, I made a mistake when adapting the MINTOZERO command to work with the new version of PLUMED. To be clear, the shortcut that does this calculation works like this:
Because I am too clever for my own good, FIND_GRID_MINIMUM uses spine interpolation and a conjugate gradient algorithm to find the coordinates of the actual minimum of the free energy surface. However, the earlier implementation of MINTOZERO just searched the value of the free energy on the various grid points, found the lowest and used that as the origin.
With this change, I have thus adjusted the shortcut so that if you use the MINTOZERO option, you just find the lowest free energy point on the grid and use that for the position of the origin. The behaviour with this option thus recovers what was done in old versions of the code.
If you want to do the actual minimisation, you can use the FINDMINTOZERO, which does the conjugate gradient minimisation.
In rt-fes-periodic there were two CONVERT_TO_FES commands that use the MINTOZERO option. I changed one of these commands to FINDMINTOZERO (this is the one where the reference is unchanged). For the other, I kept it as MINTOZERO and checked that the values that you get out with this option are the same as what they would be in older versions of PLUMED. I thus ensured that we are properly maintaining back compatibility.
Target release
I would like my code to appear in release 2.10
Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests