Code Outline

This file includes the graphic codes for the DOS data coming from the *NRG* code ($i$-files) and the exact green functions ('di' folders) written by *GreenFunctions.nb.*

Read Files

In this file we define the functions to read the density of states from the output data of the NRG code. Functions:

  1. readfile($i$, $n_{dot}$) - read DOS data from NRG of dot $n_{dot}$ in file $i$.
  2. readfile_Param($i$, $l$) - read DOS parameter of the line $l$ in file $i$.
  3. readMath(title) - read the data obtained from the Green functions written by the file GreenFunctions.nb.

The NRG configurations of the file parameters $i$ are detailed in the file GUIDE.txt.

Line parameter $l$, selection values:

  1. $a$
  2. $\Gamma_1$
  3. $\epsilon_d$
  4. $\Lambda$

And ...

  1. $h$
  2. $t_1$
  3. $t_2$
  4. $U_2$
  5. $\Gamma_2$
  6. $e_2$
  7. $t_{dots}$

Plot functions

Plot single dot functions for the output data from NRG and GreenFunctions.nb. Functions:

  1. plotMath - Plot DOS of the data obtained from the Green functions written by the file GreenFunctions.nb
  2. plotOneDot - Plot DOS of the NRG data in one dot
  3. plotFullDot- Plot DOS of the NRG data in one dot for spin-up and spin-down. Options: Adding inset images and low-energy zooms. (Useful to print the Majorana configuration)

Subplot building

The functions here build n-level subplots that will be used to describe the final results.

Code implementations

Examples of plots produced with this method.

Initializing Parameters


In [1]:
#Interactive plots 
%pylab 



# inline
import string
# import matplotlib.ticker as ticker
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
# from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
import os

#%matplotlib qt 
#%matplotlib notebook
#%matplotlib nbagg
#from __future__ import division 

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

rcParams.update({'font.size': 30})
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
mpl.rcParams['lines.linewidth'] = 2
Gamma = 2.82691*0.01
print 'This is $\pi \Gamma$ ' + repr(pi*Gamma)


Using matplotlib backend: TkAgg
Populating the interactive namespace from numpy and matplotlib
This is $\pi \Gamma$ 0.08880999688359521

Read Files


In [2]:
#The following functions read the NRG outputs

#read files for folder ini and dot 
#Inputs: ini = 1 - 1000 , dot = 0,1,2,3,4 
#return DOS - Density of states , w - energy
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'
#         dat = loadtxt(output, delimiter = ' ') 
                #Data managemente
        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%20 == 1 : vec = vec[::-1];
        DOS= array(vec) ; w = array(vec2)      
#         DOS= dat[:,1] ; w = dat[:,0] 
        return DOS , w
    
    


#Given a line in the data file, readfile_Param returns the parameter value of file ini  at the given line    
#inputs : ini = 1 ... 1000 , line = 1-17
#return : float with the parameter of the line
def readfile_Param(ini, line):
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQAVG.00.dat'
        #output = '/home/cifucito/nrgcode/TwoChNRG/src/Main/Run/Run2DOtM/rho_2_2_OmegaRhow.dat'
        output = txt+repr(ini)+ inp 
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        return  float(text[line])    

    
#Read Math : Reads the data obtaind from the Green functions in Mathematica
# input: title of the data file from the di folders
# output w , DOS
def readMath( title):
    LIMSX = 10 # Limit of the w values in the DOS
    infile = open(os.path.abspath( title ), 'r')
    text = infile.readlines()
    Green = []
    for x in text:
         Green.append(pi*Gamma*float(x.split('\n')[0]))
    #return linspace(-10,10,500), array(Green)/(pi*Gamma)
    return linspace(-LIMSX,LIMSX,500), array(Green)

Plot Functions


In [3]:
# PlotMath: Plot the data from the Green functions
# Input: ax-axis, title- title of the data file, lb -text in label ,
#        col - color

def plotMath( ax , title , lb , style,col):
    LIMSX = 10 # Limit of the w values in the DOS
    w , Green = readMath( title)
    Green = Green#/(pi*Gamma)
    NLN = 4
    
    if col == 'no':
        if lb == '':
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style ) 
        else :
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style,  linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style)
            
    else:
        if lb == '':
            if col == 'b'or style == ':' :
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , color = col, linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , color = col) 

        else :
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style, color = col , linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style, color = col)
            
# Plot NRG results of a particular dot
# Input: ax-axis, i (int)- file number, SUM(boolean) - Sum data with file i+10  ,
#        Reverse (boolean)- Invert data
def plotOneDot(ax,i , dot , SUM , Reverse): #U=8.6 \Gamma_1 
    vec , w = readfile(i, dot)
    NLN = 4
#     if Reverse:
#         vec = vec[::-1]
    if SUM :
        # IMPORTANT DETAIL. USE: 10 FOR NEWFILES 
        #                        100 for Old files
        Add = 100 if i > 400 else 10
        rho , vec2 = readfile(i+Add, dot) 
        print 'sum' + repr(Add)
        vec = 0.5*(rho+vec)
        if Reverse:
            vec = vec[::-1]
        
    #vec = vec#*pi*Gamma#*Hib
    spin = '\uparrow' if dot%2!=1 else '\downarrow'
    ln = 'b-' if dot%2!=1 else 'r-'
    if i == 450:
        ln = 'k-'
            #plot DOS
    p0 = vec[w>0][0]
    print p0*pi*Gamma*2   
    #plot(w/(Gamma*0.8),vec*pi*Gamma/0.944036503513, 'o',label= '$'  +spin + '$') 
    if dot%2 == 0 :
        ax.plot(w/Gamma,Gamma*pi*vec, ln,label= '$ '  +spin + '$' ,  linewidth=NLN)
#         ax.plot(w,vec, ln,label= '$ '  +spin + '$' ,  linewidth=NLN)
    else:
        ax.plot(w/Gamma,Gamma*pi*vec, ln,label= '$ '  +spin + '$' )
#         ax.plot(w,vec, ln,label= '$ '  +spin + '$' )
        
#plotOneDot(22 , 0)
#plotOneDot(22 , 1)
#plotOneDot(22 , 2)
#plotOneDot(22, 3)
#plot(linspace(-10*Gamma,10*Gamma,500),Green, label = 'Green')
#readMath('DQD')
#readMath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0,t2=0.02')
#xlim(-20,20)
#legend(fontsize=17, loc='lower right')


# title = '/home/cifucito/nrgcode/TwoChNRG/Data/Green/Gamma1=2.,Gamma2=0.,tdots=0.,t1=5.,t2=0.,em=0.,e1=0.,e2=0..dat'
#readMath(title)



# Plot dot with spin-up and spin-down. 
# Options: Plot insets INSET(boolean)  IM= '' no image or file inset image
# Inputs  ax-axis, num (int)- file number, SUM(boolean) - Sum data with file i+10  ,
#        Reverse (boolean)- Invert data , dot - Dot number , IM- image file
def plotFullDot(ax, IM , num , dot , SUM , INSET, Reverse):
    plotOneDot(ax,  num , dot , SUM , Reverse)
    #Eliminated to make another plot
    plotOneDot(ax,  num , dot+1 , SUM , Reverse)
    
#   Print inset image
    if IM!='':
        w = "85%" ; h = "85%" ;pos = (0, 0.0, .3, 1.2)
        axmod = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=6, bbox_transform=ax.transAxes )
        image = imread(IM,  format='png') ; axmod.imshow(image)
        axmod.set_frame_on(False) ; axmod.get_xaxis().set_visible(False) ; axmod.get_yaxis().set_visible(False)
    
