In [1]:
#from __future__ import division 
%pylab inline
import string
%matplotlib qt 
#%matplotlib notebook
#%matplotlib nbagg
import matplotlib.ticker as ticker
import os

txt = 'run'
#txt = 'OldData/run'
txt2 = '/rho_'
inp ='/input_nrg.dat'
densPath = '/home/cifucito/nrgcode/TwoChNRG/Images/Density/run'

rcParams.update({'font.size': 23})
rc("text", usetex = True)
rc("font", family = "serif")
#rcParams['figure.subplot.hspace'] = 0.3
rcParams['figure.subplot.wspace'] = 0.1
from scipy.interpolate import griddata
from scipy.optimize import curve_fit
from scipy import interpolate
Gamma = 2.8269*0.02
pi*Gamma


Populating the interactive namespace from numpy and matplotlib
Out[1]:
0.17761936544865975

In [34]:
def readfile(ini, dot):
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQAVG.00.dat'
        output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        #output = 'NotSoOld_Data/'+txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        #output = 'OldData/'+txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        
        #Data managemente
        vec = [];        vec2 = []  
        for x in text:
            #print(list(x))
            a =x.split(' ') ;            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        #if j%20 == 1 : vec = vec[::-1];
        DOS= array(vec) ; w = array(vec2) 
        return DOS , w

In [66]:
dot = 1
init = 10
rho , w = readfile(init,dot-1)
plot(w,rho , label = 'NupPdn $\uparrow$')
rho1 , w1 = readfile(init,dot)
plot(w1,rho1, label = 'NupPdn $\downarrow$')
title('DOS Dot ' + str(dot))
init = 12
rho , w = readfile(init,dot-1)
plot(w,rho , label = 'QSz $\uparrow$')
rho1 , w1 = readfile(init,dot)
plot(w1,rho1, label = 'QSz $\downarrow$')
title('DOS Dot ' + str(dot))
legend()


Out[66]:
<matplotlib.legend.Legend at 0x7f3ef6817750>

In [65]:
dot = 4
init = 10
rho , w = readfile(init,dot)
plot(w,rho , label = 'NupPdn $\uparrow$')
rho1 , w1 = readfile(init,dot)

In [ ]:


In [ ]:


In [ ]:


In [44]:
#read files for folder ini and dot 
#returns DOS and w

zvec = ['0.60','0.80','1.00','1.20','1.40']    
def readfileZ(ini, dot, Ztrick):
        output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQ'+zvec[Ztrick]+'.dat'
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        #Data managemente
        vec = [];        vec2 = []  
        for x in text:
            #print(list(x))
            a =x.split(' ') ;            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        #if j%20 == 1 : vec = vec[::-1];
        DOS= array(vec) ; w = array(vec2) 
        return DOS , w    
    
    
def readfile_Param(ini, line):
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQAVG.00.dat'
        output = txt+repr(ini)+ inp 
        #output = '/home/cifucito/nrgcode/TwoChNRG/src/Main/Run/Run2DOtM/rho_2_2_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        return  float(text[line])    
    

