mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 06:14:14 +01:00
edd1ff4529
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)
27 lines
706 B
Python
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)
|