triqs_dft_tools.sumk_dft_tools.SumkDFTTools.calc_density_correction

SumkDFTTools.calc_density_correction(filename=None, dm_type=None, spinave=False, kpts_to_write=None, broadening=None, beta=None)

Calculates the charge density correction and stores it into a file.

The charge density correction is needed for charge-self-consistent DFT+DMFT calculations. It represents a density matrix of the interacting system defined in Bloch basis and it is calculated from the sum over Matsubara frequecies of the full GF,

..math:: N_{nunu’}(k) = sum_{iomega_{n}} G_{nunu’}(k, iomega_{n})

The density matrix for every k-point is stored into a file.

Parameters:
filenamestring

Name of the file to store the charge density correction.

dm_typestring

DFT code to write the density correction for. Options: ‘vasp’, ‘wien2k’, ‘elk’ or ‘qe’. Needs to be set for ‘qe’

spinavelogical

Elk specific and for magnetic calculations in DMFT only. It averages the spin to keep the DFT part non-magnetic.

kpts_to_writeiterable of int

Indices of k points that are written to file. If None (default), all k points are written. Only implemented for dm_type ‘vasp’

broadeningfloat, optional

Imaginary shift for the axis along which the real-axis GF is calculated. If not provided, broadening will be set to double of the distance between mesh points in ‘mesh’. Only relevant for real-frequency GF.

betafloat, optional, default = broadening

when using MeshReFreq this determines the temperature for the Fermi function smearing when integrating G(w). If not given broadening will be used (converted to beta)

Returns
——-
(deltaN, dens)tuple

Returns a tuple containing the density matrix deltaN and the corresponing total charge dens.