Пример #1
0
import shutil
from pySecDec import make_package

if __name__ == "__main__":

    make_package(
        name='thetafunction',
        integration_variables=['z%i' % i for i in range(3)],

        # the order here defines the order of the expansion
        regulators=['eps'],
        real_parameters=['delta'],
        functions=['cut1'],
        polynomials_to_decompose=['(z0+z1)**(-2-2*eps)', 'z2**(-1-4*eps)'],
        remainder_expression='cut1(z1,delta)',

        # the highest orders of the final regulator expansion
        # the order here matches the order of ``regulators``
        requested_orders=[1],

        # the optimization level to use in FORM (can be 0, 1, 2, 3, 4)
        form_optimization_level=2,

        # the WorkSpace parameter for FORM
        form_work_space='500M',
    )

    # copy 'functions.hpp' (predefined for this example) to required directory
    shutil.copy('functions_thetafunction.hpp',
                'thetafunction/thetafunction_integral/src/functions.hpp')
Пример #2
0
    name = 'userdefined_cpp'

    make_package(

    name=name,
    integration_variables = ['x','y','z'],

    # use integration by parts rather than subtraction for ``x`` and ``y``
    # generate subtraction term for ``z`` to avoid derivative of HeavisideTheta
    ibp_power_goal = [0,0,-1],

    # the order here defines the order of the expansion
    regulators = ['eps'],
    functions = ['HeavisideTheta','func'],

    polynomials_to_decompose = ['(x+y)**(-2+eps)','z**(-1+eps)'],
    remainder_expression = 'HeavisideTheta(1/4-z)*func(y)',
    # full analytic result for func(y)=1:
    #   (4^-eps (-2 + 2^eps))/((-1 + eps) eps^2)
    # = 1/eps^2 + (1 - Log[2] - Log[4])/eps +  1/2 (2 - 2 Log[2] - Log[2]^2 - 2 Log[4] + 2 Log[2] Log[4] + Log[4]^2) + O[eps]
    # = 1.0000000000000000000/eps^2 - 1.0794415416798359283/eps + 0.60214400703386905808 + O[eps]

    # the highest orders of the final regulator expansion
    # the order here matches the order of ``regulators``
    requested_orders = [0],

    )

    # check the generated "functions.hpp"
    cpp_function_declarations = (
Пример #3
0
    name = 'userdefined_cpp'

    make_package(

    name=name,
    integration_variables = ['z%i' % i for i in range(4)],

    # the order here defines the order of the expansion
    regulators = ['eps'],
    real_parameters = ['alpha'],
    functions = ['dum1', 'dum2'],
    #
    polynomials_to_decompose = ['(z0+z1)**(-2-2*eps)', 'z2**(-1-4*eps)'],
    remainder_expression = '(dum1(z0,z1,z2,z3) + 5*eps*z0)**(1+eps) * dum2(z0,z1,alpha)**(2-6*eps)',
    #remainder_expression = '(z0**2+z1**3+z2**4+z3**5 + 4*z0*z1*z2*z3+2-z0**2*z1**3*z2**4*z3**5 + 5*eps*z0)**(1+eps) * (z0**2 + z1**2 +alpha**2 + 4*z0*z1+3*z0**2*z1**2 - sqrt(z0*z1*alpha))**(2-6*eps)',


    # the highest orders of the final regulator expansion
    # the order here matches the order of ``regulators``
    requested_orders = [1],

    # the optimization level to use in FORM (can be 0, 1, 2, 3, 4)
    form_optimization_level = 2,

    # the WorkSpace parameter for FORM
    form_work_space = '500M',

    )

    # check the generated "functions.hpp"
    with open(name + '/' + name + '_integral/src/functions.hpp') as generated_header_file:
Пример #4
0
    make_package(
        name='two_regulators',
        integration_variables=['z%i' % i for i in range(2)],

        # the order here defines the order of the expansion
        regulators=['alpha', 'eps'],

        #complex_parameters = ['A'],
        #functions = ['F1', 'F2'],
        prefactor='''exp(-EulerGamma*(2*eps+alpha))''',
        polynomials_to_decompose=[
            'z0**(-1-2*eps-alpha)', '(1-z0)**(-1+2*eps+alpha)',
            'z1**(-1+alpha/2)'
        ],
        remainder_expression='exp(-z0/(1-z0))',

        # the highest orders of the final regulator expansion
        # the order here matches the order of ``regulators``
        requested_orders=[0, 0],

        # the optimization level to use in FORM (can be 0, 1, 2, 3, 4)
        form_optimization_level=2,

        # the WorkSpace parameter for FORM
        form_work_space='500M',

        # Note:
        # * this integral is numerically regulated for z0->1 (see remainder_expression)
        # * default korobov3x3 transforms the integrand strongly close to z0->1
        # * applying korobov3x3 makes the integrand too numerically unstable to integrate (often get nan)
        # We instead use the asymmetric korobov3x1 to avoid introducing too much noise for z0->1
        pylink_qmc_transforms=['korobov3x1'])
Пример #5
0
    make_package(

    name='hypergeo5F4',
    integration_variables = ['z%i' % i for i in range(4)],

    # the order here defines the order of the expansion
    regulators = ['eps'],
    real_parameters = ['b'],
    #functions = [],
    prefactor = '''
                        gamma(2*eps)*gamma(4*eps)*gamma(6*eps)*gamma(8*eps)/
                        (gamma(-eps)*gamma(-3*eps)*gamma(-5*eps)*gamma(-7*eps))/
                        gamma(3*eps)/gamma(7*eps)/gamma(11*eps)/gamma(15*eps)
                ''',


    #prefactor = '947.4609375*eps**4 - 286765.9822507143*eps**6 + 1.4350164700988792*^6*eps**7 + 2.668449372562483*^7*eps**8',

    polynomials_to_decompose = ['z0**(-1-7*eps)','z1**(-1-5*eps)','z2**(-1-3*eps)','z3**(-1-eps)', '(1-z0)**(-1+15*eps)','(1-z1)**(-1+11*eps)','(1-z2)**(-1+7*eps)','(1-z3)**(-1+3*eps)','(1-b*z0*z1*z2*z3)**(-eps)'],
    #remainder_expression = '',

    # the highest orders of the final regulator expansion
    # the order here matches the order of ``regulators``
    requested_orders = [4],

    # the optimization level to use in FORM (can be 0, 1, 2, 3, 4)
    form_optimization_level = 2,

    # the WorkSpace parameter for FORM
    form_work_space = '500M',

    split = True,

    )
Пример #6
0
#!/usr/bin/env python3
import shutil
from pySecDec import make_package

if __name__ == "__main__":

    name = 'no_default_transform'

    make_package(
        name=name,
        integration_variables=['x'],

        # the order here defines the order of the expansion
        regulators=['eps'],

        # the highest orders of the final regulator expansion
        # the order here matches the order of ``regulators``
        requested_orders=[1],
        polynomials_to_decompose=['(x)**(-1+eps)'],
        polynomial_names=['p'],
        other_polynomials=['p**-2'],
        pylink_qmc_transforms=['korobov2x1', 'sidi3'])
Пример #7
0
#!/usr/bin/env python3
from pySecDec import make_package

if __name__ == "__main__":

    make_package(
        name='difference',
        integration_variables=['z1', 'z2', 'z3'],
        regulators=['eps'],
        polynomials_to_decompose=['(z1-z2*z3)**(-1+eps)'],

        # the contour deformation adds a "-i * delta" prescription to the polynomial above
        polynomial_names=['P'],
        contour_deformation_polynomial='P',

        # we want to compute up to order "eps**2"
        requested_orders=[2],

        # split the integration region at 1/2 to remap singularities
        # at one to zero
        split=True,
    )

    # analytic result:
    # ( 1.64493406684822643647241516664602518923 + 3.1415926535897932384626433832795028842 * I) * eps ** 0
    # ( 2.08781123053685858754509217178101012328 - 6.2831853071795864769252867665590057684 * I) * eps ** 1
    # (-5.94029019737039970544633397517750766917 + 4.2570651807194096861418776386549427857 * I) * eps ** 2
    # ( 5.77945251635494087034720012662916969501 - 2.2309450542592328953584685107508798034 * I) * eps ** 3 # set ``requested_orders = [3]`` to compute up to order "eps**3"
Пример #8
0
#!/usr/bin/env python3

from pySecDec import make_package

if __name__ == "__main__":

    make_package(
        name='easy',
        integration_variables=['x', 'y'],
        regulators=['eps'],
        requested_orders=[0],
        polynomials_to_decompose=['(x+y)^(-2+eps)'],
    )