mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Fix bugs in sumk_lda.py
This is a merge of fixes by Markus and Leonid. Hopefully it's OK. modified: python/sumk_lda.py
This commit is contained in:
parent
3d82fafda8
commit
2d5cf0abc7
@ -651,17 +651,17 @@ class SumkLDA:
|
|||||||
use_dc_formula=0: LDA+U FLL double counting, use_dc_formula=1: Held's formula.
|
use_dc_formula=0: LDA+U FLL double counting, use_dc_formula=1: Held's formula.
|
||||||
use_dc_formula=2: AMF
|
use_dc_formula=2: AMF
|
||||||
Be sure that you use the correct interaction Hamiltonian!"""
|
Be sure that you use the correct interaction Hamiltonian!"""
|
||||||
|
|
||||||
|
|
||||||
#if (not hasattr(self,"dc_imp")): self.__init_dc()
|
#if (not hasattr(self,"dc_imp")): self.__init_dc()
|
||||||
|
|
||||||
|
|
||||||
dm = [ {} for i in xrange(self.n_corr_shells)]
|
#dm = [ {} for i in xrange(self.n_corr_shells)]
|
||||||
for i in xrange(self.n_corr_shells):
|
#for i in xrange(self.n_corr_shells):
|
||||||
l = self.corr_shells[i][3] #*(1+self.corr_shells[i][4])
|
# l = self.corr_shells[i][3] #*(1+self.corr_shells[i][4])
|
||||||
for j in xrange(len(self.gf_struct_corr[i])):
|
# for j in xrange(len(self.gf_struct_corr[i])):
|
||||||
dm[i]['%s'%self.gf_struct_corr[i][j][0]] = numpy.zeros([l,l],numpy.float_)
|
# dm[i]['%s'%self.gf_struct_corr[i][j][0]] = numpy.zeros([l,l],numpy.float_)
|
||||||
|
|
||||||
|
|
||||||
for icrsh in xrange(self.n_corr_shells):
|
for icrsh in xrange(self.n_corr_shells):
|
||||||
|
|
||||||
@ -676,10 +676,14 @@ class SumkLDA:
|
|||||||
self.dc_imp[icrsh]['%s'%self.gf_struct_corr[icrsh][j][0]] = numpy.identity(l,numpy.float_)
|
self.dc_imp[icrsh]['%s'%self.gf_struct_corr[icrsh][j][0]] = numpy.identity(l,numpy.float_)
|
||||||
blname = self.gf_struct_corr[icrsh][j][0]
|
blname = self.gf_struct_corr[icrsh][j][0]
|
||||||
Ncr[blname] = 0.0
|
Ncr[blname] = 0.0
|
||||||
for bl in self.map[iorb][blname]:
|
|
||||||
Ncr[blname] += dens_mat[bl].real.trace()
|
|
||||||
|
|
||||||
|
|
||||||
|
for a,al in self.gf_struct_solver[iorb]:
|
||||||
|
#for bl in self.map[iorb][blname]:
|
||||||
|
bl = self.map_inv[iorb][a]
|
||||||
|
#print 'bl, valiue = ',bl,dens_mat[a].real.trace()
|
||||||
|
Ncr[bl] += dens_mat[a].real.trace()
|
||||||
|
|
||||||
|
#print 'Ncr=',Ncr
|
||||||
M = self.corr_shells[icrsh][3]
|
M = self.corr_shells[icrsh][3]
|
||||||
|
|
||||||
Ncrtot = 0.0
|
Ncrtot = 0.0
|
||||||
@ -780,10 +784,11 @@ class SumkLDA:
|
|||||||
|
|
||||||
|
|
||||||
# init self.Sigma_imp:
|
# init self.Sigma_imp:
|
||||||
if type(Sigma_imp[0]) == GfReFreq:
|
if Sigma_imp[0].note == 'ReFreq':
|
||||||
# Real frequency Sigma:
|
# Real frequency Sigma:
|
||||||
self.Sigma_imp = [ BlockGf( name_block_generator = [ (a,GfReFreq(indices = al, mesh = Sigma_imp[0].mesh)) for a,al in self.gf_struct_corr[i] ],
|
self.Sigma_imp = [ BlockGf( name_block_generator = [ (a,GfReFreq(indices = al, mesh = Sigma_imp[0].mesh)) for a,al in self.gf_struct_corr[i] ],
|
||||||
make_copies = False) for i in xrange(self.n_corr_shells) ]
|
make_copies = False) for i in xrange(self.n_corr_shells) ]
|
||||||
|
for i in xrange(self.n_corr_shells): self.Sigma_imp[i].note='ReFreq'
|
||||||
else:
|
else:
|
||||||
# Imaginary frequency Sigma:
|
# Imaginary frequency Sigma:
|
||||||
self.Sigma_imp = [ BlockGf( name_block_generator = [ (a,GfImFreq(indices = al, mesh = Sigma_imp[0].mesh)) for a,al in self.gf_struct_corr[i] ],
|
self.Sigma_imp = [ BlockGf( name_block_generator = [ (a,GfImFreq(indices = al, mesh = Sigma_imp[0].mesh)) for a,al in self.gf_struct_corr[i] ],
|
||||||
|
Loading…
Reference in New Issue
Block a user