#   Print inset zoom 
    if INSET : 
        w = "30%" ; h = "30%"  ; pos = (-0.08, 0.16, 1.1, 1.2)
        axins = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=ax.transAxes )
        
        plotOneDot(axins,num , dot , SUM , Reverse)
        #Eliminated to make another plot
        plotOneDot(axins,num , dot+1 , SUM , Reverse)
    #         Normal settings
        axins.set_xlim(-1,1) ; axins.set_ylim(0,.3)
        axins.set_xticks(arange(-1,1.1, step=1))
        axins.set_yticks(arange(0,.3, step=.2))
        setp(axins.get_xticklabels(), fontsize=23)
        setp(axins.get_yticklabels(), fontsize=23)  
#         axins.set_xticks(arange(-0.7,0.9, step=.7))
#         axins.set_yticks(arange(0,1.2, step=.5))
#         axins.set_xlim(-1.1,1.1) ; axins.set_ylim(0,0.26)
#       t1>0
#         axins.set_ylim(0,0.03)
#         axins.set_xlim(-0.11,0.11)      
#         axins.set_xticks(arange(-.1,.11, step=.2))
#         axins.set_yticks(arange(0,0.032, step=.03))
#         axins.set_xticks([])
#         axins.set_yticks([])
#     ax.set_xlabel('$\omega/ \Gamma_1$')
#     ax.set_ylabel('$$\\rho \pi \Gamma_1 $')
        return axins

Subplot building


