mirror of
https://github.com/triqs/dft_tools
synced 2024-08-29 15:23:41 +02:00
Removed invert_Akw and fermi surface calculation from sumk_dft_tools
This commit is contained in:
parent
1df7476c93
commit
8b8ab0da3d
@ -229,7 +229,7 @@ class SumkDFTTools(SumkDFT):
|
|||||||
return DOS, DOSproj, DOSproj_orb
|
return DOS, DOSproj, DOSproj_orb
|
||||||
|
|
||||||
|
|
||||||
def spaghettis(self,broadening,plot_shift=0.0,plot_range=None,ishell=None,invert_Akw=False,fermi_surface=False,mu=None,save_to_file=True):
|
def spaghettis(self,broadening=None,plot_shift=0.0,plot_range=None,ishell=None,mu=None,save_to_file=True):
|
||||||
""" Calculates the correlated band structure with a real-frequency self energy."""
|
""" Calculates the correlated band structure with a real-frequency self energy."""
|
||||||
|
|
||||||
assert hasattr(self,"Sigma_imp_w"), "spaghettis: Set Sigma_imp_w first."
|
assert hasattr(self,"Sigma_imp_w"), "spaghettis: Set Sigma_imp_w first."
|
||||||
@ -257,12 +257,6 @@ class SumkDFTTools(SumkDFT):
|
|||||||
else:
|
else:
|
||||||
Akw = { sp: numpy.zeros([self.shells[ishell]['dim'],self.n_k,n_om],numpy.float_) for sp in spn }
|
Akw = { sp: numpy.zeros([self.shells[ishell]['dim'],self.n_k,n_om],numpy.float_) for sp in spn }
|
||||||
|
|
||||||
if fermi_surface:
|
|
||||||
ishell = None
|
|
||||||
Akw = { sp: numpy.zeros([self.n_k,1],numpy.float_) for sp in spn }
|
|
||||||
om_minplot = -2.0*broadening
|
|
||||||
om_maxplot = 2.0*broadening
|
|
||||||
|
|
||||||
if not ishell is None:
|
if not ishell is None:
|
||||||
gf_struct_parproj = [ (sp, range(self.shells[ishell]['dim'])) for sp in spn ]
|
gf_struct_parproj = [ (sp, range(self.shells[ishell]['dim'])) for sp in spn ]
|
||||||
G_loc = BlockGf(name_block_generator = [ (block,GfReFreq(indices = inner, mesh = self.Sigma_imp_w[0].mesh))
|
G_loc = BlockGf(name_block_generator = [ (block,GfReFreq(indices = inner, mesh = self.Sigma_imp_w[0].mesh))
|
||||||
@ -277,23 +271,9 @@ class SumkDFTTools(SumkDFT):
|
|||||||
# Non-projected A(k,w)
|
# Non-projected A(k,w)
|
||||||
for iom in range(n_om):
|
for iom in range(n_om):
|
||||||
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
||||||
if fermi_surface:
|
|
||||||
for bname,gf in G_latt_w: Akw[bname][ik,0] += gf.data[iom,:,:].imag.trace()/(-1.0*numpy.pi) * (mesh[1]-mesh[0])
|
|
||||||
else:
|
|
||||||
for bname,gf in G_latt_w: Akw[bname][ik,iom] += gf.data[iom,:,:].imag.trace()/(-1.0*numpy.pi)
|
for bname,gf in G_latt_w: Akw[bname][ik,iom] += gf.data[iom,:,:].imag.trace()/(-1.0*numpy.pi)
|
||||||
Akw[bname][ik,iom] += ik*plot_shift # shift Akw for plotting stacked k-resolved eps(k) curves
|
Akw[bname][ik,iom] += ik*plot_shift # shift Akw for plotting stacked k-resolved eps(k) curves
|
||||||
|
|
||||||
if invert_Akw:
|
|
||||||
for sp in spn: # loop over GF blocs:
|
|
||||||
maxAkw = Akw[sp].max()
|
|
||||||
minAkw = Akw[sp].min()
|
|
||||||
if fermi_surface:
|
|
||||||
Akw[sp][ik,0] = 1.0/(minAkw-maxAkw)*(Akw[sp][ik,0] - maxAkw)
|
|
||||||
else:
|
|
||||||
for iom in range(n_om):
|
|
||||||
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
|
||||||
Akw[sp][ik,iom] = 1.0/(minAkw-maxAkw)*(Akw[sp][ik,iom] - maxAkw)
|
|
||||||
|
|
||||||
else: # ishell not None
|
else: # ishell not None
|
||||||
# Projected A(k,w):
|
# Projected A(k,w):
|
||||||
G_loc.zero()
|
G_loc.zero()
|
||||||
@ -312,29 +292,11 @@ class SumkDFTTools(SumkDFT):
|
|||||||
for sp in spn:
|
for sp in spn:
|
||||||
Akw[sp][ish,ik,iom] = G_loc[sp].data[iom,ish,ish].imag/(-1.0*numpy.pi)
|
Akw[sp][ish,ik,iom] = G_loc[sp].data[iom,ish,ish].imag/(-1.0*numpy.pi)
|
||||||
|
|
||||||
if invert_Akw:
|
|
||||||
for sp in spn:
|
|
||||||
for ish in range(self.shells[ishell]['dim']):
|
|
||||||
maxAkw=Akw[sp][ish,:,:].max()
|
|
||||||
minAkw=Akw[sp][ish,:,:].min()
|
|
||||||
for iom in range(n_om):
|
|
||||||
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
|
||||||
Akw[sp][ish,ik,iom] = 1.0/(minAkw-maxAkw)*(Akw[sp][ish,ik,iom] - maxAkw)
|
|
||||||
|
|
||||||
if save_to_file and mpi.is_master_node():
|
if save_to_file and mpi.is_master_node():
|
||||||
if ishell is None:
|
if ishell is None:
|
||||||
for sp in spn: # loop over GF blocs:
|
for sp in spn: # loop over GF blocs:
|
||||||
|
f = open('Akw_'+sp+'.dat','w') # Open file for storage:
|
||||||
# Open file for storage:
|
|
||||||
if fermi_surface:
|
|
||||||
f = open('FS_'+sp+'.dat','w')
|
|
||||||
else:
|
|
||||||
f = open('Akw_'+sp+'.dat','w')
|
|
||||||
|
|
||||||
for ik in range(self.n_k):
|
for ik in range(self.n_k):
|
||||||
if fermi_surface:
|
|
||||||
f.write('%s %s\n'%(ik,Akw[sp][ik,0]))
|
|
||||||
else:
|
|
||||||
for iom in range(n_om):
|
for iom in range(n_om):
|
||||||
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
||||||
if plot_shift > 0.0001:
|
if plot_shift > 0.0001:
|
||||||
@ -347,9 +309,7 @@ class SumkDFTTools(SumkDFT):
|
|||||||
else: # ishell is not None
|
else: # ishell is not None
|
||||||
for sp in spn:
|
for sp in spn:
|
||||||
for ish in range(self.shells[ishell]['dim']):
|
for ish in range(self.shells[ishell]['dim']):
|
||||||
|
f = open('Akw_'+sp+'_proj'+str(ish)+'.dat','w') # Open file for storage:
|
||||||
f = open('Akw_'+sp+'_proj'+str(ish)+'.dat','w')
|
|
||||||
|
|
||||||
for ik in range(self.n_k):
|
for ik in range(self.n_k):
|
||||||
for iom in range(n_om):
|
for iom in range(n_om):
|
||||||
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
if (mesh[iom] > om_minplot) and (mesh[iom] < om_maxplot):
|
||||||
|
Loading…
Reference in New Issue
Block a user