Elamur Research

T opo MS: Comprehensive topological exploration for molecular and condensed‐matter systems

Paper · 2018 · Harsh Bhatia, Attila G. Gyulassy, Vincenzo Lordi et al.

Summary

An electron density calculation describes how electrons are distributed through a molecule or material. To use that density to study charge transfer, researchers need a way to decide which region belongs to each atom. They also need a way to trace connections between atoms through the density. The quantum theory of atoms in molecules, or QTAIM, approaches both questions through the shape of the density field. TopoMS brings the resulting analyses into one program. It measures the volumes and charges of regions associated with atoms and builds a graph that shows how important features of the density connect.

The program combines numerical trajectory tracing with a representation built from the cells of the sampling grid. It first follows the direction of increasing density to determine which peak attracts each part of the domain. Those assignments guide the construction of a Morse–Smale complex, which records how gradient paths organize the field around peaks, saddles, and minima. TopoMS extracts the molecular graph from that structure. It can then simplify the graph by canceling pairs of critical points in order of their persistence, a measure of how far apart their density values are. A graphical interface lets the researcher inspect the effects of those cancellations.

For atomic volumes and charges, TopoMS reported an approximate 2.5–3.9 times speed-up over Bader charge analysis v1.0 across the tested datasets. Its calculated charges changed less when the authors reoriented ethylene relative to the sampling grid. In a periodic system containing a lithium salt in ethylene carbonate, both programs approached their respective fine-grid charge estimates as the mesh was refined, with TopoMS converging slightly faster at the finer tested resolutions. Exact atomic charges were unavailable for these comparisons.

The molecular graph experiments show why a consistent representation matters. In benzene, TopoMS retained the ring connections after interactive simplification, while some carbon–carbon connections were already missing from the original Critic2 result. TopoMS preserved the expected topological count even in a periodic calculation that produced many spurious features. That same calculation also exposed a cost of the approach. Near-flat regions yielded a large discrete graph, and Critic2 finished sooner. The relative timing changed when benzene was treated as an isolated system. In the lithium salt system, TopoMS recovered recognizable molecular structures and completed the broader graph analysis substantially sooner than Critic2.

Deep dive: T opo MS: Comprehensive topological exploration for molecular and condensed‐matter systems

TopoMS uses electron density to measure atomic volumes and charges, trace molecular connections, and simplify noisy topological graphs. · about 36 minutes to read

The problem and its context

From an electron density to an atom

A density field gives a value at every position in a calculation. It does not come with a label marking the electrons that belong to a particular atom. This is the starting point of the paper. Atomic charges in molecules are unavailable as direct observables in the account the authors give. A calculation can supply the electron charge density, and a theory of how to divide that density can then define a charge for each atom. The division matters because it determines which portions of the density enter each charge estimate.

In QTAIM, the division follows the gradient, the direction and rate of local increase in density. Imagine beginning somewhere in the field and moving uphill in density, continuously updating the direction as the field changes. Many starting positions lead to the same peak. Together they form that peak’s basin of attraction. For an ordinary nuclear peak, its basin gives the volume assigned to the corresponding topological atom. Density outside the immediate neighborhood of the nucleus can belong to that atom if its uphill trajectories lead there. The resulting region can have an irregular shape determined by the nearby density.

Where neighboring basins meet, the density gradient is tangent to their separating surface. Its component normal to the surface vanishes, giving the term zero-flux surface. This condition defines the boundary through how the density changes in space. It also explains why the position of a boundary is important numerically. If an analysis puts it on the wrong side of a portion of the grid, density from that portion enters the integral for a different atom.

The same field contains more structure than the basins. A point can be a peak in some directions and a trough in another. Such a saddle can organize paths that run from its vicinity toward neighboring peaks. The molecular graph records the connections associated with a particular kind of saddle in the density. Knowing the charge assigned to each atom leaves open which atoms are joined by these paths. Conversely, a list of connections gives little information about how much volume or density the respective basins contain. The paper treats both as outputs of studying the same field.

How earlier tools handled the calculation

The paper describes early QTAIM approaches that worked with analytical descriptions of the density or the surfaces that separate atoms. These methods provided a route to atomic properties for small molecules, with limited scalability. The authors cite AIMAll as an example that takes a molecular wavefunction as its starting point. Grid-based methods grew in relevance because density functional theory calculations can already supply density samples on a grid. A program can work directly with those samples, which reduces the cost of the analysis and makes it applicable to the data produced by real-space and plane-wave calculations.

One influential grid method, by Henkelman and colleagues, sends an uphill path from each grid point. It chooses a step among the 26-neighbors and can stop when a path reaches an already assigned point. That shortcut lets the method reuse the work done by earlier paths. The choice of direction creates a problem, though. The continuous gradient can point between the available grid directions. Repeated choices from the grid can accumulate into a systematic displacement of a path, and the reconstructed interatomic surface can take on a preferred orientation from the sampling lattice.

The related work describes several ways of addressing this effect. Sanville and colleagues allowed trajectories to leave the grid while preserving the scaling behavior of the earlier method. Tang and colleagues kept the trajectory on grid points and carried along a correction for its deviation from the continuous direction. Once the correction had grown enough, it influenced the next discrete move. The paper notes that the piecewise-constant gradient used by this approach still introduces integration error that decreases linearly with grid spacing. A method can therefore address visible directional bias and still need very fine sampling to get the desired charge accuracy.

Yu and Trinkle addressed another part of the discretization problem. A voxel, the volume element of the grid, can straddle the division between basins. Their weighting scheme permits fractions of its volume to contribute to different assignments, improving the precision with which a boundary can be represented. The Bader charge analysis software used in the paper’s comparison incorporates techniques from this line of work. The authors also discuss approaches by Rodríguez and colleagues that use fixed or adaptive cellular grids to compute atomic properties without first constructing an explicit geometric surface around each basin.

