Skip to main content

hf-rs

hf-rs is a Rust library for Hartree-Fock methods, post-Hartree-Fock electron correlation methods and Hartree-Fock variants, with native Python bindings and an ASE calculator.

It includes 80 orbital basis families, per-element basis selection and analytic RHF/UHF nuclear derivatives through fourth order. The supported methods, reference types and response limits are listed in the method catalog.

The crate forbids unsafe Rust in its own code and uses Rayon and faer for numerical work. Independent scientific reference programs are used for validation, not at runtime. Published/default F12 agreement remains an explicit open validation item; see F12 status before using those model options.

Install

Rust 2024 edition and a recent stable toolchain are required.

cargo build --release
cargo install --path .

For Python 3.8 or newer, install from the extracted source directory. Building the native extension requires the Rust toolchain above.

python -m venv .venv
# Activate .venv using the command appropriate for your shell.
python -m pip install .
hf-rs --version

The distribution is hf-rs-python; its import name is hf_rs. This source installation also installs the hf-rs command. For ASE, use python -m pip install '.[ase]'. For editable development, install maturin and run maturin develop --release from the repository root.

Command line

hf-rs --method mp2 --geometry 'H 0 0 -0.7; H 0 0 0.7' --basis sto-3g
hf-rs --oracle-compare

Geometry defaults to bohr; XYZ input defaults to angstrom. --unit overrides the input unit. Results are JSON in atomic units; progress goes to stderr. The Python entry point hf-rs uses the same native calculation boundary.

Python

import hf_rs

positions = [[0.0, 0.0, -0.7], [0.0, 0.0, 0.7]]
result = hf_rs.run("mp2", [1, 1], positions, basis="sto-3g", unit="bohr")
print(result["e_total"])
molecule = hf_rs.Molecule([1, 1], positions, basis="sto-3g")
print(molecule.gradient())

Molecule reuses SCF for unchanged geometry, reference and SCF controls. Options are validated against the selected method; unknown names are errors.

ASE

from ase import Atoms
from ase.optimize import BFGS
from hf_rs import HFCalculator

atoms = Atoms("H2", positions=[[0, 0, -0.4], [0, 0, 0.4]])
atoms.calc = HFCalculator(method="hf", basis="sto-3g", scf_energy_tol=1e-13)
BFGS(atoms).run(fmax=0.01)

ASE uses eV/angstrom-based physical inputs and results, including HF observables and available analytic Hessians. Rust/native Python use atomic units. See the method recipes and observables and Molden/wavefunction exports.

Documentation

License

Copyright (c) 2026 ss0832. Licensed under Apache-2.0. Bundled BSE numerical data retain their third-party notice.

Metadata

Release files for hf-rs-python 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hf-rs-python 0.3.2
File Size Uploaded Provenance Actions
hf_rs_python-0.3.2.tar.gz 12.5 MB Without provenance Details for hf_rs_python-0.3.2.tar.gz

Release files / hf_rs_python-0.3.2.tar.gz

Download URL hf_rs_python-0.3.2.tar.gz
Size 12.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f90967692b9c12bb1287a706d661227923de7ab47bf68caf0a31c5b2e440c8ed
BLAKE2b-256 checksum
How to use checksums
851e348527c664b55d9792d1991b6b1df9ce77b08d2afed0c351341ec168c2d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for hf-rs-python 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page