.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/01_ramanujan_master_theorem.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_01_ramanujan_master_theorem.py: Ramanujan's Master Theorem ========================== If :math:`f(x) = \sum_n \varphi(n) (-x)^n / n!`, then .. math:: \int_0^\infty x^{s-1} f(x)\,dx = \Gamma(s)\,\varphi(-s). This example applies the theorem to :math:`(1+x)^{-3}`, checks it against the Beta function and a numerical Mellin transform, and evaluates a dimensionally regulated radial integral, where the theorem *is* the analytic continuation in D. .. GENERATED FROM PYTHON SOURCE LINES 13-29 .. rst-class:: sphx-glr-script-out .. code-block:: none Int x^(s-1) (1+x)^-3 dx RMT : 0.416520275452346835657738842818 Beta : 0.416520275452346835657738842818 numeric : 0.416520275452346835657738842818 Int dq2 q2^(D/2-1)/(q2+1), D=1: 3.14159265358979323846264338328 Int dq2 q2^(D/2-1)/(q2+1), D=3: -3.14159265358979323846264338328 Int dq2 q2^(D/2-1)/(q2+1), D=3.9: -20.0824840790797440454036816166 | .. code-block:: Python import mpmath as mp from ramanujan_qft import massive_propagator_rmt, mellin_numeric, ramanujan_master_theorem mp.mp.dps = 30 # 1/(1+x)^a = Sum (a)_n (-x)^n / n! -> phi(n) = Gamma(a+n)/Gamma(a) a, s = mp.mpf(3), mp.mpf("1.25") rmt = ramanujan_master_theorem(lambda n: mp.gamma(a + n) / mp.gamma(a), s) print("Int x^(s-1) (1+x)^-3 dx RMT :", rmt) print(" Beta :", mp.beta(s, a - s)) print(" numeric :", mellin_numeric(lambda x: (1 + x)**-a, s)) # A dimensionally regulated radial integral: the RMT result *is* the analytic continuation in D. for D in (1, 3, mp.mpf("3.9")): print(f"Int dq2 q2^(D/2-1)/(q2+1), D={mp.nstr(D, 3)}:", massive_propagator_rmt(1, D)) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.019 seconds) .. _sphx_glr_download_auto_examples_01_ramanujan_master_theorem.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01_ramanujan_master_theorem.ipynb <01_ramanujan_master_theorem.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01_ramanujan_master_theorem.py <01_ramanujan_master_theorem.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 01_ramanujan_master_theorem.zip <01_ramanujan_master_theorem.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_