コード例 #1
0
ファイル: vertexF.py プロジェクト: nkyirga/frg0d
    def _expandChannel(self,wS,wSX,wSY,AC,chnL):
        if chnL is 'PP':
            UnX = self.UnPP
        elif chnL is 'PH':
            UnX = self.UnPH  
        elif chnL is 'PHE':
            UnX = self.UnPHE
        
        beTa=self.beTa
        NW=self.NW
        wB=self.wB
        NLmax=self.NLmax
        nPoints=len(wS)
        
        wMidI=self.wMidI

        UnXi=np.swapaxes(UnX,1,2)
        UnXi=np.concatenate((np.conj(UnX[:0:-1,:,:]),UnX),axis=0)
        
        UnXiF=auxF.linInterp(wMidI,UnXi,wS)
        
        zSX=auxF.forMap(wSX/np.sqrt(AC**2+1),1.0)
        zSY=auxF.forMap(wSY/np.sqrt(AC**2+1),1.0)
        
        lTempXN=np.zeros((nPoints,1,NW))
        lTempYN=np.zeros((nPoints,NW,1))
        for i in range(NW):
            lTempXN[:,0,i]=auxF.freqExpansion(zSX,2*i)
            lTempYN[:,i,0]=auxF.freqExpansion(zSY,2*i)

        UnE=np.zeros(len(wS),dtype=np.complex_)
        UnE=np.squeeze(np.matmul(lTempXN,np.matmul(UnXiF,lTempYN)))

        return UnE
コード例 #2
0
ファイル: vertexF.py プロジェクト: nkyirga/frg0d
    def vertExpand(self,UnX,wS,wSX,wSY,AC):
        beTa=self.beTa
        NW=self.NW
        wB=self.wB
        NLmax=self.NLmax
        
        wMidI=self.wMidI

        uShape=wS.shape
        wS=np.reshape(wS,wS.size)
        wSX=np.reshape(wSX,wSX.size)
        wSY=np.reshape(wSY,wSY.size)
        nPoints=len(wS)
        
        UnXi=np.swapaxes(UnX,1,2)
        UnXi=np.concatenate((np.conj(UnX[:0:-1,:,:]),UnX),axis=0)

        UnXiF=auxF.linInterp(wMidI,UnXi,wS)
        
        zSX=auxF.forMap(wSX/np.sqrt(AC**2+1),1.0)
        zSY=auxF.forMap(wSY/np.sqrt(AC**2+1),1.0)
        
        lTempXN=np.zeros((nPoints,1,NW))
        lTempYN=np.zeros((nPoints,NW,1))
        for i in range(NW):
            lTempXN[:,0,i]=auxF.freqExpansion(zSX,2*i)
            lTempYN[:,i,0]=auxF.freqExpansion(zSY,2*i)

        UnE=np.zeros(len(wS),dtype=np.complex_)
        UnE=np.squeeze(np.matmul(lTempXN,np.matmul(UnXiF,lTempYN)))

        return np.reshape(UnE,uShape)
コード例 #3
0
ファイル: propG.py プロジェクト: nkyirga/frg0d
    def susBubbles(self, wQ, NW):
        """Calculates the exchange propagators for the susceptibility 
        of the system"""

        wFX = self.wFX
        wFG = self.wFG
        beTa = self.beTa

        gProp = self.gF
        gPropX = gProp(wFX, 0.0)

        gPropPHL = np.zeros((len(wQ), len(wFX)), dtype=np.complex_)
        gPropPHR = np.zeros((len(wQ), len(wFX)), dtype=np.complex_)
        for i in range(len(wQ)):
            gPropPHL[i, :] = wFG * gPropX * gProp(-wQ[i] + wFX, 0.0)
            gPropPHR[i, :] = wFG * gPropX * gProp(-wQ[i] + wFX, 0.0)

        gPHl = (1 / beTa) * np.sum(gPropPHL, axis=1)
        gPHr = (1 / beTa) * np.sum(gPropPHR, axis=1)
        (wS, wX) = np.meshgrid(wQ, wFX, indexing='ij')

        sPHL = np.zeros((len(wQ), 1, NW), dtype=np.complex_)
        sPHR = np.zeros((len(wQ), NW, 1), dtype=np.complex_)
        for i in range(NW):
            lTempWPHL = auxF.freqExpansion(
                auxF.forMap(0.5 * (2 * wX - wS), 1.0), 2 * i)
            lTempWPHR = auxF.freqExpansion(
                auxF.forMap(0.5 * (2 * wX - wS), 1.0), 2 * i)

            sPHL[:, 0, i] = (1 / beTa) * np.sum(lTempWPHL * gPropPHL, axis=1)
            sPHR[:, i, 0] = (1 / beTa) * np.sum(lTempWPHR * gPropPHR, axis=1)

        return sPHL, sPHR, gPHl, gPHr
