Skip to main content

pes_analyzer

Fast saddle-point and minimum analysis on dense N-D potential energy surface grids.

Python ≥ 3.10 · Rust 2024 edition · N-D grids for N ∈ [2, 7] · MIT

Why

Quantum-chemistry calculations produce potential energy surfaces (PES) as dense tables of energies on a multidimensional grid of geometric coordinates. Once that grid exists, the interesting analysis questions are topological: where are the minima, where are the saddle points, which basins are connected to which? pes_analyzer answers those questions on grids that may be too large for pure-Python approaches by pushing the inner loops into Rust.

What it does

  • pes_analyzer.saddle.find_iwf_grid — imaginary water flow (watershed) saddle search between two grid points.
  • pes_analyzer.extrema.find_minima_grid — local minima on the Chebyshev king-move stencil (default 3ᴺ−1; widen via confirm_range for a fast two-pass check, or via neighborhood_range for a direct wider check).
  • pes_analyzer.extrema.find_maxima_grid — strict dual of find_minima_grid. Same stencil and same neighborhood_range / confirm_range semantics; output sorted descending by energy.
  • pes_analyzer.extrema.find_extrema_grid — combined single-sweep search. Returns (minima, maxima) byte-identical to calling the two single-polarity functions separately, at the cost of one extra-list allocation but one fewer stencil walk per cell.
  • pes_analyzer.topology.find_watershed_segmentation — full watershed flood returning a Watershed: basin labels, the merge (saddle) events, and optionally each cell's flood parent (parents=True). Peak memory 8N + 4V bytes; drop_labels() releases the grid arrays.
  • pes_analyzer.topology.find_minimum_energy_path — deep minimax path between two cells; with tree= it is reconstructed from the watershed's flood state instead of re-flooding.
  • pes_analyzer.topology merge-tree helpers — pure-Python compute_persistence, prune_merge_tree, and the traversable MergeTree(ws) (whose nodes are BasinNodes) analyse that merge tree. MergeTree is physics-free: it exposes neutral traversal, membership, and geometry primitives that a consumer composes with its own predicates to label ground states, saddles, fission exits, etc.
  • pes_analyzer.grid.build_dense — scatter helper that turns sparse (coords, value) rows into a dense numpy array indexed in axis order.

Installation

pip install pes_analyzer

Wheels bundle the full reference docs under pes_analyzer/_docs/ — see Documentation. Building from source (PyO3 + Rust via maturin) and contributor workflows are covered in DEVELOPMENT.md.

Quickstart

import numpy as np

from pes_analyzer.saddle  import find_iwf_grid
from pes_analyzer.extrema import find_minima_grid

# A toy 2x5 PES: two basins at (0, 0) and (0, 4) along the top row,
# separated by a hump that peaks at (0, 2). The bottom row is a high
# wall, so any path between the basins must cross the hump.
energies = np.array([
    [0.0, 1.0, 2.0, 1.0, 0.0],
    [3.0, 3.0, 3.0, 3.0, 3.0],
])

print(find_minima_grid(energies))
# [((0, 0), 0.0), ((0, 4), 0.0)]

print(find_iwf_grid(energies, start=(0, 0), end=(0, 4)))
# ((0, 2), 2.0)

API at a glance

Function Purpose Reference
grid.build_dense(coords, values) sparse rows → dense N-D array API.md
saddle.find_iwf_grid(energies, start, end) watershed saddle search API.md
extrema.find_minima_grid(energies, *, neighborhood_range=1, confirm_range=None) local minima (Chebyshev stencil) API.md
extrema.find_maxima_grid(energies, *, neighborhood_range=1, confirm_range=None) local maxima (dual of find_minima_grid) API.md
extrema.find_extrema_grid(energies, *, neighborhood_range=1, confirm_range=None) combined single-sweep search API.md
topology.find_watershed_segmentation(energies, neighborhood="von_neumann", *, parents=False) full basin labelling + merge tree (Watershed) API.md
topology.find_minimum_energy_path(energies, start, end, tree=tree) deep minimax path from the watershed's flood state API.md
topology.compute_persistence(basins, merges) per-basin topological persistence API.md
topology.prune_merge_tree(basins, merges, threshold) drop low-persistence basins API.md
topology.MergeTree(ws) traversable basin merge tree (physics-free primitives; drop_labels()) API.md

Documentation

The consumer reference docs are bundled in the installed package under pes_analyzer/_docs/; locate them at runtime with pes_analyzer.docs_path().

  • USAGE.md — end-to-end pipeline cookbook (start here).
  • API.md — full API reference with examples.
  • ALGORITHMS.md — how the watershed and minima algorithms work.

Developer-facing docs stay in the repo (not bundled):

License

MIT — see Cargo.toml.

Metadata

Release files for pes-analyzer 0.10.0

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

Source distribution (sdist)

Source distribution for pes-analyzer 0.10.0
File Size Uploaded Provenance Actions
pes_analyzer-0.10.0.tar.gz 516.6 kB With provenance Details for pes_analyzer-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pes-analyzer 0.10.0
File Interpreter ABI Platform Actions
pes_analyzer-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for pes_analyzer-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Total release size: 952.9 kB

Release files / pes_analyzer-0.10.0.tar.gz

Download URL pes_analyzer-0.10.0.tar.gz
Size 516.6 kB
Tags Source
SHA-256 checksum
How to use checksums
68e6e640957f5639721b6585fd3ba814e67b92f732f55cab3c35a00c57672296
BLAKE2b-256 checksum
How to use checksums
5dfbc578efc38b959d15b896653daa79f596950716ff04629923d312ce3623b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / pes_analyzer-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pes_analyzer-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 436.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
af23103b57cbd25d23bda270d8c504883de0c369634ef5b92213bcbc8b1b2c6a
BLAKE2b-256 checksum
How to use checksums
ea5b58526e826a2e17b730cb40a3e75bc8e171bfe4112d1d9ce668afffc4123d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Security for pes-analyzer 0.10.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pes_analyzer-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

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.

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