mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Added more flexible H(k) reading
This commit is contained in:
parent
f316bb567c
commit
3f5ce764a7
@ -66,7 +66,7 @@ class HkConverter:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def convert_dmft_input(self, only_upper_triangle = True, weights_in_file = False):
|
def convert_dmft_input(self, first_real_part_matrix = True, only_upper_triangle = False, weights_in_file = False):
|
||||||
"""
|
"""
|
||||||
Reads the input files, and stores the data in the HDFfile
|
Reads the input files, and stores the data in the HDFfile
|
||||||
"""
|
"""
|
||||||
@ -184,16 +184,38 @@ class HkConverter:
|
|||||||
for isp in range(n_spin_blocks):
|
for isp in range(n_spin_blocks):
|
||||||
for ik in xrange(n_k) :
|
for ik in xrange(n_k) :
|
||||||
no = n_orbitals[ik][isp]
|
no = n_orbitals[ik][isp]
|
||||||
for i in xrange(no):
|
|
||||||
if (only_upper_triangle):
|
|
||||||
ii=i
|
|
||||||
else:
|
|
||||||
ii = 0
|
|
||||||
for j in xrange(ii,no):
|
|
||||||
hopping[ik,isp,i,j] = R.next()
|
|
||||||
hopping[ik,isp,i,j] += R.next() * 1j
|
|
||||||
|
|
||||||
if ((only_upper_triangle)and(i!=j)): hopping[ik,isp,j,i] = hopping[ik,isp,i,j].conjugate()
|
if (first_real_part_matrix):
|
||||||
|
|
||||||
|
for i in xrange(no):
|
||||||
|
if (only_upper_triangle):
|
||||||
|
istart = i
|
||||||
|
else:
|
||||||
|
istart = 0
|
||||||
|
for j in xrange(istart,no):
|
||||||
|
hopping[ik,isp,i,j] = R.next()
|
||||||
|
|
||||||
|
for i in xrange(no):
|
||||||
|
if (only_upper_triangle):
|
||||||
|
istart = i
|
||||||
|
else:
|
||||||
|
istart = 0
|
||||||
|
for j in xrange(istart,no):
|
||||||
|
hopping[ik,isp,i,j] += R.next() * 1j
|
||||||
|
if ((only_upper_triangle)and(i!=j)): hopping[ik,isp,j,i] = hopping[ik,isp,i,j].conjugate()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
for i in xrange(no):
|
||||||
|
if (only_upper_triangle):
|
||||||
|
istart = i
|
||||||
|
else:
|
||||||
|
istart = 0
|
||||||
|
for j in xrange(istart,no):
|
||||||
|
hopping[ik,isp,i,j] = R.next()
|
||||||
|
hopping[ik,isp,i,j] += R.next() * 1j
|
||||||
|
|
||||||
|
if ((only_upper_triangle)and(i!=j)): hopping[ik,isp,j,i] = hopping[ik,isp,i,j].conjugate()
|
||||||
|
|
||||||
#keep some things that we need for reading parproj:
|
#keep some things that we need for reading parproj:
|
||||||
self.n_shells = n_shells
|
self.n_shells = n_shells
|
||||||
|
Loading…
Reference in New Issue
Block a user