QEDjl-project / QEDprocesses.jl

[WIP]: QEDprocesses.jl: Modeling of scattering processes for QED.jl
MIT License
1 stars 3 forks source link

perturbative Compton #40

Closed szabo137 closed 1 month ago

szabo137 commented 4 months ago

This PR adds one photon Compton scattering described in perturbative QED.

This includes the following variants

All implementations are done for arbitrary combinations of spins and polarizations.

Todos

AntonReinhard commented 1 month ago

What's the general state of this now? Trying to rebase to dev seems to be a nightmare, but merging dev back into this branch should be pretty easy. Other than that, some things need to be adjusted now to the PhaseSpacePoints and ParticleStateful types I believe.

szabo137 commented 1 month ago

What's the general state of this now? Trying to rebase to dev seems to be a nightmare, but merging dev back into this branch should be pretty easy. Other than that, some things need to be adjusted now to the PhaseSpacePoints and ParticleStateful types I believe.

I followed your advice and merged dev into this one. Now this should be up-to-date and ready for discussion. There are some open questions we could think about first (see the description box above).

szabo137 commented 1 month ago

As we discussed offline, we want to merge this PR without connecting to the phase space points, and then we want to open a separate PR for the change of the diffCS interface to phase space points (see #57).

@AntonReinhard I added the total cross section, so there are no open todos. I think this is ready for final review.

szabo137 commented 1 month ago

Certainly, there was a bug in _incident_flux which was only present in Julia versions below 1.10.

TL;DR: In the tested versions (1.6 to 1.9), the function prod(::Vector{AFM}) consuming a vector of four-vectors returned Union{Float64,<:StaticArray}, which is clear since the compiler does not know anything about the number of elements passed to prod. However, since for Compton we know that length(in_ps)==2, we can just index into the vector and use the mul function.

Edit: now everything should be ready. Edit2: The bug was actually caught by the @inferred macro, which we should use more often in the unit tests.