Skip to content

Commit cfeffeb

Browse files
WangXinyan940Ericwang6Roy-KidKuangYuRoy-Kid
authored
Merge 1.0.0-development branch to devel branch. (#129)
* 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]>
1 parent e0877ee commit cfeffeb

File tree

271 files changed

+72332
-24163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+72332
-24163
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Bug report
2+
description: Create a bug report to help us eliminate issues and improve DMFF.
3+
title: "[BUG] _Replace With Suitable Title_"
4+
labels: bug
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: summary
9+
attributes:
10+
label: Bug summary
11+
description: Please provide a clear and concise description of what the bug is.
12+
placeholder:
13+
value:
14+
validations:
15+
required: true
16+
- type: input
17+
id: version
18+
attributes:
19+
label: DMFF Version
20+
description: Version of DMFF you are using.
21+
validations:
22+
required: true
23+
- type: input
24+
id: jax-version
25+
attributes:
26+
label: JAX Version
27+
description: Version of JAX you are using.
28+
validations:
29+
required: true
30+
- type: input
31+
id: openmm-version
32+
attributes:
33+
label: OpenMM Version
34+
description: Version of OpenMM you are using.
35+
validations:
36+
required: true
37+
- type: dropdown
38+
id: installation-way
39+
attributes:
40+
label: How did you download the software?
41+
options:
42+
- pip
43+
- Built from source
44+
- Others (write below)
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: log
49+
attributes:
50+
label: Input Files, Running Commands, Error Log, etc.
51+
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."
52+
placeholder:
53+
value:
54+
validations:
55+
required: true
56+
- type: textarea
57+
id: reproduce
58+
attributes:
59+
label: Steps to Reproduce
60+
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."
61+
placeholder:
62+
value:
63+
validations:
64+
required: true
65+
- type: textarea
66+
id: further
67+
attributes:
68+
label: Further Information, Files, and Links
69+
description: Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications
70+
placeholder:
71+
value:
72+
validations:
73+
required: false

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Request for Help
4+
url: https://github.com/deepmodeling/DMFF/issues
5+
about: If you have a usage question
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Feature request
2+
description: Suggest an idea for DMFF.
3+
title: "[Feature Request] _Replace with Title_"
4+
labels: enhancement
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: summary
9+
attributes:
10+
label: Summary
11+
description: "Please provide a brief and concise description of the suggested feature or change"
12+
placeholder:
13+
value:
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: motivation
18+
attributes:
19+
label: Motivation
20+
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."
21+
placeholder:
22+
value:
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: solutions
27+
attributes:
28+
label: Suggested Solutions
29+
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."
30+
placeholder:
31+
value:
32+
validations:
33+
required: false
34+
- type: textarea
35+
id: further
36+
attributes:
37+
label: Further Information, Files, and Links
38+
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!
39+
placeholder:
40+
value:
41+
validations:
42+
required: false
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Generic issue
2+
description: For issues that do not fit any of the other categories.
3+
title: _Replace With a Descriptive Title_
4+
labels: wontfix
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: summary
9+
attributes:
10+
label: Summary
11+
description: "Please provide a clear and concise description of what the question is."
12+
placeholder:
13+
value:
14+
validations:
15+
required: true
16+
- type: input
17+
id: version
18+
attributes:
19+
label: DMFF Version
20+
description: Version of DMFF you are using.
21+
validations:
22+
required: true
23+
- type: input
24+
id: jax-version
25+
attributes:
26+
label: JAX Version
27+
description: Version of JAX you are using.
28+
validations:
29+
required: true
30+
- type: input
31+
id: openmm-version
32+
attributes:
33+
label: OpenMM Version
34+
description: Version of OpenMM you are using.
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: other-version
39+
attributes:
40+
label: Python Version, CUDA Version, GCC Version, Operating System Version etc
41+
description: "If applicable, specify what platform you are running on."
42+
placeholder:
43+
value:
44+
validations:
45+
required: false
46+
- type: textarea
47+
id: details
48+
attributes:
49+
label: Details
50+
description: "Please explain the issue in detail here."
51+
placeholder:
52+
value:
53+
validations:
54+
required: true

