All Projects → torchmd → mdgrad

torchmd / mdgrad

Licence: MIT license
Pytorch differentiable molecular dynamics

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to mdgrad

Mcmd
Monte Carlo and Molecular Dynamics Simulation Package
Stars: ✭ 52 (-59.06%)
Mutual labels:  chemistry, molecular-dynamics, physics-simulation
mddatasetbuilder
A script to build reference datasets for training neural network potentials from given LAMMPS trajectories.
Stars: ✭ 23 (-81.89%)
Mutual labels:  chemistry, molecular-dynamics
pylj
Teaching Utility for Classical Atomistic Simulation.
Stars: ✭ 23 (-81.89%)
Mutual labels:  chemistry, molecular-dynamics
Awesome Python Chemistry
A curated list of Python packages related to chemistry
Stars: ✭ 410 (+222.83%)
Mutual labels:  chemistry, molecular-dynamics
Molly.jl
Molecular simulation in Julia
Stars: ✭ 99 (-22.05%)
Mutual labels:  molecular-dynamics, physics-simulation
Tensormol
Tensorflow + Molecules = TensorMol
Stars: ✭ 226 (+77.95%)
Mutual labels:  chemistry, molecular-dynamics
opem
OPEM (Open Source PEM Fuel Cell Simulation Tool)
Stars: ✭ 107 (-15.75%)
Mutual labels:  chemistry, physics-simulation
senpai
Molecular dynamics simulation software
Stars: ✭ 124 (-2.36%)
Mutual labels:  chemistry, molecular-dynamics
Chemlab
The chemistry library you were waiting for
Stars: ✭ 187 (+47.24%)
Mutual labels:  chemistry, molecular-dynamics
Molecular Design Toolkit
Notebook-integrated tools for molecular simulation and visualization
Stars: ✭ 123 (-3.15%)
Mutual labels:  chemistry, molecular-dynamics
Elements
⚛⚗ A desktop App which displays the periodic table
Stars: ✭ 131 (+3.15%)
Mutual labels:  polymer, chemistry
gopem
GUI for OPEM library
Stars: ✭ 20 (-84.25%)
Mutual labels:  chemistry, physics-simulation
multi-chart
lit-element building blocks for charts and visualization (based on d3.js v5)
Stars: ✭ 24 (-81.1%)
Mutual labels:  polymer
vaadin-dialog
High quality web component for modal dialogs. Part of the Vaadin platform.
Stars: ✭ 15 (-88.19%)
Mutual labels:  polymer
Introduction-to-Deep-Learning-and-Neural-Networks-Course
Code snippets and solutions for the Introduction to Deep Learning and Neural Networks Course hosted in educative.io
Stars: ✭ 33 (-74.02%)
Mutual labels:  graph-neural-networks
Entity-Graph-VLN
Code of the NeurIPS 2021 paper: Language and Visual Entity Relationship Graph for Agent Navigation
Stars: ✭ 34 (-73.23%)
Mutual labels:  graph-neural-networks
SiGAT
source code for signed graph attention networks (ICANN2019) & SDGNN (AAAI2021)
Stars: ✭ 37 (-70.87%)
Mutual labels:  graph-neural-networks
stl-part-viewer
A lit-element web component that uses Three.js to display an STL model file.
Stars: ✭ 19 (-85.04%)
Mutual labels:  polymer
mlearn
Benchmark Suite for Machine Learning Interatomic Potentials for Materials
Stars: ✭ 89 (-29.92%)
Mutual labels:  chemistry
ASAP
AAAI 2020 - ASAP: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representations
Stars: ✭ 83 (-34.65%)
Mutual labels:  graph-neural-networks

torchmd

This is not just a regular simulator but a DIFFERENTIABLE simulator!

PyTorch code for End-to-end differetiable molecular simulations. More docs and tutorials are comings. This repo is under heavy development, your contribution is very much welcomed.

Install packages

I highly recommend creating a dedicated conda environment via:

conda create -n mdgrad python=3.8

Download and install

git clone https://github.com/torchmd/mdgrad.git
cd mdgrad
conda activate mdgrad
pip install -r requirements.txt # I have tested this, it should work 
pip install -e . # -e is useful if you want to edit the source code

Highlights

  • Reverse-mode automatic differentiation through ODE Solver (O(1) backprop)
  • solvers supported: 4th order Runge-Kutta and Velocity Verlet
  • Include a Graph Neural Network Module (our own SchNet implementation)
  • GPU-accelerated Neighborlist algorithm
  • End-to-End Differentiable Observable implemented - RDF, VACF
  • Good for single molecule and condensed phase( liquids and solids )
  • Compatible with ASE for system initialization
  • Users can write interface to their favorite Force Field architecture (SchNet, DimeNet, SE3NN, LAMMPS etc.)

Wang, W., Axelrod, S., & Gómez-Bombarelli, R. (2020). Differentiable Molecular Simulations for Control and Learning. https://arxiv.org/abs/2003.00868

This repo features the following demos:

  1. Differentiable folding of a polymer

  2. Learning interactions from observables (pair correlation function, velocity auto-correlations)

  3. Quantum isomerization of a minimal retinal model

# Define a box of particles 
L = 1.6 
atoms = FaceCenteredCubic(symbol='H', size=(3, 3, 3), latticeconstant=L, pbc=True)

# use System to wrap ase.atoms
from torchmd.system import System 
device = 'cuda:0'
system = System(atoms, device=device)
system.set_temperature(1.0)

# Define interactions 
from torchmd.potentials import ExcludedVolume
pair = PairPotentials(system, ExcludedVolume, **{'epsilon': 1.0,  'sigma': 1.0,"power": 12}, cutoff=2.5).to(device)

# Define simulation
from torchmd.md import NoseHooverChain
integrator = NoseHooverChain(model, 
            system,
            Q=50.0, 
            T=1.0,
            num_chains=5, 
            adjoint=True).to(device)

sim = Simulations(system, integrator)

# Simulate 
v_t, q_t, pv_t = sim.simulate(steps=50, frequency=50, dt=0.01) #v_t: velocity  q_t: position  pv_t bath: variables

# Compute observable 
obs = rdf(system, nbins=100, r_range=(0.75, 2.5))
_, _, g = obs(q_t)

g.sum().backward()
# You will find out g can be backpropagated for gradient cumulation, give it a try!

DEMOs

End-to-End Fitting for Macroscopic/Coarse-Grained Observable

Backpropagating through the trajectory to train a GNN that reproduces a target pair distribution function. We demonstrated the fitting of water rdf (Oxygen-Oxygen) at 298k with differentiable simulations

Controllable Fold for polymer chain

Folding a polymer with Graph Neural Networks

Quantum Isomerization

We fit electric field to optimize efficiency of a quantum isomerization process for retinal molecule

TODO

  • Imeplement Forward Sensitivity solver
  • More thermostats (Parrinello-Rahman dynamics, etc.)
  • Interface to LAMMPS so that this tool can be used as a plug-in for LAMMPS simulations
  • Write interface to SE3NN, DimeNET, etc.
  • Better loggers for observables
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].