コード例 #4
0
ファイル: propG.py プロジェクト: nkyirga/frg0d
    def gBubbles(self, wQ, AC, NW):
        """Calculates the exchange propagtor at scale AC over 
        NW basis functions"""

        wFX = self.wFX
        wFG = self.wFG
        beTa = self.beTa

        gProp = self.gF
        gPropX = gProp(wFX, AC)

        gPropPP = np.zeros((len(wQ), len(wFX)), dtype=np.complex_)
        gPropPH1 = np.zeros(gPropPP.shape, dtype=np.complex_)
        gPropPH2 = np.zeros(gPropPP.shape, dtype=np.complex_)
        for i in range(len(wQ)):
            gPropPP[i, :] = wFG * gPropX * gProp(wQ[i] - wFX, AC)
            gPropPH1[i, :] = wFG * gPropX * gProp(wQ[i] + wFX, AC)
            gPropPH2[i, :] = wFG * gPropX * gProp(-wQ[i] + wFX, AC)

        (wS, wX) = np.meshgrid(wQ, wFX, indexing='ij')
        wPP1 = 0.5 * (wS - 2 * wX) / np.sqrt(AC**2 + 1)
        wPP2 = 0.5 * (-wS + 2 * wX) / np.sqrt(AC**2 + 1)

        wPH1 = 0.5 * (wS + 2 * wX) / np.sqrt(AC**2 + 1)
        wPH2 = 0.5 * (-wS + 2 * wX) / np.sqrt(AC**2 + 1)

        lTempPP1 = np.zeros((len(wQ), len(wFX), NW))
        lTempPP2 = np.zeros((len(wQ), len(wFX), NW))

        lTempPH1 = np.zeros((len(wQ), len(wFX), NW))
        lTempPH2 = np.zeros((len(wQ), len(wFX), NW))
        for i in range(NW):
            lTempPP1[..., i] = auxF.freqExpansion(auxF.forMap(wPP1, 1.0),
                                                  2 * i)
            lTempPP2[..., i] = auxF.freqExpansion(auxF.forMap(wPP2, 1.0),
                                                  2 * i)

            lTempPH1[..., i] = auxF.freqExpansion(auxF.forMap(wPH1, 1.0),
                                                  2 * i)
            lTempPH2[..., i] = auxF.freqExpansion(auxF.forMap(wPH2, 1.0),
                                                  2 * i)

        gPP = np.zeros((len(wQ), NW, NW), dtype=np.complex_)
        gPH = np.zeros((len(wQ), NW, NW), dtype=np.complex_)
        for i in range(NW):
            for j in range(NW):
                intGPP=(lTempPP1[...,i]*lTempPP2[...,j]+\
                            lTempPP2[...,i]*lTempPP1[...,j])*gPropPP

                intGPH=lTempPH1[...,i]*lTempPH1[...,j]*gPropPH1+\
                    lTempPH2[...,i]*lTempPH2[...,j]*gPropPH2

                gPP[:, i, j] = (0.5 / beTa) * np.sum(intGPP, axis=1)
                gPH[:, i, j] = (0.5 / beTa) * np.sum(intGPH, axis=1)

        return gPP, gPH
