QEDjl-project / QEDprocesses.jl

[WIP]: QEDprocesses.jl: Modeling of scattering processes for QED.jl
https://qedjl-project.github.io/QEDprocesses.jl/stable/
MIT License
1 stars 3 forks source link

Model and Process interface #11

Closed szabo137 closed 1 year ago

szabo137 commented 1 year ago

This PR provides an implementation of the model and process interface, which is also combined with an interface for differential and total cross-sections.

The model definition interface

In this PR, the model interface describes only static information, i.e. there is only one un-parameterized base type and a convenient interface function:

AbstractModelDefinition
fundamental_interaction_type(::AbstractModelDefiniton)

The process definition interface

In this PR, the process interface describes only static information about a scattering process. Here, a scattering process should be seen in a generic way, which forms a physical scattering process, if it is combined with a model definition above.

The process definition interface is defined as

AbstractProcessDefinition     #base type for processes
incoming_particles(::AbstractProcessDefinition) # return tuple of incoming particle-like  
outgoing_particles(::AbstractProcessDefinition) # return tuple of outgoing particle-like 

Here, particle-like stands for subtypes of AbstractParticleType, so the static instances of particles.

Additionally, in this PR, the following process related functions are implemented

number_incoming_particles(::AbstractProcessDefinition) # number of incoming particles-like
number_outgoing_particles(::AbstractProcessDefinition) # number of outgoing particles-like

Cross sections

Based in the interface funcitons for process and model definition, this PR also provides an interface for differential and total cross sections. This interface is definied my the following two functions:

    _differential_cross_section(
        proc_def::AbstractProcessDefinition,
        model_def::AbstractModelDefinition,
        initPS::AbstractVector{T},
        finalPS::AbstractVector{T},
    ) where {T<:QEDbase.AbstractFourMomentum}

    _total_cross_section(
        proc_def::AbstractProcessDefinition,
        model_def::AbstractModelDefinition,
        initPS::AbstractVector{T},
    ) where {T<:QEDbase.AbstractFourMomentum} end

where initPS and finalPS are vectors containing the four-momenta of the incoming and outgoing particles, respectively. The leading _ indicates, that the functions are not exported, and that no input-validation is applied. Additionally, there are versions of _differential_cross_section and _total_cross_section, which evaluate the respective quantity on a set of phase space points, i.e. a matrix of four-momenta, where the columns represent the momenta of the incoming or outgoing particles and the rows represent the different phase space points. Currently, only serial execution of the respective loops is implemented.

Testing

The unit-tests for the interface have the following structure:

Final remarks

The README.md is updated to include a small section on how-to build the documentation locally.

szabo137 commented 1 year ago

@tjungni you might also have a look at this.

SimeonEhrig commented 1 year ago

@szabo137 Do we want to merge this PR first or #12 ?

szabo137 commented 1 year ago

@szabo137 Do we want to merge this PR first or #12 ?

I think we should merge this one first, and then #12.