3
0
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:
aichhorn 2014-04-02 18:36:48 +02:00
parent f316bb567c
commit 3f5ce764a7

View File

@ -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,12 +184,34 @@ 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]
if (first_real_part_matrix):
for i in xrange(no): for i in xrange(no):
if (only_upper_triangle): if (only_upper_triangle):
ii=i istart = i
else: else:
ii = 0 istart = 0
for j in xrange(ii,no): 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()
hopping[ik,isp,i,j] += R.next() * 1j hopping[ik,isp,i,j] += R.next() * 1j