mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Merge branch 'vasp' of ssh://github.com/TRIQS/dft_tools into vasp
This commit is contained in:
commit
6b89a0a6f0
@ -227,12 +227,13 @@ class ProjectorShell:
|
||||
for io, ion in enumerate(self.ion_list):
|
||||
proj_k = np.zeros((ns, nlm, nb), dtype=np.complex128)
|
||||
qcoord = structure['qcoords'][ion]
|
||||
kphase = np.exp(-2.0j * np.pi * np.dot(kp, qcoord))
|
||||
# kphase = np.exp(-2.0j * np.pi * np.dot(kp, qcoord))
|
||||
# kphase = 1.0
|
||||
for m in xrange(nlm):
|
||||
# Here we search for the index of the projector with the given isite/l/m indices
|
||||
for ip, par in enumerate(proj_params):
|
||||
if par['isite'] - 1 == ion and par['l'] == self.lorb and par['m'] == m:
|
||||
proj_k[:, m, :] = proj_raw[ip, :, ik, :] * kphase
|
||||
proj_k[:, m, :] = proj_raw[ip, :, ik, :] #* kphase
|
||||
break
|
||||
for isp in xrange(ns):
|
||||
self.proj_arr[io, isp, ik, :, :] = np.dot(self.tmatrices[io, :, :], proj_k[isp, :, :])
|
||||
@ -246,10 +247,12 @@ class ProjectorShell:
|
||||
# Here we search for the index of the projector with the given isite/l/m indices
|
||||
for ip, par in enumerate(proj_params):
|
||||
if par['isite'] - 1 == ion and par['l'] == self.lorb and par['m'] == m:
|
||||
for ik in xrange(nk):
|
||||
kp = kmesh['kpoints'][ik]
|
||||
kphase = np.exp(-2.0j * np.pi * np.dot(kp, qcoord))
|
||||
self.proj_arr[io, :, :, m, :] = proj_raw[ip, :, :, :] * kphase
|
||||
self.proj_arr[io, :, :, m, :] = proj_raw[ip, :, :, :]
|
||||
# for ik in xrange(nk):
|
||||
# kp = kmesh['kpoints'][ik]
|
||||
## kphase = np.exp(-2.0j * np.pi * np.dot(kp, qcoord))
|
||||
# kphase = 1.0
|
||||
# self.proj_arr[io, :, :, m, :] = proj_raw[ip, :, :, :] # * kphase
|
||||
break
|
||||
|
||||
|
||||
|
@ -48,6 +48,10 @@ class TestBlockMap(mytest.MyTestCase):
|
||||
self.mock_proj_params[ip]['l'] = 1
|
||||
self.mock_proj_params[ip]['m'] = im
|
||||
ip += 1
|
||||
# Mock k-mesh
|
||||
self.mock_kmesh = {'kpoints': np.zeros((1, 3))}
|
||||
# Mock structure
|
||||
self.mock_struct = {'qcoords': np.zeros((4, 3))}
|
||||
|
||||
# Scenario 1
|
||||
def test_normion_false(self):
|
||||
@ -57,7 +61,7 @@ class TestBlockMap(mytest.MyTestCase):
|
||||
|
||||
shells = []
|
||||
for sh_par in self.pars.shells:
|
||||
shells.append(ProjectorShell(sh_par, self.mock_plo, self.mock_proj_params, 0))
|
||||
shells.append(ProjectorShell(sh_par, self.mock_plo, self.mock_proj_params, self.mock_kmesh, self.mock_struct, 0))
|
||||
|
||||
proj_gr = ProjectorGroup(self.pars.groups[0], shells, self.mock_eigvals)
|
||||
|
||||
@ -81,7 +85,7 @@ class TestBlockMap(mytest.MyTestCase):
|
||||
|
||||
shells = []
|
||||
for sh_par in self.pars.shells:
|
||||
shells.append(ProjectorShell(sh_par, self.mock_plo, self.mock_proj_params, 0))
|
||||
shells.append(ProjectorShell(sh_par, self.mock_plo, self.mock_proj_params, self.mock_kmesh, self.mock_struct, 0))
|
||||
|
||||
proj_gr = ProjectorGroup(self.pars.groups[0], shells, self.mock_eigvals)
|
||||
|
||||
|
@ -35,8 +35,10 @@ class TestProjectorGroup(mytest.MyTestCase):
|
||||
|
||||
efermi = self.el_struct.efermi
|
||||
self.eigvals = self.el_struct.eigvals - efermi
|
||||
struct = self.el_struct.structure
|
||||
kmesh = self.el_struct.kmesh
|
||||
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, 0)
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, kmesh, struct, 0)
|
||||
self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh], self.eigvals)
|
||||
|
||||
# Scenario 1
|
||||
|
@ -36,8 +36,10 @@ class TestSelectBands(mytest.MyTestCase):
|
||||
|
||||
efermi = self.el_struct.efermi
|
||||
self.eigvals = self.el_struct.eigvals - efermi
|
||||
struct = self.el_struct.structure
|
||||
kmesh = self.el_struct.kmesh
|
||||
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, 0)
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, kmesh, struct, 0)
|
||||
self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh], self.eigvals)
|
||||
|
||||
# Scenario 1
|
||||
|
@ -37,8 +37,10 @@ class TestProjectorGroupTwoSite(mytest.MyTestCase):
|
||||
|
||||
efermi = self.el_struct.efermi
|
||||
self.eigvals = self.el_struct.eigvals - efermi
|
||||
struct = self.el_struct.structure
|
||||
kmesh = self.el_struct.kmesh
|
||||
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, 0)
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, kmesh, struct, 0)
|
||||
self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh], self.eigvals)
|
||||
|
||||
# Scenario 1
|
||||
|
@ -40,8 +40,10 @@ class TestProjectorShell(mytest.MyTestCase):
|
||||
efermi = self.el_struct.efermi
|
||||
eigvals = self.el_struct.eigvals - efermi
|
||||
emin, emax = self.pars.groups[0]['ewindow']
|
||||
struct = self.el_struct.structure
|
||||
kmesh = self.el_struct.kmesh
|
||||
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, 0)
|
||||
self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, kmesh, struct, 0)
|
||||
self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh], eigvals)
|
||||
|
||||
# Scenario 1
|
||||
|
Loading…
Reference in New Issue
Block a user