Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 1.0.0-development branch to devel branch. #129

Merged
merged 195 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
2690192
Fix mbar example (#76)
WangXinyan940 Dec 3, 2022
8564c13
Remove jax_md requirement to support high version of jax & tensorflow
WangXinyan940 Jan 5, 2023
c0d9408
Initialize topology information generator and its UT
WangXinyan940 Jan 10, 2023
c46c312
Half way of detecting propers
WangXinyan940 Jan 10, 2023
79a13c8
Finish proper searching
WangXinyan940 Jan 11, 2023
4417306
Update topology.py
WangXinyan940 Jan 11, 2023
0788c1e
Update topology.py
WangXinyan940 Jan 11, 2023
edced36
Auto detect impropers
WangXinyan940 Jan 11, 2023
35bd2e3
Update topology.py
WangXinyan940 Jan 11, 2023
8ff48d3
Initialize template IO
WangXinyan940 Jan 11, 2023
0a1647e
Remove jax version limitation
WangXinyan940 Jan 11, 2023
ba5a768
Finish atom type matching with templates
WangXinyan940 Jan 11, 2023
a160cf1
Initialize UT for topology tools
WangXinyan940 Jan 11, 2023
67edf0a
Upload auto workflow for UT
WangXinyan940 Jan 12, 2023
80b2add
Add issue templates for feature request and bug-report (#83)
dingye18 Feb 14, 2023
6a7ec8b
Small update in issue template (#84)
dingye18 Feb 14, 2023
cabcd72
Update initial version of frontend impl & unit tests
Mar 1, 2023
18849fc
Modify new code to fit old parts
WangXinyan940 Mar 1, 2023
615b393
Make the structure clean
WangXinyan940 Mar 1, 2023
8cb20b7
Update code
WangXinyan940 Mar 1, 2023
3d423c2
Finished adding vsite from template and smarts parsers
WangXinyan940 Mar 2, 2023
b687404
Support VSite IO in xml template
WangXinyan940 Mar 2, 2023
a209f10
Support vsite in template matching
WangXinyan940 Mar 2, 2023
717e6f1
Add example
WangXinyan940 Mar 2, 2023
e7a3785
Add example of vsite addition
WangXinyan940 Mar 2, 2023
28da5bd
Try a better implementation
WangXinyan940 Mar 5, 2023
51fdb4a
Implement a better Topology
WangXinyan940 Mar 6, 2023
16bb78f
Update bettertopology.py
WangXinyan940 Mar 6, 2023
14753a0
Designed the usage of operators
WangXinyan940 Mar 9, 2023
214d154
Update our own Topology class
WangXinyan940 Mar 9, 2023
4d8d4d7
Update test_operators.py
WangXinyan940 Mar 9, 2023
1a9db72
Update test_operators.py
WangXinyan940 Mar 9, 2023
84de55c
Implement VSite and AType operators
WangXinyan940 Mar 9, 2023
0fd4918
Create smartsvsite.py
WangXinyan940 Mar 9, 2023
ea4bf5a
Update am1charge.py
WangXinyan940 Mar 9, 2023
a7a3406
Update test_operators.py
WangXinyan940 Mar 9, 2023
28fb354
Add AM1 charge OP
WangXinyan940 Mar 14, 2023
904380d
Add Coulomb Generator
WangXinyan940 Mar 21, 2023
54f0e7e
supporting generators
WangXinyan940 Mar 22, 2023
68a26a9
Add method to find equivalent atoms (without vsites)
WangXinyan940 Mar 23, 2023
2816e73
Let AM1 charge calculator use eqv info
WangXinyan940 Mar 23, 2023
a19e57b
Add full support of BCC charge
WangXinyan940 Mar 24, 2023
25f554e
Support ambertools based typification
WangXinyan940 Mar 24, 2023
49cd1fd
Update classical.py
WangXinyan940 Mar 24, 2023
e91652f
Add LJ generator and an example
WangXinyan940 Mar 28, 2023
b69e5c7
support LJ prms
WangXinyan940 Apr 3, 2023
8274677
Deal with atom classes in LJ
WangXinyan940 Apr 4, 2023
b46a904
Add water example for interaction calculation
WangXinyan940 Apr 4, 2023
209612a
Update test_inter_water.py
WangXinyan940 Apr 4, 2023
4a993c0
Add support for loading BCC prms
WangXinyan940 Apr 6, 2023
c60dd6b
Update classical.py
WangXinyan940 Apr 6, 2023
e272cc1
Finish BCC support
WangXinyan940 Apr 6, 2023
b29984b
support type2 vsite
WangXinyan940 Apr 19, 2023
cc5009b
Make operators use the same initialization method
WangXinyan940 Apr 19, 2023
c2e8395
Support smirks patching on vsites.
WangXinyan940 Apr 19, 2023
2e5ed90
Finished dimer energy example
WangXinyan940 Apr 20, 2023
0eaf31f
Update classical.py
WangXinyan940 Apr 20, 2023
a2f4530
Update topology.py
WangXinyan940 Apr 20, 2023
719b0a5
Fix ParamSet to be a correct PyTree
WangXinyan940 Apr 20, 2023
c5f6d26
Update paramset.py
WangXinyan940 Apr 20, 2023
1b7011f
Calculate test system by hand
WangXinyan940 Apr 20, 2023
8cbfb45
Add test case for NoCutoff Coul and LJ energy
WangXinyan940 Apr 20, 2023
e7b5d05
Support NBFix
WangXinyan940 Apr 21, 2023
3b3eca6
Add Hamiltonian and its unittest.
WangXinyan940 Apr 23, 2023
edf1f16
Delete test.xml
WangXinyan940 Apr 23, 2023
6080c47
update vsite positions in hamiltonian
WangXinyan940 Apr 23, 2023
e729b0c
replace Chem.SanitizeMol with topdata.regularize_aromaticity
TablewareBox Apr 23, 2023
f61c2be
fix N+ formal charge
TablewareBox Apr 24, 2023
ba065d3
Merge branch 'master' into wangxy/frontend-refactor
WangXinyan940 Apr 24, 2023
d700e64
Update .gitignore
WangXinyan940 Apr 24, 2023
dc8bd96
Merge branch 'wangxy/frontend-refactor' of https://github.com/deepmod…
TablewareBox Apr 24, 2023
f03d198
Update topology.py
WangXinyan940 Apr 24, 2023
4e5678d
Support the way of updating paramset in optax
WangXinyan940 Apr 24, 2023
b4d82f2
Update test_run_dimer_energy.py
WangXinyan940 Apr 24, 2023
71c3fa6
Initialize generators before loading hamiltonian
WangXinyan940 Apr 26, 2023
cbad09a
add warmup and nesterov optimizer
TablewareBox May 1, 2023
c442416
fix 3fd vsite coordinates
TablewareBox May 4, 2023
a0852dd
Add mask generation
WangXinyan940 May 11, 2023
786237b
build vsites in multiple molecules separately
TablewareBox May 14, 2023
b721c9e
support dummy atom reading
TablewareBox May 24, 2023
9c2aeee
fix vsite topologies and molecules
TablewareBox May 25, 2023
fc9a290
Init new example
WangXinyan940 Jun 19, 2023
33a452d
Support Parmed LJ modifier
WangXinyan940 Jun 20, 2023
766832a
Update example for lennard jones optimization
WangXinyan940 Jun 26, 2023
e64caae
Create simpler MBAR estimator
WangXinyan940 Jun 26, 2023
d5557c2
Add reweighting estimator
WangXinyan940 Jun 27, 2023
315416d
Update opt.ipynb
WangXinyan940 Jun 27, 2023
4b03410
Update opt.ipynb
WangXinyan940 Jun 27, 2023
4a82a09
Update opt.ipynb
WangXinyan940 Jun 27, 2023
3214592
Add a simple example to calculate lennard-jones potential
WangXinyan940 Aug 25, 2023
dfbc39d
Add openmm as reference
WangXinyan940 Aug 25, 2023
dc974c0
Pearl dingzhen patch 1 (#112)
pearlDingzhen Sep 11, 2023
8efbe63
Update inter.py
WangXinyan940 Sep 11, 2023
60fce34
Remove Jax-MD requirement
WangXinyan940 Oct 11, 2023
a4a5fce
Fix Hamiltonian
WangXinyan940 Oct 11, 2023
3b7ffcd
Add HarmonicAngleGenerator
WangXinyan940 Oct 11, 2023
3853f61
Add PeriodicTorsionGenerator
WangXinyan940 Oct 11, 2023
118b192
Update NonbondedForce
WangXinyan940 Oct 11, 2023
b97c462
Correct the order of improper matching
WangXinyan940 Oct 11, 2023
bd62fcc
Fix and update unittests.
WangXinyan940 Oct 15, 2023
837ae1a
Update unit-test workflow to fix requirement problem
WangXinyan940 Oct 16, 2023
1cad257
Update test_compute.py
WangXinyan940 Oct 16, 2023
7eb616e
Update ut.yml
WangXinyan940 Oct 16, 2023
57c27c9
Update ut.yml
WangXinyan940 Oct 16, 2023
50e7c54
Add generator for ADMPPmeForce
WangXinyan940 Oct 17, 2023
eb76ae0
Merge changes on devel branch
WangXinyan940 Oct 17, 2023
b26de25
Merge changes on devel branch
WangXinyan940 Oct 17, 2023
98ffe8b
Update test_compute.py
WangXinyan940 Oct 17, 2023
78e0405
Support LJ long range correction
WangXinyan940 Oct 17, 2023
f642cb1
Add generators for Slater type forces
WangXinyan940 Oct 17, 2023
be7f94e
Update ut.yml
WangXinyan940 Oct 17, 2023
cd199e4
Update ut.yml
WangXinyan940 Oct 17, 2023
5c153bc
Fix No-AxisType bug (#122)
WangXinyan940 Oct 20, 2023
66d2eb9
qeq merge (#124)
gust-07 Oct 20, 2023
3b1cef2
Add sGNN generator
KuangYu Oct 21, 2023
4be2475
remove debugging codes
KuangYu Oct 21, 2023
800480a
Add frontend for sGNN (#125)
KuangYu Oct 22, 2023
5acacff
Modified QEQ potential and add JIT support
WangXinyan940 Oct 22, 2023
10dbff8
Fix the two examples:
KuangYu Oct 22, 2023
223ac95
Merge branch 'wangxy/v1.0.0-devel' of github.com:deepmodeling/DMFF in…
KuangYu Oct 22, 2023
81741de
Add QEQ test
WangXinyan940 Oct 22, 2023
4aa5b77
Add jaxopt requirement in github workflow
WangXinyan940 Oct 22, 2023
6134176
Update qeq.py
WangXinyan940 Oct 22, 2023
949c1cb
Fix the jupyter notebook
KuangYu Oct 23, 2023
337a8cf
Support aux data for ADMP and QEQ
WangXinyan940 Oct 23, 2023
db28782
Clean the way of aux_data implementation
WangXinyan940 Oct 23, 2023
a03c841
Add new unit test for QEQ with two residues.
WangXinyan940 Oct 23, 2023
9b03c2b
Change jaxopt root finder to be jit-able
WangXinyan940 Oct 24, 2023
919bef2
Update ut.yml
WangXinyan940 Oct 24, 2023
6de2f47
Explicit support nopbc calculation
WangXinyan940 Oct 24, 2023
cf07e05
Update admp.py
WangXinyan940 Oct 24, 2023
23a1238
make the behavior of ADMP correct while using NoCutoff
WangXinyan940 Oct 24, 2023
7e94269
Upload
WangXinyan940 Oct 26, 2023
f20b893
Update pme.py
WangXinyan940 Oct 26, 2023
48b2930
Add frontend for EANN (#127)
junminchen Oct 26, 2023
8555a8f
Change default scale setting of ADMP to reproduce MPID
WangXinyan940 Oct 26, 2023
03627c0
Update pme.py
WangXinyan940 Oct 27, 2023
029ee16
Fix optimizers for v1.0.0
WangXinyan940 Oct 27, 2023
16d1179
Fix nan problem while calculate power(0.0, 1/6)
WangXinyan940 Oct 27, 2023
7145d58
Add esp calculator in ADMPPmeForce and CoulNoCutoffForce for noPBC sy…
WangXinyan940 Oct 27, 2023
325dbb8
Fix the ADMP ESP calculator and add unit test
WangXinyan940 Oct 28, 2023
e8ec310
Update pme.py
WangXinyan940 Oct 28, 2023
83023e3
Use std library warnings to handle import errors
WangXinyan940 Oct 30, 2023
f92d04a
Add eta to increase the numerical stability of QEQ
WangXinyan940 Oct 30, 2023
d51be82
Fix the local frame axis setting in ADMP to be consistent with MPID
WangXinyan940 Oct 31, 2023
8cc28a4
Correct local frame defination in unit test
WangXinyan940 Oct 31, 2023
eaf111a
Merge branch 'pr_v1.0' into wangxy/v1.0.0-devel
KuangYu Nov 2, 2023
db09424
Update fluctuated_leading_term_waterff and water_fullpol example
KuangYu Nov 2, 2023
2171e4b
Save ADMP type mapping to potential.meta
WangXinyan940 Nov 2, 2023
5570494
Merge branch 'pr_v1.0' into wangxy/v1.0.0-devel
KuangYu Nov 2, 2023
c483a2a
Fix the ADMP examples, also improve the way map_atomtypes and
KuangYu Nov 2, 2023
a2c8beb
Break a long line in code
KuangYu Nov 2, 2023
8f3abe1
Fix the ADMP aux test
KuangYu Nov 2, 2023
e2903be
docs_review
VINFeng Nov 3, 2023
9302690
Fix examples (#130)
KuangYu Nov 3, 2023
59e3f0b
Merge branch 'pr/131' into wangxy/v1.0.0-devel
WangXinyan940 Nov 3, 2023
bf7c379
Update Installation.md
WangXinyan940 Nov 3, 2023
ed328eb
modifications to intro
VINFeng Nov 3, 2023
33e85e3
Update introduction.md
VINFeng Nov 3, 2023
0dd2995
Update index.md
VINFeng Nov 3, 2023
942f5cd
Merge branch 'wangxy/v1.0.0-devel' of github.com:deepmodeling/DMFF in…
KuangYu Nov 5, 2023
48656e3
Merge pull request #132 from VINFeng/patch-1
KuangYu Nov 5, 2023
db24380
Merge pull request #133 from VINFeng/patch-4
KuangYu Nov 5, 2023
e8f9794
Merge pull request #134 from VINFeng/patch-3
KuangYu Nov 5, 2023
09db65c
Merge branch 'wangxy/v1.0.0-devel' of github.com:deepmodeling/DMFF in…
KuangYu Nov 5, 2023
04196e7
Test modifying the MBAR.md file
KuangYu Nov 5, 2023
75654bc
Update MBAR doc
KuangYu Nov 5, 2023
5d6ee77
Update doc
KuangYu Nov 5, 2023
b9353dc
Update 4.2ADMPPmeForce.md
junminchen Nov 5, 2023
6d76807
Update 4.2ADMPPmeForce.md
zhengcheng233 Nov 6, 2023
4611913
Update 4.4MLForce.md
zhengcheng233 Nov 6, 2023
eaba9a4
Update Optimization doc
WangXinyan940 Nov 6, 2023
899d050
Merge branch 'deepmodeling:wangxy/v1.0.0-devel' into wangxy/v1.0.0-devel
KuangYu Nov 7, 2023
4f52538
Update 4.6MBAR.md
KuangYu Nov 7, 2023
de7f928
Update 4.5Optimization.md
KuangYu Nov 7, 2023
34ed56b
Update 4.5Optimization.md
KuangYu Nov 7, 2023
25ef0dd
add nocutoff and noperioid nblist
Roy-Kid Nov 7, 2023
cc0a726
Update 3.usage.md
VINFeng Nov 7, 2023
51f13fa
Merge branch 'wangxy/v1.0.0-devel' of https://github.com/KuangYu/DMFF…
WangXinyan940 Nov 8, 2023
bc00541
Merge branch 'pr/130' into wangxy/v1.0.0-devel
WangXinyan940 Nov 8, 2023
70e729b
Update 4.3ADMPQeqForce.md
gust-07 Nov 7, 2023
e0b0f15
update 4.3ADMPQeqForce.md
gust-07 Nov 7, 2023
8ffb4fb
docs/examples fix (#140)
VINFeng Nov 8, 2023
ad1bf64
Update omm plugin and save_dmff2tf.py for aux (U_ind especially) comp…
dingye18 Nov 8, 2023
f2c6975
Delete docs/dev_guide/arch.md (#141)
VINFeng Nov 8, 2023
e241696
review qeq docs and update the math display error (#139)
taipinghu Nov 8, 2023
03c9fb6
Create 4.7OpenMMplugin.md
WangXinyan940 Nov 8, 2023
cdb14ee
Update 4.3ADMPQeqForce.md
WangXinyan940 Nov 8, 2023
19c6ce0
Update 4.3ADMPQeqForce.md (#150)
gust-07 Nov 9, 2023
e2cbf0a
Update README.md (#147)
VINFeng Nov 9, 2023
348fa6a
Update the doc for openmm dmff plugin usage. (#146)
dingye18 Nov 9, 2023
2316e28
add 2 notebooks in user guide (#145)
VINFeng Nov 9, 2023
4cb4de2
Fix bug when rendering xml files
WangXinyan940 Nov 9, 2023
ce67cfa
Update the doc link in OpenMMPlugin doc (#151)
dingye18 Nov 9, 2023
58c7a5f
Merge branch 'wangxy/v1.0.0-devel' of https://github.com/deepmodeling…
WangXinyan940 Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create simpler MBAR estimator
WangXinyan940 committed Jun 26, 2023
commit e64caae7be33d4a704a183ee88450bb0f02a0beb
37 changes: 36 additions & 1 deletion dmff/mbar.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
import openmm as mm
import openmm.app as app
import openmm.unit as unit
from dmff import NeighborList, NeighborListFreud
from dmff import NeighborListFreud


def buildTrajEnergyFunction(potential_func,
@@ -149,6 +149,41 @@ def generate_energy(self, state_list):
[state.calc_energy(self.trajectory)])


class MBARSimpleEstimator:
def __init__(self, traj, ref_energies, base_energies = None, temperature = 300.0):
self.beta = 1. / temperature / 8.314 * 1000.
self.positions = jnp.array(traj.xyz)
self.cell = jnp.array(traj.unitcell_vectors)
self.ref_energies = jnp.array(ref_energies) * self.beta
if base_energies is None:
self.base_energies = jnp.zeros(ref_energies.shape)
else:
self.base_energies = jnp.array(base_energies) * self.beta

def _build_umat(self):
nk = np.array([self.positions.shape[0], 0])
umat = np.zeros((nk.shape[0], nk.sum()))
umat[0,:] = self.ref_energies[:]
return umat, nk

def optimize_mbar(self, initialize="BAR"):
umat, nk = self._build_umat()
self._mbar = MBAR(umat, nk, initialize=initialize)
self._umat_jax = jax.numpy.array(umat)
self._free_energy_jax = jax.numpy.array(self._mbar.f_k)
self._nk_jax = jax.numpy.array(nk)

def estimate_weight(self, uinit):
unew = uinit * self.beta + self.base_energies
unew_max = unew.max()
du_1 = self._free_energy_jax.reshape((-1, 1)) - self._umat_jax
delta_u = du_1 + unew.reshape((1, -1)) - unew_max - du_1.min()
cm = 1. / (jax.numpy.exp(delta_u) * jax.numpy.array(self._nk_jax).reshape(
(-1, 1))).sum(axis=0)
weight = cm / cm.sum()
return weight


class MBAREstimator:
def __init__(self):
self.samples = []
519 changes: 402 additions & 117 deletions examples/lennard_jones_opt/opt.ipynb

Large diffs are not rendered by default.