def plotPH_Sym(initials ):
    f2, ax = subplots(size(initials), 1, sharex='col', sharey='row', figsize=(10, 4*(size(initials))))
    #suptitle('Majorana Connected to the First QD')
    #suptitle('Majorana Connected to Both QDs')
    for i in initials:
        num = where(initials == i)[0] ; num = num[0]
        for j in array([0,2]):
            dosUp , wUp = readfile(i, j)
            dosDown , wDown = readfile(i, j+1)
            #plot(wUp , dosUp, wUp , dosDown)
            vec1 = dosUp[ wUp > 0] + dosDown[ wDown > 0]
            vec2 = dosUp[ wUp < 0] + dosDown[ wDown < 0]
            #vec1 = dosUp[ wUp > 0] - dosUp[ wUp < 0][::-1] 
            #vec2 = dosDown[ wDown > 0][::-1] - dosDown[ wDown < 0]

            #print vec1 - vec2[::-1]
            #plot(wUp[ wUp > 0],vec1, wUp[ wUp < 0],vec2 )
            #ax.semilogx( wUp[ wUp > 0] , vec1/vec2[::-1] , 'o',label = 'D '+ str(j/2+1)+', i '+str(i))
            #if num%3 == 0 :
            #ax[num].semilogx( wUp[ wUp > 0] , vec2[::-1]/vec1, 'o',label = 'Dot '+str(j/2+1))
            #else :
            ax[num].semilogx( wUp[ wUp > 0] , vec1/vec2[::-1], 'o',label = 'Dot '+str(j/2+1))
            #plot( range(size(vec1))[::-1] , vec1/vec2[::-1] , 'o',label = 'Dot '+ str(j/2 +1))
            #print vec1[-1], vec2[0], vec1[-1]/vec2[0] 
            #plot( log(wUp[ wUp > 0]), vec1 , 'o',label = ''+ str(j/2))
            #plot(  (-1)*log(wUp[ wUp > 0]) , vec2[::-1] , 'o',label = ''+ str(j/2))
            #xlim([-10,10])
            #ylim([1.0-0.00002,1.0+0.00002])
            #ax[num].set_title('$\Gamma =' + str(readfile_Param(i, 3))+', N_s = ' +repr(readfile_Param(i, 1))+', \epsilon_{d2} = ' +repr(readfile_Param(i, 16))+'$'  , fontsize=22)
            #ax[num].set_title('$\Gamma =' + str(readfile_Param(i, 3))+', t_1 = t_2 = ' +repr(readfile_Param(i, param))+'$'  , fontsize=22)
        
        #ax[num].text(1, 1, r'$E=mc^2$', fontsize=15) 
        ax[num].set_ylim(0.5,1.5)
        ax[num].set_ylabel('$\\frac{\\rho_\uparrow(\omega^+)+ \\rho_\downarrow(\omega^+)}{\\rho_\uparrow(\omega^-) +\\rho_\downarrow(\omega^-)}$')
            #print vec1 - vec2[::-1]
    ax[num].legend(fontsize=20 , loc='upper left' )    
    ax[num].set_xlabel( '$\omega$' )  
                
            
def plotDOS(initials,line,limsx, limsy):
    Param_name = 't_1 = t_2'
    Param_name = '\epsilon_2'
    #Param_name = '\epsilon_2 = \\frac{-U_2}{2}'
    #Param_name = 't_2' 
    
    f, axarr = subplots(2, 2, sharex='col', sharey='row', figsize=(15, 10))
    #plot the DOS at the FE
    f2, axarr2 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
    #plot the relation between both DOS (up/Down)
    f3, axarr3 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
    
    t2 = []
    for ini in initials: 
        t2.append(readfile_Param(ini, line))
    t2 = array(t2) 
    
    #suptitle('Majorana Connected to the First QD')
    #print initials
    for i in range(4):
        vec0 = []
        maxi = []
        #for j in range(40,46):
        for j in initials:
            param = t2[where(initials == j)] ; param =  param[0]
            
            #Read file
            vec , vec2 = readfile(j, i)
            #get 0 value of the DOS
            #if j%10 ==0 : vec = vec[::-1];
            vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
            vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]
            vec0.append(0.5*(vec0mas + vec0menos)) ; maxi.append(max(vec))

            #plot DOS
            
            axarr[i/2 , i%2 ].plot(vec2,vec, '-',label= '$' + Param_name + '= '+str(param) + '$') 

        #Set graphic font
        if i%2 == 1: axarr[i/2 , i%2 ].legend(fontsize=16)
        #axarr[i/2 , i%2 ].set_ylim([0,max(maxi)])    
        #axarr[i/2 , i%2 ].set_xlim([-0.5,0.5])
        spin = '\uparrow' 
        if i%2 == 1 : spin = '\downarrow';  
        title = '$\\rho_{'+str(i/2 +1 )+ spin +'}$'
        axarr[i/2 , i%2 ].set_title(title)    
        axarr[i/2 , i%2 ].set_xlim([-limsx,limsx])
        axarr[i/2 , i%2 ].set_ylim([0,limsy])
        
        if i>1 : axarr[i/2 , i%2 ].set_xlabel('$\epsilon $',fontsize=25)
        if i%2 == 0 : axarr[i/2 , i%2 ].set_ylabel('$\\rho_{'+str(i/2 +1 )+ '}$',fontsize=25)

        #t2 = -0.25 + double(initials-initials[0]) * 0.05  
        #t2[-1] = -0.06 ; t2[-2] = -0.08 
        axarr2.plot(t2,vec0 ,'o', label= title + '$(0)$')
        if i%2 == 0 : 
            new0 = vec0
        else: 
            ydata = array(new0)/array(vec0)
            #popt, pcov = curve_fit(func, t2, ydata)
            #z = polyfit(t2, ydata, 3) ; f = poly1d(z) 
            #f = interpolate.interp1d(t2, ydata, kind='cubic')
            tnew =  np.linspace(t2[0], t2[-1], 50)
            axarr3.plot(t2,ydata,'o', label= 'Dot' + str(i/2 + 1) )
            #axarr3.plot(tnew,f(tnew),'-' )
            #axarr3.semilogy(t2,array(new0)/array(vec0) , basey=2)
            #axarr3.semilogy(t2,array(new0)/array(vec0) ,'o', label= 'Dot' + str(i/2 + 1),basey=2)
            #axarr3.semilogy(t2,log2(array(new0)/array(vec0)) ,'-', basey=2)
    axarr2.set_xlabel('$'+Param_name+'$',fontsize=25)
    axarr2.set_ylabel('$\\rho(0)$',fontsize=25)
    axarr2.legend(fontsize=20 , loc='upper right' )
    #axarr2.set_xlim([-0.25,-0.05])
    #axarr2.set_ylim([0.0,4.5])

    #axarr3.set_xlabel('$\epsilon_{d2}$',fontsize=25)
    axarr3.set_xlabel('$'+Param_name+'$',fontsize=25)
    axarr3.set_ylabel('$\\rho_\uparrow(0)/\\rho_\downarrow(0)$',fontsize=25)        
    axarr3.legend(fontsize=20, loc='upper right')        
    #axarr3.set_ylim([0,3])
    axarr3.set_xlim([t2[0],t2[-1]])
    #save = directory +'/'+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.png'
    #savefig(save)
    
    
def logplotDOS(initials , line):
    #plot the 4 DOS
    f, axarr = subplots(2, 2, sharex='col', sharey='row', figsize=(15, 10))
    #plot the DOS at the FE
    f2, axarr2 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
    #plot the relation between both DOS (up/Down)
    f3, axarr3 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
    
    t2 = []
    for j in initials: 
        t2.append(readfile_Param(j, line))
    t2 = array(t2) 
    for i in range(4):
        vec0 = []
        #for j in range(40,46):
        for j in initials:
            param = t2[where(initials == j)] ; param =  param[0]
            #Read file
            vec , vec2 = readfile(j, i)
            #get 0 value of the DOS
            if j%10 ==0 : vec = vec[::-1];
            vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
            vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]

            vec0.append(0.5*(vec0mas + vec0menos))

            #plot DOS
            #axarr[i/2 , i%2 ].plot(vec2,vec, label= '$\epsilon_{d2} ='+str(-0.25+(j-initials[0])*0.05 )+'$') 
            axarr[i/2 , i%2 ].semilogx(vec2[ vec2 > 0],vec[ vec2 > 0],'o',  label= '$'+ str()+'+$') 
            axarr[i/2 , i%2 ].semilogx(-vec2[ vec2 < 0],vec[ vec2 < 0],'o' ,label= '$'+ str(param)+',-$') 
        #Set graphic font
        if i%2 == 1: axarr[i/2 , i%2 ].legend(fontsize=12)
        #axarr[i/2 , i%2 ].set_xlim([-0.5,0.5])
        spin = '\uparrow' 
        if i%2 == 1 : spin = '\downarrow';  
        title = '$\\rho_{'+str(i/2 +1 )+ spin +'}$'
        print title
        axarr[i/2 , i%2 ].set_title(title)    
        #axarr[i/2 , i%2 ].set_ylim([-0.0,9.0])
        if i>1 : axarr[i/2 , i%2 ].set_xlabel('$\epsilon $',fontsize=25)
        if i%2 == 0 : axarr[i/2 , i%2 ].set_ylabel('$\\rho_{'+str(i/2 +1 )+ '}$',fontsize=25)

        #t2 = -0.25 + double(initials-initials[0]) * 0.05  
        #t2[-1] = -0.06 ; t2[-2] = -0.08 
        axarr2.plot(t2,vec0 ,'o', label= title + '$(0)$')


        if i%2 == 0 : 
            new0 = vec0
        else: 
            print array(vec0)/array(new0) 
            axarr3.plot(t2,array(new0)/array(vec0) ,'o', label= 'Dot' + str(i/2 + 1))

    axarr2.set_xlabel('$\epsilon_{d2}$',fontsize=25)
    axarr2.set_ylabel('$\\rho(0)$',fontsize=25)
    axarr2.legend(fontsize=24 , loc='upper right' )
    #axarr2.set_xlim([-0.25,-0.05])
    #axarr2.set_ylim([0.0,4.5])

    axarr3.set_xlabel('$\epsilon_{d2}$',fontsize=25)
    axarr3.set_ylabel('$\log_2(\\rho_\uparrow(0)/\\rho_\downarrow(0))$',fontsize=25)        
    axarr3.legend(fontsize=20, loc='upper right')        
    #axarr3.set_xlim([-0.25,-0.05])
    #axarr3.set_ylim([0.0,1.8])
    #save = directory +'/'+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.png'
    #savefig(save)    

