mirror of
https://github.com/triqs/dft_tools
synced 2024-10-14 03:51:37 +02:00
SumkDFT: transform in calc_dc
This commit is contained in:
parent
8130d6b9fc
commit
f0b1599379
@ -36,9 +36,6 @@ from warnings import warn
|
|||||||
from scipy import compress
|
from scipy import compress
|
||||||
from scipy.optimize import minimize
|
from scipy.optimize import minimize
|
||||||
|
|
||||||
# TODO: check where the transformation in block_structure has to enter
|
|
||||||
# - DC
|
|
||||||
|
|
||||||
|
|
||||||
class SumkDFT(object):
|
class SumkDFT(object):
|
||||||
"""This class provides a general SumK method for combining ab-initio code and pytriqs."""
|
"""This class provides a general SumK method for combining ab-initio code and pytriqs."""
|
||||||
@ -1533,9 +1530,10 @@ class SumkDFT(object):
|
|||||||
self.dc_imp = dc_imp
|
self.dc_imp = dc_imp
|
||||||
self.dc_energ = dc_energ
|
self.dc_energ = dc_energ
|
||||||
|
|
||||||
def calc_dc(self, dens_mat, orb=0, U_interact=None, J_hund=None, use_dc_formula=0, use_dc_value=None):
|
def calc_dc(self, dens_mat, orb=0, U_interact=None, J_hund=None,
|
||||||
|
use_dc_formula=0, use_dc_value=None, transform=True):
|
||||||
r"""
|
r"""
|
||||||
Calculates and sets the double counting corrections.
|
Calculate and set the double counting corrections.
|
||||||
|
|
||||||
If 'use_dc_value' is provided the double-counting term is uniformly initialized
|
If 'use_dc_value' is provided the double-counting term is uniformly initialized
|
||||||
with this constant and 'U_interact' and 'J_hund' are ignored.
|
with this constant and 'U_interact' and 'J_hund' are ignored.
|
||||||
@ -1558,19 +1556,21 @@ class SumkDFT(object):
|
|||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
dens_mat : gf_struct_solver like
|
dens_mat : gf_struct_solver like
|
||||||
Density matrix for the specified correlated shell.
|
Density matrix for the specified correlated shell.
|
||||||
orb : int, optional
|
orb : int, optional
|
||||||
Index of an inequivalent shell.
|
Index of an inequivalent shell.
|
||||||
U_interact : float, optional
|
U_interact : float, optional
|
||||||
Value of interaction parameter `U`.
|
Value of interaction parameter `U`.
|
||||||
J_hund : float, optional
|
J_hund : float, optional
|
||||||
Value of interaction parameter `J`.
|
Value of interaction parameter `J`.
|
||||||
use_dc_formula : int, optional
|
use_dc_formula : int, optional
|
||||||
Type of double-counting correction (see description).
|
Type of double-counting correction (see description).
|
||||||
use_dc_value : float, optional
|
use_dc_value : float, optional
|
||||||
Value of the double-counting correction. If specified
|
Value of the double-counting correction. If specified
|
||||||
`U_interact`, `J_hund` and `use_dc_formula` are ignored.
|
`U_interact`, `J_hund` and `use_dc_formula` are ignored.
|
||||||
|
transform : bool
|
||||||
|
whether or not to use the transformation in block_structure
|
||||||
|
to transform the dc
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for icrsh in range(self.n_corr_shells):
|
for icrsh in range(self.n_corr_shells):
|
||||||
@ -1651,6 +1651,11 @@ class SumkDFT(object):
|
|||||||
mpi.report(
|
mpi.report(
|
||||||
"DC for shell %(icrsh)i = %(use_dc_value)f" % locals())
|
"DC for shell %(icrsh)i = %(use_dc_value)f" % locals())
|
||||||
mpi.report("DC energy = %s" % self.dc_energ[icrsh])
|
mpi.report("DC energy = %s" % self.dc_energ[icrsh])
|
||||||
|
if transform:
|
||||||
|
for sp in spn:
|
||||||
|
T = self.block_structure.effective_transformation_sumk[icrsh][sp]
|
||||||
|
self.dc_imp[icrsh][sp] = numpy.dot(T.conjugate().transpose(),
|
||||||
|
numpy.dot(self.dc_imp[icrsh][sp], T))
|
||||||
|
|
||||||
def add_dc(self, iw_or_w="iw"):
|
def add_dc(self, iw_or_w="iw"):
|
||||||
r"""
|
r"""
|
||||||
|
Loading…
Reference in New Issue
Block a user