mirror of
https://github.com/triqs/dft_tools
synced 2025-01-10 13:08:18 +01:00
Bugfix in calculate_density_matrix for purely imaginary off-diagonals
This commit is contained in:
parent
3c998adb71
commit
00194a4617
@ -1390,7 +1390,7 @@ class SumkDFT(object):
|
|||||||
prop[ish] = self.block_structure.convert_matrix(prop[ish], space_from='sumk', space_to='solver')
|
prop[ish] = self.block_structure.convert_matrix(prop[ish], space_from='sumk', space_to='solver')
|
||||||
# Get diagonalisation matrix, if not already diagonal
|
# Get diagonalisation matrix, if not already diagonal
|
||||||
for name in prop[ish]:
|
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
|
trafo[name] = numpy.linalg.eigh(prop[ish][name])[1].conj().T
|
||||||
else:
|
else:
|
||||||
trafo[name] = numpy.identity(numpy.shape(prop[ish][name])[0])
|
trafo[name] = numpy.identity(numpy.shape(prop[ish][name])[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user