## Introduction

The “*quantum theory of* *atoms in molecules*” (QTAIM) developed by Bader et al.[1–8] is very useful to obtain the chemical information from the charge density. QTAIM is a firm, rigorous, and quantum mechanically well-defined theory based on observables such as the electron density or energy density fields. Most modern theories of bonding are based, in one way or another, on the partition of charge (or electronic density) among the different nuclear centers under study, usually according to Mulliken, that is, projected density of states in solid-analysis. In this way, an important amount of the interpretative models of chemical behavior are based on concepts that are known to be poorly defined and giving answers extremely dependent on a whole hierarchy of approximations.[6] QTAIM provides a quantitative link between the total electron density (regardless of how it was generated: calculated or experimental) and important physical properties of a molecule, bypassing the wave function in the analysis. In contrast, QTAIM is a methodology independent from the orbital concept. In particular, it provides a rigorous definition of chemical bond and geometrical structure for all types of molecules and solids and it has proven to be useful in the analysis of physical properties of insulators, pure metals, and alloys.[4–6] High-quality experimental densities of minerals,[9, 10] covalent,[11] metallic,[12] and molecular crystals[13, 14] have been analyzed in terms of QTAIM concepts. Furthermore, QTAIM-calculations on simple metals,[15] alloys, and intermetallic phases[16, 17] have also been reported as well as on molecular,[18, 19] covalent, and ionic crystals.[6, 11] Software packages that calculate and draw gradient path, laplacian, and density isolines has been published,[20–28] using similar computational methods; however, only few of them are open source code (Aimpac,[25] Multiwfn,[26] DGrid,[27] and Critic[28]).

The topological study consists in determining and characterizing critical points, bond paths, zero flux surfaces, gradient maps, and atomic basins. The critical points are ones where the gradient is null (among these points exist local minima and maxima, and saddle points) and are fundamental to the topological study. The local maxima usually correspond to the atomic nuclei positions, the local minima are cage critical points; and there are two kinds of saddle points, minimum in one direction and maximum in the perpendicular plane (bond critical points), and maximum in one direction and minimum in the perpendicular plane (ring critical points). A bond and interatomic surface representations are obtained by drawing gradient paths close to a bond critical point. To find these points, it is necessary to obtain the gradient vector, **g**(**r**) and the Hessian matrix, **H**(**r**) in any space point **r** (using the Newton–Raphson method, later described).

To replace gradient and Hessian calculation routines in software packages for finding critical points and their properties, the library began to build at early 2000s using Fortran 77. For developing our own programs comprehensively, later on, the library was translated to C language. This C library content was early reported,[29] not in detail, but including some calculation examples. Also, it has been used as a tool in studies of ours group.[30] In this work, we describe exhaustively the C library, providing the source code, method of use and some additional functions for reading grids in different formats.

The library contains functions to calculate the gradient vector and the Hessian matrix, and other functions useful for the topological study.