コード例 #5
0
ファイル: vertexF.py プロジェクト: nkyirga/frg0d
    def initializeVertex(self):
        """Calculates the intial vertex in the three channels"""

        wB,NW,beTa=self.wB,self.NW,self.beTa
        NLmax=self.NLmax
        zFX,zFG=auxF.gaussianInt([-1,1],30)

        UnPPO=np.zeros((len(wB),NW,NW),dtype=np.complex_)
        UnPHO=np.zeros((len(wB),NW,NW),dtype=np.complex_)
        UnPHEO=np.zeros((len(wB),NW,NW),dtype=np.complex_)

        wFX=auxF.backMap(zFX,1.0)
        wP1=np.tile(wFX[:,np.newaxis],(1,len(wFX)))
        wP2=np.tile(wFX[np.newaxis,:],(len(wFX),1))
        zP1=np.tile(zFX[:,np.newaxis],(1,len(zFX)))
        zP2=np.tile(zFX[np.newaxis,:],(len(zFX),1))
        zPG=np.tile(zFG[:,np.newaxis],(1,len(zFX)))
        zPG=zPG*np.tile(zFG[np.newaxis,:],(len(zFX),1))

        for i in range(len(wB)):
            wS=np.zeros((len(wFX),len(wFX)))+wB[i]
            
            wPH=wP1+wP2
            wPHE=wP2-wP1
            uPP=self.uF(wS,wPH,wPHE)

            wPP=wP1+wP2
            wPHE=wP2-wP1
            uPH=self.uF(wPP,wS,wPHE)

            wPP=wP1+wP2
            wPH=wP1-wP2
            uPHE=self.uF(wPP,wPH,wS)

            for j in range(NW):
                lTemp1=auxF.freqExpansion(zP1,2*j)
                for k in range(NW):
                    lTemp2=auxF.freqExpansion(zP2,2*k)
                    UnPPO[i,j,k]=np.sum(zPG*uPP*lTemp1*lTemp2)
                    UnPHO[i,j,k]=np.sum(zPG*uPH*lTemp1*lTemp2)
                    UnPHEO[i,j,k]=np.sum(zPG*uPHE*lTemp1*lTemp2)
        
        return UnPPO,UnPHO,UnPHEO       
コード例 #6
0
ファイル: vertexF.py プロジェクト: nkyirga/frg0d
    def legndExpand(self,UnX,AC):
        """Expands the frequency dependence of UnX in terms of basis set""" 
        wB=self.wB
        beTa=self.beTa
        NW=self.NW
        NLmax=self.NLmax
        zFX,zFG=self.zFX,self.zFG
        wMidI=self.wMidI
        cScale=1.0
        
        UnXi=np.swapaxes(UnX,1,2)
        UnXi=np.concatenate((np.conj(UnXi[:0:-1,:,:]),UnX),axis=0)

        UnXiF=auxF.linInterp(wMidI,UnXi,auxF.backMap(zFX,cScale)*np.sqrt(AC**2+1))
        UnL=np.zeros((NLmax,NW,NW),dtype=np.complex_)
        
        zFXE=np.tile(zFX[:,np.newaxis,np.newaxis],(1,NW,NW))
        zFGE=np.tile(zFG[:,np.newaxis,np.newaxis],(1,NW,NW))
        for i in range(NLmax):
            UnL[i,:,:]=np.sum(zFGE*auxF.freqExpansion(zFXE,2*i)*UnXiF,axis=0)

        return UnL
