QEDjl-project / QEDprocesses.jl

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

Proposal for PhaseSpacePoint improvement #63

Closed AntonReinhard closed 1 month ago

AntonReinhard commented 1 month ago

Proposal for a rework of the PhaseSpacePoint, according to Issue #58

I did a lot of type magic with recursive variadic templates to find out type information and get functions perfectly type stable. Constructing phase space points is now always type stable and takes a maximum of ~11ns for me when constructing from momenta.

Some of the tests are failing for now because some of the interfaces currently don't expect tuples from the PSP implementation. It might make sense to fix this in #59

AntonReinhard commented 1 month ago

I just noticed I'm still missing the new implementation of spin(...) / polarization(...) of a PSP. I'll add this later

szabo137 commented 1 month ago

@AntonReinhard Seems like something broke with this one. Maybe it is better to wait with this one until #59 is merged. After that, a rebase of this one seems easy.

AntonReinhard commented 1 month ago

Should be building fine for now @szabo137

I'm not sure if it might actually be a good idea to merge this before #59 instead of the other way around, since there are slight changes in how the PSP behaves. For example, I added a momenta(::PSP, ::DIR) function to get an SVector of the momenta, because momentum.(psp.in_particles) now returns a tuple and not a vector. It doesn't do any copies for this and only takes about 5ns on my machine for a 2-length vector but it might still not be the best approach.

Also, I noticed that there is no public interface for a process' spins/polarizations, which means it's now impossible to get a particle's spin.

AntonReinhard commented 1 month ago

I have tentatively merged #59 into this, but keeping it local for now. I'm playing around with it now and am noticing that the broadcast in momenta(...) prevents everything from working on the GPU (both ROCm and CUDA).

AntonReinhard commented 1 month ago

@szabo137 Should be ready to merge now