def integrand_btz_n(u, tau, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0): s_int_fnc = lambda s: lam**2 * fp.exp(-s**2/4/sig**2)\ * (fp.exp(-fp.j*Om*s) * wightman_btz_n(s,n,R,rh,l,pm1,Om,lam,sig)) if n != 0 or deltaphi != 0: pt1 = fp.mpf( mp.acosh(rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) - 1))) pt2 = fp.mpf( mp.acosh(rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) + 1))) uplim = 2 * tau - u if n == 0: if uplim < pt2: output = fp.quad(s_int_fnc, [0, uplim]) else: output = fp.quad(s_int_fnc, [0, pt2]) + fp.quad( s_int_fnc, [pt2, uplim]) else: if uplim < pt1: output = fp.quad(s_int_fnc, [0, uplim]) elif uplim < pt2: output = fp.quad(s_int_fnc, [0, pt1]) + fp.quad( s_int_fnc, [pt1, uplim]) else: output = fp.quad(s_int_fnc,[0,pt1]) + fp.quad(s_int_fnc,[pt1,pt2])\ + fp.quad(s_int_fnc,[pt2,uplim]) output *= fp.exp(-u**2 / 4 / sig**2) return output
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 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 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 XG_plusBA(n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP): bA = mp.sqrt(RA**2 - rh**2) / l bB = mp.sqrt(RB**2 - rh**2) / l f = lambda y: 2/Om/(bB-bA) * fp.exp(-fp.j*Om/2*(bB+bA)*y)\ * h_n2(y,n,RA,RB,rh,l,pm1,deltaphi,isP)\ * fp.sin( Om/2*(bB-bA)*(2*(tau0+width)-y)) return fp.quad(f, [2 * tau0 + width, 2 * (tau0 + width)])
def XG_minusAB(n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP): bA = mp.sqrt(RA**2 - rh**2) / l bB = mp.sqrt(RB**2 - rh**2) / l f = lambda y: 2/Om/(bB-bA) * fp.exp(-fp.j*Om/2*(bB+bA)*y)\ * h_n1(y,n,RA,RB,rh,l,pm1,deltaphi,isP)\ * fp.sin( Om/2*(bB-bA)*(y-2*tau0)) return fp.quad(f, [2 * tau0, 2 * tau0 + width])
def integrandof_Xn_plus(y, n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP): 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)*(y-width) ) * fp.cos(Om/2*(bB-bA)*y)\ * g_n2(y,n,RA,RB,rh,l,pm1,deltaphi,isP)
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 f01(y, n, R, rh, l, pm1, Om, lam, sig): return lam**2*sig**2/2 * fp.exp(-sig**2*(y-Om)**2)\ / fp.mpf((mp.exp(y * 2*mp.pi*l*mp.sqrt(R**2-rh**2)/rh) + 1))
def integrand2(u, a): f = lambda s: fp.exp(-s**2) * (fp.exp(fp.j*(s+u)) * fp.mpf(mp.exp(-np.abs(u)))\ + fp.exp(fp.j*u) * fp.mpf(mp.exp(-np.abs(s+u))) ) return fp.quad(f, [0, fp.inf])
def integrandof_P_BTZn(y, n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP): return 2 * lam**2 * (fp.exp(-fp.j * Om * y) * g_n( y, n, RA, RB, rh, l, pm1, deltaphi, isP)).real * (width - y)
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)
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 _marginal_util(self, time, elapsed=0.0): "The marginal activity utility is a function of the current time and the elapsed time. " nominator = self.Sigma*self.Lambda*self.Um denominator = (fp.exp( self.Sigma*(time-self.Xi) ) * fp.power(1.0+fp.exp( -self.Sigma*(time-self.Xi) ), self.Lambda+1.0) ) return self.U0 + nominator/denominator
def f01(y,n,R,rh,l,pm1,Om,lam,sig): return lam**2*sig**2/2 * fp.exp(-sig**2*(y-Om)**2)\
def _marginal_util(self, time, elapsed=0.0): "The marginal activity utility is a function of the current time and the elapsed time. " nominator = self.Sigma * self.Lambda * self.Um denominator = (fp.exp(self.Sigma * (time - self.Xi)) * fp.power( 1.0 + fp.exp(-self.Sigma * (time - self.Xi)), self.Lambda + 1.0)) return self.U0 + nominator / denominator
def integrand1(x, a): f = lambda x2: fp.exp(-(x - x2)**2) * fp.exp(-fp.j * x) * fp.exp(-np.abs(x2 )) return fp.quad(f, [-fp.inf, a])