Skip to content

Conversation

@WangXinyan940
Copy link
Member

We propose to add the following features to DMFF:

  • 'LennardJonesForce'
  • 'CoulombPMEForce'
  • 'CoulNoCutoffForce'
  • 'CoulReactionFieldForce'
  • 'HarmonicBondJaxForce'
  • 'HarmonicAngleJaxForce'
  • 'PeriodicTorsionJaxForce'

The following generators are added to support related cards in OpenMM type XML forcefield.

  • 'HarmonicBondJaxGenerator'
  • 'HarmonicAngleJaxGenerator'
  • 'PeriodicTorsionJaxGenerator'
  • 'NonbondJaxGenerator'

WangXinyan940 and others added 30 commits March 1, 2022 16:34
feat(admp): update the newest version to devel branch
feat(classical): support OpenMM-like HarmonicBond, HarmonicAngle and PeriodicTorsion
Roy Kid and others added 23 commits March 20, 2022 18:00
Conflicts:
	dmff/api.py
	dmff/classical/inter.py
* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential
* get a preliminary result of point charge pme caclulation

* correct gradient of coul

* review api.py code

* feat(classical): Support more Coulomb potentials (#9)

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* imporve colvalent_map support

Co-authored-by: Roy Kid <lijichen365@126.com>
* feat(classical): Support differentiable mscale & add test cases (#10)

* Update PME code (#8)

* get a preliminary result of point charge pme caclulation

* correct gradient of coul

* review api.py code

* feat(classical): Support more Coulomb potentials (#9)

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* imporve colvalent_map support

Co-authored-by: Roy Kid <lijichen365@126.com>

* feat(classical): add testcases for NoCutoff Coulomb potential and a large GAFF molecule

* feat(classical): Support differentiable 1-4 scale

Co-authored-by: Roy Kid <lijichen365@126.com>

* formate code; add example XML section to parseElement docstring

Co-authored-by: Roy Kid <lijichen365@126.com>
@@ -1,5 +1,335 @@
import sys

sys.path.append("/home/lijichen/work/DMFF")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should be solved

Copy link
Collaborator

@KuangYu KuangYu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in code.

from dmff.admp.recip import generate_pme_recip, Ck_1


ONE_4PI_EPS0 = 138.935456
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same constant in dmff.admp.pme, called DIELECTRIC, should we consider put all important constants together? Maybe add a constant.py file under dmff.


return E

def get_energy(positions, box, pairs, epsilon, sigma, epsfix, sigfix):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like in the classical module, all positions/box are assumed to be in unit of nanometer. But in ADMP, all positions are assumed to be in Angstrom. We should discuss this unit conflicts...

Copy link
Member Author

@WangXinyan940 WangXinyan940 Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to input position/box in nm & kJ/mol in API, and then transfer to angstrom when creating potential function like this:

class ADMPDispGenerator:
    def createForce():
        def potential_fn(positions, box, pairs, params):
            position_ang = positions * 10.0 
            box_ang = box * 10.0
            E_sr = pot_fn_sr(
                position_ang, box_ang, pairs, mScales, a_list, b_list, q_list, c_list[0]
            )
            E_lr = pot_fn_lr(position_ang, box_ang, pairs, c_list.T, mScales)
            return E_sr - E_lr

Then we don't need to touch parameter preparing process.

Copy link
Collaborator

@KuangYu KuangYu Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good.

E_excl = get_LJ_energy(dr_excl_vec, sig_excl, eps_excl, box)
E_excl = self.scale_exclusion * E_excl

return jnp.sum(E_inter) - jnp.sum(E_excl)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause precision issues. The way in admp/pairwise.py might be better? Try to apply scaling factor directly on pairwise interactions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Making change now.

@KuangYu KuangYu requested review from Ericwang6 and KuangYu April 7, 2022 01:23
@Ericwang6 Ericwang6 merged commit 5ba5aa0 into deepmodeling:devel Apr 10, 2022
WangXinyan940 referenced this pull request in WangXinyan940/DMFF Apr 11, 2022
* fix(classical): fix import relationship

* Update

* feat(classical): make HarmonicBond and HarmonicAngle the same as GAFF

* feat(classical): Support torsion force

* fix(classical): use two attributes to save proper/improper dihedral separately

* fix(classical): Jax the parameters when creating forces

* fix(classical): fix a typo

* fix(classical): use ndarray to save indexes

* fix(classical): return sum of energies for torsion

* feat(classical): support 4th order for torsion

* feat(classical): Add UT for classical forcefields

* fix(classical): Update PDB structures needed by test cases

* fix(classical): Change atomtypes to be consistent with residues

* feat(classical): add reference energies for test cases

* fix(classical): decrease the decimal for energy comparision

* feat(classical): Use the same way of openmm for dihedral typification

* fix(classical): remove unused import

* fix(classical): add order for impropers

* fix(classical): use ndarray instead of list for index saving

* fix(classical): Add import element

* fix(classical): fix misusing between torsion.periodicity and torsion.phase

* fix(classical): misusing between periodicity and phase

* fix(classical): Correct bond connection in unit test pdb files

* Fix pdb files in unittest

* Update proper1.pdb

* feat(classical): update reference energy for improper test

* Update api.py

* feat(classical): Add wildcard testcase for improper

* set up LennardJones framework

* feat(classical): Add test case for multiple dihedrals in one molecule

* fix(classical): change the way of dihedral calculation

* start to write LJ potential

* feat(classical): Implement 12-6 potential without exclusion

* feat(classical): Add exclusion pairs for LJ force

* feat(classical): add simple test for LennardJonesForce

* fix(classical): fix imp of nbfix

* fix(classical): use more reasonable test case

* fix(classical): add reference energy

* draft for dev lj potential

* fix Zonly typo in api.py:332 which not consistent with line 475

* reduce PME force to point charge calculation

* get a preliminary result of point charge pme caclulation

* feat(classical): support loading charge from residue card and NonbondedForce card

* correct gradient of coul

* feat(classical): Add setting for force switching

* feat(classical): Add noPBC support on LJ potential

* review api.py code

* feat(classical): Use covalent map to generate exclusions

* feat(classical): Call LJ in API

* fix(classical): bug fix on misusing list and jnp.array

* fix(classical): correctly support NoCutoff

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* feat(classical): Support more Coulomb potentials (#9)

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* imporve colvalent_map support

* Update PME code (#8)

* get a preliminary result of point charge pme caclulation

* correct gradient of coul

* review api.py code

* feat(classical): Support more Coulomb potentials (#9)

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* imporve colvalent_map support

Co-authored-by: Roy Kid <lijichen365@126.com>

* feat(classical): add testcases for NoCutoff Coulomb potential and a large GAFF molecule

* feat(classical): Support differentiable 1-4 scale

* Devel (#9)

* feat(classical): Support differentiable mscale & add test cases (#10)

* Update PME code (#8)

* get a preliminary result of point charge pme caclulation

* correct gradient of coul

* review api.py code

* feat(classical): Support more Coulomb potentials (#9)

* fix(classical): fix misusing variables

* feat(classical): add a testcase for two LJ molecules

* fix(classical): correct setting of LJ case

* feat(classical): add a testcase for large molecule (including 1-4) interactions

* feat(classical): Add support for reaction-field and no-cutoff in Coulomb potential

* imporve colvalent_map support

Co-authored-by: Roy Kid <lijichen365@126.com>

* feat(classical): add testcases for NoCutoff Coulomb potential and a large GAFF molecule

* feat(classical): Support differentiable 1-4 scale

Co-authored-by: Roy Kid <lijichen365@126.com>

* formate code; add example XML section to parseElement docstring

Co-authored-by: Roy Kid <lijichen365@126.com>

* feat(classical): add more GAFF2 test cases.

* fix(classical): remove unnecessary lines

Co-authored-by: Roy-Kid <42854324+Roy-Kid@users.noreply.github.com>
Co-authored-by: Roy Kid <lijichen365@126.com>

Co-authored-by: Roy-Kid <42854324+Roy-Kid@users.noreply.github.com>
Co-authored-by: Roy Kid <lijichen365@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants