{"action":"created","issue":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/1702","repository_url":"https://api.github.com/repos/pandegroup/openmm","labels_url":"https://api.github.com/repos/pandegroup/openmm/issues/1702/labels{/name}","comments_url":"https://api.github.com/repos/pandegroup/openmm/issues/1702/comments","events_url":"https://api.github.com/repos/pandegroup/openmm/issues/1702/events","html_url":"https://github.com/pandegroup/openmm/issues/1702","id":197879118,"number":1702,"title":"Proposed API for CHARMM-like BLOCK nonbonded facility","user":{"login":"jchodera","id":3656088,"avatar_url":"https://avatars1.githubusercontent.com/u/3656088?v=4","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":[{"id":40372211,"url":"https://api.github.com/repos/pandegroup/openmm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":54,"created_at":"2016-12-28T16:25:34Z","updated_at":"2018-05-18T21:08:24Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@peastman and I discussed the potential for implementing something like the CHARMM [BLOCK](https://www.charmm.org/charmm/documentation/by-version/c40b1/params/doc/block/) facility for OpenMM to make it easier to implement things like Jana's [constant-pH lambda dynamics](10.1021/acs.jctc.6b00552) or the Brooks [multisite lambda dynamics](http://dx.doi.org/10.1021/ct200444f). While energy derivatives of global parameters are now available, the complexity of implementing the kind of potentials commonly used in lambda dynamics with the existing `Custom*Force` methods suggests it would be incredibly helpful to have a new way of specifying these global parameter-dependent interactions.\r\n\r\nThe simplest approach would be to define something like `NonbondedForce` that allows the `sigma`, `epsilon`, and `charge` parameters to optionally be defined in terms of linear combinations of groups of parameters. This way, we could support the same `NonbondedMethod` choices as `NonbondedForce`.\r\n\r\nThe parameters on a given atom would be computed as:\r\n```\r\ncharge  = charge_0  + \\sum_{n=1}^{Nblocks} parameter_n * charge_n\r\nsigma   = sigma_0   + \\sum_{n=1}^{Nblocks} parameter_n * sigma_n\r\nepsilon = epsilon_0 + \\sum_{n=1}^{Nblocks} parameter_n * epsilon_n\r\n```\r\nwhere `charge_0` is the constant component of the charge, `Nblocks` is the number of blocks that the particle appears in, `parameter_n` is the value of the global parameter for block `n`, and `charge_n` is the additive component of the charge defined for this particle in block `n`. Often, the `parameter_n` will defined in [0,1] and sum to 1, but there's no reason to require this.\r\n\r\nThe derivatives of the energy are straightforward to compute except for the PME reciprocal space energies, which Jana has conveniently derived in her recent [constant-pH lambda dynamics](10.1021/acs.jctc.6b00552) paper.\r\n\r\nHere's an example of what the new elements of the API could look like:\r\n```python\r\n# Create a new force object\r\nforce = NonbondedBlockForce()\r\n# Add constant components of charge, sigma, epsilon (which may all be zero)\r\nparticle_index = force.addParticle(charge, sigma, epsilon)\r\n...\r\n# Add constant components to exceptions (which may all be zero)\r\nexception_index = force.addException(particle1, particle2, chargeProd, sigma, epsilon)\r\n...\r\n# Now define a BLOCK of additive parameter contributions we will control with a global context parameter\r\n# Add a new block, defining its global context parameter name and default value\r\nglobal_parameter_name = 'block1_global_parameter_name'\r\ndefault_value = 0.0\r\nblock_index = force.addBlock(global_parameter_name, default_value)\r\n# Add a particle to the block, along with its additive contribution to charges\r\nforce.addParticleToBlock(block_index, particle_index, charge, sigma, epsilon) \r\n...\r\n# Define an additive contribution this block makes to exceptions\r\nforce.addExceptionToBlock(block_index, exception_index, chargeProd, sigma, epsilon)\r\n```\r\nWe'd also probably want some convenience accessors for modifying default global parameter values, modifying block particle parameters, etc.\r\n\r\nIt's useful to allow `sigma = 0` in this case, though I imagine at the time of building the actual force, any `sigma = 0` could simply be redefined to `sigma = 1` if `epsilon = 0`.\r\n\r\nTagging @lnaden who also has expertise in this area."},"comment":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/comments/390332863","html_url":"https://github.com/pandegroup/openmm/issues/1702#issuecomment-390332863","issue_url":"https://api.github.com/repos/pandegroup/openmm/issues/1702","id":390332863,"user":{"login":"peastman","id":4379786,"avatar_url":"https://avatars3.githubusercontent.com/u/4379786?v=4","gravatar_id":"","url":"https://api.github.com/users/peastman","html_url":"https://github.com/peastman","followers_url":"https://api.github.com/users/peastman/followers","following_url":"https://api.github.com/users/peastman/following{/other_user}","gists_url":"https://api.github.com/users/peastman/gists{/gist_id}","starred_url":"https://api.github.com/users/peastman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peastman/subscriptions","organizations_url":"https://api.github.com/users/peastman/orgs","repos_url":"https://api.github.com/users/peastman/repos","events_url":"https://api.github.com/users/peastman/events{/privacy}","received_events_url":"https://api.github.com/users/peastman/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T21:08:24Z","updated_at":"2018-05-18T21:08:24Z","author_association":"MEMBER","body":"Something like that.  I'm still debating about what the exact API should be, or even what to call these.  Parameter blocks?  Scaling parameters?  Block parameters?  I'm not sure."}}
{"actor":{"display_login":"peastman"}}