This repository contains the code used in our publication Stable and Accurate Orbital-Free Density Functional Theory Powered by Machine Learning. Using equivariant graph neural networks, we enable Orbital-Free Density Functional Theory calculations by learning the kinetic energy functional from data.
Installation:
pip install mldft \
torch-scatter torch-sparse torch-cluster --find-links https://data.pyg.org/whl/torch-2.4.1+cu124.html \
git+https://github.com/sciai-lab/tensor_frames.git@cd1addfd3c82a47095c9961ab999dcabfab4c21dUse our setup script to download models and set environment variables:
mldft_setupRun inference on xyz files using our model either trained on QM9 (str25_qm9) or QMUGS (str25_qmugs):
mldft example.xyz --model str25_qm9Installation using uv:
git clone https://github.com/sciai-lab/structures25.git
cd structures25
uv syncFor installation instructions without uv or cpu support visit the Installation Guide. If you have built the docs locally, open docs/build/html/installation.html.
Now you can either go to the replication guide REPLICATION_GUIDE.md to reproduce results from our paper or see the usage below.
The full usage manual now lives in our documentation. Visit the Usage Guide for detailed instructions on data generation, training, and density optimization workflows. To reproduce the results from our paper, continue to use REPLICATION_GUIDE.md. After building the docs locally, you can open docs/build/html/usage.html.
make docs
# or to build from scratch:
make docs-cleanFor more details about the template, visit: https://github.com/ashleve/lightning-hydra-template
This code adapts code from the following third party libraries:
These are distributed under the
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you use this repository in your research, please cite the following paper:
@article{Remme_Stable_and_Accurate_2025,
author = {Remme, Roman and Kaczun, Tobias and Ebert, Tim and Gehrig, Christof A. and Geng, Dominik and Gerhartz, Gerrit and Ickler, Marc K. and Klockow, Manuel V. and Lippmann, Peter and Schmidt, Johannes S. and Wagner, Simon and Dreuw, Andreas and Hamprecht, Fred A.},
doi = {10.1021/jacs.5c06219},
journal = {Journal of the American Chemical Society},
number = {32},
pages = {28851--28859},
title = {{Stable and Accurate Orbital-Free Density Functional Theory Powered by Machine Learning}},
url = {https://doi.org/10.1021/jacs.5c06219},
volume = {147},
year = {2025}
}
