3.5 Integration, grids, and partitioning
The next single most important set of specifications required for FHI-aims are the settings regarding the numerical grids used in many contexts. Details regarding the shape and physical motivation behind these grids are given in Refs. [36, 128], and we do not repeat them here.
Notice that the actual required grids may depend on the context of the calculation, for example whether Hartree-Fock, hybrid functionals, and or calculations are required. In these cases, some specific settings may require tightening, and some defaults may automatically be chosen differently depending on whether or not those techniques are used.
Specifically, the present section deals with the following topics:
-
•
the 1D logarithmic grid infrastructure required for atomic / free-atom like calculation
-
•
radial and angular grids for all three-dimensional integrals
-
•
shaping the partition functions used to split the full three-dimensional integrals into effective atom-per-atom pieces
-
•
Splitting the grids into different batches for localization / parallelization efficiency
While many of the settings below take safe defaults for standard FHI-aims calculations and need not be modified, it is particularly important to verify the accuracy and efficiency of all three-dimensional integration grids (radial_base, angular_grids, and associated tags), since these determine the performance of the code. In the species_defaults files, (very) safe settings for DFT-LDA/GGA are provided, but for many tasks, may be reduced at very little accuracy loss.
Tags for general section of control.in:
Tag: batch_size_limit(control.in)
Usage: batch_size_limit value
Purpose: Hard upper bound to the number of points in an integration
batch.
Restriction: Applies to the maxmin and octree
grid_partitioning_method.
value is an integer number. Default: 200.
See grid_partitioning_method and Ref. [128] for details regarding integration batches.
Tag: force_lebedev(control.in)
Usage: force_lebedev type
Purpose: Allows to switch between Delley’s [74] angular grids
(17 digits) and the original angular grids tabulated by Lebedev
and Laikov [188, 189, 187] (12 digits). And also, the ESTD and D6h grid are supported here.
type is a keyword (string), either original or
Delley or estd or d6hgrid. Default: Delley.
This option need not be changed (or invoked) in any normal runs, since there is no quantitative difference between integrals with Delley’s and Lebedev’s tabulated grids to our knowledge.
Lebedev’s grids may be explicitly invoked when denser angular grids than 1202 points (already very dense!) per radial integration shell around each species are required. In detail, grids with the following numbers of grid points are provided:
-
•
Delley : 6, 14, 26, 50, 110, 194, 302, 434, 590, 770, 974, 1202
-
•
Lebedev : 6, 14, 26, 38, 50, 86, 110, 146, 170, 194, 302, 350, 434, 590, 770, 974, 1202, 1454, 1730, 2030, 2354, 2702, 3074, 3470, 3890, 4334, 4802, 5294, 5810
These numbers of grid points can be invoked in the subtags of the angular_grids specified description for fixed angular grids (the default in the preconstructed species_defaults files), and in further tags such as angular or angular_min.
Tag: grid_partitioning_method(control.in)
Usage: grid_partitioning_method method
Purpose: Allows to switch between different methods to partition the
full (3D) integration grids into batches for individual
operations.
method is a string, charactrizing one of the different
methods outlined below. Default: serial–maxmin,
parallel–parallel_hash+maxmin
Partitioning the integration grid properly can be performance-critical for the expensive grid-based Hamiltonian integration and charge density update steps. Details on these methods are given in Ref. [128]. In particular, we support:
-
•
maxmin : The default for serial computations: the “grid-adapted cut-plane” method described in Ref. [128]
-
•
parallel_hash+maxmin : The default for all parallel runs. We first hash the grid points to tasks by the geometric location and then run a maxmin algorithm locally in each task.
-
•
parallel_maxmin : Memory-parallel implementation of the maxmin method. However, the exact implementations requires rather much communication, and has been superseded by parallel_hash+maxmin.
-
•
octree : The “octree” method described in Ref. [128]
-
•
parallel_octree Parallel version of the “octree” method described in Ref. [128]. Only useful for research purposes—superseded by parallel_hash+maxmin for all practical applications.
-
•
octant Simple partitioning of the grid into “octants” of each radial integration shell arround each atom.
Note that additional parameters may be invoked to specify details for these methods, most importantly batch_size_limit and points_in_batch.
We mention for completeness that FHI-aims supports further, experimental grid batching methods, including the possibility to link to external libraries. The associated method strings are tetgen+metis, qhull+metis, nearest+metis, and group. As discussed in Ref. [128], the conceptually simpler maxmin method performs as well or even better than these “bottom-up” type approaches, and should be preferred.
Tag: hirshfeld_partition_centers_2025(control.in)
Usage: hirshfeld_partition_centers_2025 boolean
Purpose: Specifies whether an enlarged centers list for calculation
of the Hirshfeld partition weights should be used.
boolean : Either .true. or .false.
Default: .true.
As documented in issue 614 of the FHI-aims Gitlab, https://aims-git.rz-berlin.mpg.de/aims/FHIaims/-/issues/614, it was noted that the Graphite exfoliation PES had a discontinuous energy jump at certain interlayer separations, with a lightdense or lightdenser basis set and xdm. It was determined that this also affected many_body_dispersion, many_body_dispersion_nl, vdw_correction_hirshfeld, and vdw_ts, and was due to an incomplete list of centers used in the calculation of the Hirshfeld partition weights. This incomplete list occurs when the outer extent of the radial grid (see the radial_base keyword) is larger than the outer extent of the cutoff potential (see the cut_pot keyword) for periodic systems with sparse unit cells.
This keyword enables the bugfix to this problem and was introduced in FHI-aims version 250702. It permits use of an enlarged centers list to calculate the Hirshfeld partition weights. Setting hirshfeld_partition_centers_2025 to .false. recovers the behaviour before this change, in case it is needed for backwards compatibility or checking of old behaviour.
As this is a bugfix, providing there are no problems with this change of centers list, it should become default behaviour in FHI-aims. Therefore, this keyword will be deprecated in approximately 1 year, and it will be no longer possible to use the old centers list.
Please also see the keyword partition_centers_2025, and issue 737 of the FHI-aims Gitlab, that this addresses, https://aims-git.rz-berlin.mpg.de/aims/FHIaims/-/issues/737, as these problems have essentially the same origin.
Tag: min_batch_size(control.in)
Usage: min_batch_size value
Purpose: Sets the minimum number of points allowed in an integration
batch.
Restriction: Affects the octree
grid_partitioning_method method only.
value is an integer number. Default: 1.
No need to tweak for standard production calculations. See grid_partitioning_method for details regarding integration batches.
Tag: partition_acc(control.in)
Usage: partition_acc threshold
Purpose: If the partition function norm for 3D integrals and the
Hartree potential is below threshold, that integration
point is ignored.
threshold is a small positive real number. Default:
10-15.
See Ref. [36] for details regarding “partitioning of unity” of the charge density in integrations and the Hartree potential. The partition functions are only calculated if their denominator (the norm; e.g. is greater than value, else that integration point is ignored.
Notice that this type of partitioning is strictly rigorous for integrands that extend no further than the free-atom like densities used to define our partition functions. This is always true for DFT-LDA/GGA, with NAO’s but if you suspect (e.g., with very diffuse Gaussian basis functions) some kind of integration noise, reducing threshold may be a good first test.
Tag: partition_centers_2025(control.in)
Usage: partition_centers_2025 boolean
Purpose: Specifies whether an enlarged centers list for calculation
of the partition function should be used. Only relevant for the Stratmann
partition function.
boolean : Either .true. or .false.
Default: .true. for periodic calculations with the
stratmann, stratmann_smooth, stratmann_smoother,
and stratmann_sparse options of partition_type or
hartree_partition_type.
.false. otherwise.
As documented in issue 737 of the FHI-aims Gitlab, https://aims-git.rz-berlin.mpg.de/aims/FHIaims/-/issues/737, it was noted that the atomic centers list used by the different flavours of the Stratmann partition function was insufficent when the outer extent of the radial grid (see the radial_base keyword) is larger than the outer extent of the cutoff potential (see the cut_pot keyword). This is because this list of centers is populated based on distances between centers being less than some criteria that depends on the outer extent of the cutoff potential. This meant that some centers in cells adjacent to the 0-cell may not be picked up, despite having grid points nearby. In many cases, this does not happen, however, it is particularly problematic for sparse unit cells and can lead to energy jumps at certain unit cell sizes, as was demonstrated in issue 737 for He in different sized unit cells.
The solution to this problem is to expand the list of centers used by the different flavours of the Stratmann partition function, by using the outer extent of the radial grid as a distance criteria, rather than the outer edge of the cutoff potential, in cases where the radial grid is larger. This keyword partition_centers_2025 automatically applies this fix, and was introduced in FHI-aims version 250626, via merge request 1857 (https://aims-git.rz-berlin.mpg.de/aims/FHIaims/-/merge_requests/1857). Setting partition_centers_2025 to .false. recovers the behaviour before this change, in case it is needed for backwards compatibility or checking of old behaviour.
As this is a bugfix, providing there are no problems with this change of centers list, it should become default behaviour in FHI-aims. Therefore, this keyword will be deprecated in approximately 1 year, and it will be no longer possible to use the old centers list.
Tag: partition_type(control.in)
Usage: partition_type type
Purpose: Specifies which kind of partition table is used for all
three-dimensional integrations.
type : A string that specifies which kind of partition
table is used. Default: stratmann_sparse
Usually, this tag need not be modified from the default. See the Computer Physics Communications description of FHI-aims for a description of the numerical integration technique used in FHI-aims.
In brief, each extended three-dimensional integrand is broken down into atom-centered pieces, using a set of localized, atom-centered partition functions:
| (3.26) |
where is an atom-centered weight function. The following options for type are available:
-
•
rho_r2 :
(first suggested by Delley [73]). -
•
rho_r :
-
•
rho :
-
•
fermi : Deprecated—do not use. A Fermi-function like approach, requires two additional parameters.
-
•
stratmann: The shape suggested by Stratmann et al., Ref. [287]. This saves 10-20 % of the numerical effort compared to rho_r2. More importantly, however, our recent testing shows that stratmann is also significantly accurate in some corner cases where the effects of integration accuracy even make a difference. Note the properly bounded “stratmann_smoother” default function below. Straight “stratmann” should not be used.
-
•
stratmann_smooth: Partial update to guarantee a smooth edge at the “outer radius” or atoms.
-
•
stratmann_smoother: Corrected version of the stratmann partition table. The following explanation refers to the prescription given in Eqs. (8), (11), and (14) of Ref. [287]. The actual (normalized) partition function is given by Eq. (10). At each grid point, it depends on a product of cell functions Eq. (9) over potentially all atoms in the system—unless its cell function is equal to one, a faraway atom may contribute to the partition function at a given grid point. Through the definition of in Eq. (4) of Ref. [287] and the limitation of the cell function to unity for through Eqs. (11) / (14), the distance from which an atom can contribute is restricted, but potentially to a very large radius indeed. This becomes a problem for periodic systems (in our case, a theoretical radius of 25 Å would have resulted even for light settings and the farthest grid points from each atom, set to 5 Å for light settings).
To avoid an overly large volume of contributing atoms, we restrict the list of contributing atoms to only those whose free-atom charge density would not be zero at the integration point in question. To that end, Eq. (8) of Ref. [287] is additionally multiplied with a function that smoothly interpolates between the original of Stratmann and coworkers and unity. The interpolation is done only for atom distances between 0.8 and 1.0 times their free-atom radius, and uses a -like interpolating function. The bottom line is that we get the benefits of both the Stratmann table and a restricted atom list without any discontinuities or wiggles as a function of atomic positions or unit cell vectors — which is as it should be. -
•
stratmann_sparse: This version of the Stratmann partition table is the same as stratmann_smoother, but it stores the relevant interatomic distances in a memory saving form.
Note that the free atom electron density still determines the extent of many partition function types. This is controlled by the cut_free_atom keyword. See also the hartree_partition_type keyword, which presently must have the same setting as the partition_type keyword.
Please also see the partition_centers_2025 for a change in how the stratmann, stratmann_smooth, stratmann_smoother, and stratmann_sparse partition functions are computed, as of version 250626.
Tag: points_in_batch(control.in)
Usage: points_in_batch value
Purpose: Target number of grid points per integration batch.
Restriction: Applies to the maxmin and octree
grid_partitioning_method.
value is an integer number. Default: 100 for most calculations. When GPU acceleration is used for tasks involving the batch integration scheme, this value is raised to 200.
See grid_partitioning_method and Ref. [128] for details regarding integration batches.
Tag: override_error_charge_integration(control.in)
Usage: override_error_charge_integration flag
Purpose: If explicitly set, allows to override the stop enforced by the code when charge integration errors become larger than .
flag is a Boolean. Default: .false..
By default, the code stops when the charge integration error at the end of a SCF iteration is larger than . This is not always an indication for an erroneous calculation, but has indicated faulty calculations in the past, where the MPI communication was wrongly set up on HPC systems. When set, the code assumes that the user must know what they are doing.
Subtags for species tag in control.in:
species sub-tag: angular(control.in)
Usage: angular limit
Purpose: For self-adapting angular integration grids, the
maximum allowed number of points per radial shell.
Restriction: This flag has no effect for species where
angular_grids is explicitly specified (the default in
our species_default files).
limit is the maximum allowed number of integration points
per radial shell.
This option is only meaningful for self-adapting angular grids, which are not the recommended default for production calculations with FHI-aims – (i) because these grids are often rather dense, and (ii) because they are meaningful only for cluster-type geometries. In order to specify self-adapting angular grids anyway, you must also set the keywords angular_min and angular_acc.
The available values of integration points in given angular grids are listed with the keyword force_lebedev.
species sub-tag: angular_acc(control.in)
Usage: angular_acc threshold
Purpose: For self-adapting angular integration grids,
specifies the desired integration accuracy for the initial
Hamiltonian and overlap matrix elements.
Restriction: Use only for cluster-type geometries.
threshold is a small positive real number; if 0., no
adaptation is performed. Default: 0.
If threshold is not zero, this option invokes the self-adaptation of all angular integration grids, within the limits given by angular_min and angular. The adaption criteria are the initial Hamiltonian / overlap matrix integrals.
In all preconstructed species_default files, we specify reliable angular integration grids for all elements for DFT. No adaptation is required. For the curious, our own grids are adapted for symmetric dimers at a tight bond distance, using threshold = .
species sub-tag: angular_grids(control.in)
Usage: angular_grids method
Purpose: Indicates how the angular integration grids (in each radial
integration shell) for this species are
determined.
method is a string, either auto or
specified.
The standard species_default files provided with FHI-aims
provide specified angular grids (on the safe side, i.e.,
rather dense) for each radial_base integration shell
around an atom. The line:
angular_grids specified
must be immediately followed by a series of lines with
division […]
outer_grid […]
tag(s). These contain the actual grid specification.
If method auto is given, appropriate specifications for self-adapting grids should be included in control.in (keywords angular, angular_min, angular_acc).
species sub-tag: angular_min(control.in)
Usage: angular_min value
Purpose: specifies the minimum number of angular grid points per
radial integration shell
value is the minimum number of grid points per shell.
For specified angular_grids, acts as a lower bound for the number of points per radial shell (specified grids will be increased accordingly).
For self-adapting angular grids, use together with the angular and angular_acc keywords.
In practice, value will be reduced to the next-highest available Lebedev integration grid (see force_lebedev tag for possible values).
species sub-tag: cut_free_atom(control.in)
Usage: cut_free_atom type [radius]
Purpose: Adds a cutoff potential to the initial, non-spinpolarized
free-atom calculation that yields free-atom densities and
potentials for many basic tasks.
type : A string, either finite or
infinite. Default: finite for DFT-LDA/GGA and
for RI_method LVL;
infinite for Hartree-Fock, hybrid functionals, , etc.
if RI_method V is used.
radius : A real number, in Å: Onset radius for the
cutoff potential, as defined in the cut_pot
tag. Default: For DFT-LDA/GGA, as given by the
onset parameter in cut_pot .
Although this is a technical parameter (ideally, no influence on self-consistent, converged results), it has important implications for a variety of numerical tasks in the code:
-
•
It influences (slightly) the basis-defining potential for the minimal basis, and for confined basis functions.
-
•
It limits the radius of the free-atom density, which in turn limits the extent of the default integration partition table. For DFT-LDA/GGA, this extent need must not be smaller than the radius of the most extended basis function, but it also need not be larger, since all integrands are zero outside anyway. This is not the case for the two-electron Coulomb operator, which is needed for Hartree-Fock, hybrid functionals, , etc, in which case the default is currently infinite (no cutoff potential applied).
-
•
It also limits the extent of the partition table used for the Hartree potential.Especially in periodic calculations, it is vital that the real-space part of the Hartree potential is kept small. In that case, it is thus critical to keep radius as small as possible.
Usually, the default specified in the code should be accurate for all requirements. If, however, you suspect some kind of integration noise which is not related to the grid, increasing the cut_free_atom value may be a good test.
species sub-tag: division(control.in)
Usage: division radius
points
Purpose: For specified
angular_grids, the number of angular points
on all radial shells that are within radius, but not
within another, smaller division.
Restrictions: Meaningful only in a block immediately following an
angular_grids specified
line.
radius : Outer radius (in Å) of this division.
points : Integer number of angular points requested in this
division (see force_lebedev tag for
possible values).
Use the outer_grid tag to specify the number of angular grid points used outside the outermost division radius.
species sub-tag: innermost_max(control.in)
Usage: innermost_max number
Purpose: Monitors the quality of the radial integration
grid.
number is an integer number, corresponding to a radial grid
shell. Default: 4.
If, after on-site orthonormalization, a radial function’s innermost extremum is inside the radial grid shell number, counting from the nucleus, that radial function is rejected in order to prevent inaccurate integrations.
species sub-tag: logarithmic(control.in)
Usage: logarithmic r_min
r_max increment
Purpose: Defines the dense one-dimensional “logarithmic” grid for
the direct solution of all radial equations (free atom quantities,
Hartree potential).
r_min is a real number (in bohr); the innermost point
of the logarithmic grid is defined as =r_min/,
where is the atomic number of the
nucleus of the species. Default:
0.0001 bohr.
r_max is a real number (in bohr), the outermost point of
the logarithmic grid, . Default: 100 bohr.
increment is a real number, the increment factor
between successive grid points, . Default: 1.0123.
The number of logarithmic grid shells, , is uniquely determined by r_min, r_max, and increment. Specifying a dense logarithmic grid is not performance-critical.
species sub-tag: outer_grid(control.in)
Usage: outer_grid
points
Purpose: For specified
angular_grids, the number of angular points
on all radial shells outside the largest
division.
Restrictions: Meaningful only in a block immediately following an
angular_grids specified
line.
points : Integer number of angular points (see
force_lebedev tag for possible values).
Use the division tag to specify the number of angular grid points used for radial shells within specified radii.
species sub-tag: radial_base(control.in)
Usage: radial_base number
radius
Purpose: Defines the basic grid of radial integration shells
according to Ref. [21]
number is an integer number (the total number of grid points,
).
radius is a positive real number which specifies the outermost
shell of the basic grid, , in Å.
The location of the number radial shells is given by
| (3.27) |
With this prescription, shell =0 would be located exactly at , and shell = would be located exactly at , i.e., this provides an exact mapping of the interval [0,].
The FHI-aims species_default files provide values for number according to the formula =1.214(nucleus+2)1/3, as determined empirically in Ref. [21]. These “basic” grids are can then be augmented by adding uniform subdivisions, using the radial_multiplier keyword described below.
species sub-tag: radial_multiplier(control.in)
Usage: radial_multiplier number
Purpose: Systematically increases the radial integration grid
density.
value is an integer, number specifying the number of
added subdivisions per basic grid spacing. Default: value
= 2
The basic grid of radial shells (see radial_base definition) is evenly subdivided number-1 times, to yield number shells in the actually used integration grid. Thus, the radial_multiplier tag allows to systematically increase the number of radial shells (by factors). For example, number=2 (the default) would yield shells total.
Note that some all-electron Gaussian basis sets contain either very high or very low exponents. If such basis sets are used for test purposes, it may be necessary to test the convergence of the radial integration grid directly by increasing the radial_multiplier.
The effect of theradial_multiplier is explained in Ref. [327] (open access at http://iopscience.iop.org/1367-2630/15/12/123033/article) Look at Figure A.1 and the accompanying explanation in that reference.