In [2]:
#from __future__ import division 
%pylab inline
import string
import os
txt = 'run'
txt = '/home/cifucito/nrgcode/TwoChNRG/Data/run'
txt2 = '/rho_'
densPath = '/home/cifucito/nrgcode/TwoChNRG/Images/Density/run'


Populating the interactive namespace from numpy and matplotlib

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

rc("text", usetex = True)
rc("font", family = "serif")
initials = array([40,42,43,44])
#initials = array([40,41,42,43 ,44,45])

for i in range(4):
    vec0 = []
    #for j in range(40,46):
    for j in initials:
        #output = txt+repr(j)+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.dat'
        output = txt+repr(j)+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow_zEQ1.40.dat'
        #output = '/home/cifucito/nrgcode/TwoChNRG/src/Main/Run/Run2DOtM/rho_2_2_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        vec = [];        vec2 = []  
        for x in text:
            #print(list(x))
            a =x.split(' ') ;            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        if j%6 == 0 : 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= '$\epsilon_{d2} ='+str(-0.25+(j-40)*0.05 )+'$') 
    print size(vec0)
    
    rcParams.update({'font.size': 25})
    axarr[i/2 , i%2 ].legend(fontsize=20)
    axarr[i/2 , i%2 ].set_xlim([-0.1,0.1])
    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.25 + double(initials-40) * 0.05    
    axarr2.plot(t2,vec0 , label= title)
    

        
    t2 = -0.25 + double(initials-40) * 0.05   
    
    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_2$',fontsize=25)
axarr2.set_ylabel('$\\rho(0)$',fontsize=25)
axarr2.legend(fontsize=20)

axarr3.set_xlabel('$t_2$',fontsize=25)
axarr3.set_ylabel('$\\rho_\uparrow(0)/\\rho_\downarrow(0)$',fontsize=25)        
axarr3.legend(fontsize=20)        
        
    
      
        
        
        #print repr(j)
        #axarr[i/2 , i%2 ].legend('vec'+repr(j))
    
    #ylabel('Spectral Density ',fontsize=18)
        #title(" , ".join(str(x) for x in maxima[-3:]),fontsize=10)
        #directory = densPath + repr(j)
        #!mkdir {directory}
        #save = directory +'/'+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.png'
        #savefig(save)
        #close()


4
Dot $1$ , Spin $\uparrow$
4
Dot $1$ , Spin $\downarrow$
[ 0.5         0.60413243  0.55205471  0.20380382]
4
Dot $2$ , Spin $\uparrow$
4
Dot $2$ , Spin $\downarrow$
[ 0.5         0.89344712  1.19443309  1.66866999]
Out[5]:
<matplotlib.legend.Legend at 0x7ff8ae884b90>

In [10]:
8%2


Out[10]:
0

In [4]:
3/2


Out[4]:
1

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

L[L >3]


Out[11]:
array([ 5,  4, 10])

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


Out[36]:
array([ 0.  ,  0.05,  0.1 ,  0.15,  0.2 ,  0.25])

In [ ]: