Make mu and total density real

This commit is contained in:
Manuel 2019-08-14 12:10:23 -04:00
parent 1ececb7a4b
commit 9839dcdf9e
1 changed files with 3 additions and 1 deletions

View File

@ -1723,7 +1723,9 @@ class SumkDFT(object):
dens = mpi.all_reduce(mpi.world, dens, lambda x, y: x + y)
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):
r"""