In [4]:
#SuperPlot of Mathematica files. 6 plots in one shot
def Plot4Tits(axarr , G2 ,tdots,t1 ,t2 , lb ):
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
    plotMath(axarr[0,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[0,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[0,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 5 ,0)
    plotMath(axarr[1,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[1,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[1,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[1,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,-5)
    plotMath(axarr[2,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[2,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[2,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[2,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')    
    return axarr
    
#SuperPlot of Mathematica files. 6 plots in one shot. More flexibility and inner for.     
def PlotNewARR(axarr , lb ):
    lt = [':','--','-']
    
    G2 = 0 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        Gvec = [0,1,2] ;  G2 = Gvec[n] 
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[0,0],tits[1],'' , lt[n], 'no')
        #plotMath(axarr[0,0],tits[0],'', '-' , 'no')
        plotMath(axarr[0,1],tits[3],'$\Gamma_2 = ' + repr(G2) + '\Gamma_1$', lt[n], 'no')
        #plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'no')
         
    
    G2 = 0 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        tdvec = [0,1,2] ;  tdots = tdvec[n] 
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[1,0],tits[1],'' , lt[n], 'no')
#         plotMath(axarr[0,0],tits[0],'', '-' , 'r')
        plotMath(axarr[1,1],tits[3],'$t_{dots} = ' + repr(tdots) + '\Gamma_1$' , lt[n], 'no')
#         plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
        
    
    G2 = 1 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        tdvec = [0,1,3] ;  tdots = tdvec[n]
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[2,0],tits[1],'' , lt[n], 'no')
#         plotMath(axarr[0,0],tits[0],'', '-' , 'r')
        plotMath(axarr[2,1],tits[3],'$t_{dots} = ' + repr(tdots) + '\Gamma_1$' , lt[n], 'no')
#         plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')


#After printing a 6- multiplot file,  DrawInsets prints three called images in the indicated column. Used to print Majorana Models 
def DrawInsets(axarr , column , im1 , im2 , im3):
    
#     w = "50%" 
#     h = "40%" 
#     pos = (0, 0, 1.2, 1.25)
    pos = (0, 0, 1.31, 1.25)
    pos2 = (0, 0, 1.25, 1.25)
    w = "60%" 
    h = "50%" 
    
    
    axins0 = inset_axes(axarr[0,column], width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[0,column].transAxes )
    axins0.set_frame_on(False)
    axins0.get_xaxis().set_visible(False)
    axins0.get_yaxis().set_visible(False)
    
    pos = pos2
    axins1 = inset_axes(axarr[1,column],  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[1,column].transAxes )
    axins1.set_frame_on(False)
    axins1.get_xaxis().set_visible(False)
    axins1.get_yaxis().set_visible(False)

    axins2 = inset_axes(axarr[2,column],  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[2,column].transAxes )
    axins2.set_frame_on(False)
    axins2.get_xaxis().set_visible(False)
    axins2.get_yaxis().set_visible(False)
    
    image = imread(im1,  format='png')
    axins0.imshow(image)

    image = imread(im2,  format='png')
    axins1.imshow(image)

    image = imread(im3 ,  format='png')
    axins2.imshow(image)
    
    
#     image = imread('D3.png')
#     axins0.imshow(image)

#     image = imread('D2.png')
#     axins1.imshow(image)

#     image = imread('D1.png')
#     axins2.imshow(image)
#axins.set_visible(False)
# , bbox_to_anchor=(0.4,0.1)
# axins = axarr[2,1].inset_axes([0.5, 0.5, 0.47, 0.47])    


# Defines the titles of the data to plot acording to the data parameters . Green Functions.nb
# Inputs: G2 -Gamma2 , tdots, t1, t2 , em, e1 , e2 ---- Only integer values are admited. Gamma1 is the unit
# Returs: title with the data for every dot
def DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2):
    title1 = 'd1/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title2 = 'd2/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title3 = 'd3/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title4 = 'd4/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    return title1 , title2, title3 , title4


# Uses the titles from DefineTitles to plot a 4-subplot with the data from Green Functions.nb.
def Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , lb):
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
    plotMath(axarr[0],tits[1],'' , '-', 'b')
    plotMath(axarr[0],tits[0],'', '--' , 'r')
    plotMath(axarr[1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[1],tits[2],' $\downarrow$ '+ lb , '--' , 'r')

In [38]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7.5, 6.5))
plotFullDot(ax,'', 335 , j*2 , True, False , False)


sum10
0.225448406562
sum10
0.415186458954

Implementations

Here we plot a 6 level NRG DOS


In [10]:
#SuperPlot of Mathematica files. 6 plots in one shot
numRows = 3
numCols = 2

# t1>0
# num = [350 , 356, 366]
# t2>0
num = [370 , 376, 384]
#t1=t2
# num = [330 , 335, 335]
rcParams['figure.subplot.wspace'] = 0.04
rcParams['figure.subplot.hspace'] = 0.1
rcParams['figure.subplot.bottom'] = 0.14
rcParams['figure.subplot.right'] = 0.98
rcParams['figure.subplot.left'] = 0.18
rcParams['figure.subplot.top'] = 0.92

#f, axarr = subplots(numRows, numCols, sharex='col', sharey='row', figsize=(7, 5))
f, axarr = subplots(numRows, numCols, sharex='col', sharey='row', figsize=(7.5, 6.5))
for i in range(numRows):
    for j in range(numCols):
        print i, j
        if (i == 0) & (j == 1) :
           print i , j
           plotFullDot(axarr[i,j],'', num[i] , j*2 , False, True , False) 
#            plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , False) 
        else:
            if i < 2 :
                plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , False)
            else:
                plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , True)
        axarr[2,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[i,0].set_ylabel('$$\\rho \pi \Gamma_1 $')
# t1 = t2

#         if i == 0 :
#             plotFullDot(axarr[i,j],'', num[i] , j*2 , True, False , False)
#         elif i == 1:
#             plotFullDot(axarr[i,j],'', num[i] , 2 - j*2 , True, False , False)
#         else:
#             plotFullDot(axarr[i,j],'', num[i] , j*2 , True, False , True)
        

        
#  t1=t2
#         axarr[i,j].set_xlim(-3,3)
        
#         axarr[i,j].set_ylim(0,0.45)
#         axarr[i,0].set_yticks(arange(0,0.45, step=0.2))
#         axarr[0,j].set_ylim(0,0.3)
#         axarr[0,0].set_yticks(arange(0,0.25, step=.2))

# t1>0
#         axarr[i,j].set_xlim(-3,3)
#         axarr[0,j].set_ylim(0,0.3)
#         axarr[1,j].set_ylim(0,0.6)
#         axarr[2,j].set_ylim(0,0.6)
        
        
#         axarr[0,0].set_yticks(arange(0,0.3, step=.2))
#         axarr[1,0].set_yticks(arange(0,0.6, step=.5))
#         axarr[2,0].set_yticks(arange(0,0.6, step=0.5))

# t2>0
        axarr[i,j].set_xlim(-3,3)
        axarr[0,j].set_ylim(0,0.6)
        axarr[1,j].set_ylim(0,0.6)
        axarr[2,j].set_ylim(0,0.6)
        
        
        axarr[0,0].set_yticks(arange(0,0.6, step=.5))
        axarr[1,0].set_yticks(arange(0,0.6, step=.5))
        axarr[2,0].set_yticks(arange(0,0.6, step=0.5))



        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')
        
for num,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
    print num/2 , num%2 , b
    axarr[num/2,num%2].text(0.05, 0.9, b, transform=axarr[num/2,num%2].transAxes, fontweight='bold', va='top')
    
rcParams.update({'figure.figsize': (500,500)}) 

# t1=t2
# DrawInsets(axarr, 0 ,  'D3.png' , 'D2V1.png' , 'D1V2.png')

# t2>0
DrawInsets(axarr, 0 ,  'D3.png' , 'D1V1.png' , 'D3V2.png')

# t1>0
# DrawInsets(axarr, 0 ,  'D2.png' , 'D1V1.png' , 'D1V2.png')
#for i in range(3):
axarr[1,1].legend(fontsize=17, loc='upper right')


0 0
1.24561843791e-17
0.949981002447
0 1
0 1
0.0503628534481
0.0251814267022
0.0503628534481
0.0251814267022
1 0
0.00981748763142
0.949827661049
1 1
0.138108993997
0.232626246494
2 0
0.0128630257531
0.950195876421
2 1
0.0678200910683
0.542122702927
0 0 (a)
0 1 (b)
1 0 (c)
1 1 (d)
2 0 (e)
2 1 (f)
Out[10]:
<matplotlib.legend.Legend at 0x7fc7d648c510>

Test


In [7]:
# Plot nice Kondo
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
cols = ['g' , 'k' , 'r']
lines = ['-' , '--' , ':']
for i in range(135,138):
    rho , w = readfile(i,0)
    vec = rho[::-1]
    rho = .5*(vec+rho)
    Gam = readfile_Param(ini=i, line=3)
    U = readfile_Param(ini=i, line=2)
    rho = rho 
    w = w/Gam
    ax.plot(w, rho , label = '$U = '+ repr(U)+'$', color = cols[i-135] , linestyle = lines[i-135])
    axvline(x= 4*Gam/U , color = cols[i-135], linestyle = lines[i-135])
ax.legend()
# plotOneDot(ax,135 , 0, True ,True)
# plotOneDot(ax,136 , 0, True ,True)
# plotOneDot(ax,137 , 0, True ,True)
# ax.set_xlabel('$\omega$',fontsize=50)
# ax.set_ylabel('$\\rho$',fontsize=50)
# ax.set_xticks([])
# ax.set_yticks([])


Out[7]:
<matplotlib.legend.Legend at 0x7f15a82ca590>

In [ ]:


In [8]:
f, ax= subplots(1, 1, sharex='col',figsize=(7.5, 6.5))
plotOneDot(ax, 101 , 0 , False)
plotOneDot(ax, 101 , 1 , False)
w = "35%" 
h = "35%" 
pos = (0, 0, 1.03, 1.3)
axins = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=ax.transAxes )
plotOneDot(axins,101 , 0, False)
plotOneDot(axins,101 , 1, False)
#     axins.set_frame_on(False)
#     axins.get_xaxis().set_visible(False)
#     axins.get_yaxis().set_visible(False)
ax.set_ylim(0,1.05)
ax.set_xlim(-12,12)


axins.set_xlim(-0.8,0.8)
ax.set_yticks(arange(0,1.2, step=.5))
axins.set_xticks(arange(-0.7,0.9, step=.7))
axins.set_yticks(arange(0,1.2, step=.5))

pos = (0, 0, 1.03, 1.3)
axmod = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=6, bbox_transform=ax.transAxes )
image = imread('QD1.png',  format='png') ; axmod.imshow(image)
axmod.set_frame_on(False) ; axmod.get_xaxis().set_visible(False) ; axmod.get_yaxis().set_visible(False)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-32d8233b4168> in <module>()
      1 f, ax= subplots(1, 1, sharex='col',figsize=(7.5, 6.5))
----> 2 plotOneDot(ax, 101 , 0 , False)
      3 plotOneDot(ax, 101 , 1 , False)
      4 w = "35%"
      5 h = "35%"

TypeError: plotOneDot() takes exactly 5 arguments (4 given)

In [18]:
# Plot nice Kondo
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
plotOneDot(ax,100 , 1, False,False)
ax.set_xlabel('$\omega$',fontsize=50)
ax.set_ylabel('$\\rho$',fontsize=50)
ax.set_xticks([])
ax.set_yticks([])


1.72525130383
Out[18]:
[]

Plot double dot


In [40]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))


plotFullDot(ax, 'DQD.png', 450 , 0 , False , True , False)
#plotFullDot(ax, 'QD1.png', 365 , 1 , False , True , False)



rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95


# plotFullDot(ax, 'MQD.png', 115 , 0 , False , True , False)
# ax.set_ylim(0,1);    ax.set_xlim(-12,12)
# ax.set_yticks(arange(0,1.2, step=.5))
# ax.set_ylim(0,.26);    ax.set_xlim(-12,12)
# ax.set_yticks(arange(0,.3, step=.2))
# ax.set_xlim(-0.5,0.5)
#ax.set_yticks(arange(0,31, step=.1))
ax.set_ylim(0,1);    ax.set_xlim(-12,12)
# ax.set_yticks(arange(0,.3, step=.2))
rcParams.update({'figure.figsize': (200,200)})
ax.set_xlabel('$\omega/ \Gamma_1$')
ax.set_ylabel('$\\rho_1 \pi \Gamma_1 = \\rho_2 \pi \Gamma_1 $')
ax.set_ylabel('$\\rho \pi \Gamma_1$')

# ax.axvline(x=8.8435)
# ax.axvline(x=-8.8435)
#ax.legend(fontsize=23 , loc='upper left')
#plotFullDot(ax, 'QD1.png', 101 , 0 , False)


0.460825214797
0.465886200115
0.460825214797
0.465886200115
Out[40]:
Text(0,0.5,u'$\\rho \\pi \\Gamma_1$')

Plot paper double dot


In [9]:
# Plot extrange case
# Here
f, ax = subplots(2, 1, sharex='col', figsize=(4, 6))
rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95
axins1 = plotFullDot(ax[0], 'DQD.png', 450 , 0 , True , True , False)
axins2 = plotFullDot(ax[1], 'DQDM.png', 330 , 2 , True , True , False)


ax[0].set_ylim(0,.3);    ax[0].set_xlim(-10,10) ; ax[1].set_xlim(-10,10) ; ax[1].set_ylim(0,.3)
ax[1].set_xlabel('$\omega/ \Gamma_1$') #; ax[1].set_xlabel('$\omega/ \Gamma_1$')
ax[0].set_yticks(arange(0,.3, step=.1))
ax[1].set_yticks(arange(0,.3, step=.1))
ax[0].set_xticks(arange(-8,8.1, step=4))
ax[1].set_xticks(arange(-8,8.1, step=4))
lab = '$\\rho_{1(2)}\  (\pi \Gamma_1) $'
ax[0].set_ylabel(lab) ; ax[1].set_ylabel(lab)
# ax[0].set_title('$t_1 = t_2 = 0$')
# ax[1].set_title('$t_1 = t_2 = 2\Gamma_1$')


line = 3.46*Gamma/.5
c = 'g'
ax[0].axvline(x=-line , linestyle = '--' , label = '$\omega = \pm  4*\Gamma^2/U$', color = c )
ax[0].axvline(x=line  , linestyle = '--', color = c)
axins1.axvline(x=-line, linestyle = '--', color = c)
axins1.axvline(x=line , linestyle = '--', color = c)

line = 8*Gamma/.5
ax[1].axvline(x=-line , linestyle = '-.',label = '$\omega = \pm  8*\Gamma^2/U$', color = c )
ax[1].axvline(x=line , linestyle = '-.', color = c)
axins2.axvline(x=-line, linestyle = '-.', color = c)
axins2.axvline(x=line , linestyle = '-.', color = c)

#ax[1].legend(fontsize=20, loc='upper left')
#ax[0].legend(fontsize=20, loc='upper left')


sum100
0.463355707631
sum100
0.463355704119
sum100
0.463355707631
sum100
0.463355704119
sum10
0.465489732259
sum10
0.232820028703
sum10
0.465489732259
sum10
0.232820028703
Out[9]:
<matplotlib.lines.Line2D at 0x7f112e4039d0>

Plot strange case. Thesis last part


In [16]:
# Plot extrange case
# Here
f, ax = subplots(1, 2, sharex='col', sharey='row', figsize=(8, 3))
rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95
plotFullDot(ax[0], 'IND.png', 410 , 0 , True , False , False)
plotFullDot(ax[1], '', 410 , 2 , True , True , False)
ax[0].set_ylim(0,.8);    ax[0].set_xlim(-1,1) ; ax[1].set_xlim(-1,1)
ax[0].set_xlabel('$\omega/ \Gamma_1$') ; ax[1].set_xlabel('$\omega/ \Gamma_1$')
ax[0].set_ylabel('$\\rho \pi \Gamma_1 $')
ax[0].set_title('Dot 1')
ax[1].set_title('Dot 2')
ax[1].legend(fontsize=20, loc='upper left')


1.2167372022
0.121986193837
0.121986193837
Out[16]:
<matplotlib.legend.Legend at 0x7fb2b4f7ad90>

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [6]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95
plotFullDot(ax, 'DQDM.png', 451 , 0 , True , True , False)
ax.set_ylim(0,.25);    ax.set_xlim(-.5,.5)
ax.set_xlabel('$\omega/ \Gamma_1$')
ax.set_ylabel('$\\rho_1 \pi \Gamma_1 = \\rho_2 \pi \Gamma_1 $')


0.462447189577
0.231188996053
0.462447189577
0.231188996053
Out[6]:
Text(0,0.5,u'$\\rho_1 \\pi \\Gamma_1 = \\rho_2 \\pi \\Gamma_1 $')

In [ ]:


In [10]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
plotFullDot(ax, 'DQDM.png',131 , 0 , False , True , False)


1.84931541467
0.0214412687064
1.84931541467
0.0214412687064
Out[10]:
<mpl_toolkits.axes_grid1.parasite_axes.AxesHostAxes at 0x7fb33321f050>

In [8]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
plotFullDot(ax, 'DQDM.png',130 , 0 , False , True , False)


2.31163480206
0.027059502604

In [ ]:


In [ ]:


In [8]:
f, axarr = subplots(1, 2, sharex='col', sharey='row', figsize=(9, 4))

G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
for G2 in array([0,0.5,1,4]):
    Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$\Gamma_2 ='+repr(G2)+'\Gamma_1$')
    
#for tdots in array([1,2,4]):
#    Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t_{dots}='+repr(tdots)+'\Gamma_1$')      
#



#plotMath(axarr[0],tits[1],'Spin-$\uparrow$', '-')
#plotMath(axarr[1],tits[3],'Spin-$\uparrow$', '-')
#for t1 in array([1,2,3.5]):
#    Plot2Tits(axarr , 0 ,1,t1 ,t2 ,em, e1 ,e2 , '$t_{1}='+repr(t1)+'\Gamma_1$')      
#

#for t2 in array([1,2,3.5]):
#    Plot2Tits(axarr , 0 ,1,t1 ,t2 ,em, e1 ,e2 , '$t_{2}='+repr(t2)+'\Gamma_1$')      
#

G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
#for G2 in array([0,0.5,1,4]):
#Plot2Tits(axarr , G2 ,1, 0,2 ,em, 0 , 0 , '')
#Plot2Tits(axarr , G2 ,1, 2,0 ,em, 0 , 5 , '')
Plot2Tits(axarr , 1 ,0, 1,1 ,em, 0 , 6 , '')


axarr[0].set_ylim(0,12)
axarr[0].set_xlim(-LIMSX,LIMSX)
axarr[1].set_xlim(-LIMSX,LIMSX)
axarr[0].set_title('Dot 1')
axarr[1].set_title('Dot 2')
axarr[0].set_xlabel('$\omega/ \Gamma_1$')
axarr[1].set_xlabel('$\omega/ \Gamma_1$')
axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
axarr[0].set_xticks((-8,-4,0,4,8))
axarr[1].set_xticks((-8,-4,0,4,8))
axarr[0].set_yticks((0,5,10))


---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-8-89da89f25924> in <module>()
     21 G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
     22 for G2 in array([0,0.5,1,4]):
---> 23     Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$\Gamma_2 ='+repr(G2)+'\Gamma_1$')
     24 
     25 #for tdots in array([1,2,4]):

<ipython-input-8-89da89f25924> in Plot2Tits(axarr, G2, tdots, t1, t2, em, e1, e2, lb)
      9 def Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , lb):
     10     tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
---> 11     plotMath(axarr[0],tits[1],'' , '-', 'b')
     12 
     13     plotMath(axarr[0],tits[0],'', '--' , 'r')

<ipython-input-5-d976d3bd90ce> in plotMath(ax, title, lb, style, col)
     17 
     18 def plotMath( ax , title , lb , style,col):
---> 19     w , Green = readMath( title)
     20     Green = Green#/(pi*Gamma)
     21     NLN = 4

<ipython-input-5-d976d3bd90ce> in readMath(title)
      3     #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0,t2=0.02'), 'r')
      4     #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0.02,t2=0.'), 'r')
----> 5     infile = open(os.path.abspath( title ), 'r')
      6     text = infile.readlines()
      7     Green = []

IOError: [Errno 2] No such file or directory: '/home/cifu/nrgcode/Data/d2/Gamma1=2.,Gamma2=8.,tdots=0.,t1=0.,t2=0.,em=0.,e1=0.,e2=0..dat'

In [8]:
axarr[1].legend(fontsize=20, loc='upper left' )
#axarr[0].set_yticks((0,5,10,15))
axarr[0].set_xticks((-8,-4,0,4,8))
axarr[1].set_xticks((-8,-4,0,4,8))
#axarr[0].set_yticks((0,3,6,9,12))