zvec2 = ['0.6','0.8','1','1.2','1.4']    
def readCost(ini, Ztrick):
        output = txt+repr(ini)+'/output_DMNRG_zEQ'+zvec2[Ztrick]+'_Dir'+repr(ini)+'.txt'
        #output = txt+repr(ini)+'/output_NRG_Code_DM_NRG_Dir'+repr(ini)+'.txt'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        w= []
        costi = []
        for x in text:
                #print(list(x))
            a=x.split('(')
            if a[0]=='RhoCosti0_0':
                omega = a[1].split('=')[1] ; omega = omega.split(' ')[1] 
                cost = a[1].split('=')[2] 
                w.append(float(omega)) ; costi.append(float(cost))
                #print float(omega) ,cost
                #Data managemente
        w = array(w) ; costi = array(costi)  
        costi = costi[argsort(w)] ;         w = w[argsort(w)]
        return w , costi

In [31]:
rcParams['figure.subplot.hspace'] = 0.15
rcParams['figure.subplot.wspace'] = 0.0
plotDOS(initials,13,0.1,4)

In [102]:
initials = array([70,71,72,73,74])
#initials = array([70])
#initials = array([6])
initials = array([2002])
#print readfile_Param(1001, 1)
#print readfile_Param(1001, 3)
#initials = array([2011,2012,2013])
initials = array([2012,2013,2014])
initials = array([2020 , 2021, 20])
#initials = array([70,71,72,73,74])
initials = array([56,57,58,59,60])
#initials = array([35,36,37,38,39])
#initials = array([160,161,162,163,164])
#initials = array([161,162,163,164])
#initials = array([56,58,60])
#initials = array([85, 2002 , 2011])
#initials = array([126,127])
#initials = array([61,62,65])
initials = array([35,36,37,38,39])
initials = array([75,76,77,78,79])
initials = array([80,81,82,83,84])
initials = array([85,86])
#initials = array([90,91,92,93,94])
#initials = array([70,71,72,73,74])
plotPH_Sym(initials,16)

In [31]:
readfile_Param(2013, 3)


Out[31]:
0.088

In [32]:
initials = array([85,86])
#initials = initials[::2]
logplotDOS(initials,17)


$\rho_{1\uparrow}$
$\rho_{1\downarrow}$
[ 1.          0.99991951]
$\rho_{2\uparrow}$
$\rho_{2\downarrow}$
[ 1.          0.99991951]

In [9]:
#param = t2[where(initials == j)] ; param =  param[0]

ini =256
dot = 1
rcParams['figure.subplot.wspace'] = 0.2
f, axarr = subplots(1, 2, figsize=(14, 6))
params = [21,23,25,27,29,31]
#for ini in range(size(initials)):
for z in range(size(zvec)):
    vec , vec2 = readfileZ(ini, dot,z)
    #vec , vec2 = readfile(initials[ini], dot)
    axarr[0].semilogx(vec2[vec2>0],vec[vec2>0]/vec[vec2<0][::-1])
    axarr[1].plot(vec2,vec,'o',label= '$Z ='+ zvec[z] + '$')
    #axarr[1].plot(vec2,vec, label= '$N ='+ repr(params[ini]) + '$')
    axarr[0].set_xlabel('$\omega$',fontsize=25)        
    axarr[1].set_xlabel('$\omega$',fontsize=25)
    axarr[0].set_ylabel('$\\rho(\omega +)/\\rho(\omega -)$',fontsize=25)        
    axarr[1].set_ylabel('$\\rho(\omega)$',fontsize=25)   
    axarr[1].legend(fontsize=18 , loc='upper right' )
    #axarr[0].set_ylim(0,2) 
    axarr[1].set_xlim(-1 , 1)

