1. Scope
This note describes the minimum Breit-Wheeler physics model needed for the next OPALX benchmark.
We follow closely the CAIN ansatz i.e. manual and source code.
The goal is not yet a full tracking implementation. The immediate target is a host-side Monte Carlo and deterministic benchmark path that reproduces CAIN for the process
The first benchmark will follow the same strategy as the linear ICS work:
-
start from a fixed-geometry, unpolarized, linear process;
-
implement the core event kernel in;
-
validate deterministic and sampled spectra against CAIN;
-
delay bunch population and tracker integration until the kernel is trusted.
2. Linear Breit-Wheeler Kinematics in CAIN
CAIN’s linear generator LNBWGN uses two incoming photons:
-
a laser photon with energy \(W_1\) and direction \(\mathbf{n}_1\),
-
a high-energy photon with energy \(W_2\) and direction \(\mathbf{n}_2\).
Note: in a collider setup the laser photon is also a high-energy photon.
The opening-angle dependence enters through
The two-photon invariant used in CAIN is
Pair creation is kinematically allowed only if
This threshold appears directly in LNBWGN:
S0=2*W1*W2*(1-Z0)
IF (4*M**2.GT.S0) GOTO 900
In a head-on geometry, \(Z_0 = -1\), so the threshold reduces to
This is the cleanest geometry for the first benchmark.
CAIN constructs the center-of-momentum boost velocity from the two incoming photon momenta and then samples the final-state scattering variables in that frame.
The code introduces a transformed photon energy \(W\) and several auxiliary variables:
The random variable \(Y\) is used to generate the CM scattering angle through
The resulting Mandelstam-like combinations in the CAIN implementation are
CAIN then builds the angular kernel from
and
For unpolarized incoming photons, the acceptance weight reduces to the unpolarized part of the full CAIN expression.
3. OPALX Validation Path
-
✓ add
Physics::LinearBreitWheeler -
✓ implement threshold and invariant helpers
-
✓ implement deterministic spectra from the linear kernel
-
✓ fixed seed through
Options::seed -
✓ return one sampled electron-positron pair per accepted event
-
no tracker, no photon bunch population, no GPU path yet
-
✓ generate a CAIN reference deck in the same style as the linear-Compton notes
-
✓ compare OPALX and CAIN histograms first in 1D, later in 2D
4. Implemented OPALX Benchmark
The current OPALX implementation lives on the laser-element-1 branch. The
relevant files are:
-
~/git/OPALX-project.github.io/gamma-gamma/generate-gamma-gamma-results.sh -
~/git/cain/linear-breit-wheeler-head-on.i -
~/git/cain/generate-linear-breit-wheeler-results.sh
The benchmark remains deliberately narrow:
-
no tracker integration,
-
no bunch population,
-
no GPU path.
The validated observables are now:
-
✓ electron energy spectrum,
-
✓ positron energy spectrum,
-
✓ electron angle spectrum,
-
✓ positron angle spectrum,
-
✓ joint \(E\) vs. \(\theta\) spectrum for the electron,
-
✓ joint \(E\) vs. \(\theta\) spectrum for the positron.
Finite incoming-photon-beam benchmark:
-
✓ electron energy spectrum with Gaussian photon-beam divergence,
-
✓ positron energy spectrum with Gaussian photon-beam divergence,
-
✓ electron angle spectrum with Gaussian photon-beam divergence,
-
✓ positron angle spectrum with Gaussian photon-beam divergence.
The finite-photon-beam extension is still intentionally narrow:
-
the high-energy photon beam is sampled only in momentum space,
-
the reference beam axis is the head-on direction,
-
the angular spread is Gaussian with \(\sigma_{\theta x} = \sigma_{\theta y} = 1\,\mathrm{mrad}\),
-
the current published benchmark keeps the photon-beam relative energy spread at zero,
-
there is still no transverse position spread or laser-overlap weighting in the OPALX benchmark path.
4.1. Local Kernel Tests
The current OPALX implementation now exposes the same proposal-coordinate view used by the CAIN rejection sampler. Two helper functions are validated directly in the unit tests:
-
the map from the proposal variable \(z \in [-1,1\)] to the center-of-momentum scattering cosine \(\cos\theta\),
-
the corresponding unpolarized local angular weight in the same proposal coordinate.
This gives a direct check of the differential kernel itself, not only of its integrated or sampled consequences. The pointwise tests use an independent reference implementation of the CAIN-aligned auxiliary variables \(Y(z)\), \(s_m\), \(u_m\), and the local acceptance weight.
4.2. Finite-Photon-Beam Folding Algorithm
For the finite incoming-photon-beam benchmark, OPALX keeps the laser photon fixed and samples only the high-energy photon beam. For each event:
-
a high-energy photon direction is drawn from a Gaussian angular spread around the head-on reference axis,
-
the photon energy is either kept fixed or, in the extended code path, drawn from a Gaussian relative energy spread,
-
a per-event linear Breit-Wheeler sampling kernel is built from that sampled incoming photon state and the fixed laser photon,
-
the electron-positron event is generated with the same host-side rejection sampler used in the fixed-geometry benchmark,
-
the requested observable is histogrammed and compared to the matching CAIN reference.
The present published finite-photon-beam result validates only the divergence broadening. The next benchmark extensions are:
-
joint \(E\)--\(\theta\) maps for the finite incoming photon beam,
-
finite-photon-beam benchmarks with nonzero photon-beam relative energy spread.
5. Results of Code Comparison
The current CAIN-backed OPALX benchmark compares the linear unpolarized
process LASERQED BREITWHEELER, NPH=0 for a weak-field setup with
\(\xi = 0.25\). The benchmark observables are:
-
electron energy spectrum,
-
positron energy spectrum,
-
electron angle spectrum,
-
positron angle spectrum,
-
joint \(E\) vs. \(\theta\) maps for electron and positron,
-
and, in the extended benchmark, the same 1D observables for a finite incoming photon beam.
The first fixed-geometry comparison point uses:
-
head-on geometry,
-
\(E_\gamma = 0.5\,\mathrm{GeV}\),
-
\(\lambda_L = 1\,\mathrm{nm}\),
-
unpolarized photons.
With the current OPALX Monte Carlo benchmark and the stored CAIN references, the agreement is already tight.
Electron:
-
✓ energy spectrum: mean-energy difference about
0.09%, \(L_1\) about0.0179 -
✓ angle spectrum: mean-angle difference about
0.02%, \(L_1\) about0.0176 -
✓ joint \(E\)--\(\theta\) map: mean-energy difference about
0.10%, mean-angle difference about0.02%, \(L_1\) about0.0281
Positron:
-
✓ energy spectrum: mean-energy difference about
0.10%, \(L_1\) about0.0160 -
✓ angle spectrum: mean-angle difference about
0.08%, \(L_1\) about0.0173 -
✓ joint \(E\)--\(\theta\) map: mean-energy difference about
0.10%, mean-angle difference about0.08%, \(L_1\) about0.0266
So the present benchmark already supports both 1D and 2D CAIN-backed regression coverage for the linear unpolarized kernel.
Finite incoming-photon-beam point:
-
head-on reference geometry,
-
\(E_\gamma = 0.5\,\mathrm{GeV}\),
-
\(\lambda_L = 1\,\mathrm{nm}\),
-
Gaussian photon-beam divergence with \(\sigma_{\theta x} = \sigma_{\theta y} = 1\,\mathrm{mrad}\),
-
zero photon-beam energy spread.
Finite-photon-beam agreement:
Electron:
-
✓ energy spectrum: mean-energy difference about
0.12%, \(L_1\) about0.0536 -
✓ angle spectrum: mean-angle difference about
2.49%, \(L_1\) about0.0784 -
✓ joint \(E\)--\(\theta\) map: mean-energy difference about
0.11%, mean-angle difference about2.77%, \(L_1\) about0.4416
Positron:
-
✓ energy spectrum: mean-energy difference about
0.13%, \(L_1\) about0.0535 -
✓ angle spectrum: mean-angle difference about
2.89%, \(L_1\) about0.0696 -
✓ joint \(E\)--\(\theta\) map: mean-energy difference about
0.07%, mean-angle difference about2.58%, \(L_1\) about0.4230
Finite-photon-beam plus energy-spread agreement:
Electron:
-
✓ energy spectrum with photon-beam relative energy spread
1.0e-3: mean-energy difference about0.55%, \(L_1\) about0.0573 -
✓ angle spectrum with photon-beam relative energy spread
1.0e-3: mean-angle difference about2.36%, \(L_1\) about0.0822
Positron:
-
✓ energy spectrum with photon-beam relative energy spread
1.0e-3: mean-energy difference about0.55%, \(L_1\) about0.0601 -
✓ angle spectrum with photon-beam relative energy spread
1.0e-3: mean-angle difference about2.59%, \(L_1\) about0.0721
The finite-photon-beam angle benchmarks are intentionally windowed to \(0 \le \theta \le 6\,\mathrm{mrad}\), so the stored CAIN angular histograms do not integrate to exactly one inside that clipped range.
The fixed-geometry head-on comparisons are shown for the electron in Fixed-geometry head-on outgoing electron energy spectrum., Fixed-geometry head-on outgoing electron polar-angle spectrum., and Fixed-geometry head-on outgoing electron joint Ee---θe- spectrum., and for the positron in Fixed-geometry head-on outgoing positron energy spectrum., Fixed-geometry head-on outgoing positron polar-angle spectrum., and Fixed-geometry head-on outgoing positron joint Ee+--θe+ spectrum..
The finite-photon-beam comparisons with Gaussian divergence and zero energy spread are shown for the electron in Finite-photon-beam outgoing electron energy spectrum., Finite-photon-beam outgoing electron polar-angle spectrum., and Finite-photon-beam outgoing electron joint Ee---θe- spectrum., and for the positron in Finite-photon-beam outgoing positron energy spectrum., Finite-photon-beam outgoing positron polar-angle spectrum., and Finite-photon-beam outgoing positron joint Ee+--θe+ spectrum..
The finite-photon-beam plus energy-spread comparisons are shown for the electron in Finite-photon-beam plus energy-spread outgoing electron energy spectrum., Finite-photon-beam plus energy-spread outgoing electron polar-angle spectrum., and Finite-photon-beam plus energy-spread outgoing electron joint Ee---θe- spectrum., and for the positron in Finite-photon-beam plus energy-spread outgoing positron energy spectrum., Finite-photon-beam plus energy-spread outgoing positron polar-angle spectrum., and Finite-photon-beam plus energy-spread outgoing positron joint Ee+--θe+ spectrum..
The overlap-restricted comparisons are shown for the electron in Overlap-restricted outgoing electron energy spectrum. and Overlap-restricted outgoing electron polar-angle spectrum., and for the positron in Overlap-restricted outgoing positron energy spectrum. and Overlap-restricted outgoing positron polar-angle spectrum..
6. Build and Run
The preferred one-shot workflow is run from the docs tree:
cd ~/git/OPALX-project.github.io/gamma-gamma
./generate-gamma-gamma-results.sh \
--opalx-build ~/git/opalx-laser/build_openmp
This top-level driver:
-
builds the OPALX gamma-gamma benchmark targets,
-
runs the inverse-Compton and Breit-Wheeler unit/regression suites,
-
regenerates the CAIN and OPALX benchmark data for both notes,
-
republishes the comparison figures, and
-
renders the gamma-gamma note pages.
If only the Breit-Wheeler assets need to be refreshed, use:
cd ~/git/cain
./generate-linear-breit-wheeler-results.sh \
--opalx-build ~/git/opalx-laser/build_openmp
This script:
-
runs the CAIN decks
~/git/cain/linear-breit-wheeler-head-on.i,~/git/cain/linear-breit-wheeler-finite-photon-beam.i,~/git/cain/linear-breit-wheeler-finite-photon-beam-energy-spread.i, and~/git/cain/linear-breit-wheeler-overlap.i, -
regenerates the stored CAIN histogram references in
~/git/opalx-laser/unit_tests/Physics/data, -
runs the OPALX benchmark executable
LinearBreitWheelerBenchmarkfor fixed-geometry, finite-photon-beam, finite-photon-beam-plus-energy-spread, and overlap cases, -
regenerates the 1D and 2D comparison plots in
~/git/cain/reference-data.
The script expects:
-
a built OPALX benchmark executable in the supplied build directory,
-
a CAIN executable at
~/git/cain/CAIN-build/cain, unless overridden by--cain-bin.
The relevant unit-test targets are:
cmake --build ~/git/opalx-laser/build_openmp \
--target TestLinearBreitWheeler TestLinearBreitWheelerSpectrum LinearBreitWheelerBenchmark -j4
~/git/opalx-laser/build_openmp/unit_tests/Physics/TestLinearBreitWheeler
~/git/opalx-laser/build_openmp/unit_tests/Physics/TestLinearBreitWheelerSpectrum
7. References
-
CAIN source parser:
src/rdlqed.f -
CAIN Breit-Wheeler runtime loop:
src/lsrqedbw.f -
CAIN linear Breit-Wheeler generator:
src/lnbwgn.f -
CAIN nonlinear Breit-Wheeler generator:
src/nlbwgn.f -
CAIN weighted event insertion:
src/lbwevent.f -
CAIN manual: User’s Manual of CAIN
Appendix A: CAIN Structure
CAIN separates Breit-Wheeler physics into three layers.
-
LASERQED BREITWHEELERis parsed insrc/rdlqed.f. -
NPH = 0selects the linear Breit-Wheeler model. -
NPH >= 1selects the nonlinear model.
-
The laser-particle loop is handled by
src/lsrqedbw.f. -
Local laser geometry and power density are obtained from
LSRGEO. -
The linear event generator is
LNBWGN. -
The nonlinear event generator is
NLBWGN. -
If an event happens, the produced electron and positron are inserted by
LBWEVENT.
-
Linear Breit-Wheeler:
src/lnbwgn.f -
Nonlinear Breit-Wheeler:
src/nlbwgn.f -
Weighted particle insertion:
src/lbwevent.f
For the first OPALX benchmark only the linear event kernel is needed.