# S-Wave Scattering

This research article solves the s-wave scattering problem by using the Diagrammatic Monte Carlo method.

The Diagrammatic Monte Carlo method (DiagMC) is a relatively new approach of solving differential equations, which are based on integral expressions. Since my PhD thesis studies the application of a more advanced version (the BMC, or Bold Diagrammatic Monte Carlo, method) to examine observables within the theory of Quantum Chromodynamics, I have to become familiar with the DiagMC method.

To apply the algorithm we need to prepare our analytical expression. We need to identify various parts and calculate some values. In this case we pick a spherical symmetrical potential U(r) with the exact form

U(r) = U0θ(r0-r).

Now we have to calculate the Fourier transform of this potential, i.e.

u(q) = 1 / (2π) ∫ d3r U(r) exp(iqr),

which results in

u(q) = 2 U0 / q3 * (sin(q r0)-q r0 cos(q r0)).

Here we also need to calculate an expression for small q, i.e. q→0,

limq→0 u(q)=2 U0 r03 / 3.

Now that we prepared a few functions we need to work out our differential equation, which needs to be evaluated by using the Diagrammatic Monte Carlo method.

We want to solve a differential equation for f(q),

f(q) = -u(q) - 1/(π) ∫-11 dχ ∫0 u(|q-q'|) f(q') dq'.

Here we can use that

|q-q'| = (q2+q'2-2qq'χ)1/2.

So we identify:

• D1(q) = -u(q)
• D2(q,q',χ) = - 1/π u((q2+q'2-2qq'χ)1/2)f(q')

Calculating the normalization I can be a tough problem. Introducing another (non-physical) diagram we can simplify this:

• D0 = const.

Now the number of order 0 diagrams Z0 is helpful. Using Z0 / Zsteps approaches D0 / I (here I is the normalization, which takes D0 into account!). Using this we can estimate

bin (s) f(q) dq = Hs D0 / Z0,

where Hs is the value (sum of signs) in the s-th bin.

Finally we have to plugin everything into a working code, thinking of some (statistical) important steps:

• Everything has to be ergodic, i.e. we need to generate Markov chains that follow the equation of detailed balance.
• We need to normalize everything properly.
• Sufficient statistics are required before using the DiagMC sampling.

Considering these steps and following the DiagMC method we obtain the following algorithm:

1. Initialize all variables
2. Perform an infinite (or long enough) outer loop
3. Measure in each step
4. Perform an accept / reject step in every iteration
5. Maybe print or save the statistics
6. Maybe end the loop

The measuring is quite straight forward. Here we have to do the following:

1. If we are in the 0th-order we exclude the measurement (this diagram was brought in artificially and must be excluded from measurements) and increment the value of the number of 0th-order measurements
2. Otherwise we look at the current value of q and select the corresponding index for binning. The index can be calculated by (int)(q / Δq), where
Δq = qmax / Nbins.
The value of the selected bin has to add the value of the current sign.

The accept / reject step is just an applied Metropolis algorithm, with respect to the current and the old diagram. Here we perform:

1. If we are in the lowest order we compute the value of the next higher order
2. If we are in the highest order we compute the value of the next lower order
3. Otherwise we decide between all possible n changes with a chance of 1/n for each change and compute the value of the picked order
4. Now we calculate the ratio of the computed value over the current value
5. If a random number (between 0 and 1) is smaller than this ratio we accept the step: the new order is the picked one and the current value is the computed one
6. Finally we have to save the sign of the current order

The full C code can be downloaded below. Using the GNU C compiler (gcc) we can built the code (swave.c) by calling:

`gcc swave.c -lm`

So we must include the math library for the code to run. If you use a different compiler (like the one from Intel, icc), then remember to specify the correct parameters.