This repository contains the source code and dataset for the Tensorial-Spectra Equivariant Neural Network (TSENN).
The following key dependencies were used in this project:
python==3.11.7torch==2.3.1+cu121torch_geometric==2.5.3torch_scatter==2.1.2+pt23cu121(plus other torch_geometric dependencies)pymatgen==2025.1.24e3nn==0.5.5
It is recommended to install torch first, followed by torch_geometric and its corresponding dependencies for your CUDA version.
You may also need the following common packages:
pandaswandbseabornmendeleevase- ...
You can install them using pip:
pip install pandas wandb seaborn mendeleev aseTo ensure all packages are installed, run the notebook at notebook/full_tensor_train_data_prep.ipynb. Missing packages can be added via pip as needed.
The dataset used in our work is hosted on Figshare because Git LFS is disabled in this repository. Download and extract it with:
python scripts/download_figshare.py --extractAfter extraction, the dataset is located in the dataset/ directory. An example of how to load
and use it is provided in: notebook/full_tensor_train_data_prep.ipynb.
Each entry in the dataset corresponds to a material and includes:
symmetrized_structuremp_id(Materials Project ID)chemical formulaband gapcrystal systemphoton energy (omega)real part of dielectric tensorimaginary part of dielectric tensor
The dielectric tensor data is stored as a NumPy array of shape (3001, 3, 3),
where 3001 corresponds to the number of photon energy points.
Each tensor is a
To train the model, navigate to the scripts folder and run:
cd scripts/
python train_full_im_tensor.pyThis will begin training the full-tensor model using the default parameters.
Pretrained model artifacts are hosted on Figshare. Download and extract them with:
python scripts/download_figshare.py --extractYou can explore the pretrained model and visualize its results in the notebook/ directory:
imaginary_part_prediction.ipynb: demonstrates predictions using the pretrained model on curated datasets.multiple_material_prediction.ipynbandmaterial_prediction.ipynb: shows how to query new materials from the Materials Project and make predictions.
Feel free to cite or fork this repository for your own research.
@misc{hsu2025accuratepredictionsequentialtensor,
title={Accurate Prediction of Tensorial Spectra Using Equivariant Graph Neural Network},
author={Ting-Wei Hsu and Zhenyao Fang and Arun Bansil and Qimin Yan},
year={2025},
eprint={2505.04862},
archivePrefix={arXiv},
primaryClass={cond-mat.mtrl-sci},
url={https://arxiv.org/abs/2505.04862},
}