mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 12:23:41 +01:00
[clean] remove Gf indices and remove calc_dc_for_density (unused)
This commit is contained in:
parent
1848b3fa25
commit
406d3a2df4
@ -587,10 +587,10 @@ class SumkDFT(object):
|
|||||||
for isp in range(self.n_spin_blocks[self.SO])]
|
for isp in range(self.n_spin_blocks[self.SO])]
|
||||||
block_ind_list = [block for block, inner in gf_struct]
|
block_ind_list = [block for block, inner in gf_struct]
|
||||||
if isinstance(mesh, MeshImFreq):
|
if isinstance(mesh, MeshImFreq):
|
||||||
glist = lambda: [Gf(indices=inner, mesh=mesh)
|
glist = lambda: [Gf(mesh=mesh, target_shape=[len(inner),len(inner)])
|
||||||
for block, inner in gf_struct]
|
for block, inner in gf_struct]
|
||||||
else:
|
else:
|
||||||
glist = lambda: [Gf(indices=inner, mesh=mesh)
|
glist = lambda: [Gf(mesh=mesh, target_shape=[len(inner),len(inner)])
|
||||||
for block, inner in gf_struct]
|
for block, inner in gf_struct]
|
||||||
G_latt = BlockGf(name_list=block_ind_list,
|
G_latt = BlockGf(name_list=block_ind_list,
|
||||||
block_list=glist(), make_copies=False)
|
block_list=glist(), make_copies=False)
|
||||||
@ -2342,30 +2342,6 @@ class SumkDFT(object):
|
|||||||
# FIXME LEAVE UNDOCUMENTED
|
# FIXME LEAVE UNDOCUMENTED
|
||||||
################
|
################
|
||||||
|
|
||||||
def calc_dc_for_density(self, orb, dc_init, dens_mat, density=None, precision=0.01):
|
|
||||||
"""Searches for DC in order to fulfill charge neutrality.
|
|
||||||
If density is given, then DC is set such that the LOCAL charge of orbital
|
|
||||||
orb coincides with the given density."""
|
|
||||||
|
|
||||||
def F(dc):
|
|
||||||
self.calc_dc(dens_mat=dens_mat, U_interact=0,
|
|
||||||
J_hund=0, orb=orb, use_dc_value=dc)
|
|
||||||
if dens_req is None:
|
|
||||||
return self.total_density(mu=mu)
|
|
||||||
else:
|
|
||||||
return self.extract_G_loc()[orb].total_density()
|
|
||||||
|
|
||||||
if density is None:
|
|
||||||
density = self.density_required - self.charge_below
|
|
||||||
|
|
||||||
dc = dichotomy.dichotomy(function=F,
|
|
||||||
x_init=dc_init, y_value=density,
|
|
||||||
precision_on_y=precision, delta_x=0.5,
|
|
||||||
max_loops=100, x_name="Double Counting", y_name="Total Density",
|
|
||||||
verbosity=3)[0]
|
|
||||||
|
|
||||||
return dc
|
|
||||||
|
|
||||||
def check_projectors(self):
|
def check_projectors(self):
|
||||||
"""Calculated the density matrix from projectors (DM = P Pdagger) to check that it is correct and
|
"""Calculated the density matrix from projectors (DM = P Pdagger) to check that it is correct and
|
||||||
specifically that it matches DFT."""
|
specifically that it matches DFT."""
|
||||||
|
Loading…
Reference in New Issue
Block a user