def show_mf(Vz,Delta,mu=0.,**kwargs): LABELSIZE=14 model=RashbaModel(Vz=Vz,Delta=Delta,mu=mu,**kwargs) filename_mf='data/mf_%s.npy'%model.get_str() mfs=load(filename_mf); mfs=mfs*mfs.conj() mfs=mfs.reshape([-1,4,mfs.shape[-1]]) sites=arange(1,mfs.shape[0]+1) ion() fig=figure(figsize=(7,5)) subplot(121) plot(sites,mfs[...,0]) xlim(0,100) ylim(-0.4,0.4) xlabel('Site',fontsize=LABELSIZE) ylabel('Amplitude',fontsize=LABELSIZE) subplot(122) plot(sites,mfs[...,1]) xlim(900,1000) xlabel('Site',fontsize=LABELSIZE) yticks([]) ylim(-0.4,0.4) legend([r'$e\uparrow$',r'$e\downarrow$',r'$h\uparrow$',r'$h\downarrow$'],loc=2) tight_layout() pdb.set_trace() savefig('data/mf_%s.png'%model.get_str())
def cal_dos_mf(Vz,Delta,mu=0.,**kwargs): ''' show the meanfield band. ''' model=RashbaModel(Vz=Vz,Delta=Delta,mu=mu,**kwargs) filename_dos='data/dos_%s.dat'%model.get_str() filename_mj='data/mf_%s.npy'%model.get_str() hgen=model.hgen if kwargs.get('kspace'): kl=hgen.kspace.kmesh hmesh=hgen.gethkmesh(kl) else: hmesh=hgen.H(dense=True) #tridmat=sr2trid(hmesh) #g=tinv(tridmat) hmesh=Hmesh(hmesh) emesh,vmesh=hmesh.getemesh(evalvk=True) wlist=linspace(-3,3,501) wlist,dos=Emesh(emesh).show_dos(wlist,geta=3e-3) dosdata=concatenate([wlist[:,newaxis],dos[:,newaxis]],axis=1) savetxt(filename_dos,dosdata) if not kwargs.get('kspace'): gate=0.01 has_mf=Vz>Delta and abs(mu)<sqrt(Vz**2-Delta**2) print 'Has Majorana fermion: %s.'%has_mf mjmask=abs(emesh)<gate print 'Zero Energy States(abs(E) < %s) -> %s'%(gate,emesh[mjmask]) mjdata=vmesh[:,mjmask] save(filename_mj,mjdata)
def plot_band(alpha,Vz,Delta,t=1.,mu=0.,nsite=100): ''' show the meanfield band. ''' model=RashbaModel(U=0.,alpha=alpha,Vz=Vz,Delta=Delta,t=t,mu=mu,nsite=nsite,periodic=True,kspace=True) hgen=model.hgen kl=hgen.kspace.kmesh-pi hkmesh=hgen.gethkmesh(kl) hmesh=Hmesh(hkmesh) print hmesh.check_hermicity() ekmesh=hmesh.getemesh() LABELSIZE=14 ion() fig=figure(figsize=(7,5)) plot(kl[:,0],ekmesh) if True:#hgen.spaceconfig.nnambu==1: axhline(y=0,ls='--',color='k') text(1.8,-0.1,'$\mu=0$',ha='center',va='center',fontsize=14) if Vz==0 and alpha!=0: dy=alpha**2/2 annotate('',xy=(-alpha,-2*dy),xycoords='data',xytext=(alpha,-2*dy),\ arrowprops=dict(arrowstyle='<->',shrinkA=0,shrinkB=0)) plot([-alpha,-alpha],[-dy-0.1,-dy+0.1],color='k',ls='-') plot([alpha,alpha],[-dy-0.1,-dy+0.1],color='k',ls='-') text(0,-2*dy-0.1,r'$2\alpha$',va='center',ha='center',fontsize=14) xlabel(r'$k$',fontsize=LABELSIZE) ylabel('Energy($t$)') xlim(-pi,pi) xticks([-pi,0,pi],[r'$-\pi/a$','0',r'$-\pi/a$'],fontsize=14) tight_layout() pdb.set_trace() savefig('data/band_%s.png'%model.get_str())
def show_dos(Vz,Delta,mu=0.,**kwargs): LABELSIZE=14 model=RashbaModel(Vz=Vz,Delta=Delta,mu=mu,**kwargs) filename_dos='data/dos_%s.dat'%model.get_str() data=loadtxt(filename_dos) wlist,dos=data[:,0],data[:,1] ion() fig=figure(figsize=(7,5)) plot(wlist,dos) xlabel('$\omega$',fontsize=LABELSIZE) ylabel('Density of States',fontsize=LABELSIZE) axes([0.65,0.65,0.2,0.2]) xlim(-0.2,0.2) xticks([-0.2,0,0.2]) ylim(0,0.5) plot(wlist,dos) pdb.set_trace() savefig('data/dos_%s.png'%model.get_str())
def cal_G(Vz,Delta,mu=0.,siteindex=0,force=False,**kwargs): ''' show the meanfield band. ''' N=2001 model=RashbaModel(Vz=Vz,Delta=Delta,mu=mu,kspace=False,**kwargs) hgen=model.hgen filename='data/G00_%s.dat'%(model.get_str()) hndim=hgen.spaceconfig.nnambu*hgen.spaceconfig.nspin wlist=linspace(-3,3,N) t0=time.time() if force: hmesh=hgen.H(dense=True) E,U=eigh(hmesh) U0=U[:hndim] else: hmesh=hgen.H(dense=False).tobsr((hndim,hndim)) invG=sr2trid(-hmesh,p=None) dg=invG.diagonal I=identity(hndim) gl=empty([N,4,4],dtype='complex128') #gl=zeros([0,4,4],dtype='complex128') geta=0.2e-3 for i,w in enumerate(wlist): z=w+geta*1j if force: G00=(U0/(z-E)).dot(U0.T.conj()) else: invG.diagonal=z*I+dg G=get_inv_system(invG) G00=G[0,0] #gl.append(array(G00)) #gl=concatenate([gl,G00[newaxis]],axis=0) gl[i]=G00 t1=time.time() pdb.set_trace() print 'Elapse -> %s'%(t1-t0) al=-1./pi*gl.diagonal(axis1=-1,axis2=-2).imag data=concatenate([wlist[:,newaxis],al],axis=1) savetxt(filename,data)
def show_mr(Vz,Delta,mu=0.,indexer=0,**kwargs): LABELSIZE=14 model=RashbaModel(Vz=Vz,Delta=Delta,mu=mu,**kwargs) filename_mf='data/mf_%s.npy'%model.get_str() mfs=load(filename_mf) mfs=mfs.reshape([-1,4,mfs.shape[-1]]) sites=arange(1,mfs.shape[0]+1) #sites=roll(sites,model.nsite/4,axis=0) mfs=roll(mfs,model.nsite/4,axis=0) ion() fig=figure(figsize=(7,5)) plot(sites,mfs[...,indexer]) ylim(-0.2,0.2) xlabel('Site',fontsize=LABELSIZE) ylabel('Amplitude',fontsize=LABELSIZE) legend([r'$e\uparrow$',r'$e\downarrow$',r'$h\uparrow$',r'$h\downarrow$'],loc=1) text(model.nsite/2,0.05,'$\Delta=0.1,\mu=0.3$',ha='center') text(model.nsite/8,0.05,'$\Delta=0,\mu=0$',ha='center') tight_layout() pdb.set_trace() savefig('data/mf_%s%s.png'%(model.get_str(),indexer))