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

Merge pull request #201 from phibeck/w90

Previous commit still not correct for multiple impurities. For now re…
This commit is contained in:
Alexander Hampel 2021-12-20 15:44:07 -05:00 committed by GitHub
commit 558572de90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,7 @@
# and an error occurs on the masternode, the calculation does not abort # and an error occurs on the masternode, the calculation does not abort
# - in case of disentanglement, the outer window being close to Kohn-Sham energies # - in case of disentanglement, the outer window being close to Kohn-Sham energies
# can cause a problem in creating the udis_mat in read_wannier90data # can cause a problem in creating the udis_mat in read_wannier90data
# - add_lambda does not work for multiple impurities
### ###
@ -194,9 +195,10 @@ class Wannier90Converter(ConverterTools):
# Only one block supported - either non-spin-polarized or spin-orbit coupled # Only one block supported - either non-spin-polarized or spin-orbit coupled
assert SP == SO, 'Spin-polarized calculations not implemented' assert SP == SO, 'Spin-polarized calculations not implemented'
if self.add_lambda: if self.add_lambda:
assert [sh['dim'] for sh in corr_shells] == [3 for sh in corr_shells], 'Add_lambda only implemented for t2g shell' assert n_shells == 1, 'add_lambda not implemented for more than one t2g shell'
assert SO == SP == 0, 'Add_lambda not implemented for SO = SP = 1' assert [sh['dim'] for sh in corr_shells] == [3 for sh in corr_shells], 'add_lambda only implemented for t2g shell'
assert self.bloch_basis == False, 'Add_lambda not implemented for bloch_basis = True' assert SO == SP == 0, 'add_lambda not implemented for SO = SP = 1'
assert self.bloch_basis == False, 'add_lambda not implemented for bloch_basis = True'
# now setting SO and SP to 1 # now setting SO and SP to 1
SO = SP = 1 SO = SP = 1
@ -292,6 +294,7 @@ class Wannier90Converter(ConverterTools):
# scale Hamiltonian by 2 to account for spin DOF # scale Hamiltonian by 2 to account for spin DOF
hamr = [numpy.kron(numpy.eye(2), hamr[ir]) for ir in range(nr)] hamr = [numpy.kron(numpy.eye(2), hamr[ir]) for ir in range(nr)]
# scale lambda matrix by number of correlated shells to account for shells # scale lambda matrix by number of correlated shells to account for shells
# FIXME: does not give the correct order for multiple impurities!
hamr[nr//2] += numpy.kron(numpy.eye(n_corr_shells), self.lambda_matrix_w90_t2g()) hamr[nr//2] += numpy.kron(numpy.eye(n_corr_shells), self.lambda_matrix_w90_t2g())
with numpy.printoptions(linewidth=100, formatter={'complexfloat': '{:+.3f}'.format}): with numpy.printoptions(linewidth=100, formatter={'complexfloat': '{:+.3f}'.format}):
mpi.report('Local Hamiltonian including spin-orbit coupling:') mpi.report('Local Hamiltonian including spin-orbit coupling:')
@ -447,7 +450,6 @@ class Wannier90Converter(ConverterTools):
if self.add_lambda: u_temp = numpy.kron(numpy.eye(2), u_temp) if self.add_lambda: u_temp = numpy.kron(numpy.eye(2), u_temp)
for icrsh in range(n_corr_shells): for icrsh in range(n_corr_shells):
dim = corr_shells[icrsh]['dim'] dim = corr_shells[icrsh]['dim']
print(isp, icrsh, dim, iorb, iorb+dim)
proj_mat[:, isp, icrsh, 0:dim, :] = u_temp[:,iorb:iorb+dim,:] proj_mat[:, isp, icrsh, 0:dim, :] = u_temp[:,iorb:iorb+dim,:]
iorb += dim iorb += dim