Пример #1
0
def JosephsonCurrent(G,params_F,W,NMats,direction,gtype):
	''' Josephson current calculated from the Nambu Green function '''
	[beta,U,Delta,GammaL,GammaR,GammaN,eps,P,B] = params_F
	Phi = P*sp.pi
	## select direction, in theory JC_R = -JC_L
	Gamma = GammaR  if direction == 'R' else -GammaL
	Phi_s = Phi/2.0 if direction == 'R' else -Phi/2.0
	Hyb = lambda x: Gamma*IntFiniteBW(Delta,W,x)
	## define empty GFs
	J    = GfImFreq(indices = ['up','dn'],beta = beta,n_points = NMats)
	H    = GfImFreq(indices = ['up','dn'],beta = beta,n_points = NMats)
	G_iw = GfImFreq(indices = ['up','dn'],beta = beta,n_points = NMats)
	## calculate the Matsubara function from input
	if   gtype == 'leg': G_iw.set_from_legendre(G)
	elif gtype == 'tau': G_iw.set_from_fourier(G)
	else:                G_iw = G.copy()
	## define lambdas and fill the hybridizations
	H11 = lambda x:  x*Hyb(x)
	H12 = lambda x:  Delta*sp.exp( 1.0j*Phi_s)*Hyb(x)
	H21 = lambda x: -Delta*sp.exp(-1.0j*Phi_s)*Hyb(x)
	H22 = lambda x: -x*Hyb(x)
	H['up','up'] << Function(H11)
	H['up','dn'] << Function(H12)
	H['dn','up'] << Function(H21)
	H['dn','dn'] << Function(H22)
	## fill the GF i<c{dag}d-d{dag}c>
	for band1,band2 in product(['up','dn'], repeat=2):
		J[band1,band2] << H[band1,band2]*G_iw[band1,band2]
	J.tail.zero()	## tail is small and hard to fit
	JC = 2.0*sp.imag(J['up','dn'].density()[0][0]+J['dn','up'].density()[0][0])
	return JC
Пример #2
0
def GFzero(params_F,W,NMats,FitMin,FitMax,NTerms):
	''' constructs the non-interacting Green function as the input '''
	[beta,U,Delta,GammaL,GammaR,GammaN,eps,P,B] = params_F
	Phi = P*sp.pi
	epsUp =  eps + U/2.0 + B
	epsDn = -eps + U/2.0 + B
	V2 = W*GammaN/sp.pi  # hybridization with normal lead
	## define lambdas (hybridizations are real)
	GF11 = lambda x: x*(1.0 + HybDiagFiniteW(GammaL,GammaR,Delta,W,x)) - epsUp
	GF12 = lambda x: HybOffDiagFiniteW(GammaL,GammaR,Delta,P,W,x)
	GF21 = lambda x: sp.conj(HybOffDiagFiniteW(GammaL,GammaR,Delta,P,W,x))
	GF22 = lambda x: x*(1.0 + HybDiagFiniteW(GammaL,GammaR,Delta,W,x)) - epsDn
	## define GF objects
	GFinv = GfImFreq(indices = ['up','dn'],beta = beta,n_points = NMats)
	GF    = GfImFreq(indices = ['up','dn'],beta = beta,n_points = NMats)
	## fill GF objects with lambdas
	## W is half-bandwidth in Flat() descriptor from TRIQS
	GFinv['up','up'] << Function(GF11) - V2*Flat(W)
	GFinv['up','dn'] << Function(GF12)
	GFinv['dn','up'] << Function(GF21)
	GFinv['dn','dn'] << Function(GF22) - V2*Flat(W)
	## fit the tail
	GFinv.tail.zero()
	fixed_tail = TailGf(2,2,1,-1)
	fixed_tail[-1] = sp.eye(2)
	GFinv.fit_tail(fixed_tail,8,FitMin,FitMax)
	## calculate inverse
	GF << inverse(GFinv)
	## refit the tail
	GF.tail.zero()
	fixed_tail = TailGf(2,2,3,-1)
	fixed_tail[-1] = sp.zeros([2,2])
	fixed_tail[ 0] = sp.zeros([2,2])
	fixed_tail[ 1] = sp.eye(2)
	GF.fit_tail(fixed_tail,8,FitMin,FitMax)
	return GF
Пример #3
0
    return 0.7 / (z - 2.6 + 0.3 * 1j) + 0.3 / (z + 3.4 + 0.1 * 1j)


# Semicircle
def GSC(z):
    return 2.0 * (z + sqrt(1 - z**2) * (log(1 - z) - log(-1 + z)) / pi)


