Memory Use¶
The size of a grid-like object in memory depends on a number of factors, some of which we can state explicitly and some which can only be estimated in the general case.
Orthogonal grid¶
An ortogonal grid in \(n\) dimensions is comprised of cells which are
defined by their \(2^n\) vertices.
The brille implementation of a three dimenional orthogonal grid is
in BZGridQdd, BZGridQdc, and BZGridcc which
are datatype specialisations of a single C++ class BrillouinZoneGrid3
with double (double), double (complex double),
and complex double (complex double) eigenvalue (eigenvector) element datatypes,
respectively.
The orthogonal grid is guaranteed to envelop the polyhedron used in its construction and has cell edge lengths determined by either a specified cell volume or specified number density which is used to calculate the cell volume. If \(V_\text{c}\) is the cell volume and \(V_\text{p}\) the polyhedron volume, then the cell number density is \(N = V_\text{p}/V_\text{c}\).
The number of grid vertices that are within the polyhedron depends on the shape of the polyhedron, but is similar to the number density if the polyhedron is a rectangular prism and commensurate with the grid. In all other cases the number of useful vertices is lower, so \(N\) is a useful upper bound. For each vertex equal-sized data is stored, depending entirely on what the user provides. In the case of phonon mode data for a crystal with \(n_\text{atom}\) atoms each phonon mode is comprised of one real scalar and \(n_\text{atom}\) complex valued three-vectors, and there are \(3n_\text{atom}\) modes in all. Thus, for each vertex the grid stores
8-byte values.
The grid is stored as list of its cell boundaries, each of which is approximately \(N^{1/3}+1\) in length, and for each cell at least partly in the polyhedron the eight corner vertex indices are stored in a structure. Since all vertices are indexed this meta information totals
8-byte values. And therefore, the total memory required for an orthogonal grid storing phonon data is on the order of
For a number density of \(10^5\) a system with ten atoms would therefore need up to 1.36 GB and one with one hundred atoms would need up to 134 GB.
Note
The actual implementation of BZGridQ handles the meta
information for in-polyhedron grid vertices differently than described
here.
This description is aspirational and would rationalise BrillouinZoneGrid3
with BrillouinZoneTrellis3.
Overall memory requirements for the current implementation are similar to
that described above.
Other grids¶
For other grids, the per vertex memory usage is similar but the total number of vertices is not as easy to estimate.