コード例 #1
0
ファイル: argobj.py プロジェクト: GiggleLiu/nrg
    def get_sigma_eig(self,wlist=None,interp='spline',kk_method='mac'):
        '''
        kk-relation to get (index1,index2) component of Sigma, we ignored pi factor here, for we will get U*FG^{-1}.

        For reference:
            * Initial version: J. Phys.: Condens. Matter 10.8365.
            * The matrix version: PRB 79.214518

        wlist:
            the frequency space.
        interp:
            interpolation method.

            * `spline`
            * `pchip`
        kk_method:
            method to calculate kk-relation(Appl. Spectrosc. 42.952).

            * `mac` -> using Maclaurin-method.
            * `fft` -> using Successive Double Fourier Transformation method.
        '''
        nband=self.nband
        print 'Interpolating A(w),B(w) to get self-energy Sigma(w).'
        t0=time.time()
        wl,Alist,Blist=self.data
        if not wlist is None:
            if interp=='pchip':
                interpolator=pchip_interpolate
            elif interp=='spline':
                interpolator=matrix_spline
            else:
                raise Exception('Undefined interpolation method @get_sigma.')
            Alist=interpolator(wl,Alist,wlist)
            Blist=interpolator(wl,Blist,wlist)
        else:
            wlist=wl
        Gilist=-pi*Alist
        Filist=-pi*Blist
        Gievals,Gievecs=eigh_sorted(Gilist)
        #Fievals,Fievecs=eig_sorted(Filist)
        if kk_method=='fft':
            Grevals=kk_fft(Gievals,'i2r',expand=1.5)
            Frlist=kk_fft(Filist,'i2r',expand=1.5)
        elif kk_method=='mac':
            Grevals=kk(Gievals,'i2r',wlist=wlist)
            Frlist=kk(Filist,'i2r',wlist=wlist)
        else:
            raise Exception('Undefined calculation method for kk-relation!')
        #Slist=self.U*array([(Br+1j*Bi).dot(inv(Ar+1j*Ai)) for Ar,Ai,Br,Bi in zip(Arlist,Alist,Brlist,Blist)])
        #Srlist=(swapaxes(Slist.conj(),1,2)+Slist)/2.
        #Silist=(swapaxes(Slist.conj(),1,2)-Slist)*(-1j/2.)
        Gevals=Grevals+1j*Gievals
        #Fevals=Frevals+1j*Fievals
        invG=eigen_combine(1./Gevals,Gievecs)
        F=Frlist+1j*Filist
        #why here is a minus sign?!
        S=-self.U*bcast_dot(F,invG)
        t1=time.time()
        print 'Elapse -> %s'%(t1-t0)
        return S,invG,F
コード例 #2
0
ファイル: argobj.py プロジェクト: GiggleLiu/nrg
    def get_sigma_naive(self,chain,recursive=False):
        '''
        get the naive self energy by `G0^{-1} - G^{-1}`.

        chain:
            the chain instance.
        recursive:
            the recursive approach.
        '''
        print 'Getting self-energy using Naive Method.'
        t0=time.time()
        wlist=self.data[0]
        if recursive:
            G0=chain.get_G0(wlist,geta=0.01)
        else:
            HL=chain.H0
            G0=mean([H2G(w=wlist[:,newaxis,newaxis],h=H0,geta=1e-2)[:,:2,:2] for H0 in HL],axis=0)
        Alist=self.data[1]
        Arlist=kk(Alist,'i2r',wlist=wlist)
        Gr=-pi*(Arlist+1j*Alist)
        sigma=inv(G0)-inv(Gr)
        t1=time.time()
        print 'Elapse -> %s'%(t1-t0)
        return sigma