def getRadialMatrixElementSemiClassical(self, n, l, s, j, n1, l1, s1, j1): #get the effective principal number of both states nu = n - self.getQuantumDefect(n, l, s, j) nu1 = n1 - self.getQuantumDefect(n1, l1, s1, j1) #get the parameters required to calculate the sum l_c = (l + l1 + 1.) / 2. nu_c = sqrt(nu * nu1) delta_nu = nu - nu1 delta_l = l1 - l gamma = (delta_l * l_c) / nu_c g0 = (1. / (3. * delta_nu)) * (mpmath.angerj(delta_nu - 1., -delta_nu) - mpmath.angerj(delta_nu + 1, -delta_nu)) g1 = -(1. / (3. * delta_nu)) * (mpmath.angerj(delta_nu - 1., -delta_nu) + mpmath.angerj(delta_nu + 1, -delta_nu)) g2 = g0 - mpmath.sin(pi * delta_nu) / (pi * delta_nu) g3 = (delta_nu / 2.) * g0 + g1 radial_ME = (3 / 2) * nu_c**2 * (1 - (l_c / nu_c)**(2))**0.5 * ( g0 + gamma * g1 + gamma**2 * g2 + gamma**3 * g3) return radial_ME
def ExactIntegrationOfSinus(t, a=None, b=None): with precision(300): if a == None and b == None: return 0.5 * math.pi * math.sqrt(t) * (mpmath.angerj(0.5, t) - mpmath.angerj(-0.5, t)) elif a == None and b != None: a = 0 elif b == None: b = t mpmath.mp.dps = 50 mpmath.mp.pretty = True pi = mpmath.mp.pi pi = +pi fcos = mpmath.fresnelc fsin = mpmath.fresnels arg_b = mpmath.sqrt(2 * (t - b) / pi) if a == "MinusInfinity": return mpmath.sqrt( 0.5 * mpmath.mp.pi) * (-2 * mpmath.sin(t) * fcos(arg_b) + 2 * mpmath.cos(t) * fsin(arg_b) + mpmath.sin(t) - mpmath.cos(t)) else: arg_a = mpmath.sqrt(2 * (t - a) / pi) return mpmath.sqrt(2 * mpmath.mp.pi) * ( (fsin(arg_b) - fsin(arg_a)) * mpmath.cos(t) + (fcos(arg_a) - fcos(arg_b)) * mpmath.sin(t))
def ExactIntegrationOfSinusKernel(t, a = None, b = None): with precision(300): if a == None and b == None: return 0.5 * math.pi * math.sqrt(t) * (mpmath.angerj(0.5, t) - mpmath.angerj(-0.5, t)) if a == None and b != None: a = t elif b == None: b = 0. mpmath.mp.pretty = True pi = mpmath.mp.pi pi = +pi fcos = mpmath.fresnelc fsin = mpmath.fresnels arg_a = mpmath.sqrt(2 * (t - a) / mpmath.mp.pi) arg_b = mpmath.sqrt(2 * (t - b) / mpmath.mp.pi) return mpmath.sqrt(2 * mpmath.mp.pi) * ((fsin(arg_b) - fsin(arg_a)) * mpmath.cos(t) + (fcos(arg_a) - fcos(arg_b)) * mpmath.sin(t))