Skip to content

digital-synthesis-lab/DM2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text DM2: Diffusion Models for Disordered Materials

This repo is mainly adapted from LLNL/graphite (version Dec 12, 2023). Modifications to the original code from Tim Hsu were made to include an embedding for the processing conditions of the glassy materials, and integrate the generation with the simulation of amorphous structures. This code is provided as a separate snapshot to ensure reproducibility of our manuscript, but considering that the credits for the original graphite code belong to Hsu.

📂 Gallery

Generation of cubic a-SiO2

Generation of cubic a-SiO2 (slice view)

Generation of amorphous mesoporous SiO2 (slice view)

Generation of cubic Cu50Zr50 (slice view)

📂 Directory Overview

  • demo/ — Example scripts for training and generating

    • demo_training/

      • simu_data/ — Simulated SiO2 structures for training
      • denoiser_train_unconditional.py -- unconditional training script
      • denoiser_train_conditional.py -- conditional training script
    • demo_generating/

      • inital_data/ —- Initial random structures (e.g., SiO2)
      • gen_data/ -- Empty folder to store generated trajectory
      • denoise_generate_unconditional.py -- unconditional generation script
      • denoise_generate_conditional.py -- conditional generation script
    • model/ — Pretrained diffusion models

      • gen-a-sio2-cond-v1.pt — Conditional SiO2 generator
      • gen-a-sio2-uncond-v1.pt — Unconditional SiO2 generator
      • gen-cu50zr50-v1.pt — Cu–Zr metallic glass generator
  • src/ — Core source code and utilities

🧪 Demo: Training and generating

Demo scripts and related files are provided at ~/demo/demo_training for training and ~/demo/demo_generating for generating amorphous SiO2 structures using the pre-trained model.

Before running the demo, you may need to make minor adjustments (changing GPU ID or updating relevant file paths). Once configured, simply execute the script by python DEMO.py to reproduce the our results.

The demo generating 300-atom a-SiO2 took about 2 mins on NVIDIA RTX A6000.

The unconditional model training takes about 20 hours and the conditional model training takes about 40 hours on NVIDIA RTX A6000

⚙️ Installation

Create new environment

conda create -n dm2 python=3.10 -y
conda activate dm2

Install pytorch and other packages for graph data.

pip install torch==2.5.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

pip install torch-geometric

Install e3nn with specific version. The latest version of e3nn may cause some error.

pip install "e3nn==0.4.4"

Common packages:

pip install numpy==1.26.4

pip install ase scipy pandas scikit-learn matplotlib tqdm

Then, clone the repo and install dm2

pip install -e /path/to/the/repo

Installation of different verison of packages may cause errors.

Citing

If using this code, please cite the following papers:

@article{yang2025generative,
  title={A generative diffusion model for amorphous materials},
  author={Yang, Kai and Schwalbe-Koda, Daniel},
  journal={arXiv:2507.05024},
  year={2025}
}

@article{hsu2024score,
  title={Score-based denoising for atomic structure identification},
  author={Hsu, Tim and Sadigh, Babak and Bertin, Nicolas and Park, Cheol Woo and Chapman, James and Bulatov, Vasily and Zhou, Fei},
  journal={npj Computational Materials},
  volume={10},
  number={1},
  pages={155},
  year={2024},
}

We thank the support from TRI for this project.

About

Diffusion models for disordered materials

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages