def g_n2(y, n, RA, RB, rh, l, pm1, deltaphi, isP): sigma = sigma_btz_n(y, n, RA, RB, rh, l, pm1, deltaphi, isP) + 2 if sigma == 0: return 0 elif sigma > 0: return 1 / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(sigma) else: return -fp.j / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(-sigma) * fp.sign(y)
def integrand_Pdotp_n(s, tau, n, R, rh, l, pm1, Om, lam, sig, deltaphi, eps): K = lam**2 * rh / (2 * fp.pi * fp.sqrt(2) * l * fp.sqrt(R**2 - rh**2)) * fp.exp(-tau**2 / 2 / sig**2) # Zp = mp.mpf(rh**2/(R**2-rh**2)*(R**2/rh**2 * fp.cosh(rh/l * (deltaphi - 2*fp.pi*n)) + 1)) # if Zp == fp.mpf(mp.cosh(rh/l/mp.sqrt(R**2-rh**2) * s)): # return 0 # else: return K * fp.exp(-(tau-s)**2/2/sig**2) * fp.exp(-fp.j*Om*s) \ / fp.sqrt(gammap_btz_n(s,n,R,rh,l,deltaphi,eps))
def sigma_geon_n(y, n, RA, RB, rh, l, pm1, deltaphi, isP): if isP: return RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1\ + fp.sqrt(RA**2-rh**2)*fp.sqrt(RB**2-rh**2)/rh**2 \ * fp.mpf(mp.cosh(rh/l/mp.sqrt(RA*RB-rh**2) * y) ) else: return RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1\ + fp.sqrt(RA**2-rh**2)*fp.sqrt(RB**2-rh**2)/rh**2 \ * fp.mpf(mp.cosh(rh/l**2 * y) )
def integrand_deltaPdot_n(s, tau, n, R, rh, l, pm1, Om, lam, sig, deltaphi): Zm = mp.mpf(rh**2/(R**2-rh**2)\ *(R**2/rh**2 * fp.cosh(rh/l * (deltaphi - 2*fp.pi*(n+1/2))) - 1)) Zp = mp.mpf(rh**2/(R**2-rh**2)\ *(R**2/rh**2 * fp.cosh(rh/l * (deltaphi - 2*fp.pi*(n+1/2))) + 1)) K = lam**2 * rh / (2 * fp.pi * fp.sqrt(2) * l * fp.sqrt(R**2 - rh**2)) * fp.exp(-tau**2 / 2 / sig**2) return K * fp.exp(-(tau-s)**2/2/sig**2) * fp.exp(-fp.j*Om*s)\ * ( 1/fp.sqrt(Zm + mp.cosh(rh/l/mp.sqrt(R**2-rh**2) * s))\ - pm1*1/fp.sqrt(Zp + mp.cosh(rh/l/mp.sqrt(R**2-rh**2) * s)) )
def XGEON_integrand_nBA(y, n, RA, RB, rh, l, pm1, Om, lam, sig, deltaphi): bA = mp.sqrt(RA**2 - rh**2) / l bB = mp.sqrt(RB**2 - rh**2) / l K = 1 alp2 = bA**2 * bB**2 / 2 / (bA**2 + bB**2) / sig**2 bet2 = (bA + bB) * bA * bB / (bA**2 + bB**2) E = (bB - bA) / fp.sqrt(2) / fp.sqrt(bB**2 + bA**2) * ( (bB + bA) * y / 2 / sig + fp.j * sig * Om) return K*mp.exp(-alp2*y**2)*mp.exp(-fp.j*bet2*Om*y) *fp.erfc(E) \ * XGEON_denoms_n(y,n,RA,RB,rh,l,pm1,Om,lam,sig,deltaphi)
def g_n1(y, n, RA, RB, rh, l, pm1, deltaphi, isP): sigma = sigma_btz_n(y, n, RA, RB, rh, l, pm1, deltaphi, isP) #print('y',y,' sigma',sigma) if n == 0 and deltaphi == 0 and RA == RB: #Deal with this case separately return 0 elif sigma == 0: return 0 elif sigma > 0: return 1 / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(sigma) else: return -fp.j / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(-sigma) * fp.sign(y)
def Xn_plus(n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP): intlim2 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\ / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2) #print('plus, %.4f ;'%intlim2) f = lambda y: integrandof_Xn_plus(y, n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP) if intlim2 < width: return fp.quad(f, [0, intlim2]) + fp.quad(f, [intlim2, width]) else: return fp.quad(f, [0, width])
def f02(y, n, R, rh, l, pm1, Om, lam, sig): K = lam**2 * sig / 2 / fp.sqrt(2 * fp.pi) a = (R**2 - rh**2) * l**2 / 4 / sig**2 / rh**2 b = fp.sqrt(R**2 - rh**2) * Om * l / rh Zp = mp.mpf((R**2 + rh**2) / (R**2 - rh**2)) if Zp - mp.cosh(y) > 0: return fp.mpf(K * mp.exp(-a * y**2) * mp.cos(b * y) / mp.sqrt(Zp - mp.cosh(y))) elif Zp - mp.cosh(y) < 0: return fp.mpf(-K * mp.exp(-a * y**2) * mp.sin(b * y) / mp.sqrt(mp.cosh(y) - Zp)) else: return 0
def f02(y,n,R,rh,l,pm1,Om,lam,sig): K = lam**2*sig/2/fp.sqrt(2*fp.pi) a = (R**2-rh**2)*l**2/4/sig**2/rh**2 b = fp.sqrt(R**2-rh**2)*Om*l/rh Zp = mp.mpf((R**2+rh**2)/(R**2-rh**2)) if Zp == mp.cosh(y): print("RIP MOM PLSSS") #print(Zp, y, fp.cosh(y)) if Zp - mp.cosh(y) > 0: return K * fp.exp(-a*y**2) * fp.cos(b*y) / fp.mpf(mp.sqrt(Zp - mp.cosh(y))) elif Zp - mp.cosh(y) < 0: return -K * fp.exp(-a*y**2) * fp.sin(b*y) / fp.mpf(mp.sqrt(mp.cosh(y) - Zp)) else: return 0
def g(x, RA, RB): # bA = mp.sqrt(RA**2-rh**2)/l # bB = mp.sqrt(RB**2-rh**2)/l # return fp.j*4 * fp.exp(-fp.j*Om*(bB+bA)*(tau0+width/2))/(Om*(bB+bA))\ # * fp.cos( Om/2*(bB+bA)*(x-width) ) * fp.cos(Om/2*(bB-bA)*x)\ # * g_n2(x,0,RA,RB,rh,l,pm1,deltaphi) sigma = sigma_btz_n(x, n, RA, RB, rh, l, pm1, deltaphi) + 2 if sigma == 0: return 0 elif sigma > 0: return 1 / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(sigma) else: return -fp.j / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt(-sigma) * fp.sign(x)
def fn1(y, n, R, rh, l, pm1, Om, lam, sig): K = lam**2 * sig / 2 / fp.sqrt(2 * fp.pi) a = (R**2 - rh**2) * l**2 / 4 / sig**2 / rh**2 b = fp.sqrt(R**2 - rh**2) * Om * l / rh Zm = mp.mpf(rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.cosh(2 * fp.pi * rh / l * n) - 1)) if Zm == mp.cosh(y): return 0 elif Zm - fp.cosh(y) > 0: return fp.mpf(K * mp.exp(-a * y**2) * mp.cos(b * y) / mp.sqrt(Zm - mp.cosh(y))) else: return fp.mpf(-K * mp.exp(-a * y**2) * mp.sin(b * y) / mp.sqrt(mp.cosh(y) - Zm))
def T_P_int_geon(x, tau, tau0, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0): K = lam**2 / (np.sqrt(2) * np.pi * l * Om) * rh / np.sqrt(R**2 - rh**2) Gm = rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.mpf( mp.cosh(rh / l * (deltaphi - 2 * np.pi * (n + 0.5)))) - 1) Gp = rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.mpf( mp.cosh(rh / l * (deltaphi - 2 * np.pi * (n + 0.5)))) + 1) if tau < tau0: return 0 elif x < (tau + tau0): return K * fp.sin(Om*(2*tau0+x))\ * (1/fp.sqrt(Gm + fp.mpf(mp.cosh(rh/l**2 * x))) - 1/fp.sqrt(Gp + fp.mpf(mp.cosh(rh/l**2 * x)))) else: return K * fp.sin(Om*(2*tau-x))\ * (1/fp.sqrt(Gm + fp.mpf(mp.cosh(rh/l**2 * x))) - 1/fp.sqrt(Gp + fp.mpf(mp.cosh(rh/l**2 * x))))
def P_BTZn(n,R,rh,l,pm1,Om,lam,sig): b = fp.sqrt(R**2-rh**2)/l lim = 20*sig*rh/b/l**2 print('limit: ',lim) Zm = fp.mpf(1) #rh**2/(R**2-rh**2)*(R**2/rh**2 * fp.cosh(2*fp.pi*rh/l * n) - 1) Zp = rh**2/(R**2-rh**2)*(R**2/rh**2 * fp.cosh(2*fp.pi*rh/l * n) + 1) print('Zm: ',Zm, 'Zp: ',Zp, 'acosh(Zp): ', fp.mpf(mp.acosh(Zp))) #print(Zm,fp.acosh(Zm)) # plt.figure() # xaxis = fp.linspace(0,lim/5,50) # yaxis = [f02(x,n,R,rh,l,pm1,Om,lam,sig) for x in xaxis] # plt.plot(xaxis,yaxis) # plt.show() if pm1==-1 or pm1==1 or pm1==0: if n==0: return 0\ - fp.quad(lambda x: f02(x,n,R,rh,l,pm1,Om,lam,sig),[0,fp.mpf(mp.acosh(Zp))])\ - fp.quad(lambda x: f02(x,n,R,rh,l,pm1,Om,lam,sig),[fp.mpf(mp.acosh(Zp)),lim]) #fp.quad(lambda x: f01(x,n,R,rh,l,pm1,Om,lam,sig),[-fp.inf,fp.inf]) # else: # if fp.cosh(lim) < Zm or Zm < 1: # return fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ # - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[0,lim]) # else: # return fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ # - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[0,fp.mpf(mp.acosh(Zm))])\ # - fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ # - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[fp.mpf(mp.acosh(Zm)),lim]) else: print("Please enter a value of 1, -1, or 0 for pm1.")
def wightman_btz_n(s, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0, eps=1e-4): if n == 0: Bm = (R**2 - rh**2) / rh**2 Bp = (R**2 + rh**2) / rh**2 else: Bm = R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) - 1 Bp = R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) + 1 Scosh = (R**2 - rh**2) / rh**2 * mp.cosh(rh / l**2 * (s - fp.j * eps)) # if s == 0: # return 0 # elif Bm == Scosh or Bp == Scosh: # return 0 # else: return 1/(4*fp.sqrt(2)*fp.pi*l) * (-fp.j/fp.sqrt(2*Bm)/\ mp.sinh(rh/2/l**2 * (s - fp.j*eps)) - pm1/fp.sqrt(Bp - Scosh))
def PGEON_n(n, R, rh, l, pm1, Om, lam, sig): """ Om = energy difference lam = coupling constant """ if pm1 == -1 or pm1 == 1 or pm1 == 0: return lam**2*sig*fp.sqrt(fp.pi) * fp.mpf(mp.exp(-sig**2 * Om**2)) *\ fp.quad(lambda x: h_n(x,n,R,rh,l,pm1) * PGEON_gaussian(x,sig), [-fp.inf, fp.inf]) else: print("Please enter a value of 1, -1, or 0 for pm1.")
def P_BTZn(n, R, rh, l, pm1, Om, lam, sig): b = fp.sqrt(R**2 - rh**2) / l lim = 20 * sig * rh / b / l**2 #Zp = mp.mpf(rh**2/(R**2-rh**2)*(R**2/rh**2 * fp.cosh(2*fp.pi*rh/l * n) + 1)) #print('Zm: ',Zm, 'Zp: ',Zp) #print(Zm,fp.acosh(Zm)) if pm1 == -1 or pm1 == 1 or pm1 == 0: if n == 0: return fp.quad(lambda x: f01(x, n, R, rh, l, pm1, Om, lam, sig), [-fp.inf, fp.inf]) else: Zm = rh**2 / (R**2 - rh**2) * ( R**2 / rh**2 * fp.cosh(2 * fp.pi * rh / l * n) - 1) if fp.cosh(lim) < Zm or Zm < 1: return fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[0,lim]) else: return fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[0,fp.mpf(mp.acosh(Zm))])\ - fp.quad(lambda x: fn1(x,n,R,rh,l,pm1,Om,lam,sig)\ - fn2(x,n,R,rh,l,pm1,Om,lam,sig),[fp.mpf(mp.acosh(Zm)),lim]) else: print("Please enter a value of 1, -1, or 0 for pm1.")
def P_BTZn(n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi=0, eps=1e-8, isP=True): f = lambda y: integrandof_P_BTZn(y, n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP) if n == 0 and deltaphi == 0 and RA == RB: # P0m P0m = 2 * fp.quad( lambda x: integrandPBTZ_0m(x, RA, rh, l, pm1, Om, lam, tau0, width, eps), [0, width]) intlim = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\ / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2) if intlim < width: return fp.quad(f, [0, intlim]) + fp.quad(f, [intlim, width]) + P0m else: return fp.quad(f, [0, width]) + P0m else: intlim1 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1)\ / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2) intlim2 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\ / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2) #print('%.4f, %.4f'%(intlim1,intlim2)) if intlim2 < width: return fp.quad(f, [0, intlim1]) + fp.quad( f, [intlim1, intlim2]) + fp.quad(f, [intlim2, width]) elif intlim1 < width: return fp.quad(f, [0, intlim1]) + fp.quad(f, [intlim1, width]) else: return fp.quad(f, [0, width])
def h_n2(y, n, RA, RB, rh, l, pm1, deltaphi, isP): return 1 / (4 * fp.pi * fp.sqrt(2) * l) * 1 / fp.sqrt( sigma_geon_n(y, n, RA, RB, rh, l, pm1, deltaphi, isP) + 2)
# checkfcn.append( (g_n1(y[i],0,Ri,Ri,rh,l,pm1,0)*fp.exp(fp.j*Om*y[i])).real ) # checkfcn2.append( (g_n1(y[i],0,Ri,Ri,rh,l,pm1,0)*fp.exp(fp.j*Om*y[i])).imag ) #plt.plot(y,checkfcn,label='real of g') ##plt.plot(y,checkfcn2,label='imag of g') #plt.legend() P0_gauss = [] P_btz, P_geon = [], [] X_btz, X_geon = [], [] PB_btz, PB_geon = [], [] # Create y-axis array for BTZ and geon for n in np.arange(0, nmax + 1): print('n = ', n, '; i = ', end='') for i in range(np.size(dR)): print(i, end=' ', flush=True) bA = fp.sqrt(RA[i]**2 - rh**2) / l bB = fp.sqrt(RB[i]**2 - rh**2) / l tau0B = tau0 * bB / bA widthB = width * bB / bA if n == 0: P0_gauss.append(P0m_GAUSS(RA[i], rh, l, pm1, Om, lam, sig).real) P_btz.append( P_BTZn(0, RA[i], RA[i], rh, l, pm1, Om, lam, tau0, width)) P_geon.append( 2 * PGEON_n(0, RA[i], RA[i], rh, l, pm1, Om, lam, tau0, width)) PB_btz.append( P_BTZn(0, RB[i], RB[i], rh, l, pm1, Om, lam, tau0B, widthB)) PB_geon.append( 2 * PGEON_n(0, RB[i], RB[i], rh, l, pm1, Om, lam, tau0B, widthB)) X_btz.append(
def integrandPBTZ_0m(y, R, rh, l, pm1, Om, lam, tau0, width, eps): #print( mp.sinh(rh/2/l**2 * (y - fp.j*eps)) ) return (- fp.j*rh*lam**2 / (8*fp.pi*l * fp.sqrt(R**2-rh**2))\ * fp.exp(-fp.j*Om*y)/mp.sinh(rh/2/l**2 * (y - fp.j*eps)) * (width - np.abs(y))).real
def T_P_int_geon(x, tau, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0): return lam**2*fp.exp(-sig**2*Om**2) * fp.sqrt(fp.pi)*sig * fp.erf(-(x-2*tau/2/sig)-fp.j*sig*Om)\ * fp.exp(-x**2/4/sig**2) * h_n(x,n,R,rh,l,pm1)
def h_n(x, n, R, rh, l, pm1): return 1/(4*fp.sqrt(2)*fp.pi*l) * (1/fp.sqrt(sigma_geon(x,n,R,rh,l)) \ - pm1 * 1/fp.sqrt(sigma_geon(x,n,R,rh,l) + 2))
def integrandPBTZ_0m_GAUSS(y, R, rh, l, pm1, Om, lam, sig, eps): #print(mp.sqrt(1 - mp.cosh( y -fp.j*eps ))) return fp.exp(-fp.j*fp.sqrt(R**2-rh**2)*Om*l/rh * y)\ / mp.sqrt(1 - mp.cosh( y -fp.j*eps ))\ * lam**2*sig/(2*fp.sqrt(2*fp.pi))\ * fp.exp(-(R**2-rh**2)*l**2/(4*sig**2*rh**2) * y**2)