.github/workflows/test_openmm_dmff_plugin.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ jobs:
4141
export OPENMM_INSTALLED_DIR=$CONDA_PREFIX
4242
export CPPFLOW_INSTALLED_DIR=$CONDA_PREFIX
4343
export LIBTENSORFLOW_INSTALLED_DIR=$CONDA_PREFIX
44-
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR} -DUSE_HIGH_PRECISION=ON
44+
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR} -DUSE_HIGH_PRECISION=OFF
4545
make && make install
46-
make PythonInstall
46+
make PythonInstall
4747
- name: Run Tests
4848
run: |
4949
source $CONDA/bin/activate dmff_omm
50-
python -m OpenMMDMFFPlugin.tests.test_dmff_plugin_nve -n 100
50+
cd ${GITHUB_WORKSPACE}/backend/
51+
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

.github/workflows/ut.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
- name: Install Dependencies
2020
run: |
2121
source $CONDA/bin/activate
22-
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
22+
conda create -n dmff -y python=${{ matrix.python-version }} numpy openmm==7.7.0 pytest rdkit openbabel mdtraj ambertools -c conda-forge
2323
conda activate dmff
2424
pip install --upgrade pip
25-
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
25+
pip install jax jaxlib jaxopt networkx parmed pymbar==4.0.1 optax tqdm
2626
- name: Install DMFF
2727
run: |
2828
source $CONDA/bin/activate dmff && pip install .
2929
- name: Run Tests
3030
run: |
3131
source $CONDA/bin/activate dmff
32-
pytest -vs tests/test_classical/*
33-
pytest -vs tests/test_common/*
34-
pytest -vs tests/test_admp/*
35-
pytest -vs tests/test_api.py
32+
pytest -vs tests/test_classical/test_*
33+
pytest -vs tests/test_common/test_*
34+
pytest -vs tests/test_admp/test_*
3635
pytest -vs tests/test_utils.py
37-
pytest -vs tests/test_mbar/*
36+
pytest -vs tests/test_mbar/test_*
37+
pytest -vs tests/test_sgnn/test_*

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -785,3 +785,10 @@ FodyWeavers.xsd
785785

786786
# hmtff cache
787787
*.hmtff/
788+
789+
# debugging ipynb
790+
debug.ipynb
791+
test.xml
792+
793+
# PyCharm Cache
794+
.idea/

README.md

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DMFF
22

3-
[![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)
3+
[![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)
44

55
## About DMFF
66

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

1111
### License and credits
1212

13-
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
14-
Differentiable Platform for Molecular Force Field
15-
Development and Molecular Dynamics
16-
Simulation. ChemRxiv. Cambridge: Cambridge Open Engage; 2022; This content is a preprint and has not been peer-reviewed.`
13+
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
14+
Journal of Chemical Theory and Computation 2023 19 (17), 5897-5909
15+
DOI: 10.1021/acs.jctc.2c01297`
1716

1817
## User Guide
1918

20-
+ [1. Introduction](docs/user_guide/introduction.md)
21-
+ [2. Installation](docs/user_guide/installation.md)
22-
+ [3. Basic usage](docs/user_guide/usage.md)
23-
+ [4. XML format force field](docs/user_guide/xml_spec.md)
24-
+ [5. Theory](docs/user_guide/theory.md)
19+
+ [1. Introduction](docs/user_guide/1.introduction.md)
20+
+ [2. Installation](docs/user_guide/2.installation.md)
21+
+ [3. Basic Usage](docs/user_guide/3.usage.md)
22+
+ [4. Modules](docs/user_guide/4.modules.md)
23+
+ [Classical](docs/user_guide/4.1classical.md)
24+
+ [ADMP](docs/user_guide/4.2ADMPPmeForce.md)
25+
+ [Qeq](docs/user_guide/4.3ADMPQeqForce.md)
26+
+ [Machine Learning](docs/user_guide/4.4MLForce.md)
27+
+ [Optimization](docs/user_guide/4.5Optimization.md)
28+
+ [Mbar Estimator](docs/user_guide/4.6MBAR.md)
29+
+ [OpenMM Plugin](docs/user_guide/4.7OpenMMplugin.md)
30+
+ [5. Advanced examples](docs/user_guide/DMFF_example.ipynb)
31+
+ [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)
32+
33+
[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)
2534

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

3242
## Code Structure
3343

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

4761
## Support and Contribution
4862

backend/openmm_dmff_plugin/README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
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.
5-
To use it, you need to save you DMFF model with the script in `DMFF/backend/save_dmff2tf.py`.
5+
To use it, you need to save your DMFF model with the script in `DMFF/backend/save_dmff2tf.py`.
66

77
## Installation
88

@@ -15,10 +15,9 @@ conda create -n dmff_omm -c conda-forge python=3.9 openmm cudatoolkit=11.6
1515
conda activate dmff_omm
1616
```
1717
### Download `libtensorflow_cc` and install `cppflow` package
18-
Install the precompiled libtensorflow_cc library from deepmodeling channel.
18+
Install the precompiled libtensorflow_cc library from conda.
1919
```shell
20-
21-
conda install -c deepmodeling libtensorflow_cc=2.9.1=cuda112h02da4e0_0
20+
conda install -y libtensorflow_cc=2.9.1 -c conda-forge
2221
```
2322
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`.
2423
```shell
@@ -37,9 +36,9 @@ mkdir ${CONDA_PREFIX}/include/cppflow
3736
cp -r include/cppflow ${CONDA_PREFIX}/include/
3837
```
3938

40-
### Install the OpenMM DMFF plugin from source
39+
### Install the OpenMM DMFF plugin from the source
4140

42-
Compile the plugin from source with following steps.
41+
Compile the plugin from the source with the following steps.
4342
1. Set up environment variables.
4443
```shell
4544
export OPENMM_INSTALLED_DIR=$CONDA_PREFIX
@@ -49,7 +48,7 @@ Compile the plugin from source with following steps.
4948
mkdir build && cd build
5049
```
5150

52-
2. Run `cmake` command with required parameters.
51+
2. Run `cmake` command with the required parameters.
5352
```shell
5453
cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR}
5554
make && make install

backend/openmm_dmff_plugin/openmmapi/include/DMFFForce.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef double ENERGYTYPE;
5050
#else
5151
typedef float FORCETYPE;
5252
typedef float COORDTYPE;
53-
typedef float ENERGYTYPE;
53+
typedef double ENERGYTYPE;
5454
#endif
5555

5656
namespace DMFFPlugin {
@@ -71,6 +71,12 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
7171
* @param energyCoefficient : the energy transform coefficient.
7272
*/
7373
void setUnitTransformCoefficients(const double coordCoefficient, const double forceCoefficient, const double energyCoefficient);
74+
/**
75+
* @brief Set the has_aux flag when model was saved with auxilary input.
76+
*
77+
* @param hasAux : true if model was saved with auxilary input.
78+
*/
79+
void setHasAux(const bool hasAux);
7480

7581
const std::string& getDMFFGraphFile() const;
7682
/**
@@ -97,6 +103,13 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
97103
* @return double
98104
*/
99105
double getCutoff() const;
106+
/**
107+
* @brief Get the Has Aux object
108+
*
109+
* @return true
110+
* @return false
111+
*/
112+
bool getHasAux() const;
100113
void updateParametersInContext(OpenMM::Context& context);
101114
bool usesPeriodicBoundaryConditions() const {
102115
return use_pbc;
@@ -106,6 +119,7 @@ class OPENMM_EXPORT_DMFF DMFFForce : public OpenMM::Force {
106119
private:
107120
string graph_file;
108121
bool use_pbc = true;
122+
bool has_aux = false;
109123
double cutoff = 1.2;
110124
double coordCoeff, forceCoeff, energyCoeff;
111125

0 commit comments

Comments
 (0)