Comments (2)
Hello. Maybe you would like to switch to branch wangxy/v1.0.0-devel and try this test code:
import sys
import time
import jax
import jax.numpy as jnp
import numpy as np
import openmm.app as app
import openmm.unit as unit
import openmm as mm
from dmff import Hamiltonian, NeighborListFreud
from jax.config import config
config.update("jax_enable_x64", True)
prmtop = app.AmberPrmtopFile("RAMP1_gas.prmtop")
inpcrd = app.AmberInpcrdFile("RAMP1_gas.inpcrd")
ff = Hamiltonian("amber14/protein.ff14SB.xml", "amber14/tip3p.xml")
potentials = ff.createPotential(prmtop.topology, nonbondedMethod=app.NoCutoff, useDispersionCorrection=False)
params = ff.getParameters()
positions = jnp.array(inpcrd.getPositions(asNumpy=True).value_in_unit(unit.nanometer))
box = jnp.array([[100.0, 0.0, 0.0], [0.0, 100.0, 0.0], [0.0, 0.0, 100.0]])
nbList = NeighborListFreud(box, 20.0, potentials.meta["cov_map"])
nbList.allocate(positions)
pairs = nbList.pairs
efunc = potentials.getPotentialFunc()
dmff_e = efunc(positions, box, pairs, ff.paramset)
print("DMFF Pot E: ", dmff_e)
system = prmtop.createSystem(nonbondedMethod=app.NoCutoff, constraints=None)
integrator = mm.VerletIntegrator(0.001*unit.picoseconds)
platform = mm.Platform.getPlatformByName('Reference')
simulation = app.Simulation(prmtop.topology, system, integrator, platform)
simulation.context.setPositions(inpcrd.positions)
state = simulation.context.getState(getEnergy=True, getVelocities=True, getForces=True, getPositions=True)
energy = state.getPotentialEnergy()
print("OpenMM Pot E: ", energy)
The output on my laptop is:
DMFF Pot E: -6487.265980775686
Initial Pot E: -6487.229977725502 kJ/mol
Our neighbor list is a (N, 3) matrix with the third element saving covalant distance (1-2, 1-3, 1-4, etc). Directly using neighborlist in jax_md would cause unexpected error.
from dmff.
The devel branch has been merged to the master branch and our 1.0.0 version is released. I believe this problem is solved and would close this issue.
from dmff.
Related Issues (20)
- [Feature Request] Request a new feature for development of reactive force field HOT 3
- [BUG] spatial.py shape error
- Question about gradient HOT 7
- [Feature Request] Change the API of polarizable potential (ADMP and Qeq) functions HOT 1
- [Feature Request] Change the default unit of the ADMP frontend
- [BUG] Out of Memory Issue During Neighbor List Generation HOT 2
- [Feature Request] Install dependencies automatically and publish to PyPI HOT 3
- [Feature Request] Support for machine learning force field in OpenMM DMFF plugin HOT 1
- Installation problem
- Op type not registered 'XlaSharding' in binary running HOT 1
- [Feature Request] Refactor the cpp interface of the saved DMFF jax model with MD engine
- update the charge HOT 2
- [BUG] LJ switch function
- [Feature Request] Support Virtual Site in DMFF frontend HOT 1
- [Feature Request] MD Engine Support (LAMMPS) for trained model with DMFF
- [Feature Request] Support parameter optimization for dynamic properties based on trajectory HOT 2
- [Feature Request] QEQ modelโs parameterization for conductive electrodes with DMFF HOT 1
- [Feature Request] Workflow to fit relative protein-ligand binding free energy data
- [Feature Request] Efficient neighborlist construction/usage plugin for nonbonded force calculation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dmff.