In [10]:
rcParams['figure.subplot.wspace'] = 0.2
f, axarr = subplots(1, 2, figsize=(14, 6))
#params = [0.001 , 0.01,3]
params = zvec2 
print params
#print readCost(ini, 0)
#for ini in range(size(initials)):
ini =260
for z in range(size(zvec2)):
        w , costi = readCost(ini, z)
        #w , costi = readCost(initials[ini], z)
        axarr[0].semilogx(w[w>0],costi[w>0]/costi[w<0][::-1])
        axarr[1].plot(w,costi,label= 'Z =' + zvec2[z])
        #axarr[1].plot(w,costi,'o',label= '$N ='+ repr(params[ini]) + '$')    
        axarr[1].plot(w,costi,'-') 
        axarr[0].set_xlabel('$\omega$',fontsize=25)        
        axarr[1].set_xlabel('$\omega$',fontsize=25)
        axarr[0].set_ylabel('$cost(\omega +)/cost(\omega -)$',fontsize=25)        
        axarr[1].set_ylabel('$cost(\omega)$',fontsize=25)   
        axarr[1].legend(fontsize=18 , loc='upper right' )
        #axarr[0].set_ylim(0.95,1.05) 
        axarr[1].set_xlim(-1 , 1)


['0.6', '0.8', '1', '1.2', '1.4']

In [35]:
fig, axMaj = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
fig2, axMaj2 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
vec0 = []
initials = array([70,71,72,73,74,75,76,77])
initials = array([57,58,59,60])
#initials = array([30,31,32,33,34])
#initials = array([35,36,37,38,39])
#initials = initials[::2]
for j in initials:
        #Read file
    vec , vec2 = readfile(j, 4)
    #axMaj.plot(vec2,vec, label= '$\epsilon_{d2} ='+str(-0.25+(j-initials[0])*0.05 )+'$') 
    axMaj.plot(vec2,vec, label= '$\epsilon_{d2} ='+str(0.005+(j-initials[0])*0.005 )+'$')
    vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
    vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]
    vec0.append(0.5*(vec0mas + vec0menos))


t2 = -0.25 + double(initials-initials[0]) * 0.05
t2 = 0.005+ double(initials-initials[0]) * 0.005
#t2[-1] = -0.06 ; t2[-2] = -0.08 
axMaj2.plot(t2,vec0, 'o' , label= title + '$(0)$')
  

axMaj.legend(fontsize=20 )
axMaj.set_xlim([-0.1,0.1])    
axMaj.set_xlabel('$\omega$',fontsize=25)
axMaj.set_ylabel('$\\rho_M$',fontsize=25)

axMaj2.set_xlabel('$\epsilon_{d2}$',fontsize=25)
axMaj2.set_ylabel('$\\rho_M(0)$',fontsize=25)
#axMaj2.legend(fontsize=20 , loc='upper left' )
axMaj2.set_xlim([0.005,0.02])
#axMaj2.set_ylim([0.0,4.5])


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-35-b7a0cd8f92f3> in <module>()
     20 t2 = 0.005+ double(initials-initials[0]) * 0.005
     21 #t2[-1] = -0.06 ; t2[-2] = -0.08
---> 22 axMaj2.plot(t2,vec0, 'o' , label= title + '$(0)$')
     23 
     24 

TypeError: unsupported operand type(s) for +: 'function' and 'str'

In [ ]:
3/2

In [ ]:
L = array([5 , 2 , 4 ,10])

L[L >3]

In [ ]:
double(range(0,6)) * 0.05

In [ ]:
f, axarr = subplots(2, 2, sharex='col', sharey='row', figsize=(15, 10))
f2, axarr2 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
f3, axarr3 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))



initials = array([40,42,43,44])
#initials = array([40,41,42,43 ,44,45])
initials = array([61,62,63,64,65])
#initials = initials[::2]
initials = array([56,57,58,59,60])
initials = array([139])


