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

Model and Process interface #11

Merged
merged 21 commits into from
Sep 21, 2023

Conversation

szabo137
Copy link
Member

@szabo137 szabo137 commented Sep 15, 2023

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:

  • a full test implementation of every interface
  • a partitial test implementation of every interface (dedicated for failing the interface, the are indicated by an appended _FAIL)
  • a test for every interface function
  • a test for every derived function
  • a test for every break of the interface

Final remarks

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

@szabo137 szabo137 marked this pull request as draft September 15, 2023 01:41
@szabo137
Copy link
Member Author

@tjungni you might also have a look at this.

@szabo137 szabo137 added the 06 - Feature-request Missing a feature or functionality label Sep 18, 2023
@szabo137 szabo137 linked an issue Sep 19, 2023 that may be closed by this pull request
@szabo137 szabo137 force-pushed the dev-model_and_process_interface branch from 7bc8385 to a11a87b Compare September 20, 2023 08:56
Uwe Hernandez Acosta and others added 7 commits September 20, 2023 11:20
Co-authored-by: Tom Jungnickel <[email protected]>
added process interface and tests

added combined interface

added differential cross section interface for abstract processes and models, as well as included tests of the interface

replaced the hard and soft interfaces by just the registration of the function name. Added the respective doc string to indicate the implementations to be for the interfaces.

added doc strings to the functions of the process and model interface. Added an section to the README.md on how-to build the documentation locally.
@szabo137 szabo137 force-pushed the dev-model_and_process_interface branch from a11a87b to 531ed7f Compare September 20, 2023 09:32
@szabo137 szabo137 changed the title [WIP] Model and Process interface Model and Process interface Sep 20, 2023
@szabo137 szabo137 marked this pull request as ready for review September 20, 2023 09:35
@SimeonEhrig
Copy link
Member

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

SimeonEhrig
SimeonEhrig previously approved these changes Sep 20, 2023
Copy link
Member

@tjungni tjungni left a comment

Choose a reason for hiding this comment

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

Mostly typos

src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
test/interfaces/process_interface.jl Outdated Show resolved Hide resolved
test/interfaces/process_interface.jl Outdated Show resolved Hide resolved
test/interfaces/process_interface.jl Outdated Show resolved Hide resolved
src/interfaces/process_interface.jl Outdated Show resolved Hide resolved
test/interfaces/process_interface.jl Outdated Show resolved Hide resolved
@szabo137
Copy link
Member Author

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

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

Copy link
Member

@tjungni tjungni left a comment

Choose a reason for hiding this comment

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

Everything is fixed

@tjungni tjungni merged commit ebc5f4c into QEDjl-project:dev Sep 21, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Process and Model interface
3 participants