Prediction of potential energy profiles of molecular dynamic simulation by graph convolutional networks
This is the implementation for Prediction of potential energy profiles of molecular dynamic simulation by graph convolutional networks
MD-GNN (GCN-based Predictor for mesoscale metallic systems) is constructed to predict physical properties from trajectory of MD simulation.
If you want to use the same environment used in the paper, you can follow instructions below.
To perform calculations using the source code in this repository, the following environment is required
- NVIDIA GPU that is compatible with CUDA
- CPU, memory, and auxiliary storage devices with sufficient specifications to perform scientific and technical calculations
- Docker
- NVIDIA Drivers
- NVIDIA Container Toolkit
- NVIDIA Container Toolkit is a software that enables the use of NVIDIA GPUs within containerized environments
- You can find how to install NVIDIA container toolkit on this page
clone this repository by executing the command below.
git clone git@github.com:nodematerial/MD-GNN.git
- Build Docker Image by executing the command below.
docker-compose build
- Run Docker Container by executing the command below.
docker-compose up -d
- Attach to the running container by executing the command below.
docker attach MD-GNN [YOUR CONTAINER ID]
- install Python modules by using Poetry
poetry install
├── LICENSE
├── README.md
├── compose.yml
├── configs # Config file to Create Input Data for ML model
├── dataset # Input Data for ML model (Graphs, Features, Labels)
├── docker # Directory to put Dockerfile
├── dumpfiles # Directory to put Dumpfile (atomic information by MD simulation)
├── lmpfile # Directory to put setting file for LAMMPS
├── makefile
├── poetry.lock
├── pyproject.toml
├── script # Directory to put script for Machine Learning experimet
└── shell_script # Directory to put task definitions
LAMMPS[1] (Large-scale Atomic/Molecular Massively Parallel Simulator) is an open-source molecular dynamics software package designed to simulate and study the behavior of materials at the atomic and molecular scale.
- You have to define MD simulation tasks according to the notation described in documentation.
- You can start an MD simulation by executing the following command
lmp -sf gpu -in [YOUR LAMMPS FILE]
- or you can excecute defined task by command below
- You have to define two parameters in config file(.yml) below
config
directory- lmpfile_name: The name of LAMMPS file
- dir_name: Relative path where lmpfile file is put
- You have to define two parameters in config file(.yml) below
make lmp CONF_NAME=[YOUR_CONFIG_FILE.yml]
[1] S.J. Plimpton, Fast parallel algorithms for short-range molecular dynamics, J. Comput. Phys., 117 (1995) 1.
To use GCN, it is essential to convert atomic coordinates of the system into the graph structure. You can convert atomic information in dumpfiles into Graphs and Features by following commands below
- You have to define four parameters in config file (.yml) below
config
directory- dirname: Relative path where dumpfile is put
- cutoff: cutoff value(angstrom), which is the threshold to evaluate whether two nodes is connected. (The edge is created between two atoms when the interatomic distance is shorter than the threshold distance.)
- time: determine the timestep to use, three elements of the list represents [ time of first step, time of last step, interval of each steps ] (unit: fs)
- division: Specifies the number of divisions of the system into cells, specified as a list with three elements, each of which refers to the number of divisions in the x, y, and z directions.
make makegraph CONF_NAME=[YOUR_CONFIG_FILE.yml]
Before starting the training of ML models, you need to prepare supplemantal data, concretely, you have to run command that excecute Common Neighbor Analysis and convert lammps logfile into csv data
- You have to define four parameters in config file(.yml) below
config
directory- dirname: Relative path where dumpfile is put
- time: determine the timestep to use, three elements of the list represents [ time of first step, time of last step, interval of each steps ] (unit: fs)
make cna CONF_NAME=[YOUR_CONFIG_FILE.yml]
make thermo CONF_NAME=[YOUR_CONFIG_FILE.yml]
You can train the ML model by runnning command below,
poetry run python3 train.py
Detailed setting is described in config.yml
which is placed in each experiment folder.
cutoff : [String] # The cutoff which is used as the threshold to convert atoms position into graphs
interval: [Integer] # The interval of timestep
data_per_condition: [Integer] # the amount of data for each condition
train_dirs: [List[String]] # List of directory name in which the training data is placed
valid_dirs: [List[String]] # List of directory name in which the validation data is placed
all_dirs: [List[String]] # List of directory name in which the training&validation data is placed
seed: [Integer] # random seed
hidden_channels: [Integer] #dimension of hidden layer of GCN convolution
epochs: [Integer] # The number of epoch of training.
lr: [Float] # The Learning Rate of training.
wandb: [boolean] # If you can use Weight & Biases (https://wandb.ai/home), you can manage the training result by Wandb.
project_name: [String] # Project name of experimet (this name is used as namespace in Wandb)
exp_name: [String] # Experiment name
BASE_ENERGY: [Float] # Potential energy at the first step (i.e. 0sec)
you can predict the potential energy by excecuting command below.
The prediction result will be saved as prediction.csv
and visualization results will be placed in images
folder
poetry run python3 infer.py
poetry run python3 mapping.py
@article{NODA2023112448,
title = {Prediction of potential energy profiles of molecular dynamic simulation by graph convolutional networks},
journal = {Computational Materials Science},
volume = {229},
pages = {112448},
year = {2023},
issn = {0927-0256},
doi = {https://doi.org/10.1016/j.commatsci.2023.112448},
url = {https://www.sciencedirect.com/science/article/pii/S0927025623004421},
author = {Kota Noda and Yasushi Shibuta},
keywords = {Molecular dynamics, Machine learning, Graph convolutional networks, Graph representation, Solid-liquid coexisting system},
}
If you have some trouble, please contact us by opening Issue.