Out[8]:
[<matplotlib.axis.XTick at 0x7fd203c4cfd0>,
 <matplotlib.axis.XTick at 0x7fd203c62150>,
 <matplotlib.axis.XTick at 0x7fd208247210>,
 <matplotlib.axis.XTick at 0x7fd208242310>,
 <matplotlib.axis.XTick at 0x7fd208242a10>]

In [270]:


In [50]:

NON-Interacting

Here we plot a 6 subplot files with the Green functions coming from GreenFunctions.nb


In [21]:
# f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(6, 5.6))
f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(6.8, 6.8))
# f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(12, 11))
print axarr[0,0]

rcParams['figure.subplot.wspace'] = 0.04
rcParams['figure.subplot.hspace'] = 0.1
rcParams['figure.subplot.bottom'] = 0.13
rcParams['figure.subplot.right'] = 0.98
rcParams['figure.subplot.left'] = 0.16
rcParams['figure.subplot.top'] = 0.92


for num,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
    print num/2 , num%2 , b
    axarr[num/2,num%2].text(0.05, 0.9, b, transform=axarr[num/2,num%2].transAxes, fontweight='bold', va='top')
    
for i in range(3):
    for j in range(2):
#         axarr[0,j].set_ylim(0,12)
# #         axarr[0,j].set_ylim(0,3.1)
#         #axarr[1,j].set_ylim(0,21)
#         axarr[1,j].set_ylim(0,15)
#         axarr[2,j].set_ylim(0,7)

#    cong for t1 = t2
#         axarr[0,j].set_ylim(0,0.4)
#         axarr[1,j].set_ylim(0,1.1)
#         axarr[2,j].set_ylim(0,1.1)
#         axarr[0,0].set_yticks(arange(0,.4, step=.2))
#         axarr[1,0].set_yticks(arange(0,1.1, step=.5))
#         axarr[2,0].set_yticks(arange(0,1.1, step=0.5))
        
    
#     cong for t1 > 0 connected t2 = G2 =0
#         axarr[0,j].set_ylim(0,1.6)
#         axarr[1,j].set_ylim(0,1.7)
#         axarr[2,j].set_ylim(0,1.7)
#         axarr[0,0].set_yticks(arange(0,1.6, step=.5))
#         axarr[1,0].set_yticks(arange(0,1.7, step=.5))
#         axarr[2,0].set_yticks(arange(0,1.7, step=0.5)).

#     cong for t2>0 connected t1 = G2 =0
        axarr[0,j].set_ylim(0,1.6)
        axarr[1,j].set_ylim(0,1.7)
        axarr[2,j].set_ylim(0,1.7)
        axarr[0,0].set_yticks(arange(0,1.6, step=.5))
        axarr[1,0].set_yticks(arange(0,1.7, step=.5))
        axarr[2,0].set_yticks(arange(0,1.7, step=0.5))
        
        
        #axarr[i,j].text(0.1, 0.9, 'A', transform=axarr[i,j].transAxes, fontweight='bold', va='top')
        #axarr[1,0].text(-0.3, 0.5, 'B', transform=axarr[1,1].transAxes, fontweight='bold', va='top')
        
        
#         axarr[0,0].set_yticks(arange(0,3.1, step=1))
#         axarr[0,0].set_yticks(arange(0,13, step=5))
#         #axarr[0,0].set_yticks((0,5,10))
#         axarr[1,0].set_yticks(arange(0,13, step=5))
#         axarr[2,0].set_yticks(arange(0,7, step=2))
        
       
        
        axarr[0,0].set_ylabel('$\\rho \pi \Gamma_1 $'  , fontsize=24)
        axarr[1,0].set_ylabel('$\\rho \pi \Gamma_1$' , fontsize=24)
        axarr[2,0].set_ylabel('$\\rho \pi \Gamma_1$', fontsize=24)
#         axarr[0,0].set_ylabel('$\\rho(\omega) $'  , fontsize=24)
#         axarr[1,0].set_ylabel('$\\rho(\omega)$' , fontsize=24)
#         axarr[2,0].set_ylabel('$\\rho(\omega)$', fontsize=24)
        
        #axarr[0,0].set_ylabel('$ \\mathbf{ \epsilon_{1,2} = 0 }$ \n  $\\rho(\omega) $'  , fontsize=26)
        #axarr[1,0].set_ylabel('$ \\mathbf{ \epsilon_1 = 5\Gamma_1}$ \n $\\rho(\omega)$' , fontsize=24)
        #axarr[2,0].set_ylabel('$ \\mathbf{\epsilon_2 = -5\Gamma_1}$ \n $\\rho(\omega)$', fontsize=24)
        
        axarr[2,j].set_xticks((-8,-4,0,4,8))
        
        axarr[2,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')

        
#Plot4Tits(axarr , 0 ,1.5, 3,0, '')
# DrawInsets(axarr, 1 ,  'D3.png' , 'D2.png' , 'D1.png')
# Plot4Tits(axarr , 1 ,0, 2,2, '')
# Plot4Tits(axarr , G2 ,tdots,t1 ,t2 , lb ):

# t1=t2
# Plot4Tits(axarr , 1 ,0, 2,2, '')
# DrawInsets(axarr, 1 , 'D3.png' , 'D2V1.png' , 'D1V2.png')

# t1>0
# Plot4Tits(axarr , 0 ,1, 2,0, '')
# DrawInsets(axarr, 1 ,  'D2.png' , 'D2V1.png' , 'D1V2.png')

# t2 >  0
Plot4Tits(axarr , 0 ,1, 0,2, '')
DrawInsets(axarr, 1 , 'D3.png' , 'D1V1.png' , 'D3V2.png')

# INSET
w = "30%" ; h = "30%"  ; pos = (0.03, -0.17, 1.1, 1.2)
axins = inset_axes(axarr[1,0],  width=w, height=h, bbox_to_anchor=pos,loc=6, bbox_transform=axarr[1,0].transAxes )
tits = DefineTitles(0 ,1,0 ,2 ,0, 5 ,0)
# print tits
plotMath( axins , tits[0] , '' , '-','r')
plotMath( axins , tits[1] , '' , '-','b')
axins.set_xlim(-1,1)
axins.set_ylim(0,1.2)
axins.set_xticks((-1,0,1))
axins.set_yticks((0,1))
setp(axins.get_xticklabels(), fontsize=23)
setp(axins.get_yticklabels(), fontsize=23)

rcParams.update({'figure.figsize': (200,200)})
#DrawInsets(axarr, 0 ,  'DQD1.png' , 'DQD2.png' , 'DQD3.png')
#PlotNewARR(axarr , '' )
#for i in range(3):
axarr[0,0].legend(fontsize=17, loc='upper right')


AxesSubplot(0.16,0.673125;0.401961x0.246875)
0 0 (a)
0 1 (b)
1 0 (c)
1 1 (d)
2 0 (e)
2 1 (f)
Out[21]:
<matplotlib.legend.Legend at 0x7f15a558d3d0>

In [42]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(6.8, 6.8))
tits = DefineTitles(0 ,1,0 ,2 ,0, 5 ,0)
plotMath( ax , tits[2] , '' , '-','r')
plotMath( ax , tits[3] , '' , '-','b')

In [259]:
# for i,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
#     print i , b
    
# fig = figure()
# for i, label in enumerate(('A', 'B', 'C', 'D')):
#     ax = fig.add_subplot(2,2,i+1)
#     ax.text(0.05, 0.95, label, transform=ax.transAxes,
#      fontsize=16, fontweight='bold', va='top')

#plt.show() 

