ramanujan_qft.rmt#

Ramanujan’s Master Theorem and a numerical Mellin transform to check its uses. User guide: Ramanujan’s Master Theorem.

ramanujan_qft.rmt.ramanujan_master_theorem(phi, s, dps=None)[source]#

Mellin transform by Ramanujan’s Master Theorem.

If \(f(x) = \sum_{n\ge0} \varphi(n)\,(-x)^n/n!\), then

\[\int_0^\infty x^{s-1} f(x)\,dx = \Gamma(s)\,\varphi(-s).\]

This function returns the right-hand side, Gamma(s) * phi(-s).

Parameters:
  • phi (callable) – The analytic continuation of the Taylor-coefficient function. It is called once, with the mpmath number -s, at the working precision, so write it with mpmath functions (mpmath.gamma, mpmath.rgamma, mpmath.rf, …).

  • s (number or str) – The Mellin variable. It should lie in the strip where the integral converges; outside it the analytic continuation is returned. Strings are exact decimals.

  • dps (int, optional) – Decimal digits of working precision (default: mpmath.mp.dps).

Return type:

mpmath.mpf or mpmath.mpc

Notes

The theorem holds for the continuation of \(\varphi\) that satisfies Hardy’s growth condition: with \(\lambda(v) = \varphi(v)/\Gamma(1+v)\) analytic for \(\operatorname{Re} v \ge -\delta\), \(|\lambda(v + iw)| < C e^{Pv + A|w|}\) with \(A < \pi\). A function that agrees with \(\varphi\) on the integers but grows faster (for example \(\varphi(v) + \sin(\pi v)\)) gives a wrong value. This cannot be detected from a black-box callable, so check new uses with mellin_numeric().

References

G. H. Hardy, Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, Cambridge University Press (1940), ch. XI. T. Amdeberhan, O. Espinosa, I. Gonzalez, M. Harrison, V. H. Moll, A. Straub, Ramanujan’s Master Theorem, Ramanujan J. 29 (2012) 103.

Examples

\(e^{-x}\) has \(\varphi(n) = 1\), so its Mellin transform is \(\Gamma(s)\):

>>> import mpmath
>>> ramanujan_master_theorem(lambda n: 1, 2.5)
mpf('1.329340388179137')

\((1+x)^{-3}\) has \(\varphi(n) = \Gamma(3+n)/\Gamma(3)\), which gives the Beta function \(B(s, 3-s)\):

>>> ramanujan_master_theorem(lambda n: mpmath.gamma(3 + n) / 2, 1.25)
mpf('0.41652027545234682')
>>> mpmath.beta(1.25, 1.75)
mpf('0.41652027545234682')
ramanujan_qft.rmt.mellin_numeric(f, s, dps=None)[source]#

Numerical Mellin transform \(\int_0^\infty x^{s-1} f(x)\,dx\), for cross-checks.

Intended for non-oscillatory f that behave like a power \(x^{p_0}\) as \(x \to 0\) and decay like a power (or faster) as \(x \to \infty\).

Parameters:
  • f (callable) – The integrand factor; called with mpmath numbers.

  • s (number or str) – The Mellin variable; Re s > 0 is required.

  • dps (int, optional) – Decimal digits of working precision (default: mpmath.mp.dps).

Returns:

The integral, accepted only if the quadrature error estimate is below \(10^{-\lfloor dps/2 \rfloor}\) relative to the value. Ask for more digits than you want to compare.

Return type:

mpmath.mpf or mpmath.mpc

Raises:
  • ValueError – If Re s <= 0; if f vanishes at sample points; if f is not in its power-law regime on \([10^{-12}, 10^{-4}]\) or \([10^{4}, 10^{12}]\) (oscillating or logarithmic behaviour); or if the integral diverges, or nearly so, at either end.

  • ArithmeticError – If the quadrature error estimate does not reach about half of the working digits.

Notes

The exponent \(p_0\) is estimated from samples at \(x = 10^{-4}, \dots, 10^{-12}\) and the decay \(f \sim x^{-a}\) from samples at \(x = 10^{4}, \dots, 10^{12}\). The algebraic endpoint behaviour is removed by the substitutions \(x = y^{1/\sigma}\) on \([0, 1]\), with \(\sigma = \operatorname{Re} s + p_0\), and \(x = y^{-1/c}\) on \([1, \infty)\), with \(c = a - \operatorname{Re} s\), before tanh-sinh quadrature (mpmath.quad).

Examples

>>> import mpmath
>>> mellin_numeric(lambda x: (1 + x)**-3, 1.25)
mpf('0.41652027545234682')
>>> mellin_numeric(lambda x: 1 / (1 + x), 1)
Traceback (most recent call last):
...
ValueError: the Mellin integral diverges (or nearly so) at infinity for this s
ramanujan_qft.rmt.massive_propagator_rmt(msq, D, dps=None)[source]#

Radial integral of a massive propagator in \(D\) dimensions, by RMT.

\[\int_0^\infty dq^2\,(q^2)^{D/2-1}\,\frac{1}{q^2+m^2} = (m^2)^{D/2-1}\,\Gamma(D/2)\,\Gamma(1-D/2).\]

The expansion \(1/(q^2+m^2) = \sum_n \Gamma(n+1)(m^2)^{-n-1}(-q^2)^n/n!\) gives \(\varphi(n) = \Gamma(n+1)/(m^2)^{n+1}\), and the theorem is applied at \(s = D/2\).

Parameters:
  • msq (number or str) – The squared mass \(m^2 > 0\).

  • D (number or str) – The dimension. The integral converges for \(0 < D < 2\); elsewhere the analytic continuation in \(D\) is returned, which is dimensional regularisation. At \(D = 2, 4, 6, \dots\) the continuation has a pole and mpmath raises ValueError.

  • dps (int, optional) – Decimal digits of working precision (default: mpmath.mp.dps).

Return type:

mpmath.mpf or mpmath.mpc

Raises:

ValueError – If msq is not positive, or at a pole in D.

Notes

Dividing by \(\Gamma(D/2)\) gives the Euclidean tadpole \(\int d^Dq_E/\pi^{D/2}\,(q_E^2+m^2)^{-1} = \Gamma(1-D/2)\,(m^2)^{D/2-1}\).

Examples

>>> massive_propagator_rmt(2.5, 1.5)
mpf('3.533294752055899')
>>> print(massive_propagator_rmt(4, 3))     # D = 3 by continuation: -2 pi
-6.28318530717959