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.
-
demo/ — Example scripts for training and generating
-
demo_training/simu_data/— Simulated SiO2 structures for trainingdenoiser_train_unconditional.py-- unconditional training scriptdenoiser_train_conditional.py-- conditional training script
-
demo_generating/inital_data/—- Initial random structures (e.g., SiO2)gen_data/-- Empty folder to store generated trajectorydenoise_generate_unconditional.py-- unconditional generation scriptdenoise_generate_conditional.py-- conditional generation script
-
model/ — Pretrained diffusion models
gen-a-sio2-cond-v1.pt— Conditional SiO2 generatorgen-a-sio2-uncond-v1.pt— Unconditional SiO2 generatorgen-cu50zr50-v1.pt— Cu–Zr metallic glass generator
-
-
src/ — Core source code and utilities
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
Create new environment
conda create -n dm2 python=3.10 -y
conda activate dm2Install 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-geometricInstall 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 tqdmThen, clone the repo and install dm2
pip install -e /path/to/the/repoInstallation of different verison of packages may cause errors.
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.





