Mocking

Momenta

QEDbase.Mocks.MockMomentumType
struct MockMomentum{T} <: AbstractMockMomentum{T}

A concrete implementation of a four-momentum with immutable components.

Fields

  • E::T: Energy component.
  • px::T: Momentum component in the x-direction.
  • py::T: Momentum component in the y-direction.
  • pz::T: Momentum component in the z-direction.

Example

p = MockMomentum(10.0, 1.0, 2.0, 3.0)
source
QEDbase.Mocks.MockMomentumMutableType
mutable struct MockMomentumMutable{T} <: AbstractMockMomentum{T}

A concrete implementation of a four-momentum with mutable components.

Fields

  • E::T: Energy component.
  • px::T: Momentum component in the x-direction.
  • py::T: Momentum component in the y-direction.
  • pz::T: Momentum component in the z-direction.

Unlike MockMomentum, this struct allows modifying individual momentum components.

Example

p = MockMomentumMutable(10.0, 1.0, 2.0, 3.0)
QEDbase.setT!(p, 12.0)  # Modify energy
source

Model

QEDbase.Mocks.MockModelType
struct MockModel <: AbstractModelDefinition

A mock model definition used for testing and validation purposes.

This model serves as a placeholder within the framework, returning a predefined interaction type when queried.

Methods

  • QEDbase.fundamental_interaction_type(::MockModel): Returns the fundamental interaction type by calling _groundtruth_interaction_type().

Example

model = MockModel()
interaction_type = QEDbase.fundamental_interaction_type(model)
# Output: :mock_interaction
source
QEDbase.Mocks.MockModel_FAILType
struct MockModel_FAIL <: AbstractModelDefinition

A mock model definition intended to represent an incorrect or failing model.

This type can be used in tests to verify error handling and robustness of the framework when encountering invalid models.

Usage

MockModel_FAIL does not define fundamental_interaction_type and can be used to test behavior when a model lacks proper definitions.

Example

model_fail = MockModel_FAIL()
# This may trigger an error if the framework expects a valid interaction type.
source

Coordinate transformations

QEDbase.Mocks.MockCoordinateTrafoType
MockCoordinateTrafo <: AbstractCoordinateTransformation

A mock coordinate transformation that scales all momentum components by a factor of 2.

This transformation internally calls _groundtruth_coord_trafo.

Usage

This type is used as a coordinate transformation within the context of QEDbase, applying _groundtruth_coord_trafo to momenta.

Example

p = MockMomentum(rand(4))
trafo = MockCoordinateTrafo()
transformed_p = trafo(p)
source
QEDbase.Mocks._groundtruth_coord_trafoFunction
_groundtruth_coord_trafo(p::AbstractMockMomentum)::AbstractMockMomentum
_groundtruth_coord_trafo(psp::MockPhaseSpacePoint)::MockPhaseSpacePoint

Applies a coordinate transformation to a given momentum p by multiplying it by 2. If a phase space point is given, the transformation is applied to all momenta.

source

Cross Section/Probability

QEDbase.Mocks._groundtruth_incident_fluxFunction
_groundtruth_incident_flux(in_ps)

Mock implementation of the incident flux. Return the Minkowski square of the sum of the incoming momenta:

\[\begin{align} I = \left(\sum p_i\right)^2, \end{align}\]

where $p_i\in\mathrm{ps_in}$.

source
QEDbase.Mocks._groundtruth_is_in_phasespaceFunction
_groundtruth_is_in_phasespace(in_ps, out_ps)

Mock implementation of the phase space check. Return false if either the momentum of the first incoming particle is exactly zero(SFourMomentum), or if the momentum of the last outgoing momentum is exactly ones(SFourMomentum). Otherwise, return true.

source
QEDbase.Mocks._groundtruth_unsafe_probabilityFunction
_groundtruth_unsafe_probability(proc, in_ps, out_ps)

Mock implementation of the unsafe differential probability. Uses the test implementations of _groundtruth_matrix_element,_groundtruth_averaging_norm and _groundtruth_phase_space_factor.

source
QEDbase.Mocks._groundtruth_safe_probabilityFunction
_groundtruth_safe_probability(proc, in_ps, out_ps)

Mock implementation of the safe differential probability. Uses the test implementations of _groundtruth_is_in_phasespace and _groundtruth_unsafe_probability.

source
QEDbase.Mocks._groundtruth_unsafe_diffCSFunction
_groundtruth_unsafe_diffCS(proc, in_ps, out_ps)

Mock implementation of the unsafe differential cross section. Uses the test implementations of _groundtruth_incident_flux and _groundtruth_unsafe_probability.

source
QEDbase.Mocks._groundtruth_safe_diffCSFunction
_groundtruth_safe_diffCS(proc, in_ps, out_ps)

Mock implementation of the safe differential cross section. Uses the test implementations of _groundtruth_is_in_phasespace and _groundtruth_unsafe_diffCS.

source

Phase Space Layout

QEDbase.Mocks._groundtruth_out_momsFunction
_groundtruth_out_moms(Ptot,out_coords,mom_type)

Mock implementation for building outgoing momenta. Maps all components into four momenta and adds the last momentum via energy momentum conservation.

source

Phase Space Point

QEDbase.Mocks.MockProcess_FAIL_DIFFCSType

Mock process with no implemented interface except the incoming and outgoing particles. Should fail every usage except construction of itself and the respective phase space point for given four-momenta.

source

Random Mock Momenta

QEDbase.Mocks._rand_momentaFunction

Return a tuple of random four momenta, i.e. a random phase space point.

source

Return a vector of tuples of random four momenta, i.e. a collection of phase space points. n1 is the size of the phase space point, n2 is the number of points.

source
QEDbase.Mocks._rand_in_momenta_failing_mixFunction

Return a collection of incoming phase space points, where the first point is failing the phase space constraint, i.e. the first entry of the vector is invalid but the others pass. n1 is the size of the phase space point, n2 is the number of points.

source
QEDbase.Mocks._rand_in_momenta_failing_allFunction

Return a collection of incoming phase space points, where all points are failing the phase space constraint, i.e. their first entries are null momenta. n1 is the size of the phase space point, n2 is the number of points.

source
QEDbase.Mocks._rand_out_momenta_failing_mixFunction

Return a vector of outgoing phase space points, where the first point is failing the phase space constraint, i.e. the last entry of the vector is invalid but the others pass. n1 is the size of the phase space point, n2 is the number of points.

source
QEDbase.Mocks._rand_out_momenta_failing_allFunction

Return a vector of outgoing phase space points, where all points are failing the phase space constraint, i.e. their last entries are unit momenta. n1 is the size of the phase space point, n2 is the number of points.

source