choderalab / chiron

Differentiable Markov Chain Monte Carlo
https://github.com/choderalab/chiron/wiki
MIT License
14 stars 1 forks source link

Unit treatment #31

Open chrisiacovella opened 6 months ago

chrisiacovella commented 6 months ago

I propose that we switch to openff-units, as this is a bit more extensible. The reason to use openmm-units was from initial convenience when working with openmmtools test systems. If we implement our own topology object and TestSuite (see #30 ), we will no longer have to worry about this dependency; openff-units also provides an easy means to convert to/from openmm-units for continued compatibility.

In this regard we also need to ensure that the reporters attach units to the given logged quantities.

In terms of where we retain units vs where we remove them, I think we should aim keep units attached until we absolutely need to remove them (e.g., in a jitted computation), but then appropriately re-attached. We are doing this in some locations, but it would greatly improve transparency in the code.

I think one specific place where we are not doing this is the SamplerState, as the getter functions strip units (presumably we did this for convenience inside computations, i.e., pre-stripping the units), but I think this might be poor form and lead to confusion.