mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 05:43:40 +01:00
Determining delta from gf (currently only BlockGf and GfImFreq)
This commit is contained in:
parent
ec32223ea7
commit
70d4aba545
@ -9,12 +9,12 @@ SET(PYTHON_SOURCES
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/_gf_legendre.py
|
${CMAKE_CURRENT_SOURCE_DIR}/_gf_legendre.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/_gf_refreq.py
|
${CMAKE_CURRENT_SOURCE_DIR}/_gf_refreq.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/_gf_retime.py
|
${CMAKE_CURRENT_SOURCE_DIR}/_gf_retime.py
|
||||||
#${CMAKE_CURRENT_SOURCE_DIR}/gf_two_real_times.py
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/_gf_plot.py
|
${CMAKE_CURRENT_SOURCE_DIR}/_gf_plot.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/_gf_common.py
|
${CMAKE_CURRENT_SOURCE_DIR}/_gf_common.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/inverse.py
|
${CMAKE_CURRENT_SOURCE_DIR}/inverse.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/lazy_expressions.py
|
${CMAKE_CURRENT_SOURCE_DIR}/lazy_expressions.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/tools.py
|
${CMAKE_CURRENT_SOURCE_DIR}/tools.py
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/functions.py
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install python sources
|
# Install python sources
|
||||||
|
@ -29,24 +29,16 @@ It is imported with the command::
|
|||||||
from gf import *
|
from gf import *
|
||||||
|
|
||||||
from inverse import inverse
|
from inverse import inverse
|
||||||
#from gf_imfreq import GfImFreq
|
|
||||||
#from gf_imtime import GfImTime
|
|
||||||
#from gf_refreq import GfReFreq
|
|
||||||
#from gf_retime import GfReTime
|
|
||||||
#from gf_two_real_times import GfTwoRealTime
|
|
||||||
#from gf_legendre import GfLegendre
|
|
||||||
from block_gf import BlockGf
|
from block_gf import BlockGf
|
||||||
from descriptors import Omega, iOmega_n, SemiCircular, Wilson, Fourier, InverseFourier, LegendreToMatsubara, MatsubaraToLegendre
|
from descriptors import Omega, iOmega_n, SemiCircular, Wilson, Fourier, InverseFourier, LegendreToMatsubara, MatsubaraToLegendre
|
||||||
|
from functions import delta
|
||||||
|
|
||||||
#__all__ = ['TailGf','GfImFreq','MeshImFreq']
|
__all__ = ['Omega','iOmega_n','SemiCircular','Wilson','Fourier','InverseFourier','LegendreToMatsubara','MatsubaraToLegendre',
|
||||||
|
'lazy_expressions','TailGf',
|
||||||
__all__ = ['Omega','iOmega_n','SemiCircular','Wilson','Fourier','InverseFourier','LegendreToMatsubara','MatsubaraToLegendre','lazy_expressions','TailGf',
|
|
||||||
'GfImFreq','MeshImFreq',
|
'GfImFreq','MeshImFreq',
|
||||||
'GfImTime', 'MeshImTime',
|
'GfImTime', 'MeshImTime',
|
||||||
'GfReFreq', 'MeshReFreq',
|
'GfReFreq', 'MeshReFreq',
|
||||||
'GfReTime', 'MeshReTime',
|
'GfReTime', 'MeshReTime',
|
||||||
'make_gf_from_inverse_fourier',
|
'make_gf_from_inverse_fourier',
|
||||||
'BlockGf','inverse'] #,'GfTwoRealTime']
|
'BlockGf','inverse',
|
||||||
|
'delta']
|
||||||
#__all__ = ['Omega','iOmega_n','SemiCircular','Wilson','Fourier','InverseFourier','LegendreToMatsubara','MatsubaraToLegendre','lazy_expressions','TailGf','GfImFreq','GfImTime','GfReFreq','GfReTime','GfLegendre','BlockGf','inverse'] #,'GfTwoRealTime']
|
|
||||||
|
|
||||||
|
@ -364,11 +364,6 @@ class BlockGf(object):
|
|||||||
self.__check_attr("invert")
|
self.__check_attr("invert")
|
||||||
for i,g in self : g.invert()
|
for i,g in self : g.invert()
|
||||||
|
|
||||||
def delta(self) :
|
|
||||||
"""Compute delta from G0"""
|
|
||||||
self.__check_attr("delta")
|
|
||||||
return self.__class__( name_block_generator = [ (n, g.delta()) for n,g in self], make_copies=False)
|
|
||||||
|
|
||||||
def transpose(self):
|
def transpose(self):
|
||||||
"""Transpose of the BlockGf"""
|
"""Transpose of the BlockGf"""
|
||||||
self.__check_attr("transpose")
|
self.__check_attr("transpose")
|
||||||
|
17
pytriqs/gf/local/functions.py
Normal file
17
pytriqs/gf/local/functions.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from inverse import inverse
|
||||||
|
from block_gf import BlockGf
|
||||||
|
from gf import GfImFreq
|
||||||
|
from descriptor_base import A_Omega_Plus_B
|
||||||
|
|
||||||
|
def delta(g) :
|
||||||
|
"""Compute delta from G0"""
|
||||||
|
if type(g) == BlockGf:
|
||||||
|
return BlockGf(name_block_generator = [ (n, delta(g0)) for n,g0 in g], make_copies=False)
|
||||||
|
elif type(g) == GfImFreq:
|
||||||
|
g0_iw_inv = inverse(g)
|
||||||
|
delta_iw = g0_iw_inv.copy()
|
||||||
|
delta_iw <<= A_Omega_Plus_B(g0_iw_inv.tail[-1], g0_iw_inv.tail[0])
|
||||||
|
delta_iw -= g0_iw_inv
|
||||||
|
return delta_iw
|
||||||
|
else:
|
||||||
|
raise TypeError, "No function delta for g0 object of type %s"%type(g)
|
Loading…
Reference in New Issue
Block a user