mirror of
https://github.com/triqs/dft_tools
synced 2025-01-10 21:18:22 +01:00
Beautify check density imag part
This commit is contained in:
parent
ac1f55f3de
commit
46d9229722
@ -1884,10 +1884,10 @@ class SumkDFT(object):
|
|||||||
# collect data from mpi:
|
# collect data from mpi:
|
||||||
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()
|
||||||
import numpy as np
|
|
||||||
if np.abs(np.imag(dens)) > 1e-20:
|
if abs(dens.imag) > 1e-20:
|
||||||
mpi.report("Warning: Imaginary part in density will be ignored ({})".format(str(np.abs(np.imag(dens)))))
|
mpi.report("Warning: Imaginary part in density will be ignored ({})".format(str(abs(dens.imag))))
|
||||||
return np.real(dens)
|
return dens.real
|
||||||
|
|
||||||
def set_mu(self, mu):
|
def set_mu(self, mu):
|
||||||
r"""
|
r"""
|
||||||
|
Loading…
Reference in New Issue
Block a user