Metadata-Version: 2.4
Name: flodi
Version: 0.1.0
Summary: Fields and Linear Operators for Differentiation and Integration
Author: Ivo Filot
License-Expression: MIT
Project-URL: Homepage, https://github.com/ifilot/flodi
Project-URL: Documentation, https://ifilot.github.io/flodi/
Project-URL: Source, https://github.com/ifilot/flodi
Project-URL: Issues, https://github.com/ifilot/flodi/issues
Project-URL: Changelog, https://github.com/ifilot/flodi/blob/main/CHANGELOG.md
Keywords: finite-difference,quantum-chemistry,hartree-fock,poisson,numerical-grids
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Provides-Extra: visualization
Requires-Dist: matplotlib>=3.6; extra == "visualization"
Requires-Dist: pytessel>=1.3.0; extra == "visualization"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Requires-Dist: matplotlib>=3.6; extra == "dev"
Requires-Dist: pytessel>=1.3.0; extra == "dev"
Requires-Dist: pillow>=9.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx<9,>=7.2; extra == "docs"
Requires-Dist: myst-parser<5,>=2; extra == "docs"
Requires-Dist: sphinx-rtd-theme<4,>=2; extra == "docs"
Dynamic: license-file

# FLODI

[![GitHub Actions](https://github.com/ifilot/flodi/actions/workflows/ci.yml/badge.svg)](https://github.com/ifilot/flodi/actions/workflows/ci.yml)
[![Version](https://img.shields.io/badge/version-0.1.0-blue)](https://github.com/ifilot/flodi/releases)
[![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue?logo=python&logoColor=white)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

**Fields and Linear Operators for Differentiation and Integration**

FLODI is a Python library for numerical fields on radial, spherical, and
prolate spheroidal grids. Sample a function, integrate products, apply a
Laplacian, solve Poisson's equation, or find low-energy orbitals while the
grid handles geometry and physical cell volumes. Quantum-chemistry examples
use atomic units.

## Install

Requires Python 3.10 or newer. Install the release from PyPI:

```sh
python -m pip install flodi
python -m pip install 'flodi[visualization]'
```

To work from a repository checkout, use `python -m pip install .` or
`python -m pip install '.[visualization]'` instead.

NumPy and SciPy are required. Matplotlib and PyTessel are optional; importing
the core library does not require either visualization package. Blender is
an optional external renderer, not a Python dependency.

## A first calculation

```python
import numpy as np
from flodi import RadialGrid

grid = RadialGrid.uniform(n_r=160, r_max=5.0)
source = grid.sample(lambda c: np.exp(-c.r**2) / np.pi**1.5)
potential = grid.poisson(source)
residual = grid.laplacian(potential) + 4 * np.pi * source
print(f"Integrated Gaussian: {grid.integrate(source):.8f}")
print(f"Poisson residual norm: {np.sqrt(grid.integrate(abs(residual)**2)):.3e}")
```

`grid.integrate` includes physical cell volumes; supply complex conjugation
explicitly for inner products. Orbital fields store physical amplitudes,
not reduced radial functions. Eigenstates have unit physical norm and zero
outer values. Poisson potentials instead match a source-free exterior that
decays at infinity. Finite grid spacing and finite domains still require
convergence checks.

`lowest_orbitals(potential, k=N)` returns ascending energies and N fields.
Radial local-potential problems use a tridiagonal solver; angular grids and
custom operator actions use a general eigensolver. Prolate angular sectors
are selected with `m=`. `grid.closed_shell(...)` retains the occupied state
for Hartree, exchange, Fock actions, and total-energy calculations.

## Develop and test

```sh
python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python -m unittest discover -s tests -t . -v
python website/source/examples/first_fields.py
```

A single BLAS thread often avoids thread overhead for these small problems.
The library leaves thread settings under the caller's control. All tests run
against the installed package; no assignment repository is needed. Tests of
PyTessel meshes are skipped when the optional package is unavailable.

## Repository contents

- `src/flodi/`: installable library, including private implementation modules.
- `tests/`: library and example regression tests.
- `examples/`: atomic and molecular worked calculations (N, E, and X series).
- `docs/field-guide.md`: representations, normalization, and grid conventions.
- `scripts/`: orbital rendering and numerical-investigation utilities.
- `docs/`: investigation notes and an archived obsolete example test.
- `website/`: Sphinx documentation sources, figures, and generation scripts.

Historical study notes retain references to the original authoring repository
and its build artifacts; those artifacts are not needed to use or test FLODI.

Read the [documentation](https://ifilot.github.io/flodi/), or build and preview
it locally:

```sh
python -m pip install -e '.[docs]'
python -m sphinx -b html -W --keep-going -n website/source website/build/html
python -m http.server 8080 --directory website/build/html
```

The student guides explain operation contracts, representation conventions,
and validation through independent Gaussian and finite-ball examples.
They support implementing an investigation without providing exercise solutions.
The documentation uses Sphinx with the Read the Docs theme. GitHub Actions
checks documentation builds on pull requests and deploys successful builds
from `main` to GitHub Pages. See [website/README.md](website/README.md) for
authoring and deployment details.

## Build and release

See [RELEASING.md](RELEASING.md) for validation and publication. Pushing a
version tag such as `v0.1.0` runs the release checks and publishes to PyPI
through the `pypi` environment. The tag must match `pyproject.toml`.
Branch pushes and pull requests do not publish packages.

## License

MIT; see [LICENSE](LICENSE).
