{"action":"created","issue":{"url":"https://api.github.com/repos/choderalab/perses/issues/222","repository_url":"https://api.github.com/repos/choderalab/perses","labels_url":"https://api.github.com/repos/choderalab/perses/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/choderalab/perses/issues/222/comments","events_url":"https://api.github.com/repos/choderalab/perses/issues/222/events","html_url":"https://github.com/choderalab/perses/issues/222","id":163765596,"number":222,"title":"NaNs encountered with GHMC NCMC","user":{"login":"jchodera","id":3656088,"avatar_url":"https://avatars.githubusercontent.com/u/3656088?v=3","gravatar_id":"","url":"https://api.github.com/users/jchodera","html_url":"https://github.com/jchodera","followers_url":"https://api.github.com/users/jchodera/followers","following_url":"https://api.github.com/users/jchodera/following{/other_user}","gists_url":"https://api.github.com/users/jchodera/gists{/gist_id}","starred_url":"https://api.github.com/users/jchodera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchodera/subscriptions","organizations_url":"https://api.github.com/users/jchodera/orgs","repos_url":"https://api.github.com/users/jchodera/repos","events_url":"https://api.github.com/users/jchodera/events{/privacy}","received_events_url":"https://api.github.com/users/jchodera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-05T03:24:53Z","updated_at":"2016-09-19T22:20:36Z","closed_at":null,"body":"I'm still seeing `nan`s with the current GHMC NCMC implementation, which should never happen. For a simple `benzene <--> napthalene` transformation, I encountered this:\r\n```\r\n................................................................................\r\nUpdating chemical state with ncmc-geometry-ncmc scheme...\r\nProposing new topology...\r\nProposed transformation: c1ccc(cc1)N => CC(=O)CSc1cccs1\r\nGenerating new system...\r\nPerforming NCMC annihilation\r\nGeometry engine proposal...\r\nproposal took 1.393 s\r\nGeometry engine logP_reverse calculation...\r\ncalculation took 1.449 s\r\nPerforming NCMC insertion\r\nTraceback (most recent call last):\r\n  File \"perses/tests/testsystems.py\", line 2106, in <module>\r\n    run_fused_rings()\r\n  File \"perses/tests/testsystems.py\", line 2097, in run_fused_rings\r\n    testsystem.designer.run(niterations=5)\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 1181, in run\r\n    self.update()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 1163, in update\r\n    self.update_samplers()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 1124, in update_samplers\r\n    sampler.update()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 1032, in update\r\n    self.update_sampler()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 996, in update_sampler\r\n    self.sampler.update()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 863, in update\r\n    self.update_state()\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/samplers/samplers.py\", line 789, in update_state\r\n    [ncmc_new_positions, ncmc_introduction_logp, potential_insert] = self.ncmc_engine.integrate(topology_proposal, geometry_new_positions, direction='insert', iteration=self.iteration)\r\n  File \"/Users/choderaj/miniconda/lib/python2.7/site-packages/perses/annihilation/ncmc_switching.py\", line 419, in integrate\r\n    raise NaNException(msg)\r\nperses.annihilation.ncmc_switching.NaNException: Particle coordinate is nan during NCMC integration while using integrator_type 'GHMC'\r\nThis should NEVER HAPPEN with GHMC!\r\n```\r\nI'm not quite sure how this can happen unless [something is wrong with this logic](https://github.com/choderalab/perses/blob/master/perses/annihilation/ncmc_switching.py#L578-L582).  There is also a [`select`](http://docs.openmm.org/7.0.0/api-python/generated/simtk.openmm.openmm.CustomIntegrator.html#simtk.openmm.openmm.CustomIntegrator) alternative to `beginIfBlock`s, but the issue may lie with whether `nan` energies really result in [this line](https://github.com/choderalab/perses/blob/master/perses/annihilation/ncmc_switching.py#L578) giving `accept = 1`."},"comment":{"url":"https://api.github.com/repos/choderalab/perses/issues/comments/248145406","html_url":"https://github.com/choderalab/perses/issues/222#issuecomment-248145406","issue_url":"https://api.github.com/repos/choderalab/perses/issues/222","id":248145406,"user":{"login":"jchodera","id":3656088,"avatar_url":"https://avatars.githubusercontent.com/u/3656088?v=3","gravatar_id":"","url":"https://api.github.com/users/jchodera","html_url":"https://github.com/jchodera","followers_url":"https://api.github.com/users/jchodera/followers","following_url":"https://api.github.com/users/jchodera/following{/other_user}","gists_url":"https://api.github.com/users/jchodera/gists{/gist_id}","starred_url":"https://api.github.com/users/jchodera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchodera/subscriptions","organizations_url":"https://api.github.com/users/jchodera/orgs","repos_url":"https://api.github.com/users/jchodera/repos","events_url":"https://api.github.com/users/jchodera/events{/privacy}","received_events_url":"https://api.github.com/users/jchodera/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T22:20:36Z","updated_at":"2016-09-19T22:20:36Z","body":"That's because I removed the first velocity Verlet step from the GHMCIntegrator. If we added it back (which is necessary for correctness) it still gives NaNs. We still need to get to the bottom of that issue, but I haven't yet been able to produce a minimal example that demonstrates the issue."}}
{"actor":{"display_login":"jchodera"}}