Metadata-Version: 2.4
Name: atomic_femdvr
Version: 0.2.0
Summary: Kohn-Sham solver for isolated atoms (all-electron and norm-conserving pseudopotentials) using the finite-element discrete variable representation
Keywords: density functional theory,Kohn-Sham,atom,pseudopotential,UPF,finite element,discrete variable representation,atomic orbitals,snekpack
Author: Michael Schüler
Author-email: Michael Schüler <michael.schueler@psi.ch>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Dist: click
Requires-Dist: typing-extensions
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pydantic>=2
Requires-Dist: upf-tools
Requires-Dist: h5py
Requires-Dist: sympy
Requires-Dist: matplotlib ; extra == 'plot'
Maintainer: Michael Schüler
Maintainer-email: Michael Schüler <michael.schueler@psi.ch>
Requires-Python: >=3.10
Project-URL: Bug Tracker, https://github.com/michaelschueler/atomic-femdvr/issues
Project-URL: Homepage, https://github.com/michaelschueler/atomic-femdvr
Project-URL: Repository, https://github.com/michaelschueler/atomic-femdvr.git
Project-URL: Documentation, https://atomic-femdvr.readthedocs.io
Provides-Extra: plot
Description-Content-Type: text/markdown

<h1 align="center">
  atomic-femdvr
</h1>

<p align="center">
    <a href="https://github.com/michaelschueler/atomic-femdvr/actions/workflows/tests.yml">
        <img alt="Tests" src="https://github.com/michaelschueler/atomic-femdvr/actions/workflows/tests.yml/badge.svg" /></a>
    <a href="https://pypi.org/project/atomic_femdvr">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/atomic_femdvr" /></a>
    <a href="https://pypi.org/project/atomic_femdvr">
        <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/atomic_femdvr" /></a>
    <a href="https://github.com/michaelschueler/atomic-femdvr/blob/main/LICENSE">
        <img alt="License" src="https://img.shields.io/pypi/l/atomic_femdvr" /></a>
    <a href="https://doi.org/10.5281/zenodo.24314160">
        <img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.24314160.svg" /></a>
    <a href="https://atomic-femdvr.readthedocs.io/en/latest/?badge=latest">
        <img alt="Documentation Status" src="https://readthedocs.org/projects/atomic-femdvr/badge/?version=latest" /></a>
</p>

Kohn-Sham solver for isolated atoms using the finite-element discrete variable
representation (FE-DVR).

- **Pseudo-atoms** with norm-conserving pseudopotentials in UPF format, including
  pseudopotentials without pseudo-atomic orbitals (e.g. SG15)
- **All-electron atoms** (non-relativistic), plus approximate scalar-relativistic
  (Koelling-Harmon) and ZORA treatments
- LDA and GGA functionals: PBE built in, all others via
  [libxc](https://libxc.gitlab.io)
- **Confined atomic orbitals** with polarization functions for use as localized
  basis functions or projectors, exported on a logarithmic grid (Quantum ESPRESSO
  style), on the FE-DVR grid, or as spherical Bessel transforms; dipole matrix
  elements
- **Photoemission**: scattering phase shifts and dipole matrix elements to
  continuum states

## 🚀 Installation

```console
$ python3 -m pip install atomic_femdvr
```

The built-in exchange-correlation driver provides PBE. Other functionals (e.g. the
LDA used for the NIST benchmark) need the libxc Python bindings, which are not on
PyPI; see the
[installation guide](https://atomic-femdvr.readthedocs.io/en/latest/installation.html).

## 💪 Getting started

Calculations are defined by a JSON input file. A pseudo-atom with a confinement
potential and polarization orbitals (`examples/Si_Pseudo.json`):

```json
{
  "control": { "storage_dir": "./Si_pseudo" },
  "sysparams": {
    "element": "Si",
    "file_upf": "../tests/data/Si/Si.oncvpsp.upf",
    "lmax": 2,
    "nmax": 1
  },
  "dft": { "xc_functional": "PBE", "mixing_scheme": "anderson", "alpha_mix": 0.5 },
  "confinement": {
    "type": "SoftStep",
    "rc": 20.0,
    "ri_factor": 0.5,
    "polarization_mode": "SoftCoul"
  },
  "output": { "output_wfc_qe": true, "output_wfc_bessel": true }
}
```

```console
$ cd examples
$ atomic_femdvr pseudoatomic Si_Pseudo.json -t scf,nscf out
```

This solves the Kohn-Sham equations self-consistently (`scf`), computes two
confined radial functions each for s, p and d (`nscf`), and writes them to `out/`.
All energies are in Hartree and all lengths in bohr. The all-electron solver is
run with `atomic_femdvr atomic` (see `examples/Ne_full.json`).

See the [documentation](https://atomic-femdvr.readthedocs.io) for the input
reference, the method and the output formats.

## ✅ Validation

- **All-electron**: LDA eigenvalues agree with the
  [NIST atomic reference data](https://www.nist.gov/pml/atomic-reference-data-electronic-structure-calculations)
  (Ne, to 2e-6 Ha).
- **Pseudo-atoms**: eigenvalues reproduce the all-electron reference energies
  stored by ONCVPSP in the UPF file to about 0.5 meV (Mo, Si).

The scalar-relativistic and ZORA options are approximate and have not been
benchmarked. Details are in the
[documentation](https://atomic-femdvr.readthedocs.io/en/latest/validation.html).

## 📖 Citation

If you use atomic-femdvr in your work, please cite the archived release:

> M. Schüler, _atomic-femdvr_, Zenodo (2026),
> [doi:10.5281/zenodo.24314160](https://doi.org/10.5281/zenodo.24314160)

```bibtex
@software{atomic_femdvr,
  author    = {Schüler, Michael},
  title     = {atomic-femdvr},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.24314160},
  url       = {https://github.com/michaelschueler/atomic-femdvr}
}
```

See also [CITATION.cff](CITATION.cff).

## ⚖️ License

The code is licensed under the MIT License. The test pseudopotentials in
`tests/data` are taken from [PseudoDojo](http://www.pseudo-dojo.org) (M. J. van
Setten et al., Comput. Phys. Commun. **226**, 39 (2018)) and distributed under
CC BY 4.0; see [tests/data/README.md](tests/data/README.md).

## 👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are
appreciated. See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for more
information.

### Development installation

```console
$ git clone https://github.com/michaelschueler/atomic-femdvr.git
$ cd atomic-femdvr
$ python3 -m pip install -e .
$ python3 -m pytest tests
```

The NIST benchmark test is skipped unless `pylibxc` is installed. With
[tox](https://tox.wiki) installed (`pip install tox tox-uv`), `tox -e py` runs
the tests, `tox -e lint` the linter and `tox -e docs` builds the documentation in
`docs/build/html`.

### Making a release

`tox -e finish` removes the `-dev` suffix from the version, builds and uploads
the package to PyPI, tags the release, and bumps the version. It needs a PyPI
token in the keyring (`keyring set https://upload.pypi.org/legacy/ __token__`).
After pushing, create a release on GitHub from the new tag.

### 🍪 Template

This package was created from
[@cthoyt](https://github.com/cthoyt)'s
[cookiecutter-snekpack](https://github.com/cthoyt/cookiecutter-snekpack)
template.