image = imread('D1.png')
imshow(image)


Out[259]:
<matplotlib.image.AxesImage at 0x7efdd2816090>

In [12]:
f, axarr = subplots(2, 2,  sharex='col',sharey='row', figsize=(6, 6.6))
print axarr[0,0]

rcParams['figure.subplot.wspace'] = 0.06
rcParams['figure.subplot.hspace'] = 0.19
rcParams['figure.subplot.bottom'] = 0.16
rcParams['figure.subplot.right'] = 0.99
rcParams['figure.subplot.left'] = 0.2

def PlotMode(axarr , NumCase , G2 ,tdots,t1 ,t2 , lb ,SUM):
    i = NumCase
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
    plotMath(axarr[0,0],tits[1],'' , '-', 'b')
    plotMath(axarr[0,0],tits[0],'', '--' , 'r')
    plotMath(axarr[0,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '--' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,5)
    plotOneDot(axarr[1,0],i , 0 ,SUM)
    plotOneDot(axarr[1,0],i , 1 ,SUM)
    plotOneDot(axarr[1,1],i , 2 ,SUM)
    plotOneDot(axarr[1,1],i , 3 ,SUM)

    
#y1 = 3.2  ;  ystep1=1
#y2 = 3.2  ;  ystep2=1
y1 = 16.2  ;  ystep1=4
y2 = 6.2  ;  ystep2=2
for i in range(2):
    for j in range(2):
        axarr[i,j].set_xlim(-10,10)
        axarr[0,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[1,j].set_xlabel('$(\omega / \Gamma_1)(U/ \Gamma_1)$')
        
        axarr[0,j].set_ylim(0,y1)
        axarr[0,j].set_yticks(arange(0,y1, step=ystep1))
        axarr[1,j].set_ylim(0,y2)
        axarr[1,j].set_yticks(arange(0,y2, step=ystep2))
        #axarr[1,j].set_ylim(0,3)
       # axarr[1,0].set_yticks((0,1,2,3))
        #axarr[1,j].set_xticks((-8,-4,0,4,8))
        axarr[1,j].set_xticks((-8,0,8))
        axarr[0,0].set_ylabel('$\\textbf{U = 0}$ \n  $ \\rho(\omega)$' )
        axarr[1,0].set_ylabel('$\\textbf{U=17} \\mathbf{\Gamma_1} $ \n  $  \\rho(\omega) $')
        
        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')

#PlotMode(axarr , 818 ,1 ,0, 2,2, '', True)    
#PlotMode(axarr , 304 ,0 ,1, 2,0, '',False) 
PlotMode(axarr , 309 ,0 ,1, 0,2, '',False)


AxesSubplot(0.16,0.54381;0.390476x0.37619)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-d894488a8192> in <module>()
     48 #PlotMode(axarr , 818 ,1 ,0, 2,2, '', True)
     49 #PlotMode(axarr , 304 ,0 ,1, 2,0, '',False)
---> 50 PlotMode(axarr , 309 ,0 ,1, 0,2, '',False)

<ipython-input-12-d894488a8192> in PlotMode(axarr, NumCase, G2, tdots, t1, t2, lb, SUM)
     16     plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '--' , 'r')
     17     tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,5)
---> 18     plotOneDot(axarr[1,0],i , 0 ,SUM)
     19     plotOneDot(axarr[1,0],i , 1 ,SUM)
     20     plotOneDot(axarr[1,1],i , 2 ,SUM)

TypeError: plotOneDot() takes exactly 5 arguments (4 given)

In [ ]:


In [ ]:


In [192]:


In [ ]:


In [9]:
i = 458
#i = 817

i = 465
#i = 304
#i = 318
f, axarr = subplots(1, 2, sharex='col', sharey='row', figsize=(10, 5))

plotOneDot(axarr[0],i , 0)
plotOneDot(axarr[0],i , 1)
plotOneDot(axarr[1],i , 2)
plotOneDot(axarr[1],i , 3)

axarr[0].set_ylim(0,6)
axarr[0].set_xlim(-10,10)
axarr[1].set_xlim(-10,10)
axarr[0].set_title('Dot 1')
axarr[1].set_title('Dot 2')
axarr[0].set_xlabel('$(\omega / \Gamma_1) \\times (U/ \Gamma_1)$')
axarr[1].set_xlabel('$(\omega / \Gamma_1) \\times (U/ \Gamma_1)$')
axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
#axarr[1].legend(fontsize=20, loc='upper right')
#axarr[0].set_xlim(-10,10)
#axarr[1].set_xlim(-10,10)
#axarr[0].set_xticks((-1.5,0,1.5))
#axarr[1].set_xticks((-1.5,0,1.5))

#axarr[0].set_ylim(0,11)
#axarr[0].set_yticks((0,1,2,3))

#axarr[0].set_title('Dot 1')
#axarr[1].set_title('Dot 2')

#axarr[0].set_xlabel('$\omega/\Gamma$')
#axarr[1].set_xlabel('$\omega/\Gamma$')
#axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
print readfile_Param(i, 12) , readfile_Param(i, 13)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-be296b679497> in <module>()
      7 f, axarr = subplots(1, 2, sharex='col', sharey='row', figsize=(10, 5))
      8 
----> 9 plotOneDot(axarr[0],i , 0)
     10 plotOneDot(axarr[0],i , 1)
     11 plotOneDot(axarr[1],i , 2)

TypeError: plotOneDot() takes exactly 5 arguments (3 given)

In [24]:
axarr[1].legend(fontsize=20, loc='upper left' )
#axarr[0].set_yticks((0,5,10,15))
axarr[0].set_yticks((0,1,2,3,4))
#axarr[0].set_yticks((0,3,6,9,12))


Out[24]:
[<matplotlib.axis.YTick at 0x7f9031f6f610>,
 <matplotlib.axis.YTick at 0x7f9031f6fe10>,
 <matplotlib.axis.YTick at 0x7f9032be4c90>,
 <matplotlib.axis.YTick at 0x7f9032c51c50>,
 <matplotlib.axis.YTick at 0x7f9032e57290>]

In [63]:
#mpl.rcParams['lines.linewidth'] = 3
f, axarr = subplots(1, 1, sharex='col', sharey='row', figsize=(10, 5))
G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0 
#for t1 in array([0.5,1,2]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ t='+repr(t1)+'\Gamma_1$', '--')

#for e1 in array([1,2,5]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ \epsilon_1='+repr(e1)+'\Gamma_1$', '--')
    #plotMath(axarr,tits[1],'Spin-$\uparrow$' , '-')

#   
#for em in array([0.5,1,3]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ \epsilon_m='+repr(em)+'\Gamma_1$', '--')
    #plotMath(axarr,tits[1],'Spin-$\uparrow$' , '-')

    
axarr.set_ylim(0,1)
axarr.set_title('')
axarr.set_xlabel('$\omega/ \Gamma_1$')
axarr.set_ylabel('DOS')
axarr.legend(fontsize=18 , loc='upper right' )


/usr/lib/python2.7/dist-packages/matplotlib/axes/_axes.py:519: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labelled objects found. "

In [65]:
axarr[1].legend(fontsize=15, loc='upper left' )


Out[65]:
<matplotlib.legend.Legend at 0x7fe21e02d2d0>

In [52]:
'Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat'
readMath('Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat')

In [53]:
'Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat'
readMath('Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat')

