Transformer-inspired architectures make machine-learned electron densities accurate and transferable enough to bypass self-consistency
Organizations: Center for AI and Natural Sciences, Korea Institute for Advanced Study, Seoul 02455, Republic of Korea
Abstract
We introduce machine learning models that accurately predict the electron density, the central variable of density functional theory. They are built on Transformer-inspired architectures, which require little computation per parameter and can therefore be enlarged at low cost. The proposed models, SwinUNETR-V2 and its attention-free counterpart NeXtUNETR, achieve state-of-the-art accuracy on QM9, with normalized mean absolute errors in the density averaging 0.075% and 0.046%, respectively. The predicted densities are accurate enough to bypass the self-consistent iteration: a single Kohn-Sham step reproduces the self-consistent electronic structure. For NeXtUNETR, the median errors are 0.036 meV in the total energy, 0.65 meV/angstrom in the forces and 1.8 meV in the HOMO-LUMO gap. The forces not only recover the self-consistent minima in geometry optimization but also successfully drive ab initio molecular dynamics. Fine-tuned on small datasets, both networks also transfer accurately to systems containing elements absent from QM9 or larger than its molecules.
Figures & tables
| Density NMAE (%) | One-step energies (meV) | One-step forces (meV Å -1 ) | |||||||
| Model | Predicted | One step | HOMO | LUMO | gap | w/o NSCC | w/ NSCC | ||
| SAD guess (input) | mean | 13.9 | – | – | – | – | – | – | – |
| median | 14.0 | – | – | – | – | – | – | – | |
| Previous work | |||||||||
| eqDeepDFT (ref. 13 ) | mean | 0.27 b | – | – | – | – | – | – | – |
| ELECTRA (ref. 16 ) | mean | 0.176 b | – | – | – | – | – | – | – |
| Test set | Training | SR-ResNet | SwinUNETR-V2 | NeXtUNETR |
|---|---|---|---|---|
| C 7 O 2 H 10 a | zero-shot | 0.662 | 0.853 | 0.809 |
| fine-tuned | 0.244 | 0.228 | 0.167 | |
| from scratch | 1.885 | 1.064 | 1.706 | |
| MT b | zero-shot | 2.168 | 1.518 | 3.501 |
| fine-tuned | 0.339 | 0.214 | 0.203 | |
| from scratch | 3.478 | 0.993 | 1.931 |