-
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
Computation and process setup interface #14
Conversation
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.
Some pariticles are still hiding
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.
Sorry for being maybe a little pedantic 😅
I added a description to this PR and therefore removed the draft status. |
fixed bug caused by the pariticles typo Co-authored-by: Tom Jungnickel <140055258+tjungni@users.noreply.github.com>
fixed typos and formulations flaws Co-authored-by: Anton Reinhard <s1509337@msx.tu-dresden.de>
…_assert_valid_input
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.
I reacted to every concern, please feel free to comment on my replies.
Not at all, this review was very good and helped a lot to improve the PR! |
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.
A few more typos
Fixed typos in docstrings Co-authored-by: Tom Jungnickel <140055258+tjungni@users.noreply.github.com>
…s and unit tests accordingly
…unit tests accordingly
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.
From my side everything is resolved.
…input the derivation; adjusted the tests and docstrings accordingly
…sert_valid_input covers all necessary usecases
fixed comments on comments Co-authored-by: Anton Reinhard <s1509337@msx.tu-dresden.de>
With this PR, the concept of computation setups is introduced, and general as well as functionality related to scattering processes is implemented.
Description of the problem
One of the main tasks of this package is the computation of quantities like differential and total cross-section for given scattering processes and a given set of parameters. Usually, these quantities depend on a fixed set of initial parameters, and their value needs to be calculated for large amounts of input data. For example, the differential cross-section of a process depends on the generic scattering process, the compute model, and all sorts of initial parameters, which might be physical (e.g. energy scales) or technical (e.g. integrator settings). Once initialized, the differential cross-section is still a function of the external momenta of a scattering process. Therefore, for a given set of input data, i.e. momenta, one needs to be able to compute the respective value of the differential cross-section using the given setting.
Suggested solution
The initial parameters for a given quantity will be collected in a setup, which, once initialized, describes the initialized quantity, i.e. the quantity with fixed initial parameters. The actual computation can be performed by calling a member function
compute
on the setup object and the respective input arguments. The implementation described below defines an interface, that unifies this approach and extends the computation workflow by adding input verification and post-processing steps.Implementation details
The root type for all setups is
AbstractSetup
, for which the following interface functions are defined:None of those functions is exported, but they need to be added for a concrete implementation of
AbstractSetup
. For all functions, except_compute
, a generic fallback is implemented, which uses a default implementation for the respective function. Based on the interface functions, the actual compute function is implemented aswhere internally, the following steps are performed:
_input_validation
_compute
_post_computation
Additionally, based on
AbstractSetup
, a specialized version of setups related to the combination of scattering processes and compute models is implemented:AbstractProcessSetup<:AbstractSetup
, where the following functions are added to the setup interface:Based on them, the following functions are delegated to the respective type parameter:
Final remarks
The possibilities for functionality based on the setup definition above are not exhausted by the set of interface functions defined with this PR. For example, the pre-and post-processing could be enhanced by more fine granular structures. Furthermore, the initialization step of a setup could have its input validation. This is currently delegated to the users, who implement a setup by themself. Finally, the set of functions defined on
AbstractProcessSetup
and delegated to the process and model, could be extended if necessary. However, all the points above should be considered only if they are necessary, which implies opening dedicated issues if any.