print initials
for i in range(4):
    vec0 = []
    #for j in range(40,46):
    for j in initials:
        #Read file
        vec , vec2 = readfile(j, i)
        #get 0 value of the DOS
        if j%5 == 1 : vec = vec[::-1];
        vec = array(vec) ; vec2 = array(vec2) 
        vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
        vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]   
        vec0.append(0.5*(vec0mas + vec0menos))
        axarr[i/2 , i%2 ].plot(vec2,vec, label= '$t_{2} ='+str(0.00+(j-initials[0])*0.005 )+'$') 
    
    
    axarr[i/2 , i%2 ].legend(fontsize=20)
    axarr[i/2 , i%2 ].set_xlim([-0.5,0.5])
    
    spin = '\uparrow' 
    if i%2 == 1 : spin = '\downarrow';  
    title = 'Dot $'+str(i/2 +1 )+'$ , Spin $'+ spin +'$'
    axarr[i/2 , i%2 ].set_title(title)    
    #axarr[i/2 , i%2 ].set_ylim([-0.0,9.0])
    if i>1 : axarr[i/2 , i%2 ].set_xlabel('$\omega$',fontsize=25)
    if i%2 == 0 : axarr[i/2 , i%2 ].set_ylabel('Spectral Density',fontsize=25)
        
    t2 = -0.0 + double(initials-initials[0]) * 0.005    
    axarr2.plot(t2,vec0 ,'o', label= title)  
    
    if i%2 == 0 : 
        new0 = vec0
    else: 
        print array(vec0)/array(new0) 
        axarr3.plot(t2,array(vec0)/array(new0) ,'o', label= title)
    
axarr2.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr2.set_ylabel('$\pi \Gamma \\rho(0)$',fontsize=25)
axarr2.legend(fontsize=20)
axarr2.set_xlim([-0.0,0.02])
axarr2.set_ylim([0.0,4.5])

axarr3.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr3.set_ylabel('$\\rho_\uparrow(0)/\\rho_\downarrow(0)$',fontsize=25)        
axarr3.legend(fontsize=20)        
axarr3.set_xlim([-0.0,0.02])
axarr3.set_ylim([0.0,1.8])

In [ ]:


In [8]:


In [8]:


In [10]:
f, axarr = subplots(2, 2, sharex='col', sharey='row', figsize=(15, 10))
f2, axarr2 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))
f3, axarr3 = subplots(1, 1, sharex='col', sharey='row', figsize=(8, 5))



initials = array([40,42,43,44])
#initials = array([40,41,42,43 ,44,45])
initials = array([61,62,63,64,65])
#initials = initials[::2]
initials = array([35,36,37,38,39])
initials = initials[::2]
print initials
for i in range(4):
    vec0 = []
    #for j in range(40,46):
    for j in initials:
        #Read file
        vec , vec2 = readfile(j, i)
        
        #get 0 value of the DOS
        if j%20 == 1 : vec = vec[::-1];
        vec = array(vec) ; vec2 = array(vec2) 
        vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
        vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]   
        vec0.append(0.5*(vec0mas + vec0menos))
       
        axarr[i/2 , i%2 ].plot(vec2,vec, label= '$t_{2} ='+str(0.00+(j-initials[0])*0.005 )+'$') 
    
    
    axarr[i/2 , i%2 ].legend(fontsize=20)
    axarr[i/2 , i%2 ].set_xlim([-0.5,0.5])
    spin = '\uparrow' 
    if i%2 == 1 : spin = '\downarrow';  
    title = 'Dot $'+str(i/2 +1 )+'$ , Spin $'+ spin +'$'
    print title
    axarr[i/2 , i%2 ].set_title(title)    
    #axarr[i/2 , i%2 ].set_ylim([-0.0,9.0])
    if i>1 : axarr[i/2 , i%2 ].set_xlabel('$\omega$',fontsize=25)
    if i%2 == 0 : axarr[i/2 , i%2 ].set_ylabel('Spectral Density',fontsize=25)
        
    t2 = -0.0 + double(initials-initials[0]) * 0.005    
    axarr2.plot(t2,vec0 , label= title)  
    
    if i%2 == 0 : 
        new0 = vec0
    else: 
        print array(vec0)/array(new0) 
        axarr3.plot(t2,array(vec0)/array(new0) , label= title)
    
axarr2.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr2.set_ylabel('$\pi \Gamma \\rho(0)$',fontsize=25)
axarr2.legend(fontsize=20)
axarr2.set_xlim([-0.0,0.02])
axarr2.set_ylim([0.0,4.5])

axarr3.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr3.set_ylabel('$\\rho_\uparrow(0)/\\rho_\downarrow(0)$',fontsize=25)        
axarr3.legend(fontsize=20)        
axarr3.set_xlim([-0.0,0.02])
axarr3.set_ylim([0.0,1.8])


