Skip to content

quantumbeam/PhaseDifformer

Repository files navigation

PhaseDifformer: Enabling single-observation decomposition of multi-phase X-ray diffraction patterns via generative deep learning

Yusei Ito, Naoya Chiba*, Tatsunori Taniai*, Ryo Igarashi, Yuta Suzuki, Kotaro Saito, Yoshitaka Ushiku, and Kanta Ono

Table of Contents

Citation

To be updated

Setup a Docker Environment

cd docker
docker build -t main/phasedifformer:latest .
docker run --gpus=all --name phasedifformer --shm-size=2g -v ../:/workspace -it  main/phasedifformer:latest /bin/bash

Note: If docker run fails due to a relative path issue, please replace ../ with the absolute path to the cloned repository directory.

Prepare Datasets

In the docker container:

cd /workspace/Data
python query_mp.py #Download structure data from the Materials Project
python make_mp_data.py #Create a synthetic dataset for training and testing

Training

In the /workspace directory in the docker container:

CUDA_VISIBLE_DEVICES=0 python train.py 

Training is performed in the following order: noise predictor with guide, noise predictor without guide, and confidence estimator.

Evaluation by synthetic data

In the dataset preparation described above, synthetic test datasets were constructed for single-phase, two-phase, and three-phase patterns across three crystal systems: Cubic, Tetragonal, and Orthorhombic. By assigning the target dataset path to path_data and the save directory to path_save_dir in recursive_decomposition.py, and then running

CUDA_VISIBLE_DEVICES=0 python recursive_decomposition.py

you can perform phase separation and evaluation.

Perform decomposition on custom data

Assign the 2θ values and intensities of the PXRD pattern as NumPy arrays to pattern_angle and pattern_intensity, respectively, in perform_decomposition_own_data.py, and specify the save directory in path_save_dir. Then, by running

CUDA_VISIBLE_DEVICES=0 python perform_decomposition_own_data.py

the decomposition can be performed.

By specifying the directory where the decomposition results are saved in path_dir and the reference structure CIF files in path_cifs in show_decomposed_pattern.py, the decomposition results can be visualized. If path_cifs is set to an empty list, only the decomposition results will be visualized.

About

The official code repository for "Enabling single-observation decomposition of multi-phase X-ray diffraction patterns via generative deep learning".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors