Пример #1
0
    guess=rho/(-bb[1][1])
    from scipy.optimize import fsolve
    hphi=fsolve(lambda hphi:rho+getBoundary(hphi,0,[0,a2])[0][1][1], guess)

    w=1e-3*Tc
    bb,osc=getBoundary(hphi,0,[w,a2])
    assert osc==0
    sigma=-1j*bb[2][1]/( bb[2][0]*w )
    d=1/sigma.real
    m=sigma.imag/w*d**2
    y1s.append(1/d)
    rho=-bb[1][1]
    mu=bb[1][0]
    y2s.append(m/d*Tc)
#drude=1/(d-m*1j*w)
fig(0)
pl.xscale('log')
pl.yscale('log')
pl.plot([a2 for a2 in a2s],y1s,ls='-',c='k',label=r'$\sigma_0$')
pl.plot(a2s,y2s,ls='--',c='k',label=r'$\tau T_c$')
hn=len(a2s)/3.5
k=np.log(y1s[-1]/y1s[-2])/np.log(a2s[-1]/a2s[-2])
m=y1s[-1]/a2s[-1]**k
print(k)
print(m)
pl.plot([a2s[hn], a2s[-1]], [a2s[hn]**k*m, a2s[-1]**k*m],ls='--',c='r')#,label=r'$\mathrm{Power\ fit}$')
pl.annotate(r'$C\left(\frac{\alpha_2}{L^4}\right)^{'+('%.3f'%k)+'}$',xy=(a2s[hn],a2s[hn]**k*m), xycoords='data',
                                  xytext=(-70, -14), textcoords='offset points', fontsize=10,
                                                                     arrowprops=dict(arrowstyle="->"))

'''k=np.log(y2s[-1]/y2s[-2])/np.log(a2s[-1]/a2s[-2])
Пример #2
0
ws=[.01,1,20]
aa=True
n2=11

Gobs=[loadG(name, Nf, L, n2) for Nf in Nfs]
Ss=[getSfun(Gob, addAsym=aa) for Gob in Gobs]
wm=Gobs[0][0]
print('Datapoints: '+str(len(Gobs[0][1])))
N=200
xs=np.linspace(-wm, wm, N)
wss=reduce(lambda a,b:a+', '+b,map(str,ws))

colors=['red', 'green', 'blue', 'violet']

for r in [0,1]:
	f=fig(r,size=14)
	for i in range(len(ws)):
		kx=ws[i]
		cf=[np.real,np.imag][r]
		for j in range(len(Nfs)):
			pl.plot(xs, [cf(Ss[j](x,kx)) for x in xs],label='$N_fk_f='+str(Nfs[j])+r'\lambda^2$' if i==0 else '',color=colors[j])
			if r==1:
				pl.plot(xs, cf(SlargeNf(Nfs[j],xs)),color=colors[j],linestyle='--')
		pl.plot(xs, cf([Squenchedv1(w,kx) for w in xs]),label=(r'$N_fk_f=0$' if i==0 else ''),color='black')
	pl.plot([],[],label=r'$k_x/\lambda^2='+wss+'$',color='white')
	pl.xlim([-wm,wm])
	if r==1:
		pl.ylim([-.11, .11])
	else:
		pl.ylim([-0,.09])
	grid_selfmade(f.get_axes()[0])
Пример #3
0
hpsis = np.logspace(-6, 1.5, 300)
a2 = 0.1
plotImag = False  # True
from solveBC import sweep, findrho

try:
    bbs, sols = load(open("cache/sols_a2=" + str(a2)))
except IOError:
    print("Solve for sweep of different horizon BCs...")
    bbs, sols = sweep(lambda x, y: getBoundary(x, y, [0, a2]), hpsis, oscN=1, status=True)
    dump((bbs, sols), open("cache/sols_a2=" + str(a2), "w"))

rho = -np.array(bbs)[:, :, 1, 1].real
rhoc = min([min(r) for r in rho])  # rho, in units used at Tc

fig(11)
if a2 == 0:
    Trs = [1.0, 0.9, 0.5, 0.05]
else:
    Trs = [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3]
    # Trs=[0.1,0.3,0.5,0.7,0.9,1.1]
    # Trs=np.linspace(0.23,0.4,8)
zh = 1
T = 3.0 / (zh * 4.0 * np.pi)
# wvs= np.logspace(0,1.5,40)/15.
if a2 == 0:
    wvs = np.logspace(-1, 0.3, 400)
else:
    wvs = np.logspace(-1, 0.6, 40)
pl.xlim(wvs[0], wvs[-1])
if plotImag:
Пример #4
0
#murs=[i*19./nature[0] for i in nature]
scale=3.7
murs=[scale*np.sqrt(1.*i)*5000./2/8.9/natTK for i in nature]

zh=1
T=3./(zh*4.*np.pi)
#wvs= np.logspace(0,1.5,40)/15.
wm=8000.
wvs= np.linspace(wm*0.01/natTK,wm/natTK,2)
'''pl.xlim(wvs[0],wvs[-1])
if plotImag:
    pl.ylim(-1.1,1.8)
else:
    pl.ylim(-.1,1.8)'''

fig(0,size=12)
pl.xlim(0,wm)
pl.ylim(-0.2,1.3)
fig(1,size=12)
pl.ylim(-1.5,5)

pl.xlim(0,wm)


Vcrit=(muc/T*natTK*8.9*2/5000./scale)**2
fig(0)
pl.plot([0,wm],[1,1],c='r',ls='-',label='$V<%.2f\ \mathrm{V}$'%Vcrit)
pl.legend(loc='lower right')
fig(1)
pl.plot([0,wm],[0,0],c='r',ls='-',label='$V<%.2f\ \mathrm{V}$'%Vcrit)
pl.legend(loc='upper right')
Пример #5
0
    bb,osc=getBoundary(1,0,[0,a2])
    guess=rho/(-bb[1][1])
    from scipy.optimize import fsolve
    hphi=fsolve(lambda hphi:rho+getBoundary(hphi,0,[0,a2])[0][1][1], guess)

    w=1e-3*Tc
    bb,osc=getBoundary(hphi,0,[w,a2])
    assert osc==0
    sigma=-1j*bb[2][1]/( bb[2][0]*w )
    d=1/sigma.real
    m=sigma.imag/w*d**2
    Cs.append(sigma.real/a2)

#drude=1/(d-m*1j*w)
fig(0,size=11)
k,m=np.polyfit(np.log(Trs),np.log(Cs),1)
print k
print np.exp(m)
plMin,plMax=.8*Trs[0],Trs[-1]/0.8
pl.plot([plMin,plMax],[plMin**k*np.exp(m), plMax**k*np.exp(m)],c='r',label=r'$\mathrm{Power\ fit}$')
pl.plot(Trs,Cs,ls='',marker='x',c='k',label=r'$\sigma_0$')
pl.xscale('log')
pl.yscale('log')
#pl.plot(a2s,y2s,ls='--',c='k',label=r'$\tau T_c$')
#hn=len(a2s)/4
#k=np.log(y1s[-1]/y1s[-2])/np.log(a2s[-1]/a2s[-2])
#m=y1s[-1]/a2s[-1]**k
#print(k)
#print(m)
#pl.plot([a2s[hn], a2s[-1]], [a2s[hn]**k*m, a2s[-1]**k*m],ls='-',c='r')#,label=r'$\mathrm{Power\ fit}$')
Пример #6
0
        Tc = T * np.sqrt(rho / rhoc)

        bb, osc = getBoundary(1, 0, [0, a2])
        guess = rho / (-bb[1][1])
        from scipy.optimize import fsolve

        hphi = fsolve(lambda hphi: rho + getBoundary(hphi, 0, [0, a2])[0][1][1], guess)

        w = 1e-3 * Tc
        bb, osc = getBoundary(hphi, 0, [w, a2])
        assert osc == 0
        sigma = -1j * bb[2][1] / (bb[2][0] * w)
        sigma0 = sigma.real
        tauTc = sigma.imag / (w * sigma0)
        y1s[-1].append(sigma0)
        y2s[-1].append(1 / tauTc)
fig(0, size=12)
pl.xscale("log")
pl.yscale("log")
pl.xlim(Trs[0], Trs[-1])
pl.ylim(5e-3, 2e4)
for j in range(len(a2s)):
    pl.plot(Trs, [y[j] for y in y2s], ls="-", c="k", label=r"$\frac{1}{\tau T_c}$")
    printText(Trs, [y[j] for y in y2s], 10.0, -0.03, "$10^{" + str(j - 4) + "}L^4$")
pl.xlabel(r"$\frac{T}{T_c}$")
pl.ylabel(r"$\frac{1}{\tau T_c}$")
# pl.legend(loc='upper left')
saveFig("scatvsT_2")

pl.show()
Пример #7
0
#rho=-np.array(bbs)[0,:,1,1].real
#rhoc=min( rho)#rho, in units used at Tc
mu=np.array(bbs)[0,:,1,0].real
muc=mu[0]

Trs=[.9,.925,0.95,0.975,1.,2.]#[1.2,1.,.97,.86,.70]
    #Trs=[0.1,0.3,0.5,0.7,0.9,1.1]
    #Trs=np.linspace(0.23,0.4,8)
zh=1
T=3./(zh*4.*np.pi)
#wvs= np.logspace(0,1.5,40)/15.
wv0=0.01
wv1=4.
for i in range(2):
    fig(i)
    pl.xlim(wv0,wv1)
    pl.xscale('log')
    if i==0:
        pl.yscale('log')
minAbs=float('inf')
maxAbs=0
for j in range(len(Trs)):
    Tr=Trs[j]
    print('Solving for specific temperature...')
    #rho=rhoc/Tr**2
    mu=muc/Tr
    #Tc=T*np.sqrt(rho/rhoc)
    Tc=T*(mu/muc)

    if Tr<1:
Пример #8
0
hpsis=np.logspace(-6,1.5,300)
a2=0

from solveBC import sweep, findrho

try:
    bbs,sols=load(open('cache/sols'))
except IOError:
    print('Solve for sweep of different horizon BCs...')
    bbs,sols=sweep(lambda x,y: getBoundary(x,y,[0,a2]), hpsis, oscN=1, status=True)
    dump((bbs,sols),open('cache/sols','w'))

rho=-np.array(bbs)[:,:,1,1].real
rhoc=min([min(r) for r in rho])#rho, in units used at Tc

fig(11)
Trs=np.linspace(0.03,0.999,100)
zh=1
T=3./(zh*4.*np.pi)
wvs= np.logspace(-4,-3,2)
pl.xscale('log')
pl.yscale('log')
first=True
ys=[]
for j in range(len(Trs)):
    printRatio(j,len(Trs))
    Tr=Trs[j]
    rho=rhoc/Tr**2
    Tc=T*np.sqrt(rho/rhoc)

    if Tr<1:
Пример #9
0
rho=-np.array(bbs)[:,:,1,1].real
mu=np.array(bbs)[:,:,1,0].real
O=np.array(bbs)[:,:,0,1].real
#const=mu
const=np.sqrt(rho)
cConst=min([min(r) for r in const])#rho, in units used at Tc


zh=1.#choice of length units makes zh numerically constant
T=3./(zh*4.*np.pi)#temp of solution in units used, this is constant by choice of units

for osci in range(len(mu)):
    sign=-1 if O[osci][0]<0 else 1
    Tc=T/cConst*const[osci]
    fig(1)
    pl.plot(cConst/const[osci],np.sqrt(sign*O[osci]*np.sqrt(2))/Tc,ls='-' if sign==1 else '--',c='k')
    fig(2)
    pl.plot(cConst/const[osci],mu[osci]/Tc,ls='-' if sign==1 else '--',c='k')
    print O[osci]

fig(1)
pl.plot([0,1.2],[0,0],lw=1)
pl.ylim([-1,9])
#pl.legend(loc='upper right')
pl.xlabel(r'$\frac{T}{T_c}$')
pl.ylabel(r'$\frac{\sqrt{\sqrt{2}|\langle\mathcal{O}\rangle|}}{T_c}$')
saveFig('O_constRho_a2_'+str(a2))

fig(2)
Trs=np.linspace(0,1.2)[1:]
Пример #10
0
    #Trs=[0.1,0.3,0.5,0.7,0.9,1.1]
    #Trs=np.linspace(0.23,0.4,8)
zh=1
T=3./(zh*4.*np.pi)
#wvs= np.logspace(0,1.5,40)/15.
if a2==0:
    wvs= np.logspace(-1.2,0.0,40)
else:
    wvs= np.logspace(-1,0.6,40)
'''pl.xlim(wvs[0],wvs[-1])
if plotImag:
    pl.ylim(-1.1,1.8)
else:
    pl.ylim(-.1,1.8)'''

fig(0,size=10)
pl.xlim(0,wvs[-1])
pl.ylim(-0.4,1.3)
fig(1,size=10)
pl.ylim(-1.5,5)

pl.xlim(0,wvs[-1])

first=True
for j in range(len(Trs)):
    Tr=Trs[j]
    print('Solving for specific temperature...')
    rho=rhoc/Tr**2
    Tc=T*np.sqrt(rho/rhoc)

    if Tr<1:
Пример #11
0
try:
    As=load(open('cache/As_oscN='+str(oscN)+'_a2='+str(a2)))
except IOError:
    from scipy.integrate import cumtrapz
    As=[]
    for s in sols:
        As.append([])
        for i in range(len(hpsis)):
            printRatio(i,len(hpsis))
            _,_,(zs,y)=getBoundary(s[i], hpsis[i], [0,a2], plot=False, returnSol=True)
            Al=[0]+list(cumtrapz([Lfun(*([zs[j]]+[0,a2]+y[j][:-4]+[0,0]))
                for j in range(len(zs))][::-1], x=zs[::-1]))
            As[-1].append(Al[-1])
    dump(As,open('cache/As_oscN='+str(oscN)+'_a2='+str(a2),'w'))

fig(1)
for osci in range(len(mu)):
    sign=-1 if O[osci][0]<0 else 1
    Tc=T/cConst*const[osci]
    pl.plot(cConst/const[osci],As[osci]/Tc**3,ls='-' if sign==1 else '--',c='k')

#pl.plot(Trs,rho*zh/Tc,lw=1)
Trs=np.linspace(0.01,1.2,100)
if a2==0 and False:
    pl.plot(Trs,(4*np.pi/3*T*Trs)*(min([min(r) for r in rhos])*(zh/Trs))**2/2 / T**3,lw=1,c='k')
else:
    from scipy.integrate import cumtrapz
    normAs=[]
    for Tr in Trs:
        rho=min([min(r) for r in rhos])/Tr**2
        Tc=T/Tr
Пример #12
0
Gobs=[loadG(name, Nf, L, 15) for Nf in Nfs]
Gs=[getGfun(Gob, 'cubic') for Gob in Gobs]
wm=Gobs[0][0]
n=len(Gobs[0][1])
ws=np.linspace(-wm,wm,n)[n/2:]
skip=1
ws=np.concatenate((ws[skip:n/256],np.logspace(np.log10(ws[n/256]),np.log10(ws[-1]),20)))
print('Datapoints: '+str(n))
N=2000
wmin=wm/(n-1)
wmax=wm
xs=wmin*np.exp(np.linspace(0, np.log(wmax/wmin), N))

colors=['red', 'green', 'blue', 'violet']

f=fig(2,size=14)
phis=np.linspace(0,2*np.pi,20)[:-1]
rs=[.05,1]
j=0
for i in range(len(rs)):
	phases=np.exp(1j*phis)*rs[i]
	pl.plot(phis, [np.angle(Gs[j](p.imag,p.real)) for p in phases])
pl.show()
sys.exit(0)


f=fig(0,size=14)
pl.plot(xs, np.abs([Gquenchedv1(0,w) for w in xs]),label=(r'$N_fk_f=0$'),color='black')
pl.plot(xs, np.abs([1/w for w in xs]),label=(r'$\lambda=0$'),color='black',ls='--')
for j in range(len(Nfs)):
	pl.loglog(ws, abs(Gs[j](0,ws)),'+',label='$N_fk_f='+str(Nfs[j])+r'\lambda^2$',color=colors[j])
Пример #13
0
def plot(bbs,ind,As=None,name='',verbose=False):
    lss=['-', '--', '-.', ':']*4
    bbs=np.array(bbs)
    if As!=None: A=np.array(As)
    p1=bbs[:,:,0,0].real
    p2=bbs[:,:,0,1].real
    mu=bbs[:,:,1,0].real
    rho=-bbs[:,:,1,1].real
    rhoc=min([min(r) for r in rho])#rho, in units used at Tc
    if verbose: print 'rhoc: '+str(rhoc)
    zh=1.#choice of length units makes zh numerically constant
    T=3./(zh*4.*np.pi)#temp of solution in units used, this is constant by choice of units
    for osci in range(len(rho)):
        Tc=T*np.sqrt(rho[osci]/rhoc)#critical temp, in units used for all solutions
        fig(1)
        pl.plot(T/Tc,np.power(np.abs(p2[osci])*np.sqrt(2.),1./(ind[0][0][1]))/Tc,c='k',ls=lss[osci])
        fig(4)
        pl.plot(T/Tc,mu[osci]/Tc,c='k',ls=lss[osci])
        if As!=None:
            fig(7)
            pl.plot(T/Tc,A[osci]/Tc**3,c='k',ls=lss[osci])
        if verbose:
            print 'mu/rho'+str(mu[osci][-1]/rho[osci][-1])
            print 'p2/rho'+str(p2[osci][-1]/rho[osci][-1])
    fig(1)
    pl.plot([0,2], [0,0], c='k', lw=1)
    pl.xlabel('$\\frac{T}{T_c}$')
    pl.ylabel('$\\frac{\\sqrt{O_2}}{T_c}$')
    pl.xlim([0,1.2])
    pl.ylim([-1,10])
    if name: saveFig(name+'O2Tzeros')
    fig(4)
    rho=np.linspace(rhoc*0.2,rhoc*10,1000)
    mu=rho*zh
    Tc=T*np.sqrt(rho/rhoc)#critical temp, in units used for all solutions
    pl.plot(T/Tc,mu/Tc,c='k',ls='-',lw=1)
    pl.xlabel('$\\frac{T}{T_c}$')
    pl.ylabel('$\\frac{\\mu}{T_c}$')
    pl.xlim([0,1.2])
    pl.ylim([0,40])
    if name: saveFig(name+'muTzeros')

    if As!=None:
        fig(7)
        pl.xlabel('$\\frac{T}{T_c}$')
        pl.ylabel('$\\frac{A}{V_{2}T_c^3}$')
        Atriv=4*np.pi*T/3*mu**2/2
        pl.plot(T/Tc, Atriv/Tc**3,c='k',ls='-',lw=1)
        pl.xlim([0,2])
        pl.ylim([0,1.5e3])
        if name: saveFig(name+'A')
Пример #14
0
    else:
        return [bb,osc]

if __name__=='__main__':
    hpsis=np.logspace(-7,1.0,30)

    print('Solve for sweep of different horizon BCs...')
    from solveBC import sweep, findrho

    bbs,sols=sweep(lambda x,y: getBoundary(x,y,[0,1]), hpsis, oscN=3, status=True)

    if True:
        print('Calculating free energy...')
        from scipy.integrate import cumtrapz
        As=[]
        fig(0)
        for s in sols:
            As.append([])
            for i in range(len(hpsis)):
                _,_,(zs,y)=getBoundary(s[i], hpsis[i], [0,1], plot=True, returnSol=True)
                Al=[0]+list(cumtrapz([Lfun(*([zs[j]]+varParams+y[j][:-4]+[0,0]))
                        for j in range(len(zs))][::-1], x=zs[::-1]))
                As[-1].append(Al[-1])
    else: As=None

    print('Plot the result...')
    import plotOps
    plotOps.plot(bbs,ind,As=As)

    fig(5)
    for s in sols:
Пример #15
0
from results import loadG, loadGBenchmark, getSfun, getGfun, GlargeNfApp
import pylab as pl
import numpy as np
import matplotlib.pyplot as plt
from fig import fig, saveFig, fill_between, grid_selfmade

N=35000
wm=.021234;

colors=['red', 'green', 'blue', 'violet','yellow']


f=fig(0,size=10)
Nf=1.
kx=1
xs=np.linspace(kx-wm, kx+wm, N)
pl.plot(xs, -2*np.imag(GlargeNfApp(Nf,-1j*xs+0.000001,kx)),label='',color='black')
pl.plot(np.linspace(kx-.0005,kx+.0005,1000),500*[-120000,120000],color='black')
#pl.plot(xs, -np.imag(GlargeNfApp(Nf,-1j*xs+0.00001,kx)),label='',color='blue')
#pl.yscale('log')
pl.xlim([xs[0],xs[-1]])
#pl.legend(loc=4)
pl.ylim([-100000,100000])
grid_selfmade(f.get_axes()[0])
pl.xlabel(r'$\omega/\lambda^2$')
pl.ylabel(r'$A(\omega, k_x=\lambda^2)/\lambda^2$')

saveFig('inconsistency')

plt.show()
Пример #16
0
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator
import matplotlib.pyplot as plt
import numpy as np
import fig as f

fig=f.fig(0,aspect=1.)
ax = fig.gca(projection='3d')
m=10
phi = np.linspace(0, 2*np.pi, 16*m+1)
mz=1
z = np.linspace(-mz, mz, 16*m+1)
xlen = len(phi)
ylen = len(z)
alpha=0.5
X =np.outer(np.cos(phi), np.sqrt(z**2+alpha**2))
Y =np.outer(np.sin(phi), np.sqrt(z**2+alpha**2))
Z =np.outer(np.ones(np.size(phi)),z)

colortuple = ((0.5,0.3,1.0), (0.5,1.0,0.3))
colors = []
for y in range(ylen):
    colors.append([])
    for x in range(xlen):
        colors[-1].append( colortuple[(x/m+y/m) % len(colortuple)])
        
mr=np.sqrt(mz**2+alpha**2)
ax.plot(np.cos(phi)*mr,np.sin(phi)*mr , -1, label='parametric curve',c='k',zorder=-1,lw=1)
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors,
                linewidth=0, antialiased=False, shade=True, zorder=0)