Finding all the features needed for a molecular graph presents additional problems. The analysis has to locate critical points and trace the paths between them. The paper describes a grid-based method by Rodríguez that uses Newton–Raphson root finding to locate critical points, as well as a graphics processor implementation by Hernández-Esparza and colleagues. Critic2 offers a broader set of analyses, including the extraction of the paths that make up a molecular graph. The authors point to noise and discretization as reasons that numerical searches can return an incomplete or internally inconsistent set of features. A search for individual points and paths needs some way to check their relation to the field as a whole.

Why use a Morse–Smale complex?

Morse theory relates the stationary points of a scalar field to the way its gradient organizes space. The Morse–Smale complex captures that organization by partitioning positions according to where their gradient trajectories begin and end. Its graph records connections among critical points of different kinds. Its higher-dimensional pieces describe surfaces and regions, giving a common structure for studying both the partition into atomic basins and the paths in the molecular graph.

The authors identify earlier applications of Morse–Smale analysis to chemical systems, including work on ion diffusion and molecular interactions. The challenge for TopoMS was to turn those ideas into practical QTAIM software while retaining accurate geometry on a sampled field. A discrete complex built by choosing locally steep grid directions can be consistent as a combinatorial object and still put paths in the wrong places geometrically. The paper describes prior work that improved the geometry through a serial traversal, which the authors considered too costly for this application. It also describes parallel algorithms that assign discrete gradient vectors independently in small neighborhoods. TopoMS uses a conforming construction that gives those local assignments information from an earlier numerical calculation.

The paper places this effort within quantum chemical topology, where the field under investigation can also be a quantity such as the electron localization function or molecular electrostatic potential. Those possibilities motivate a general representation of the field’s topology. The implementation and evaluations in the paper focus on electron density, where the authors can examine the basin calculation and graph extraction together.

The method, step by step

What the gradient tells the program

TopoMS starts with sampled density values and information about the calculation domain. In the basin analysis, it looks for peaks in the sampled density, identifies grid vertices whose destinations can be assigned from their neighbors, and traces numerical paths for the remaining assignments. A correction pass revisits vertices along basin boundaries. If the requested output is atomic volumes and charges, the program can stop after assigning and integrating the basins. Graph extraction uses the resulting labels to build a discrete gradient, recover paths and critical cells, and organize possible simplifications.

From sampled electron density to a molecular graph

The steps in order.

From sampled electron density to a molecular graphStep 1: Screen low-density regions1. Screen low-density regionsStep 2: Identify peaks and establish certain regions2. Identify peaks and establish certain regionsStep 3: Trace trajectories and correct basin labels3. Trace trajectories and correct basin labelsStep 4: Match basins to atoms and integrate properties4. Match basins to atoms and integrate propertiesStep 5: Build a discrete gradient respecting basin boundaries5. Build a discrete gradient respecting basin boundariesStep 6: Extract critical cells and their connecting paths6. Extract critical cells and their connecting pathsStep 7: Prepare cancellations and smooth the displayed paths7. Prepare cancellations and smooth the displayed paths

In the continuous description, the paper begins with a smooth scalar function on a spatial domain.

f : M → ℝ

Here f assigns a real value to each position in M, the domain, and ℝ is the set of real numbers. The arrow describes the mapping. For the physical analysis the field of interest is the electron density. The paper also uses a sign-reversed field during construction of the discrete gradient.

A critical point is a position where the gradient vanishes. In the smooth part of the field, the condition is

∇f(p꜀) = (∂f/∂x, ∂f/∂y, ∂f/∂z)|p꜀ = 0

The symbol p꜀ denotes the critical point and ∇f is the gradient of f. The derivatives describe the rate of change of f with respect to the coordinates x, y, and z. The vertical bar indicates evaluation at p꜀, and 0 on the right represents the zero vector.

To classify such a point, the paper looks at the Hessian, the matrix of second derivatives. Its eigenvalues describe curvature along the principal directions at the point. A critical point is nondegenerate when the Hessian is invertible. In this setting the rank ω, the number of non-zero eigenvalues, is 3. The signature σ adds the signs of those eigenvalues, and the index counts the negative eigenvalues. For the density itself, the paper gives the following correspondence.

Shape of the densityIndexRank and signatureQTAIM name
Local maximum3(3, −3)Nuclear critical point (NCP)
Saddle with two negative curvature directions2(3, −1)Bond critical point (BCP)
Saddle with one negative curvature direction1(3, +1)Ring critical point (RCP)
Local minimum0(3, +3)Cage critical point (CCP)

The nuclear designation requires some care. The authors explain that an ideal point nucleus can give a density maximum where the gradient is discontinuous. A finite nucleus or a smooth density at a nucleus in a pseudopotential calculation permits the usual critical-point description. A density peak can also occur away from a nucleus. TopoMS searches the field for maxima before using the coordinates of the atoms, so a non-nuclear attractor has a route into the result.

The continuous trajectory through a position obeys the gradient equation.

∂L(t)/∂t = ∇f(L(t)),  ∀t ∈ ℝ

Here L(t) is a position along the trajectory at parameter t, and ∂L(t)/∂t is the tangent vector of the path. The right side evaluates the gradient of f at that position. The condition after the comma says that the equation applies for all real values of t. The path is fixed by its starting position.

L(0) = p

In this expression p is the chosen starting point, and L(0) is the position on the trajectory when t is 0. Later, the paper also uses L for a map of grid vertices to their eventual basin labels. The continuous path is the object being approximated when the program computes one of those labels.

Under the smooth construction, a trajectory has critical points at its backward and forward limits. An ascending manifold collects trajectories with a common origin. A descending manifold collects those with a common destination. In a domain of dimension d, the paper assigns an i-dimensional descending manifold to a critical point of index i, and an ascending manifold of dimension given by d minus i. Thus a maximum in the density receives trajectories from a region with volume, while a bond saddle has a one-dimensional ascending manifold. The portions of that manifold that run to density maxima supply the connections of interest in the molecular graph.

A Morse function has nondegenerate critical points. For a Morse–Smale function, the ascending and descending manifolds also intersect transversally. Transversality gives a controlled way for the families of paths to meet. Their intersections make up the cells of the Morse–Smale complex. The graph of its nodes and arcs is called its one-skeleton. In the continuous description, the arcs link critical points whose indices differ by one. The molecular graph selects the part that joins bond saddles to maxima, while the full skeleton includes the other types of critical points and their relationships.

From a basin to a volume and charge

In the density field, the surface between adjacent basins satisfies the zero-flux condition.

∇ρ(x) · n̂(x) = 0

Here ρ is the electron charge density, x is a position on the surface, and ∇ρ(x) is the gradient there. The symbol n̂(x) denotes the unit normal at that position. The dot product gives the component of the gradient normal to the surface, and 0 is the value of that component. The paper connects an interatomic dividing surface of this kind to the descending manifold of a bond saddle.

With a basin defined, its volume follows from integrating the volume element over the region.

VΩ = ∫Ω dx

The symbol Ω is the basin, VΩ is its volume, and dx is the spatial volume element. The integral is taken over the whole basin. The corresponding net charge uses the integrated density and the charge of the nucleus.

qΩ = ZΩ − ∫Ω ρ(x) dx

Here qΩ is the net atomic charge of basin Ω, ZΩ is the charge of its corresponding nucleus, and the integral gives the amount of electron charge associated with that basin under the paper’s density convention. The variable x ranges over positions in Ω. A boundary error affects the integration domain in both formulas, but the amount of charge affected also depends on the density in the misassigned volume.

Preparing the sampled domain

A regular volumetric mesh has vertices, edges, quadrilateral faces, and hexahedral cells. A face of a cell is a lower-dimensional part of its boundary. A facet is a face exactly one dimension lower. The distinction matters because the discrete gradient pairs a cell with a cell for which it is a facet. The reverse relation is called a cofacet. For example, a mesh edge has vertices as facets and can itself be a facet of a quadrilateral.

For the discrete construction, TopoMS reverses the sign of the density.

f(α) = −ρ(α)

Here α is a position at a mesh vertex, ρ(α) is its sampled density, and f(α) is the value used for ordering cells in the discrete construction. An ascent toward a density maximum is a descent in f. This change lets the program work with discrete arrows that follow the convention of descending values, while the physical interpretation still concerns motion uphill in density.

The construction needs a consistent answer when neighboring vertices have equal values. The paper uses simulation of simplicity, which establishes a strict order through an infinitesimal tie break. One expression for it is

f*(vᵢ) = f(vᵢ) + iε

Here vᵢ is the vertex with ordering identifier i, f(vᵢ) is its original value, and f*(vᵢ) is its value in the perturbed ordering. The positive infinitesimal ε breaks ties using the identifier, such as the order associated with a location in memory. The construction uses this order to select among equal samples while retaining the comparisons of unequal samples.

A vertex’s lower star groups the incident cells for which it is the highest-valued vertex in the ordered field. Each cell can be assigned to its unique highest vertex, so the lower stars divide the mesh into independently processable groups. The lower star also gives a way to screen regions of very low density. In the sign-reversed field, these are the regions of high value. The program works with a sublevel complex, the cells retained below a cutoff.

Vfₜ = {α ∈ 𝓜 | dim(α) = 0 and f*(α) < fₜ}

In this expression 𝓜 is the mesh, α is a cell, and dim(α) is its dimension. Dimension 0 selects vertices. The symbol fₜ denotes the threshold in the sign-reversed field and Vfₜ is the set of vertices below it. The vertical bar introduces the conditions for membership in the set.

𝓜fₜ = ⋃α∈Vfₜ St⁻(α)

Here 𝓜fₜ is the thresholded complex and St⁻(α) is the lower star associated with vertex α. The union gathers the cells belonging to the selected vertices. With a positive density cutoff, the threshold in the reversed field is the negative of that cutoff. The construction therefore retains the cells on the higher-density side of the screen.

The authors motivate this operation with the behavior of isolated systems. A large fraction of a simulation box can contain almost no density. Floating-point error and artifacts of constructing the original density can then be large relative to the remaining signal. Excluding those vertices also saves the work of evaluating gradients and launching trajectories there. TopoMS reports the volume and the charge in the screened region, so a basin report can account for how much of the original grid went into the vacuum category.

Establishing secure destinations

TopoMS first finds maxima from the grid’s own ordering. On a regular grid, a density maximum for this step is a vertex whose value exceeds those of its six edge-connected neighbors in the chosen ordering. In the sign-reversed field it has no lower neighbor to which a descending pairing could take it. These identified peaks become the destinations of numerical trajectories. This supplies stable stopping targets even when interpolation produces small stationary features between samples.

For each peak, TopoMS finds an atomic certain region. The rule considers strictly uphill paths on the edges of the grid. If all the higher neighbors of a vertex belong to the same certain region, any strictly increasing edge path beginning there must first enter that region. The vertex can therefore receive the same destination label. A vertex with higher neighbors that lead to different peaks requires further analysis.

A priority queue grows each region from its peak. The program considers the highest-density candidate first and admits it if all its higher edge neighbors already belong to the region. Admission adds its lower neighbors as candidates. Working down through the density makes the required neighbor assignments available when needed. The regions can be grown independently in parallel. They spare the program from tracing paths from already settled vertices and give the remaining trajectories a larger set of places at which to stop.

The paper compares this idea with earlier atomic trust spheres that use auxiliary grids around nuclei. Those methods establish a radius over which gradients point towards the nucleus under an angular criterion. The TopoMS procedure uses the connectivity and ordering of the existing grid. The shape of a certain region follows the outcome of those comparisons and can differ from the shape of a sphere centered at the nucleus.

Tracing and correcting basin assignments

For vertices outside the vacuum and certain regions, TopoMS estimates the direction of the gradient using central differences at grid vertices. It uses trilinear interpolation to evaluate that gradient at positions between vertices. The numerical path can therefore take steps through the interior of grid cells. The implementation caches the gradients at the vertices of the current hexahedron so that subsequent interpolation in that cell can use the same values.

The integrator uses an adaptive Euler step. The equations in the paper write the step with the gradient of f. In applying the update to basin finding, the direction is the one leading towards a higher density, equivalently downhill in the sign-reversed ordering used for the discrete field. Using pₙ for the current position, the trial full step is

pₙ₊₁ = pₙ + t∇f(pₙ)

Here pₙ₊₁ is the trial next position, n indexes the integration steps, and t is the trial step size. The expression ∇f(pₙ) denotes the gradient used for advection at the current point under the trajectory equation. The method also computes a midpoint estimate from a shorter step.

p′ₙ₊½ = pₙ + (t/2)∇f(pₙ)

The prime marks a position on the two-step trial, and p′ₙ₊½ is its intermediate point. The quantity t/2 is half the step size. As in the full step, pₙ is the current accepted point and ∇f(pₙ) is the gradient evaluated there. The second shorter step uses the gradient at the newly estimated position.

p′ₙ₊₁ = p′ₙ₊½ + (t/2)∇f(p′ₙ₊½)

Here p′ₙ₊₁ is the endpoint after both short steps, and ∇f(p′ₙ₊½) is the gradient at the intermediate position. Re-evaluating the gradient there lets the two-step trial respond to a change in direction along the path. The discrepancy between the two endpoints estimates stepping error.

ε ≈ pₙ₊₁ − p′ₙ₊₁

Here ε denotes the integration error estimate, distinct from the infinitesimal used for tie breaking. The symbol ≈ indicates an approximation. The positions on the right are the endpoints of the full step and the two shorter steps. Their difference measures the disagreement between the updates. TopoMS doubles the step size when the error estimate is below the user’s threshold and halves it and retries when the error exceeds that threshold. A separate limit caps the displacement at 1/2 the grid spacing. A path can stop when it comes within half a grid spacing of a vertex in a certain region.

The first labeling pass uses path compression. When a trajectory reaches a labeled destination, the program can assign the vertices near the traced path to the same basin. A subsequent trajectory can end near a previously labeled vertex and use its assignment. The label map is a flat array shared by the threads. Reads and writes use the atomicity of integer operations, and the first pass avoids synchronization of the whole decision about whether to trace or assign a vertex.

A label assigned this way can be wrong near a dividing surface. Proximity to the same numerical path is insufficient when nearby vertices lie in different basins. Threads can also read a label and make an assignment while assignments in that neighborhood are changing. The correction pass takes vertices along the boundary between labels and traces each again from its own starting point, allowing it to stop only in a certain region. Changing a label can expose further boundary vertices. The program repeats the process on those boundaries until their vertices have been corrected. This is how the method combines an inexpensive initial labeling with a more cautious determination of the assignments most sensitive to error.

The completed map links each retained vertex to a density peak. If atomic coordinates are available, TopoMS looks up the closest atom to each peak using a kd-tree, a search structure that subdivides positions in space. Because the atom coordinates enter after peak detection, an attractor can appear in the field without having been supplied as a starting atom. The program obtains basin volumes and charges from the grid vertices carrying each basin label.

Building a discrete gradient that respects the basins

Topological graph extraction begins by extending the vertex labels to a flag on every cell. A cell belongs to a single basin at its vertices or straddles a change in labels. The rule can be written as

∂L(α) = 0 if |{L(v) : v is a vertex of α}| = 1, and 1 otherwise

The map L gives the final basin label of a vertex v. In this context α is any mesh cell and ∂L(α) is its boundary flag. The braces form the set of different labels found among its vertices, the vertical bars give the size of that set, and the colon introduces the condition on v. A value of 0 marks a cell with a single label. A value of 1 marks one with more than one.

A discrete vector pairs a cell α with a cofacet β. Its geometric direction can be pictured using the centers of the paired cells.

B(β) − B(α)

Here B gives the barycenter of a cell, obtained by averaging the coordinates of its vertices. The displayed difference is the displacement from the barycenter of the tail α to the barycenter of the head β. For computing connectivity, the important part of the vector is the pairing itself. Each cell can participate in at most one such pair. An unpaired cell is critical, with its dimension giving its discrete index.

The algorithm processes the lower star of each vertex separately. It first chooses an eligible edge in the direction of steepest descent from the vertex. The edge must have the same boundary flag as the vertex. A vertex always has a single label, so an edge connecting vertices with different basin labels is unavailable for that first pairing. When there is no eligible edge, the algorithm marks the vertex as critical.

For the remaining cells, the algorithm works upward through cell dimensions. It looks for an unassigned higher-dimensional cell with a unique unassigned and conforming facet in the same lower star. Cells conform when their boundary flags agree. The construction pairs the facet with the higher-dimensional cell when the expansion conditions hold. If the current candidates cannot be assigned through these expansions, an unassigned cell of the dimension under consideration is declared critical. The lower-star restriction prevents one vertex’s work from competing for cells assigned to another vertex’s group.

The arrangement gives a discrete gradient with no closed gradient paths. The ordering regulates movement between lower stars, and the expansion rule regulates pairings within each one. The basin constraint supplies additional information about where paths should go. For example, a vertex can continue across a paired edge through another vertex only when that edge is internal to the corresponding assignment. Cells on the boundary can participate in the discrete construction with other boundary cells. The program can therefore recover topological features of the division without allowing its basin trajectories to traverse a label change.

Following the discrete flow

A step through the mesh uses the partner of a cell and the facets of that partner. Expressed directly in terms of the operations described in the paper, the step is

Φ(α) = facets(v(α))

Here Φ is the discrete flow operator, α is the current cell, and v(α) is the head paired with α when α is a tail. If α has no such partner, v(α) is empty and there is no step of this kind. The facets operation returns the boundary cells one dimension lower than the head. A path continues through a different facet of that head. The notation in the paper puts a dimensional subscript on the facet operation. In the traversal, both successive tail cells are facets of the intervening head.

The paper describes such a sequence as a V-path.

α₀, β₀, α₁, β₁, α₂, …, βᵣ, αᵣ₊₁

In this sequence the α cells are the successive cells at the starting dimension. The β cells are the intervening heads, each one dimension higher. The subscripts give the path order and r indexes the final head. Each β is paired with the preceding α, and the next α is another facet of that β. The sequence replaces the continuous task of following a gradient for an arbitrarily long time with a traversal among mesh cells.

TopoMS records critical cells as nodes. It uses a depth-first search to trace paths and record the arcs between them in the topological skeleton. It uses breadth-first searches over reachable cells to recover the ascending and descending manifolds. The full structure describes relationships among all classes of critical cells. The molecular graph uses the paths between bond saddles and maxima in the density. With the sign reversal in place, the corresponding critical indices must be interpreted in the field used by the discrete construction.

The paper gives an alternating count that ties the critical points to the topology of the domain.

χ(M) = ∑ᵢ (−1)ⁱ cᵢ

Here χ(M) is the Euler characteristic of the domain M, i is the critical-point index under the chosen convention, and cᵢ is the number of critical points with that index. The sum ranges over the indices, and the factor involving −1 gives opposite signs to neighboring index classes. The paper gives +1 for a nonperiodic domain equivalent to a filled ball and 0 for a domain periodic in all directions. In applying the count, the index convention and the domain under analysis matter. A periodic grid treated in its entirety and a selected portion around an isolated molecule are different cases.

Simplifying the graph and drawing its paths

Two critical points of consecutive indices can be candidates for cancellation when a single arc connects them in the complex. The program ranks such cancellations by persistence, the absolute difference in the field values of the paired points. Low-persistence pairs can arise from small fluctuations in the density or from sampling artifacts. Performing a cancellation updates the arcs so that the resulting skeleton represents the coarser topology. The two removed points contribute opposite signs to the alternating count, which explains how a series of valid cancellations preserves that count.

TopoMS stores the simplification as a hierarchy. A researcher can inspect the graph at different persistence levels, seeing which features disappear and how the remaining arcs connect. This is a study of the effect of simplifying the topological structure. The vacuum threshold has a different role. It specifies which low-density part of the field is screened from the calculation. A sparse graph can result from either choice, but the two choices act on different objects.

The discrete paths supply the graph’s connectivity. A path drawn directly through grid vertices can still show the orientation of the mesh. For a smoother geometry, TopoMS traces a numerical trajectory from the first vertex of the discrete saddle-to-maximum path. When the trajectory comes within half a grid cell of the intended maximum, the program attaches it to that peak. If it instead arrives near another maximum, TopoMS tries again from the next vertex of the discrete path. It continues until the numerical geometry agrees with the identified connection. This keeps a numerical error during rendering from silently changing the graph’s endpoints.

TopoMS v1.0 is implemented in C++ and was released under the GNU General Public License. Its input formats are VASP CHGCAR/AECCAR and Cube. A configuration specifies the input, the analysis to run, and the relevant parameters. The command-line program can output atomic volumes and charges, a basin labeling, and a graph at selected levels of simplification and filtering. The graphical interface supports exploration of those levels alongside a viewer. The software uses OpenMP for shared-memory computation and can export volume and graph data in formats suitable for separate visualization.

Experiments and results

What the comparisons measure

The authors separate the evaluation of basin integration from the evaluation of molecular graph extraction. For the former, they use Bader charge analysis v1.0 as the comparison program. They measure elapsed time, examine the shapes of corresponding basins, and compare the charges assigned to atoms. They also ask whether the charges are stable when the molecule is reoriented and whether estimates approach a fine-grid reference as the mesh is refined. For graph extraction, the comparison program is Critic2. The authors examine elapsed time, the critical-point counts, the connections visible in the resulting graph, and what happens when low-significance structure is removed.

The experiments ran on a MacBook Pro with a 2.8 GHz Intel i7 processor, 4 cores, and 16 GB memory. These specifications fix the context for the elapsed times. The basin benchmark includes water, benzene, two ethylene orientations, a NaCl crystal, and lithium salt in ethylene carbonate. The grids vary in size, and the domains differ both in the number of atoms and in the fraction they devote to vacuum. Those differences make the collection useful for examining runtime across inputs. The detailed chemical and numerical analyses concentrate on selected systems within it.

Basin runtimes and small-molecule checks

Across the basin benchmarks, the paper describes an approximate 2.5–3.9 times speed-up for TopoMS. On the water grid, Bader charge analysis took 1.51 seconds and TopoMS took 0.597 seconds. For the NaCl crystal on a [160 × 160 × 160] grid, the respective times were 29.37 and 7.581 seconds. The authors note that workload depends on the amount of vacuum and the number of atoms as well as the grid dimensions. Runtime on equal-sized meshes can therefore vary with the contents of the domain.

For water, the input is a Cube file giving the MP2 total electron density on a [201 × 201 × 201] grid. The authors classify density below 10⁻³ e/ų as vacuum. The assignments show the expected equivalence of the two hydrogen atoms. Each has a reported QTAIM charge of 0.6325736 e and basin volume of 20.6241691 ų. Oxygen has a reported charge of -1.1746194 e and volume of 154.1277976 ų. The positive hydrogen charges and negative oxygen charge give the direction of charge transfer in the partition. The shape of the oxygen basin is concave where the neighboring hydrogen regions enter the picture. The surface rendering is smoothed, while the underlying assignments are sampled on the mesh.

Water serves as a check that the numerical procedure recovers equivalent basins and charges for equivalent positions in a familiar molecule. It also illustrates the remaining effect of sampling. The paper reports a small non-zero net charge for the grid and attributes it to numerical artifacts. With the same vacuum cutoff, the authors say that the Bader program matched the water results up to three decimal places. The agreement is reported in prose, with no separate set of comparison values for each atom.

For ethylene, the input is valence density in VASP CHGCAR format, sampled on a [140 × 140 × 140] grid with a box length of 10 Å along each side. The vacuum cutoff is again 10⁻³ e/ų. The basin visualizations from the two programs almost coincide, with small discrepancies near the boundaries. Their per-atom charges are also comparable. The stability test uses ethylene-a and ethylene-b, which place the same molecule differently relative to the sampling mesh. The change in the computed charge for each atom between orientations is smaller with TopoMS in the authors’ comparison. The figure shows the pattern across atoms without a single numerical summary of the orientation effect.

A periodic system and a sequence of finer meshes

The larger basin example contains lithium salt in 63 molecules of ethylene carbonate. Its total charge density comes from VASP AECCAR0+AECCAR2 data. The system contains 638 atoms in a periodic box roughly 19.283 Å on each side, with [280 × 280 × 280] as the main analysis grid. The dataset lets the authors compare repeated instances of similar atoms throughout the system as well as individual results between the programs. Basin visualizations for the selected atoms shown in the paper are visually indistinguishable between the two programs.

The TopoMS charge distribution shows similar values across atoms of the same type in the ethylene carbonate molecules. The paper reports average QTAIM charges of about -2.08 electrons for carbonyl carbons and about -0.36 electrons for ether carbons. In the comparison between programs, most per-atom differences are roughly within 0.02 electrons. The largest hydrogen differences reach 5% relative to the number of hydrogen valence electrons, and the ether-carbon differences are bounded by about 2% in relative terms. The authors locate the clearest differences around carbon–hydrogen connections. In their account, TopoMS assigns more electron charge to hydrogen and less to ether carbon than the Bader program. That description refers to the distribution of electron density among basins.

The convergence study uses the same system sampled at different resolutions. For each program, the authors take its own result on a [1120 × 1120 × 1120] grid as its reference. They evaluate the mean, maximum, and standard deviation of the relative deviations from that reference. The paper reports comparable errors for the programs at resolutions below [210 × 210 × 210]. As the grid is refined, TopoMS approaches its reference slightly faster. The differences between the programs also shrink with mesh refinement. Taken together, the two observations support convergence toward a common value, although neither reference is an exact charge.

The per-atom plots provide a complementary view. Between the displayed resolutions 120 and 560, the reported error scale drops from 3 electrons to about 0.03 electrons. Hydrogen errors become more prominent within that smaller overall range. Relative to its own reference, the Bader program shows a systematic pattern of overestimates for ether carbons and underestimates for hydrogen in the paper’s plots. The authors also observe overestimation for carbonyl carbons and underestimation for most oxygens in both programs. These patterns helped motivate their judgment that, for this dataset, the TopoMS charges on the [280 × 280 × 280] grid could be closer to the fine-grid result.

The runtime measurements cover a sequence from [120 × 120 × 120] to [560 × 560 × 560]. At the main [280 × 280 × 280] resolution, the basin analysis took 62.53 seconds with the Bader program and 18.155 seconds with TopoMS. The runtime advantage persists on the largest timed grid in that series. The fine-grid resolution used as the accuracy reference is separate from the largest grid in the timing comparison.

Basin analysis time for lithium salt in ethylene carbonate on the [560 × 560 × 560] grid

TopoMS completes the basin analysis sooner on the largest timed grid.

Basin analysis time for lithium salt in ethylene carbonate on the [560 × 560 × 560] gridBader charge analysis: 506.06Bader charge analysis506.06TopoMS (this paper): 141.163TopoMS (this paper)141.163
The numbers
System or settingseconds
Bader charge analysis506.06
TopoMS (this paper)141.163

The benzene graph under two treatments of the domain

The authors use the symmetry and recognizable ring of benzene to inspect the extracted connectivity. The input is total density from VASP AECCAR0+AECCAR2 on a [200 × 200 × 200] grid. Though the molecule is isolated physically, the experiment also keeps the periodic domain and its low-density surroundings to show what happens when those regions remain in the calculation. In that treatment, the analysis has to contend with many weak features and paths reaching across the periodic boundary.

The original Critic2 output contains 865 critical points. These comprise 95 NCPs, 325 BCPs, 323 RCPs, and 122 CCPs. The paper reports a Morse sum of −29 and regards the result as topologically inconsistent. After discarding critical points with density below 10⁻⁶, the reported counts are 12 NCPs, 15 BCPs, 6 RCPs, and 2 CCPs, for 35 points in total. The paper reports a Morse sum of +1 for this filtered result and treats it as consistent with an isolated system. Yet the graph still presents problematic paths, and some connections around the carbon ring are absent. The figure caption identifies three missing carbon–carbon bonds and says the loss is already present in the original result. A correct alternating count can coexist with incomplete molecular connectivity.

Without a vacuum threshold, TopoMS finds 13,418 discrete critical points in the periodic domain. The paper records 1255 NCPs, 5060 BCPs, 5454 RCPs, and 1649 CCPs. Many occur where the density or its gradient is very small and the field is sensitive to noise. The count gives the expected Morse sum of 0 for the periodic treatment. After interactive simplification and filtering, the TopoMS graph shows a hexagonal ring and outward paths to hydrogen. The example illustrates how the full complex provides a consistent representation of a noisy field from which the user can recover a recognizable molecular graph.

The many critical cells also create extra work. In the periodic case, TopoMS computes the topology along with a range of simplifications, and its denser representation takes longer to construct. The comparison changes when the authors run benzene as an isolated system. The chart reports the two timings in each treatment.

Molecular graph extraction time for benzene under periodic and isolated treatments

Critic2 is quicker in the noisy periodic treatment, while TopoMS is quicker in the isolated treatment.

Molecular graph extraction time for benzene under periodic and isolated treatmentsCritic2, noisy periodic calculation: 15Critic2, noisy periodic calculation15TopoMS, noisy periodic calculation (this paper): 19.3TopoMS, noisy periodic calculation (thispaper)19.3Critic2, isolated calculation: 14Critic2, isolated calculation14TopoMS, isolated calculation: 12.4TopoMS, isolated calculation12.4
The numbers
System or settingseconds
Critic2, noisy periodic calculation15
TopoMS, noisy periodic calculation (this paper)19.3
Critic2, isolated calculation14
TopoMS, isolated calculation12.4

The periodic timings include the work that TopoMS performs to support subsequent interactive simplification. The paper gives the Critic2 periodic timing as approximate. Both details matter when reading the comparison as evidence about the cost of producing the raw topology and preparing it for inspection.

Extracting a graph in the condensed system

The lithium salt in ethylene carbonate provides the second molecular graph experiment. Here periodicity is part of the system being studied. The question is whether the graph can expose recognizable structures in a much more crowded field. After choosing levels of simplification and filtering, the authors show the connections within ethylene carbonate molecules and the hexafluorophosphate ion. These connections come from the density’s critical points and gradient paths. The procedure does not require a distance cutoff assigning bonds to pairs of nearby atoms.

TopoMS took about 55.4 seconds for the complete workflow reported for this case, including QTAIM analysis and the work of simplifying and filtering the graph to an appropriate level. Critic2 took about 223 seconds for what the authors describe as a similar analysis. This result illustrates the paper’s headline performance claim of up to 4x on the tested laptop. The demonstrated graph shows selected recognizable structures. The paper evaluates them by inspecting the resulting connectivity, rather than by scoring all possible connections in the periodic box against an independently labeled graph.

Reported molecular graph analysis time for lithium salt in ethylene carbonate

TopoMS finishes sooner in the authors’ comparison on the condensed system.

Reported molecular graph analysis time for lithium salt in ethylene carbonateCritic2: 223Critic2223TopoMS (this paper): 55.4TopoMS (this paper)55.4
The numbers
System or settingseconds
Critic2223
TopoMS (this paper)55.4

What the ablations show

The paper gives no component-removal ablation and instead analyzes sensitivity to mesh orientation, sample resolution, and the treatment of low-density topology. These comparisons examine different failure modes. Rotation can change a charge estimate even when the molecule is the same. Refinement tests whether errors shrink against a fixed fine-grid reference. Changing the treatment of the vacuum and simplifying the topology reveal how weak density features affect the graph and the time required to construct it.

Orientation and resolution test different numerical effects

Reorienting ethylene changes how interatomic surfaces meet the grid. The near agreement between the plotted basins from the two programs at a single orientation leaves room for each program to respond differently to that change. Comparing the corresponding atoms across both orientations makes this sensitivity visible directly in their assigned charges. The smaller variability reported for TopoMS is consistent with the use of numerical paths that can move between mesh vertices and with the correction of boundary labels after the first pass. The experiment changes the orientation of the input to the entire pipeline. It supplies evidence for the combined basin algorithm, without isolating an effect for interpolation, integration, or boundary correction individually.

The lithium salt refinement experiment changes the amount of spatial detail in the input. Both programs produce comparable deviations from their references at the coarser tested resolutions. At finer resolutions the TopoMS deviations shrink somewhat faster. This behavior fits a situation in which coarse samples impose a limit shared by both methods, while better sampling gives the basin algorithms more information with which to resolve the boundaries. The authors describe coarse sampling as lossy. Their evidence for the finer range comes from the progression of the measured errors, instead of a fitted convergence rate.

The per-atom refinement plots also suggest where to look for allocation differences. The error patterns for ether carbons and hydrogens persist across changes in the overall scale of the errors. When considered alongside the direct comparison between programs on the main grid, those patterns support the authors’ interpretation that the methods distribute density differently between the atoms at carbon–hydrogen connections. A single average deviation would conceal the signs of these differences and the fact that they cluster by atom type.

Screening and simplification affect the graph in different ways

The noisy benzene run probes the cost of preserving a discrete account of the entire field. TopoMS represents many critical cells in near-flat portions of the domain. They enlarge the amount of topology it must construct and simplify. The periodic calculation shows how the discrete method can account for these features in the global invariant even when they make the original graph too complicated to inspect comfortably. The isolated calculation shows that excluding much of this low-density material changes the relative runtime of the programs. The result ties the runtime advantage to properties of the input and to the choice of domain.

