Ejemplo n.º 1
0
    def constr_Sigma_ME(self, Filename, Beta, N_om, orb=0):
        """Uses Data from files to construct a GF object on the real axis."""

        #first get the mesh out of one of the files:
        if (len(self.GFStruct_Solver[orb][0][1]) == 1):
            Fname = Filename + '_' + self.GFStruct_Solver[orb][0][0] + '.dat'
        else:
            Fname = Filename + '_' + self.GFStruct_Solver[orb][0][
                0] + '/' + str(self.GFStruct_Solver[orb][0][1][0]) + '_' + str(
                    self.GFStruct_Solver[orb][0][1][0]) + '.dat'

        R = Read_Fortran_File(Fname)
        mesh = numpy.zeros([N_om], numpy.float_)
        try:
            for i in xrange(N_om):
                mesh[i] = R.next()
                sk = R.next()
                sk = R.next()

        except StopIteration:  # a more explicit error if the file is corrupted.
            raise "SumK_LDA.read_Sigma_ME : reading file failed!"
        R.close()

        # now initialize the GF with the mesh
        a_list = [a for a, al in self.GFStruct_Solver[orb]]
        glist = lambda: [
            GFBloc_ReFreq(Indices=al, Beta=Beta, MeshArray=mesh)
            for a, al in self.GFStruct_Solver[orb]
        ]
        SigmaME = GF(NameList=a_list, BlockList=glist(), Copy=False)
        SigmaME.load(Filename)
        SigmaME.Note = 'ReFreq'  # This is important for the put_Sigma routine!!!

        return SigmaME
Ejemplo n.º 2
0
    def constr_Sigma_ME(self,Filename, Beta, N_om, orb = 0):
        """Uses Data from files to construct a GF object on the real axis."""

        
        #first get the mesh out of one of the files:
        if (len(self.GFStruct_Solver[orb][0][1])==1):
            Fname = Filename+'_'+self.GFStruct_Solver[orb][0][0]+'.dat'
        else:
            Fname = Filename+'_'+self.GFStruct_Solver[orb][0][0]+'/'+str(self.GFStruct_Solver[orb][0][1][0])+'_'+str(self.GFStruct_Solver[orb][0][1][0])+'.dat'

        R = Read_Fortran_File(Fname)
        mesh = numpy.zeros([N_om],numpy.float_)
        try:
            for i in xrange(N_om): 
                mesh[i] = R.next()
                sk = R.next()
                sk = R.next()
                
        except StopIteration : # a more explicit error if the file is corrupted.
            raise "SumK_LDA.read_Sigma_ME : reading file failed!"
        R.close()

        # now initialize the GF with the mesh
        a_list = [a for a,al in self.GFStruct_Solver[orb]]
        glist = lambda : [ GFBloc_ReFreq(Indices = al, Beta = Beta, MeshArray = mesh) for a,al in self.GFStruct_Solver[orb] ] 
        SigmaME = GF(NameList = a_list, BlockList = glist(),Copy=False)
        SigmaME.load(Filename)
        SigmaME.Note='ReFreq'          # This is important for the put_Sigma routine!!!

        return SigmaME