コード例 #7
0
ファイル: vertexF.py プロジェクト: nkyirga/frg0d
    def projectionW(self):
        """Calculates the arrays for projection between the channels at the 
        start of the flow"""

        NW=self.NW
        NLmax=self.NLmax
        wB=self.wB
        zFX,zFG=auxF.gaussianInt([-1,1],30)
        cScale=1.0

        scaleDerv=np.zeros((NW,NW,NW,NW))
        for i in range(NW):
            for j in range(NW):
                scaleTemp1=np.zeros((NW,NW))
                scaleTemp2=np.zeros((NW,NW))
                for k in range(1,NW):
                    intG=(zFX**2)*auxF.freqExpansion(zFX,2*k)-zFX*auxF.freqExpansion(zFX,2*k-1)
                    scaleTemp1[k,j]=2*k*np.sum(zFG*intG*auxF.freqExpansion(zFX,2*i))

                    intG=(zFX**2)*auxF.freqExpansion(zFX,2*k)-zFX*auxF.freqExpansion(zFX,2*k-1)
                    scaleTemp2[i,k]=2*k*np.sum(zFG*intG*auxF.freqExpansion(zFX,2*j))
                scaleDerv[:,:,i,j]=-(scaleTemp1+scaleTemp2)
        self.scaleDerv=scaleDerv

        wTransPHtoPP=np.zeros((NLmax,NW,NW,len(wB),NW,NW))
        wTransPHEtoPP=np.zeros((NLmax,NW,NW,len(wB),NW,NW))
        wTransPPtoPH=np.zeros((NLmax,NW,NW,len(wB),NW,NW))
        wTransPHEtoPH=np.zeros((NLmax,NW,NW,len(wB),NW,NW))
        wTransPPtoPHE=np.zeros((NLmax,NW,NW,len(wB),NW,NW))
        wTransPHtoPHE=np.zeros((NLmax,NW,NW,len(wB),NW,NW))

        wFX=auxF.backMap(zFX,cScale)
        wP1=np.tile(wFX[:,np.newaxis,np.newaxis],(1,len(wFX),len(wB)))
        wP2=np.tile(wFX[np.newaxis,:,np.newaxis],(len(zFX),1,len(wB)))
        wBE=np.tile(wB[np.newaxis,np.newaxis,:],(len(zFX),len(zFX),1))

        wFXE=np.tile(wFX[:,np.newaxis],(1,len(wB)))
        wBEe=np.tile(wB[np.newaxis,:],(len(zFX),1))

        zP1=np.tile(zFX[:,np.newaxis,np.newaxis],(1,len(zFX),len(wB)))
        zP2=np.tile(zFX[np.newaxis,:,np.newaxis],(len(zFX),1,len(wB)))
        zPE=np.tile(zFG[:,np.newaxis,np.newaxis],(1,len(zFX),len(wB)))
        zPE=zPE*np.tile(zFG[np.newaxis,:,np.newaxis],(len(zFX),1,len(wB)))

        lTempXtoY1=np.zeros((len(zFX),len(zFX),len(wB),NLmax))
        lTempXtoY2=np.zeros((len(zFX),len(zFX),len(wB),NLmax))

        for i in range(NLmax):
            zT=auxF.forMap((wP1+wP2),cScale)
            lTempXtoY1[...,i]=zPE*auxF.freqExpansion(zT,2*i)

            zT=auxF.forMap((wP2-wP1),cScale)
            lTempXtoY2[...,i]=zPE*auxF.freqExpansion(zT,2*i)

        lTempP1=np.zeros((len(zFX),len(zFX),len(wB),NW))
        lTempP2=np.zeros((len(zFX),len(zFX),len(wB),NW))
        lTempP3=np.zeros((len(zFX),len(zFX),len(wB),NW))
        lTempP4=np.zeros((len(zFX),len(zFX),len(wB),NW))

        lTempW1=np.zeros((len(zFX),len(zFX),len(wB),NW))
        lTempWn=np.zeros((len(zFX),len(wB),NW))

        for i in range(NW):
            zT=auxF.forMap(0.5*(wBE-(wP2-wP1)),cScale)
            lTempP1[...,i]=auxF.freqExpansion(zT,2*i)

            zT=auxF.forMap(0.5*(wBE+(wP2-wP1)),cScale)
            lTempP2[...,i]=auxF.freqExpansion(zT,2*i)

            zT=auxF.forMap(0.5*(wBE-(wP1+wP2)),cScale)
            lTempP3[...,i]=auxF.freqExpansion(zT,2*i)

            zT=auxF.forMap(0.5*(wBE+(wP1+wP2)),cScale)
            lTempP4[...,i]=auxF.freqExpansion(zT,2*i)

            lTempW1[...,i]=auxF.freqExpansion(zP1,2*i)
            lTempWn[...,i]=auxF.freqExpansion(auxF.forMap(wFXE,cScale),2*i)
        
        wTemp1=np.zeros((len(zFX),NW,NW,len(wB),NW))
        wTemp2=np.zeros((len(zFX),NW,NW,len(wB),NW))
        for i in range(NLmax):
            for j in range(NW):
                for k in range(NW):
                    for l in range(NW):
                        wTemp1[:,j,k,:,l]=np.sum(lTempXtoY1[...,i]*lTempP1[...,j]*lTempP2[...,k]*lTempW1[...,l],axis=0)
                        wTemp2[:,j,k,:,l]=np.sum(lTempXtoY2[...,i]*lTempP3[...,j]*lTempP4[...,k]*lTempW1[...,l],axis=0)
                    
            for j in range(NW):
                intG=lTempWn[...,j]
                intG=np.tile(intG[:,np.newaxis,np.newaxis,:,np.newaxis],(1,NW,NW,1,NW))
                wTransPHtoPP[i,:,:,:,:,j]=np.sum(intG*wTemp1,axis=0)
                wTransPHEtoPP[i,:,:,:,:,j]=np.sum(intG*wTemp2,axis=0)
        wTransPPtoPH=wTransPHtoPP[:]
        for j in range(NW):
            wTransPHEtoPH[:,j,:,:,:,:]=wTransPHEtoPP[:,j,:,:,:,:]
            wTransPPtoPHE[:,j,:,:,:,:]=wTransPHtoPP[:,j,:,:,:,:]
            wTransPHtoPHE[:,j,:,:,:,:]=wTransPHEtoPP[:,j,:,:,:,:]

        self.wTransPHtoPP=wTransPHtoPP
        self.wTransPHEtoPP=wTransPHEtoPP
        self.wTransPPtoPH=wTransPPtoPH
        self.wTransPHEtoPH=wTransPHEtoPH
        self.wTransPPtoPHE=wTransPPtoPHE
        self.wTransPHtoPHE=wTransPHtoPHE
