A high-performance differentiable molecular dynamics and forcefield engine.
- Interpolated nonbonded softcore potentials are implemented via 4D decoupling.
- Computes derivatives of the observables with respect to forcefield parameters.
- No constraints (HMR is needed to increase step size)
- Explicit solvent is supported by reaction field, not PME
We currently support the following functional forms. Parameters that can be optimized are listed in parentheses.
- HarmonicBond (force constant, bond length)
- HarmonicAngle (force constant, ideal angle)
- PeriodicTorsion (force constant, phase, periodicity)
- PBC LennardJones 612 (sigma, epsilon)
- PBC reaction field electrostatics (charge)
- RDKit
- OpenEye Toolkits
- OpenMM
- Cuda 12.4+
- CMake 3.24.3
If using conda the following can be used to configure your environment
conda env create -f environment.yml -n timemachine
conda activate timemachine
The CUDA extension module implementing custom ops is only supported on Linux, but partial functionality is still available on non-Linux OSes.
pip install -r requirements.txt
pip install .
pip install -r requirements.txt
pip install -e .
Possible variants of the last step include
pip install -e .[dev,test] # optionally install dev and test dependencies
CMAKE_ARGS=-DCUDA_ARCH=86 pip install -e . # override CUDA_ARCH
SKIP_CUSTOM_OPS=1 pip install -e . # skip building CUDA extension, no effect on non-Linux OSes
To rebuild the extension module after making changes to the C++/CUDA code, either rerun
pip install -e .
or
make build # Must have installed dev dependencies for this to work
DEBUG_BUILD=true make build # Disable optimizations and build with debugging information
To run tests that use openeye
, ensure that either OE_LICENSE
or OE_DIR
are set appropriately.
For example, starting from a clean environment with the openeye license file in ~/.openeye
:
OE_DIR=~/.openeye pytest -xsv tests/
Note: we currently only support and test on python 3.10, use other versions at your own peril.
Most of the training is using the correctable charge corrections ccc forcefield, which is SMIRNOFF 1.1.0 augmented with BCCs ported via the recharge project. There are some additional modifications:
- The charges have been multiplied by sqrt(ONE_4PI_EPS0) as an optimization.
- The eps parameter in LJ have been replaced by an alpha such that alpha^2=eps in order to avoid negative eps values during training.
- We use a consistent 0.5 scaling for the 1-4 terms across LJ and electrostatics.
- The reaction field used is the real part of PME with a beta (alpha) coefficient of 2.0
- The recharge BCC port is not yet complete, as there are some missing types that will cause very large errors (eg. P=S moieties).
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.