This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · posts/the-pion-loop-function-by-computer-algebra

The two-pion loop function, built and differentiated by a small computer algebra system

The loop function sets the momentum dependence of the two-pion-exchange nuclear force at next-to-leading order. The program writes it as an expression tape, evaluates it, and differentiates the tape symbolically into a second tape. Both are checked against a 30-digit Feynman-parameter integral that never uses the closed form: and /MeV there, to and /MeV.

In chiral effective field theory the force between two nucleons is a sum of pion exchanges and short-range contact terms. At next-to-leading order the exchange of two pions enters through one function of the momentum transfer ,

which multiplies the central, tensor and spin-spin parts of the potential (Machleidt and Entem, Phys. Rep. 503, 1 (2011), Eqs. (4.9)-(4.12), with their average pion mass MeV). , and grows like at large . As a function of it has a branch cut that starts at , the two-pion threshold, so in coordinate space the force it carries has range , half the one-pion range.

Higher orders need many such functions and their derivatives, which is the job of a computer algebra system. This post builds a small one: an expression tape, a list of operations each of which refers to earlier entries, with an evaluator and a differentiator that turns a tape into the tape of its derivative.

The reference, posts/refs/the-pion-loop-function-by-computer-algebra.py, does not use the closed form. It computes the loop from its Feynman-parameter integral (the equation under the title) with mpmath's quadrature at 30 digits, and the derivative by mpmath's numerical differentiation of that integral.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 38–156

The tape of

The program writes the way it is printed: as the square root of , then . That is 11 entries. Differentiating appends the derivative of every entry, including the derivatives of constants, which are zero; the tape grows to 36 entries. Nothing simplifies the result, so the derivative tape does more arithmetic than a hand-written derivative would, but it is exact.

[2]lines 169–181

Values against the Feynman-parameter integral

The reference evaluates at eight momenta from its integral representation, which comes from the loop diagram itself, not from the closed form. The tape agrees at every one to , from MeV, where , to 1 GeV. At small the logarithm in the integral expands, and with and , ,

At MeV, , and the tape matches the two terms to .

A third representation is the dispersion integral: has an imaginary part above the two-pion threshold , and

The program maps to with and integrates by Simpson's rule on 2000 intervals. The integrand has a square-root zero at threshold, where Simpson's rule loses its order, and the result is off by at MeV.

[3]lines 209–299

The derivative

The derivative tape, evaluated at three momenta, matches mpmath's numerical derivative of the Feynman-parameter integral to per MeV, rounding in a number of about 0.001. A central difference on the tape with a step of 1 MeV is off by up to , which is the error of that step; the symbolic derivative has no step to choose.

[4]lines 311–368