コード例 #8
0
ファイル: propG.py プロジェクト: nkyirga/frg0d
    def xBubbles(self, wQ, dSEwMid, AC, NW):
        """Calculates the single scale exchange propagator over
        the NW basis functions"""

        beTa = self.beTa
        wFX = self.wFX
        wFG = self.wFG
        wFI = self.wFI

        dSE = np.zeros(len(wFX), dtype=np.complex_)
        dSEI = np.append(np.conj(dSEwMid[::-1]), dSEwMid)
        dSE += np.interp(wFX, wFI, dSEI.real)
        dSE += 1j * np.interp(wFX, wFI, dSEI.imag)

        gProp = self.gF
        sProp = self.sF(wFX, AC) + dSE * (gProp(wFX, AC)**2)

        sPropPP = np.zeros((len(wQ), len(wFX)), dtype=np.complex_)
        sPropPH1 = np.zeros(sPropPP.shape, dtype=np.complex_)
        sPropPH2 = np.zeros(sPropPP.shape, dtype=np.complex_)
        for i in range(len(wQ)):
            sPropPP[i, :] = wFG * sProp * gProp(wQ[i] - wFX, AC)
            sPropPH1[i, :] = wFG * sProp * gProp(wQ[i] + wFX, AC)
            sPropPH2[i, :] = wFG * sProp * gProp(-wQ[i] + wFX, AC)

        (wS, wX) = np.meshgrid(wQ, wFX, indexing='ij')
        wPP1 = 0.5 * (wS - 2 * wX) / np.sqrt(AC**2 + 1)
        wPP2 = 0.5 * (-wS + 2 * wX) / np.sqrt(AC**2 + 1)

        wPH1 = 0.5 * (wS + 2 * wX) / np.sqrt(AC**2 + 1)
        wPH2 = 0.5 * (-wS + 2 * wX) / np.sqrt(AC**2 + 1)

        lTempPP1 = np.zeros((len(wQ), len(wFX), NW))
        lTempPP2 = np.zeros((len(wQ), len(wFX), NW))

        lTempPH1 = np.zeros((len(wQ), len(wFX), NW))
        lTempPH2 = np.zeros((len(wQ), len(wFX), NW))
        for i in range(NW):
            lTempPP1[..., i] = auxF.freqExpansion(auxF.forMap(wPP1, 1.0),
                                                  2 * i)
            lTempPP2[..., i] = auxF.freqExpansion(auxF.forMap(wPP2, 1.0),
                                                  2 * i)

            lTempPH1[..., i] = auxF.freqExpansion(auxF.forMap(wPH1, 1.0),
                                                  2 * i)
            lTempPH2[..., i] = auxF.freqExpansion(auxF.forMap(wPH2, 1.0),
                                                  2 * i)

        mixPP = np.zeros((len(wQ), NW, NW), dtype=np.complex_)
        mixPH = np.zeros((len(wQ), NW, NW), dtype=np.complex_)
        for i in range(NW):
            for j in range(NW):
                intGPP=(lTempPP1[...,i]*lTempPP2[...,j]+\
                            lTempPP2[...,i]*lTempPP1[...,j])*sPropPP

                intGPH=lTempPH1[...,i]*lTempPH1[...,j]*sPropPH1+\
                    lTempPH2[...,i]*lTempPH2[...,j]*sPropPH2

                mixPP[:, i, j] = (1 / beTa) * np.sum(intGPP, axis=1)
                mixPH[:, i, j] = (1 / beTa) * np.sum(intGPH, axis=1)

        return mixPP, mixPH
