Daniel Russel wrote: > Here is my version of the harmonic. It removes the internal scaling > factors since those only make sense given various assumptions about the > system. Instead offers a function which allows you to compute the spring > constant from a standard deviation (and a temperature) if you want those > assumptions to hold.
Opinion differs on what the form of a harmonic function is - the CHARMM guys say the score is kx^2 (deriv 2kx) while the GROMOS guys use 0.5kx^2 (deriv kx). This patch is clearly wrong because it reports a score of kx^2 but a derivative of 0.5kx![*] The patch I committed as r471 uses the GROMOS convention, and explicitly states this in the headers so that there can be no confusion.
[*] Unfortunately this is missed by the unit tests right now because there is no way to overload return type in Python. (There is no way in C++ either - we overload the arguments instead - but SWIG converts both overloaded C++ functions to the same Python method.)
> No existing code meaningfully depended on the old behavior. The test code > has been patched.
Depends on what you mean by "meaningfully" I suppose. ;) But your patch breaks the Modeller tests, since they do assume standard deviation. But I fixed that in r471.
Ben