Mocking
Momenta
QEDbase.Mocks.MockMomentum — Type
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)sourceQEDbase.Mocks.MockMomentumMutable — Type
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 energysourceModel
QEDbase.Mocks.MockModel — Type
struct MockModel <: AbstractModelDefinitionA 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_interactionsourceQEDbase.Mocks.MockModel_FAIL — Type
struct MockModel_FAIL <: AbstractModelDefinitionA 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.sourceQEDbase.Mocks._groundtruth_interaction_type — Function
_groundtruth_interaction_type()::SymbolReturns the type of interaction associated with the mock setup.
sourceCoordinate transformations
QEDbase.Mocks.MockCoordinateTrafo — Type
MockCoordinateTrafo <: AbstractCoordinateTransformationA 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)sourceQEDbase.Mocks._groundtruth_coord_trafo — Function
_groundtruth_coord_trafo(p::AbstractMockMomentum)::AbstractMockMomentum
_groundtruth_coord_trafo(psp::MockPhaseSpacePoint)::MockPhaseSpacePointApplies 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.
Cross Section/Probability
QEDbase.Mocks._groundtruth_incident_flux — Function
_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}$.
sourceQEDbase.Mocks._groundtruth_matrix_element — Function
_groundtruth_matrix_element(in_ps, out_ps)Mock implementation for a matrix elements. Returns a list of three complex numbers without any physical meaning.
sourceQEDbase.Mocks._groundtruth_averaging_norm — Function
_groundtruth_averaging_norm(::Type{T}, proc)Mock implementation of the averaging norm. Returns the inverse of the sum of all external particles of the passed process.
sourceQEDbase.Mocks._groundtruth_is_in_phasespace — Function
_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.
QEDbase.Mocks._groundtruth_phase_space_factor — Function
_groundtruth_phase_space_factor(in_ps, out_ps)Mock implementation of the phase space factor. Return the inverse of the product of the energies of all external particles.
sourceQEDbase.Mocks._groundtruth_unsafe_probability — Function
_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.
QEDbase.Mocks._groundtruth_safe_probability — Function
_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.
QEDbase.Mocks._groundtruth_unsafe_diffCS — Function
_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.
QEDbase.Mocks._groundtruth_safe_diffCS — Function
_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.
QEDbase.Mocks._groundtruth_total_probability — Function
_groundtruth_total_probability(in_ps::AbstractVector)Mock implementation of the total cross section. Return the Minkowski square of the sum the momenta of all incoming particles.
sourcePhase Space Layout
QEDbase.Mocks._groundtruth_in_moms — Function
_groundtruth_in_moms(in_coords,mom_type)Mock implementation for building incoming momenta. Maps all components into four momenta.
sourceQEDbase.Mocks._groundtruth_out_moms — Function
_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.
sourcePhase Space Point
QEDbase.Mocks.MockProcess — Type
MockProcess(rng,incoming_particles,outgoing_particles)sourceQEDbase.Mocks.MockProcessSP — Type
QEDbase.Mocks.MockProcess_FAIL_ALL — Type
Mock process with no implemented interface. Should fail every usage except construction.
sourceQEDbase.Mocks.MockProcess_FAIL_DIFFCS — Type
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.
sourceRandom Mock Momenta
QEDbase.Mocks._rand_momenta — Function
Return a tuple of random four momenta, i.e. a random phase space point.
sourceReturn 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.
sourceQEDbase.Mocks._rand_in_momenta_failing — Function
Return a random phase space point that is failing the incoming phase space constraint, i.e. the first entry of the phase space is the null momentum.
sourceQEDbase.Mocks._rand_out_momenta_failing — Function
Return a random phase space point that is failing the outgoing phase space constraint, i.e. the last entry of the phase space is the unit momentum.
sourceQEDbase.Mocks._rand_in_momenta_failing_mix — Function
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.
sourceQEDbase.Mocks._rand_in_momenta_failing_all — Function
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.
sourceQEDbase.Mocks._rand_out_momenta_failing_mix — Function
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.
sourceQEDbase.Mocks._rand_out_momenta_failing_all — Function
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