In [29]:
print 'Green/Gamma1=2.,Gamma2='+repr(int(G2*2))


  File "<ipython-input-29-62e236601272>", line 1
    print 'Green/Gamma1=2.,Gamma2='+repr(int(G2*2)
                                                  ^
SyntaxError: unexpected EOF while parsing

In [37]:
out = 'run2000/rho_0_0_OmegaRhow_zEQAVG.00.dat'
dat = loadtxt(out, delimiter = ' ') 
w = dat[:,0] ; rho = dat[:,1]
plot(w,rho)
xlim(-.5,.5)


Out[37]:
(-0.5, 0.5)

In [38]:
out = 'run450/rho_0_0_OmegaRhow_zEQAVG.00.dat'
dat = loadtxt(out, delimiter = ' ') 
w = dat[:,0] ; rho = dat[:,1]
out = 'run550/rho_0_0_OmegaRhow_zEQAVG.00.dat'
dat = loadtxt(out, delimiter = ' ') 
w = 0.5*(w +dat[:,0]) ; rho = 0.5*(rho + dat[:,1])
plot(w,rho)
xlim(-.5,.5)


---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-38-1aeef3c08fff> in <module>()
      1 out = 'run450/rho_0_0_OmegaRhow_zEQAVG.00.dat'
----> 2 dat = loadtxt(out, delimiter = ' ')
      3 w = dat[:,0] ; rho = dat[:,1]
      4 out = 'run550/rho_0_0_OmegaRhow_zEQAVG.00.dat'
      5 dat = loadtxt(out, delimiter = ' ')

/usr/lib/python2.7/dist-packages/numpy/lib/npyio.pyc in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)
    894                 fh = iter(bz2.BZ2File(fname))
    895             elif sys.version_info[0] == 2:
--> 896                 fh = iter(open(fname, 'U'))
    897             else:
    898                 fh = iter(open(fname))

IOError: [Errno 2] No such file or directory: 'run450/rho_0_0_OmegaRhow_zEQAVG.00.dat'

In [28]:
axvline(x=8.8435)


list = [1,3,9,5,2,5,6,9,7]

# print diff(sign(diff(dat[:,1]))) 
twos = diff(sign(diff(dat[:,1]))) 
w = w[1:-1] ;  rho = rho[1:-1]
wup = w[twos==-2] ; rhoup = rho[twos==-2] 
# plot(dat[:,1],'.')

axvline(x=wup[-3],color ='r')
axvline(x=wup[2],color ='r')

print wup[2], wup[-3], rhoup[2]
rho[rho <= (rhoup[2]/2)]
# max(rho[])

trick = (rho >= (0.8)) & (w  <= (-0.01))
a =  [min(w[trick]) , max(w[trick]) ]
axvline(x=a[0],color ='b')
axvline(x=a[1],color ='b')
print (a[1]-a[0])


-0.169157409848 0.169157409848 1.23959586262
0.154973057649

In [27]:
print(sqrt(2)) , 0.25/wup[2]


1.41421356237 -1.4779133839

In [63]:
print wup[2], wup[-3], rhoup[2]
rho[rho <= (rhoup[2]/2)]
# max(rho[])

trick = (rho >= (rhoup[2]/2)) & (w  <= (-0.01))
base = argmax(w[trick])
print rho[base] , w[base]
axvline(x=w[base],color ='y')


-0.169157409848 0.169157409848 1.23959586262
0.0803811670413 -0.556689510137

In [20]:
print dat[:,1]


