Skip to content

PhysiLearn/SCDM

Repository files navigation

🔬 SCDM:Discovery of 2D Materials via Symmetry-Constrained Diffusion Model

A symmetry-constrained diffusion model (SCDM) that integrates space group symmetry into the generative process for 2D material discovery.

图片1

✨ Key Features

  • Symmetry-aware Generation: Incorporates space group symmetry constraints in diffusion process
  • Wyckoff Position Processing: Automated data preprocessing for crystallographic data
  • 2D Material Focus: Specialized for two-dimensional material discovery

🚀 Getting Started

Prerequisites

  • Python 3.9+
  • PyTorch 2.0+
  • CUDA-enabled GPU (recommended cu121)

Installation

# Clone repository
git clone https://github.com/yourusername/SCDM.git

# Install dependencies
pip install -r requirements.txt

📖 Usage

Step 1: Data Preprocessing

0.Prepare your crystallographic data in cif format under ..SCDM/poscar/

1.Use python csv_create.py for encoding all the data under ..SCDM/poscar/

2.Modify file paths in npz.py

# your data csv here
csv_file = '../SCDM/POSCAR/xxx.csv'
# your poscar data here
directory_path = '../POSCAR'

3.Generate processed dataset: python npz.py --output materials_dataset.npz

Step 2: Model training

python TRAIN.py\
    --dataset materials_dataset.npz 
    --batch_size 24 
    --num_epochs 100 
    --save_dir models

Step 3: Generation

  1. Load Your Trained Model before generating new materials, load your trained model:
best_model_path = saved_path + '/' + 'BestModel.pth'
#your trained model here
best_model_path ='../saved_train_models/BestModel.pth'
DDPM.load_state_dict(torch.load(best_model_path)) 

1.Run the generation script to create new 2D materials:

python Generate.py

🤝 Citation

@article{xu2025discovery,
  title={Discovery of 2D Materials via Symmetry-Constrained Diffusion Model},
  author={Xu, Shihang and Chu, Shibing and Mrad, Rami and Zhang, Zhejun and Li, Zhelin and Jiao, Runxian and Chen, Yuanping},
  journal={The Journal of Physical Chemistry C},
  volume={129},
  number={14},
  pages={6794--6802},
  year={2025},
  publisher={ACS Publications}
}

📜 License

This project is licensed under the MIT License.

📞 Contact

If there are any issues and questions, please leave us issues on Github or send me email (Shibing Chu c◎ujs dot edu dot cn).

About

2D Crystal generation via diffusion models guided by symmetry group constraints.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages