Abstract
Algorithms are presented for performing a topological analysis of an arbitrary function, evaluated on an arbitrary grid of points. These algorithms work strictly by post-processing the data and require no additional function evaluations. This is achieved by connecting the grid points with a neighbourhood graph, allowing the topological analysis to be recast as a problem in graph theory. The flexibility of the approach is demonstrated for various applications involving analysis of the charge and magnetically induced current densities in molecules, where features of the neighbourhood graph are found to correspond to chemically relevant topographical properties, such as Bader charges. These properties converge using orders of magnitude fewer grid points than uniform-grid approaches, whilst exhibiting an appealing O(N log(N)) scaling of the computational cost. The issue of grid bias is discussed in the context of graph based algorithms and strategies for avoiding this bias are presented. Python implementations of the algorithms are provided.