-
Notifications
You must be signed in to change notification settings - Fork 3
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
Coordinate-based evaluation of differential cross-sections and probabilities #39
Conversation
8476468
to
962a6d6
Compare
…ial cross sections
…ed several bugs in the coordinate based implementation
0c66862
to
d08c741
Compare
Co-authored-by: Tom Jungnickel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a lot of code duplication for not too much gain. If I understand correctly, the idea is to allow a new, different type of representation of the FourMomenta as input. So why not make the existing functions generically accept any AbstractPhasespaceElement
and then a function (or multiple functions) that convert an AbstractPhasespaceElement
into a specific representation?
The interface of this function could even completely generically allow to specify a target type, so if more types might be added later, the only thing that needs to be added are the relevant conversion function implementations.
This function would then be the identity function if it's already the correct representation, and otherwise do whatever it needs to do. This would be the _generate_incoming_momenta()
I believe.
Also, it might make sense to have this function only work on a single element and then broadcast where necessary, seems more flexible.
As we discussed offline, I think this is a great idea, which would avoid a lot of code duplication. However, I think it would be necessary to develop a full-fledged conversion system first, where any given phase-space element type can be converted into four-momenta as the default phase-space element type. Therefore I suggest proceeding with this PR as it is, but open an issue to address your idea. I think adding the phase-space conversion system later will not break the API, which means it should be fine to add it later. Edit: The respective issue is #49 |
6a0023f
to
51b583b
Compare
@AntonReinhard could you please check is something is left over here? If not, we could proceed with this one 😊 |
Problem description
Currently, differential cross-sections and probabilities can only computed on given momenta. However, in some cases, one wants to calculate those quantities directly on given phase-space parameterizations, i.e. independent coordinates.
Suggested solution
One might use multiple dispatch on the element type of the incoming and outgoing phase-space of
differential_cross_section
andprobability
to determine if coordinates or momenta are passed in. Furthermore, it seems sufficient to use the following implementation ofdifferential_cross_section
as the actual interface functionThe coordinate-based implementation of the differential cross-section should then fall back onto the momentum-based implementation by a phase-space generator, e.g.
which returns the respective vector or matrix of
SFourMomentum
. Using that, the default implementation of thedifferential_cross_section
readswhich works generically.
For the evaluation of cross sections and probabilities on sets of phase space points, the
implementation is the same for momenta and coordinates. Therefore, this PR introduces a general phase space element type:
AbstractPhaseSpacePoint = Union{Real, AbstractFourMomentum}
.TODO