Skip to content

Commit

Permalink
[feat] gw_flow allow sigma_mix for the calculated imp self-energy
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed Jul 18, 2024
1 parent e63fbff commit a0716e3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions python/solid_dmft/gw_embedding/gw_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from solid_dmft.dmft_tools.solver import SolverStructure
from solid_dmft.dmft_tools import interaction_hamiltonian
from solid_dmft.dmft_cycle import _extract_quantity_per_inequiv
from solid_dmft.dmft_tools import greens_functions_mixer as gf_mixer
from solid_dmft.gw_embedding.bdft_converter import convert_gw_output


Expand Down Expand Up @@ -455,6 +456,22 @@ def embedding_driver(general_params, solver_params, gw_params, advanced_params):
sumk.symm_deg_gf(Sigma_dlr_iw[ish],ish=ish)
Sigma_dlr[ish] = make_gf_dlr(Sigma_dlr_iw[ish])

# mixing of impurity Sigma
if general_params['sigma_mix'] < 1.0 and iteration > 1:
if mpi.is_master_node():
print('mixing sigma with previous iteration by factor {:.3f}\n'.format(general_params['sigma_mix']))
with HDFArchive(general_params['jobname'] + '/' + general_params['seedname'] + '.h5', 'r') as ar:
Sigma_dlr_prev = ar[f'DMFT_results/it_{iteration-1}'][f'Sigma_dlr_{ish}']
Sigma_Hartree_prev = ar[f'DMFT_results/it_{iteration-1}'][f'Sigma_Hartree_{ish}']
Sigma_dlr[ish] << (general_params['sigma_mix'] * Sigma_dlr[ish]
+ (1-general_params['sigma_mix']) * Sigma_dlr_prev)
for block in solvers[ish].Sigma_Hartree.keys():
solvers[ish].Sigma_Hartree[block] = (general_params['sigma_mix'] * solvers[ish].Sigma_Hartree[block]
+ (1-general_params['sigma_mix']) * Sigma_Hartree_prev[block])
Sigma_dlr[ish] = mpi.bcast(Sigma_dlr[ish])
solvers[ish].Sigma_Hartree = mpi.bcast(solvers[ish].Sigma_Hartree)


for i, (block, gf) in enumerate(Sigma_dlr[ish]):
# print Hartree shift
print('Σ_HF {}'.format(block))
Expand Down Expand Up @@ -491,10 +508,12 @@ def embedding_driver(general_params, solver_params, gw_params, advanced_params):

if not general_params['magnetic']:
break

if mpi.is_master_node():
print("\nChecking impurity self-energy on the IR mesh...")
ir_kernel.check_leakage(Sigma_ir, stats='f', name="impurity self-energy", w_input=True)


# Writes results to h5 archive
if mpi.is_master_node():
with HDFArchive(general_params['jobname'] + '/' + general_params['seedname'] + '.h5', 'a') as ar:
Expand Down

0 comments on commit a0716e3

Please sign in to comment.