Skip to content

Commit

Permalink
Merge branch 'develop' into jo_cthyb_seg
Browse files Browse the repository at this point in the history
  • Loading branch information
j-otsuki committed Sep 6, 2022
2 parents 4cb6d36 + 4f374b8 commit eec3fea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/dcore/dcore_bse.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def calc_num_flavors(_ish):
print(" skip")
return

Gloc_iw_sh, _ = self.calc_Gloc()
Gloc_iw_sh, _, _ = self.calc_Gloc()
solver_name = self._params['impurity_solver']['name']

# generate sampling points of Matsubara frequencies
Expand Down
2 changes: 1 addition & 1 deletion src/dcore/dcore_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def calc_Sigma_w(self, mesh):
solver_name = self._params['impurity_solver']['name']
Solver = impurity_solvers.solver_classes[solver_name]
if Solver.is_gf_realomega_available():
Gloc_iw_sh, _ = self.calc_Gloc()
Gloc_iw_sh, _, _ = self.calc_Gloc()
_, _, sigma_w = self.solve_impurity_models(Gloc_iw_sh, -1, mesh)
return sigma_w
else:
Expand Down
7 changes: 5 additions & 2 deletions src/dcore/dmft_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def calc_Gloc(self):
diff = make_hermite_conjugate(g)
if diff > 1e-8:
print('Warning Gloc_iw at ish {} is not hermite conjugate: {}'.format(ish, diff))
return r['Gloc_iw_sh'], r['dm_sh']
return r['Gloc_iw_sh'], r['dm_sh'], r['total_charge']


def print_density_matrix(self, dm_sh, smoment_sh):
Expand Down Expand Up @@ -821,7 +821,10 @@ def print_time(comment):
sys.stdout.flush()

# Compute Gloc_iw where the chemical potential is adjusted if needed
Gloc_iw_sh, dm_sh = self.calc_Gloc()
Gloc_iw_sh, dm_sh, total_charge = self.calc_Gloc()
print("\n Total charge : %.6f" % total_charge)
self._quant_to_save_history['total_charge'] = total_charge

smoment_sh = spin_moments_sh(dm_sh)
self.print_density_matrix(dm_sh, smoment_sh)
self._quant_to_save_history['density_matrix'] = dm_sh
Expand Down
4 changes: 4 additions & 0 deletions src/dcore/sumkdft_workers/gloc_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ def run(self):
sk.calc_mu(self.params['prec_mu'])
# calc_mu returns None when it failed in adjusting chemical potential
if sk.chemical_potential is None:
# TODO: sys.exit is not MPI safe. replace with MPI.COMM_WORLD.Abort(1)?
sys.exit("ERROR: Failed in adjusting chemical potential")
if mpi.is_master_node():
results['mu'] = float(sk.chemical_potential)
results['total_charge'] = sk.density_required
else:
results['total_charge'] = sk.total_density() + sk.charge_below

# Local Green's function and Density matrix
Gloc = sk.extract_G_loc(with_dc=with_dc)
Expand Down

0 comments on commit eec3fea

Please sign in to comment.