3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-22 12:23:41 +01:00

Make mu and total density real

This commit is contained in:
Manuel 2019-08-14 12:10:23 -04:00
parent 555084f149
commit b50ac5b9a3

View File

@ -1723,7 +1723,9 @@ class SumkDFT(object):
dens = mpi.all_reduce(mpi.world, dens, lambda x, y: x + y) dens = mpi.all_reduce(mpi.world, dens, lambda x, y: x + y)
mpi.barrier() mpi.barrier()
return dens if abs(dens.imag) > 1e-20:
mpi.report("Warning: Imaginary part in density will be ignored ({})".format(str(abs(dens.imag))))
return dens.real
def set_mu(self, mu): def set_mu(self, mu):
r""" r"""