Closed badisa closed 1 month ago
Had attempted to do this by looking at the parameters, but seems more error prone and was not immediately obvious how to handle NonbondedPairListPrecomputed parameters.
I would push back here and say that using the atom mapping seems more error prone. I.e. it seems like the source of truth for whether atoms are interacting should be the potential parameters? Otherwise a bug or some change in the parameterization logic might lead us to think that interacting atoms are noninteracting here.
Had attempted to do this by looking at the parameters, but seems more error prone and was not immediately obvious how to handle NonbondedPairListPrecomputed parameters.
I would push back here and say that using the atom mapping seems more error prone. I.e. it seems like the source of truth for whether atoms are interacting should be the potential parameters? Otherwise a bug or some change in the parameterization logic might lead us to think that interacting atoms are noninteracting here.
For the cases of solvent and complex it is straightforward since each atom has a single parameter in the params (how I originally did it in https://github.com/proteneer/timemachine/pull/1338/commits/88a8b1821625092d52893a9d0a85e56f964222aa). In the case of vacuum where there is a NonbondedPairlistPrecomputed there are only delta_w coords which makes it difficult to reconstruct which atoms are actually dummy. Could refactor out the code in https://github.com/proteneer/timemachine/blob/master/timemachine/fe/single_topology.py#L1261-L1278 but at the moment this seems pre-mature since we always have it so that dummy atoms are non-interacting in all states but the dummy atom respective end state.
Random thought: another approach to detecting noninteracting atoms might be to look at where $\partial U_{\text{nb}} / \partial x$ is zero. I'm not sure if this would be a simpler/more robust approach?
Random thought: another approach to detecting noninteracting atoms might be to look at where ∂Unb/∂x is zero. I'm not sure if this would be a simpler/more robust approach?
Don't know that that is always true. If you had a long chain of dummy atoms, think they could still have ∂Unb/∂x != 0.0 due to interacting with the other dummy atoms that are non-interacting. I would also like to avoid having to run potentials to determine which atoms are interacting or not.
Had attempted to do this by looking at the parameters, but seems more error prone and was not immediately obvious how to handle NonbondedPairListPrecomputed parameters.
I would push back here and say that using the atom mapping seems more error prone. I.e. it seems like the source of truth for whether atoms are interacting should be the potential parameters? Otherwise a bug or some change in the parameterization logic might lead us to think that interacting atoms are noninteracting here.
For the cases of solvent and complex it is straightforward since each atom has a single parameter in the params (how I originally did it in 88a8b18). In the case of vacuum where there is a NonbondedPairlistPrecomputed there are only delta_w coords which makes it difficult to reconstruct which atoms are actually dummy. Could refactor out the code in https://github.com/proteneer/timemachine/blob/master/timemachine/fe/single_topology.py#L1261-L1278 but at the moment this seems pre-mature since we always have it so that dummy atoms are non-interacting in all states but the dummy atom respective end state.
Ah OK, I think I've got it now (also after some offline discussion): I was initially tripped up by the sense in which we're using "noninteracting" here, here I think we mean "having no interaction with the core (and environment, if present)". And as @badisa said above, that's easy to determine for the potentials that are parameterized with a $w$ coordinate per atom, but not obvious how to tell which atom in a pair with 4-d offset $w$ is in the core if you don't have the atom mapping.
InitialState
to store theAtomMapMixin
(or really the SingleTopology). Still allows unpickling older files since the field is optional.run_vacuum
.The definition of interacting atoms is entirely determined by the atom mapping