[35 37 39]
Dot $1$ , Spin $\uparrow$
Dot $1$ , Spin $\downarrow$
[ 0.50000003  0.50000001  0.5       ]
Dot $2$ , Spin $\uparrow$
Dot $2$ , Spin $\downarrow$
[ 0.50000026  0.50000004  0.5       ]
Out[10]:
(0.0, 1.8)

In [8]:


In [8]:


In [199]:
f, axarr = subplots(2, 2, sharex='col', sharey='row', figsize=(15, 10))
f2, axarr2 = subplots(1, 1, sharex='col', sharey='row', figsize=(15, 10))
f3, axarr3 = subplots(1, 1, sharex='col', sharey='row', figsize=(15, 10))

initials = array([30,31,32,33,34])
#initials = array([80,81,82,83,84])
initials = array([160,56])
#initials = initials[::2]
#initials = initials[4:5]
print initials
for i in range(4):
    vec0 = []
    #for j in range(40,46):
    for j in initials:
    #Read file
        vec , vec2 = readfile(j, i)
        #get 0 value of the DOS
        
        if j%20 == 2 : vec = vec[::-1];
        vec = array(vec) ; vec2 = array(vec2) 
        vec0mas = vec[ vec2 > 0] ; vec0mas = vec0mas[0]
        vec0menos = vec[ vec2 < 0] ; vec0menos = vec0menos[-1]
        vec0.append(0.5*(vec0mas + vec0menos))
        #print vec0mas , vec0menos , 0.5*(vec0mas + vec0menos)
        #maxima = vec[r_[True, vec[1:] > vec[:-1]] & r_[vec[:-1] > vec[1:], True]]
        #maxima = sort(maxima)
        
       
        axarr[i/2 , i%2 ].plot(vec2,vec,label= '$t_{2} ='+str(0.00+(j-initials[0])*0.005 )+'$') 
    print size(vec0)
    
    
    axarr[i/2 , i%2 ].legend(fontsize=20)
    axarr[i/2 , i%2 ].set_xlim([-0.5,0.5])
    spin = '\uparrow' 
    if i%2 == 1 : spin = '\downarrow';  
    title = 'Dot $'+str(i/2 +1 )+'$ , Spin $'+ spin +'$'
    print title
    axarr[i/2 , i%2 ].set_title(title)    
    #axarr[i/2 , i%2 ].set_ylim([-0.0,9.0])
    if i>1 : axarr[i/2 , i%2 ].set_xlabel('$\omega$',fontsize=25)
    if i%2 == 0 : axarr[i/2 , i%2 ].set_ylabel('Spectral Density',fontsize=25)
        
    t2 = -0.0 + double(initials-initials[0]) * 0.005    
    axarr2.plot(t2,vec0 , label= title)
    

        
    t2 = -0.0 + double(initials-initials[0]) * 0.005   
    
    if i%2 == 0 : 
        new0 = vec0
    else: 
        print array(vec0)/array(new0) 
        axarr3.plot(t2,array(new0)/array(vec0) , label= title)
    
axarr2.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr2.set_ylabel('$\pi \Gamma \\rho(0)$',fontsize=25)
axarr2.legend(fontsize=20)
axarr2.set_xlim([-0.0,0.02])
axarr2.set_ylim([0.0,4.5])

axarr3.set_xlabel('$t_1=t_{2}$',fontsize=25)
axarr3.set_ylabel('$\\rho_\uparrow(0)/\\rho_\downarrow(0)$',fontsize=25)        
axarr3.legend(fontsize=20)        
axarr3.set_xlim([-0.0,0.02])
#axarr3.set_ylim([0.0,1.0])


[160  56]
2
Dot $1$ , Spin $\uparrow$
2
Dot $1$ , Spin $\downarrow$
[ 1.  1.]
2
Dot $2$ , Spin $\uparrow$
2
Dot $2$ , Spin $\downarrow$
[ 1.  1.]
Out[199]:
(-0.0, 0.02)

In [ ]:
initials = array([109,119,124])
    for i in range(4):
        vec0 = []
        #for j in range(40,46):
        for j in initials:
            param = t2[where(initials == j)] ; param =  param[0]
            #Read file
            vec , vec2 = readfile(j, i)
            #get 0 value of the DOS