# A superposition of GLorentz(z) and GSC(z) with equal weights
def G(z):
    return 0.5 * GLorentz(z) + 0.5 * GSC(z)


# Matsubara GF
gm = GfImFreq(indices=[0], beta=beta, name="gm")
gm <<= Function(G)
gm.tail.zero()
gm.tail[1] = numpy.array([[1.0]])

# Real frequency BlockGf(reference)
gr = GfReFreq(indices=[0], window=(-5.995, 5.995), n_points=1200, name="gr")
gr <<= Function(G)
gr.tail.zero()
gr.tail[1] = numpy.array([[1.0]])

# Analytic continuation of gm
g_pade = GfReFreq(indices=[0],
                  window=(-5.995, 5.995),
                  n_points=1200,
                  name="g_pade")
g_pade.set_from_pade(gm, n_points=L, freq_offset=eta)
Пример #4
0
def GLorentz(z):
    return 0.7 / (z - 2.6 + 0.3 * 1j) + 0.3 / (z + 3.4 + 0.1 * 1j)


# Semicircle
def GSC(z):
    return 2.0 * (z + sqrt(1 - z**2) * (log(1 - z) - log(-1 + z)) / pi)


# A superposition of GLorentz(z) and GSC(z) with equal weights
def G(z):
    return 0.5 * GLorentz(z) + 0.5 * GSC(z)


# Matsubara GF
gm = GfImFreq(indices=[0], beta=beta, name="gm")
gm << Function(G)
gm.tail.zero()
gm.tail[1] = array([[1.0]])

# Analytic continuation of gm
g_pade = GfReFreq(indices=[0],
                  window=(-5.995, 5.995),
                  n_points=1200,
                  name="g_pade")
g_pade.set_from_pade(gm, n_points=L, freq_offset=eta)

from pytriqs.archive import HDFArchive
R = HDFArchive('pade.output.h5', 'w')
R['g_pade'] = g_pade
Пример #5
0
def GLorentz(z):
    return 0.7 / (z - 2.6 + 0.3 * 1j) + 0.3 / (z + 3.4 + 0.1 * 1j)


# Semicircle
def GSC(z):
    return 2.0 * (z + sqrt(1 - z**2) * (log(1 - z) - log(-1 + z)) / pi)


# A superposition of GLorentz(z) and GSC(z) with equal weights
def G(z):
    return 0.5 * GLorentz(z) + 0.5 * GSC(z)


# Matsubara GF
gm = GfImFreq(indices=[0], beta=beta, name="gm")
gm <<= Function(G)
gm.tail.zero()
gm.tail[1] = array([[1.0]])

# Analytic continuation of gm
g_pade = GfReFreq(indices=[0],
                  window=(-5.995, 5.995),
                  n_points=1200,
                  name="g_pade")
g_pade.set_from_pade(gm, n_points=L, freq_offset=eta)

from pytriqs.archive import HDFArchive
R = HDFArchive('pade.output.h5', 'w')
R['g_pade'] = g_pade
Пример #6
0
def make_g_tau(g_tau):
    K = make_kernel(g_tau.mesh.beta)
    g_tau << Function(lambda tau: Z_delta * K(tau, e_delta) + quad(
        lambda w: K(tau, w) * (A_con(w) + A_triangle(w)), e_min, e_max)[0])
Пример #7
0
def make_g_tau(g_tau):
    K = make_kernel(g_tau.mesh.beta)
    g_tau << Function(lambda tau: quad(
        lambda w: K(tau, w) * A(w), e_min, e_max, limit=100)[0])
Пример #8
0
    return 0.7 / (z - 2.6 + 0.3 * 1j) + 0.3 / (z + 3.4 + 0.1 * 1j)


# Semicircle
def GSC(z):
    return 2.0 * (z + sqrt(1 - z**2) * (log(1 - z) - log(-1 + z)) / pi)


# A superposition of GLorentz(z) and GSC(z) with equal weights
def G(z):
    return 0.5 * GLorentz(z) + 0.5 * GSC(z)


# Matsubara GF
gm = GfImFreq(indices=[0], beta=beta, name="gm")
gm << Function(G)
gm.tail.zero()
gm.tail[1] = numpy.array([[1.0]])

# Real frequency BlockGf(reference)
gr = GfReFreq(indices=[0], window=(-5.995, 5.995), n_points=1200, name="gr")
gr << Function(G)
gr.tail.zero()
gr.tail[1] = numpy.array([[1.0]])

# Analytic continuation of gm
g_pade = GfReFreq(indices=[0],
                  window=(-5.995, 5.995),
                  n_points=1200,
                  name="g_pade")
g_pade.set_from_pade(gm, n_points=L, freq_offset=eta)