mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Tidy up of unused functions in sumk_lda
This commit is contained in:
parent
88d3784c20
commit
c23f6fd720
@ -918,7 +918,7 @@ class SumkLDA:
|
|||||||
################
|
################
|
||||||
|
|
||||||
# FIXME Merge with find_mu?
|
# FIXME Merge with find_mu?
|
||||||
def find_mu_nonint(self, dens_req, orb = None, beta = 40, precision = 0.01):
|
def find_mu_nonint(self, dens_req, orb = None, precision = 0.01):
|
||||||
|
|
||||||
def F(mu):
|
def F(mu):
|
||||||
gnonint = self.extract_G_loc(mu=mu,with_Sigma=False)
|
gnonint = self.extract_G_loc(mu=mu,with_Sigma=False)
|
||||||
@ -942,7 +942,6 @@ class SumkLDA:
|
|||||||
return self.chemical_potential
|
return self.chemical_potential
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def find_dc(self,orb,guess,dens_mat,dens_req=None,precision=0.01):
|
def find_dc(self,orb,guess,dens_mat,dens_req=None,precision=0.01):
|
||||||
"""Searches for DC in order to fulfill charge neutrality.
|
"""Searches for DC in order to fulfill charge neutrality.
|
||||||
If dens_req is given, then DC is set such that the LOCAL charge of orbital
|
If dens_req is given, then DC is set such that the LOCAL charge of orbital
|
||||||
@ -972,60 +971,50 @@ class SumkLDA:
|
|||||||
return dcnew
|
return dcnew
|
||||||
|
|
||||||
|
|
||||||
# FIXME Check that dens matrix from projectors (DM=PPdagger) is correct (ie matches DFT)
|
# Check that the density matrix from projectors (DM = P Pdagger) is correct (ie matches DFT)
|
||||||
def check_projectors(self):
|
def check_projectors(self):
|
||||||
|
|
||||||
dens_mat = [numpy.zeros([self.corr_shells[ish][3],self.corr_shells[ish][3]],numpy.complex_)
|
dens_mat = [numpy.zeros([self.corr_shells[icrsh][3],self.corr_shells[icrsh][3]],numpy.complex_)
|
||||||
for ish in range(self.n_corr_shells)]
|
for icrsh in range(self.n_corr_shells)]
|
||||||
|
|
||||||
for ik in range(self.n_k):
|
for ik in range(self.n_k):
|
||||||
|
for icrsh in range(self.n_corr_shells):
|
||||||
for ish in range(self.n_corr_shells):
|
dim = self.corr_shells[icrsh][3]
|
||||||
dim = self.corr_shells[ish][3]
|
|
||||||
n_orb = self.n_orbitals[ik,0]
|
n_orb = self.n_orbitals[ik,0]
|
||||||
projmat = self.proj_mat[ik,0,ish,0:dim,0:n_orb]
|
projmat = self.proj_mat[ik,0,icrsh,0:dim,0:n_orb]
|
||||||
dens_mat[ish][:,:] += numpy.dot(projmat, projmat.transpose().conjugate()) * self.bz_weights[ik]
|
dens_mat[icrsh][:,:] += numpy.dot(projmat, projmat.transpose().conjugate()) * self.bz_weights[ik]
|
||||||
|
|
||||||
if (self.symm_op!=0): dens_mat = self.symmcorr.symmetrize(dens_mat)
|
if self.symm_op != 0: dens_mat = self.symmcorr.symmetrize(dens_mat)
|
||||||
|
|
||||||
# Rotate to local coordinate system:
|
# Rotate to local coordinate system:
|
||||||
if (self.use_rotations):
|
if self.use_rotations:
|
||||||
for icrsh in xrange(self.n_corr_shells):
|
for icrsh in range(self.n_corr_shells):
|
||||||
if (self.rot_mat_time_inv[icrsh]==1): dens_mat[icrsh] = dens_mat[icrsh].conjugate()
|
if self.rot_mat_time_inv[icrsh] == 1: dens_mat[icrsh] = dens_mat[icrsh].conjugate()
|
||||||
dens_mat[icrsh] = numpy.dot( numpy.dot(self.rot_mat[icrsh].conjugate().transpose(),dens_mat[icrsh]) ,
|
dens_mat[icrsh] = numpy.dot( numpy.dot(self.rot_mat[icrsh].conjugate().transpose(),dens_mat[icrsh]) ,
|
||||||
self.rot_mat[icrsh] )
|
self.rot_mat[icrsh] )
|
||||||
|
|
||||||
|
|
||||||
return dens_mat
|
return dens_mat
|
||||||
|
|
||||||
|
|
||||||
# FIXME DETERMINE EQUIVALENCY OF SHELLS
|
# Determine the number of equivalent shells
|
||||||
def sorts_of_atoms(self,lst):
|
def sorts_of_atoms(self,lst):
|
||||||
"""
|
"""
|
||||||
This routine should determine the number of sorts in the double list lst
|
This routine should determine the number of sorts in the double list lst
|
||||||
"""
|
"""
|
||||||
sortlst = [ lst[i][1] for i in xrange(len(lst)) ]
|
sortlst = [ lst[i][1] for i in range(len(lst)) ]
|
||||||
sortlst.sort()
|
sorts = len(set(sortlst))
|
||||||
sorts = 1
|
|
||||||
for i in xrange(len(sortlst)-1):
|
|
||||||
if sortlst[i+1]>sortlst[i]: sorts += 1
|
|
||||||
|
|
||||||
return sorts
|
return sorts
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the number of atoms
|
||||||
def number_of_atoms(self,lst):
|
def number_of_atoms(self,lst):
|
||||||
"""
|
"""
|
||||||
This routine should determine the number of atoms in the double list lst
|
This routine should determine the number of atoms in the double list lst
|
||||||
"""
|
"""
|
||||||
atomlst = [ lst[i][0] for i in xrange(len(lst)) ]
|
atomlst = [ lst[i][0] for i in range(len(lst)) ]
|
||||||
atomlst.sort()
|
atoms = len(set(atomlst))
|
||||||
atoms = 1
|
|
||||||
for i in xrange(len(atomlst)-1):
|
|
||||||
if atomlst[i+1]>atomlst[i]: atoms += 1
|
|
||||||
|
|
||||||
return atoms
|
return atoms
|
||||||
|
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# DUPLICATED, NEED TO REMOVE #
|
# DUPLICATED, NEED TO REMOVE #
|
||||||
##############################
|
##############################
|
||||||
|
Loading…
Reference in New Issue
Block a user