def integrate_from_dict(fun_dict): """ integrate from dict --- this function allows to integrate a function without having to declare it as a support function, directly from the ppp. Important: it does not multiply by the coefficient!! :param fun_dict: contains all the function parameters :return: float """ try: a = fun_dict['params']['A'] b = fun_dict['params']['B'] except KeyError: raise IOError("could not find the parameters of the radial part") try: p = fun_dict['params']['P'] except KeyError: if fun_dict['bond'] is None: p = 0 else: p = 1 if fun_dict['bond'] is None: return 4 * np.pi * mathfunctions.generalized_exponential_integral(a, b, p) else: alpha = fun_dict['params']['alpha'] return 2 * np.pi * mathfunctions.generalized_exponential_integral( a, b, p) * mathfunctions.angular_gaussian_integral(alpha)
def integrate_from_old_dict(fun): """ :return: """ if fun['support_type'] in ['ORCV', 'OR', 'ORV', 'ORC']: a = fun['params']['A3'] b = fun['params']['B3'] return mathfunctions.generalized_exponential_integral(a, b, 0) * 4 * math.pi elif fun['support_type'] == 'AG': g = fun['params']['G'] u = fun['params']['U'] alpha = fun['params']['Alpha'] v = mathfunctions.angular_gaussian_integral(alpha) v *= mathfunctions.generalized_exponential_integral(u, g, P=1) v *= 2 * math.pi return v
def __integral_trigo(self): return generalized_exponential_integral( self.__A, self.__B, self.__P ) * angular_gaussian_integral(self.__alpha) * 2 * np.pi