コード例 #1
0
ファイル: solver.py プロジェクト: tayral/triqs_0.x
    def __init__(self,Beta,GFstruct,N_Matsubara_Frequencies=1025,**param):
        """
        :param Beta: The inverse temperature
        :param GFstruct: The structure of the Green's functions. It must be a list of tuples,
                         each representing a block of the Green's function. The tuples have two
                         elements, the name of the block and a list of indices. For example:
                         [ ('up', [1,2,3]),  ('down', [1,2,3]) ].
        :param N_Matsubara_Frequencies: (Optional, default = 1025) How many Matsubara frequencies
                                        are used for the Green's functions.
        :param param: A list of extra parameters, described below.
        """

        # For backward compatibility
        self.update_params(param)

        parameters.check_no_parameters_not_in_union_of_dicts(param, self.Required, self.Optional)
        SolverBase.__init__(self,GFstruct,param)
        self.beta = float(Beta)
        self.Verbosity = 2 if mpi.rank ==0 else 0

        # Green function in frequencies
        a_list = [a for a,al in self.GFStruct]
        glist = [ GfImFreq(indices = al, beta = self.beta, n_matsubara =N_Matsubara_Frequencies) for a,al in self.GFStruct]
        self.G0 = BlockGf(name_list = a_list, block_list = glist, make_copies=False, name="G0")
        self.G = BlockGf(name_block_generator = self.G0, make_copies=True, name="G")
        self.F = BlockGf(name_block_generator = self.G0, make_copies=True, name="F")
        self.Sigma = BlockGf(name_block_generator = self.G0, make_copies=True, name="Sigma")
        self.Sigma_Old = BlockGf(name_block_generator = self.G0, make_copies=True, name="Sigma_Old")
        self.name = 'Hybridization Expansion'

         # first check that all indices of the Green Function do correspond to a C operator.
        for a,alpha_list in self.GFStruct :
          for alpha in alpha_list :
            if (a,alpha) not in operators.C_list_names() :
              raise "Error : Some indices (%s,%s) of the Green function do not correspond to existing operator"%(a,alpha)
コード例 #2
0
ファイル: solver_base.py プロジェクト: tayral/triqs_0.x
    def __init__(self,Beta,GFstruct,**param):
        self.beta = float(Beta)
        parameters.check_no_parameters_not_in_union_of_dicts (param,self.Required, self.Optional)
        if 'Nmsb' not in param : param['Nmsb'] = 1025
        if 'Nspin' not in param : param['Nspin'] = 2

        SolverBase.__init__(self,GFstruct,param)

        # construct Greens functions:
        self.a_list = [a for a,al in self.GFStruct]
        glist = lambda : [ GfImFreq(indices = al, beta = self.beta, n_matsubara = self.Nmsb) for a,al in self.GFStruct]
        self.G = BlockGf(name_list = self.a_list, block_list = glist(),make_copies=False)
        self.G_Old = self.G.copy()
        self.G0 = self.G.copy()
        self.Sigma = self.G.copy()
        self.Sigma_Old = self.G.copy()
        M = [x for x in self.G.mesh]
        self.zmsb = numpy.array([x for x in M],numpy.complex_)
        
        # for the tails:
        self.tailtempl={}
        for sig,g in self.G: 
            self.tailtempl[sig] = copy.deepcopy(g._tail)
            for i in range(11): self.tailtempl[sig][i].array[:] *= 0.0
    
        self.name=''

        # effective atomic levels:
        if self.UseSpinOrbit: self.NSpin=2

        self.ealmat = numpy.zeros([self.Nlm*self.Nspin,self.Nlm*self.Nspin],numpy.complex_)