Skip to main content

Accelerated molecular dynamics with large-time-step predictions

Project description

FlashMD: universal long-stride molecular dynamics

This repository contains custom integrators to run MD trajectories with FlashMD models. These models are designed to learn and predict molecular dynamics trajectories using long strides, therefore allowing very large time steps. Before using this method, make sure you are aware of its limitations, which are discussed in this preprint.

Quickstart

You can install the package with

  pip install flashmd

After installation, you can run accelerated molecular dynamics with ASE as follows:

import ase.build
import ase.units
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
import torch
from pet_mad.calculator import PETMADCalculator

from flashmd import get_universal_model
from flashmd.ase.langevin import Langevin


# Create a structure and initialize velocities
atoms = ase.build.bulk("Al", "fcc", cubic=True)
MaxwellBoltzmannDistribution(atoms, temperature_K=300)

# Load models
device="cuda" if torch.cuda.is_available() else "cpu"
calculator = PETMADCalculator("1.0.1", device=device)
atoms.calc = calculator
model = get_universal_model(16)  # 16 fs model; also available: 1, 4, 8, 32, 64 fs
model = model.to(device)

# Run MD
dyn = Langevin(
    atoms=atoms,
    timestep=16*ase.units.fs,
    temperature_K=300,
    time_constant=100*ase.units.fs,
    model=model,
    device=device
)
dyn.run(1000)

Other available integrators:

  from flashmd.ase.velocity_verlet import VelocityVerlet
  from flashmd.ase.bussi import Bussi

Disclaimer

This is experimental software and should only be used if you know what you're doing. We recommend using the i-PI integrators for any serious work, and to perform constant pressure, NpT molecular dynamics. You can see this cookbook recipe for a usage example. Given that the main issue we observe in direct MD trajectories is loss of equipartition of energy between different degrees of freedom, we recommend using a local Langevin thermostat, and to monitor the temperature of different atomic types or different parts of the simulated system.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flashmd-0.1.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flashmd-0.1.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file flashmd-0.1.2.tar.gz.

File metadata

  • Download URL: flashmd-0.1.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for flashmd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7b1935acfece9d1eb195e727c7c99b6614bbdfb473a83ca08c6baaa49f08ca66
MD5 ef9aaff8c331d1fb724c6c3dcadad80f
BLAKE2b-256 2e7825ed0bc74bf7430eeb77a4ac2c3ce019873c28a6140d224dedc04162dd5c

See more details on using hashes here.

File details

Details for the file flashmd-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: flashmd-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for flashmd-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b6bf21fff747dedd8b58c2ce7757b763f681b4e5c780646d6dabeed2ec80e93
MD5 69363fd49bfa32ac1ec51937af6fb5cd
BLAKE2b-256 25737a11298c088a208188e271a248bd3cc3c61db9c83700aa11619ea8e43a45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page