3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-21 11:53:41 +01:00

fixed density_matrix for spin-polarized input

matrix dimension is spin-dependent
This commit is contained in:
Gernot J. Kraberger 2016-07-19 16:56:52 +02:00
parent 1c29776727
commit 03ea26ec6f

View File

@ -867,13 +867,8 @@ class SumkDFT:
ntoi = self.spin_names_to_ind[self.SO]
spn = self.spin_block_names[self.SO]
unchangedsize = all(
[self.n_orbitals[ik, ntoi[sp]] == self.n_orbitals[0, ntoi[sp]] for sp in spn])
if unchangedsize:
dim = self.n_orbitals[0, ntoi[sp]]
else:
dim = self.n_orbitals[ik, ntoi[sp]]
MMat = [numpy.zeros([dim, dim], numpy.complex_) for sp in spn]
dims = {sp:self.n_orbitals[ik, ntoi[sp]] for sp in spn}
MMat = [numpy.zeros([dims[sp], dims[sp]], numpy.complex_) for sp in spn]
for isp, sp in enumerate(spn):
ind = ntoi[sp]