コード例 #9
0
ファイル: testF.py プロジェクト: nkyirga/frg0d
    zFLogX, zFLogG = auxF.gaussianInt(zFX, 8)

    uPPElog = np.zeros(len(zFLogX), dtype=np.complex_)
    uPPEalg = np.zeros(len(zFAlgX), dtype=np.complex_)

    uPPElog = np.interp(logBackMap(zFLogX, fA), wBE, uPPl[:, i].real) + 0 * 1j
    uPPElog += 1j * np.interp(logBackMap(zFLogX, fA), wBE, uPPl[:, i].imag)

    uPPEalg = np.interp(algBackMap(zFAlgX, fA), wBE, uPPl[:, i].real) + 0 * 1j
    uPPEalg += 1j * np.interp(algBackMap(zFAlgX, fA), wBE, uPPl[:, i].imag)

    bTempLog = np.zeros(len(wBE), dtype=np.complex_)
    bTempAlg = np.zeros(len(wBE), dtype=np.complex_)

    for j in range(NW):
        algN[j] = np.sum(zFAlgG * auxF.freqExpansion(zFAlgX, j) * uPPEalg)
        logN[j] = np.sum(zFLogG * auxF.freqExpansion(zFLogX, j) * uPPElog)

        bTempLog += logN[j] * auxF.freqExpansion(logForMap(wBE, fA), j)
        bTempAlg += algN[j] * auxF.freqExpansion(algForMap(wBE, fA), j)

    logPPl[:, i] = bTempLog.real
    algPPl[:, i] = bTempAlg.real

    #logPPl[:,i]=np.interp(wBE,fA*wBE,bTempLog.real)
    #algPPl[:,i]=np.interp(wBE,fA*wBE,bTempAlg.real)

print ACl[10], ACl[40], ACl[80]
plt.style.use('seaborn-paper')

plt.plot(np.arange(0, NW, 2),