{"action":"created","issue":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/906","labels_url":"https://api.github.com/repos/pandegroup/openmm/issues/906/labels{/name}","comments_url":"https://api.github.com/repos/pandegroup/openmm/issues/906/comments","events_url":"https://api.github.com/repos/pandegroup/openmm/issues/906/events","html_url":"https://github.com/pandegroup/openmm/issues/906","id":74797251,"number":906,"title":"Potential Issues with Nonbonded (LJ) force?","user":{"login":"kyleabeauchamp","id":1900459,"avatar_url":"https://avatars.githubusercontent.com/u/1900459?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleabeauchamp","html_url":"https://github.com/kyleabeauchamp","followers_url":"https://api.github.com/users/kyleabeauchamp/followers","following_url":"https://api.github.com/users/kyleabeauchamp/following{/other_user}","gists_url":"https://api.github.com/users/kyleabeauchamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleabeauchamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleabeauchamp/subscriptions","organizations_url":"https://api.github.com/users/kyleabeauchamp/orgs","repos_url":"https://api.github.com/users/kyleabeauchamp/repos","events_url":"https://api.github.com/users/kyleabeauchamp/events{/privacy}","received_events_url":"https://api.github.com/users/kyleabeauchamp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":65,"created_at":"2015-05-10T00:58:29Z","updated_at":"2015-05-19T14:13:24Z","closed_at":null,"body":"So I've been implementing and debugging various hamiltonian monte carlo methods.  For most systems, my methods seem to be working, as measured by comparing the expected value of the potential energy with a HMCIntegrator and a LangevinIntegrator (with small timestep).  However, I find that for a periodic system of Lennard Jones particles, HMC and Langevin are giving answers that are statistically different, with differences of several KJ / mol.  \r\n\r\nThis difference depends strongly on the cutoff.  For example, a cutoff of ~2.5 sigma (the LJ radius) gives errors of ~5 KJ / mol (relative error: 1E-3).  A cutoff of 3 sigma gives errors of ~2 KJ / mol (relative error 5E-4).  A cutoff of 3.5 sigma gives errors that are undetectable. \r\n\r\nResults for the three different cutoff lengths are below.   With the CUDA platform on a GTX Titan.  I've actually tried all three precision levels, with no major differences AFAIK.  The average potential energy is given in the column \"mu\".  \r\n\r\n\r\n```\r\n         sysname          integrator           mu    stderr           Neff  timestep\r\n18         ljbox  LangevinIntegrator -3835.804623  0.070364    6263.192065     2.000\r\n11         ljbox       HMCIntegrator -3837.672160  0.024726   50483.297078    16.000\r\n2      longljbox  LangevinIntegrator -3916.681236  0.059387    8645.740209     2.000\r\n0      longljbox       HMCIntegrator -3916.522774  0.022949   58144.505627    16.000\r\n19    shortljbox  LangevinIntegrator -3613.987124  0.158612    1301.501161     1.333\r\n20    shortljbox       HMCIntegrator -3619.623843  0.267620     428.535579    16.000\r\n```\r\n\r\n\r\nGiven how HMC works, the two most obvious culprit is perhaps the force for periodic nonbonded forces is not exactly the the gradient of the energy.  However, I have not been able to quantify or support this claim, so I really have no idea what's actually going on.  There could also be a bug in my HMC code as well, or cosmic rays.  \r\n\r\nPS: similar system with a non-periodic cluster of ~500 LJ particles in a harmonic restraining well does not exhibit the same energy differences---I tried with both no cutoff and a short cutoff.  \r\n\r\nPS: this is all with NVT, although I did play with the dispersion correction which had no effect."},"comment":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/comments/103514126","html_url":"https://github.com/pandegroup/openmm/issues/906#issuecomment-103514126","issue_url":"https://api.github.com/repos/pandegroup/openmm/issues/906","id":103514126,"user":{"login":"swails","id":779022,"avatar_url":"https://avatars.githubusercontent.com/u/779022?v=3","gravatar_id":"","url":"https://api.github.com/users/swails","html_url":"https://github.com/swails","followers_url":"https://api.github.com/users/swails/followers","following_url":"https://api.github.com/users/swails/following{/other_user}","gists_url":"https://api.github.com/users/swails/gists{/gist_id}","starred_url":"https://api.github.com/users/swails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swails/subscriptions","organizations_url":"https://api.github.com/users/swails/orgs","repos_url":"https://api.github.com/users/swails/repos","events_url":"https://api.github.com/users/swails/events{/privacy}","received_events_url":"https://api.github.com/users/swails/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T14:13:24Z","updated_at":"2015-05-19T14:13:24Z","body":"> I think this can already be done with a tiny modification to my existing HMC RESPA code:\r\n> \r\n> Make a copy of the nonbonded force\r\n> Lower the accuracy of the copy\r\n> Make the copy a separate force group\r\n> Exclude the high-accuracy force group from the integration steps and exclude the low-accuracy force group from the energy calculation.\r\n\r\nI don't think this is going to work.  For the GPU platforms, all nonbonded kernels are coalesced into the same nonbond loop, requiring that all forces have the same cutoff and same group ID.\r\n\r\nIIRC, this limitation does *not* apply to the Reference (and by extension CPU) platform, but it'll hit you when you go to CUDA or OpenCL.\r\n\r\nIt's for reasons like this that I mentioned the FR of different nonbonded forces being allowed in different groups in the Omnia call yesterday."}}