The Critic2 comparison illustrates the difference between a density filter and a topological cancellation. A filter on the values of individual critical points can remove much of the visual clutter. It can also produce a set of counts that satisfies the reported consistency check for the isolated case. In the example, that change leaves gaps in the benzene ring that were already present in the initial output. Removing weak-looking features after extraction gives no mechanism for reconstructing a connection that the initial search missed.

TopoMS begins with a connected discrete structure and simplifies it by canceling eligible pairs and updating the remaining arcs. The benzene example shows that this process can keep the ring visible while removing much of the topology in the surroundings. The mechanism explains preservation of the alternating count across cancellations. The experiment illustrates preservation of the expected ring connections at the levels chosen by the authors. The count and the visual result answer different questions and are both needed to understand what the comparison establishes.

The paper also describes the purpose of shortcuts such as certain regions and path compression. Certain regions reduce the number and length of numerical trajectories. Path compression lets later trajectories use earlier assignments, and boundary reintegration addresses errors introduced by that shortcut. The timing results concern the implemented pipeline. They do not assign a separate runtime or accuracy contribution to each shortcut, nor do they measure the effect of turning off the conforming gradient constraint.

Limitations

Limits the authors state

The authors state that exact basin volumes and atomic charges are unavailable for the datasets they use. Stability under rotation, agreement between programs, and convergence as the grid is refined are indirect tests. Each program’s fine-grid solution provides a practical reference for its own refinement experiment. The closing gap between programs supplies further evidence about their limiting behavior. An error measured against either reference remains a difference from a finely sampled computation.

The authors also describe the cost of taking a discrete representation through regions where the gradient is nearly zero. The benzene case yields many more critical cells in TopoMS than the number of critical points located numerically by Critic2. A valid complex can faithfully record such discrete structure while demanding more work to build and simplify. The reported change in relative speed between the periodic and isolated benzene cases makes this limitation concrete.

The first release and experiments concern electron charge density. The software architecture is designed to allow future additions. The authors suggest broadening the range of accepted input formats, investigating in situ analysis with VASP, and using the framework to study quantities such as molecular electrostatic potential and the electron localization function. The paper demonstrates file-based analysis for its supported density inputs. Its test results establish performance and behavior in that setting.

Limits evident from the experiments

Topological consistency supplies a constraint on what the extracted graph can be. The alternating count checks a global invariant, and the construction supplies a coherent set of cells and paths. Those properties alone cannot identify every individual feature as physically important. The unfiltered benzene graph shows why. Its count is valid even though many of the critical cells fall in low-density areas of little interest to the molecular analysis. Conversely, the filtered Critic2 result passes the reported count for the isolated case while still missing carbon-ring connections. The graph’s completeness for a given chemical question requires evidence about the individual connections as well as the invariant.

The comparison of Morse sums in the benzene example also requires attention to conventions. The paper gives a general formula indexed by critical-point class and reports particular signed sums in its account of the experiment. The interpretation of a non-zero count depends on the ordering used for the classes and on the domain or boundary treatment. In the benzene discussion, the relevant conclusions are the paper’s identification of an inconsistency in the noisy Critic2 output and its use of different expected invariants for the isolated and periodic results. A reader comparing those counts needs to keep both the sign convention and the treatment of the domain in view.

Persistence ranks eligible cancellations by field-value difference. It gives the researcher a principled way to inspect the effect of progressively coarser topology. In the graph examples the authors choose levels interactively. The paper does not give a rule that automatically selects a chemically appropriate level for every input or verify the selection across a broad set of difficult cases. Similarly, obtaining connections without a distance threshold for bond detection still leaves choices about the density screen, numerical integration, and the amount of graph simplification. The graph represents interaction paths in the density, with the paper using the bond-path interpretation under the stated condition of vanishing forces on the atoms.

The orientation experiment covers one molecule in two alignments. It demonstrates reduced variability in that comparison, while leaving the response to a broader set of rotations, translations, systems, or grids open. The detailed refinement evidence comes from the lithium salt case. It provides a view across mesh sizes and atom types within that system. It supplies less evidence for how fast convergence will be for another density with different features near basin boundaries. Likewise, the water symmetry check establishes the recovery of a recognizable pattern, while visual basin agreement in the other examples has limited sensitivity to boundary discrepancies.

Finally, the experiments time the software on one shared-memory laptop. The timings establish a practical runtime comparison for the chosen datasets and settings. They do not provide a scaling curve over different numbers of cores or characterize performance on larger shared-memory machines. The graph cases also involve differences in the work each program performs, particularly the construction of the simplification hierarchy and the choice of output to inspect. The reported times are best read as timings for the described workflows. They support the speed claims for those workflows without identifying a general speed factor for every molecular graph calculation.

What came after

There are no documented follow-up studies to trace here. The paper closes with proposed extensions to other chemical fields, input formats, and in situ analysis. Those directions describe the authors’ plans at the end of the study. The demonstrated contribution is the joint use of numerically traced basins and a discrete Morse–Smale complex for electron-density analysis.

Cite

Cite as Harsh Bhatia, Attila G. Gyulassy, Vincenzo Lordi, John E. Pask, Valerio Pascucci and Peer‐Timo Bremer. 2018. T opo MS: Comprehensive topological exploration for molecular and condensed‐matter systems. Journal of Computational Chemistry.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1002/jcc.25181

@article{bhatia2018t,
  title = {{T opo MS: Comprehensive topological exploration for molecular and condensed‐matter systems}},
  author = {Harsh Bhatia, Attila G. Gyulassy, Vincenzo Lordi, John E. Pask, Valerio Pascucci and Peer‐Timo Bremer},
  journal = {Journal of Computational Chemistry},
  year = {2018},
  doi = {10.1002/jcc.25181},
  url = {https://doi.org/10.1002/jcc.25181}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bhatia-2018-t-opo-ms-comprehensive-topological/