def rgop_c3(i,spinindex): r''' get NRG operator $c_{i\sigma}c_{i\bar{\sigma}}^\dag c_{i\bar{\sigma}}$ ''' spaceconfig=SuperSpaceConfig([1,2,1,1]) f1=op_c(spaceconfig=spaceconfig,index=spinindex)() f2=op_cdag(spaceconfig=spaceconfig,index=1-spinindex)() fff=op_c(spaceconfig=spaceconfig,index=1-spinindex)() FFF=f1.dot(f2.dot(fff)).view(OpArray) FFF.label='fff%s%s'%(i,'up' if spinindex==0 else 'dn') return op2expand(FFF,expansion_method='expand',starting_level=i+1)
def rgop_c(i,spinindex=0): ''' get the c^dag operator for specific site. i: the site index. spinindex: the spin index. ''' spaceconfig=SuperSpaceConfig([1,2,1,1]) fd=op_c(spaceconfig=spaceconfig,index=spinindex)().view(OpArray) fd.label='f%s%s'%(i,'up' if spinindex==0 else 'dn') return op2expand(fd,expansion_method='expand',starting_level=i+1)
def rgop_n(i,spinconfig='up'): ''' number of i-th site. i: site index. spinconfig: the spin configuration, refer spindict for more detail. ''' spaceconfig=SuperSpaceConfig([1,2,1,1]) n=0 for s1,s2,sfactor in spin_dict[spinconfig]: opcd=op_cdag(spaceconfig=spaceconfig,index=s1)().view(OpArray) opc=op_c(spaceconfig=spaceconfig,index=s2)().view(OpArray) n=n+dot(opcd,opc) n.label='n%s%s'%(i,spinconfig) return op2expand(n,expansion_method='expand',starting_level=i+1)