11# cpp_hf — Fast Hartree–Fock on k‑grids (FFTW + Eigen + pybind11)
22
3+ [ ![ PyPI] ( https://img.shields.io/pypi/v/cpp-hf.svg )] ( https://pypi.org/project/cpp-hf/ )
4+ [ ![ Python] ( https://img.shields.io/pypi/pyversions/cpp-hf.svg )] ( https://pypi.org/project/cpp-hf/ )
5+ [ ![ Wheel] ( https://img.shields.io/pypi/wheel/cpp-hf.svg )] ( https://pypi.org/project/cpp-hf/#files )
6+ [ ![ License] ( https://img.shields.io/pypi/l/cpp-hf.svg )] ( LICENSE )
7+ [ ![ Release] ( https://github.com/skilledwolf/cpp_hf/actions/workflows/release.yml/badge.svg )] ( https://github.com/skilledwolf/cpp_hf/actions/workflows/release.yml )
8+
39cpp_hf provides a compiled extension module exposing a fast Hartree–Fock
410self‑consistent field (SCF) loop for uniform 2D k‑grids. It uses
511FFTW (batched 2D complex DFTs), Eigen (Hermitian eigendecompositions), and
@@ -13,28 +19,41 @@ pybind11 to bind the C++ implementation to Python.
1319This package is designed to interoperate with ContiMod, but it can be used on
1420its own as a lightweight HF kernel.
1521
22+ Project links:
23+ - PyPI: https://pypi.org/project/cpp-hf/
24+ - Source: https://github.com/skilledwolf/cpp_hf
25+
1626## Installation
1727
18- Prerequisites:
28+ Quick install (prebuilt wheel if available):
29+ ```
30+ pip install cpp-hf
31+ ```
32+
33+ Notes:
34+ - The import name is ` cpp_hf ` (underscore), even though the package name uses a hyphen.
35+ - Wheels may not be available for all platforms/Python versions yet; in that case pip will build from source.
36+
37+ Build from source (requirements):
1938- Python 3.8+
2039- A C++17 compiler
21- - FFTW (with threads recommended) and headers
40+ - FFTW and headers ( threads variant optional)
2241- CMake ≥ 3.21
2342
24- Install from source (recommended during development):
25-
43+ Build via pip (with optional CMake flags):
2644```
27- # Optional: choose features via -C flags
2845pip install . \
2946 -C cmake.define.HF_USE_OPENMP=ON \
3047 -C cmake.define.HF_USE_FFTW_THREADS=ON
3148```
3249
33- If you have Homebrew on macOS :
50+ macOS ( Homebrew) dependencies :
3451```
3552brew install fftw eigen cmake
3653```
3754
55+ If FFTW is not found, set one of ` PKG_CONFIG_PATH ` , ` FFTW3_DIR ` , or ` CMAKE_PREFIX_PATH ` to point to your installation.
56+
3857The repo includes a convenience script that activates a conda env and builds:
3958```
4059sh build_install.sh
@@ -90,29 +109,11 @@ hartreefock_iteration_cpp(
90109- Returns the converged density ` P ` , mean‑field ` F ` , total energy, chemical
91110 potential, and the iteration count.
92111
93- ## Building wheels / releasing to PyPI
94-
95- We use scikit‑build‑core, so building wheels is standard:
96-
97- ```
98- python -m pip install build twine
99- python -m build # creates dist/*.whl and dist/*.tar.gz
100- python -m twine upload dist/*
101- ```
102-
103- To test upload to TestPyPI first:
104- ```
105- python -m twine upload --repository testpypi dist/*
106- # then install with
107- pip install -i https://test.pypi.org/simple/ cpp_hf
108- ```
109-
110- Note: the name ` cpp_hf ` must be available on PyPI. If it’s taken, consider a
111- unique name such as ` contimod-cpp-hf ` and update ` pyproject.toml ` accordingly.
112-
113112## License
114113
115- MIT — see ` LICENSE ` .
114+ GPLv2+ — see ` LICENSE ` .
115+
116+ Third‑party notices: see ` THIRD_PARTY_NOTICES.md ` .
116117
117118## Acknowledgments
118119
0 commit comments