Skip to content

Commit

Permalink
Merge 1.0.0-development branch to devel branch. (#129)
Browse files Browse the repository at this point in the history
* Fix mbar example (#76)

* Add requirement of mdtraj, optax and pymbar to the doc

* Fix benzen demo (#75)

* Add Gitee_mirror

* Fix mirror CI/CD

* Update ben-prm.xml

Co-authored-by: Yingze Wang <[email protected]>
Co-authored-by: Roy-Kid <[email protected]>
Co-authored-by: KuangYu <[email protected]>
Co-authored-by: Jichen Li <[email protected]>
Co-authored-by: crone <[email protected]>
Co-authored-by: Yuzhi Zhang <[email protected]>

* Remove jax_md requirement to support high version of jax & tensorflow

* Initialize topology information generator and its UT

* Half way of detecting propers

* Finish proper searching

* Update topology.py

* Update topology.py

* Auto detect impropers

* Update topology.py

* Initialize template IO

* Remove jax version limitation

* Finish atom type matching with templates

* Initialize UT for topology tools

* Upload auto workflow for UT

* Add issue templates for feature request and bug-report (#83)

* Small update in issue template (#84)

* Add issue templates for feature request and bug-report

* Update issue template

* Update initial version of frontend impl & unit tests

* Modify new code to fit old parts

* Make the structure clean

* Update code

* Finished adding vsite from template and smarts parsers

* Support VSite IO in xml template

* Support vsite in template matching

* Add example

* Add example of vsite addition

* Try a better implementation

* Implement a better Topology

* Update bettertopology.py

* Designed the usage of operators

* Update our own Topology class

* Update test_operators.py

* Update test_operators.py

* Implement VSite and AType operators

* Create smartsvsite.py

* Update am1charge.py

* Update test_operators.py

* Add AM1 charge OP

* Add Coulomb Generator

* supporting generators

* Add method to find equivalent atoms (without vsites)

* Let AM1 charge calculator use eqv info

* Add full support of BCC charge

* Support ambertools based typification

* Update classical.py

* Add LJ generator and an example

* support LJ prms

* Deal with atom classes in LJ

* Add water example for interaction calculation

* Update test_inter_water.py

* Add support for loading BCC prms

* Update classical.py

* Finish BCC support

* support type2 vsite

* Make operators use the same initialization method

* Support smirks patching on vsites.

* Finished dimer energy example

* Update classical.py

* Update topology.py

* Fix ParamSet to be a correct PyTree

* Update paramset.py

* Calculate test system by hand

* Add test case for NoCutoff Coul and LJ energy

* Support NBFix

* Add Hamiltonian and its unittest.

* Delete test.xml

* update vsite positions in hamiltonian

* replace Chem.SanitizeMol with topdata.regularize_aromaticity

* fix N+ formal charge

* Update .gitignore

* Update topology.py

* Support the way of updating paramset in optax

* Update test_run_dimer_energy.py

* Initialize generators before loading hamiltonian

* add warmup and nesterov optimizer

* fix 3fd vsite coordinates

* Add mask generation

* build vsites in multiple molecules separately

* support dummy atom reading

* fix vsite topologies and molecules

* Init new example

* Support Parmed LJ modifier

* Update example for lennard jones optimization

* Create simpler MBAR estimator

* Add reweighting estimator

* Update opt.ipynb

* Update opt.ipynb

* Update opt.ipynb

* Add a simple example to calculate lennard-jones potential

* Add openmm as reference

* Pearl dingzhen patch 1 (#112)

* Update classical.py

Add NBFixPair support for LJ potential

* Update inter.py

add support for LJ nbfixpair

* Update inter.py

change eps_mat at (_map[1], _map[0])

* Update inter.py

* Remove Jax-MD requirement

* Fix Hamiltonian

* Add HarmonicAngleGenerator

* Add PeriodicTorsionGenerator

* Update NonbondedForce

* Correct the order of improper matching

* Fix and update unittests.

* Update unit-test workflow to fix requirement problem

* Update test_compute.py

* Update ut.yml

* Update ut.yml

* Add generator for ADMPPmeForce

* Merge changes on devel branch

* Update test_compute.py

* Support LJ long range correction

* Add generators for Slater type forces

* Update ut.yml

* Update ut.yml

* Fix No-AxisType bug (#122)

* add rules of local axis for NoAxisType

* add test for NoAxisType

---------

Co-authored-by: plumbum082 <[email protected]>

* qeq merge (#124)

* add qeqforce and QeqQenerator, modify CoulmbGenerator

* ethresh modified

* add refresh in qeq.py

* Add sGNN generator
fixed a few problems in ADMPPmeGenerator

* remove debugging codes

* Add frontend for sGNN (#125)

* Add sGNN generator
fixed a few problems in ADMPPmeGenerator

* remove debugging codes

* Modified QEQ potential and add JIT support

* Fix the two examples:
* fluctuated_leading_term_waterff
* peg_slater_isa
Make map_atomtype and map_poltype available in generator

* Add QEQ test

* Add jaxopt requirement in github workflow

* Update qeq.py

* Fix the jupyter notebook

* Support aux data for ADMP and QEQ

* Clean the way of aux_data implementation

* Add new unit test for QEQ with two residues.

* Change jaxopt root finder to be jit-able

* Update ut.yml

* Explicit support nopbc calculation

* Update admp.py

* make the behavior of ADMP correct while using NoCutoff

* Upload

* Update pme.py

* Add frontend for EANN (#127)

* Change default scale setting of ADMP to reproduce MPID

* Update pme.py

* Fix optimizers for v1.0.0

* Fix nan problem while calculate power(0.0, 1/6)

* Add esp calculator in ADMPPmeForce and CoulNoCutoffForce for noPBC systems

* Fix the ADMP ESP calculator and add unit test

* Update pme.py

* Use std library warnings to handle import errors

* Add eta to increase the numerical stability of QEQ

* Fix the local frame axis setting in ADMP to be consistent with MPID

* Correct local frame defination in unit test

* Update fluctuated_leading_term_waterff and water_fullpol example

* Save ADMP type mapping to potential.meta

* Fix the ADMP examples, also improve the way map_atomtypes and
map_poltypes are accessed.

* Break a long line in code

* Fix the ADMP aux test

* docs_review

* Fix examples (#130)

* Add sGNN generator
fixed a few problems in ADMPPmeGenerator

* remove debugging codes

* Fix the two examples:
* fluctuated_leading_term_waterff
* peg_slater_isa
Make map_atomtype and map_poltype available in generator

* Fix the jupyter notebook

* Update fluctuated_leading_term_waterff and water_fullpol example

* Fix the ADMP examples, also improve the way map_atomtypes and
map_poltypes are accessed.

* Break a long line in code

* Fix the ADMP aux test

* Update Installation.md

* modifications to intro

* Update introduction.md

* Update index.md

* Test modifying the MBAR.md file

* Update MBAR doc

* Update doc

* Update 4.2ADMPPmeForce.md

* Update 4.2ADMPPmeForce.md

* Update 4.4MLForce.md

* Update Optimization doc

* Update 4.6MBAR.md

* Update 4.5Optimization.md

* Update 4.5Optimization.md

* add nocutoff and noperioid nblist

* Update 3.usage.md

* Update 4.3ADMPQeqForce.md

* update 4.3ADMPQeqForce.md

* docs/examples fix (#140)

* DMC_fix

* udpate gitignore and delete .idea cache

---------

Co-authored-by: Yingze Wang <[email protected]>

* Update omm plugin and save_dmff2tf.py for aux (U_ind especially) compatible. (#135)

* Add issue templates for feature request and bug-report

* Add script for dmff model saving.

* Remove issue template from devel branch.

* debug workflow

* remove debug

* Update ut.yml. Install mdtraj by conda.

* Add openmm dmff plugin to backend

* Update .gitignore

* Add test workflow for openmm dmff plugin

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Specific setuptools version in workflow yaml

* Update tensorflow version

* Enable double precision in test omm dmff plugin workflow

* update nve assert checking in omm dmff plugin workflow

* Fix no axis type bug (#120)

* add rules of local axis for NoAxisType

* add test for NoAxisType

* Update omm plugin and save_dmff2tf.py for aux compatible.

* Fix test issue.

* Update test_openmm_dmff_plugin.yml

---------

Co-authored-by: plumbum082 <[email protected]>

* Delete docs/dev_guide/arch.md (#141)

* review qeq docs and update the math display error (#139)

Co-authored-by: WangXinyan940 <[email protected]>

* Create 4.7OpenMMplugin.md

* Update 4.3ADMPQeqForce.md

* Update 4.3ADMPQeqForce.md (#150)

* Update README.md (#147)

* Update the doc for openmm dmff plugin usage. (#146)

* Add issue templates for feature request and bug-report

* Add script for dmff model saving.

* Remove issue template from devel branch.

* debug workflow

* remove debug

* Update ut.yml. Install mdtraj by conda.

* Add openmm dmff plugin to backend

* Update .gitignore

* Add test workflow for openmm dmff plugin

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Specific setuptools version in workflow yaml

* Update tensorflow version

* Enable double precision in test omm dmff plugin workflow

* update nve assert checking in omm dmff plugin workflow

* Fix no axis type bug (#120)

* add rules of local axis for NoAxisType

* add test for NoAxisType

* Update omm plugin and save_dmff2tf.py for aux compatible.

* Fix test issue.

* Update test_openmm_dmff_plugin.yml

* Update the doc for openmm dmff plugin usage

* Revision on the doc of DMFF plugin

* Upload tf c directory.

* Remove tf2.9.1_c.tar

---------

Co-authored-by: plumbum082 <[email protected]>

* add 2 notebooks in user guide (#145)

* DMC_fix

* udpate gitignore and delete .idea cache

* Add files via upload

* Update README.md

* Update README.md

* Add files via upload

---------

Co-authored-by: Yingze Wang <[email protected]>

* Fix bug when rendering xml files

* Update the doc link in OpenMMPlugin doc (#151)

* Add issue templates for feature request and bug-report

* Add script for dmff model saving.

* Remove issue template from devel branch.

* debug workflow

* remove debug

* Update ut.yml. Install mdtraj by conda.

* Add openmm dmff plugin to backend

* Update .gitignore

* Add test workflow for openmm dmff plugin

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Update workflow for openmm dmff plugin test.

* Specific setuptools version in workflow yaml

* Update tensorflow version

* Enable double precision in test omm dmff plugin workflow

* update nve assert checking in omm dmff plugin workflow

* Fix no axis type bug (#120)

* add rules of local axis for NoAxisType

* add test for NoAxisType

* Update omm plugin and save_dmff2tf.py for aux compatible.

* Fix test issue.

* Update test_openmm_dmff_plugin.yml

* Update the doc for openmm dmff plugin usage

* Revision on the doc of DMFF plugin

* Upload tf c directory.

* Remove tf2.9.1_c.tar

* Update doc link in OpenMM plugin

---------

Co-authored-by: plumbum082 <[email protected]>

---------

Co-authored-by: Yingze Wang <[email protected]>
Co-authored-by: Roy-Kid <[email protected]>
Co-authored-by: KuangYu <[email protected]>
Co-authored-by: Jichen Li <[email protected]>
Co-authored-by: crone <[email protected]>
Co-authored-by: Yuzhi Zhang <[email protected]>
Co-authored-by: Ye Ding <[email protected]>
Co-authored-by: Ye Ding <[email protected]>
Co-authored-by: Wang Xinyan <[email protected]>
Co-authored-by: Junhan Chang <[email protected]>
Co-authored-by: pearlDingzhen <[email protected]>
Co-authored-by: plumbum082 <[email protected]>
Co-authored-by: Haichao Huang <[email protected]>
Co-authored-by: Junmin <[email protected]>
Co-authored-by: VINFeng <[email protected]>
Co-authored-by: Zheng Cheng <[email protected]>
Co-authored-by: Roy Kid <[email protected]>
Co-authored-by: gust-07 <[email protected]>
Co-authored-by: plumbum082 <[email protected]>
Co-authored-by: Taiping Hu <[email protected]>
  • Loading branch information
21 people authored Nov 9, 2023
1 parent e0877ee commit cfeffeb
Show file tree
Hide file tree
Showing 271 changed files with 72,332 additions and 24,163 deletions.
73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Bug report
description: Create a bug report to help us eliminate issues and improve DMFF.
title: "[BUG] _Replace With Suitable Title_"
labels: bug
assignees: []
body:
- type: textarea
id: summary
attributes:
label: Bug summary
description: Please provide a clear and concise description of what the bug is.
placeholder:
value:
validations:
required: true
- type: input
id: version
attributes:
label: DMFF Version
description: Version of DMFF you are using.
validations:
required: true
- type: input
id: jax-version
attributes:
label: JAX Version
description: Version of JAX you are using.
validations:
required: true
- type: input
id: openmm-version
attributes:
label: OpenMM Version
description: Version of OpenMM you are using.
validations:
required: true
- type: dropdown
id: installation-way
attributes:
label: How did you download the software?
options:
- pip
- Built from source
- Others (write below)
validations:
required: true
- type: textarea
id: log
attributes:
label: Input Files, Running Commands, Error Log, etc.
description: "Please provide necessary information including input file, running commands, error log , etc., AS DETAILED AS POSSIBLE to help locate and reproduce your problem. WARNING: Do not use image to show error log! Paste texts in a code block instead."
placeholder:
value:
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce
description: "Describe the steps required to (quickly) reproduce the issue. You can attach (small) files to the section below or add URLs where to download an archive with all necessary files. Please try to create an input set that is as minimal and small as possible and reproduces the bug as quickly as possible. **NOTE:** the less effort and time it takes to reproduce your reported bug, the more likely it becomes, that somebody will look into it and fix the problem."
placeholder:
value:
validations:
required: true
- type: textarea
id: further
attributes:
label: Further Information, Files, and Links
description: Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications
placeholder:
value:
validations:
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Request for Help
url: https://github.com/deepmodeling/DMFF/issues
about: If you have a usage question
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Feature request
description: Suggest an idea for DMFF.
title: "[Feature Request] _Replace with Title_"
labels: enhancement
assignees: []
body:
- type: textarea
id: summary
attributes:
label: Summary
description: "Please provide a brief and concise description of the suggested feature or change"
placeholder:
value:
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: "Please explain why you think this feature is important and should be implemented. If possible, provide references to relevant background information like publications or web pages, and whether you are planning to implement the enhancement yourself or would like to participate in the implementation. If applicable add a reference to an existing bug report or issue that this will address."
placeholder:
value:
validations:
required: true
- type: textarea
id: solutions
attributes:
label: Suggested Solutions
description: "Please describe possible solutions to the problem. If you have a specific idea in mind, please describe it here. If you don't have a specific idea, please describe what you think would be a good solution to the problem."
placeholder:
value:
validations:
required: false
- type: textarea
id: further
attributes:
label: Further Information, Files, and Links
description: Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications. If you have any further questions, please don't hesitate to ask them here. Any comments are welcomed!
placeholder:
value:
validations:
required: false
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/generic-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Generic issue
description: For issues that do not fit any of the other categories.
title: _Replace With a Descriptive Title_
labels: wontfix
assignees: []
body:
- type: textarea
id: summary
attributes:
label: Summary
description: "Please provide a clear and concise description of what the question is."
placeholder:
value:
validations:
required: true
- type: input
id: version
attributes:
label: DMFF Version
description: Version of DMFF you are using.
validations:
required: true
- type: input
id: jax-version
attributes:
label: JAX Version
description: Version of JAX you are using.
validations:
required: true
- type: input
id: openmm-version
attributes:
label: OpenMM Version
description: Version of OpenMM you are using.
validations:
required: true
- type: textarea
id: other-version
attributes:
label: Python Version, CUDA Version, GCC Version, Operating System Version etc
description: "If applicable, specify what platform you are running on."
placeholder:
value:
validations:
required: false
- type: textarea
id: details
attributes:
label: Details
description: "Please explain the issue in detail here."
placeholder:
value:
validations:
required: true
7 changes: 4 additions & 3 deletions .github/workflows/test_openmm_dmff_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ jobs:
export OPENMM_INSTALLED_DIR=$CONDA_PREFIX
export CPPFLOW_INSTALLED_DIR=$CONDA_PREFIX
export LIBTENSORFLOW_INSTALLED_DIR=$CONDA_PREFIX
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR} -DUSE_HIGH_PRECISION=ON
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR} -DUSE_HIGH_PRECISION=OFF
make && make install
make PythonInstall
make PythonInstall
- name: Run Tests
run: |
source $CONDA/bin/activate dmff_omm
python -m OpenMMDMFFPlugin.tests.test_dmff_plugin_nve -n 100
cd ${GITHUB_WORKSPACE}/backend/
python -m OpenMMDMFFPlugin.tests.test_dmff_plugin_nve -n 100 --pdb ../examples/water_fullpol/water_dimer.pdb --model ./openmm_dmff_plugin/python/OpenMMDMFFPlugin/data/admp_water_dimer_aux --has_aux True
14 changes: 7 additions & 7 deletions .github/workflows/ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
- name: Install Dependencies
run: |
source $CONDA/bin/activate
conda create -n dmff -y python=${{ matrix.python-version }} numpy openmm==7.7.0 mdtraj=1.9.7 pytest rdkit biopandas openbabel -c conda-forge
conda create -n dmff -y python=${{ matrix.python-version }} numpy openmm==7.7.0 pytest rdkit openbabel mdtraj ambertools -c conda-forge
conda activate dmff
pip install --upgrade pip
pip install jax==0.3.15 jaxlib==0.3.15 jax_md==0.2.0 pymbar==4.0.1 chex==0.1.4 dm-haiku==0.0.7 tqdm
pip install jax jaxlib jaxopt networkx parmed pymbar==4.0.1 optax tqdm
- name: Install DMFF
run: |
source $CONDA/bin/activate dmff && pip install .
- name: Run Tests
run: |
source $CONDA/bin/activate dmff
pytest -vs tests/test_classical/*
pytest -vs tests/test_common/*
pytest -vs tests/test_admp/*
pytest -vs tests/test_api.py
pytest -vs tests/test_classical/test_*
pytest -vs tests/test_common/test_*
pytest -vs tests/test_admp/test_*
pytest -vs tests/test_utils.py
pytest -vs tests/test_mbar/*
pytest -vs tests/test_mbar/test_*
pytest -vs tests/test_sgnn/test_*
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -785,3 +785,10 @@ FodyWeavers.xsd

# hmtff cache
*.hmtff/

# debugging ipynb
debug.ipynb
test.xml

# PyCharm Cache
.idea/
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DMFF

[![doi:10.26434/chemrxiv-2022-2c7gv](https://img.shields.io/badge/DOI-10.26434%2Fchemrxiv--2022--2c7gv-blue)](https://doi.org/10.26434/chemrxiv-2022-2c7gv)
[![DOI: 10.1021/acs.jctc.2c01297](https://img.shields.io/badge/DOI-10.1021%2Facs.jctc.2c01297-blue)](https://pubs.acs.org/doi/10.1021/acs.jctc.2c01297)

## About DMFF

Expand All @@ -10,24 +10,34 @@ The behavior of organic molecular systems (e.g., protein folding, polymer struct

### License and credits

The project DMFF is licensed under [GNU LGPL v3.0](LICENSE). If you use this code in any future publications, please cite this using `Wang X, Li J, Yang L, Chen F, Wang Y, Chang J, et al. DMFF: An Open-Source Automatic
Differentiable Platform for Molecular Force Field
Development and Molecular Dynamics
Simulation. ChemRxiv. Cambridge: Cambridge Open Engage; 2022; This content is a preprint and has not been peer-reviewed.`
The project DMFF is licensed under [GNU LGPL v3.0](LICENSE). If you use this code in any future publications, please cite this using `Xinyan Wang, Jichen Li, Lan Yang, Feiyang Chen, Yingze Wang, Junhan Chang, Junmin Chen, Wei Feng, Linfeng Zhang, and Kuang Yu
Journal of Chemical Theory and Computation 2023 19 (17), 5897-5909
DOI: 10.1021/acs.jctc.2c01297`

## User Guide

+ [1. Introduction](docs/user_guide/introduction.md)
+ [2. Installation](docs/user_guide/installation.md)
+ [3. Basic usage](docs/user_guide/usage.md)
+ [4. XML format force field](docs/user_guide/xml_spec.md)
+ [5. Theory](docs/user_guide/theory.md)
+ [1. Introduction](docs/user_guide/1.introduction.md)
+ [2. Installation](docs/user_guide/2.installation.md)
+ [3. Basic Usage](docs/user_guide/3.usage.md)
+ [4. Modules](docs/user_guide/4.modules.md)
+ [Classical](docs/user_guide/4.1classical.md)
+ [ADMP](docs/user_guide/4.2ADMPPmeForce.md)
+ [Qeq](docs/user_guide/4.3ADMPQeqForce.md)
+ [Machine Learning](docs/user_guide/4.4MLForce.md)
+ [Optimization](docs/user_guide/4.5Optimization.md)
+ [Mbar Estimator](docs/user_guide/4.6MBAR.md)
+ [OpenMM Plugin](docs/user_guide/4.7OpenMMplugin.md)
+ [5. Advanced examples](docs/user_guide/DMFF_example.ipynb)
+ [And here is a tutorial notebook of the basic usage of DMFF. Welcome to read it and get started with DMFF!](docs/user_guide/test.ipynb)

[And here is a tutorial notebook, which would tell you some basic usage of DMFF. Welcome to read it and get started witn DMFF!](docs/user_guide/test.ipynb)

## Developer Guide
+ [1. Introduction](docs/dev_guide/introduction.md)
+ [2. Software architecture](docs/dev_guide/arch.md)
+ [3. Coding conventions](docs/dev_guide/convention.md)
+ [4. Document writing](docs/dev_guide/write_docs.md)
+ [5. An example for developing: how to write a generator?](docs/dev_guide/generator.ipynb)

## Code Structure

Expand All @@ -38,11 +48,15 @@ The code is organized as follows:
+ `package`: files for constructing packages or images, such as conda recipe and docker files.
+ `tests`: unit tests.
+ `dmff`: DMFF python codes
+ `dmff/api`: source code of application programming interface of DMFF.
+ `dmff/admp`: source code of automatic differentiable multipolar polarizable (ADMP) force field module.
+ `dmff/classical`: source code of classical force field module.
+ `dmff/common`: source code of common functions, such as neighbor list.
+ `dmff/generators`: source code of force generators.
+ `dmff/sgnn`: source of subgragh neural network force field model.
+ `dmff/eann`: source of embedded atom neural network force field model.
+ `dmff/generators`: source code of force generators.
+ `dmff/operators`: source code of operators.


## Support and Contribution

Expand Down
13 changes: 6 additions & 7 deletions backend/openmm_dmff_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


This is a plugin for [OpenMM](http://openmm.org) that used the trained JAX model by [DMFF](https://github.com/deepmodeling/DMFF) as an independent Force class for dynamics.
To use it, you need to save you DMFF model with the script in `DMFF/backend/save_dmff2tf.py`.
To use it, you need to save your DMFF model with the script in `DMFF/backend/save_dmff2tf.py`.

## Installation

Expand All @@ -15,10 +15,9 @@ conda create -n dmff_omm -c conda-forge python=3.9 openmm cudatoolkit=11.6
conda activate dmff_omm
```
### Download `libtensorflow_cc` and install `cppflow` package
Install the precompiled libtensorflow_cc library from deepmodeling channel.
Install the precompiled libtensorflow_cc library from conda.
```shell

conda install -c deepmodeling libtensorflow_cc=2.9.1=cuda112h02da4e0_0
conda install -y libtensorflow_cc=2.9.1 -c conda-forge
```
Download the tensorflow sources file. Copy the `c` direcotry in source code to installed header files of tensorflow library, since it's needed by package `cppflow`.
```shell
Expand All @@ -37,9 +36,9 @@ mkdir ${CONDA_PREFIX}/include/cppflow
cp -r include/cppflow ${CONDA_PREFIX}/include/
```

### Install the OpenMM DMFF plugin from source
### Install the OpenMM DMFF plugin from the source

Compile the plugin from source with following steps.
Compile the plugin from the source with the following steps.
1. Set up environment variables.
```shell
export OPENMM_INSTALLED_DIR=$CONDA_PREFIX
Expand All @@ -49,7 +48,7 @@ Compile the plugin from source with following steps.
mkdir build && cd build
```

2. Run `cmake` command with required parameters.
2. Run `cmake` command with the required parameters.
```shell
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR}
make && make install
Expand Down
16 changes: 15 additions & 1 deletion backend/openmm_dmff_plugin/openmmapi/include/DMFFForce.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef double ENERGYTYPE;
#else
typedef float FORCETYPE;
typedef float COORDTYPE;
typedef float ENERGYTYPE;
typedef double ENERGYTYPE;
#endif

namespace DMFFPlugin {
Expand All @@ -71,6 +71,12 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
* @param energyCoefficient : the energy transform coefficient.
*/
void setUnitTransformCoefficients(const double coordCoefficient, const double forceCoefficient, const double energyCoefficient);
/**
* @brief Set the has_aux flag when model was saved with auxilary input.
*
* @param hasAux : true if model was saved with auxilary input.
*/
void setHasAux(const bool hasAux);

const std::string& getDMFFGraphFile() const;
/**
Expand All @@ -97,6 +103,13 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
* @return double
*/
double getCutoff() const;
/**
* @brief Get the Has Aux object
*
* @return true
* @return false
*/
bool getHasAux() const;
void updateParametersInContext(OpenMM::Context& context);
bool usesPeriodicBoundaryConditions() const {
return use_pbc;
Expand All @@ -106,6 +119,7 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
private:
string graph_file;
bool use_pbc = true;
bool has_aux = false;
double cutoff = 1.2;
double coordCoeff, forceCoeff, energyCoeff;

Expand Down
Loading

0 comments on commit cfeffeb

Please sign in to comment.