DOS2BandNet is an AI framework that predicts unfolded band structures, also referred to as effective band structures (EBS), from density of states (DOS) and one-dimensional electron diffraction (ED).
Python 3.12+ is required.
# Recommended: create/activate a virtual environment first
pip install -r requirements.txt
# Please install PyTorch>=2.8 with CUDA. https://pytorch.org/get-started/locally/
pip install .scripts/preprocessing.py generates the following files for each target band* directory:
diffrac.npy: 1D electron diffraction intensitydos.npy: DOS vector (or site-projected array)ebs.npy: 2D band intensity map
Given raw DOS samples
If Gaussian smoothing is applied:
Then max-normalize:
EBS.dat is generated from the VASP outputs using VASPKIT.
For each point EBS.dat, accumulate a 2D Gaussian kernel:
In code,
Final normalization:
Reflections are selected along zone axis
Then max-scale the final intensity.
The pre-trained model and dataset are available on Zenodo (DOI:10.5281/zenodo.19490693).
Please download the dataset from Zenodo, extract it. Then run:
cd DOS2band_datasetThe Zenodo dataseti also provides preprocessed data.
Therefore, this step is not required when using the released dataset.
python scripts/preprocessing.py \
--prefix1 vac \
--tasks diffraction \
--dos-emin -10 \
--fwhm-q 0.08 \
--nproc 4python /path/to/dos2bandnet/scripts/train.py \
--mode finetune \
--out-root ./trained-model \
--pretrained-id full-input_model \
--finetune-base ./TaTe2_CDW/33SC_MD \
--finetune-split 0.8,0.1,0.1 \
--finetune-lr 5e-5 \
--prefix1 orb \
--prefix2 ebs \
--epochs-diff 200 \
--batch-size 32 \
--min-lr 1e-7 \
--warmup-epochs 60python /path/to/dos2bandnet/scripts/forward.py full-input_model \
--out_root ./trained-model \
--dirs ./TaTe2_CDW/33CDW/ebs_100 \
--steps 50 \
--guidance 1.0 \
--view_range -5 5 \
--zoom_range 0 4 \
--size-cm 12 9 \
--hide-y-numbers \
--dos-fwhm 0.15 \
--ed-fwhm 0.08 \
--ldm_ckpt ./trained-model/full-input_model/finetune_TaTe2_CDW/checkpoints/ldm_best.pt--base-dir: data root--prefix1,--prefix2: directory prefixes--tasks:diffraction,dos,ebs--dos-emin,--dos-emax,--dos-grid: DOS grid settings--tt-min,--tt-max,--dif-grid,--fwhm-q: diffraction settings--nk,--nE,--sigma-E-ebs: EBS settings--nproc: number of worker processes
--mode:vae|ldm|both|finetune--pretrained-id: pretrained run ID for finetune--finetune-base,--finetune-split,--finetune-lr--batch-size,--epochs-vae,--epochs-diff
--mode:create|agent|agent_pool|replay--project,--entity,--sweep_id--pool_gpus,--agents_per_gpu,--count_per_agent
- positional
run_name --dirs: inference target directories--steps,--guidance--view_range,--zoom_range,--size-cm--dos-fwhm,--ed-fwhm--ldm_ckpt: checkpoint path
This project is licensed under the MIT License.