dmft_tools.manipulate_chemical_potential

Contains all the functions related to setting the chemical potential in the next iteration.

dmft_tools.manipulate_chemical_potential._determine_band_edge(mesh, spectral_function, spectral_func_threshold, valence_band, edge_threshold=0.2)[source]

Finds the band edge of a spectral function. This is done in two steps: starting from the Fermi energy, looks for the first peak (>spectral_func_threshold and local maximum on discrete grid). Then moves back towards Fermi energy until the spectral function is smaller than the fraction edge_threshold of the peak value.

Parameters:
meshnumpy.ndarray of float

the real frequencies grid.

spectral_functionnumpy.ndarray of float

the values of the spectral function on the grid.

spectral_func_thresholdfloat

Threshold for spectral function to cross before looking for peaks.

valence_bandbool

Determines if looking for valence band (i.e. the upper band edge) or the conduction band (i.e. the lower band edge).

edge_thresholdfloat

Fraction of the peak value that defines the band edge value.

Returns:
float

The frequency value of the band edge.

dmft_tools.manipulate_chemical_potential._initialize_lattice_gf(sum_k, general_params)[source]

Creates lattice Green’s function (GF) that is averaged over orbitals, blocks and spins. Returns lattice GF as input for an analytical continuation as well as G_lattice(tau=beta/2) (proxy for the spectral weight) and G_lattice(beta) (proxy for the total occupation).

Parameters:
sum_kSumkDFT object

Sumk object to generate the lattice GF from.

general_paramsdict

general parameters as dict.

Returns:
gf_lattice_iwtriqs.gf.BlockGf

trace of the lattice GF over all blocks, orbitals and spins in Matsubara frequency.

g_betahalfcomplex

the Fourier transform of gf_lattice_iw evaluated at tau=beta/2.

occupationcomplex

the total density from gf_lattice_iw

dmft_tools.manipulate_chemical_potential._mix_chemical_potential(general_params, density_tot, density_required, previous_mu, predicted_mu)[source]

Mixes the previous chemical potential and the predicted potential with linear mixing: new_mu = factor * predicted_mu + (1-factor) * previous_mu, with factor = mu_mix_per_occupation_offset * |density_tot - density_required| + mu_mix_const under the constrain of 0 <= factor <= 1.

Parameters:
general_paramsdict

general parameters as a dict

density_totfloat

total occupation of the correlated system

density_requiredfloat

required density for the impurity problem

previous_mufloat

the chemical potential from the previous iteration

predicted_mufloat

the chemical potential predicted by methods like the SumkDFT dichotomy

Returns:
new_mufloat

the chemical potential that results from the mixing

dmft_tools.manipulate_chemical_potential._set_mu_to_gap_middle_with_maxent(general_params, sum_k, gf_lattice_iw, archive=None)[source]

Bundles running maxent on the total lattice GF, analyzing the spectral function and determining the new chemical potential.

Parameters:
general_paramsdict

general parameters as dict.

sum_kSumkDFT object

SumkDFT object needed for original chemical potential and frequency range of MaxEnt continuation.

gf_lattice_iwBlockGf

trace of the lattice GF over all blocks, orbitals and spins in Matsubara frequency.

archiveHDFArchive, optional

If given, writes spectral function (i.e. MaxEnt result) to archive.

Returns:
float

new chemical potential located in the middle of the gap from MaxEnt. None if not master node or if something went wrong.

dmft_tools.manipulate_chemical_potential.set_initial_mu(general_params, sum_k, iteration_offset, archive, broadening)[source]

Handles the different ways of setting the initial chemical potential mu: * Chemical potential set to fixed value: uses this value

  • New calculation: determines mu from dichotomy method

  • Resuming calculation and chemical potential not updated this iteration:

    loads calculation before previous iteration.

  • Resuming calculation and chemical potential is updated:

    checks if the system is gapped and potentially run MaxEnt to find gap middle. Otherwise, gets mu from dichotomy and applies mu mixing to result.

Parameters:
general_paramsdict

general parameters as dict.

sum_kSumkDFT object

contains system information necessary to determine the initial mu.

iteration_offsetint

the number of iterations executed in previous calculations.

archiveHDFArchive

needed to potentially load previous results and write MaxEnt results to.

Returns:
sum_kSumkDFT object

the altered SumkDFT object with the initial mu set correctly.

dmft_tools.manipulate_chemical_potential.update_mu(general_params, sum_k, it, archive, broadening)[source]

Handles the different ways of updating the chemical potential mu: * Chemical potential set to fixed value: uses this value

  • Chemical potential not updated this iteration: nothing happens.

  • Chemical potential is updated: checks if the system is gapped and

    potentially run MaxEnt to find gap middle. Otherwise, gets mu from dichotomy and applies mu mixing to result.

Parameters:
general_paramsdict

general parameters as dict.

sum_kSumkDFT object

contains system information necessary to update mu.

itint

the number of the current iteration.

archiveHDFArchive

needed to potentially write MaxEnt results to.

Returns:
sum_kSumkDFT object

the altered SumkDFT object with the updated mu.