## Introduction
This supplementary code contains experiments and general training and inference code of the DynamicsDiffusion paper.

Paper Title: DyamicsDiffusion: Generating and Enhanced Sampling of Molecular Dynamic Trajectories Using Diffusion Models
Conference: ICLR 2024

## Acknowledgement 

The code is heavily based in-part on the code found in the repository of the paper "Planning with Diffusion for Flexible Behavior Synthesis" by Janner et. all
Paper: https://arxiv.org/abs/2205.09991
Code: https://github.com/jannerm/diffuser

## Repository Structure
The repository is organized as follows:
.
├── AD Benchmark Gromacs              # The folder for the GROMACS based speed comparison benchmark
|   ├── run_ad_gromacs.sh             # Runs N parallel simulations of Alanine Dipeptide in Vacuum
│   └── speed_sum.py                  # Sums up the ns/day speed measures from all N runs
├── Alanine Dipeptide                 # The folder containing all the data generation for Alanine Dipeptide, training on the system and benchmarking the models speed
│   ├── Data Generation               # The folder containing the data generation for Alanine Dipeptide trajectories
|   |   ├── Data                      # The folder where the trajectory data is saved
|   |   ├── Models                    # The folder where model checkpoints are saved
│   |   └── AD_DataGen.ipynb          # The notebook in which OpenMM is used to simulate Alanine Dipeptide and the resulting trajectories are processed
│   └── Training                      # The folder containing the training on the Alanine Dipeptide trajectories and benchmarking the models speed
|       ├── DDPM_AD_Benchmark.ipynb   # The notebook in which the DyamicsDiffusion model is bechmarked to ascertain is generation speed
│       └── DDPM_AD.ipynb             # The notebook in which the DyamicsDiffusion model is trained on the Alanine Dipeptide trajectories
├── Double-Well                       # The folder containing all the data generation for the double well, DW, and training on its trajectories, as well as usage demos
│   ├── Data Generation               # The folder containing the data generation for DW trajectories
|   |   ├── Data                      # The folder where the trajectory data is saved
|   |   ├── Models                    # The folder where model checkpoints are saved
│   |   ├── DW_DataGen_con.ipynb      # The notebook in which the DW is simulated at different temperatures and the resulting trajectories are processed
|   |   └── DW_DataGen.ipynb          # The notebook in which the DW is simulated and the resulting trajectories are processed
│   └── Training                      # The folder containing the training on the DW trajectories and benchmarking the models speed
|       ├── DDPM_DW_Ablations.ipynb   # The notebook in which the ablation experiments are performed
|       ├── DDPM_DW_conditional.ipynb # The notebook in which the DyamicsDiffusion model is trained for conditional generation on the DW trajectories
│       └── DDPM_DW.ipynb             # The notebook in which the DyamicsDiffusion model is trained on the DW trajectories and used for inpainting and variation generation
├── SeqDiff
│   ├── __init__.py                 
│   └── dynamicsdiffusion.py          # The source code file
└── README.md                         # This README file

## Requirements
To run the code, please ensure the following dependencies are installed:

Training & Inference:
* python >= 3.9
* numpy
* torch
* torchvision
* functools
* einops
* diffusers
Data Generation:
* openmm
* multiprocessing
* mdtraj
* simtk
* sklearn
* pickle
Plotting & Misc.:
* matplotlib
* pandas
* pylab
* scipy
* statsmodels
Benchmarks
* Gromacs 2022.5
