chemparseplot.plot.disconnectivity#
Approximate disconnectivity graphs from minima databases.
The classic disconnectivity graph needs transition states; a hopping campaign records only quenched minima. These helpers draw the superbasin merge tree of a descriptor-space k-nearest-neighbour graph instead: at each energy level the minima below it split into connected components, and components merge as the level rises. That approximation is a rendering of the database made for reading the figure; it should never feed a reported statistic.
Basins can be lumped for display by spectral clustering on the same graph. Everything is iterative: with a thousand minima the merge chains grow deeper than any recursion limit.
Added in version 1.10.0.
Module Contents#
Classes#
A merge-tree node; leaves carry their minimum’s index. |
Functions#
Merge near-identical minima, keeping the lowest-energy representative. |
|
Symmetric k-nearest-neighbour adjacency in descriptor space. |
|
Weakly connect graph components through their closest point pairs. |
|
Display-only basin assignment by spectral clustering on the graph. |
|
Superbasin merge tree over an energy-threshold sweep. |
|
Post-order traversal without recursion. |
|
Leaf x positions in tree order, children sorted deepest-first. |
|
Colour each subtree by the spectral basin of its deepest minimum. |
|
Vertical stems to the merge level, horizontal bars at merges. |
|
Full pipeline: dedup, graph, merge tree, spectral paint, draw. |
Data#
API#
- chemparseplot.plot.disconnectivity.BASIN_PALETTE#
None
- chemparseplot.plot.disconnectivity.dedup(matrix, energies, tol)#
Merge near-identical minima, keeping the lowest-energy representative.
Returns the kept row indices, lowest energy first.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.knn_graph(matrix, k=6)#
Symmetric k-nearest-neighbour adjacency in descriptor space.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.bridge_components(adjacency, matrix, weight=0.1)#
Weakly connect graph components through their closest point pairs.
Spectral clustering assumes a connected graph; a k-NN graph over a minima database often fragments. One weak edge per component pair (closest points in descriptor space) restores the geometry without drowning the strong intra-basin structure.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.spectral_basins(adjacency, n_basins, rng, matrix=None)#
Display-only basin assignment by spectral clustering on the graph.
With
matrixgiven, disconnected components are weakly bridged through their closest descriptor pairs first.Added in version 1.10.0.
- class chemparseplot.plot.disconnectivity.Node(level, children=None, leaf=None)#
A merge-tree node; leaves carry their minimum’s index.
Added in version 1.10.0.
Initialization
- __slots__#
(‘argmin’, ‘children’, ‘emin’, ‘leaf’, ‘level’, ‘x’)
- chemparseplot.plot.disconnectivity.merge_tree(adjacency, energies, levels)#
Superbasin merge tree over an energy-threshold sweep.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.iter_nodes(root)#
Post-order traversal without recursion.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.layout(root)#
Leaf x positions in tree order, children sorted deepest-first.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.paint(root, assign, palette=None)#
Colour each subtree by the spectral basin of its deepest minimum.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.draw(ax, root, colors, lw=1.1)#
Vertical stems to the merge level, horizontal bars at merges.
Added in version 1.10.0.
- chemparseplot.plot.disconnectivity.plot_disconnectivity(ax, matrix, energies, *, dedup_tol=0.15, knn=6, n_levels=48, n_basins=5, rng=None)#
Full pipeline: dedup, graph, merge tree, spectral paint, draw.
Returns
(kept_indices, root)so callers can label leaves.Added in version 1.10.0.