Features | Quick start | Installation | Change log | Documentation
SPARC-atomSFE is a Python library for atomic structure calculatons in the framework of Kohn-Sham density functional theory (DFT). It employs a Spectral Finite Element (SFE) discretization. It is heavily optimized and aims for high numerical accuracy.
The package supports both all-electron and norm-conserving pseudopotential calculations across a comprehensive hierarchy of exchange-correlation approximations, spanning local, semilocal, and nonlocal functionals. The latter includes hybrid functionals and the many-body random phase approximation, for which we implement both the generalized Kohn-Sham approach and the optimized effective potential (OEP) method, with OEP necessary for eigenvalue-dependent functionals.
This is a research code. Please try it out, report issues, and share feedback.
from atom import AtomicDFTSolver
# Single-atom DFT with GGA-PBE
solver = AtomicDFTSolver(atomic_number=13, xc_functional="GGA_PBE")
results = solver.solve()
# Access total energy, density, eigenvalues, etc.
print(results["energy"])- Finite-element discretization — Real-space mesh and operators in
atom.mesh. - Pseudopotentials — Norm-conserving pseudopotential support (e.g. psp8) in
atom.pseudo. - SCF driver — Density, Hamiltonian, eigensolver, Poisson, mixing, and convergence in
atom.scf. - Exchange–correlation — LDA, GGA-PBE, hybrid (HF), and ML-XC in
atom.xc.
from atom import AtomicDFTSolver
# xc_functional can be any supported functional (e.g. GGA_PBE, LDA_PZ, PBE0, ...)
solver = AtomicDFTSolver(atomic_number=29, xc_functional="GGA_PBE")
results = solver.solve()
# Many options available: domain_size, mesh, grid, SCF settings, verbose, etc.
solver = AtomicDFTSolver(
atomic_number=6,
xc_functional="LDA_PZ",
domain_size=15.0,
verbose=True,
)
results = solver.solve()- Python ≥ 3.8
- NumPy ≥ 1.20
- SciPy ≥ 1.7
| Use case | Command |
|---|---|
| Core (CPU) | pip install -e . or pip install atom |
| With viz | pip install -e ".[viz]" |
| Dev + tests | pip install -e ".[dev]" |
| All optional | pip install -e ".[all]" |
From the repository root:
pip install -e .| Directory / module | Description |
|---|---|
src/mesh |
Grid construction and operators |
src/pseudo |
Pseudopotential reading and evaluation (local / non-local) |
src/scf |
SCF loop: density, Hamiltonian, eigensolver, Poisson, mixer |
src/xc |
XC functionals: LDA, GGA, HF, ML-XC, etc. |
src/data |
Data generation, loading, and processing |
src/utils |
Occupation states, periodicity helpers |
tests |
Unit and integration tests |
docs |
Cookbook (cookbook.md) and short docs/README.md |
| Extra | Purpose |
|---|---|
ml |
PyTorch, scikit-learn for ML-XC |
viz |
Matplotlib for plotting |
dev |
pytest, Jupyter for development |
threadpool |
threadpoolctl for RPA/thread control |
If you use this code in your research, please cite the repository:
@software{sparc_atomsfe_placeholder,
author = {TBD},
title = {TBD},
url = {TBD},
version = {TBD},
year = {TBD},
}
SPARC-atomSFE is licensed under GNU GPLv3.
For usage examples, see docs/cookbook.md (and docs/README.md for a one-line pointer).
For development and contribution guidelines, see the repository.
- U.S. Department of Energy (DOE), Office of Science (SC): DE-SC0023445