[ -6.92448940e-19   1.64662219e-19  -1.96134517e-19   2.17203814e-20
  -5.26233689e-19   8.77416293e-19  -1.83368997e-18  -5.97642387e-18
  -4.12190547e-18   2.83631351e-18   1.08183525e-18   4.79111317e-18
   1.35210450e-17  -6.43992188e-18  -5.58933905e-18  -6.72211837e-17
  -1.88320551e-17  -5.43935332e-17  -4.69304316e-17  -9.88057926e-17
  -6.90548343e-17   7.25529377e-17  -2.90963777e-18   4.82767835e-17
  -1.30584569e-18  -1.48314089e-16  -1.23802515e-17   1.29948907e-16
   1.07956715e-16  -4.26144424e-16  -5.94080464e-16  -5.26658172e-16
  -3.34998685e-16  -2.04774796e-16  -2.53426312e-16  -2.85804669e-16
   3.86486953e-17   5.43426840e-16   5.79156238e-16  -7.06674212e-16
  -3.73800990e-16  -1.91747833e-18  -7.12927540e-16  -1.14965826e-15
  -8.34538602e-16  -7.79846939e-16  -4.50066444e-16   5.11751979e-16
  -1.46304396e-15  -1.08464270e-15  -2.79894950e-17   1.12053457e-15
  -7.63575021e-16  -4.05897506e-15  -9.51502826e-16  -1.44295645e-16
   1.26098264e-16  -5.99727424e-15  -1.13548087e-14  -1.88717298e-15
   6.16250391e-15   3.70240742e-15  -2.15959277e-14  -2.89370544e-14
  -3.30977884e-15  -1.45383242e-15  -1.77388049e-14  -4.29614006e-14
  -6.31387438e-14  -3.57513761e-14   2.87791593e-15  -1.54527800e-15
  -1.35424651e-13  -1.53548040e-13  -9.06733515e-14  -3.81561887e-14
  -1.06413610e-13  -1.78349888e-13  -2.47502185e-13  -1.65426500e-13
   9.70106345e-15   1.32105146e-14  -4.40116177e-13  -5.26038272e-13
  -3.89258630e-13  -1.73373136e-13  -3.40231948e-13  -6.20188737e-13
  -8.92800863e-13  -6.72442967e-13   6.46481733e-14   9.67804640e-15
  -1.32388059e-12  -1.59277201e-12  -1.12723505e-12  -5.36130335e-13
  -7.21607580e-13  -1.65141538e-12  -2.76897782e-12  -2.18878070e-12
  -4.70107390e-13  -4.76093945e-13  -3.54928308e-12  -4.08683509e-12
  -3.75361625e-12  -2.16654900e-12  -2.53201772e-12  -3.38235712e-12
  -4.81838189e-12  -4.46855804e-12  -1.77834158e-12  -5.65775159e-13
  -2.89125801e-12  -5.12224400e-12  -6.49005736e-12  -5.00611500e-12
  -2.07587594e-12  -9.35911383e-13  -5.89316721e-12  -7.91847297e-12
  -7.24050651e-12  -1.49479496e-12   3.23584993e-12  -2.50295803e-12
  -9.48157534e-12  -9.69438241e-12  -4.85717726e-13   4.70899082e-12
  -1.28242255e-12  -7.14978945e-12  -1.16300853e-11  -1.43876557e-12
   2.01028417e-11   7.33604485e-12  -7.89174901e-12  -1.16826044e-11
   1.66358166e-11   1.66959419e-11  -9.44311750e-12  -1.56346611e-11
  -3.42964655e-12   9.26982084e-12   2.72771960e-11   1.40070599e-11
   2.33454221e-12  -1.06231817e-11   1.99344379e-11   2.34570312e-11
  -6.62166648e-11  -5.87042669e-11   7.63104450e-11   6.63427029e-11
   3.20492070e-11   2.62778099e-11   1.81984357e-11  -6.85726961e-12
   1.82936283e-10   1.18943279e-10  -4.21293374e-10  -3.18826431e-10
   4.16863189e-10   3.49073571e-10   3.22280052e-10   2.30692062e-10
  -1.82867020e-10  -1.82630423e-10   5.95299498e-10   4.34223412e-10
  -2.51835946e-09  -2.00993103e-09   2.04537087e-09   1.73801480e-09
   2.00905697e-09   1.66080095e-09  -1.11118140e-11  -5.06726993e-10
   3.84801031e-09   3.05507078e-09  -1.42437876e-08  -1.15722466e-08
   1.33529073e-08   1.10511849e-08   1.06293139e-08   9.70415213e-09
  -5.12713531e-10  -4.19330921e-09   2.11305325e-08   1.69749796e-08
  -9.12797860e-08  -7.30340476e-08   8.01247602e-08   6.63359577e-08
   5.81574642e-08   5.61188563e-08   3.32360583e-09  -2.27607288e-08
   1.30064167e-07   1.02480583e-07  -5.67924584e-07  -4.52056368e-07
   5.05314652e-07   4.16115375e-07   3.87082954e-07   3.68594973e-07
   2.92860295e-08  -1.36179325e-07   8.22107188e-07   6.48599415e-07
  -3.54536106e-06  -2.82099028e-06   3.17695529e-06   2.60997696e-06
   2.47134678e-06   2.32365410e-06   1.85757553e-07  -8.46944603e-07
   5.16633491e-06   4.08302520e-06  -2.21499943e-05  -1.76324175e-05
   1.98012105e-05   1.62803946e-05   1.53413444e-05   1.44516919e-05
   1.00767861e-06  -5.39342348e-06   3.21424830e-05   2.54222253e-05
  -1.38800638e-04  -1.10422444e-04   1.23510801e-04   1.01618411e-04
   9.58347012e-05   9.02680405e-05   6.68755216e-06  -3.34743371e-05
   2.01002468e-04   1.58976927e-04  -8.67632138e-04  -6.90071802e-04
   7.73032298e-04   6.35725699e-04   5.99414123e-04   5.64339611e-04
   4.20982918e-05  -2.08919153e-04   2.08924885e-04  -4.21004554e-05
  -5.64354842e-04  -5.99434878e-04  -6.35728158e-04  -7.73009580e-04
   6.90062263e-04   8.67628742e-04  -1.58975143e-04  -2.01004501e-04
   3.34770209e-05  -6.68897999e-06  -9.02691532e-05  -9.58352723e-05
  -1.01605578e-04  -1.23490606e-04   1.10420584e-04   1.38796587e-04
  -2.54262232e-05  -3.21462736e-05   5.38787690e-06  -1.01516728e-06
  -1.44526154e-05  -1.53429082e-05  -1.62785670e-05  -1.97983109e-05
   1.76315899e-05   2.21484266e-05  -4.08234579e-06  -5.16468414e-06
   8.46563618e-07  -1.86205051e-07  -2.32484944e-06  -2.47283355e-06
  -2.61032275e-06  -3.17793213e-06   2.82135776e-06   3.54552988e-06
  -6.48301157e-07  -8.21391777e-07   1.37131537e-07  -2.79339183e-08
  -3.68830821e-07  -3.87444419e-07  -4.15725031e-07  -5.04547399e-07
   4.51980502e-07   5.67687174e-07  -1.02152321e-07  -1.29357629e-07
   2.29469256e-08  -3.12240866e-09  -5.63247436e-08  -5.83970571e-08
  -6.62181858e-08  -7.99883445e-08   7.29307918e-08   9.11791892e-08
  -1.71207125e-08  -2.13237887e-08   4.10176294e-09   4.17941181e-10
  -9.70442298e-09  -1.05779094e-08  -1.09922499e-08  -1.32291204e-08
   1.16429829e-08   1.43515038e-08  -2.97047066e-09  -3.71497911e-09
   5.70175202e-10   1.12925211e-10  -1.62976726e-09  -1.96433822e-09
  -1.75981780e-09  -2.07550787e-09   2.01106280e-09   2.50994339e-09
  -4.43612512e-10  -6.09630252e-10   1.88924628e-10   1.91140314e-10
  -2.45501919e-10  -3.34065430e-10  -3.58921421e-10  -4.28702926e-10
   3.26427113e-10   4.34114632e-10  -1.07075922e-10  -1.63777015e-10
   1.84470456e-11  -4.44135974e-12  -2.13877902e-11  -2.52003965e-11
  -6.18387298e-11  -6.99266155e-11   5.84758267e-11   6.40546132e-11
  -2.21892127e-11  -1.87543320e-11   9.93355855e-12  -2.76485525e-12
  -1.36505814e-11  -2.71622134e-11  -7.65084199e-12   5.11308020e-12
   1.34288637e-11   6.43613570e-12  -1.66797530e-11  -1.74848434e-11
   1.17039824e-11   7.60031814e-12  -7.31006647e-12  -1.98003790e-11
   1.16856335e-12   1.13309120e-11   7.17394902e-12   1.10558668e-12
  -5.22482775e-12   3.56600699e-14   8.85950270e-12   8.34329999e-12
   2.28669654e-12  -3.38088503e-12   1.44411111e-12   7.33798799e-12
   7.89316422e-12   5.84310682e-12   9.64801995e-13   2.35744947e-12
   4.95128108e-12   6.41720566e-12   5.17427655e-12   2.98531402e-12
   4.71385627e-13   1.74716744e-12   4.38157043e-12   4.84743090e-12
   3.40943874e-12   2.56627652e-12   2.27102527e-12   3.90145839e-12
   4.00137997e-12   3.45222746e-12   4.11728496e-13   4.25497492e-13
   2.20595793e-12   2.79443972e-12   1.64871050e-12   6.80644777e-13
   4.89815267e-13   1.09264995e-12   1.56164933e-12   1.27382660e-12
  -2.68980732e-14  -8.58831313e-14   6.44414414e-13   8.80754568e-13
   6.03809265e-13   3.21867125e-13   1.68003179e-13   4.03579441e-13
   5.39223604e-13   4.47437410e-13  -8.72210078e-15   3.63439807e-15
   1.76839220e-13   2.55459225e-13   1.81693802e-13   1.10396305e-13
   4.29804700e-14   9.07040916e-14   1.56711140e-13   1.37749152e-13
  -3.80459879e-16  -4.46297882e-15   3.64469272e-14   6.38317556e-14
   4.16479461e-14   1.56403520e-14   1.97810805e-15   6.08334179e-15
   3.17469117e-14   2.34965238e-14  -2.97151690e-15  -4.84839899e-15
   3.31921088e-15   1.19427773e-14   6.57619850e-15  -9.86001829e-16
  -1.93193845e-15   1.51390169e-16   2.67691193e-15  -1.38282319e-16
  -9.15240488e-16   4.00861798e-18   1.15180789e-15   1.54198458e-15
  -6.86101733e-16   2.58155800e-16   7.67731370e-16   9.04389337e-16
   1.09655261e-15   6.04097182e-16  -7.74847353e-17   3.04626990e-16
   5.82610385e-16  -6.48693109e-16  -5.44540707e-16   2.76748197e-17
   3.37806932e-16   3.11340585e-16   3.21443521e-16   4.01532199e-16
   5.63469604e-16   6.58043213e-16   5.16588968e-16  -5.74532010e-17
  -6.94223314e-17   1.98222537e-17   1.47188548e-16   2.10467409e-17
   8.57768056e-18   5.50735824e-18  -4.92164735e-17   6.08540637e-17
   8.18180725e-17   2.94527851e-17   4.99422969e-17   2.50526823e-17
   8.05523405e-17   9.01303168e-18   1.21458403e-17   4.16278004e-18
   1.49145807e-17  -1.74155338e-18  -1.83944384e-18   2.44158052e-18
   1.23850431e-18   1.63869553e-19  -6.13951094e-19  -1.49431206e-20
  -3.07938389e-19  -2.73393638e-20   1.95094484e-20  -2.21726947e-19]

In [ ]: