Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perturbative Compton #40

Merged
merged 70 commits into from
May 16, 2024
Merged

Conversation

szabo137
Copy link
Member

@szabo137 szabo137 commented Feb 22, 2024

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

This includes the following variants

  • diff. probability and cross section on momenta
  • diff. probability and cross section on coordinates (electron restframe and spherical coordinates)

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

Todos

  • discuss where the spins/polarizations are stored: proc or phase space point (be aware of dispatch)
  • add total cross section
  • add unit test for total cross section
  • add unit tests for phase space point input

@szabo137 szabo137 force-pushed the dev-perturbative-compton branch from 341bc8e to 2d0bce3 Compare March 26, 2024 22:52
@szabo137 szabo137 added this to the Release-next milestone May 3, 2024
@AntonReinhard
Copy link
Member

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 szabo137 requested a review from AntonReinhard May 14, 2024 20:59
@szabo137
Copy link
Member Author

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).

src/models/perturbative_qed.jl Outdated Show resolved Hide resolved
src/patch_QEDbase.jl Show resolved Hide resolved
src/processes/one_photon_compton/one_photon_compton.jl Outdated Show resolved Hide resolved
test/processes/one_photon_compton/perturbative.jl Outdated Show resolved Hide resolved
test/processes/one_photon_compton/process.jl Outdated Show resolved Hide resolved
test/runtests.jl Show resolved Hide resolved
@szabo137 szabo137 marked this pull request as ready for review May 16, 2024 09:42
@szabo137
Copy link
Member Author

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 szabo137 changed the title [WIP] perturbative Compton perturbative Compton May 16, 2024
AntonReinhard
AntonReinhard previously approved these changes May 16, 2024
test/processes/one_photon_compton/perturbative.jl Outdated Show resolved Hide resolved
@szabo137
Copy link
Member Author

szabo137 commented May 16, 2024

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.

Copy link
Member

@AntonReinhard AntonReinhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@szabo137 szabo137 merged commit e84809c into QEDjl-project:dev May 16, 2024
4 checks passed
@szabo137 szabo137 added 06 - Feature-request Missing a feature or functionality X-scattering-process changes related to scattering processes X-Compton related to Compton scattering labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
06 - Feature-request Missing a feature or functionality X-Compton related to Compton scattering X-scattering-process changes related to scattering processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants