standardized hdf5 structure
All DFT input data produced by the dftkit converters is stored in a single hdf5
archive, using the conventions of the TRIQS HDFArchive. This page documents
the layout
of that archive: which top-level group each piece of data goes into, what it
means, and which converter writes it.
Every converter writes into the same archive file (seedname.h5), one
top-level group per kind of data. The group names are not hardcoded: on the
writing side they are constructor arguments of the converters (dft_subgrp,
misc_subgrp, symmcorr_subgrp, …), and on the reading side of
SumkDFT and SumkDFTTools
(dft_data, misc_data, symmcorr_data, …). Both default to the names
used below, and this is what all of
DFTTools assumes.
SumkDFT only ever needs
dft_input (plus dft_symmcorr_input if symm_op = 1); all other groups
serve specific post-processing or charge self-consistency tasks.
Overview of the groups
Group |
Written by |
Contents |
Consumed by |
|---|---|---|---|
all |
The main data: shells, projectors, Hamiltonian, k-mesh. Always required. |
||
all but H(k) |
Everything that is code specific and not part of the standard: Fermi weights, band windows, lattice information, k-paths. |
charge self-consistency, transport, band plotting |
|
Wien2k, VASP, Elk |
Symmetry operations acting on the correlated shells. |
|
|
Wien2k |
Symmetry operations acting on all shells (partial projectors). |
|
|
Wien2k |
Partial projectors onto all (also uncorrelated) shells. |
|
|
Wien2k, Elk |
Projectors and eigenvalues on a k-path, for spectral functions. |
|
|
Wien2k, Elk |
Velocity (momentum) matrix elements for optics / transport. |
|
|
Elk |
Projectors and eigenvalues on a k-plane, for Fermi surface contours. |
|
|
QE, and as an unused copy VASP |
The DMFT charge density correction handed back to Quantum Espresso. |
Quantum Espresso, in charge self-consistent runs. For VASP the correction
goes to |
Throughout this page the converters are abbreviated as follows:
Short name |
Converter |
|
|---|---|---|
Wien2k |
|
|
VASP |
|
|
W90 |
|
|
Elk |
|
|
H(k) |
|
|
Storage conventions
The archive is written through HDFArchive, which means the raw hdf5 file
looks slightly different from the Python objects:
A Python list becomes a subgroup whose members are named
'0','1', … (with aFormat = Listattribute). Sorot_matis not one array but a group with one array per correlated shell, anddim_repsis a group of groups.A dict becomes a subgroup with one member per key (attribute
Format = Dict). Each entry ofshells/corr_shellsis such a group.A complex array is stored as a real array with one extra trailing axis of length 2 (real, imaginary part), flagged by the
__complex__attribute. Reading throughHDFArchivehides this; inspecting withh5pydoes not. Ahoppingof logical shape[n_k, n_spin_blocs, nb, nb]therefore shows up as[n_k, n_spin_blocs, nb, nb, 2].
Further conventions:
The spin index runs over
n_spin_blocs = SP + 1 - SOblocks: one block for a paramagnetic or a spin-orbit coupled calculation, two blocks for a collinear spin-polarised one. Below this is written asSP+1-SO. (Exception: the Elkband_window, see there.)Arrays over bands are allocated with the maximum number of bands
max(n_orbitals)occurring on the k-mesh and zero-padded at k-points with fewer bands, so that all matrices have the same size.band_windowentries are 1-based Kohn-Sham band indices, as used by the DFT codes, not 0-based Python indices.All energies are converted to eV by the converters, so
energy_unitis the factor that was applied:13.605698for Wien2k (Ry),27.2113850560for Elk (Ha), and1.0for VASP, W90 and H(k), which already work in eV.
Main data: dft_input
The main group of the archive, written by every converter (default name
dft_input, argument dft_subgrp). It holds a lot of information, so that
DMFT calculations for all kinds of situations are possible, e.g. d-p
Hamiltonians, more than one correlated atomic shell, or symmetry operations for
the k-summation.
Required entries
These are written by all converters and are what
SumkDFT reads.
Name |
Type |
Meaning |
|---|---|---|
|
float |
Unit of energy that was used to convert the DFT output to eV, see conventions. |
|
string |
DFT code the input data comes from, one of |
|
int |
Number of k-points used for the BZ integration. |
|
int |
1 if the dimension of the projection operators depends on the k-point, 0 otherwise. 1 for Wien2k, VASP and Elk (projection onto a band window); 0 for W90 and H(k) (Wannier basis, same size at every k). |
|
int |
1 for a spin-polarised Hamiltonian, 0 for a paramagnetic one. |
|
int |
1 if spin-orbit interaction is included, 0 otherwise. |
|
float |
Number of electrons in the crystal below the correlated orbitals. Set to 0 where the concept does not apply (VASP, W90), since the projection window is defined by band indices there. |
|
float |
Required total electron density. Needed to determine the chemical
potential. The density in the projection window is then
|
|
int |
1 if symmetry operations are used for the BZ sums, 0 if all k-points are
directly included in the input. 1 for Wien2k and Elk, 0 for VASP, W90 and
H(k). If 1, the group |
|
int |
Number of atomic shells for which post-processing is possible. Note: this
is not the number of correlated orbitals! If there are two equivalent
atoms in the unit cell, |
|
list of dict {string:int}, dim |
Atomic shell information. For each shell a dict with at least the keys
|
|
int |
Number of correlated atomic shells. If there are two correlated
equivalent atoms in the unit cell, |
|
list of dict {string:int}, dim |
Correlated orbital information. For each correlated shell a dict with at
least the keys |
|
int |
Number of inequivalent atomic shells. Needs to be smaller than or equal
to |
|
list of int, dim |
Mapping from correlated shells to inequivalent correlated shells. A list
of length |
|
list of int, dim |
A list of length |
|
int |
1 if local and global coordinate systems are used, 0 otherwise. |
|
list of numpy.array.complex, dim |
Rotation matrices for correlated shells, if |
|
list of int, dim |
If |
|
list of int, dim |
Number of irreducible representations of each inequivalent correlated shell, e.g. 2 if eg/t2g splitting is used. Only Wien2k and H(k) use a value other than 1. |
|
list of list of int, dim |
Dimension of the representations of each inequivalent correlated shell,
e.g. |
|
list of numpy.array.complex, dim |
Transformation matrix from the complex spherical harmonics to the
impurity problem basis (normally the real cubic harmonics). Note that the
dimension is the full \(2l+1\) shell size (doubled with spin-orbit),
independent of how many orbitals |
|
numpy.array.int, dim [ |
Number of Bloch bands included in the projection window for each
k-point. If |
|
numpy.array.complex, dim [ |
Projection matrices from Bloch bands to Wannier orbitals. For efficient storage reasons, all matrices must be of the same size (given by the last two indices). For k-points with fewer bands, only the first entries are used, the rest are zero, e.g. if the number of Bloch bands ranges from 4-6, all matrices are of size 6. |
|
numpy.array.float, dim [ |
Weights of the k-points for the k summation. Deprecated duplicate of
|
|
numpy.array.complex, dim [ |
Non-interacting Hamiltonian matrix for each k-point. As for |
Note
The exact set of keys in the shells / corr_shells dicts is not
uniform across converters. Wien2k, W90 and H(k) write the four documented
keys in shells; VASP additionally writes 'SO' and 'irep' there
(the shells and corr_shells entries are the same dicts); Elk adds a
'natom' key to both. Consumers should therefore access keys by name and
not rely on the number of entries.
Optional and converter specific entries
These live in dft_input as well, but only some converters write them.
Name |
Type |
Written by |
Meaning |
|---|---|---|---|
|
numpy.array.float, dim [ |
VASP, W90 |
k-points given in fractional (reciprocal) coordinates. |
|
numpy.array.float, dim [ |
VASP, W90 |
Weights of the k-points for the k summation. The successor of
|
|
numpy.array.float, dim [3, 3] |
VASP, W90 (Bloch basis) |
Basis of the k-point mesh, i.e. the reciprocal lattice vectors as columns. |
|
string |
VASP |
Switch determining whether the VASP converter ran in projection mode
|
|
numpy.array.complex, dim [ |
VASP ( |
Projection matrices from Bloch bands to Wannier orbitals for the
Hamiltonian based |
|
numpy.array.float, dim [ |
W90 |
Wannier centres in cartesian coordinates (Angstrom), read from
|
Code specific data: dft_misc_input
Everything that a given DFT code provides on top of the standard goes into
dft_misc_input (argument misc_subgrp). None of it is needed for a
one-shot DMFT calculation, but charge self-consistency, transport and band
plotting rely on parts of it. The H(k) converter writes no such group.
Name |
Type |
Written by |
Meaning |
|---|---|---|---|
|
list of numpy.array.int, dim |
Wien2k, VASP, W90 (Bloch basis), Elk |
Lowest and highest Kohn-Sham band index (1-based) inside the projection
window, per spin channel and k-point. Needed to write the charge density
correction back to the DFT code. W90 stores this as a single
numpy.array.int of dim [ |
|
numpy.array, dim [ |
VASP, W90 (Bloch basis) |
DFT Fermi weights (occupations) of the Kohn-Sham states for each k-point, used to compute the density matrix correction. Complex for VASP, real for W90. |
|
float |
W90 |
Kohn-Sham Fermi energy in eV, as read from the DFT output. |
|
numpy.array.float, dim [ |
VASP, W90 (Bloch basis) |
The k-points in cartesian coordinates. |
|
int |
VASP, W90 (Bloch basis) |
Number of k-points in the irreducible wedge, when the DFT mesh has a
reducible/irreducible split. The first |
|
subgroup with |
W90 |
High-symmetry k-path read from |
|
string |
Wien2k |
Bravais lattice type as defined by Wien2k. |
|
numpy.array.float, dim [3] |
Wien2k |
Unit cell parameters in atomic units. |
|
numpy.array.float, dim [3] |
Wien2k |
Unit cell angles in rad. |
|
int |
Wien2k, Elk (transport) |
Number of space group symmetry operations. |
|
list of numpy.array.float, dim |
Wien2k, Elk (transport) |
Matrix representation of all space group symmetry operations, used to symmetrise the transport quantities. |
|
float |
Elk (transport) |
Unit cell volume, needed to normalise the transport distribution. |
|
int |
Elk |
Total number of (second-variational) states in the Elk calculation, i.e. the number of bands before the projection window is applied. |
|
numpy.array.float, dim [ |
Elk |
The k-points in fractional coordinates (Elk’s naming). |
Symmetry operations: dft_symmcorr_input and dft_symmpar_input
These groups hold the data needed to apply symmetry operations in the DMFT loop
and are read by Symmetry.
dft_symmcorr_input (argument symmcorr_subgrp) contains the symmetries
acting on the correlated shells and is required whenever symm_op = 1;
dft_symmpar_input (argument symmpar_subgrp) contains the same data for
all shells and is only used together with the partial projectors. Both
groups have identical structure, they only differ in what orbits runs over.
Name |
Type |
Meaning |
|---|---|---|
|
int |
Number of symmetry operations. |
|
int |
Number of atoms involved in the permutations. |
|
list of dict {string:int}, dim |
The shells the symmetry operations act on: a copy of |
|
list of list of int, dim |
For each symmetry operation, the permutation of the atoms it induces (1-based atom indices). |
|
list of int, dim |
1 if the symmetry operation has to be combined with time inversion, 0
otherwise. All zeros unless |
|
list of list of numpy.array.complex, dim |
Representation of each symmetry operation in the orbital basis of each shell. |
|
list of numpy.array.complex, dim |
Additional matrix for the time inversion operation, per shell. Only read
from file for |
|
int |
Spin-polarisation flag, mirroring |
|
int |
Spin-orbit flag, mirroring |
Note
The VASP converter writes this group as a placeholder only: the
symmetries are not analysed, so n_symm = 0, n_atoms = 1, and mat
/ mat_tinv are 1x1 identities. This is consistent with VASP setting
symm_op = 0, i.e. the full BZ is written out and no symmetrisation is
applied in the k-sum. The Elk converter writes real symmetry data but no
time inversion (time_inv is all zeros). The H(k) converter writes no
symmetry group at all.
Partial projectors: dft_parproj_input
Written by Converter.convert_parproj_input() of the Wien2k
converter (argument parproj_subgrp), together with dft_symmpar_input. It provides
projectors onto all shells, correlated and uncorrelated, which is what
SumkDFTTools needs for partial densities of states and partial charges.
Only Wien2k supports this.
Name |
Type |
Meaning |
|---|---|---|
|
numpy.array.int, dim [ |
Number of partial projectors (theta projectors) per shell. |
|
numpy.array.complex, dim [ |
Projection matrices from Bloch bands onto all shells. |
|
list of list of numpy.array.complex, dim |
Density matrix of each shell from the bands below the projection
window. Divided by 2 if |
|
list of numpy.array.complex, dim |
Global-to-local rotation matrices for all shells, the analogue of
|
|
list of int, dim |
Whether the coordinate transformation of each shell contains inversion.
Only read for |
Data on a k-path: dft_bands_input
Written by convert_bands_input() of the Wien2k and Elk converters (argument
bands_subgrp). It repeats the projectors and eigenvalues, but on a
high-symmetry k-path instead of the BZ mesh, so that SumkDFTTools can
compute correlated band structures. The quantities have the same meaning as
their counterparts in dft_input / dft_parproj_input, with n_k now
counting the k-points along the path.
Name |
Type |
Meaning |
|---|---|---|
|
int |
Number of k-points along the path. |
|
numpy.array.int, dim [ |
Number of bands in the projection window at each k-point of the path. |
|
numpy.array.complex, dim [ |
Projectors onto the correlated shells along the path. |
|
numpy.array.complex, dim [ |
Kohn-Sham eigenvalues along the path, on the diagonal. |
|
numpy.array.int, dim [ |
As in |
|
numpy.array.complex, dim [ |
As in |
Note
The VASP converter does not currently write a dft_bands_input group; band
structures from VASP projectors are obtained by running the converter on a
separate band-path calculation.
Transport data: dft_transp_input
Written by convert_transport_input() of the Wien2k and Elk converters
(argument transp_subgrp), and read by DFTTools’
transport_distribution(). Note that the accompanying
n_symmetries, rot_symmetries and (Elk) cell_vol go to
dft_misc_input, not here.
Name |
Type |
Meaning |
|---|---|---|
|
list of numpy.array.int, dim |
Band window for which the velocity matrix elements are available. Same
idea as |
|
list of list of numpy.array.complex, dim |
Velocity (momentum) matrix elements between all bands inside
|
Fermi surface contours: dft_contours_input
Written by Converter.convert_contours_input() of the Elk
converter (argument cont_subgrp), for spectral functions on a plane or a
k-grid in the BZ (Fermi surfaces).
Name |
Type |
Meaning |
|---|---|---|
|
int |
Number of irreducible k-points on the plane / grid. |
|
numpy.array.int, dim [ |
Number of bands in the projection window at each of these k-points. |
|
numpy.array.complex, dim [ |
Projectors onto the correlated shells at these k-points. |
|
numpy.array.complex, dim [ |
Kohn-Sham eigenvalues at these k-points, on the diagonal. |
|
numpy.array.float, dim [3, 3] |
Reciprocal lattice vectors, used to convert the k-points to cartesian coordinates for plotting. |
|
int |
Number of k-points in the full (reducible) plane / grid. |
|
numpy.array.float, dim [ |
The full set of k-points in fractional coordinates. |
|
numpy.array.int, dim [ |
For each of these k-points, the index of the irreducible k-point it maps
onto, i.e. the mapping from the full plane into the |
Charge density correction: dft_update
This is how the DMFT charge density correction is handed back to Quantum
Espresso during a charge self-consistent DFT+DMFT run: written either by
DFTTools’ SumkDFT.calc_density_correction(dm_type='qe') or, equivalently, by
the calc_density_correction() step of the dftkit
Quantum Espresso driver. It also
turns up in VASP archives, but is not used there, see the
note below.
Name |
Type |
Meaning |
|---|---|---|
|
numpy.array.complex, dim [ |
The DMFT correction to the Kohn-Sham density matrix in band basis, on the full k-mesh. For spin-orbit calculations this is the single spinor channel, otherwise the average of the two spin channels. |
The other codes do not use this group: their corrections are written to separate files that are not part of this archive.
VASP reads
vaspgamma.h5, a standalone archive with a top-levelband_windowand adeltaNgroup holding one block per irreducible k-point (keyedup/down, orudfor spin-orbit). This is whatSumkDFT.calc_density_correction(dm_type='vasp')writes.Wien2k reads
dens_mat.dat, Elk readsDMATDMFT.OUT(both plain text). For VASP a legacy textGAMMAfile can still be requested viadm_type='vasp', filename='GAMMA'.Abinit reads a
seedname.deltaNtext file, written by the dftkit Abinit driver.
Note
The dftkit VASP driver additionally leaves a copy of the correction in
dft_update after writing vaspgamma.h5, so the group can show up in
a VASP archive. That copy is incidental: nothing reads it back, and it is not
part of the interface to VASP.
General and simple H(k) converter
The converters described above read the full output of a DFT code, including
information about symmetry operations, band windows and partial projectors.
Sometimes, however, we want to use a light implementation where the input
consists basically only of the Hamiltonian matrix in Wannier basis, given at a
grid of k-points in the first Brillouin zone. For this purpose the simple
triqs_dftkit.hk.Converter is included in dftkit, implemented for
the simplest case of paramagnetic DFT calculations without spin-orbit coupling.
It reads a simple, easy to construct text file, and produces an archive that
can be used for the DMFT calculations. An example input file for a structure
with one correlated site with 3 t2g orbitals in the unit cell contains the
following:
10 <- n_k
1.0 <- density_required
1 <- n_shells
1 1 2 3 <- shells, as above: atom, sort, l, dim
1 <- n_corr_shells
1 1 2 3 0 0 <- corr_shells, as above: atom, sort, l, dim, SO, dummy
2 2 3 <- n_reps, dim_reps (length 2, because eg/t2g splitting) for each inequivalent correlated shell
After this header, we give the Hamiltonian matrices for all the k-points. For each k-point we give first the matrix of the real part, then the matrix of the imaginary part. The projection matrices are set automatically to unity matrices, no rotations, no symmetry operations are used. That means that the symmetry sub group in the hdf5 archive needs not be set, since it is not used. It is furthermore assumed that all k-points have equal weight in the k-sum. Note that the input file should contain only the numbers, not the comments given in above example.
The Hamiltonian matrices can be taken, e.g., from Wannier90, which constructs the Hamiltonian in a maximally localized Wannier basis.
Note that with this simplified converter, no full charge self consistent calculations are possible!