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

Bugfix in calculate_density_matrix for purely imaginary off-diagonals

This commit is contained in:
aichhorn 2020-02-26 14:38:32 +01:00
parent 3c998adb71
commit 00194a4617

View File

@ -1390,7 +1390,7 @@ class SumkDFT(object):
prop[ish] = self.block_structure.convert_matrix(prop[ish], space_from='sumk', space_to='solver')
# Get diagonalisation matrix, if not already diagonal
for name in prop[ish]:
if abs(numpy.sum(prop[ish][name]-numpy.diag(numpy.diagonal(prop[ish][name])))) > 1e-13:
if numpy.sum(abs(prop[ish][name]-numpy.diag(numpy.diagonal(prop[ish][name])))) > 1e-13:
trafo[name] = numpy.linalg.eigh(prop[ish][name])[1].conj().T
else:
trafo[name] = numpy.identity(numpy.shape(prop[ish][name])[0])