Datasets:

ArXiv:
License:
File size: 6,403 Bytes
31b14c7
 
 
38ad8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731e53a
 
 
 
 
 
 
 
 
 
 
 
38ad8a5
 
 
 
 
 
 
731e53a
38ad8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e3a928
38ad8a5
 
 
 
 
 
 
 
 
 
8e3a928
38ad8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731e53a
 
8e3a928
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731e53a
 
38ad8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e3a928
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
license: apache-2.0
---
<div align="center">
 👋 Hi, everyone! 
    <br>
    We are <b>ByteDance Seed team.</b>
</div>

<p align="center">
  You can get to know us better through the following channels👇
  <br>
  <a href="https://seed.bytedance.com/">
    <img src="https://img.shields.io/badge/Website-%231e37ff?style=for-the-badge&logo=bytedance&logoColor=white"></a>
  <a href="https://github.com/user-attachments/assets/5793e67c-79bb-4a59-811a-fcc7ed510bd4">
    <img src="https://img.shields.io/badge/WeChat-07C160?style=for-the-badge&logo=wechat&logoColor=white"></a>
 <a href="https://www.xiaohongshu.com/user/profile/668e7e15000000000303157d?xsec_token=ABl2-aqekpytY6A8TuxjrwnZskU-6BsMRE_ufQQaSAvjc%3D&xsec_source=pc_search">
    <img src="https://img.shields.io/badge/Xiaohongshu-%23FF2442?style=for-the-badge&logo=xiaohongshu&logoColor=white"></a>
  <a href="https://www.zhihu.com/org/dou-bao-da-mo-xing-tuan-dui/">
    <img src="https://img.shields.io/badge/zhihu-%230084FF?style=for-the-badge&logo=zhihu&logoColor=white"></a>
</p>

![seed logo](https://github.com/user-attachments/assets/c42e675e-497c-4508-8bb9-093ad4d1f216)


# Towards A Universally Transferable Acceleration Method for Density Functional Theory
Zhe Liu, Yuyan Ni, Zhichen Pu, Qiming Sun, Siyuan Liu & Wen Yan

https://arxiv.org/abs/2509.25724

# TL;DR

We propose a framework for accelerating DFT calculations.

We train E(3)-equivariant neural networks to predict the expansion coefficients of the electron density in an auxiliary basis, and use the prediction to construct an initial guess for the SCF process. This approach exhibits superior transferability in various aspects.

# Changelog

## 2026.3.7

* The full evaluation code is released.
* The train/valid/test split of the main dataset is released.
* The model weights of the NequIP model are released.

## 2025.12.1

* First release.

# Contents

The repo currently contains the following contents:

* The full SCFbench dataset.
* The data pipeline for the SCFbench dataset.
* The PyTorch `nn.Module` of the species-wise linear layer for the prediction of the electron density coefficients.
* The NequIP model code and weights with the species-wise linear layer.
* Example code for computing the density coefficients from a density matrix.
* The full evaluation code.


# Requirements

* torch
* e3nn
* pyscf
* lmdb
* numpy>1.26
* nequip (if you want to use the NequIP model)


# Dataset Usage

The `dataset` folder of the repo contains the `main` dataset (the dataset for training, validation and in-distribution testing) and the `ood-test` dataset.

Each dataset contains several `parts`, each of which corresponds to a specific piece of information. The parts are:

* `base`: the basic information of the molecule, including atomic numbers, coordinates, etc.
* `dm`: the density matrix of the molecule.
* `fock`: the Hamiltonian (fock) matrix of the molecule.
* `auxdensity.denfit`: the density coefficients on def2-universal-jfit.
* `auxdensity.denfit.etb2.0`: the density coefficients on the ETB basis of def2-svp with $\beta=2.0$.
* `auxdensity.denfit.etb1.5`: the density coefficients on the ETB basis of def2-svp with $\beta=1.5$.

Example usage:

```python
from dataset import SCFBenchDataset

# Loading base info (atomic numbers, coordinates, etc.), density matrix, Hamiltonian (fock) matrix and the density coefficients on def2-universal-jfit.
parts_to_load = ['base', 'dm', 'fock', 'auxdensity.denfit']
dataset = SCFBenchDataset(data_root='dataset/main', parts_to_load=parts_to_load)
dataset[0].keys()

# Loading the base info and the density coefficients on the ETB basis of def2-svp with $\beta=1.5$.
parts_to_load = ['base', 'auxdensity.denfit.etb1.5']
dataset = SCFBenchDataset(data_root='dataset/ood-test', parts_to_load=parts_to_load, auxbasis='etb:def2-svp:1.5') 
dataset[0].keys()

# for the raw data, use the underlying dataset
dataset.dataset[0].keys()
```

# Evaluation

The full evaluation code is provided in `evaluate_scf_gpu.py`. To evaluate the provided NequIP model checkpoint `nequip_L_jfit.ckpt`, run:

```bash
# evaluate on the test split of the main dataset (ID setting); note that you can also specify --num-shards and --shard-index to only run the evaluation on a subset
python evaluate_scf_gpu.py --ckpt nequip_L_jfit.ckpt --data-root dataset/main --split test --output id_test.csv

# evaluate on the ood-test dataset
python evaluate_scf_gpu.py --ckpt nequip_L_jfit.ckpt --data-root dataset/ood-test --split no --output ood_test.csv

# evaluate on the ood-test dataset, with a XC/basis transfer setting
python evaluate_scf_gpu.py --ckpt nequip_L_jfit.ckpt --data-root dataset/ood-test --split no --xc blyp --transfer-basis def2-tzvp --output ood_test_transfer.csv
```

# Known Issues

* The species-wise linear readout layer may cause unstable model forward time on GPU in some software environments. We recommend implementing the prediction using a uniform padded basis for all species, just like how Hamiltonian prediction models (e.g., QHNet) predict the Hamiltonian matrix. We have tested this method internally but would like to keep the code in this repo consistent with our paper for reproducibility.


# Citing SCFbench
If you use SCFbench in your research, please cite:
```latex
@misc{liu2025universallytransferableaccelerationmethod,
      title={Towards A Universally Transferable Acceleration Method for Density Functional Theory}, 
      author={Zhe Liu and Yuyan Ni and Zhichen Pu and Qiming Sun and Siyuan Liu and Wen Yan},
      year={2025},
      eprint={2509.25724},
      archivePrefix={arXiv},
      primaryClass={physics.chem-ph},
      url={https://arxiv.org/abs/2509.25724}, 
}
```


## License

Models are licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

The dataset is a derivative of [ChEMBL](https://www.ebi.ac.uk/chembl/), used under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/). 

Our modified version, the SCFbench dataset, is also licensed under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/).

## About [ByteDance Seed Team](https://seed.bytedance.com/)

Founded in 2023, ByteDance Seed Team is dedicated to crafting the industry's most advanced AI foundation models. The team aspires to become a world-class research team and make significant contributions to the advancement of science and society.