Compare volume integrals of KDUQ potentials

Volume integrals are a useful way to gain intuition about the relative importance of different terms at different energies.

For a spherical potential term \(V(r;E)\), we define

(1)\[\begin{equation} \frac{J_V(E)}{ A} \equiv \frac{4\pi}{A} \int_0^\infty V(r;E) r^2 dr \end{equation}\]
1import numpy as np
2from tqdm import tqdm
1from matplotlib import pyplot as plt
1from jitr.reactions import ElasticReaction
1from jitr.optical_potentials import kduq
1from jitr.optical_potentials.potential_forms import (
2    thomas_volume_integral,
3    woods_saxon_prime_volume_integral,
4    woods_saxon_volume_integral,
5)
6from jitr.utils.constants import WAVENUMBER_PION
1neutron = (1, 0)
2proton = (1, 1)
1target = (24, 12)
2projectile = proton
3energy_lab = np.linspace(10, 250, 100)
4rxn = ElasticReaction(target=target, projectile=projectile)
1kduq_samples = kduq.get_samples(projectile)
1kinematics = rxn.kinematics(energy_lab)
 1r = np.linspace(0.1, 10, 1000)
 2kduq_v_central = np.zeros(
 3    (kduq.NUM_POSTERIOR_SAMPLES, energy_lab.size, r.size), dtype=complex
 4)
 5kduq_v_so = np.zeros(
 6    (kduq.NUM_POSTERIOR_SAMPLES, energy_lab.size, r.size), dtype=complex
 7)
 8central_volume_integral_analytic = np.zeros(
 9    (kduq.NUM_POSTERIOR_SAMPLES, energy_lab.size), dtype=complex
10)
11
12so_volume_integral_analytic = np.zeros(
13    (kduq.NUM_POSTERIOR_SAMPLES, energy_lab.size), dtype=complex
14)
15
16for i, kduq_sample in enumerate(tqdm(kduq_samples)):
17    for j, E in enumerate(kinematics.Elab):
18        cent, so, coul = kduq.calculate_params(projectile, target, E, *kduq_sample)
19        kduq_v_central[i, j, :] = kduq.central(r, *cent)
20        kduq_v_so[i, j, :] = kduq.spin_orbit(r, *so)
21
22        Vv, Rv, av, Wv, Rw, aw, Wd, Rd, ad = cent
23        jv = -woods_saxon_volume_integral(Vv, Rv, av)
24        jw = -woods_saxon_volume_integral(
25            Wv, Rw, aw
26        ) - woods_saxon_prime_volume_integral(Wd, Rd, ad)
27
28        central_volume_integral_analytic[i, j] = jv + 1j * jw
29
30        Vso, Rso, aso, Wso, Rwso, awso = so
31        so_volume_integral_analytic[i, j] = -thomas_volume_integral(
32            Vso, Rso, aso
33        ) - 1j * thomas_volume_integral(Wso, Rwso, awso)
 96%|████████████████████████████████████████████████████████████████████████████▏  | 401/416 [00:10<00:00, 40.37it/s]/home/kyle/umich/jitr/src/jitr/optical_potentials/kduq.py:467: RuntimeWarning: overflow encountered in exp
  d2 = d2_0 + d2_A / (1 + np.exp((A - d2_A3) / d2_A2))
100%|███████████████████████████████████████████████████████████████████████████████| 416/416 [00:11<00:00, 36.51it/s]
1A = target[0]
2central_volume_integral = (
3    (4 * np.pi) / A * np.trapezoid(kduq_v_central * r**2, r, axis=-1)
4)
5so_volume_integral = (4 * np.pi) / A * np.trapezoid(kduq_v_so * r**2, r, axis=-1)
1central_volume_integral_analytic *= 1 / A
2so_volume_integral_analytic *= (1 / WAVENUMBER_PION) ** 2 / A
1def get_ci(x):
2    return np.percentile(x.real, [16, 50, 84], axis=0) + 1j * np.percentile(
3        x.imag, [5, 50, 95], axis=0
4    )
1np.testing.assert_allclose(
2    central_volume_integral_analytic, central_volume_integral, atol=0.2
3)
 1l, m, u = get_ci(central_volume_integral)
 2plt.fill_between(
 3    energy_lab,
 4    l.real,
 5    u.real,
 6    alpha=0.3,
 7    color="tab:blue",
 8    hatch=r"\\",
 9    label=r"$J_V(E)/A$",
10)
11plt.fill_between(
12    energy_lab,
13    l.imag,
14    u.imag,
15    alpha=0.3,
16    color="tab:orange",
17    hatch=r"\\",
18    label=r"$J_W(E)/A$",
19)
20
21l, m, u = get_ci(central_volume_integral_analytic)
22plt.fill_between(energy_lab, l.real, u.real, alpha=0.3, color="tab:blue", hatch="//")
23plt.fill_between(energy_lab, l.imag, u.imag, alpha=0.3, color="tab:orange", hatch="//")
24
25plt.fill_between(
26    [200, 250],
27    [-500, -500],
28    [
29        0,
30        0,
31    ],
32    color="k",
33    alpha=0.1,
34    zorder=-1,
35)
36
37plt.legend()
38plt.xlabel(r"$E_{\text{lab}}$ [MeV]")
39plt.ylabel(r"$J(E)/A$ [MeV]")
40plt.title(f"${rxn.reaction_latex}$")
Text(0.5, 1.0, '$^{24} \\rm{Mg}(p,el)$')
../../_images/1ddb37947946feca765769b8b4b4146b203ddc9e735fe753fb4c4bce2b0ba82c.png
1np.testing.assert_allclose(so_volume_integral_analytic, so_volume_integral, atol=0.01)
 1l, m, u = get_ci(so_volume_integral)
 2plt.fill_between(
 3    energy_lab,
 4    l.real,
 5    u.real,
 6    alpha=0.3,
 7    color="tab:blue",
 8    hatch=r"\\",
 9    label=r"$J_{Vso}(E)/A$",
10)
11plt.fill_between(
12    energy_lab,
13    l.imag,
14    u.imag,
15    alpha=0.3,
16    color="tab:orange",
17    hatch=r"\\",
18    label=r"$J_{Wso}(E)/A$",
19)
20
21l, m, u = get_ci(so_volume_integral_analytic)
22plt.fill_between(energy_lab, l.real, u.real, alpha=0.4, color="tab:blue", hatch="//")
23plt.fill_between(energy_lab, l.imag, u.imag, alpha=0.4, color="tab:orange", hatch="//")
24plt.fill_between(
25    [200, 250],
26    [-18, -18],
27    [
28        12,
29        12,
30    ],
31    color="k",
32    alpha=0.2,
33    zorder=-1,
34)
35
36
37plt.legend()
38plt.xlabel(r"$E_{\text{lab}}$ [MeV]")
39plt.ylabel(r"$J(E)/A$ [MeV]")
40plt.title(f"${rxn.reaction_latex}$")
Text(0.5, 1.0, '$^{24} \\rm{Mg}(p,el)$')
../../_images/77b4e74b67524b2df31bde745a143ac0b15fa8178a9b07a85d77d3f6b4edf0ae.png