From fa420924af90cbbb05b9e8a065e2dc262ba0cfef Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Tue, 10 Nov 2015 12:07:13 +0100 Subject: [PATCH] Fixed a bug in 'debug_density_matrix()' The on-site blocks of the large (for all orbitals) desnity matrix were incorrectly copied for the output. --- python/vasp/elstruct.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/vasp/elstruct.py b/python/vasp/elstruct.py index d7625ac1..87a7a2f3 100644 --- a/python/vasp/elstruct.py +++ b/python/vasp/elstruct.py @@ -109,8 +109,9 @@ class ElectronicStructure: dm = np.zeros((norb, norb)) ov = np.zeros((norb, norb)) for ind, iorb in iorb_inds: - dm[iorb, :] = den_mat[ispin, ind, :] - ov[iorb, :] = overlap[ispin, ind, :] + for ind2, iorb2 in iorb_inds: + dm[iorb, iorb2] = den_mat[ispin, ind, ind2] + ov[iorb, iorb2] = overlap[ispin, ind, ind2] print " Density matrix" + (12*norb - 12)*" " + "Overlap" for drow, dov in zip(dm, ov):