3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 08:24:54 +02:00

SumkDFT: transform in calc_dc

This commit is contained in:
Gernot J. Kraberger 2018-09-13 17:11:30 +02:00 committed by Hermann Schnait
parent 8130d6b9fc
commit f0b1599379

View File

@ -36,9 +36,6 @@ from warnings import warn
from scipy import compress
from scipy.optimize import minimize
# TODO: check where the transformation in block_structure has to enter
# - DC
class SumkDFT(object):
"""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_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"""
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
with this constant and 'U_interact' and 'J_hund' are ignored.
@ -1570,7 +1568,9 @@ class SumkDFT(object):
use_dc_value : float, optional
Value of the double-counting correction. If specified
`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):
@ -1651,6 +1651,11 @@ class SumkDFT(object):
mpi.report(
"DC for shell %(icrsh)i = %(use_dc_value)f" % locals())
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"):
r"""