Esempio n. 1
0
    def __init__(self,t,U=0,occ=True):
        self.t,self.U=t,U
        self.occ=occ

        #occupation representation will use <SuperSpaceConfig>, otherwise <SpaceConfig>.
        if self.occ:
            spaceconfig=SuperSpaceConfig([1,2,6,1])
        else:
            spaceconfig=SpaceConfig([1,2,6,1],kspace=False)
            if abs(U)>0: warnings.warn('U is ignored in non-occupation representation.')
        hgen=RHGenerator(spaceconfig=spaceconfig)

        #define the operator of the system
        hgen.register_params({
            't1':self.t,
            'U':self.U,
            })

        #define a structure and initialize bonds.
        rlattice=Structure(sites=[(0.,0),(0,sqrt(3.)/3),(0.5,sqrt(3.)/2),(0.5,-sqrt(3.)/6),(1.,0),(1.,sqrt(3.)/3)])
        hgen.uselattice(rlattice)

        b1s=rlattice.getbonds(1)  #the nearest neighbor

        #add the hopping term.
        op_t1=op_simple_hopping(label='hop1',spaceconfig=spaceconfig,bonds=b1s)
        hgen.register_operator(op_t1,param='t1')

        #add the hubbard interaction term if it is in the occupation number representation.
        if self.occ:
            op_ninj=op_U(label='ninj',spaceconfig=spaceconfig)
            hgen.register_operator(op_ninj,param='U')

        self.hgen=hgen
Esempio n. 2
0
    def __init__(self, t, t2=0, U=0, mu=0., occ=True, nsite=6):
        self.t, self.t2, self.U, self.mu = t, t2, U, mu
        self.occ = occ
        self.nsite = nsite

        #occupation representation will use <SuperSpaceConfig>, otherwise <SpaceConfig>.
        if self.occ:
            spaceconfig = SuperSpaceConfig(chorder([nsite, 2, 1]))
        else:
            spaceconfig = SpaceConfig(chorder([1, 2, nsite, 1]), kspace=False)
            if abs(U) > 0:
                warnings.warn('U is ignored in non-occupation representation.')
        hgen = RHGenerator(spaceconfig=spaceconfig)

        #define the operator of the system
        hgen.register_params({
            't1': self.t,
            't2': self.t2,
            'U': self.U,
            '-mu': -self.mu,
        })

        #define a structure and initialize bonds.
        rlattice = Chain(N=nsite)
        hgen.uselattice(rlattice)

        b1s = rlattice.getbonds(1)  #the nearest neighbor
        b2s = rlattice.getbonds(2)  #the nearest neighbor

        #add the hopping term.
        op_t1 = op_simple_hopping(label='hop1',
                                  spaceconfig=spaceconfig,
                                  bonds=b1s)
        hgen.register_operator(op_t1, param='t1')
        op_t2 = op_simple_hopping(label='hop2',
                                  spaceconfig=spaceconfig,
                                  bonds=b2s)
        hgen.register_operator(op_t2, param='t2')
        op_n = op_simple_onsite(label='n', spaceconfig=spaceconfig)
        hgen.register_operator(op_n, param='-mu')

        #add the hubbard interaction term if it is in the occupation number representation.
        if self.occ:
            op_ninj = op_U(label='ninj', spaceconfig=spaceconfig)
            hgen.register_operator(op_ninj, param='U')

        self.hgen = hgen
Esempio n. 3
0
    def __init__(self,t,t2=0,U=0,mu=0.,occ=True,nsite=6):
        self.t,self.t2,self.U,self.mu=t,t2,U,mu
        self.occ=occ
        self.nsite=nsite

        #occupation representation will use <SuperSpaceConfig>, otherwise <SpaceConfig>.
        if self.occ:
            spaceconfig=SuperSpaceConfig([1,2,nsite,1])
        else:
            spaceconfig=SpaceConfig([1,2,nsite,1],kspace=False)
            if abs(U)>0: warnings.warn('U is ignored in non-occupation representation.')
        hgen=RHGenerator(spaceconfig=spaceconfig)

        #define the operator of the system
        hgen.register_params({
            't1':self.t,
            't2':self.t2,
            'U':self.U,
            '-mu':-self.mu,
            })

        #define a structure and initialize bonds.
        rlattice=Chain(N=nsite)
        hgen.uselattice(rlattice)

        b1s=rlattice.getbonds(1)  #the nearest neighbor
        b2s=rlattice.getbonds(2)  #the nearest neighbor

        #add the hopping term.
        op_t1=op_simple_hopping(label='hop1',spaceconfig=spaceconfig,bonds=b1s)
        hgen.register_operator(op_t1,param='t1')
        op_t2=op_simple_hopping(label='hop2',spaceconfig=spaceconfig,bonds=b2s)
        hgen.register_operator(op_t2,param='t2')
        op_n=op_simple_onsite(label='n',spaceconfig=spaceconfig)
        hgen.register_operator(op_n,param='-mu')

        #add the hubbard interaction term if it is in the occupation number representation.
        if self.occ:
            op_ninj=op_U(label='ninj',spaceconfig=spaceconfig)
            hgen.register_operator(op_ninj,param='U')

        self.hgen=hgen
