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 viaconfirm_rangefor a fast two-pass check, or vianeighborhood_rangefor a direct wider check).pes_analyzer.extrema.find_maxima_grid— strict dual offind_minima_grid. Same stencil and sameneighborhood_range/confirm_rangesemantics; 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 aWatershed: 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_minimax_path— deep minimax path between two cells; withtree=it is reconstructed from the watershed's flood state instead of re-flooding.pes_analyzer.topology.find_steepest_descent_path,find_least_action_path,find_minimum_ascent_path— path kernels that follow the slope from a cell, minimise ∫ cost ds for a caller-built cost, or minimise the total climb; they take optional physical axis coordinates (axes=) and an end cell or a boolean target mask.pes_analyzer.topologymerge-tree helpers — pure-Pythoncompute_persistence,prune_merge_tree, and the traversableMergeTree(ws)(whose nodes areBasinNodes) analyse that merge tree.MergeTreeis 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 densenumpyarray indexed in axis order.pes_analyzer.grid.minimize_grid/jump_map/index_to_coords/path_length— minimised maps with the full index of each minimiser, the jump map that shows where the minimiser switches valley, and axis-coordinate helpers.pes_analyzer.synthetic— analytic surfaces (muller_brown,separable_wells,hidden_barrier) with exact minima, index-1 saddles and the minima each saddle joins, for tests and data-free examples.
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 |
grid.minimize_grid(energies, keep, *, threads=None) |
minimised map + full index of each minimiser | API.md |
grid.jump_map(index, keep) |
how far the minimiser moves between map neighbours | API.md |
grid.index_to_coords(indices, axes) |
grid indices → physical coordinates | API.md |
grid.path_length(indices, axes=None) |
cumulative Euclidean length along a path | 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_minimax_path(energies, start, end, tree=tree) |
deep minimax path from the watershed's flood state | API.md |
topology.find_steepest_descent_path(energies, start, *, axes=None, neighborhood="moore") |
steepest-descent path from a cell | API.md |
topology.find_least_action_path(cost, start, end, *, axes=None, neighborhood="moore") |
path minimising ∫ cost ds to a cell or mask | API.md |
topology.find_minimum_ascent_path(energies, start, end, *, axes=None, neighborhood="von_neumann") |
path minimising the total climb to a cell or mask | 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 |
synthetic.muller_brown(), separable_wells(ndim), hidden_barrier() |
analytic surfaces with exact critical points | 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):
ARCHITECTURE.md— repo layout, Python/Rust seam, GIL handling.DEVELOPMENT.md— building, testing, common workflows.
License
MIT — see Cargo.toml.
Metadata
Release files for pes-analyzer 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pes_analyzer-0.11.0.tar.gz | 591.8 kB | With provenance | Details for pes_analyzer-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pes_analyzer-0.11.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.11.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
Total release size: 1.1 MB
Release files / pes_analyzer-0.11.0.tar.gz
| Download URL | pes_analyzer-0.11.0.tar.gz |
|---|---|
| Size | 591.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a75e4713c9803d48e6f516218a3ed14576a3210865ae7680b9c61daa764d5746
|
|
BLAKE2b-256 checksum How to use checksums |
82012ec77058450f7298a6bfff3235e7e2c780d70868140db79c4e833f690c16
|
| 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 Oct 7, 2026.
Transparency logRelease files / pes_analyzer-0.11.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pes_analyzer-0.11.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 476.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a435f3b307d3468e42a4ccc833ac9dadc53deea79c62332ceec9cf28504e0974
|
|
BLAKE2b-256 checksum How to use checksums |
5e3c6030b78457173010e749d2f4f3971e6d3fadd5fe703947b5f5818b77b105
|
| 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 Oct 7, 2026.
Transparency logSecurity for pes-analyzer 0.11.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.
Attestation for pes_analyzer-0.11.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 Oct 7, 2026.
Transparency logA 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.