3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 14:23:38 +01:00
dft_tools/doc/tour/ipt_solver.py
tayral edd1ff4529 Restructuring documentation.
A first general restructuration of the doc according to the pattern [tour|tutorial|reference].
In the reference part, objects are documented per topic.
In each topic, [definition|c++|python|hdf5] (not yet implemented)
2014-10-18 12:21:08 +01:00

27 lines
706 B
Python

from pytriqs.gf.local import *
class IPTSolver:
def __init__(self, **params):
self.U = params['U']
self.beta = params['beta']
# Matsubara frequency
self.g = GfImFreq(indices=[0], beta=self.beta)
self.g0 = self.g.copy()
self.sigma = self.g.copy()
# Imaginary time
self.g0t = GfImTime(indices=[0], beta = self.beta)
self.sigmat = self.g0t.copy()
def solve(self):
self.g0t <<= InverseFourier(self.g0)
self.sigmat <<= (self.U**2) * self.g0t * self.g0t * self.g0t
self.sigma <<= Fourier(self.sigmat)
# Dyson equation to get G
self.g <<= self.g0 * inverse(1.0 - self.sigma * self.g0)