Esempio n. 4
0
    def __init__(self,t,mu,K1,K2,nsite,U=0.,periodic=False,use_sx=True):
        self.t,self.mu,self.K1,self.K2,self.U=t,mu,K1,K2,U
        self.nsite=nsite
        self.periodic=periodic
        self.use_sx=use_sx

        spaceconfig=SuperSpaceConfig(chorder([1,2,self.nsite,1]))
        hgen=RHGenerator(spaceconfig=spaceconfig)

        #define the operator of the system
        hgen.register_params({
            '-t':-self.t,
            'K1':self.K1,
            'K2':self.K2,
            '-mu':-self.mu,
            'U':self.U
            })

        #define a structure and initialize bonds.
        rlattice=Chain(N=nsite)
        if periodic:
            rlattice.usegroup(TranslationGroup(rlattice.N[:,newaxis]*rlattice.a,per=ones(1,dtype='bool')))
        hgen.uselattice(rlattice)

        b1s=rlattice.getbonds(1)  #the nearest neighbor

        #add the hopping term.
        op_t1=op_simple_hopping(label='hop1',spaceconfig=spaceconfig,bonds=b1s)
        hgen.register_operator(op_t1,param='-t')
        op_n=op_simple_onsite(label='n',spaceconfig=spaceconfig)
        hgen.register_operator(op_n,param='-mu')
        op_nn=op_U(spaceconfig=spaceconfig)
        hgen.register_operator(op_nn,param='U')

        #add the interaction term
        ql1=[]
        op_K1=sum([Qlinear(indices=array([
            spaceconfig.c2ind(chorder([0,i%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([1,i%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([1,(i+1)%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([0,(i+1)%nsite,0]))]),spaceconfig=spaceconfig)  #spin, atom orbit
            for i in xrange(nsite if periodic else nsite-1)])
        op_K1=op_K1+op_K1.HC
        op_K1.label='K1'
        hgen.register_operator(op_K1,param='K1')

        op_K2=sum([Qlinear(indices=array([
            spaceconfig.c2ind(chorder([0,i%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([0,(i+1)%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([1,(i+1)%nsite,0])),  #spin, atom orbit
            spaceconfig.c2ind(chorder([1,i%nsite,0]))]),spaceconfig=spaceconfig)  #spin, atom orbit
            for i in xrange(nsite if periodic else nsite-1)])
        op_K2=op_K2+op_K2.HC
        if self.use_sx:
            op_K2+=sum([Qlinear(indices=array([
                spaceconfig.c2ind(chorder([0,i%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([1,(i+1)%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([0,(i+1)%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([1,i%nsite,0]))]),spaceconfig=spaceconfig)  #spin, atom orbit
                for i in xrange(nsite if periodic else nsite-1)])
            op_K2+=sum([Qlinear(indices=array([
                spaceconfig.c2ind(chorder([1,i%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([0,(i+1)%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([1,(i+1)%nsite,0])),  #spin, atom orbit
                spaceconfig.c2ind(chorder([0,i%nsite,0]))]),spaceconfig=spaceconfig)  #spin, atom orbit
                for i in xrange(nsite if periodic else nsite-1)])
        op_K2.label='K2'
        hgen.register_operator(op_K2,param='K2')

        self.hgen=hgen
        self.qnumber='QR' if K2!=0 else 'QM'
Esempio n. 5
0
    def __init__(self,t,mu,alpha,U,Delta,Vz,nsite,periodic=False,occ=False,kspace=True,resonance=False):
        if kspace and not periodic:
            raise ValueError('Don\'t be silly, how can you use kspace with non-periodic system!')
        if kspace and occ:
            raise ValueError('Don\'t be silly, how can you use kspace with occupation representation!')
        if kspace and resonance:
            raise ValueError('Don\'t be silly, how can you use kspace to study resonance!')
        self.t,self.mu,self.alpha,self.U,self.Delta,self.Vz=t,mu,alpha,U,Delta,Vz
        self.nsite=nsite
        self.periodic=periodic
        self.resonance=resonance
        self.occ=occ
        nambu=abs(self.Delta)>0 and not occ
        #nambu=True
        nnambu=2 if nambu else 1
        junction_site=nsite/2

        if occ:
            spaceconfig=SuperSpaceConfig(chorder([1,2,self.nsite,1]))
            hgen=RHGenerator(spaceconfig=spaceconfig)
        elif kspace:
            spaceconfig=SpaceConfig(chorder([nnambu,2,1,1]),kspace=True)
            hgen=KHGenerator(spaceconfig=spaceconfig,propergauge=False)
        else:
            spaceconfig=SpaceConfig(chorder([nnambu,2,self.nsite,1]))
            hgen=RHGenerator(spaceconfig=spaceconfig)

        #define the operator of the system
        hgen.register_params({
            '-t/2':-self.t/2.,
            '-alpha/2':-self.alpha/2.,
            'U':self.U,
            'Vz':self.Vz,
            '-mu+t':-self.mu+self.t,
            'Delta':self.Delta,
            't':self.t,
            })

        #define a structure and initialize bonds.
        rlattice=Chain(N=nsite)
        if periodic:
            rlattice.usegroup(TranslationGroup(rlattice.N[:,newaxis]*rlattice.a,per=ones(1,dtype='bool')))
        hgen.uselattice(rlattice)

        b1s=rlattice.cbonds[1] if kspace else rlattice.getbonds(1)  #the nearest neighbor
        b0s=rlattice.cbonds[0] if kspace else rlattice.getbonds(0)  #the onsite bonds.
        brs=[b for b in b0s if b.atom1>=junction_site]
        bls=[b for b in b0s if b.atom1<junction_site]

        #add the hopping term and chemical potential.
        t0=time.time()
        op_t1=op_simple_hopping(label='hop1',spaceconfig=spaceconfig,bonds=b1s)
        hgen.register_operator(op_t1,param='-t/2')
        t1=time.time()
        if resonance:
            op_n=op_on_bond(label='n',spaceconfig=spaceconfig,bonds=brs,mats=[kron(sz,identity(2))]*len(brs))
            hgen.register_operator(op_n,param='t')
            op_nl=op_on_bond(label='nl',spaceconfig=spaceconfig,bonds=bls,mats=[kron(sz,identity(2))]*len(bls))
            hgen.register_operator(op_nl,param='-mu+t')
        else:
            op_n=op_simple_onsite(label='n',spaceconfig=spaceconfig)
            hgen.register_operator(op_n,param='-mu+t')
        t2=time.time()
        #the rashba term
        rmats=[1j*(sy if not nambu else kron(sz,sy))*(1 if b.bondv[0]>0 else -1) for b in b1s]
        op_r=op_on_bond(label='rashba',spaceconfig=spaceconfig,bonds=b1s,mats=rmats)
        hgen.register_operator(op_r,param='-alpha/2')
        t3=time.time()
        #the magnetic field
        op_Vz=op_on_bond(label='Sz',spaceconfig=spaceconfig,bonds=b0s,mats=[sz if not nambu else kron(sz,sz)]*len(b0s))
        hgen.register_operator(op_Vz,param='Vz')
        t4=time.time()
        if abs(Delta)>0:
            #the cooper pairing term, if the resonace mode, only the left side is added.
            if nambu:
                if resonance:
                    op_D=op_on_bond(label='D',spaceconfig=spaceconfig,bonds=bls,mats=[-kron(sy,sy)]*len(bls))
                else:
                    op_D=op_on_bond(label='D',spaceconfig=spaceconfig,bonds=b0s,mats=[-kron(sy,sy)]*len(b0s))
            else:
                op_D=op_supercooper(label='D',spaceconfig=spaceconfig,bonds=b0s,mats=[array([[0,1],[0,0]])]*len(b0s))
            hgen.register_operator(op_D,param='Delta')

        if occ:
            #add the interaction term
            op_ninj=op_U(label='ninj',spaceconfig=spaceconfig)
            hgen.register_operator(op_ninj,param='U')
        t5=time.time()
        print 'Elapse -> t: %s, n: %s, r: %s, B: %s, D: %s'%(t1-t0,t2-t1,t3-t2,t4-t3,t5-t4)

        self.hgen=hgen
Esempio n. 6
0
 def get_interaction(self):
     '''
     Get the interaction operator.
     '''
     return self.U*op_U(self.spaceconfig)