All Projects → openmm → NNPOps

openmm / NNPOps

Licence: other
High-performance operations for neural network potentials

Programming Languages

C++
36643 projects - #6 most used programming language
Cuda
1817 projects
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to NNPOps

tinker9
Tinker9: Next Generation of Tinker with GPU Support
Stars: ✭ 31 (-35.42%)
Mutual labels:  molecular-dynamics, molecular-modeling
tinker
Tinker: Software Tools for Molecular Design
Stars: ✭ 79 (+64.58%)
Mutual labels:  molecular-dynamics, molecular-modeling
enspara
Modeling molecular ensembles with scalable data structures and parallel computing
Stars: ✭ 28 (-41.67%)
Mutual labels:  molecular-dynamics, molecular-modeling
Pyemma
🚂 Python API for Emma's Markov Model Algorithms 🚂
Stars: ✭ 200 (+316.67%)
Mutual labels:  molecular-dynamics
fahbench
Folding@home GPU benchmark
Stars: ✭ 32 (-33.33%)
Mutual labels:  molecular-dynamics
wepy
Weighted Ensemble simulation framework in Python
Stars: ✭ 38 (-20.83%)
Mutual labels:  molecular-dynamics
mdgrad
Pytorch differentiable molecular dynamics
Stars: ✭ 127 (+164.58%)
Mutual labels:  molecular-dynamics
Plumed2
Development version of plumed 2
Stars: ✭ 178 (+270.83%)
Mutual labels:  molecular-dynamics
Fermi.jl
Fermi quantum chemistry program
Stars: ✭ 107 (+122.92%)
Mutual labels:  molecular-modeling
nequip
NequIP is a code for building E(3)-equivariant interatomic potentials
Stars: ✭ 312 (+550%)
Mutual labels:  molecular-dynamics
physical validation
Physical validation of molecular simulations
Stars: ✭ 37 (-22.92%)
Mutual labels:  molecular-dynamics
awesome-molecular-dynamics
😎 A curated list of awesome Molecular Dynamics libraries, tools and software.
Stars: ✭ 76 (+58.33%)
Mutual labels:  molecular-dynamics
CellListMap.jl
Flexible implementation of cell lists to map the calculations of particle-pair dependent functions, such as forces, energies, neighbour lists, etc.
Stars: ✭ 62 (+29.17%)
Mutual labels:  molecular-dynamics
Tensormol
Tensorflow + Molecules = TensorMol
Stars: ✭ 226 (+370.83%)
Mutual labels:  molecular-dynamics
QCxMS
Quantum mechanic mass spectrometry calculation program
Stars: ✭ 25 (-47.92%)
Mutual labels:  molecular-dynamics
Chemlab
The chemistry library you were waiting for
Stars: ✭ 187 (+289.58%)
Mutual labels:  molecular-dynamics
packmol
Packmol - Initial configurations for molecular dynamics simulations
Stars: ✭ 118 (+145.83%)
Mutual labels:  molecular-dynamics
senpai
Molecular dynamics simulation software
Stars: ✭ 124 (+158.33%)
Mutual labels:  molecular-dynamics
calphy
A Python library and command line interface for automated free energy calculations
Stars: ✭ 28 (-41.67%)
Mutual labels:  molecular-dynamics
contact map
Contact map analysis for biomolecules; based on MDTraj
Stars: ✭ 27 (-43.75%)
Mutual labels:  molecular-dynamics

GH Actions Status Conda Anaconda Cloud Badge

NNPOps

The goal of this project is to promote the use of neural network potentials (NNPs) by providing highly optimized, open source implementations of bottleneck operations that appear in popular potentials. These are the core design principles.

  1. Each operation is entirely self contained, consisting of only a few source files that can easily be incorporated into any code that needs to use it.

  2. Each operation has a simple, clearly documented API allowing it to be easily used in any context.

  3. We provide both CPU (pure C++) and CUDA implementations of all operations.

  4. The CUDA implementations are highly optimized. The CPU implementations are written in a generally efficient way, but no particular efforts have been made to tune them for optimum performance.

  5. This code is designed for inference (running simulations), not training (creating new potential functions). It computes gradients with respect to particle positions, not model parameters.

Installation

Install with Conda

A conda package can be installed from the conda-forge channel:

conda install -c conda-forge nnpops

If you don't have conda, we recommend installing Miniconda.

Build from source

Prerequisites

Build & install

  • Get the source code
$ git clone https://github.com/openmm/NNPOps.git
  • Set CUDA_HOME
$ export CUDA_HOME=/usr/local/cuda-11.2
  • Crate and activate a Conda environment
$ cd NNPOps
$ conda env create -n nnpops -f environment.yml
$ conda activate nnpops
  • Configure, build, and install
$ mkdir build && cd build
$ cmake .. \
        -DTorch_DIR=$CONDA_PREFIX/lib/python3.9/site-packages/torch/share/cmake/Torch \
        -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
$ make install
  • Run the tests
$ ctest --verbose

Usage

Accelerated TorchANI operations:

Example

import mdtraj
import torch
import torchani

from NNPOps.SpeciesConverter import TorchANISpeciesConverter
from NNPOps.SymmetryFunctions import TorchANISymmetryFunctions
from NNPOps.BatchedNN import TorchANIBatchedNN
from NNPOps.EnergyShifter import TorchANIEnergyShifter

from NNPOps import OptimizedTorchANI

device = torch.device('cuda')

# Load a molecule
molecule = mdtraj.load('molecule.mol2')
species = torch.tensor([[atom.element.atomic_number for atom in molecule.top.atoms]], device=device)
positions = torch.tensor(molecule.xyz * 10, dtype=torch.float32, requires_grad=True, device=device)

# Construct ANI-2x and replace its operations with the optimized ones
nnp = torchani.models.ANI2x(periodic_table_index=True).to(device)
nnp.species_converter = TorchANISpeciesConverter(nnp.species_converter, species).to(device)
nnp.aev_computer = TorchANISymmetryFunctions(nnp.species_converter, nnp.aev_computer, species).to(device)
nnp.neural_networks = TorchANIBatchedNN(nnp.species_converter, nnp.neural_networks, species).to(device)
nnp.energy_shifter = TorchANIEnergyShifter(nnp.species_converter, nnp.energy_shifter, species).to(device)

# Compute energy and forces
energy = nnp((species, positions)).energies
energy.backward()
forces = -positions.grad.clone()

print(energy, forces)

# Alternatively, all the optimizations can be applied with OptimizedTorchANI
nnp2 = torchani.models.ANI2x(periodic_table_index=True).to(device)
nnp2 = OptimizedTorchANI(nnp2, species).to(device)

# Compute energy and forces again
energy = nnp2((species, positions)).energies
positions.grad.zero_()
energy.backward()
forces = -positions.grad.clone()

print(energy, forces)
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].